Most voted "map" questions
56 questions
Sort by count of
-
8
votes1
answer725
viewsDifference between Hashmap and Treemap
What are the main differences between HashMap and TreeMap? Regarding use, in which situations it is recommended to use each one?
-
7
votes2
answers80
viewsHow to understand mapping (map) of functions list in Python?
lista = [0, 1, 2, 3, 4] def square(y): return (y**2) def cube(y): return (y**3) funcs = [square, cube] for i in lista: valor = map(lambda x: x(i), funcs) print(list((valor))) Exit: [0, 0] [1, 1] [4,…
-
6
votes1
answer273
viewsWhat is the Map object for in Javascript?
This also seems to be another novelty of Javascript: the object Map. Unlike Set, that I already have an idea of how it works and saw in other languages, the Map is something I didn’t get to see in…
-
6
votes3
answers128
viewsMap with dynamic array and property
I’m trying to create a function map, whose array and property to be returned are dynamic, that is, can be passed as a function parameter. Let’s take the array below as a use case. const students = […
-
3
votes1
answer84
viewsQuickly access exact element instance within List java
I have a list that will be filled with many points (x, y, z) - about 3000. Each point is unique within the list (no repeated points). At some point my program needs to recover the instance of a…
-
2
votes1
answer33
viewsatOffset using map
private OffsetDateTime getDataDistribuicao() { return Optional.ofNullable(this.getPaginaInfoGerais()) .map(page -> page.<HtmlTableCell>getFirstByXPath(XPATH_CEL_DATA_DISTRIBUICAO))…
-
2
votes1
answer194
viewsDifference between Std::map, Std::unordered_map, Std::flat_map, and which one to choose?
What is the difference between library functions map, unordered_map, flat_map, and which one to use, for example in terms of performance?
-
2
votes1
answer64
viewsHow to assemble a collection of derived objects, and use specific functions of each?
I want to create a dynamic list that contains all Component derived objects. I’m trying to do it this way: map<string, Componente> tabuleiro_componentes;…
-
2
votes2
answers785
views -
2
votes0
answers28
viewsCreate a groupedList with map
Hello, I’m new to flutter and I’m trying to create a list with grouping using the map, but I’m not getting... I saw that I can use the Groupedlistview, but how to map it? GroupedListView( elements:…
-
1
votes2
answers387
viewsSave file data to a c++ map
I am not able to read a txt file correctly and transfer to a map in c++. The code I developed works only if you don’t have spaces " " in txt, if you loop and it doesn’t work. Here’s the code: void…
-
1
votes2
answers423
viewsHow do D-Ocker respond to a domain that does not exist in /etc/hosts?
In my hosts file I have only the following domains: 127.0.0.1 localhost 127.0.0.1 abc.com When I will rotate the image I use the following command: docker run -p 80:80 -v…
-
1
votes1
answer112
viewsElixir multiplication on a Map does not work. Why?
I’m new to Elixir and I don’t understand the return of function. list = %{"100" => 1, "50" => 2, "20" => 4, "10" => 8, "5" => 16, "1" => 32} for {key, value} <- list, do:…
-
1
votes2
answers254
viewsFill Map without duplicating records
I own a List of an object A. In this object, I have 2 attributes: Long and a BigDecimal. How can I create a Map where the key will be Long and value will be the BigDecimal, using a lambda? The…
-
1
votes1
answer27
viewsMapping between FHIR and Openehr
I have a question about mapping between persistence models and interoperability of health data. Is there any mapping between FHIR and Openehr? If so, how should it be done? Is there an automatic way…
mapasked 6 years ago Rodrigo Lopes 13 -
1
votes2
answers735
viewsAccessing a property of an object array within another object array
While using map, filter, reduce to access data an array of objects was all quiet, now I came across access a nesting so locked everything here. const objects = [{ to: 'a', b: 'b', c: [ { cc: 1, dd:…
-
1
votes4
answers1234
viewsPython - Calculate transposed matrix
I need to calculate the transposed matrix using the python map function. But, I’m not able to solve. def transp(a): for i in range(2): for j in a: return [a[i][j]] list (map(transp,matrix)) The…
-
1
votes1
answer40
viewsObject change with javascript
My API is returning a array with the objects in the following structure: [ {id: 1, name: "Flávio", position: "SP - Atacante"}, {id: 2, name: "João", position: "SP - Goleiro"}, {id: 3, name:…
-
1
votes1
answer259
viewsMake a Map and take the values
I have a Map and within it I have another Map and I need to make a for and take the values that are in those maps, how it can be done? The structure and shape that the Map is created like this:…
-
1
votes1
answer36
viewsHow to map the value of 2 inputs in React?
I’m creating a kind of Todolist in React and had the idea to use two inputs. The code is divided into 3 components: App.js: import React, { useState } from "react"; import Form from "./Form"; import…
-
0
votes1
answer212
viewsJava Stream converter Map<String, Obj> to List<Obj>
I have this object filled: Map<String, List<LogLine>> logMap = new TreeMap<>(); And after I’ve made a filter, I’d like a flat list of it, but I can only create a list…
-
0
votes1
answer124
viewsAndroid Volley post compilation error map
Hello, The code below only compiles if I comment on the map section, but I need it to fill in the post parameters. Erros: method onresponse onerrorresponse does not override its superclass There is…
-
0
votes2
answers601
viewsWhat is the difference between map() and lenght()?
I was studying and this code appeared: var materials = [ 'Hydrogen', 'Helium', 'Lithium', 'Beryllium' ]; console.log(materials.map(material => material.length)); As I understand it, it scans the…
-
0
votes1
answer230
viewsHow to use return values using . map() in Javascript
I’m trying to make a way .map(), but I’m not getting it. My last code was this: var double = x => x * 2; function filtro(funcao, numeros) { let arr = []; for (let i = 0; i < numeros.length;…
-
0
votes1
answer192
viewsHow to use map / create keys to store c/c++ cycles?
What is the most efficient c/c++ structure that I can use to create and store cycles, so that I can ensure that repeated cycles are not stored? I have a CICLO struct, such that: struct CICLO {…
-
0
votes0
answers40
viewsHow to leave the oceans blank in the Basemap?
The following code produces a map with a color scheme. I need the colors to stay only on the continents, leaving the oceans blank. How do I get this? excel file :…
-
0
votes1
answer68
viewsHow to use a template as a type in a map?
Is there any way to use template as type in a map in C++17? template<typename T> std::map<std::string, T/* tipo desconhecido, pode ser qualquer tipo */> map_exemplo;…
-
0
votes1
answer201
viewsGoogle Maps Api in android app does not work in Play Store
I developed an application for Android that shows google maps in one of the activitys, in the tests works well, except that the application published in the Play Store does not show the map. I…
-
0
votes2
answers204
viewsMap navigation intent for all apps [mount route]
I’m looking for a way to give user option select which app mount your route (Waze, google maps, Uber...), but just does not work on google maps. When I choose it, it just shows the location on the…
-
0
votes1
answer57
viewsAccessing methods of a class on a vector of pointers
All right, I have a Package class with a public method double calculate_cost(). I need to create a std::map<string, std::vector<Package*>> where I can iterate through the array and save…
-
0
votes0
answers34
viewsMap() item going through multiple requests
The code below worked the way I wanted but in the last test something went wrong. I do a map where the item went through several requests and at the end I defined my object and then a new item would…
-
0
votes1
answer2656
views -
0
votes0
answers87
viewsDoubt - Map operation in C++
In order to compare different pairs of shoes I created a map, the first int represents size and the char represents whether it is for the left or right foot ('e' or’d'). N represents the number of…
-
0
votes1
answer456
viewsReactjs - if condition inside the map
I have a requisition for the states api.get('address/states') .then(res => { const states = res.data.data; this.setState({ states }); }) And another that searches the address data by the zip code…
-
0
votes1
answer76
viewsSpotify API: this.state.data.map is not a Function
I am trying to pass the data from the api to a child component, but always giving this error when I type the name of the singer in the input, because I want to fetch every letter typed, not just…
-
0
votes2
answers52
viewsHow to use reduce() on a map() with data coming from the Firestore
I have an array of data coming from the firestore. With the data received by the firestore I make a map to make the display available as a table. When I try to make a table reduce to compute the sum…
-
0
votes1
answer329
viewsRemove comma from map
Good afternoon. I’m trying to create some elements dynamically coming from an API, only I’m running the map for this, the problem is that along with it, commas appear in the middle of the li’s that…
-
0
votes1
answer49
viewsHow do I make the function not return the value if the number is not binary
I am trying to make a limiter so that every time the user type a number that is not binary, receive an alert with the message "Write a binary number" however the problem is that the code sends the…
-
0
votes1
answer46
viewsHow to calculate the total in a filter in Vue js
This application Vue calculates totals in a list as below within methods: somaTotal(){ let amounts = this.transactions.map(transaction => transaction.valor); return this.total = amounts…
-
0
votes1
answer116
viewsFirst value in a map function in javascript
I have a function map Javascript where I return all the photos of a certain record. Among these photos, one of them has to receive a text, which in my case is Main photo, which will always be the…
-
0
votes1
answer115
viewsMap vector in Java
I have a data structure work in which I need to create an array and implement the interface Map of Java and, inside it, I store the ordered maps. I’ve already created the vector, but now I don’t…
-
0
votes1
answer65
viewsChoosing how many DIV’s to mount at a time within a . map()
Good morning guys, I went through a recent situation where I had to resolve the basis of a gambiarra but I wonder if there is a way to do what I had in mind at the time but could not accomplish. The…
-
-1
votes2
answers59
viewsConvert arrays to hash
I am giving some maintenance on a system in Perl (language that I am Noob) and I needed to create a new report module where I need to solve the following situation: I have 2 arrays with the…
-
-1
votes1
answer21
viewsMAP function applied to only one column
I’m trying to map the value "Others" to a "Career" column, according to some criteria. For example, when the column contains the Recycle Bin or Helper value, I want that value replaced by the Other…
-
-1
votes1
answer57
viewsExercise with a map
Create a map which has three keys ("Local", "Resp", "Prioridade"). Ask the user to fill in this map and then show the result on the screen. #include <iostream> #include <map> using…
-
-1
votes1
answer71
viewsCannot multiply the sequence by a non-int of type 'float', even when transformed into 'map'
level: beginner I need to multiply that [list] * [float]: eta = [random.random () - 0,5] * eps but when I try to make a float or a map, it still doesn’t work (because of unsupported operand types).…
-
-1
votes1
answer19
viewshow to fetch data from an Api with React
I am trying to display properties of an api with React but get the following error: notice that on the right the property exists is I call it below:…
-
-1
votes1
answer41
viewsSubtraction between elements in Ruby array
Hello, I have an array of values: values = [3, 5, 12, 1, 2] I would like in the first iteration all elements of the array to be subtracted by the first element (Ex, 5-3, 12-3, 1-3, 2-3) # [2, 9, -2,…
-
-2
votes1
answer49
viewsStream Filter == List.get(index) does not compile
I’m trying to create a Stream to filter a list of a class with several attributes. One of these attributes is repeated in other instances. I’m trying to filter these instance members to make a sum…
-
-2
votes1
answer76
viewsHow do I work with chained Hashmap in Java?
I’m trying to popular a DTO through a received Json, in case I’m the Gson library, but I’m having trouble filling the field urlPhoto of my class hotelDTO. I can even convert Json to a Hoteldto…