Skip to main content

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
-2 votes
0 answers
17 views

How do relationships not cause infinite loops?

So I'm still learning SwiftData and the one thing I cannot get my head around is how relationships don't cause infinite loops. For example, using SwiftData, if you want to list all the films an actor ...
sam0701's user avatar
1 vote
2 answers
73 views

C++: array types and new

I'm learning C++. The following program looks nice and generic: typedef some_type T; int main() { T* p = new T; } And it indeed works for non-array types like int, etc. However, if I try typedef ...
Ivan's user avatar
  • 327
0 votes
0 answers
38 views

Best practice approach for dynamically loading and referencing large datasets [closed]

I have an analysis framework which operates on large datasets loaded from other workbooks. The sets comprise headered columns each containing a single metric, with multiple columns on each sheet and ...
MASH's user avatar
  • 1
0 votes
0 answers
6 views

How can we solve this Array to string conversion error in php 8

I have this below code from old theme file. When migrating this to PHP 8, exactly at this line ($$value['id'] = get_option( $value['id'] ); }) it throws an error - [error] 198034#198034: *334 FastCGI ...
Prasath's user avatar
  • 33
-4 votes
0 answers
19 views

Copying bytes with step offsets from one array to another in VB.net [closed]

I have a large byte array that I want to transfer to a smaller array by copying every 6th byte. The VB.net array copy commands do not appear to offer a method of using offsets - is there a way around ...
Terry's user avatar
  • 1
0 votes
3 answers
57 views

Search for a pattern in a string array

Let's assume I have the following array: string[] arr = ["Off", "Off", "Off", "Duty", "Off", "Off", "Duty", "Duty", &...
Nean Der Thal's user avatar
1 vote
2 answers
36 views

How to count values from a column with JSON content?

I have a table with singers and each singer can be linked to many musical styles. Musical Styles are in a TEXT column, but the content of the column has JSON format. I want to count the number of ...
Sébastien Merour's user avatar
1 vote
1 answer
134 views

Can't understand this C syntax. Designated initialization of an array of structs?

Trying to learn the nuances of C, though I was doing well until I found this: #define SOKOL_IMPL #define SOKOL_GLES3 #include "sokol_gfx.h" #include "sokol_log.h" #include "...
Matheus de Moraes Peixoto's user avatar
-1 votes
2 answers
50 views

C++ Rectangle 2D Array with numbers beside the rectangle

I've been trying to make a 2D array of rectangle, and i want the number of index x to printed beside the rectangle and index y to be printed below the rectangle.. Here is my code.. int height, width; ...
ken's user avatar
  • 1
-8 votes
0 answers
28 views

How to get and sort a string from an array in javascript? [closed]

I have this array with this string: ['MEX-CUN'] ['MEX-MTY'] and I would like a result similar to this: CUNMEX MEXMTY Is it possible to perform this action?
dany952's user avatar
  • 303
1 vote
1 answer
24 views

Import Array to Godot via CSV

I'm currently making a game in Godot using CSV tables to help keep track of things. Most stuff works, except when I want to import a column as an array. How would I format this array in a CSV so ...
Relo Kai's user avatar
-1 votes
0 answers
13 views

In excel I need a general set of instructions to derive certain sub arrays

enter image description here Given an array of variable numbers of rows from 5 to 100 and columns from 5 to 26, an example of which is shown in image; The columns may start in row 2 with a variable ...
Christopher Paul's user avatar
0 votes
0 answers
23 views

How to import an array of rows while editing each row of the array

I have a complicated question I have one table with a bunch of columns and rows. Then on other pages I import filtered data from the first page. That is, I group all the data into separate groups via =...
K14M's user avatar
  • 5
0 votes
1 answer
32 views

Find the average per index in a matrix

I'm looking to get the average of each index in a matrix row in JS [1, 2, 3] [4, 5, 6] [7, 8, 9] Then returning a list with the average of each row index : [4, 5, 6] Would I create a loop, save each ...
zaklance's user avatar
2 votes
3 answers
112 views

Converting to char*** from char* [2][2]

I have the following variable char* a[2][2] = {{"123", "456"}, {"234", "567"}}; I wanted to refer it using another variable. While the cast works, accessing ...
Sreepathy's user avatar
1 vote
0 answers
36 views

Multiple adding to cart in JavaScript doesn't work

when I add products to the shopping cart at some point it stops updating the table, it is refreshed when I click the previous product and the product I want to add. Live site: https://frontend-mentor-...
Kajetan Ślęga's user avatar
1 vote
0 answers
6 views

Warning: Undefined array key 0 releases/80/vendor/magento/module-configurable-product/Model/Product/Type/VariationMatrix.php on line 47

A configurable in the Product view opens up with the error message, of which I cannot proceed any further. The children attached can open up without issue. There were not any issues with opening up ...
user76474's user avatar
0 votes
1 answer
22 views

LENGTH of ARRAY [42883]: ERROR: function array_length(text[]) does not exist

ON PostgreSQL 9.6.10 (Red Hat 4.8.5-28), 64-bit select string_to_array('file.name.pdf', '.') {file,nome,pdf} select array_length(string_to_array('file.nome.pdf', '.')) [42883]: ERROR: function ...
pissardl's user avatar
0 votes
1 answer
37 views

Checking a candidate majority element: Does my simplification work with all cases?

Here are the details of the problem: Given a sorted array arr of N elements. A majority element in an array of size N is an element that appears more than N/2 times. The task is to write a function ...
Gargouri Nourallah's user avatar
0 votes
1 answer
28 views

CSV backslash create issue while procession file data

I am trying to process a CSV file in which one column contains JSON formatted data. In this JSON data, some fields use backslashes, which creates a problem when mapping fields with their values. Link ...
Siddhart hundare's user avatar
-1 votes
3 answers
72 views

Todo list using array and loop

I want to create a todo list using array and loop and display the list in div container. I am able to display the list but it is muliplying the same list stored and is displayed. <body> <...
Sam Sandy's user avatar
0 votes
2 answers
90 views

How to show String of array text in curve shape in SwiftUI?

I need array of text should scroll in curve shape like below: Code: but with this code i can create green colour curve shape view but how to show array of text in curve shape ? please help me to ...
Swift's user avatar
  • 1,170
1 vote
3 answers
75 views

In C, why can a variable holding a char array be assigned to a pointer, but the address of the same pointer cannot?

Consider the following code: char stringy[] = "There's too much confusion, I can't get no relief!"; char *pStringy; pStringy = stringy; This compiles - stringy is an array of characters, ...
Bennypr0fane's user avatar
-1 votes
0 answers
17 views

How can I convert a multidimensional array from x by y to y by x? [duplicate]

Given the 3x2 multidimensional array: const arr = [ [1, 3, 5], [2, 4, 6] ] where (1,2) === 2 and where (3,1) === 5 and etc How can I convert it to the 2x3 multidimensional array: const arr = [ [...
danday74's user avatar
  • 55.4k
-1 votes
3 answers
42 views

Retrieve array data that every nested array contains

The main goal is to select all the colors that every car.colors contain, if there's no color that every car have then the expected output is an empty array. Having an array that contains text, and a ...
mynameiszsofia's user avatar
-1 votes
0 answers
20 views

Output an object's value without looping [duplicate]

I'm trying to var_dump the guid value in this object without setting up a foreach loop. I think the ["2"] key is throwing me off. This data is coming from the Toast API. Any help would be ...
Rob Myrick's user avatar
0 votes
0 answers
13 views

Google Earth Engine: error "Invalid type. Expected type: Number" trying to compute a Number while performing histogram matching on satellite images

I am working on satellite imagery on Google Earth Engine (JavaScript), and I'm experiencing some issues while I try to perform histogram matching on two images from two different time periods. In ...
Aurora Bozzini's user avatar
0 votes
1 answer
42 views

How to convert long hex string into byte array (0x69, 0x63, etc. etc.)

I have a long hex string (around 8000 bytes) that I want to convert into what I think is called a byte array. (Please be kind if I've got the name wrong.) In other words, the string begins 69636E etc. ...
emendelson's user avatar
0 votes
0 answers
38 views

Leetcode output is different from visual studio code output

I just started on my leetcode exercises and I ran into a bit of a problem. I usually work on the leetcode problems on vsc and then when I got my answer, i just copaste it onto the leetcode answer box. ...
Andrey's user avatar
  • 3
2 votes
1 answer
28 views

Extract Unique Values from a Power BI JSON in Power Automate

I have the following JSON that comes from PowerBI (via the Power Automate button function) [ { "entity": { "Power BI values": [ { "G-DATEMO":...
BobsBugs's user avatar
1 vote
2 answers
39 views

How can I, having two arrays, remove elements of the second array to the first array - PostgreSQL?

Let's say I have a table t, 2 of its columns are A1 and A2. It looks something like this: A1 A2 ID 1,3,6,9,11 3,9 1 2,3,5,7 3 2 ... I want to add a column with the result: A3 1,6,11 2,5,7 ... ...
user26413110's user avatar
-1 votes
1 answer
42 views

Javascript: How to compare a parent array of array with more than two similar elements of another array and return unique array of arrays

const array1 = [[1, 2, 3], [1,3,4], [1,2,5]]; let b = [] let c = [2,3] array1.forEach(e => { c.some(r => { if(e.includes(r)) b.push(e) }) }) console.log(b) got the ...
sharath222's user avatar
1 vote
0 answers
31 views

Unable to insert array and map data into the databricks table programmatically in python

Trying to insert array and map (dictionary/json) data into Azure databricks table using both SQLAlchemy as well as databricks-sql-connector. getting differenet error from sqlalchemy import ...
Chinmaya's user avatar
0 votes
1 answer
19 views

Modifying a Complicated Map Formula to put in Header

I've got a complicated formula that I don't understand: =map(A2:index(A:A,match(,0/(A:A<>""))),lambda(Σ,if(Σ="",,map(BZ1:CW1,lambda(Λ,let(x,index(sumifs('Ref4'!Q:Q,'Ref4'!G:G,...
Tyler Depke's user avatar
-1 votes
0 answers
43 views

I need help reversing an array in C [duplicate]

Hey I'm a beginner to C so please excuse any beginner mistakes I make on this platform. I am trying to write a program that reverses the order of the elements elements of an array and prints it. I ...
Draj136's user avatar
-2 votes
0 answers
19 views

How to find matching words and phrases in two strings with php [closed]

I have two strings. In the spam.php file, $bad_words list looks like this (they can be a word or phrases): $bad_words = " kittens fake driver license real passports buy passports buy driver ...
VitalSigns's user avatar
0 votes
2 answers
127 views

Can not create Function array in Java 8

I have a class called SFunction which extends from Function in JDK 8 @FunctionalInterface public interface SFunction<T, R> extends Function<T, R>, Serializable { } Now I have several ...
flyingfox's user avatar
  • 13.5k
0 votes
1 answer
21 views

useState returning empty array on default state, using react + supabase

I need help to understand why when I console.log(menus) on Menu.jsx it returns an array of values, but if I console.log(item) it only returns an empty array, while the default value of the item is &...
eko pram's user avatar
0 votes
1 answer
18 views

Transform Long Data to Table

If I have a data like this: Column A 1 2 3 4 5 6 7 8 What formula should I use if I want it to look like this in spreadsheet? Column A Column B Column C 1 2 3 4 5 6 7 8 Thank you! I ...
Ayu Eka's user avatar
0 votes
1 answer
14 views

DynamoDB Storage type for an array of objects?

I'm wanting to store an array of objects in my DynamoDB table but I'm unsure of which data type I should be specifying. For example, I'm getting an API response with data that looks like: { id: 123, ...
physicsboy's user avatar
  • 6,074
0 votes
0 answers
8 views

How can I set an alert on a condition met in an array in Pinescript

I have an array that is being set with divergences. What I want to do is add a conditional statement for IF the array contains cwmacd and macd together and another one that checks IF the array ...
OnePlusTwo's user avatar
0 votes
1 answer
52 views

How to loop through an array?

How do I loop through an array? The idea is to go to the Names worksheet, Where I have a list of users Initials and names in a list. Create 2 arrays that record the initial and name of each person. ...
One foot in the Grave's user avatar
0 votes
0 answers
48 views

Why is my array value not equal to a literal?

I am new to assembly and was trying to work with an array. However, I was geting caught when try to compare the array value to a constant stored in a register. From the following code I was expecting ...
Jeremy's user avatar
  • 1
1 vote
1 answer
38 views

How to stop the second console.log from including the array of the first in its calculations?

I made a function that will find the sum of whatever array you put in. The problem is that if I have 2 of these console.log up, the second will add the sum of the first to it's result. What am I doing ...
Issac Alleyne's user avatar
1 vote
1 answer
50 views

Filter multideminsional array in PHP so that if certain values are duplicated in sub-arrays the redundant ones are unset [closed]

In an application, redundant but non-identical arrays are being returned. I'd like to remove the redundant arrays from the multidimensional array. Though the issue could possibly be solved closer to ...
CK MacLeod's user avatar
  • 1,050
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'...
user1931511's user avatar
-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 ...
MasterMax's user avatar
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); ...
khushal dak's user avatar
-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 = {...
Chobbit's user avatar
  • 493
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 ...
knods's user avatar
  • 23

15 30 50 per page
1
2 3 4 5
8347