multidimensional-array

Javascript multi-dimensional array issues

Here is a sample of the global.heights array: [[190, 76, 209, 57, 114, 171, 76, 513, 209, 171, 76, 152, 76, 76, 190, 114, 95, 76, 76, 95, 57, 133, 114], [152, 76, 133, 38, 95, 133, 76, 342, 190, 114, 57, 152, 76, 57, 133, 76, 76, 76, 57, 76, 57, 76, 76], [], []] What I need to do is make another array a part of the global array (simpl...

2D arrays with C++

I have a function that takes a pointer to a pointer an as argument. func(double **arr, int i); where in the main function the array is defined as follows: double arr[][] = //some initialization here; How can I call this function from my main code. I tried the following but it gives an error func (&arr); Doesn't work. Any help ...

2-dimensional arrays in C# and how to return the array

Hi, I'm having trouble with declaring 2-dimensional arrays in C#, populating them and then returning the array. At the moment, I'm declaring the array like so: private static string[,] _programData = new String[50,50]; public string[,] ProgramData { get { return _programData; } } ...

Dynamic list slicing

Good day code knights, I have a tricky problem that I cannot see a simple solution for. And the history of the humankind states that there is a simple solution for everything (excluding buying presents) Here is the problem: I need an algorithm that takes multidimensional lists and a filter dictionary, processes them and returns lists ...

How to Flatten a Multidimensional Array?

Is it possible, in PHP, to flatten a (bi/multi)dimensional array without using recursion or references? I'm only interested in the values so the keys can be ignored, I'm thinking in the lines of array_map() and array_values(). ...

Retrieve first key in multi-dimensional array using PHP

I would like to retrieve the first key from this multi-dimensional array. Array ( [User] => Array ( [id] => 2 [firstname] => first [lastname] => last [phone] => 123-1456 [email] => [website] => [group_id] => 1 [company_id] => 1 ...

C# Convert a 2-dimensional array into a dataset / datatable

hi, does anyone know how to turn a 2-dimensional array into a dataset or datatable in c#? Source: a range of values from excel (interop) in an object[,] array. Thanks. ...

Find array key in php and change its value or contents?

Given a multi-dimensional array that you don't necessarily know the structure of; how would one search for a key by name and change or add to it's contents? The value of the key could be either a string or an array and the effects should be applied either way--I had looked at array_walk_recursive, but it ignores anything that contains an...

Writing part of an array to a worksheet range

Since it is not possible to dynamically delete a single row (record) of a 2D array, I am looping through it to find certain records to exclude. I want to write out the good portion of the array to a temporary array, then back... and in the process eliminate the unwanted record. Any example code of success with this? ...

Transform an array to several sql statements

Hi, I have a array that looks like this Array ( [provider] => Array ( [id] => provider1 [distribuitor] => Array ( [0] => Array ( [name] => distribuitor1 [machines] => Array ( ...

c# cast byte[*,*,*] to byte[]

Hey there! I have an object with a Property of type byte[,,*] now i'd like to use System.Random::NextBytes() to fill this multidimensional array with random values. NextBytes however takes an argument of byte[] can i cast the multidimensional array somehow to the singledimensional one in order to pass it as an argument? thanks! ...

Is int *array[32] a pointer to an array of 32 ints, or an array of 32 pointers to int? Does it matter?

If I write int *columns[32]; am I defining an array with 32 pointers to ints? Or is it a pointer to an array of 32 ints? How do I differentiate between the two? Is there a difference? ...

How can I create a numpy array holding values of a multi-variable function?

I want to create an array holding a function f(x,y,z). If it were a function of one variable I'd do, for instance: sinx = numpy.sin(numpy.linspace(-5,5,100)) to get sin(x) for x in [-5,5] How can I do the same to get, for instance sin(x+y+z)? ...

.NET: Writing one 2D array onto another

It would be easy enough to make my own system for this, but I'm figuring that the .NET library, being as massive as it is, probably already has a class made for this very purpose. For hit detection, my VB.NET game uses two 2D arrays that store the state of each pixel in the level. Each element in these arrays is a Byte (or, more accurat...

PHP - Multi dimensional SESSION array a good or bad idea for performance?

Are there any reasons not to want to use a multi dimensional SESSION array to store temporary user data? ...

Debugging a 2D array in VS2008

I have a 2D array which contains height information. I want to see it in the debugger to a certain point if the values are correct. I know we can see a 1D array using "myArray,5", but it doesn't work when i write "myArray,5,5" or "myArray[0],5", without the quotation marks. Does anybody know how to do this? Or is this even possible? ...

PHP - Highlight duplicate values in a multidimensional array

I'm outputting a list of purchases, and I want to automatically highlight the presence of duplicate orders. Here's what the array looks like. The first two orders are duplicate orders place by mistake. You'll notice that the orderid for each is different, while the email and userid remain the same. So the duplication will need to match ...

How to recursively create a multidimensional array?

I am trying to create a multi-dimensional array whose parts are determined by a string. I'm using . as the delimiter, and each part (except for the last) should be an array ex: config.debug.router.strictMode = true I want the same results as if I were to type: $arr = array('config' => array('debug' => array('router' => array('strictM...

how to implement Multidimention array

Hi, I want to use a multidimensional array. Can any one explain how to use that in an iPhone app? I'm new to Objective-C. Here's what I'm trying to do: I am spliting the main string on the basis of seprator and storing in an array. replacing some content of this array's each elements with new substrings and new values are storing ...

[PHP] How to convert all keys in a multi-dimenional array to snake_case?

I am trying to convert the keys of a multi-dimensional array from CamelCase to snake_case, with the added complication that some keys have an exclamation mark that I'd like removed. For example: $array = array( '!AccountNumber' => '00000000', 'Address' => array( '!Line1' => '10 High Street', '!line2' => 'London')); I woul...