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
vote
0 answers

How do I add both a form and a set key value pair into MongoDB using Python?

I've got a system set up where a user can create an object (a jam) using a form. I also want to add another key-value pair to this form on creation: jam_creator : session['username'], but I can't seem to figure out how to go about this using…
Res210
  • 25
  • 1
  • 7
1
vote
3 answers

How to deserialize JSON to IList> with whitespaces in key?

I have a big problem with deserializing my JSON to an object. It should be deserialized to IList> the problem is that the keys have white spaces. "spec": { "SOMETHING WITH SPACES" : "10" etc. …
Skundlony
  • 61
  • 8
1
vote
0 answers

Accessing the key of a KeyValuePair just returns the string "Key"

I have a list of KeyValuePairs (string, bool). I am iterating over the list using a for loop, but when I try and access the key of the kvp at the current index, all I get is the string "Key". The KeyValuePair is {"DD", false} Sorry if this is super…
Bigtingz92
  • 129
  • 1
  • 15
1
vote
1 answer

Object as Map Key in Typescript

I wanted to create a Map object with an object as key and a number as value in Typescript. I defined the map object as follows: myMap: Map; myObj: MyObj; and when I try to add a pair to this map object: this.myMap[myObj]=1; It tells…
oksuzlerOmer
  • 125
  • 1
  • 2
  • 11
1
vote
2 answers

declaring a Tuple of KeyValuePair in C#

For the sake of my code I need a tuple which has 2 components both of which are KeyValuePairs. However, for the life of me I can't even figure out how to declare this thing. I had it working with normal strings Tuple t = new…
user5494969
  • 171
  • 3
  • 14
1
vote
0 answers

Why is it necessary to use = and avoid single-quotation marks when working with dictionaries?

def build_profile(first, last, **user_info): """Build a dictionary containing everything we know about a user.""" profile = {} profile['first_name'] = first profile['last_name'] = last for key, value in user_info.items(): …
Nacka
  • 5
  • 1
  • 6
1
vote
3 answers

How can I convert a NameValueCollection to a KeyValuePair

I want to convert a NameValueCollection to a KeyValuePair. Is there a way to do this easily for just a single value in a NameValueCollection? I have this right now but it seems kind of verbose: private KeyValuePair
DannyD
  • 2,732
  • 16
  • 51
  • 73
1
vote
0 answers

System.InvalidOperationException: 'The type System.Collections.Generic.List`1 may not be used in this context.'

I have an asmx which returns data to a client. In the asmx I have the following method : [WebMethod] [XmlInclude(typeof(CustomField))] public List GetData(InitializeRequest request) { return…
Bart Schelkens
  • 1,235
  • 4
  • 21
  • 45
1
vote
1 answer

Convert List to List

I'm currently working on a .NET Framework 4.7.2 application. From a web service response, I need to parse JSON data to a List>>. This datatype is important for the further program flow, I cannot change…
timhorton42
  • 241
  • 5
  • 15
1
vote
2 answers

create "pair key=value" file with SAS datastep

I have to create a file from a dataset that is JSON style but without CR between each variable. All variables have to be on the same line. I would like to have something like that : ID1 "key1"="value1" "key2"="value2" ..... Each key is a column of a…
chezleon
  • 29
  • 7
1
vote
1 answer

How to extract key from datasource of combobox

Below is code where I am trying to extract key from combobox. If you look in to foreach (int value in comboBox1.ValueMember), I want to compare value 90 with all keys added in datasource of combobox. How to do that? namespace SetComboBoxEnum { …
DipakM
  • 37
  • 6
1
vote
5 answers

How do I convert key value paired list into table with columns using AWK?

I need to convert a dataset from a key value paired list (informix dbaccess output) into a columned csv. I'm fairly certain this can be done easily with awk or sed. UPDATE The solution needs to be a single line response. I am using NSH (which is…
27560
  • 93
  • 7
1
vote
2 answers

Is it possible to override "find" and "erase" methods of boost::bimaps::bimap.left? How to do it?

I have following: struct foo_and_number_helper { std::string foo; uint64_t number; }; struct foo_and_number {}; struct bar {}; using my_bimap = boost::bimaps::bimap< …
Lukas Salich
  • 959
  • 2
  • 12
  • 30
1
vote
2 answers

using named parameters for variables in sql

my code is not working im doing something wrong , is it possible to use named parameters for the key. I am trying to make it to where i can assign a value to the variable part in my sql"where username = aaron " without hard coding it, if not how…
1
vote
2 answers

Getting Key Values from user input within python dict

I have hundreds of IP cameras that I have connected to an amazon ec2 instance, which performs NAT so the cameras use the Public IP of the instance and can be switched between cameras based on Port specified. I am trying to Write a simple python…
Alec M
  • 23
  • 1
  • 4