Questions tagged as 'loop'

1
answer

ForEach returning only one object in the list

I have a JSP page and I want it to be a list. To do this, I created a listarTodos() method inside the DAO class and set the fields to show the data of the object, thus getting the code: </div> <% ProdutoD...
asked by 06.09.2017 / 00:56
1
answer

Loop to sum values of one db

I'm doing a financial control system, and I've looped while grabbing the client data from a db and it shows them in a table. What I want to do is take the values in the column "PRICE" and add, to give the value of the total of balances. I'm goin...
asked by 29.07.2017 / 21:37
1
answer

C ++ Iterator while jumping the reading of cin.getline

I'm starting in C ++, during some tests I noticed that after the second iteration of while the command cin.getline was not read displaying the line after it. I do not understand what happens. Here is the code: #include <iostream> #includ...
asked by 24.06.2017 / 01:33
2
answers

Checking for repeated numbers in PHP

I am doing a job of choice that is a lottery. In this lottery I need to check if the numbers are the same, if they are, I must replace them with another number and this number can not have already been generated. My difficulty is to make a loop...
asked by 19.05.2017 / 02:02
0
answers

struct that stores number of rows and columns of array and a vector

I used a struct to store the number of rows (m) and columns (n) of the array and another to store number of columns of the vector (n). I make the product of two arrays in the function prod() and the product of a matrix with a vecto...
asked by 25.05.2017 / 23:49
1
answer

Duplicate repetition

I have a problem with the repetition of my result, in fact I can not find a solution. Notice that in the image below we have the order number and the parcels, but this order number always repeats when a new parcel is requested. it does not repea...
asked by 20.06.2017 / 02:02
0
answers

How to optimize a power loop of 2 ^ n and (2 ^ n) +1 in java?

Good, I'm doing a job where I have to do tests on stacks, and the tests have to be done when I push and pop powers of 2 and powers of 2 plus one (1,2,3,4,5, 8,9,16,17, etc.) I have some code done: public static void testsForLinkedLists(int...
asked by 13.04.2017 / 15:46
1
answer

How to loop with jquery without duplicates

I wanted to know if you can loop inside the other using the each function without duplicating the values Example var cor = ["branco", "preto"]; var exa = ["#FFF" ,"#000"]; $.each(cor, function(index, values){ $.each(exa, functi...
asked by 25.02.2017 / 22:17
1
answer

Interacting all items in a list

I have the following situation: I have 4 numerical lists ranging from 1 to 30. Eg: AP_X = [1,2,3,4,5...30] AP_Y = [1,2,3,4,5...30] demanda_X = [1,2,3,4,5...30] demanda_Y = [1,2,3,4,5...30] I have another empty list called distancia...
asked by 07.03.2017 / 00:35
1
answer

How to find the sum of two numbers in an array that match the input value

How to do this without having to make two loops. Example method: function getPairNumbers($array, $valor) { //aqui viria o método }     
asked by 27.01.2017 / 18:45