Tagged Questions
1
vote
5answers
53 views
Thorough understanding of any multi-dimensional array in Java
I am a Java beginner and multi-dimensional array questions have been asked before but none of the answers have been clear and concise.
For instance, when a 2-D array is initialized like this:
...
0
votes
1answer
37 views
Merge two multidimensional associative arrays
I have these two arrays that I would like to merge together into 1 array but been having a hard time figuring out. See below for the two snippets of code:
First array:
$propSelectMaxRow = ...
0
votes
1answer
25 views
Recreate original PHP array from print_r output
Let's say I have this output from some source where I don't have access to the original PHP created array:
Array
(
[products] => Array
(
[name] => Arduino Nano Version ...
0
votes
2answers
47 views
PHP: Sort multi-dimension array [closed]
I have multi-dimension array like:
Array
(
[name] => Array
(
[0] => South Africa
[1] => Australia
[2] => Egypt
)
[img] => ...
-4
votes
1answer
30 views
Optimize and combine three if-statements in PHP
Problem:
Optimize and combine three if-statements in PHP.
Code:
// Trial phase
if (substr(strrchr($_SERVER['PHP_SELF'], '/'), 1) == "part-d.php")
{
if ($_SESSION['accuracy'] == 1)
{
...
0
votes
2answers
52 views
How to merge two multidimensional arrays without overwriting existing keys in PHP?
I'm trying to add two multidimensional arrays. The function should be the exact same as adding the arrays together like so: $new_array = $array1 + $array2, except it should work with multidimensional ...
1
vote
1answer
34 views
Sorting multidimensional array, descending
I have an multidimensional array in my ruby which looks like this :
arr= [{"10.0.1.50", "4"},
{"10.0.1.51", "10"},
{"10.0.1.48", "7"}]
I want to sort it such that the result should be:
...
4
votes
8answers
130 views
How to Convert int[] to int[,] - C# [closed]
It look simple, yet I just can't' wrap my head round the logic. I have an int array in this form {1,2,3,4,5,6} and I want to convert it into this form {{1,2}, {3,4}, {5,6}}
How do I achieve this ...
0
votes
1answer
44 views
How to identify the indices of certain characters in this array?
For my game, I read in text file in order to set up my map. The text file is a series of characters separated by commas, with each character representing a tile in the game. For example, a section of ...
6
votes
4answers
112 views
A workaround for a big multidimensional array (Jagged Array) C#?
I'm trying to initialize an array in three dimension to load a voxel world.
The total size of the map should be (2048/1024/2048). I tried to initialize an jagged array of "int" but I throw a memory ...
0
votes
3answers
44 views
Efficient solution to compare two large arrays
I like to compare two arrays without using in_array as both of these arrays are extremely large (50,000 plus). I like to generate a new array of all the ones that are missing from the first array.
...
2
votes
2answers
54 views
finding size of multidimensional array
How would I find the size in bytes of an array like this?
double dArray[2][5][3][4];
I've tried this method but it returns "2". Maybe because the array is only declared and not filled with ...
0
votes
1answer
57 views
C-style Multidimensional Array in ARC Objective-C
I'm trying to implement an n x n multidimensional array of ints in Objective-C, and because using NSMutableArray seems to be too much of an overhead I decided to implement it using only C's malloc and ...
-1
votes
2answers
43 views
Creating object of array dynamically in javascript/jQuery
I want to create a variable which would look like this:
var projects = [
{
value: "jquery",
label: "jQuery",
desc: "the write less, do more, JavaScript library"
},
{
...
0
votes
6answers
75 views
What is the dimension of a array with 4 brackets
say I have an array like:
double theArray[2][5][3][4];
I don't quite understand the last dimension.
first is [][][][][]
second is [][][][][]
[][][][][]
third would make it 3 ...