A while loop is a control structure used in many languages to loop over a set of instructions as long as a particular condition is met.
-1
votes
1answer
15 views
do - while with $var[x]
i'm still in the learning curve with php
I'm trying to achieve this:
let's say i have an ul with dynamically generated li's. And these li's must be populated with data stored in a variable. For ...
0
votes
2answers
82 views
What's going on with my if-else statement? (Python 3.3)
I'm writing conditional statements for a billing program project. It's a bit advanced for a beginner I know but I welcome the challenge. Anyways, I plan on starting the program with asking for ...
0
votes
4answers
89 views
Why is this while statement looping infinitely?
I am using Python 2.7 in Windows PowerShell.
def loop(loop):
i = 0
numbers = []
while i < loop:
print "At the top i is %d" % i
numbers.append(i)
i += 1
...
0
votes
3answers
46 views
Updating textView with while loop?
I programmed a stopwatch but it works with java, but not on Android. If I press the Button it makes nothing. Could it be, that maybe Eclipse is wrong installed?
package com.example.stoppuhr;
import ...
0
votes
1answer
14 views
'While' loop count is worng?
ans = num_rushes(100, 15, 7)
print(ans)
should return 19 but mine is returning 12?
Here is what I have:
def num_rushes(slope_height, rush_height_gain, back_sliding):
rushes = 0
...
0
votes
2answers
53 views
How to periodically check if any file changed and then build
I would like to monitor directory for change and if any file in that directory changes then I would like to build software. How can I do it with a shell "oneliner" ?
I was trying some variations of
...
1
vote
3answers
30 views
Matching keys from one array to another and creating a new array with their values?
Hi I have two arrays the first one looks like this:
array(
00000 => array(
0 => 123,
1 => 456,
2 => 789,
)
...
0
votes
2answers
67 views
PHP How to filter array values
I'm trying to show in a div 3 thumbnails stored in different folders.
In my bd determined (with value "1") which record has pictures. So this is my db:
...
0
votes
3answers
64 views
Read All Lines in a Text File and Add Them C#
I've been working on this problem for a while and I'm a little stuck. I have a text file that I need to loop through and read all lines of, then add all of the substrings together for one final ...
0
votes
1answer
17 views
Nested looping XML elements
This is my XML:
<Scenario>
<Steps>
<Step Name="A">
<Check Name="1" />
<Check Name="2" />
</Step>
<Step Name="B">
...
0
votes
1answer
35 views
Confused on some webBrowser functions
public void PortalLogin()
{
string portalUrl = "URL";
string portalEmail = "email";
string portalPassword = "password";
// Run when page ...
-3
votes
2answers
32 views
Efficiently iterate through javascript array, do something different with the first element
Somewhat new to javascript and I've written the following loop. I'm wondering if this is the most efficient way to iterate through a javascript array and process only the first element differently ...
-1
votes
1answer
18 views
Python 3: Why are my while loops exiting?
I am extremely new to programming and a little unsure as to what I am and doing - and thus where it is going wrong.
My problem: take variables x, y and z. I want to increment each to 1 in steps of ...
0
votes
1answer
51 views
PHP creating an array from another array?
Hi I was wondering how to create an array with key value pairs from my other array which is an array consisting of values read in from a DB table.
Heres the code:
$query1 = "SELECT phone, id FROM ...
1
vote
1answer
78 views
If inside while
PROBLEM SOLVED: I forgot to flush the PrintWriter in client.
I'm having an issue with this code. The output is 1, 2, 3, 4, 5, 5.5 but it won't reach 6 or 5.75 and I can't figure out what's wrong. ...