Questions tagged [keyvaluepair]

Defines a key/value pair that can be set or retrieved.

Defines a key/value pair that can be set or retrieved. The most common key/value pair used is HTTP GET paramaters which take the form of:

key1=value1&key2=value2&key3=value3

This syntax makes this type of storage very open-ended as you continue to append the next key/value pair to the end of the string.


In the mscorlib library (from MSDN)

Namespace: System.Collections.Generic

Type Parameters

TKey

The type of the key.

TValue

The type of the value.

Read more and view examples at MSDN

440 questions
-1
votes
3 answers

Suggested structure to maps some strings to some other strings

In my console application I have one hundred county codes and their names. For example: "01" : "Floyd" "02" : "Wabash" When my program uses the values, it reads "01","02"...and I want to get "Floyd", etc... This list won't grow in future, I am just…
-1
votes
1 answer

Any reason for URLEncodedUtils.parse return List< NameValuePair >

https://hc.apache.org/httpcomponents-client-4.3.x/httpclient/apidocs/org/apache/http/client/utils/URLEncodedUtils.html#parse(java.net.URI,%20java.lang.String) why not return Map< String, List< String > > if it returns Map, user can easily query by…
zxshi
  • 357
  • 3
  • 8
-1
votes
3 answers

How to explicitly define an associative array with key-value pairs in PHP?

I'm having an array called $enquiries_labels. It's a static array. So, I've defined it as follows: $enquiries_labels = array("New Enquiry","Retail Enquiry","Feedback","Payment Query","Package Query","Test Query"); But instead of this I want to…
PHPLover
  • 1
  • 51
  • 158
  • 311
-2
votes
3 answers

ComboBox KeyValuePair Binding WPF - Display Member

i got a quick question about binding the DisplayMember of my ComboBox. I have a list with a KeyValuePair for example: 1, Value1; 2, Value2; 3, Value3; My SelectedValuePath is set to Key which is in my example "1". Now i want my DisplayMemberPath to…
-2
votes
1 answer

How to convert the JSON data into Key Value Pair using Typescript

A JSON data has 2 arrays (categories & applets) as shown below. Each applet can belong to many categories as per the data. categories = ['Investments', 'Operations', 'Performance']; applets = [ { name: 'Performance Snapshot', categories:…
Mr.V
  • 17
  • 2
-2
votes
1 answer

Index error when adding Array to SortedDictionary

I've been working on this code but have yet to see the results. It's giving me error message "Index was outside the bounds of the array". I read other posts with the same error but I couldn't fully understand nor apply most of the recommendations.…
Koda
  • 37
  • 5
-2
votes
5 answers

Keep the most recent KeyValuePairs in a SortedList

I have a SortedList that adds KeyValuePairs every 10 min. I'm trying to keep the most recent 10 KeyValuePairs and remove all prior pairs but what I'm doing isn't working. Below I attached my code with explanation along each step. Any help is greatly…
Koda
  • 37
  • 5
-2
votes
1 answer

How to loop through hard-coded key-value pairs line by line and parse each pair into key and value?

I am looking for a Windows Batch (Cmd.exe) counterpart of the Unix bash code shown below. Key-value pairs are given by HereDoc. The pairs are repeatedly read by the read command associated with the while command. IFS=$';' defines a semicolon (;)…
Flot8d4ea
  • 7
  • 2
-2
votes
2 answers

storing key value pairs in an array in javascript

I have 2 arrays namely, configdata = ["assignee", "shortDesc"]; ticketarray = ["Tom","testDesc"]; I want to store the values as a key value pair in another array, something like this: ticketData = ["assignee":"Tom","shortDesc":"testDesc"]; Kindly…
Smruti
  • 11
  • 1
  • 1
-2
votes
2 answers

KeyValue Pair C#

I am trying to figure how to work with a list of KeyValuePairs in C#. I would use dictionaries but they do not allow for duplicate values. Also the lookup which also i cannot figure out how to write the syntax. I have seen other solutions but i am…
panoskarajohn
  • 1,846
  • 1
  • 21
  • 37
-2
votes
1 answer

HashMap individual value retrieval in Java

I have created a HashMap listed below: Map> hm1 = new HashMap>(); List hmValues1 = new ArrayList(); and using this below method to add values from a file, where the specified values of…
pankaj kashyap
  • 372
  • 2
  • 4
  • 13
-2
votes
3 answers

How to initialize an object from a string containing key value pairs in C#

The object has 139 fields; the string initializer may have some or all of these fields. It is formatted like this: "FirstName":"Bart","LastName":"Simpson","Company":"Fat Tony's","Address":"55 Maple Drive" etc. I could just look for the fields like…
Ron
  • 2,435
  • 3
  • 25
  • 34
-2
votes
3 answers

Setter for a key value pair List object

I am stumped with this one and hoping to see if this could be a good way to solve my issue. I'll first explain how the program works. I have a class that is simply a key value pair: public class KeyValuePair { private final String name; …
user1158745
  • 2,402
  • 9
  • 41
  • 60
-3
votes
1 answer

Ruby on Rails: how can I make a form/controller for a model which holds a key/value pair?

I have a model called configurations which holds key value pairs in my database to store options for the website. The schema looks like this: create_table "configuration", force: :cascade do |t| t.string "key", limit: 255 t.string "value",…
-3
votes
2 answers

How to pass null into Pair in Java

I'm new to Java. I'm creating an app in android, and I created a method that takes a varargs of Pair. But I can't seem to pass null in. Is this possible? Method: makeJson(Pair... keyValuePairs)…
user1422348
  • 345
  • 1
  • 7
  • 23
1 2 3
29
30