62 questions
0
votes
0
answers
233
views
C++ cannot convert initializer list to map
I am declaring a map in a header file, which maps 2 strings to a function pointer in another cpp file. However, I'm getting the following error:
Error C2440 'initializing': cannot convert from '...
0
votes
1
answer
552
views
Iterate nested map recursively in groovy jenkins
While iterating map I am getting error.
Followed with the below approach:
How to iterate through all values of a nested map in groovy
def deNull(root) { if (root instanceof List) { root.collect { if (...
0
votes
1
answer
127
views
Clojure update nested map inside atom
I have an atom like this, inside a let:
(let [scors (atom {:one {:year-one [] :year-five [] :year-ten []}
:two {:year-one [] :year-five [] :year-ten []}
:...
-1
votes
4
answers
248
views
in a nested map find key and update its value
find key : sum in nested map and update its value to : bill * 100 + : coins
Need to pass test1
test "test1" do
assert BcToInt.data(%{
count: 3,
sum: %{bills: 1, ...
0
votes
1
answer
40
views
Java - How to create a new map containing summed fields from a map containing a key and list of fields
I am provided with a List<Result>
The Result class has a number of fields of which five are of interest
class Result {
public enum SESSION_TYPE {
NIGHT,
DAY
}
...
1
vote
2
answers
110
views
How to search(filter) in nested map and return entire map elements
I am trying to filter the map and in return, I want every filtered map element.
Code:-
Map<String, Map<int, int>> temp = {Basic Terms: {1: 0}, Table and Column Naming Rules: {1: 1}};
var ...
0
votes
1
answer
79
views
Nested maps in Qt's QCborStreamWriter?
My program provides a large amount of data, organized in nested maps, that I would like to serialize and write in a file. Originally, I used a QJsonDocument with QJsonMap's and QJsonArray's, but the ...
0
votes
2
answers
89
views
why nested map showing repeated content in react
import "./styles.css";
const data = [
{
firstname: "junaid",
lastname: "hossain",
phones: [{ home: "015000" }, { office: "0177" }]
},
...
-3
votes
1
answer
155
views
How to acheive the order of insetion in nested maps using golang [duplicate]
In my project we are using nested map
map[string]map[string]map[string]string
for insertion of the data into cache.
While preparing the data the db data has to be compared with the cache data(nested ...
0
votes
1
answer
1k
views
How to delete exact matched data from nested map in golang
I am using IM cache with nested map data structure(map[string]map[string]map[string]string-map[ip]map[port]map[path]string) in the golang project, for one ip there is a multiple combination of port, ...
0
votes
2
answers
606
views
How to access item in nested hashmap without multiple clones?
There is a TokenBalances struct defined using a nested map. I want to implement a the balance_of method which takes two keys: token, account as input, and returns the balance as output.
use std::...
1
vote
1
answer
1k
views
Convert a List of JSON-objects input into a nested Map
I have a String input in the following format:
Input String: [{ "id":"1", "name":"A", "address":"St 1"},{ "id":"2", &...
1
vote
2
answers
449
views
Implement multi-dimensional std::map with std::tuple and view access
I know that I can create a multi-dimensional map by nesting maps together, e.g.:
// Two-dimensional key
map<string, map<int, double> > m;
so it is easy to extract all of the values ...
-2
votes
2
answers
241
views
Converting a nested HashMap with a list to another nested HashMap with a linkedHashMap instead of the list
I have a map in java that is an instance of the following:
Map< K1,Map< K2, List<Object>>>
I want to convert it to the following structure:
Map< K1, Map< K2, LinkedHashMap<...
0
votes
1
answer
923
views
Golang nested map filter
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strings"
)
func main() {
fmt.Println(fecthData())
}
func fecthData() (map[...
1
vote
1
answer
2k
views
How to place a Map into another Map in Java
I'm doing a personal project.
After a lot of maps, I came to the point where I want to enter a map inside another map... Let me explain better.
I have this Map atPropostas which have information about ...
1
vote
1
answer
185
views
clojure/clojurescript change just one key in nested map
I have this map:
{:a {:a {:a 1 :b 2}}}
And I want to turn it into this one:
{:a {:a {:x 1 :b 2}}}
I tried this, but -of course- got all :a replaced:
(clojure.walk/postwalk-replace {:a :c} {:a {:a {:...
0
votes
0
answers
549
views
Terraform iterate over nested map from module
I'm fairly new to Terraform, and I'm struggling trying to design a module to create Monitor Alerts in Azure.
I've essentially created a module that will generate alerts based on a nested map passed in ...
0
votes
0
answers
313
views
Terraform Nested maps of different sizes
I am deploying a number of AWS application load balancers by feeding a nested map from locals.tf to a module configuring the load-balancers.
locals {
lb_vars = {
alb1 = {
...
0
votes
1
answer
4k
views
Iterate through a yaml file that key name changes
I have tried a couple of ways to iterate through a map in yaml but each results i keep getting errors ex: local.settings is object with # attributes .
to start with here is my yaml and locals setup
...
1
vote
2
answers
4k
views
How to convert map and nested map to string and vise versa in Kotlin?
I have no idea how to convert HashMap and nested Hashmap to string and vise versa:
I use Room to save data in a local database. The "users " hashmap is a parameter of the data class. To save ...
0
votes
2
answers
541
views
Java Nested map String array Looping Optional<Map<String,Map<String,String[]>>>
I have an object of Optional<Map<String,Map<String,String[]>>> How do I loop over each string in the array?
The below code I am expecting "application" to be 'String' but ...
0
votes
2
answers
2k
views
Dart: How to iterate over objects in an array in a nested Map?
This is the current state of the Map data structure that I am working with in Dart:
Map database = {
'campusConnect': {
'hashtags': [
{
'id': 4908504398,
...
1
vote
2
answers
731
views
C++Map :Accessing map inside a map
How can I loop, access and assign through a std::map in C++? My map is defined as:
std::map<std::string, std::map<std::string, int>>
For example, the above container holds data like this:
...
0
votes
1
answer
85
views
Updating values of map using for in Clojure
I have a json like below and have a requirement to add values in it
{ "10 days refund": [
{
"paymentType": "CreditCard",
"amount"...
0
votes
0
answers
139
views
Firebase & Flutter - Generate widget from Firebase data
I passed data from RTDB into a map.
This is the RTDB structure: RTDB
I extracted the data using schoolList['Kỹ thuật và Công nghệ']['oisp']['title'] (I called the map that was holding the data ...
0
votes
0
answers
356
views
Dart/Flutter & Firebase RTDB - How to access the nested Map retrieved from RTDB
I'm working with data from Firebase RTDB. While I've successfully gotten the whole data from Firestore through this piece:
// GETTING ALL THE DATA FROM RTDB - MAP
void readSchool() async {
...
1
vote
1
answer
1k
views
Initialize a multilayer nested map that's inside a struct GO
I'm new to golang and kinda new to coding in general and I've been stuck on this problem. I've found multiple examples on how to do this with two layers of map but none of them scale well to three ...
0
votes
2
answers
412
views
React Nested array not working, Cannot read property 'map' of undefined
I am using react functional component. When I run react it outputs this error "TypeError: Cannot read property 'map' of undefined"
Sample Data
const tabData = [{
key: 0,
label: '...
0
votes
1
answer
431
views
nested map inner value with []
I have a nested map with all self-defined objects as key and values
typedef map <Time,WindLogType> minuteIntervalData;
typedef map <Date,minuteIntervalData> DayData;
How can I access the ...
2
votes
1
answer
2k
views
groovy nested map update value without checking type of value
I have two maps ,
def configmap = [ "env" :["required": ["team" : "k", "test": "sample"], "optional" : ["anotherkey" : &...
1
vote
1
answer
308
views
How to render a nested map as JSON from the Controller
This solution does not work for a nested map. I'm trying to convert to JSON. I need to send this nested map because it contains a lot that I need for a graph which I'm going to make with plotly on the ...
13
votes
1
answer
40k
views
Terraform - iterate over nested map
I am trying to create IAM binding for Bigquery dataset using the resource - google_bigquery_dataset_iam_binding. The requirement is I read the parameters in this resource (dataset_id, role, members) ...
4
votes
1
answer
466
views
What is the easiest way to change the inner value type in a nested map in java?
I have a nested map Map<String, Map<String, List<ObjectA>>> passed to me, and I want to change it to type Map<String, Map<String, Set<ObjectA>>>, what is the ...
0
votes
1
answer
1k
views
How to safely allow current access to nested maps in go?
I'm a bit confused about how to ensure I safe concurrent access to nested maps.
Originally my setup was like this, bit I realize I'd need to be able to lock at least one of the maps.
map[string]map[...
0
votes
1
answer
362
views
How to sort a nested map by inner keys descending order and then by inner values in ascending order?
I have a nested map Map<String, Map<String, Integer> for example
("Samsung", ("Note", 30))
("Samsung", ("Galaxy", 20))
("Apple", ("Iphone", 40))
I need to sort the map by inner key ...
1
vote
2
answers
953
views
Java map of map (nested map) sorting
I have a nested map as
Map<String, HashMap<String, Integer>> map = new TreeMap<String, HashMap<String, Integer>>();
Also, I have deep map as
HashMap<String, Integer> ...
0
votes
2
answers
386
views
Nested mapping reactjs
I'm mapping a list of objects in my react app like follows
(countrydata !== null) ? Object.keys(countrydata).map((item, key) => {
return (
<img src={countrydata[item].image_location}/>
...
0
votes
1
answer
125
views
Trying to parse a nested json and store in a nested Map. While reading it gives extra values in the Map. Code, output and json below
Map < String, Map < String, String >> appPayload = new HashMap < String, Map < String, String >> ();
Map < String, String > featurePayload = new HashMap < String, ...
0
votes
1
answer
1k
views
Java8 Streams - How to modify value of keys of inner map to null object from "null" string
I have a utility method defined as below.
public static Map<String, Map<String, String>> convertRawMapToStringValues(Map<String, Map<String, Object>> cassandraRowsRawMap) {
...
3
votes
1
answer
3k
views
Filter on a value of inner Map using Java 8 streams
I have a map of maps - Map> - collection.
I need to filter the map and get the outer map that has a given value for a given key of the inner map.
I tried some combinations, but it is not working.
...
7
votes
1
answer
4k
views
creating nested maps with nested properties from List, stream, Java 8
I made this question
stream creating List of List (nested List) using forEach, Java 8
class EntityCompositeId {
private Long firstId;
private Long secondId;
// getter & setter...
}
...
0
votes
0
answers
196
views
Gaps in sass css output
I'm writing some sass to generate a set of icons based on a series of parameters. I have a function that analyses a set of variables and then returns a 'scenario' variable which in turn is used to ...
2
votes
1
answer
2k
views
Nested Hashmap: Alternative to putIfAbsent which does not requires null check and manual get?
I have a nested HashMap looking like this: HashMap<String, HashMap<String,Object>>.
I created a add method to fill the HashMap
private void add(String currentVersion, String ...
0
votes
1
answer
502
views
How to compare and sort nested Map in java based on Item price?
How to fix this issue/error ( How to sort nested TreeMap in java)
When i am trying to sort Map using item price it is not working because TreeMap sort in natural order according to key but i need to ...
2
votes
2
answers
5k
views
C++ Map : manipulate map inside map
I'm more used to a single map and not to nested map. So I have serious difficulty understanding how to deal with this.
Remark: Please don't request me to use multimap or boost,I'm restricted to ...
1
vote
3
answers
3k
views
iterate, find and update value in nested Map<String, ?>
I have a YML file, which I parse to Map using yamlBeans library.
I don't know how deep the nested map goes.
for example:
key1:
key2: value1
key3:
key4: value2
key5: value3
...
0
votes
1
answer
1k
views
JS How to use nested map?
Here is the code, below the console.log part is my issue.
It logs out all 3 classes of offset in a tag like this :
<tag id="id1" class="$offset1, $offset2, $offset3">
But I just need 1 class ...
0
votes
0
answers
60
views
Flatten nested map into rows [duplicate]
In clojure, how can I turn a nested map like this:
{"1" {"1.1" {}
"1.2" {}}
"2" {"2.1" {}
"2.2" {}
"2.3" {}}}
Into this:
[["1" "1.1"]
["1" "1.2"]
["2" "2.1"]
["2" "2.2"]
["2" ...
1
vote
0
answers
159
views
nested map in d3 (custom key)
I am trying to create a nested map, something like this,
Map<Key1, Map<Key2, Map<Key3, List<Objects>>>>
using d3 map. I don't want to use d3.nest as I want to index my data ...