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

Efficient way to access constant key value data

I am wanting to store key - value data and be able to access it in an efficient manner. Basically: I have a custom object(EquipmentObj) and w/ in that object is a property called "DeviceType". In the constructor of the object, I am passing a string…
Botonomous
  • 1,746
  • 1
  • 16
  • 39
0
votes
1 answer

Spark view engine with array of namevaluepair

I would like to use the Spark view engine (DirectUse) for email templating. So I have dived into the Spark examples (EmailOrTextTemplating). But what I want is to use an array of NameValuePair(String name, object value) objects in the viewdata as a…
ZxCvBnM
  • 277
  • 3
  • 14
0
votes
2 answers

How do I stop [ ] appearing when inserting the value of a KeyValuePair into a list control?

As it stands I'm using a Dictionary to store answers to a question in the following format:- Destination: A1 - Warehouse A2 - Front Office A3 - Developer Office A4 - Admin Office B1 - Support A1, A2 etc are unique identifiers used to select…
Kobunite
  • 365
  • 8
  • 23
0
votes
1 answer

Use key's value as key in key-value pair in a Javascript function param

Possible Duplicate: Use key’s value as key in key-value pair in Javascript As a followup to Use key's value as key in key-value pair in Javascript function parameter. How can you use the value of a key-value pair as the key in a different…
Eugene
  • 10,957
  • 20
  • 69
  • 97
0
votes
3 answers

Use key's value as key in key-value pair in Javascript

How can you use the value of a key-value pair as the key in a different key-value pair in javascript? I'd like to do the following: var gizmos = {gizmo1: "G1"}; var things = {gizmos.gizmo1: "T1"}; So that things essentially equals: var things =…
Eugene
  • 10,957
  • 20
  • 69
  • 97
0
votes
3 answers

Converting the value of a string to a variable of KeyValuePair

I was doing something like this : foreach( KeyValuePair reader in _readerDict ) { var selectedReader = reader; var antenna1 = selectedReader.Value.Antenna1IsEnabled; var antenna2 = selectedReader.Value.Antenna2IsEnabled; var…
Khairul
  • 191
  • 2
  • 14
0
votes
2 answers

Can I access an associative array by numerical index?

I would like to know if it is possible to get the x-value position (ie 2nd) in a variable variable array reference. the code below works for the 1st array but not the 2nd. // WORKS FINE // $my1stArray= array( 'red', 'green', 'blue'); $var_1st =…
art vanderlay
  • 2,341
  • 4
  • 35
  • 64
0
votes
1 answer

I want to add query string variables to JSON Name/Value Pairs

I have a .asp page with a url of page.asp?id=33&album=ourcookout page.asp calls a file.js In the file.js there is a line under a function url: "post_file.php", How can I get my id=33 and album=cookout on the end of the JSON Name/Value Pairs. The end…
GTK
  • 1
  • 2
0
votes
3 answers

How to assign key to bitmap using HashMap?

In global definition I have declared: private HashMap map = new HashMap(); In other part of my code, I connect to server and get my required info. Two of then are image address (url) and image id. after that I…
Hesam
  • 52,260
  • 74
  • 224
  • 365
-1
votes
2 answers

how separate string into key/value pair in dart?

how can a string be separated into key/value pair in dart? The string is separated by a "=". And how can the pair value be extracted? main(){ var stringTobeSeparated = ['ab = cd','ef = gh','ld = kg']; Map map = {}; …
Mala
  • 89
  • 9
-1
votes
4 answers

How to extract values from list and store it as dictionary(key-value pair)?

I need to extract 2 values from this list of dictionary and store it as a key-value pair. Here I attached sample data..Where I need to extract "Name" and "Service" from this input and store it as a dictionary. Where "Name" is Key and corresponding…
Pepper
  • 65
  • 1
  • 8
-1
votes
1 answer

Convert hashtable back to string data in efficient way

I am trying to convert a hashtable back to key-value pair in an efficient way. Currently I am using this: $kv = "" $hash.GetEnumerator() | ForEach { $kv += "$($_.Name)=$($_.Value)" } Isn't there any way to directly convert hash table to key value…
Wasif
  • 14,755
  • 3
  • 14
  • 34
-1
votes
1 answer

Is it possible to optimize this Python code?

Given a list of integers and a single sum value, return the first two values (parse from the left please) in order of appearance that add up to form the sum. Example: sum_pairs([11, 3, 7, 5], 10) # ^--^ 3 + 7 = 10 == [3,…
-1
votes
2 answers

Find Closest Keys In KeyValuePair (C#)

I'm trying to find the closest group of elements that qualify in sequence compared to an existing dictionary. The goal is to take first group of elements that contain string values in a specific order. In my case, I may have a larger list, that…
Kieran Ojakangas
  • 495
  • 4
  • 18
-1
votes
2 answers

jq map_values on very large file

I'm using jq to find patterns in a very large JSON file (500MB+) with the following flat object structure: { "prop1": "large string", "prop2": "another large string", "prop3": "yet another large string", ... } The below query works fine…
greywolf
  • 37
  • 5