An array is an ordered data structure consisting of a collection of elements (values or variables), each identified by at least one index. All the elements of an array are stored adjacent to each other.

learn more… | top users | synonyms (2)

1
vote
2answers
42 views

Java: Calculations giving wrong answer, where is my mistake?

I can't seem to figure out why it's not printing correctly: public class test3 { public static void main(String[] args) { double[] gens = {100, 200.1, 9.3, 10}; double d0 = 0; double d1 ...
0
votes
3answers
25 views

Dynamic two dimensional C array crashing in Objective-C

I am making a curve fitting program using matrices in the form of a two dimensional arrays but the compiler throws out BAD_ACCESS errors at random such as Thread 1:EXC_BAD_ACCESS (code=1, ...
-5
votes
0answers
28 views

how can I Declare two ArrayList lists list1 & list2 [closed]

how can I Declare two ArrayList lists list1 & list2 and Call the method fillArrayList to fill the two lists with corresponding elements. import java.util.ArrayList; import java.util.Scanner; ...
0
votes
7answers
53 views

Java: How do you print an array?

System.out.println(someArray); Just gives me a single address, that I assume is the address where the values are stored. System.out.println(Arrays.asList(someArray)); ...
0
votes
0answers
25 views

glob() to build array of files, or hardcode array? Speed is key, but automation is nice

Sorry for the undescriptive title, wasn't to sure what to title this :-) I have written an API that loads required javascript libraries from a directory on my server. The directories have a specific ...
3
votes
4answers
36 views

Perl array shortcuts

Is it possible to create an array of string variables in perl without having to specify each single string that goes in the array? Like by using the ".." shortcut for letters and numbers. For ...
-1
votes
1answer
32 views

How can i create a List that the items inside will be random tree of websites addresses?

What i mean is that the List will be in the end with an offline websites addresses but as a tree. For example the program will create automatic List of websites addresses for example the first one ...
-1
votes
3answers
43 views

How do I swap two integers in an array, where my method takes in two integers and an array from main?

I call my swap method in main, but it doesn't change anything. What am I doing wrong? public static void main(String[] args){ int mainArr[] = new int[20]; for(int i = 0; ...
3
votes
2answers
42 views

Create a list / arraylist of objects and sort the list (Java)

I have a student object and then I create ArrayList and add student to the list. ArrayList<Student_Object> studentsList = new ArrayList<>(); Now, I want to sort the list by studentId ...
1
vote
2answers
36 views

PHP Insert Numbers not working?

I am inserting tags from a textarea into a database but the issue is that whenever I try to insert the album INT or the track INT it shows up as 0 in the database. If you see the PHP output the values ...
0
votes
2answers
47 views

Checking for characters in an array element in Java

I have an array of type string that contains a bunch of lines of text that are broken up in the different elements of the array. I want to check which element contains the string Name: in it. The ...
0
votes
1answer
34 views

Java sorting an String Array by a Substring of characters

I need to sort an array of strings like the following, by a substring of characters: [0] = "gtrd3455"; [1] = "wsft885"; [2] = "ltzy96545"; [3] = "scry5558"; [4] = "lopa475"; I need to sort by the ...
-1
votes
0answers
15 views

Circle Distances

I am completely lost on how to even approach the second part of the problem. This is the question: Create a new class called “Circle” that can be used to create customized circle objects. Your ...
0
votes
2answers
19 views

Setting array elements without knowing their index

In my code I'm doing $params[ltrim($part, ':')] = null; in order to get an array that looks like this: Array ( [id] => [random] => [something] => ) I need a way of setting ...
0
votes
2answers
30 views

numpy array: accessing element in a loop gives an error

This code throws an exception: "list index out of range" at the line marked below. col_sig_squared = [np.zeros(shape=(1,6), dtype=int)] def calculate_col_sigma_square(matrix): mx = ...

1 2 3 4 5 2502
15 30 50 per page