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
3 views
how to add caption in waterwheelCarousel
i want to add caption text below the waterwheelCarousel gallery images,how can i do this.
echo "<a href=".$value." target='_blank'><img src=".$image_url_2." id='item-1' /></a>";
3
votes
2answers
65 views
what does a comma do in the first parameter of a for loop?
What does it mean when there is a comma in the first parameter of a for loop?
For example:
for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
//
}
0
votes
2answers
43 views
for loop and variable scope
I'm trying to figure out the best way to do something.
I have a variable that acts as a HTML template, and insert properties from an array of objects. Simple code below:
i = 0;
v = "<li>",
v ...
0
votes
1answer
32 views
MATLAB: Does the If Statement order effect performance
I'm trying to speed up a loop that runs for about 100000 iterations and was wondering if the order of if statements had an effect on the performance. For example will the following code check the if ...
0
votes
3answers
47 views
nested array/object creating html?
var bbcodes =
[{
contents: {
newBB:["b","u","i","list"],
newBB:["j","k","l","m"],
newBB:["close","stop","back","time"],
},
}];
for(var j=0;j<bbcodes;j++){
var temp= ...
2
votes
3answers
65 views
What is a nested for loop?
So I am running through some examples of 'nested for loops' and the below code is given as an example. But isn't this technically a for loop?
xLimits = range(getWidth(pic))
for x in xLimits:
...
0
votes
3answers
38 views
Coin Purse Program
I'm working through this java book and have come across an exercise I cannot seem to solve. The idea is to create an ArrayList Purse with however many coins in it and print it's reverse out. I have ...
3
votes
1answer
115 views
Add elements to a vector during range-based loop c++11
I have used the new range-based for loop provided by C++11 standard and I came up with the following question: suppose that we iterate over a vector<> using the range-based for, and we add some ...
3
votes
2answers
29 views
Find specific occurances within a vector in MATLAB, without for-loop?
I have a problem that seems to be simple but maybe I am missing something. Let us say I have: vector = [10:1:19];. I have another vector, want = [11 16 19]; I simply want a way in which a command will ...
0
votes
3answers
60 views
Setting a variable equal to a returned value from a for loop in Python
This would save me a lot of code, but I'm not sure how to implement it. I would like to set my variable "totalfactors" to the result of a for loop iterating through a dictionary and performing a ...
1
vote
4answers
28 views
Contiously adding to datatable
I have the code below that goes out to a database using OleDB and fills a dataset with the information. It then checks to make sure it has something in the dataset, if it does it then addes that ...
2
votes
3answers
98 views
How to optimize this loop?
I am working on a Java program which creates a map using Voronoi. I am using a Java library which generates Voronoi and it is very fast (http://sourceforge.net/projects/simplevoronoi/).
The problem I ...
-1
votes
6answers
38 views
Break for loop from inside of switch case in Javascript
What command i must sue, to get out of the for loop, also from //code inside jump direct to //code after
//code before
for(var a in b)
{
switch(somethink)
{
case somethink:
...
0
votes
1answer
17 views
Escape asterisk in Windows Batch File's FOR Loop
When running the following code in a windows batch file everything works aside from the string containing the asterisk, which is skipped. Checking the passed parameters by number (i.e. echo(%~6) I ...
0
votes
1answer
16 views
I want to loop through a file assigning a variable to specific tokens, then use the variables in a command line
I am a newbi and apologize if I am not asking the question correctly, but I want to loop through a list, assigning a variable to specific tokens in that list, then pass the variables to a command ...