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.
0
votes
0answers
7 views
Writing Elegant PHP Code: Cleaning Up Unnecessary Loops and Merging Arrays
I'm pulling input from six (6) different textareas, exploding the array with \r\n as the delimiter, and looping through each set of data twice in order to replace it.
For example, I have textarea ...
-1
votes
1answer
34 views
Why does this C loop skip the first attempt to input a letter?
This is a program I am making for a class. It is supposed to read a letter from a file, and then in the game the user tries do guess the letter. with every wrong attempt the program tells you if the ...
0
votes
0answers
12 views
R: Row resampling loop speed improvement
I'm subsampling rows from a dataframe with c("x","y","density") columns at a variety of c("s_size","reps"). Reps= replicates, s_size= number of rows subsampled from the whole dataframe.
> ...
0
votes
2answers
59 views
For loop in Python?
I am trying to list every card in a deck of cards (along with a number assigned to the card) using this code:
suitName = ("hearts", "diamonds", "spades", "clubs")
rankName = ("Ace", "Two", "Three", ...
0
votes
1answer
37 views
Updating an UILabel looks like wasting performances
I'm working on a project, where i have to update the text of a UILabel really regularly (0.085f). So, I insert the update of the label in a loop like this :
MetresNumber = MetresNumber + 0.25;
...
1
vote
3answers
40 views
Iterate over associative arrays inside an indexed array
I'm learning JS and have to do a trivia game, where each question has 4 possible answers. The questions are given to me in a string with "#", which separates the questions, and "@", which separates ...
2
votes
1answer
35 views
Iterating through a numpy array and then indexing a value in another array
I am struggling to get this code to work I want to iterate through an numpy array and based on the result, index to a value in another numpy array and then save that in a new position based on that ...
0
votes
1answer
14 views
Comparing XML with ActionScript 3
I have some fairly large XML files which I need to compare in Flash and then assign different scores for each node that matches. I don't have control over the XML files so I can't use node attributes ...
0
votes
2answers
29 views
save data from all loop iterations in matlab
the following is part of my code, when I run it, I find that data and data1 is only file B5.m, I would like to save all iterations (Example, B11.m to B55.m). finally, I want to add B11 from first ...
-2
votes
1answer
58 views
Python input=output loop
I am trying to make a python loop where the output is used as the input, until the output and input is equivalent, this is the statement that i am trying to solve:
1
----- = x
1+x
The result ...
0
votes
4answers
59 views
for loops in objective C
Apologies for a basic question. I have checking out the for loops here and here and for example if we analyse the first code :
for(int i = 0; i < CFDataGetLength(pixelData); i += 4) {
...
1
vote
1answer
35 views
insertbefore() in loop only adds the first row, fails on the others
I am using Greasemonkey and JavaScript to write annotations for a web page. I want to add the same <td> to multiple rows, but the code only works for the first row.
Here is what I have:
var ...
-1
votes
1answer
14 views
Rewrite rule - redirect dinamic url to a subdirectory without loop
I have these possible path to images:
/media/thumbnail/img.jpg
or
/media/thumbnail/product/img.jpg
or
/media/thumbnail/product/some-text/img.jpg
All have to be redirected to:
...
0
votes
2answers
18 views
setting session in foreach loop in codeigniter
i have a model in codeigniter that gets notification from the database using foreach loop.i want to pass the values to session using set_userdata but unfortunately i cant pass multiple values in to my ...
1
vote
1answer
12 views
Android: Seeking through an .mp3 file using an ImageButton
I'm new to Android programming, so pardon me if my problem seems noobish. Here is the code that I am using:
ffMusicButton.setOnLongClickListener(new View.OnLongClickListener() {
@Override
...