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
15
questions
0
votes
0
answers
7
views
Why does `blake2b` on a `numpy` array give different results in different machines?
I ran the following code in two different machines:
import numpy as np
from hashlib import blake2b
print(blake2b(np.array([1, 2, 3])).hexdigest())
The two machines print a different result. Why ...
0
votes
2
answers
12
views
PHP variable from mysql query in form, when null
I have an html form used to edit a record in a mysql table.
In the case of editing, I prefill the form with the current values for the record as returned by the query, as below:
<INPUT TYPE="...
0
votes
0
answers
8
views
Check if an array includes / contains values with extra in JavaScript?
Using an Angular application which inserts 'ng-star-inserted' to every node element. I need to check if the target element class exists inside array
var footerElementClassList = [
'footer-...
0
votes
0
answers
13
views
Manipulate data for Row Span logic in ag grid
I have an ag grid with row spanning and I am able to do row span for first and second column. Can anyone please help me for row span logic for rest of the columns (notes, votes)?
I think row span ...
-3
votes
0
answers
23
views
I can't display values from a javascript function separately through an array or a callback function [duplicate]
I need to retrieve the latitude and longitude coordinates to use them elsewhere. What is the easiest way? Using an Array? Or an callback function?
According to the code snippet below, the console.log(...
0
votes
1
answer
23
views
EXCEL Sumproduct COUNT 2 AND condition every nth COLUMN, counting blank and not blank
Good Day to all! as my title suggest I am having a problem with the sumproduct formula to get the result that for the following condition
Check and Count every 4th column range for NOT blank ...
0
votes
1
answer
20
views
Can't use variable field of mongodb in javascript
I have retrieved one document from mongodb, in that I have one array and I want to loop through that array but I can't do that. If I loop through that it consider whole array as one element, this is ...
-3
votes
0
answers
30
views
Get sum of values in multi array [duplicate]
I have an array with different keys, and I am interested in the sum of the values of only the ones that start (or contain) "MT".
$json = file_get_contents($path2);
//echo $json.'<br&...
-2
votes
0
answers
18
views
Linter Warning: struct field tag `json:email_addresses` not compatible with reflect.StructTag.Get: bad syntax for struct tag value [closed]
I have the following struct defined:
type User struct {
gorm.Model
FirstName string `json:"first_name" gorm:"type:varchar(32); not null" binding:"required&...
-7
votes
1
answer
52
views
WiggleSort: giving wrong output? [closed]
I am trying to solve LeetCode problem 324. Wiggle Sort II:
Given an integer array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3]....
You may assume the input array always ...
2
votes
1
answer
110
views
array of pointers to pointers to integers VS pointer to pointer to array of integers
I have 3 integers A, B & C from which I make pointers that I group in an array arrayABC of pointers to pointers:
int A = 1;
int B = 2;
int C = 3;
int *ptA = &A;
int *ptB = &B;
int *ptC = &...
-2
votes
0
answers
28
views
Javascript step by step - returning results based on buttons chosen [closed]
I am looking to mock up a structure up like this:
I presume I can use Javascript to mock up and return the results on the final page (Step 3) by looping through an array of buttons depending on which ...
1
vote
0
answers
21
views
How to stop a #N/A result showing in a most frequent value formula? [duplicate]
I have a spreadsheet of raw data that includes a cost based on a product code. I am trying to create a table that collates that information into an easy to read overview.
The cell I am currently ...
0
votes
0
answers
18
views
Plotting Eigen-energies using QuTip
I am trying to plot the eigen-energies of the following Hamiltonian
$$ H = 2\tau \cos(\frac{eA}{hc} \sin(\omega t) + k) $$
Here \tau value is set to 1. A is the amplitude. e,h,c are electron charge, ...
-1
votes
0
answers
26
views
unexpected token (...) for no reason [closed]
This entire HTML's script code:
[...document.querySelectorAll("input")].forEach(ele => {
ele.addEventListener(
"change", () => {
Main();
}
...