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,719
questions
0
votes
0
answers
26
views
How do get search filter data in es6
// Filter rows based on string values and exclude from whiteList
const whiteList = rows.map(sel => sel.RuleAutoID); // Array of IDs to exclude
console.log('whiteList', whiteList);
// Assuming you'...
-1
votes
2
answers
56
views
What is this type? And how can I return it from a function? [closed]
[FieldOffset(24)]
public fixed Int32 myArray[4];
As far as I understand it should be an int array. But I'm not sure. I stumbled over this while looking over a code base which is not mine. It seems ...
0
votes
2
answers
61
views
Is the & operator is essential to use as address operator [duplicate]
#include<stdio.h>
int main()
{
int a[5]={5,10,15,20,25};
int *p;
int i;
p=a;
for (i=0;i<=5;i++)
{
printf("the address of the %d is = %d\n",*p,p);
...
-1
votes
2
answers
33
views
Extracting values from array and adding them to new elements
I've got some code which loops through an array of products, it records new categories found and also how many times a category is found:
const categoriesFound = (catArray) => {
let categories = {...
1
vote
1
answer
71
views
How do I effectively compute pairwise quantities in numpy?
I want to compute pairwise quantities, e.g. distances between two points.
A simple example would be
import numpy as np
N = 9
x = np.linspace(0,1,N)
y = np.abs(x - x[:,None]) # pairwise 1d eucdlidian ...
-1
votes
1
answer
88
views
write a programme in c to skip 2 elements after occurence of a non prime
I write the code as my knowledge but i didnt get the correct ouput.i provide my code below
#include <stdio.h>
int main() {
int i, j, isPrime, n, a[1000], k;
// Input array limit
...
0
votes
2
answers
49
views
New to using SAS arrays and can't get array elements to populate with values based on IF-THEN-ELSE statement
Admittedly, I've never written an array, so I'm sure this is an easy solution for most users. I've got a dataset with two columns:
START_BLOCK (possible integer values 0-47)
END_BLOCK (possible ...
3
votes
2
answers
61
views
Traverse over tree type structured data uing JavaScript
I have a data set having parent and nested children in it. The purpose of this data is to traverse over parent to -> child1 to-> Child1Child .....
-> child2 to -> child1 to -> child2 ...
0
votes
2
answers
68
views
How to transform nested arrays by extending the dimension of the array
Suppose I have an array X with N elements. I would like then to input this array into a 2D array A as follows
X=np.array([0,1,2,3],dtype=np.float64)
A=np.array([[0,0,X],
[0,X,0]],dtype=np....
1
vote
1
answer
105
views
Arrays, Pointers and Memory addresses instances confusion in C++
I'm learning and playing a bit with pointers and memory addresses.
The thing is that I've tried doing some moves with instances inside arrays and getting their memory address, and I can't figure out ...
-5
votes
0
answers
43
views
Appending to an Array in Bash [closed]
So I am currently working on some practice exercises for learning Bash Scripting, one of which is a brute forced way of doing calculating up to the nth Fibonacci sequence where n is an input from the ...
0
votes
1
answer
30
views
How to vectorize a custom function to use with mutate() and case_when() in R?
I'm trying to run a custom function, QA2Char, to iterate down all the rows of a specific column in my dataframe and then append the output as a new column.
QA2Char takes a decimal/integer and outputs ...
1
vote
3
answers
64
views
Powershell: Replacing string elements in the hashtable
I have the following Hashtable ($wImages):
Name Value
---- -----
abc.png 1
def.png 1
ghk.png 1
xyz.png 1
I want to ...
0
votes
0
answers
30
views
Pass plain string as an argument to a command in bash script [duplicate]
I am trying to write a simple bash script for package installation using zypper.
The script is supposed to read zypper package names line-by-line from packages.txt file, put them into an array and ...
0
votes
1
answer
35
views
Send data to all sockets at exact time [closed]
Say we have array or list of sockets named (A,B,C) and we want to send data to all of them at the same exact time due to that the application is really time critical, then is there a away to send to ...