keyvalue

Is there any character limitation in Dictionary Keys?

In .NET can I use any string as a dictionary key? This is part of a templating engine and I'm planning allow users to add their custom headers and values. Headers will be something like "Value of X" or "Summary of Analyse & XYZ Reports", I'm worried if they would get an exception in a rare character or something like that. I assume th...

What is the C interface to Lua for accessing a table's key/value pairs?

In Lua, using the C interface, given a table, how do I iterate through the table's key/value pairs? Also, if some table table members are added using arrays, do I need a separate loop to iterate through those as well or is there a single way to iterate though those members at the same time as the key/value pairs? ...

Is there a library or framework for setting preferences from within an iPhone application?

Using the Settings.app on the iPhone isn't that hard. In fact Xcode does the most of the work for you. Just add the Settings.bundle to your project and there you have it for nearly no cost. At the moment I'm developing an application for the iPhone which requires the user to fill out several "forms", mostly key-value pairs, some sliders...

What's the best way to manage real-time configuration variables with Ruby on Rails?

I'm aware of YAML and plugins like rails-settings, but neither of these is useful for configuration settings that need to be changed in real time. For instance, say I have MAX_ALLOWED_REGISTERED_USERS set at 2000, but I want to up it to 2300. With a typical "configuration" or YAML solution, this would involve changing a config file and ...

How to "convert" a Dictionary into a sequence in F#?

How do I "convert" a Dictionary into a sequence so that I can sort by key value? let results = new Dictionary() results.Add("George", 10) results.Add("Peter", 5) results.Add("Jimmy", 9) results.Add("John", 2) let ranking = results ??????? |> Seq.Sort ?????? |> Seq.iter (fun x -> (... some function ...)) ...

Distributed Key-Value Data Store with Offline Access (Static Partitioning)

Need to be able to set server(s) that replicate all information, as a master data store that has all the data. Also need servers that specifically store/replicate certain data, available in local LANs, so that when the internet connection goes down, they can still access their local data. Under normal circumstances, the clients will ac...

Is there a lightweight, embeddable, key/value database? (something like diet couchdb)

Hello, I was wondering if there was a lightweight, embeddable, key/value database out there. Something like a lightweight Couchdb (RESTful, key/value, etc) where you just send it the key and it responds with appropriate values. Thanks! ...

What's the difference between System.Collections, System.Collections.Specialized, and System.Collections.Generic in .NET?

What is the major difference between the three? Right now, I want to create a key/value pair using both string/string respectively. All three seem to have options I can use. Edit: I just want to create a simple hash table - nothing really complex. ...

best way to store .net session data

Hi, I'm investigating for a free, high available, high performance solution for caching or storing .net session data (for a high traffic website). I don't want to use a db (db is the bottleneck on traffic increase). There're some key/value stores, but as far as I know they don't support .net objects. And there're some distributed or r...

A UML way to describe a key/value datastore ?

Hi all, I'm currently writing the documentation for a database using berkeleyDB. I'd like to draw UML diagram describing the keys and the values of the datastores. Is there a 'standard' way to describe this kind of database using UML ? Thanks ...

Ideas to manage IP and Ports in Key/Value format?

I'm looking for a good and fast way to manage IP addresses and ports in a file. Sort of a DB Table that has 2 columns: IP and Port, but in a file, without using a DB. It has to support adding, deleting and updating. I don't care from concurrency. Thanks. ...

Search/Queries in Collections (Java)

I've created many Geodata objects (name,postalCode,lat,lon). Now I want to put them into a collection to search for different entries later. Everything should happen objectOriented/in-memory, so there shouln't be a need for a relational database. Such a Query looks like: Find lat and lon by name or plz Find objects between LAT1,L...

How to remove elements from a generic list while iterating around it?

I am looking for a better 'pattern' for working with a list of elements which each need processed and then depending on the outcome are removed from the list. You can't use .Remove(element) inside a foreach (var element in X)... you also can't use for (int i = 0; i < elements.Count(); i++) and .RemoveAt(i). Previously I have done craz...

The default for KeyValuePair

I have an object of the type IEnumerable<KeyValuePair<T,U>> keyValueList, I am using var getResult= keyValueList.SingleOrDefault(); if(getResult==/*default */) { } else { } How to check whether getResult is the default, in case I can't find the correct element? I can't check whether it is null or not, because KeyValuePair is ...

Are there any stable and production quality nosql datastores ?

Are there are production quality nosql stores that I can use on a production system. I have looked at cassandra, tokyodb, couchdb etc but none of them seem to be ready for deployments on production like environments. I am talking thousands of requests per minute and lots of reads/writes/updates. My only concern is speed and service times...

C# Linq Result ToDictionary Help

I have a lambda expression that gets results from a Dictionary. var sortedDict = (from entry in dctMetrics orderby entry.Value descending select entry); The expression pulls back the pairs I need, I can see them in the IDE's debug mode. How do I convert this back a dictionary of the same type as ...

How do I add multiple keys and values to an NSMutableDictionary without using an array?

I know you could add all the keys to an array and add it to one side of the dictionary but I'm curious how you can add or insert a value at a certain point in the dictionary. The way i have it now it I believe it just keeps overwriting the last entries to make room for the new one: NSMutableDictionary *bookmarks = [[NSMutableDictionary ...

Java properties: Is there a way a key can include a blank character?

Hi, we are getting properties, we can not influence, out of a database and want to access them by a key/value mapping. We are facing the problem, that one of the property keys includes a blank character. foo bar = barefoot This is - correctly - interpreted as follows key: foo value: bar = barefoot Is there a way to include the bla...

Cassandra time series data

We are looking at using Cassandra to store a stream of information coming from various sources. One issue we are facing is the best way to query between two dates. For example we will need to retrieve an object between datetime dt1 and datetime dt2. We are currently considering the created unix timestamp as the key pointing to the act...

Create a Dictionary in xaml?

Pseudo example: <Window> <Window.Tag> <x:Dictionary KeyType="{x:Type sys:String}" ValueType="{x:Type sys:Int32}"> <sys:DictionaryEntry Entry="{sys:DictionaryEntry Key0, 000}"/> <sys:DictionaryEntry Key="key1" Value="111"/> <sys:DictionaryEntry> <sys:DictionaryEntry.Key> <sys:String>Key...