A for loop is a control structure used by many programming languages to iterate over a range. Depending on the language this may be over a range of integers, iterators, etc.
0
votes
0answers
8 views
confirmation box and inside for loop is not waiting for the user action …all confirmation boxes are coming at same time
I have the following for loop code
for (var i = 0; i < selection.docs.length; ++i) {
callDeleteElement(paramsdoc);
}
and the function
function callDeleteElement(param){
var confirmCb ...
0
votes
1answer
13 views
How do I duplicate “new TextView” and “setId”?
My FragmentActivity loops and creates numerous Fragments, each with `new TextView. After some help, I have this:
FragmentActivity.java
...
@Override
protected void onCreate(Bundle ...
3
votes
2answers
21 views
An issue with vectorising Gsub
Aim:
I am a newcomer to R, but I am trying to familiarise myself with programming in R. In a current task, I wanted to replace a number of words occurring in a corpus whilst keeping in tact the ...
-3
votes
1answer
73 views
Using for-loops in C++
I'm currently taking a course in programming and I have this exercise I can't figure out. They want me to create a program that asks for a number and then prints the value in 'A's. For example if I ...
0
votes
0answers
10 views
Determining the index of a PictureBox list item in a For Next Loop
I am a new programmer and have a question in regards to determining the index of an item in a PictureBox list as follows;
For Each pic As PictureBox In senetBlocks
Dim picIndex = ...
-5
votes
0answers
24 views
For each word do something in PHP [closed]
I have output from DB like this: Ro, Ru, Eng, Fr
How to make for each word do somthing like:
echo '<img src="/images/Romania.png" height="32" width="32"';
echo '<img src="/images/Russia.png" ...
-3
votes
2answers
39 views
OpenCV/C++ for loop does not break
I'm currently using C++ and writing a program that depends on OpenCV. I'm having trouble with two nested for-loops.
float invalue = 0;
float columnvalue = 0;
CvScalar rscal;
printf("%i\n", height);
...
4
votes
6answers
81 views
What does this comma do in the *test* portion of a for loop?
int c = someIntegerValue;
// Some code...
int i;
for ( i = 0; i < 5, i < c; i++ ) {
...
}
My compiler says error: expression has no effect, which sounds about right. So, which of those 2 ...
4
votes
1answer
166 views
C++11 Range-based for-loop efficiency “const auto &i” versus “auto i”
In C++11, I can iterate over some container like so:
for(auto i : vec){
std::cout << i << std::endl;
}
But I know that this needlessly - needlessly, since I only need to print the ...
0
votes
1answer
72 views
what type of loop is more C when using pointers [closed]
I want to go through every elem in a string to see how many times a letter occurs, what loop is more C
while (*s != '\0') {
//do stuff
s++;
}
or
for (; *s!='\0'; s++) {
//do stuff
}
...
3
votes
2answers
78 views
How to get rid of a java.lang.NullPointerException when output is acceptable?
This is a bit complicated for me to explain so please bear with me. I am simulating a process identifier (PID) manager that allocate PIDs. It's been expanded to consist of a multithreaded program that ...
-1
votes
1answer
61 views
Using a for loop in R with a condition
I am trying to write a rscript that will find the annotation for ChIP-seq peaks using biomaRt from the bioconductor package. I am adapting the annotation code from here, ...
0
votes
2answers
59 views
If statements in a for loop
I have a problem with some if statements in a for loop. Here is my code:
import numpy as np
mv = []
mb = []
mbv = []
M = []
for i in range (0,25):
mv.append(10.1 - 2.5 * np.log10(fv[i]/1220000))
...
0
votes
1answer
15 views
For-Loop to quick to present View Controller
i want to add multiple passbook passes by running through a array with URLs. The problem is that the loop counts faster than the view controller can present.
Here s my code:
NSArray *passURLArray ...
-1
votes
1answer
36 views
Getting data from array doesn't work in for loop
Fetching data to get array of ids i need
$STH = $DBH->prepare("SELECT char_id FROM att WHERE raid_id=:id AND spec=:spec AND status=:status");
$STH->bindValue(":id", $id);
...