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
0answers
15 views
Achieving same array structure when converting from JSON and XML
I'm trying to build my first public API, which is going pretty fine, but i ran into some trouble converting different data formats that will get POSTed. Basically, the API should accept both JSON and ...
0
votes
0answers
7 views
Adding in a dimension of an array for statistical probably: die Rolling
I've got down how to display the simulated probability of each die roll (both dice added together), but I don't know how to add in a column for the statistical probability of each sum (2-12). How ...
0
votes
3answers
55 views
json object vs array of objects
I'm querying a remote server and receiving a json reponse. The format of the reponse depends on the number of objects in the response. If there is a single object it looks similar to:
"results": {
...
0
votes
3answers
50 views
Accessing the array index
I have an array of 255 elements. I need to store 100 values in this array. For example, if there are 3 items rose, red, rat then arr[0] should represent rose, arr[1] should represent red and arr[2] as ...
4
votes
2answers
107 views
Generating set of “N” numbers in an integer range at “logarithmic” distance in C++
I couldn't find exact answer to this question so I am posting it here:
If I have an integer range, I want to calculate "N" numbers in this range at equal logarithmic distance.
Here is a sample code ...
0
votes
1answer
18 views
How can I find words from scrambled letters?Visual Basic 2010
I have scrambled the letters, so they're different each time and have a txt file which contains all of the words from the dictionary. I am new to this and trying to teach myself VB, but this has got ...
0
votes
0answers
29 views
How can I plot (x,y,z) coordinates dynamically
My application obtains x,y,z coordinates like this:
x: -0.020941
y: -0.241276
z: 0.956
--------------
x: 0.0782352
y: -0.159108
z: 0.923
--------------
x: 0.0665857
y: -0.140757
z: 0.885
...
3
votes
1answer
42 views
Search for an Array element beginning at a given index
In Python, you can specify start and end indices when searching for a list element:
>>> l = ['a', 'b', 'a']
>>> l.index('a')
0
>>> l.index('a', 1) # begin at index 1
2
...
0
votes
3answers
48 views
Binary Search keeps returning -1?
This method is supposed to pass an array of objects:
Movie[] movieList = new Movie[6];
movieList[0] = new Drama("Titanic","James Cameron", 1997, 200.0, 80.0, 7.50);
movieList[1] = new ...
0
votes
0answers
20 views
Predicating and multiple connected NSMutableArrays
long time reader, first time poster. I was hoping someone would be able to help me out with an array problem I'm having. I've been working with iOS for about 4 months. I can't get this code to work ...
0
votes
4answers
60 views
How in input an array of integers by pointers and print out the array and the size of the array(C++)
#include<iostream>
using namespace std;
int main() {
int *p=new int [10];
}
After creating the array, I am confused and want to know if it's possible to do the following:
read an array ...
-1
votes
6answers
58 views
Removing duplicates from 2D array in java
I have a 2D String array, something like
_________
|abc|123|
---------
|pqr|234|
---------
|mno|567|
---------
|abc|123|
---------
|abc|999|
What is the most efficient way to remove duplicate ...
0
votes
5answers
38 views
Explode text into array as per paragraph
I have text like
$test = 'Test This is first line
Test:123
This is Test';
Now i want to explode this string to array as per paragraph
I write below code for this but it is not ...
-7
votes
2answers
38 views
time addition in php by inputting an array
I have array data, when I print this array
print_r($data);
The output is like this:
Array ( [0] => 10.11 [1] => 10.07 [2] => 9.37 [3] => 11.43 )
Now I want to add the element of ...
-1
votes
1answer
24 views
Hash has value in array as value
I want to find a certain value in an array as value in hash. If I simply use ans.has_value?("car"), it can only find such value if it is not in an array. But if I use ans.has_value?(["car"]), it can ...