key-value

append multiple values for one key in Python dictionary

I am new to python and I have a list of years and values for each year. What I want to do is check if the year already exists in a dictionary and if it does, append the value to that list of values for the specific key. So for instance, I have a list of years and have one value for each year: 2010 2 2009 4 1989 8 2009 7 ...

python: access multiple values in the value portion of a key:value pair

I am trying to perform a calculation on multiple values in the value portion of a list of key:value pairs. So I have something like: [('apples', ['254', '234', '23', '33']), ('bananas', ['732', '28']), ('squash', ['3'])] I'm trying to create a list of y-values that are the averages of those integers above. What I'm trying to write i...

ANSI C hash table implementation with data in one memory block

Hello, I am looking for an open source C implementation of a hash table that keeps all the data in one memory block, so it can be easily send over a network let say. I can only find ones that allocate small pieces of memory for every key-value pair added to it. Thank you very much in advance for all the inputs. EDIT: It doesn't necess...

Redis access from MS Excel?

I would like to use redis to query data from commandline, scripts, web and from within spreadsheets. I can find good examples for all but spreadsheets... I don't quite know where to start for access from a MS Excel spreadsheet, though. Google is failing me. Please let me know how you would suggest doing this, thanks! p.s. for those u...

How to send javascript key-value pair to server?

I have a key value pair which i want to send to server. e.g: var obj = {'item1': true, 'item2': false, ........}; I want to send this information to server by ajax call. But at server side i am unable to get individual value. At server side i am getting "object" as string. I am using jQuery for making an ajax call. Can anyone please g...

PHP: Can an array have an array as a key in a key-value pair?

I'm getting an "Illegal offset type" for this array: public static $CATS_AND_TYPES = array( // Statement Administration array( self::CAT_STATEMENT_ADMIN => "Document Administration" ) => array( self::TYPE_STATEMENTS_LOADED => "Documents Loaded", self::TYPE_STATEMENTS_REMOVED => "Documents Removed...

ASP.NET - How to properly split a string for search?

I'm trying to build a search that is similar to that on Google (with regards to exact match encapsulated in double quotes). Let's use the following phrase for an example "phrase search" single terms [different phrase] Currently if I use the following code Dim searchTermsArray As String() = searchTerms.Split(New String() {...

Embeddable open-source key-value storage with liberal license

Is there any open-source document-oriented key-value map/reduce storage that: is easily embeddable (Yes, it is possible to embed, let's say CouchDB, but it might be a pain to take the whole erlang machine onboard and I just don't feel good about it bounded on some port when my app is running) does not keep the whole map in RAM (Hello, ...

What is the type of "keys" in JavaScript?

I bumbed into one of those moments when I just lose the focus and start wondering on a silly question: var a = { b: "value" } What is the typeof 'b' and I don't mean the typeof "value", but the actual Key labeled as b? background: I started wondering about this when I had to create a key which is a string: var a = { "b": "value"...

How to correctly use HashMap?

HashMap savedStuff = new HashMap(); savedStuff.put("symbol", this.symbol); //this is a string savedStuff.put("index", this.index); //this is an int gives me the warning: HashMap is a raw type. References to generic type HashMap<K,V> should be parameterized ...

key=value asp.net mvc with url get?

a little problem for ya. in master page i have a search input and link: <input type="text" value="Searche..." name="txtSearche" id="txtSearche" style="vertical-align: middle; height:14px;" /> <%= Html.ActionLink("search", "Search", "Search", new{ searche = "txtSearche???what is here"}, null) %> how can i write value in url "value" fr...

Ensuring the right kind of operations on the right types

I want to write a program to load a key-value store with lots of random data of random types. Assuming the key-value store supports three types ( strings, lists and sets ) there are operations that are valid for a set (say, union) that are not valid for strings. #define SUBSTR 0 // substring, only on strings #define SEARCH 1 // search...

PHP question about multidimensional array

My array looks like this: Array ( [Bob] => Red [Joe] => Blue ) But it could be any number of people, like this: Array ( [Bob] => Red [Joe] => Blue [Sam] => Orange [Carla] => Yellow) Basically I want PHP to take this array and echo it so that it comes out looking like: Bob - Red Joe - Blue Sam - Orange Carla - Yellow I know I nee...

HTML5 localStorage design questions

What is the best way to store object data in HTML5's localStorage. I haven't worked much with key value storage. In my research i've seen a few different approaches. example data: var commands = [ {invokes: 'Window', type: 'file', data: '/data/1'}, {invokes: 'Action', type: 'icon', data: '/data/2'}, {invokes: 'Window', type: 'fi...

How can I tell if the value of any array key is the value I'm looking for?

I have an array of arrays like this: $cart = Array ( [0] => Array ( [TypeFlag] => S [qty] => 2 [denom] => 50 [totalPrice] => 100 ) [1] => Array ( [TypeFlag] => V [qty] => 1 [denom] => 25 [totalPrice] => 25 ) [2] => Array ( [TypeFlag] => C [qty] => 1 [denom] => 25 [totalPrice] => 25 ) ) Is there any way, short of looping throug...

Hi, Could anybody recommend me KeyValue Store supporting C#?

Hi, I am looking up keyvalue stores that support C#, but i found that most of them are implemented by Java. Could anybody recommend some to me? It would be super if it is very light-weight, i.e., appearing as a library. thanks!! ...