Questions tagged as 'array'

6
answers

How to find a value in an array with a specific structure

I need to find the position of an array inside another, in the following structure: array{ [0]=>{ ["id"]=>"5744" ["fk"]=>"7" ["nome"]=>"Nivel 1" ["created"]=>"2014-04-30 16:54:14" ["modified"]=>NULL...
asked by 30.04.2014 / 22:58
2
answers

Difference between splice () and slice ()

What is the difference between the functions splice() and slice() of the object Array of JavaScript and when each one should be used?     
asked by 19.11.2018 / 17:35
3
answers

Is there a more efficient way to dynamically create an array from another array by filtering the contents of the array first?

I have an array of values that can include several numpy.nan: import numpy as np a = np.array ( [1, 2, np.nan, 4] ) And I want to iterate over your items to create a new array without np.nan. The way I know to create arrays dynamically...
asked by 15.12.2013 / 17:48
2
answers

How to align strings to use in a listview?

In my Android project I need to create a table with a listview but the data always comes misaligned. I put each record in my database at a position in an array of strings so I can use it in listview . The method I use to try to alig...
asked by 27.01.2014 / 18:01
7
answers

What is the difference of these parameters (array) in these methods?

I see this a lot in methods class Exemplo { public function exemplo1(array $parameters = array()) { } public function exemplo2(array $parameters) { } public function exemplo3($parameters = array()) { } }...
asked by 30.01.2015 / 14:55
2
answers

Differences between Jagged Array and Multidimensional Array in C #?

Is there a difference in these arrays in C #? int[][][] int[,,] What I see is the same thing, but C # can not cast from one to another.     
asked by 07.08.2016 / 18:52
2
answers

Why invert the index of the array in a for, to popular the array, makes the process faster?

I was doing some tests in Java and noticed a very strange behavior. I made a two-dimensional array and populated the array in two different ways, filling in random numbers up to 2 ^ 31-1 and just changing its index. I got a considerable performa...
asked by 13.03.2014 / 04:09
2
answers

How to use the jsondiffpatch library?

I'm having second thoughts about manipulating the data with the jsondiffpatch library The original array : [ {"id":1004,"idproduto":3,"forma":"Alface","preco":1,"quantidade":1}, {"id":1000,"idproduto":3,"forma":"Bacon","preco":2,"qu...
asked by 05.03.2015 / 18:02
2
answers

What are the advantages of using associative arrays?

I have come across the definition of associative arrays which are vectors with indices consisting of strings , example: $site['nome'] = "Stack Overflow"; What are the advantages of using this kind of vectors? Since you can not use them i...
asked by 18.12.2015 / 16:04
3
answers

Sort a multidimensional array with numeric values

Let's suppose the following situation in which I have array composed of several array with numerical values: $array = array( array(22, 25, 28), array(22), array(22, 23) ) I would like to leave this array ord...
asked by 31.01.2014 / 17:05