An array is an ordered data structure consisting of a collection of elements (values or variables), each identified by one (single dimensional array, or vector) or multiple indexes.
0
votes
1answer
24 views
jQuery JSON Decode ( PHP to Javascript)
I'm trying to make an autocomplete script. I pass variables through JSON, and then I don't know how to go on to decode JSON.
This is an example of the JSON code I got, and I'd like to convert it in a ...
1
vote
1answer
20 views
Starting threads in a loop passing array elements to each
i start 4 threads in a loop. each thread gets a reference to an array element to write the result.
But on the line where i create each thread, i get a System.IndexOutOfRangeException. I'm amazed that ...
1
vote
1answer
27 views
Find the given sum “total” from the three matrixes algorithm
i was following the this question and i felt that this can be solved in O(NLogN). Below is my algorithm:
1. Sort list1 , list2, list3 i.e. O(NLogN)
2. while indexA < size and indexB < size ...
0
votes
2answers
33 views
Array counting Error
I am trying to count from the following associative array in two's key->value filter, by Key-gender and Key-rname, Please see below ...
<pre>
Array
(
[0] => Array
(
...
0
votes
4answers
19 views
An array of UIImageViews in objective-c
I already had many UIImageViews.. I want to make an array of UIImageViews and assign every element of the array with one of the UIImageViews above.. How can I do that with objective c??
I did it in ...
0
votes
2answers
27 views
Check if array value isset and is null
How to check if array variable
$a = array('a'=>1, 'c'=>null);
is set and is null.
function check($array, $key)
{
if (isset($array[$key])) {
if (is_null($array[$key])) {
...
0
votes
3answers
32 views
Hash to custom array implementation
Last newbie question for today. There is a hash:
h = {a: 1, b: 2, c: 3}
How to implement convert_to_arr(h) method with such output:
convert_to_arr(h)
# ["Key: 'a', Value: '1'",
# "Key: 'b', ...
0
votes
0answers
14 views
Variable changes after the function triggered twice
I'm simply trying to modify a chrome extension. However I don't know much about JavaScript. I'm just a reader rather than writing stuff in JavaScript. Anyway, I wrote a function that inserts a little ...
2
votes
2answers
32 views
Change a hash into an array
I have an Rails 4 application that collects attendance at church services. Some weeks there are two services and some weeks there is only one. I need to get the total attendance for each week and show ...
1
vote
2answers
30 views
How do I create a custom “merge” method for hashes?
How do I implement a "custom_merge" method?
h1 = {a: 1, c: 2}
h2 = {a: 3, b: 5}
This is a standard "merge" method implementation:
h1.merge(h2) # => {:a=>3, :c=>2, :b=>5}
My desired ...
1
vote
1answer
16 views
Fastest/Easiest way to store multiple arrays of data for multiple time steps
I have particle ID, x-position, y-position, x-velocity, and y-velocity data for thousands of time steps. I would like to be able to use find() across multiple time steps. For instance to find all ...
0
votes
2answers
28 views
array of UIImageView in objective c
I already had many UIImageViews..
I want to make an array of UIImageViews and assign every index with one of the UIImageViews above..
How can I do that with objective c??
1
vote
2answers
17 views
how to get items that belongs to all numpy arrays?
I need some analogue to numpy.in1d() function, my task is to have list of items, that more than 2 arrays have. For example i have 3 arrays:
a = np.array((1,2,5,6,12))
b = np.array((1,3,7,8,5,14,19))
...
0
votes
0answers
32 views
JS basic random image select
I've only started HTML yesterday and I'm trying to do a really basic memory game. First, there's an image of all the pieces, then a button that calls a function that hides that image and make another ...
0
votes
2answers
47 views
access arrays of arrays or objects
I would like to have an array of arrays like the following function shows.
function getarrayinfo(index)
{
var myarray1=new Array();
myarray[0]=[1,1.1,1.2];
myarray[1]=[0.1,0.2,0.3];
...