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

Adding subkey-value pairs to existing array (or JSON object?) in javascript

Been wracking my brain and googling like mad, but perhaps I'm not searching with the right keywords. Got a list/array/JSON serialized data (doesn't really matter at this point) like so: { "program": 1, "program": 2, "program": 3 } and I'm…
the digitalmouse
  • 223
  • 3
  • 25
1
vote
3 answers

Search.lookupFields() Method is return [0bject Object] instead of key value pair

I have created the lookup search on customer record to get the particular field value.while putting obtained result in alert it showing as [object,object]. and i have converted result to string JSON stringfy method. The alert showing the result like…
Deepan Murugan
  • 721
  • 2
  • 19
  • 41
1
vote
1 answer

Java create key value pair for table with multiple column

I have to create table like below using key value pair Column1 Column2 Column3 Column4 Column5 Column6 23 ASD 10 Oct 2016(Current Date) value11 value11 value11 78 XYZ 10…
user3441151
  • 1,880
  • 6
  • 35
  • 79
1
vote
4 answers

How to order the elements of a map using its values if keys are same?

I have a situation where I have to store marks of some students in descending order. So created a map. As a map stores data in the form of heap, always highest mark will be on top. But the problem arises when I have same mark for two…
Midhun
  • 744
  • 2
  • 15
  • 31
1
vote
0 answers

Post JSON data as KeyValue pair to Rest Service

I have Rest Service API, the Contract is [OperationContract] [WebInvoke( Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, …
Rathore25
  • 46
  • 8
1
vote
3 answers

Defining new Dictionary members methods C#

I want to define a new member method for Dictionary as it already built in member methods e.g. Add(), Clear(), ContainsKey() etc. That newly added member method should return all the keyvaluepairs in form of a Set as we can return map.entrySet()…
maliks
  • 1,102
  • 3
  • 18
  • 42
1
vote
1 answer

How to extend KeyValuePair stuct operators in C#?

Let say I have two KeyValuePair variable. KeyValuePair kv1 = new KeyValuePair("a", 5); KeyValuePair kv2 = new KeyValuePair("b", 7); There is no definition of…
1
vote
1 answer

Javascript: function which takes in object, and returns list of all numbers described in object

Write a function that takes in an object like so {1: 4, 2: 10, 5:3} and then return a list of all the numbers described in the object. Each key-value pair describes a number and how many times it should occur in the array. Example: {3 : 10,5 :…
zasman
  • 446
  • 1
  • 8
  • 28
1
vote
4 answers

Store List of Places as Key Value pair with City name using C#

With My code I can Generate Lots of Places name from a Wikipedia article. Suppose if I look for Flensburg wikipedia page it will give all the external page links of places as name. So at this moment all the places are shown on output as list form…
harry.luson
  • 247
  • 7
  • 19
1
vote
1 answer

Am I hitting the stl::pair issue 2051 if I use a function pointer as the value a pair?

I want to have a std::unordered_map variable. But - when I try instantiating that, I get an error message, deep inside, which is essentially: /usr/include/c++/4.9/bits/stl_pair.h(102): error: a function type is not allowed…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
1
vote
2 answers

Compare function for pair

I have a pair: typdef pair > pair_t I need to implement my own comparison function for that map, so I tried : struct myCmp { int operator()(unsigned char arr_1[10], unsigned char arr_2[10]) { return…
user1673206
  • 1,671
  • 1
  • 23
  • 43
1
vote
3 answers

Extracting a key-value pair from inside a string

I have the following string: string myString = "{'gridObject':'[1,2,3,4],[5,6,7,8]'}"; How do I process this into an object so that I can do this: charts[0] //=> [1,2,3,4] charts[0][1] //=> 2 If I can convert it to this object, even…
Ege Ersoz
  • 6,461
  • 8
  • 34
  • 53
1
vote
1 answer

Create custom POST-request body in PowerShell

I am running into a bit of trouble. I am trying to do a POST-request with PowerShell. The problem is that the request-body uses the same key (you can upload multiple images), multiple times, so I can't build a hashtable to send the request. So the…
1
vote
2 answers

check if items are not in a keyvaluepair list

I have a list of type List>. This list contains 8 items. I also have a string line. I'm trying to check if line does not contain a word from the TKey (string) and the TValue is false. I'm not using a dictionary because…
Alex
  • 689
  • 1
  • 8
  • 22
1
vote
3 answers

Evaluating "key=value" with whitespaces in "$value" in bash fails

In a script i have a function which evaluates passed 'key=value' parameters, i.e.: function evaluateKeyValuePair() { eval "$1" } evaluateKeyValuePair "key=value with whitespaces" evaluateKeyValuePair "key=value" The latter call works fine,…
PuppetMaster
  • 21
  • 1
  • 7