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
4
votes
3 answers

CSV to Dictionary, matching up column titles and row values?

I feel quite embarrassed to ask this, but I simply cannot get my desired results. I have a CSV file which looks like this: Col_Title_1|Col_Title_2|Col_Title_3|Col_Title_4|Col_Title_5 Value_1 | Value_2 | Value_3 | Value_4 | Value_5 I want…
user2439970
  • 129
  • 1
  • 11
4
votes
1 answer

C# Re-populating Dictionary after clearing/setting it to null

Ive got a dictionary filled with KeyValuePairs (equalityMap) which I'm using to populate a combobox (comBox1). I want to call the function below as a part of initializing comBox1. Then, I have a selectedValueChanged event from another combobox…
Mark Gifford
  • 135
  • 1
  • 9
4
votes
3 answers

Get the sub array in a bidimensional array having a particular key/value pair

I have a large PHP array, similar to: $list = array( array( 'id' = '3243' 'link' = 'fruits' 'lev' = '1' ), array( 'id' = '6546' 'link' = 'apple' 'lev' = '2' ), …
Irfanullah Jan
  • 3,336
  • 4
  • 24
  • 34
3
votes
2 answers

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…
KPexEA
  • 16,560
  • 16
  • 61
  • 78
3
votes
1 answer

compiler error in accessing first and second of pair inside a map in c++

What is the problem in line of code inside inner for loop if else block?? Accessing first and second of a pair inside a map is creating problems #include #include #include using namespace std; int main() { …
Suyash_14
  • 43
  • 5
3
votes
1 answer

How can I iterate through an array list of pairs to retrieve the value of a specified key?

I have been trying to write a function Retrieve in Java that accepts a key and returns a value from an array list of Pairs. Any suggestions? ArrayList> set_of_pairs = new ArrayList>(); public void insert(K key, V value)…
Xenon
  • 311
  • 5
  • 12
3
votes
2 answers

dynamically define key name for which the value needs to be identified

I have a keyvalue pair list some thing like this List subs = new List(); subs.Add(new Subscriptions() { Id = 1, Name = "ABC" }); subs.Add(new Subscriptions() { Id = 1, Name = "DEF" }); I can search against…
FizzaTahir
  • 57
  • 4
3
votes
1 answer

How to rename Key for QMap?

I have this QMap myTable like this (1, {something0}) (3, {something1}) (5, {something2}) (8, {something3}) How can I change Key for myTable with first key begin from 0? (0, {something0}) (1, {something1}) (2, {something2}) (3,…
songvan
  • 369
  • 5
  • 21
3
votes
1 answer

maximum ratio of a min subset and a max subset of size k in a collection of n value pairs

So, say you have a collection of value pairs on the form {x, y}, say {1, 2}, {1, 3} & {2, 5}. Then you have to find a subset of k pairs (in this case, say k = 2), such that the ratio of the sum of all x in the subset divided by all the y in the…
Jontahan
  • 113
  • 8
3
votes
3 answers

ORACLE - JSON To Key Value Pair Table

Is there any way to obtain a table with key/value pairs from a CLOB Json Column? The idea here is to get these values, on a dynamic way. Because the CLOB column does not always contain the same structure. I've created a function that does this,…
bmvr
  • 817
  • 2
  • 9
  • 25
3
votes
1 answer

How to set the values to: KeyValuePair,int>

C# I am using a KeyValuePair as a key in my main KeyValuePair. Here is my problem: If I have "KeyValuePair", the declaration would be as following: KeyValuePair varName = new KeyValuePair("String 1","String 2"); How do…
3
votes
5 answers

List of KeyValuePair to be Distinct

I have a list of KeyValuePair which its values are list too such as List>> ListX = new List>>(); ListX.Add(new KeyValuePair>("a",list1)); ListX.Add(new…
user1947393
  • 153
  • 4
  • 18
3
votes
2 answers

PHP function to edit configuration file

I'm looking for a PHP function that I can use to edit key/value pairs in a text file. What I want to do (PHP): changeValue(key, bar); and have in setings.txt: key = foo key2 =foo2 Change to: key = bar key2 = foo2 What I got so far (not…
PeteM
  • 51
  • 6
3
votes
6 answers

How to return Multiple List<> values from a single function?

trying to return 2 List values from a single function I am using this code:- public KeyValuePair encrypt(string password) { List key = new List(); List code = new List(); /* do…
user3651521
3
votes
3 answers

C# How to create a generic List of KeyValuePair

I have created a list of KeyValuePair to populate the content as the data for the HttpClient. List> keyValues = new List>(); keyValues.Add(new KeyValuePair("email",…
Yasitha
  • 2,233
  • 4
  • 24
  • 36