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

how to read files using containers in STL

I have to read word by word from "testdata.txt"and look for the same words in another file "dictionary.txt". I already implemented the code to read the "dictionary.txt" in ReadDictionary() function. But I have to Implement the ReadTextFile() public…
muzzi
  • 382
  • 3
  • 10
1
vote
1 answer

Get the size of a map of pairs continous when the first key changes

I have a map of pairs map, int> counts. I am iterating through this and I am calculating some float numbers, if the value of the map is bigger than 2. Now I want to save the float numbers in a vector that is as big as the number of…
Grillteller
  • 891
  • 10
  • 26
1
vote
2 answers

How to add values of similar keys in an array of object

I have an array of objects that looks like this: [ {1: 22}, {1: 56}, {2: 345}, {3: 23}, {2: 12} ] I need to make it look like this: [{1: 78}, {2: 357}, {3: 23}] Is there a way I could make it so that it can sum up all the values that have the…
Parth Patel
  • 63
  • 1
  • 2
  • 5
1
vote
1 answer

Automapper, how to make this custom List mapping generic?

I've got the following mapping working with for key value pairs based on construct using: Mapper.Initialize(cfg => { cfg.CreateMap>, KeyValuePair>>() .ConstructUsing(x =>…
SventoryMang
  • 10,275
  • 15
  • 70
  • 113
1
vote
1 answer

awk array that overtypes itself when printed

this is my first question so please let me know if I miss anything. This is an awk script that uses arrays to make key-value pairs. I have a file that has a header information separated by colons. The data is below it and separated by colons as…
1
vote
2 answers

Is there a good way to append words in Spark?

Here is an example. DataSet - dataset.txt 1 banana kiwi orange melon Code scala> val table = sc.textFile("dataset.txt").map(_.split(" ")) scala> table.take(1) res0: Array[Array[String]] = Array(Array(1, banana , kiwi , orange, melon)) scala> val…
S.Kang
  • 581
  • 2
  • 10
  • 28
1
vote
0 answers

LINQ Group by for keyvaluepair data

Hello I am using Linq in my asp.net mvc application to get the questions as per ids inserted in answer table. I have table data like this: Here in above picture you can see ScheduleId is there in two tables first table which is used to assign…
3 rules
  • 1,359
  • 3
  • 26
  • 54
1
vote
1 answer

VB.NET Get list of keys from json deserialized object

I want to get the keys present in a json deserialized object The json looks like : {"key1":1,"key2":2,"key3":3} I'm using JavaScriptSerializer : Dim jsonStr As String = "{""key1"":1,""key2"":2,""key3"":3}" Dim j As Object = New…
Tr Fntn
  • 15
  • 1
  • 6
1
vote
1 answer

How std::map maps a pair as a key to its value without a comparison function

If we use a structure or a class as a key then a comparison function is required to place the values in the tree but if a pair is used as a key then how the map data structure place the values in the tree. I.e. there has to be something to compare…
Rajat Sati
  • 11
  • 3
1
vote
3 answers

Compare dictionaries within lists python

I have two lists with nested dictionaries: list1 = [{u'Key': u'lm_app', u'Value': u'lm_app'}, {u'Key': u'Name', u'Value': u'new Name'}, {u'Key': u'lm_sbu', u'Value': u'lm_sbu'}, {u'Key': u'lm_app_env', u'Value': u'lm_app_env'}] list 2 = [{u'Key':…
mccoym
  • 21
  • 1
  • 2
1
vote
0 answers

ComboBox Validation - Options

I've been asked to review some code written by someone else and they've used a method to validate their comboxboxes that I've never seen before, and I'm not sure if it's a better way and/or what the point of it is. For ease, let's say there's one…
Benny O'Neill
  • 208
  • 4
  • 10
1
vote
3 answers

make value of one( key value pair )to be key of another in angular js

i am having a json response from which i wanted to create new json object response = [ {Detail:"Reuters ID",keyName:"Reuters_ID"}, {Detail:"Parity One",keyName:"parity_one"}, {Detail:"Parity…
Rajat
  • 111
  • 4
  • 14
1
vote
3 answers

Alter Methods So That Their Search Becomes Case In-Sensitive

I have two methods that I need to fix so that when a user searches for "Javascript", the methods will return values if they're spelled like "Javascript" or like "JavaScript" - capitalization won't matter. Importing data from the csv file (where the…
SpeakInCode43
  • 580
  • 4
  • 11
  • 23
1
vote
1 answer

How to properly serialize my object that contains a list> into Json?

I'm trying to serialize a collection of object named TableDTO. This object contains a Name, Date and a List>. I'm trying to serialize it using Newtonsoft.Json library in C# Every things works good when i construct the object. I add the…
Wafou Z
  • 85
  • 10
1
vote
1 answer

KeyValueComparer based on key

I have 2 key value comparers - in both I am using key to compare, which is string. Can I use generic for the value - so instead of have 2 classes I can have only 1? So instead of the classes below I wish I could have only 1 class class KvpComparer :…
Anand
  • 1,387
  • 2
  • 26
  • 48