Multidimensional-arrays can be described as "arrays of arrays". Multidimensional-arrays are often used to put values in a table format (e.g. rows and columns).

learn more… | top users | synonyms

0
votes
1answer
32 views

Mapping multidimensional array in rails to an array

I have a list of beers that a user has in their cellar through cellared_beers so that a user has many beers through cellared_beers and vice versa. Each cellared_beer has extra data like year and size ...
0
votes
2answers
17 views

Creating a multidimensional dictionary in C# for Windows Phone 7.8

I need to store daily statistics in the isolated storage of Windpws Phone which leads me to believe that a multidimensional dictionary would be the most useful but I'm having trouble wrapping my head ...
1
vote
4answers
65 views

How to create a C++ bool 2D array with size 40,000?

I want to make a bool matrix named connectionsOf with size of up to 40 000. Here is my code: int index = 40000; bool connectionsOf[index][index]; However, when I run it on a file with 37 000 ...
1
vote
1answer
27 views

Blitz++: Filling an array with random numbers

I am trying to compare the performance of Blitz++ / Armadillo / Eigen and my own library. I am currently doing the following using Blitz++: ... Array<T, 1> s(samples); Uniform<T> rand; ...
0
votes
2answers
52 views

What's the error in my foreach loop?

Following is my multidimensional array named $prev_map_data: Array ( [0] => Array ( [class_id] => 2 [class_name] => II [class_checked] => 1 ...
1
vote
2answers
45 views

JavaScript - Compare two multidimensional arrays

I have two multidimensional arrays: first is something like (['one','one','three'],['four','five',five'],['one','one','one']) second is like this ...
0
votes
7answers
54 views

How to create Dynamic Two Dimensional Array [JAVA]

I am new to java and I want to create a 2-dimensional array in which the rows are static but the columns are dynamic. double [][] lastSecArray = new double [2][41]; int lastValue = -1; public foo ...
0
votes
2answers
39 views

What's the error in my foreach loop over multidimensional array?

Following is my multidimensional array named $prev_map_data: Array ( [0] => Array ( [class_id] => 2 [class_name] => II [class_checked] => 1 ...
2
votes
2answers
25 views

How to access the values from inner key of associative array in PHP?

Following is may multidimensional array named $form_data: Array ( [form_submitted] => yes [teacher_id] => 3807f31f8c4357bbb56662047529dcde [cs_map_ids] => Array ( ...
0
votes
1answer
16 views

Form an array hierarchy from specifically-formatted strings

I'm iterating over a folder and formatting its contents in a certain way. I've to form an array from this set of strings: home--lists--country--create_a_country.jpg ...
0
votes
3answers
34 views

How to change the keys of multidimensional array in PHP?

My multidimensional array named $cs_map_data is as follows : Array ( [2] => Array ( [class_id] => 2 [class_name] => II [class_checked] => 0 ...
0
votes
0answers
26 views

Treating a 3D array like a list, adding entries at given positions

I have a block of code that is designed to decode MIDI files into a 3D array. The first dimension (size 3) holds voice data in slot 0, note data in slot 1, and volume data in slot 2. The second ...
1
vote
1answer
43 views

Selecting some dimensions from a multi-dimensional array

I have a 4-D array, and I need to process all 1-D vectors from this array along a given dimension. This works well: def myfun(arr4d,selected_dim): # selected_dim can only be 2 or 3 ...
0
votes
1answer
30 views

php eliminate blank option lines in for loop echo [closed]

I have a strange thing happening and I don't know why. I have a multidimensional array that looks like this: Array ( [0] => Array ( [title] => I'm a title [desc] ...
4
votes
2answers
60 views

MySQL tables or PHP explode for business hours

I need to store business hours for 200+ unique businesses (and growing). Each business has varying hours and some are closed for lunch. In addition, a business might open at 8am one day and 9am on ...
0
votes
3answers
46 views

jQuery: function to check if array is multidimentional

I just wanted to know if anyone knew of a simple function to check if a given array is multidimensional and, if possible, also see how many dimensions it has. Here is a sample array: ...
0
votes
1answer
29 views

How to access a key from multidimensional array in smarty?

I've got the following multidimensional array named $cs_map_data in PHP file and I've assigned it to the smarty template: Array ( [2] => Array ( [class_id] => 2 ...
0
votes
3answers
53 views

json_encode() on a multidimensional array - with string keys

I am creating an very large multidimensional array using PHP. Each object contains Name, ID, ParentID and Children. Children is an array of more objects in the same format. It is critical I name the ...
-6
votes
1answer
32 views

fetch multi level array in php [closed]

I am stucked in fetching cvname variable in these complicated array. Array ( [0] => Page Object ( [blocksAliasedFromMasterCollection:protected] => [cID] ...
0
votes
3answers
32 views

extract name from mulitple levels multidimensional array

I have multidimensional array. It can be extented upto N- levels. I want to collect only name. Name from child to Parent. For example I need output like this name => ...
1
vote
6answers
45 views

Sort & shuffle multi dimentional array

Im working on gaming project. Which needs sort & shuffle multidimentional array. First i need to sort based on bid. If multiple bids are same i need to sort based on priority. If bid & ...
0
votes
0answers
18 views

Protobuf-net Jagged/multidim arrays, surrogate, wrapper etc one more time

I have found many similar questions here on the stackoverflow. But this one becomes really point of my interest : How do you serialize/deserialize jagged/nested arrays with protobuf-net? From Marc`s ...
-1
votes
3answers
29 views

How to insert a new key-value pair in an associative array in PHP? [closed]

I've an associative array named $classes_data as follows: Array ( [2] => Array ( [class_id] => 2 [class_name] => II [subjects] => Array ...
-1
votes
2answers
59 views

How to access elements in double pointer style matrix

double **matrix = NULL; matrix = (double **)malloc(sizeof(double *) * N); // N is the size of the square matrix for(int i=0; i<N; i++) { matrix[i] = (double *)malloc(sizeof(double)*N); } // ...
0
votes
1answer
27 views

multidimensional array sum and sorting

$inventory = array( array("fruit"=>"orange", "price"=>3), array("fruit"=>"kiwi", "price"=>2), array("fruit"=>"apple", "price"=>3), array("fruit"=>"apple", ...
2
votes
5answers
67 views

Iterating through many arrays in C

I have a header file that has many arrays. Each array pair (i.e. x0, y0) are the same length, but different pairs have different lengths. numPaths[] = 4; pathLengths[] = {12, 11, 13, 10}; int x0[] ...
0
votes
2answers
31 views

Accessing Object within Array

I have the following output: Array ( [0] => stdClass Object ( [id] => 20 [news_title] => Startup finance docs in GitHub [news_url] => ...
2
votes
2answers
47 views

reading from file and pass to a two dimensional array in C

I want to read a text file and put it's data into a 2 dimensional array. This code works for a small text file like 0 1 1 1 0 1 1 0 1 1 1 1 but gives segmentation fault for a big text file and 648x512 ...
2
votes
6answers
75 views

Python: Find number of occurrences of given array within two-dimensional array

How best to find the number of occurrences of a given array within a set of arrays (two-dimensional array) in python (with numpy)? This is (simplified) what I need expressed in python code: patterns ...
1
vote
4answers
45 views

Best way to slice multidimensional array on the basis of keys in PHP?

I have an result array like this:- $array = array( 'key1' => array('...'), 'key2' => array('...'), 'key3' => array('...'), ...
1
vote
2answers
37 views

php foreach with multidimensional array do I need to use a key?

I have the following multidimensional array called $responses and it looks like this when I do a print_r My foreach loop looks like this but it's not working: foreach ($responses as $response) { ...
5
votes
3answers
118 views

Creating a multi-dimensional array using a for loop

There are many solved multi-dimensional array posts, but I am having difficulties trying to create one through a for loop. This is the code snippet of code that I am trying to do. //Get a list of ...
0
votes
3answers
50 views

sort array on clothing sizes (multidimensional array)

My array looks like this: Array ( [0] => Array ( [id] => 613 [kleur] => royalblauw/wit [maat] => maat XL [voorraad] => 100 ...
0
votes
3answers
53 views

Can't add variables to my array

I keep getting this weird issues when I'm constructing my Ulam (Prime) Spiral. What I am doing in SpiralMaker() is using a 4 step method to create the spiral. As long as the location is less than the ...
0
votes
2answers
35 views

C++ multidimensional array and pointers to table of pointers

Here is the thing. I can completely understand a concept of a multidimensional array (let's consider 2D for a while) made by pointer to array to pointers and so on... We do something like this: // ...
0
votes
2answers
19 views

reading from text file to two dimensional array

I try to read a text file and pass all integers to a 2 dimensional array one by one. But when i print what I tried to pass, I get weird outputs. What could be the problem? For example if the text is: ...
1
vote
3answers
29 views

Pushing into a 2 dimensional PHP array

Friends, I am creating a drupal form (its my second one yay!) and I am pulling from the database information about Coursework. a very simple coursework_id and a coursework_name. Now the usual format ...
3
votes
2answers
38 views

Comparison of methods appending arrays in a foreach loop

I've set up an array of associative arrays (with dummy data for testing) like this: // To hold dropdown filter options $results['filters'] = array('Client' => array( array('a' => '1') ), ...
-1
votes
2answers
54 views

Multidimensional array of char pointer

Good day to everyone, there's some kind of big deal that I cannot figure out. I create a multidimensional array of pointers: char *listA[5000][2]; In particular condition, I want that specific ...
-1
votes
0answers
24 views

Export a multidimensional array to CSV in javascript

I am trying to export a large array that looks something like this: exportArray = [Array[3], Array[3], Array[3], Array[3], Array[3], Array[3], Array[3], Array[3], Array[3], Array[3], ...
0
votes
3answers
108 views

c style string and dynamic allocation in c++

I must implement a bunch of methods that allocates, modify and free a 2D array of c-style string. I cannot use string nor vectors nor any stl container. getNewMat : char*** getNewMat(int w, int h){ ...
3
votes
1answer
82 views

How to pass two dimensional array to a function in F#?

I am trying to create a function in F# that takes as input a two dimensional array of integers (9 by 9), and prints its content afterwards. The following code shows what I have done : let printMatrix ...
0
votes
2answers
17 views

compare two multidimensional arrays of object and set new property true/false pending match on larger set

I Have an array of objects example: Larger Set: Array( [0] stdClass Object( [ID] => 1, [name] => monkey, [sub] => ...
0
votes
1answer
35 views

dynamic 2d char array allocation not working correctly

I am trying to make a 2d char array of dynamic size. Whenever I allocate the memory, the inner array always ends up being the same size as the outer array. char **memory; int outer = 1000; int inner ...
1
vote
2answers
28 views

append new data to multidimensional array

please help me out. I want to append new data to a multidimensional array but structure it the same way the original was structured. Here's what I have right now: <?php session_start(); $ses = ...
2
votes
4answers
72 views

ReDim Preserve to a Multi-Dimensional Array in Visual Basic 6

I'm using VB6 and I need to do a ReDim Preserve to a Multi-Dimensional Array: Dim n, m As Integer n = 1 m = 0 Dim arrCity() As String ReDim arrCity(n, m) n = n + 1 m = m + ...
0
votes
2answers
33 views

C++ Passing Polymorphic Pointer of Pointers to Function

In trying to shorted my code for readability, I wound up changing too much and making mistakes. This is still condensed but taken straight from my code. My problem is that I have a class called ...
0
votes
1answer
16 views

google checkout - how can i extract info from array

I've recently been having issues with google checkout - i believe the customer ip address is no longer being returned in the response. However, i'm not sure how to view all parts of the array. How ...
0
votes
2answers
28 views

Grouping counted values of Multidemsional arrays

I am attempting to not only count the amount of times a certain value appears in an array, but also limit the output to only even results. $quotes = array( array( 'quote' => 1, ...
1
vote
1answer
25 views

Perl: increment 2d array cell?

I have a set of numerical data for which is important to me to know what pairs of numbers occured together, and how many times. Each set of data contain 7 numbers betwen 1 and 20. There are several ...

1 2 3 4 5 118
15 30 50 per page