Questions tagged [arrays]
An array is an ordered linear data structure consisting of a collection of elements (values, variables, or references), each identified by one or more indexes. When asking about specific variants of arrays, use these related tags instead: [vector], [arraylist], [matrix]. When using this tag, in a question that is specific to a programming language, tag the question with the programming language being used.
arrays
417,304
questions
0
votes
0
answers
7
views
Javascript : Find node value through recursive iteration
I have the following structure :
var content = {
"id": "RkktMTA1OC0wNTE3QElNQi82NTAwNC9YLzAwSDc",
"name": "FI-1058-0517",
"category": &...
-2
votes
1
answer
30
views
Array input from user in C program [closed]
So I'm just learning C, my case is to make n the number of arrays, but when I try to run the program, the program always stops when I just enter 1 number, is there an error in my code?
this is my code ...
0
votes
1
answer
21
views
Mongo How to get only available documents by date
I have documents that associated to students:
[
{
'_id': 1,
'name': 'Anna',
'vacation_start: '2024-01-01',
'vacation_end': '2024-01-03'
},
{
'_id': 2,
'name': 'Bob',
'vacation_start: '2024-01-01',
'...
0
votes
0
answers
12
views
GroupBy a nested array of objects in TS
I have an object MealFood which contains information about a food like this:
{
...
id: 1,
main: true,
familyId: 3,
scheduledServings: [
{
...
time: '2024-07-09 13:00:00',
quantity: ...
0
votes
1
answer
35
views
How to create a generic array in GO?
I have a function that needs to receive a GORM model as a parameter, and depending on the model I receive as a parameter, I need to create an Array(Slice) based on the type of the struct(gorm model) I ...
0
votes
0
answers
15
views
Create mysql table from json string when 1st dimension hold columns and 2nd dimension holds rows
I am sitting with a legacy database and im trying to create this table in mysql using json strings stored in the database.
I have a table that stores a massive json string and one of the keys inside ...
2
votes
2
answers
44
views
How do i use "my" to declare array and element in perl?
If I have an array, say @test and refer to items in the array as $test[0], etc. how should a my statement look? one of the following?
my (@test,$test); # array and element
my (@test); #just the array
...
-5
votes
1
answer
45
views
An ordinary numpy array produces a type error? [closed]
Could someone explain why I get this warning
<>:18: SyntaxWarning: list indices must be integers or slices, not tuple; perhaps you missed a comma?
and this error message
TypeError ...
1
vote
1
answer
30
views
Resolve Multidimensional Array using Javascript
When I do.
I receive as the screenshot attached.
But I need one array having each array as a whole number.
'use strict'
const { helper, browserstackBase } = require('@core/IQAir')
const webdriver = ...
0
votes
1
answer
35
views
How do I print data to table rows from multiple arrays within a larger array retrieved from an API?
I cannot think of the most apt way to phrase this question, so please forgive me if this description doesn't fully match the title. For context, I am working on an NFL database presentation site that ...
0
votes
1
answer
43
views
How to use `static` with an array of array in C
Given,
int last(int arr[3][6]) {
return arr[2][5];
}
I want to make it clear that arr can't be null with the static keyword.
The problem is that the following code won't work.
int last(int arr[...
0
votes
1
answer
28
views
Sorting with AlgoBuild. Why do I get an index is out of range error?
I am using AlgoBuild to make a program that sorts numbers.
This is my attempt:
AlgoBuild translates this chart to the following pseudo code:
PROGRAM main
INPUT int D
FOR i = 0; i < D; i = ...
-2
votes
2
answers
44
views
How can I get last three values from array of objects [closed]
I have an array of object with a few values. I would like to get only last, three values (ownerSurname, color and bark).
I tried to use slice or length but with failure.
const myValues: MyValues<...
-2
votes
0
answers
32
views
Warning: Trying to access array offset on false in .... on line [closed]
function fc_table_one($table, $when, $id, $value)
{
global $db;
$db->connect();
$res = $db->selectOneData($table, '*', $when."='".$id."'");
return $res[$...
1
vote
1
answer
57
views
C# generic method detect if T is array and then index into the array
I'm trying to write a Dbg debug function that will print out some debug info about the given parameter and then return it. I would like arrays to be printed as the list of elements, and scalars to ...