Remove key from dictionary - parse-platform

I want to remove key from dictionary in Parse cloud code, as we can achieve this by calling removeObjectForKey: in objective-C. Sorry as this is very simple, but I am new to js, and also not able to find out solution for this.

As I have found the answer, so I am posting it for others, who want to do the same thing.By following command, we can do this
delete dictionary[key];

Related

is there an easy way to inspect/edit values stored in nsIPrefBranch?

I'm looking for a way to quickly edit and view my extension credential list (I use nsIPrefBranch to store it).
Is there any easy way to do that? I tried to look where that's stored but couldnt find it.
Many thanks!!
Got it,
It's inside %appdata%\Mozilla\Firefox\Profiles{ID}\prefs.js

How to edit a key with Win32::TieRegistry?

I was doing a script with Perl and I came up with the following problem: I have to edit the name of a key in the Windows registry.
I'm using the module Win32::TieRegistry and searched at the documentation for any function, but didn't find it. I know that it should be easy, but can't find the way to do that. Any tip?
Thanks!
You can't change the name of a key in a hash, but you can copy the value to a new key and delete the old one.
$hash{new} = delete $hash{old};
This should work the same for a tied hash, assuming the implementation is sane.

How to make the cities/countries dropdown like facebook does?

See the screenshot here:
I'd like the user to just type a city or country name and the autocompleter will show suggested items.
How should I start for creating it?
Are there any API(s) or web services for me to call?
Where can I find the database of all cities/countries in the world?
I think this would be the best database for your situation, check it out:
http://www.geodatasource.com/cities-free.html
You first need a autocomplete plugin.
I recommend to use the jQuery-Ui Auto Complete Plugin.
The database could as example be this, but eventually try to search a bit for yourself.
There was already a question on stackoverflow about a database for cities of the world.
A simple text file with all cities may also be this.
There are very much of those libraries, but you have to chose the right one for you.
My solution may not be the best, but it's a starting point:
Google a list with all countries (ISO-Standard), paste it into a txt-file. Then you can simply read that file with PHP an create a select menu with the contents of the file.
It does not incorporate the cities, but maybe it helps you in some way.

How to use the MultipleTextOutputFormat class to rename the default output file to some meaningful names?

After the reduce phase in Hadoop, I wanted the output file names to be something meaningful depending on the input key value. However I'm not successful on following the example on "Hadoop: The Definative Guide" which used MultipleTextOutputFormat to do this. The reason is that it's based on old API and it doesn't work on the new API ?
Can anybody hint on the solution or point me to the relevant documentation ?
You are probably right. Most things that worked in the old API don't always work in the new one.
There is a "new way" of doing this now, called MultipleOutputs.

howto get Builder to create <tag></tag> instead of <tag/>

I,m using Builder::XmlMarkup to create xml. I want to create a tag without content because the api force me to create this.
If I use a blog
xml.tag do
end
I get what i need
<tag></tag>
but I want it shorter
xml.mytag
this gives me
<mytag/>
but i want
<mytag></mytag>
what do I have to pass as option.
regards Kai
Just pass empty string as a parameter. xml.mytag('')
Why do you want <mytag></mytag> instead of <mytag/>? Since the output is XML, downstream applications should not know or care about the difference.
According to the Infoset spec (Appendix D point 7), "The difference between the two forms of an empty element: <foo/> and <foo></foo>" is not represented in the XML Information Set.
This doesn't answer your "how" question, but if you discover that you actually don't need to do what you're trying to do, it may save you from a difficult and unnecessary wild goose chase.
ok empty string is nice, another one-line-way is empty block I found out.
xml.mytag{}

Resources