Top "Loops" questions

Loops are a type of control flow structure in programming in which a series of statements may be executed repeatedly until some condition is met.

Iterating over ResultSet and adding its value in an ArrayList

I am iterating over an ResultSet and trying to copy its values in an ArrayList. The problem is that its …

java jdbc resultset loops
Decreasing for loops in Python impossible?

I could be wrong (just let me know and I'll delete the question) but it seems python won't respond to …

python loops for-loop
Angular 2 Cannot find control with unspecified name attribute on formArrays

I am trying to iterate over a formArray in my component but I get the following error Error: Cannot find …

loops angular angular2-forms
Iterate a certain number of times without storing the iteration number anywhere

I was wondering if it is possible to perform a certain number of operations without storing the loop iteration number …

python loops range
How to loop through a dataset in powershell?

I am trying a "very" simple task to output values of each rows from a DataSet : for ($i=0;$i -le $…

powershell dataset loops
Loop through a date range with JavaScript

Given two Date() objects, where one is less than the other, how do I loop every day between the dates? …

javascript loops date iteration date-range
How to write a simple Java program that finds the greatest common divisor between two numbers?

Here is the question: "Write a method named gcd that accepts two integers as parameters and returns the greatest common …

java loops while-loop greatest-common-divisor
How to iterate through table in Lua?

So, I have a table something along these lines: arr = { apples = { 'a', "red", 5 }, oranges = { 'o', "orange", 12 }, pears = { 'p', "green", 7 } } It …

arrays loops lua key lua-table
Is recursion ever faster than looping?

I know that recursion is sometimes a lot cleaner than looping, and I'm not asking anything about when I should …

performance loops recursion iteration
How can I escape white space in a bash loop list?

I have a bash shell script that loops through all child directories (but not files) of a certain directory. The …

bash loops whitespace