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
1 answer

PySpark: Convert a pair RDD back to a regular RDD

Is there any way I can convert a pair RDD back to a regular RDD? Suppose I get a local csv file, and I first load it as a regular rdd rdd = sc.textFile("$path/$csv") Then I create a pair rdd (i.e. key is the string before "," and value is the…
1
vote
1 answer

How to search duplicated key in KeyValuePair list and delete the earlier key value

I've a KeyValuePair list use to store some info from incoming message. List> qInfoTempList = new List>(); qInfoTempList.Add(new KeyValuePair(eventInfo.ReferenceId,…
YWah
  • 571
  • 13
  • 38
1
vote
1 answer

how to use keyvaluepairofstringdouble returned from c# webservice

I have a web-service method that returns a List> However when I use use that method in a service reference, the object it returns is List I cannot figure out how to use this.
colobusgem
  • 473
  • 1
  • 4
  • 18
1
vote
2 answers

How to convert int array to List>?

I need to convert an integer array to a list of KeyValuePair where the string can be an empty string. What would be an efficient and elegant way to do this? So from this: int[] ints = new int[] { 1, 2, 3 }; to this: List>…
crazysnake
  • 451
  • 2
  • 7
  • 18
1
vote
1 answer

Highchart.js drilldown adding to data dynamicaly without hardcoding.

I want to add a fully populated array or keyvalue paired object to the drill down data section but when I do so it either only shows me the first value in the array or just does not display any information at all. Is there a way of populating this…
Don6l
  • 13
  • 4
1
vote
1 answer

MongoDB document model code value type data in C# driver

I have a relational table that stores key-value data in the below structure. KEY VARCHAR(10) Value-Text VARCHAR(50) Value-Date DATETIME Value NUMERIC So for any given key, there will be only one Value column used. This is not a good…
1
vote
5 answers

Search for key value pair from the string and output only the matching record

I have a large file in terms of a string containing key value pairs. I am looking for a proper way to search for the value pair where the value is 'apple' (can be both upper or lower) and output only related key value pair if found. For ex.…
Skyline
  • 53
  • 8
1
vote
2 answers

How to convert an array to JSON format

I have a string array, e.g. p[]={"John","Kevin","Lex"} I want to convert it to JSON so that the data appears in key-value pair like: { "name":"John", "name":"Kevin" } How can I achieve that?
Rakeh Sahu
  • 47
  • 3
  • 11
1
vote
1 answer

unordered_map pair of values c++

I am trying to use the unordered_map in C++, such that, for the key I have an int, while for the value there is a pair of floats. But, I am not sure how to access the pair of values. I am just trying to make sense of this data structure. I know to…
TMath
  • 47
  • 1
  • 8
1
vote
1 answer

Spark-Java : Display join RDD

I am trying to join two pairRDDs as show below and whereas lat1 : K,V -> k-integer , V- Double lat2 : K,V -> k-integer , V- Double JavaPairRDD> latlong = lat.join(long); Am assuming the new RDD will be …
swagath001
  • 79
  • 1
  • 4
  • 9
1
vote
2 answers

How to print the information out of a KeyValuePair in C#?

I have a list of KeyValuePair. I would like to print the details from T, but I do not know its type in order to do a cast. For example the value stored in T could be a Student, a Person, a Movie, etc, and I would like to print out the…
kikitza
  • 13
  • 3
1
vote
1 answer

Using Array Key => Value to track count of items

I basically have a script where I pull a list of machines, then pull all of the inventory currently inside of them. If the machine has more than 1 of the same type of inventory (drives for example) then my current code just appends them into a long…
user470760
1
vote
0 answers

Convert unknown KeyValuePair object to KeyValuePair

I have an object that is of type KeyValuePair , but the actual types of T1,T2 are only known at run time. I would like to extract Key and Value of that object but I do not know how. Could you please help? (The idea is as below but it does not…
Nghia Le
  • 535
  • 2
  • 6
  • 16
1
vote
1 answer

Redis Hash: How to Query on both Key and Value

I want to store key-value pairs(T1,T2) in Redis. Both key and value are unique. I want to be able to query on both key and value, i.e. HGET(Key) should return corresponding Value and HGET(Value) should return corresponding Key. A trivial approach…
Vijay Kansal
  • 809
  • 12
  • 26
1
vote
1 answer

Rename Key/Value in KeyValuePair/Dictionary

At more and more places all over my code, I am using KeyValuePair and Dictionary in the following way: The KeyValuePair contains primary eMail and UPN name, and I always fail to memorize which one is in Key and which…
Alexander
  • 19,906
  • 19
  • 75
  • 162