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
2
votes
2 answers

Type problems with tuples & streams

I have my own implementation for a few tuples, here's the gist of the code for pair: public class Pair extends Tuple implements Serializable{ ... public Pair(A a,B b){ this.a=a; this.b=b; } ... public
Seppo420
  • 2,041
  • 2
  • 18
  • 37
2
votes
3 answers

How to get Key, Value from dictionary when value is a list

so basically I have a dictionary where I have a key, and then the value is a list that contains strings.. so for example.. {"key1", list1} list1 = [Value 1 Value2, Value3] And I have multiple keys and therefore values that have lists. I want to…
vbaid
  • 89
  • 1
  • 8
2
votes
3 answers

Formatting the join rdd - Apache Spark

I have two key value pair RDD, I join the two rdd's and I saveastext file, here is the code: val enKeyValuePair1 = rows_filter6.map(line => (line(8) ->…
Abu
  • 21
  • 3
2
votes
2 answers

How to create a Java Map with unmodifiable keys?

In java, how should I create a Map that has unmodifiable keys, while keeping the values modifiable. I'd like to hand this Map through an interface for someone else to add/change the Map values, but not be able to change…
abaines
  • 224
  • 1
  • 5
  • 11
2
votes
2 answers

Select values from C# KeyValuePair

Code: var list = new List>(); list .Add(new KeyValuePair(1, new string[] { "1", "One"})); list .Add(new KeyValuePair(2, new string[] { "2", "Two"})); list .Add(new KeyValuePair
Code.me
  • 281
  • 3
  • 13
2
votes
4 answers

Cast A Dictionary after a select to a KeyValue Pair

So I have A dictionary (Employees2Name) Of int => (some class) which I need to turn into a sorted list of key value pairs of int => (some property in the class) I have this working fine which is the good news. It just seems like I'm doing an extra…
user4071723
2
votes
2 answers

For Each loop on an array of List(Of KeyValuePair(Of String, Integer))

I'm having problems doing a For Each loop on a "List(Of KeyValuePair(Of" collection. I'm passing a ParamArray to a Function ParamArray args() As List(Of KeyValuePair(Of String, Integer)) I'm then trying to do a For Each on the Collection For Each…
JA12
  • 61
  • 1
  • 4
  • 12
2
votes
1 answer

Defining key-value pairs from schema to json

I am trying to define an object with key value pairs from a JSON schema and validating it at: Json Schema Validator but I am having no joy as there does not seem to be instructions to do so in all the JSON schema sites I have looked up. My object…
HGB
  • 2,157
  • 8
  • 43
  • 74
2
votes
4 answers

What is the difference between Tuple and keyvaluepair

I am not understanding the difference between tuple and keyvaluepair. i was looking into this article http://www.dotnetperls.com/tuple-keyvaluepair. it seems like tuple is better than keyvaluepair but some of the developers saying strictly do not…
sundar rajan
  • 61
  • 2
  • 10
2
votes
1 answer

Uncaught TypeError: Cannot use 'in' operator to search for '123' in

Hi i have converted json object to string by using JSON.stringify now i want key value pair in array for eg. key =en value =Anglais and so on... here is jsfiddle code var data…
skhurams
  • 2,133
  • 7
  • 45
  • 82
2
votes
0 answers

How to detect a cycle in set of key value pairs where some values can be keys

Detecting a cycle in Hashtable. Consider you are given a set of key value pairs and these are stored in Hashtable. It is possible that a value can also be a key. If all this key value pairs are stored in Hashtable and given a key we should be able…
ashy143
  • 169
  • 11
2
votes
1 answer

Getting all possible combinations of a List of KeyValue Pairs in C#

I have a key value pair like this: var accounts = new List>(); and the contents of accounts looks like…
Mohammad Sepahvand
  • 17,364
  • 22
  • 81
  • 122
2
votes
2 answers

Setting IEnumerable KeyValuePair

I have 2 IEnumerable> collections: _myObject.Trees - contains all the TreeTypes with values of 0. newTrees - can contain any number of TreeTypes with any int value. Now what I want to do is simple but I've been trying…
user2439970
  • 129
  • 1
  • 11
2
votes
0 answers

Android Bluetooth printer print without pairing

i am using this code for printing: public class BPrinterActivity extends Activity implements Runnable { protected static final String TAG = "TAG"; private static final int REQUEST_CONNECT_DEVICE = 1; private static final int REQUEST_ENABLE_BT =…
CoronaPintu
  • 1,865
  • 2
  • 17
  • 20
2
votes
2 answers

Sort a file based on key value pair at a different position in each line

I have a text file that has a bunch of key value pairs. The key value pairs are not in the same order in each line, and only my sequence key is guaranteed to be in each line. How can I sort the file in linux based on a key value? e.g. key1=blah…
brercia
  • 171
  • 1
  • 6