Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
2 votes
1 answer
150 views

I am attempting to move away from std::vector<std::vector<int>> types and use boost::multi_array in its place. I am struggling how to initialize such data members though. I used to have a ...
One_Cable5781's user avatar
Advice
0 votes
3 replies
88 views

I'm in C and I have an int ** (2 dimensional array, it's basically a matrix, it's actually set up a little bit complicated but there's no internal aliasing, so it's not relevant). is this int** ...
Snark's user avatar
  • 1,674
3 votes
2 answers
125 views

I'm trying to create a package of generic adjacency matrices to define graphs, and the first goal is to define a static version based on two-dimensional array: with Ada.Containers.Vectors; generic ...
tymurmchyk's user avatar
1 vote
2 answers
110 views

I have the following code to sort the items based on a timestamp. $arr = []; foreach(glob('*.json') AS $item) { $data = json_decode(file_get_contents($item), true); $arr[] = [ 'taken' =...
Airikr's user avatar
  • 6,468
-1 votes
2 answers
112 views

I am trying to make a loop that will fill in an array of arrays that will contain every possible colour value in rgb form given the bit depth. However, I have noticed that even after an array is ...
Chi Sum Lam's user avatar
1 vote
1 answer
89 views

I want to extract "email" from JSON using ADF/Synapse. Below is the JSON that I want to flatten and extract all "email" which is in an object in a multidimensional array: { "...
user31502762's user avatar
2 votes
1 answer
94 views

I want to read an Excel file without openening the file and put the result in a two dim. array. For this I use the below code Sub ReadExcelFileWithoutOpening() Dim conn As Object Dim rs As Object Dim ...
Stephan's user avatar
  • 665
-1 votes
1 answer
170 views

After some extensive search I could not find a clear answer to the following issue. When one is to compare the 1D (vector<type>) vs 2D (<vector<vector<type>>>) vector ...
rk85's user avatar
  • 163
1 vote
2 answers
183 views

In my initial question there was some confusion as to what I was really trying to do. Specifically, when I edit large images i store them in an array of pixels where Pixel image[iwid][ihei] is my ...
Vigor's user avatar
  • 11
1 vote
1 answer
108 views

I am using the following code for automatic vector/matrix template parameter deduction (I am particullarily interested in automatic deduction from passing initializer lists) template<class T, ...
Xenos's user avatar
  • 223
1 vote
2 answers
91 views

I am trying to convert an XML string into multi-dimensioned PHP array. The difficulties are that XML comes with attributes and has nested values. My code works at parent level data but I am not sure ...
user5705009's user avatar
2 votes
3 answers
192 views

I have a question about the performance tradeoffs between different ways of storing 2D arrays in memory in C. I know that if I declare a 2D matrix A with dimensions MxN by the following: int (*A)[N] = ...
Martin's user avatar
  • 85
0 votes
0 answers
86 views

I'm looking at the newly-introduced std::mdspan class template (also described here on SO). One of the template parameters is, according to cppreference: LayoutPolicy - specifies how to convert ...
einpoklum's user avatar
  • 137k
0 votes
1 answer
83 views

i would like to create a nested list of arbitrary depth (containing numerical values specifically) with uniform arbitrary lengths at each level and then compress it to a NumPy array of minimum ...
L8t Original's user avatar
1 vote
2 answers
72 views

Solution requirements: Pre C++11 Statements: Function someFunction exists, that accepts 2D vector as vector of string vectors: vector2d. Class someClass exists, that contains 1D vector of strings: ...
KamilK's user avatar
  • 11
1 vote
1 answer
84 views

#include <stdio.h> int main() { int arr[2][3] = {1,2,3,4,5}; printf("%d", (*arr)[4]); return 0; } See the array declaration in the above code. As per my knowledge, this ...
0xChaitanya's user avatar
0 votes
1 answer
85 views

In TIBCO BW6, I am trying to parse below JSON having nested array with below XSD. But getting error : TIBCO-BW-PALETTE-REST-100016: An error occurred while converting json to xml: Content of array ...
Nitinamg's user avatar
0 votes
1 answer
113 views

I have this intermediary buffer that has the entire contents of a file: char *intermediary_buffer I need to move this to a different 2D buffer: char **final_buffer Where a new row is started every ...
Everlee Jones's user avatar
2 votes
2 answers
116 views

I am using Code::Blocks 20.03. I have been trying to print a string from a 2D char array but only receive random characters. int main() { char str[5][80]; str[1][80] = "hello world"; ...
Peakka's user avatar
  • 51
2 votes
1 answer
123 views

The C++ standard library, and specifically its part involving containers and ranges, is mostly "one-dimensionally oriented" - things have a start and and end you go from start to end. If you ...
einpoklum's user avatar
  • 137k
2 votes
1 answer
79 views

Please check the below code, the mat array after the second rotation should be identical to the target array tar. However, it is not happening. Could you please review to check where the logic is ...
Sakib's user avatar
  • 37
1 vote
3 answers
117 views

I have an array of some parameters (like a YAML config file) and this need to be written to database finaly with primary ids and so on. For example this is a part of my array: $settings = [ 'basic'...
Joeker's user avatar
  • 123
-2 votes
1 answer
74 views

We have a large web app with a lot of files where english language strings are in a file. Consider this file: sample.php <?php $newFlowString['english']['login'] = "login"; $...
SSMan74's user avatar
2 votes
2 answers
80 views

I am trying to sort the values in the Data array into Column arrays X1,X2, and Y_actual. The code I have written out makes sense to me, and returns the correct array1,array2, and array3 values if I ...
Jackatoe's user avatar
1 vote
2 answers
108 views

When passing a 2-dimensional array to a function in C, I normally just pass it by using a single pointer. Example : void process_array(int* arr, int rows, int cols) I see 2-dimensional arrays also ...
Engineer999's user avatar
  • 4,159
0 votes
3 answers
147 views

I am trying to use a for loop to create a series of data, assign that data and the index number to an array, and then send that array to a worksheet. This sends only the data and not the index number ...
Squid1622's user avatar
1 vote
1 answer
75 views

I am trying to permanently add a row to a 2 dimensional array in apps script, however it only adds the row temporarily and it's gone as soon as the function completes. I plan to do more with this ...
Jake Molenkamp's user avatar
3 votes
2 answers
124 views

Suppose I have a database in memory that I want to modify. Let's say the tables are phone information and items. The phone information consists of a name up to 99 characters and a character code. The ...
Mike S's user avatar
  • 33
1 vote
1 answer
86 views

I am trying to use scipy.ndimage.correlate to replicate the output of IDL convol() function. The IDL function only calculates elements where there is full overlap between the input and the kernel. So, ...
Arya Akmal's user avatar
0 votes
4 answers
183 views

char array[8][13]; memset (&array, 0, sizeof(array)); /* this is a rough example this is in a struct that is memset */ if (array[0]) { printf("this is valid"); /* again this code is ...
John Reed's user avatar
0 votes
1 answer
71 views

I can iterate over rows (or columns) of an ndarray in Rust, e.g.: use ndarray::array; fn main() { let a = array![[1, 5], [3, 7]]; let b = array![[2, 4], [8, 6]]; for row in a.rows() { ...
Roger V.'s user avatar
  • 803
1 vote
2 answers
106 views

I am trying to sort the tuples in the 2D array based on a single column value similar to Javascript's sort function. arr.sort((a,b) => a[0] - b[0]) C Code : #include<stdio.h> #...
Bittu970's user avatar
  • 107
6 votes
1 answer
76 views

I have the following code : #include<stdio.h> #include<stdlib.h> int comp(const void *a, const void *b) { return (((int*)a)[0] - ((int*)b)[0]); } int main() { int arr[][4] = { ...
Bittu970's user avatar
  • 107
0 votes
1 answer
66 views

Note: I have no idea what one might call this operation, so I've gone with "cut-and-overlap". Please let me know if there is an accepted terminology for something like this! Intro I need to ...
Heisenbugs's user avatar
0 votes
0 answers
50 views

One can easily concatenate (stack up) four arrays by using: B = cat(3, A, A, A, A); % here A is 2-dimensional M x N matrix and B is 3-dimensional M x N x 4 stack How is it possible to concatenate (...
Crowley's user avatar
  • 2,341
0 votes
0 answers
37 views

I have an array img_data of shape (x, x, n_channels) and I want to convolve / smooth along the axis=2. Specifically, I would like the output shape to be (x,x,n_channels//3), after convolving the ...
Anks_Eagle's user avatar
0 votes
2 answers
79 views

I have here a nested array: const roster = [["Ryu","RyuNormal"], ["Ryu as Ken","RyuKen"], ["Ryu as Akuma","RyuAkuma"], ["Chun-Li",&...
Wammy's user avatar
  • 63
-3 votes
1 answer
51 views

My result I need to make the number of stars decrease with each line, but I have no idea how. import random import numpy as np import sys size = int(sys.argv[1]) mat = np.full((size, size), '\x1b[35m....
wbowser 's user avatar
4 votes
3 answers
175 views

Consider the following code: #include <stdio.h> int main() { int **s = (int**)malloc(3 * sizeof(int*)); for (int i = 0; i < 3; i++) { printf("%d\n", s+i); } ...
M. Saamin Rahman's user avatar
0 votes
0 answers
81 views

I am unable to create a json object with nested objects. See the code and the current output versus the desired output. Goal Output: { "carlist" : [ { "attributes": [ { ...
CavFife's user avatar
0 votes
2 answers
72 views

Assuming a 2d array as input, how can each first level key be copied as a new element in its second level row? Sample input: $members = [ 'myname' => ['userid' => 52, 'age' => 46], '...
mickmackusa's user avatar
  • 49.2k
1 vote
2 answers
93 views

A list $tags = 'a','b','c','d','e' the process $array = New-Object 'object[,]' 3,5 $array[0,0] = $tags[0] $array[0,1] = $tags[1] $array[0,2] = $tags[2] $array[0,3] = $tags[3] $...
deetle's user avatar
  • 437
0 votes
1 answer
69 views

I've initialized a list of arrays of different dimensions in Python and want to write to the entries of the arrays. If I want to write to the entry list[i, m1, m1, ..., m1, m2, m2, ..., m2] where m1 ...
serene's user avatar
  • 13
0 votes
2 answers
102 views

I'm working on a tool to create inputs for array simulations, where various inputs are iterated over multiple series to create all combinations of inputs. Some values need to iterate coupled together, ...
Tristan Muzzy's user avatar
3 votes
1 answer
115 views

I ran a few tests on 2d arrays and found that in some contexts, native sorting functions can give unexpected results when array keys are 2, 5, 10, or 13. $expected = range(0, 11); $array = array_fill(...
mickmackusa's user avatar
  • 49.2k
0 votes
3 answers
221 views

I am currently attempting to create a triple pointer to point to and update the contents of a statically allocated 3d array in C. The updating of the elements of the array will be completed by a ...
frank's user avatar
  • 41
0 votes
3 answers
124 views

I have a dynamic array, each group of lines start with a specific code "S10.G00.00", "S10.G00.01", "S10.G00.02" ... The array may be like this: array:20 [▼ 0 => &...
hous's user avatar
  • 2,766
1 vote
1 answer
79 views

when I get my data series with foreach, I get the result in the structure below in the structure [N]==1 match result 1 win [N]==2 match result ends in a draw [N]==3 match result away win [O] parts are ...
user29401486's user avatar
1 vote
1 answer
130 views

What am I trying: To Load a csv file into memory of 2d array, then print the array to output. The format in which I planned to load can be represented like the below give image: In simple terms, the ...
PsquareJ Lol's user avatar
1 vote
0 answers
93 views

I have an ndarray array that is used throughout my program: Note: ndarray and nalgebra are both used here, imported as nd and na respectively. let test: nd::ArrayBase<nd::OwnedRepr<na::...
Pioneer_11's user avatar
  • 1,441

1
2 3 4 5
724