Questions tagged as 'array'

1
answer

Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

I need to open a file txt and store its information in ArrayList and then make a comparison between what was typed and what has in bad ArrayList to see if the login is right or not. Here is my code: public void actionPerfo...
asked by 04.09.2016 / 21:29
1
answer

Remove empty spaces in arrays in JS

I would like to know how to eliminate the gaps that are in a vector. The situation is as follows: I need to read all text tags from an HTML page and store them in an array so that I can work on them individually in the future. I created an ar...
asked by 18.01.2018 / 21:47
2
answers

php array for json will not all data

Hello, I'm having a problem with my code and I wanted your help. I need to get data from a table and send it as json, I have 10 items in my table but json just sends one. Table: Location InmycodewhereIputallPHPandMsqliinclude("connect....
asked by 16.07.2017 / 06:44
2
answers

fill an Array with data up to a specific value

I need to make a program that reads the keyboard names until the user types the word "end", and then prints the names typed in the order they were typed. So far, I have tried to resolve this issue using ArrayList , like this: public c...
asked by 09.10.2015 / 20:35
2
answers

Question about array in php [closed]

I'm breaking my head and I'm already out of ideas, summarizing my code looks like this: <?php $var = 'arquivo_1'; // podendo ser arquivo_1 ou arquivo_2 $arquivo_1 = array( "algo1" => "alguem1", "algo2" => "alguem2" ); $arquivo_2 =...
asked by 13.02.2017 / 18:10
3
answers

Read multiple numbers of scanf separated by space

I need to make a program that receives a number of elements of a vector, and then each element of that vector, but in the same% with spaces. Only I do not know how to do this, someone can help me. Example: 3 1 2 3     
asked by 22.05.2018 / 01:08
1
answer

Get Object id []

I need to get the id of these objects. Object[] classe = getNames().toArray(); String[] strings = Arrays.stream(classe ).map(Object::toString). toArray(String[]::new); for (int i=0;i<strings.length;i++) {...
asked by 01.06.2018 / 19:52
1
answer

Error "Invalid argument supplied for foreach ()" and "Undefined index" in PHP form

I need to create 20 inputs which, when filled in, should show what was typed in them below, using arrays and foreach, here is the code below: function repeteInput(){ for($i = 1; $i <= 20; $i++){ echo '<form action="repeteInpu...
asked by 28.04.2017 / 16:01
0
answers

How to sort a random position in an array?

I have an array of random size filled with random numbers (between 0 and 3). I need to sort a position inside it and from that position, pick up the numbers "above" and "below" from the selected position and save it to another array, making a co...
asked by 21.12.2018 / 11:53
2
answers

Pass an array to another format

The array is coming in this database format: array (size=12) 0 => array (size=3) 'maquinas' => string '111' (length=3) 'mes' => string '1' (length=1) 'YEAR(data_ordem)' => string '2016' (length=4) 1 =>...
asked by 15.12.2016 / 20:08