All Questions
638
questions
0
votes
1
answer
58
views
GoLang - looping through array of structs - can I map?
I'm new to GoLang, coming from Node. A little late to the (definitely not functional) game and need some help understanding approaches, and perhaps just understanding...
I want to omit an item from a ...
0
votes
2
answers
48
views
Map values between two arrays to generate a flat, associative array
I have two arrays, one is a list of status IDs and the corresponding numbers of records that are that status ID. The second array is the names of the statuses. I'd like to tie them together so I have ...
0
votes
0
answers
28
views
Python - How to Select a Point on a Map and Track it through Time?
I have a series of monthly latitude vs longitude maps made from an xarray.
The xarray follows the structure of: [date, latitude, longitude]
In the lat/lon placements, there are unique integers that ...
0
votes
1
answer
24
views
How to get an array with elements that are taken in order from other arrays?
I need from this array:
const initArray = [
{
'18888': [
{
unitId: 1,
venueId: 18888,
},
{
unitId: 2,
venueId: 18888,
},
],
},
{
...
-5
votes
1
answer
50
views
Javascript array group by and sum nested object
I need create a scoreboard for these players, based on an array of games. Each game has a final score with multiple p[layers. Each player has a property for what team they played. that property needs ...
-3
votes
1
answer
334
views
Converting a Javascript map into an array of objects [duplicate]
I am given a map of key value pairs which I have no control over, and I need to convert them into an array of objects, but in a certain way.
let paramArray1 = [];
let paramArray2 = [];
...
0
votes
0
answers
37
views
Map an array, but sorted by values inside the array [duplicate]
I have an array like this:
[{ "title": "Home", "url": "/", "order": 1 },
{ "title": "Services", "url": "#services&...
-2
votes
4
answers
135
views
Array time slots: check for appointment availability by searched datetime and next 2 datetimes
I'm programming an appointment scheduling system. It checks several Google calendars.
I divided the day (9:00 a.m. - 6:00 p.m.) into 10-minute slots.
Now I have an array with the respective slots and ...
0
votes
3
answers
81
views
Group 2d array data by one column, populate subarrays with defaults, sum values from another column using a mapping array
I am trying to group data from a 2d array while leveraging a lookup array to ensure that default values exist in each group.
My lookup/mapping array associates language ids with language names.
$langs ...
0
votes
1
answer
16
views
Keep record in mapping (no over-writing)
contract YourContract {
struct student_marks
{
uint maths ;
uint science ;
}
mapping (address => student_marks) public record ;
function add_marks(uint _maths, ...
0
votes
2
answers
66
views
Plotting a 2D list of co ordinates to a 2D map
This is my attempt at mapping a set of co-ordinates in a 2d list to a 2d map. Each co ordinate is given as(y,x) y and x representing the given axis on the map. the map is simply a grid of 0's, the ...
0
votes
1
answer
60
views
jq : applying different functions/mappings over parts of an array
The JSON input is a simple set
I wish to pick some of its elements based on their names
a1,..,an -> {"a1":v1,..."an':vn}
jq -j '[.a1,.a2,...,.an]'
And then use different functions f,...
1
vote
3
answers
48
views
How to fetch Object inside Array of Array
How to fetch Object inside Array of Array? I am getting undefined
myArray = [
[{ name: test1, username: sampleuser1 }],
[{ name: test2, username: sampleuser2 }],
[{ name: test3, username: ...
1
vote
1
answer
64
views
How to map elements in 2d numpy array without using for-loop?
I want to reorganize the elements in a 2d numpy array based on data stored in a list of lists.
The below (simplified) minimum code example does exactly what I intend to do, but by using a rather slow ...
1
vote
2
answers
42
views
How to map JavaScript array to multidimensional array based on item property?
I have an array of objects such as this:
var arr = [
{name:"item1", category:0},
{name:"item2", category:3},
{name:"item3", category:1},
{name:"item4&...