c,arrays,multidimensional-array,initialization,compiler-warnings
I am trying to initialize a 2D array of user defined type to zero by using following line, qmf_t X_hybrid_left[32][32] = {{0}}; Where qmf_t is a user defined type. Here I get the compiler warning, warning: missing braces around initializer [-Wmissing-braces]" But if I use, qmf_t X_hybrid_left[32][32] = {{{0}}};, i.e....

javascript,angularjs,multidimensional-array,angularjs-ng-repeat,ng-repeat
I have an object in this format, I am trying to print it as a table. [{categoryName: "category1", value:[{name:"item1.1"}{name:"item1.2"},...]}, {categoryName: "category2", value:[{name:"item2.1"},...]},...] So, categaory name should be the header and values under it should be subheaders, as in the colspan of categoryname should be equal to number of values in...

c#,arrays,multidimensional-array
I need to fill a two dimensional array in a following way: Rectangular matrix filled with zeros with a triangle of ones (its top is in the middle of first row and the lower vertices of the triangle are in the first and the last element of the last row)....

php,mysql,arrays,multidimensional-array,twig
I'm trying to create multi level dropdown menu with mysql as store data, and i use twig as theme engine, i know there is ton of code outside but, all of them HTML as the output, since i use twig, so i need array as the output, and let twig...

php,arrays,multidimensional-array
I am working on a function which fetch data from three table based on Left outer join, is as follows:- public function get_full_category_history($id) { $id = mysqli_real_escape_string($this->_con,$id); if (isset($id) && $id != "") { $query = "SELECT qz_categories.id as category_id, qz_categories.name as category_name, qz_quizzes.id as quiz_id, qz_quizzes.name as quiz_name, qz_questions.id...

python,numpy,multidimensional-array,indexing,dynamic-arrays
I'm new to python so I need some help with this: I have 2D array of numbers that represent density of a circle of material in a space and I want to locate the centre. So I want to get the index of the numbers representing the diameter and then...

javascript,performance,object,multidimensional-array
After searching for something similar here, it was not clear to me how to create an object with different levels of rows like the following example: Example: Object = { 1 : { name : bob , dinner : pizza }, 2 : { name : john , dinner :...

php,mysql,arrays,variables,multidimensional-array
i've this code, i'm trying to explode my date e.g "04 June 2015" to have the day and the month in other 2 variables, but i have all in a method, with an array, is it possible, my code doesn't work, it writes "Array[0]" why? while ($i < $number) {...

c,multidimensional-array,stack
General Background I had a need for a character array that contained a dynamic number of character arrays based on the number of files located in a specific folder. I was able to accomplish this by initializing char (*FullPathNames)[MAX_FILENAME_AND_PATHNAME_LENGTH] and then using FullPathNames = malloc( sizeof(*FullPathNames) * NumOfFiles * MAX_FILENAME_AND_PATHNAME_LENGTH...

php,arrays,multidimensional-array
I'm trying to get sum and average of visitors from the following multi-dimensional array : Array([visitors] => Array( [2015-06-12] => Array([0] => Array([value] => 29)) [2015-06-11] => Array([0] => Array([value] => 55)) ... )) I cannot manage to find a way to get the results i need as i get...

python,arrays,multidimensional-array,flask,jinja2
Within my Flask index.html template I wish to create a 2 dimensional array within a for loop. The for loop works perfectly fine but trying to 'set' an array that's multidimensional is not working. For example, one of the many things I've tried is: {% set matrix = [[] for...

php,arrays,multidimensional-array,pdo
I'm using PDO, and I managed to get the table columns despite the table name and create the bind variables, like in ... VALUES (:foo, :bar);. The method I'm trying to do this is insert(). public function insert() { // the variable names depend on what table is being used...

codeigniter,multidimensional-array
On my codeigniter project my callback is not working as would like with my multidimensional array post I am trying on my callback set message $key['image'] to display correct value of the multidimensional array post. But when I var dump it returns NULL On my set rules the multidimensional array...

java,android,arrays,multidimensional-array,arraylist
I have an array with 2 positions, each one contains a list of "ids_alunos", the first position has ids_alunos: "1,2,3" and the second:"4,5" but what is happening when I add the ids in my array is this, the first position gets "1,2,3" values and the second: "1,2,3,4,5". why is this...

php,arrays,multidimensional-array
I have two multi-dimensional arrays. I need to concatenate the two without loosing any values which have the same key and different values. Here is the scenario: Array1 ( [0] => 11 [2] => 12 [3] => 13 [4] => ( [0] => 100 [1] => 200 ) [5] =>...

arrays,scala,multidimensional-array,n-dimensional
I was looking into multi-dimensional Arrays in Scala and came across some easy ways to create multi-dimensional Arrays. Namely: val my3DimensionalArray = Array.ofDim[Int](3,4,5) //array with dimensions 3 x 4 x 5 Or even val myFilledArray = Array.fill[Int](3,4,5)(0) //Array of same dimension filled with 0's However this only works for 1...

python,c++,arrays,multidimensional-array
I'm implementing an translating a Python code to C++, however I want to place a Multidimensional array at another Multidimensional array index. The values of first array should be copied to specific index of other 2D array. Here's my Python Code: var2 = "121" a = [None for x in...

c,multidimensional-array,conways-game-of-life
I have been looking at this for a while and rewritten the code three times so far, this is what I have and what I do not understand. I have a method which checks the neighborhood, through various print lines and my running through it, this works. int getLiveCellCount(Generation *currentGeneration,...

php,arrays,checkbox,multidimensional-array
i want to fetch multiple textbox values corresponding to the checkbox selected... we can select one or multiple checkboxes at a time and on button click the output i need is like this: suppose my array is like this: array1('first','second','third'); array2('a','b','c','d','e','f','g','h','i') . and output i need is:- first,a,b,c second,d,e,f third,g,h,i...

c++,boost,multidimensional-array
I am using a dynamic array from boost in one of my classes and having trouble to write a proper getter function for it. Heres what I tried (I checked the size of the array within the class setter and with the getter from the main function): #include <iostream> #include...

python,numpy,multidimensional-array,subsetting
I have looked into documentations and also other question in here, but seems I have not got the hang of subsetting in numpy arrays yet. I have a numpy array, and for the sake of argument, let it be defined as follows: import numpy as np a = np.arange(100) a.shape...

javascript,html,arrays,sorting,multidimensional-array
i have problem with sorting multidimensional array with js.It works for second column because it contain number below 10 , but for third column it's not working. I import this table data into array <table class="myTable" id="myTable"> <col class="column-one"> <col class="column-two"> <col class="column-three"> <thead> <tr> <th>Naziv</th> <th>Cijena</th> <th>Količina</th> </tr> </thead>...

c++,c++11,vector,multidimensional-array
I have: vector<string> myVector = {0}; myVector.push_back("first"); myVector.push_back("second"); char *list[] = ???? I want it to be initialized like if I was doing this char *list[] = { "first", "second", NULL }; I know I can start allocating memory based on the size and of the vector and the size...

python,list,numpy,multidimensional-array
I have a list which contains 1000 integers. The 1000 integers represent 20X50 elements of dimensional array which I read from a file into the list. I need to walk through the list with an indicator in order to find close elements to each other. I want that my indicator...

numpy,multidimensional-array,indexing,argmax
I have a collection of 2D narrays, depending on two integer indexes, say p1 and p2, with each matrix of the same shape. Then I need to find, for each pair (p1,p2), the maximum value of the matrix and the indexes of these maxima. A trivial, albeit slow, way to...

python,matrix,multidimensional-array,indices
I convert a list of integers to a two dimensinal array like this: data = numpy.array( l ) shape = ( 10, 30 ) data = data.reshape( shape ) I try to get the indices x,y of the matrix of the values that are bigger than some threshold and lower...

javascript,jquery,arrays,multidimensional-array
At the moment I have this object: obj = [object{id: 1, name: test, parentID: 3}, object{id:1, name: another, parentID: 5}, object{id:2, name:something, parentID: 1}]. Ultimately I want an object structured in a different manner. So that it is object, but if my identifier is 1, it has a collection of...

arrays,ruby,multidimensional-array
I need to find the closest values from a set multidimensional arrays, here is the example: a = [[a,b,1,2,3],[a,b,5,6,7],[a,b,8,9,10],[c,d,1,2,9],[c,d,1,7,8]] I want to search the value closest to 1.8 from the overall arrays that contain the same elements in the first 2 index. My expected result is this: a = [[a,b,1,2,3],[c,d,1,2,9]]...

.net,vb.net,multidimensional-array
I'm trying to create a function that essentially returns an array with the following structure: (String, String, Integer) At first, I was using a SortedList(Of String, SortedList(Of String,Integer)), but it seems like a huge waste since I don't need an array for the latter of the data. Now I'm thinking...

c,arrays,multidimensional-array
I'm trying to understand pointers in C and I think I have an okay grasp so far. I am trying to make sense of arrays and how they are passed to functions. It is my understanding that when passing an array to a function it is passed by reference and...

c,arrays,multidimensional-array
I'm studying arrays, before I advance to arrays of strings, and I stumbled a problem. I looked up the questions out there, but most of the questions on multidimensional arrays are about C#, and google didn't turn out to be very handy this time. What I want to do is...

php,arrays,multidimensional-array
I'm trying to add an element to the beginning of a multidimensional array, but for some reason it's not recognizing the array I initialized as an array, even though I initialized it as an array. Please take a look: test.php $array = array(); <---initialize an array; array_unshift($array[0] , 'name'); <---add...

java,android,arrays,multidimensional-array,arraylist
I have a list of users inside of an ExpandableListView, for now I have 2 groups of list, now I'm trying to create an ArrayList that will add data as I click on the users, so if have 2 groups of schools and I click on a student of each...

php,arrays,loops,select,multidimensional-array
I am new to PHP and hope someone can help me with this. I have a Select query that returns (among others) the values from two columns in a db table, "ID" and "en". When getting the results from the Select I would like to store both these values for...

javascript,jquery,arrays,multidimensional-array
I have 10 rows of numbers, each row has 5 number separated by a dot, like so: All of those are in a row with the same class name. I now have to find in each row if they amount to 90 summed together. So if the first row contains...

r,multidimensional-array,data.frame
I like to define an 3D-array of data.frame(A,B,C,...) so that I can do for (x in 1:4) for (y in 1:5) for (z in 1:5) { m[x,y,z]$A <- dnorm(1) m[x,y,z]$B <- dnorm(1) m[x,y,z]$C <- dnorm(1) } it would be ok too, if I get a data.frame(x,y,z,A,B,C) with x,y,z ids and...

php,mysql,arrays,multidimensional-array,comparison
I have a user table. I have 2 DATETIME per row that I'm looking at. I will look at $lastLog date and $lastReceived (for last received lead) and determine which is newer and that becomes their $eligibleTime. We will then look for the oldest $eligibleTime to select which user should...

php,jquery,ajax,json,multidimensional-array
There might be an idiotic mistake in my code, but I just haven't found the answer yet. I'm using JSON data from http://rata.digitraffic.fi/api/v1/live-trains/[trainnumber] which is an external site. My objective is to get data from array inside JSON array to a simple HTML table, in this case stationShortCode, type, commercialTrack...

php,arrays,multidimensional-array,substring
I have a 2-dimensional PHP array containing strings ($fulltable) which I'm trying to fit into the datables grid (https://www.datatables.net/). Sometimes some of the strings are really long. I'd like to truncate each string to lets say to 75 charachters, which will make the fields more manageable on display. Is there...

javascript,arrays,sorting,multidimensional-array
I have an array in JavaScript. var array = [[12,3],[10,2],[8,1],[12,3],[7,1],[6,1],[4,1],[10,2],[12,3]] I would like to sort this array by the second value in descending order. The expected output is [[12,3],[12,3],[12,3],[10,2][10,2],[8,1],[7,1],[6,1],[4,1] I've tried array.sort(function(array) { return array[1] - array[1] } Unfortunately, that didn't work. Sorting single-dimensional arrays is easy but I'm not...

c,pointers,multidimensional-array,crash,copy
I have fullNames, which is a 2D array that has sorted full names in it and I want to copy its content into sortedNames, which is a 2D array that exists out side of this function. (I get ***sortedNames as a parameter). I dynamically allocated this array, but the copying...

python,arrays,numpy,multidimensional-array
In Matlab, I can do the following: X = randn(25,25,25); size(X(:,:)) ans = 25 625 I often find myself wanting to quickly collapse the trailing dimensions of an array, and do not know how to do this in numpy. I know I can do this: In [22]: x = np.random.randn(25,25,25)...

arrays,multidimensional-array,vb6,lazarus,fpc
I wonder how to decode a three-dimensional dynamic array of a custom type written to a binary file in VB6. The custom type is defined as follows: Type XYByte X As Byte Y As Byte End Type It represents two coordinates of a contact point. The three-dimensional array represents pre-computed...

ruby-on-rails,arrays,ruby,multidimensional-array
seating_arrangement [ [:first, :second, :none], [:first, :none, :second], [:second, :second, :first], ] I need to copy this array into new array. I tried to do it by following code: class Simulator @@current_state def initialize(seating_arrangement) @@current_state = seating_arrangement.dup end But whenever I am making any changes to seating_arrangement current_state changes automatically....

c,arrays,loops,for-loop,multidimensional-array
I'am trying to write a program for converting the given string in cross manner(i.e Diagonal from left-right and from right-left). If the string length is even it returns a message else arrange it in a cross form. The code is: #include<stdio.h> #include<string.h> int main() { char str[50]; char str2[50][50]; int...

arrays,multidimensional-array,lisp,clisp
I am taking input N as number of rows of a 2D matrix in lisp, where each row can have maximum of 5 elements in it. So i make it like this. Now for eachrow as it can have any number of elements between 0 to 5. So I made...

arrays,sorting,multidimensional-array
I've been trying to fill a 10X10 int array with the number 46 and want to do it in one line, with out the use of a nested forloop. I've been trying to use memset but a doubt I'm using it for the right purpose. Can I do this in...

ios,arrays,swift,multidimensional-array,set
I'm fairly new to coding in and I usually find answers already on here. However on this occasion I've been trying to find a method in swift that will allow me to identify pairs of numbers, in another array of unpaired numbers within another array for example in the image...

java,multidimensional-array,java.util.scanner
I am trying to take user input for name, last name, phone number and age. For some odd reason the scanner is skipping name but none of the other variables. Can someone point out my mistake please? I can't figure it out. import java.util.Scanner; public class Lab2{ String [][] info...

javascript,arrays,angularjs,multidimensional-array
I searched a lot, but I could not get a satisfactory answer on the net. In javascript, how do I add an array into another multidimensional array at a particular position based on a key value? finalArray = []; //final result to be stored here for(var i=0; i<5; ++i) {...

php,arrays,multidimensional-array
I have a multidimensional array $elements where I need to fill it with values from the array $ratings. The array $ratings is built so the first value will fit into the first slot in elements, the next in the second and so on. $elements 4 => array:3 [▼ 2 =>...

matlab,multidimensional-array,plot,size,cell
i have a domain of interest and this domain will be converted onto finite difference grid with cells (rows,columns) a 2-D array (cond) contains the conductivity values assigned to each cell in the desired domain when i use the pcolor command in matlab pcolor(cond); shading flat the output figure consider...

php,arrays,multidimensional-array
I have user a plugin to upload files every thing is working fine know I have to save that uploaded file name into database I need to access the file name when I do print_r() function ; $files = $data['data']; print_r($files); I get Array ( [files] => Array ( [0]...

vb.net,multidimensional-array,arraylist
Friends I have a serious issue at present and Honestly I have no idea as to why this isn't working as expected. I am more a custom to C# than VB can anyone help with the following Code Example Please note that the String is passed from other classes and...

matlab,matrix,multidimensional-array,vectorization,reshape
I'm trying to reshape a multidimensional array into the original image. I have split an image of 512x512 pixels in sub-matrices of 8x8 pixels using the great solution that I found in this question: sub_images = permute(reshape(permute(reshape(i_image, size(i_image, 1), n, []), [2 1 3]), n, m, []), [2 1 3]);...

matlab,matrix,multidimensional-array,scalar
I'm having problems multiplying specific values within my multidimensional matrix by a scalar. My matrix has the following dimension: size(comDatabe) = 5 10 3 397 10 The third dimension is an x-y-z coordinate frame. Something went wrong and now my y-axis is defined upside down for one subject (#8 out...

ios,objective-c,multidimensional-array,uiimageview
I'm working in Xcode 6 on tiling the iPhone background with many UIImageViews and I'd like to know if this is the most efficient solution. I know one simple solution would be to create image views in the storyboard and cover the entire screen with them manually. I'd like to...

php,arrays,sorting,multidimensional-array
I have two arrays stored in an array. They have the same number of values and are aligned: $matrix['label1'] $matrix['label2'] I want to apply alphabetical sorting to $matrix['label1'] and move the contents of $matrix['label1'] in the same pattern. Here is an example of input and output. $matrix['label1'] = ['b','c','a'] $matrix['label2']...

python,numpy,multidimensional-array,matplotlib,axes
I am plotting a 2-D array in python using matplotlib and am having trouble formatting the tick marks. So first, my data is currently organized as a 2-D array with (elevation, latitude). I am plotting values of electron density as a function of height and latitude (basically a longitudinal slice...

c++,arrays,oop,multidimensional-array
I have an error when compiling my code, with multidimensional array. C:\Users\Tobi13\Desktop\Projet C++\Code\Test\Test111\map.hpp|17|error: declaration of 'levelchargement' as multidimensional array must have bounds for all dimensions except the first| And I don't understand at all. I have searched on the internet but I didn't found anything. The code of map.hpp class...

php,arrays,json,multidimensional-array
I try to return a multidimensional array of dates and revenues each date as JSon array in order to display a chart in my panel dashboard. Unfortunately the chart makes some problem, when I don't hardcode my JSon Array, thus I am debugging it right now and I wonder why...

c++,arrays,multidimensional-array,initialization
I am trying to initialize a multidimensional array in batches and can't seem to make it work or find an example! The dimensions I am working with are big enough that I don't want to specify them by hand! More precisely : int test[5][192]; for(int i = 0; i <...

java,arrays,multidimensional-array,initialization,declare
I am currently taking Java lessons, and the course is explaining two-dimensional arrays. The first method to declaring that type of variable would be to create a constant as arguments for how many rows and columns will be in my two-dimensional array. Then, I just used a nested for-loop to...

arrays,multidimensional-array,vhdl
I need to use multidimensional arrays to represent matrices in my design. I have tried the two available options: Declaring array of arrays type t11 is array (0 to c1_r2) of std_logic_vector(31 downto 0); type t1 is array (0 to r1) of t11; --r1*c1_r2 matrix Multidimensional arrays. type matrix is...

python,python-2.7,multidimensional-array
I need a 2D array with a fixed array name (say 'grids'), which can take variable row and variable column size based on certain conditions. Like if the first condition is satisfied, then that will add a row to 'grids' and if other condition satisfies, then a new column has...

php,arrays,multidimensional-array
$array_size is giving array size of array $expkey in each iteration. On each iteration I want to compare present array size with the previous array size. How to do this plus in on first iteration there is no prev array size so it should not give some offset index. So...

c++,multidimensional-array
I'm trying to double each number in 2D arrays. For example the values in array1 would become {2,4,6}{4,8,12}{6,12,18}. The problem is that my code doubles the only the first number. Can someone give me some direction on what to do? #include <iostream> #include <iomanip> using namespace std; const int N...