0
votes
1answer
31 views

loop issue in sql data verification

Hi this is my PHP code for attendance sign in, but it enters multiple entry when i remove the while loop. Please help me to get which loop is better to this coding... It is working fine when i ...
2
votes
4answers
104 views

Speeding up my code for a volume of a sphere (Nested while loops)

I'm trying to speed up my code for calculating the volume of a sphere (see code below). This volume of the sphere is produced by calculating small volume segments, dv, and summing them into a volume, ...
2
votes
1answer
34 views

grep for files through another list of files

I'm trying to find if some java classes are called in a list of script files that are actually being called in a scheduler. while read j; do while read b; do #Read through job files ...
0
votes
0answers
17 views

Table Insertion using WHILE loop

I am in MySql 5.5.34 and trying to use a while loop for multiple insertions, code looks like this: WHILE (@i < 23) DO INSERT INTO my_table (date, field1, field2) VALUES (date_add('2012-12-24 ...
0
votes
0answers
45 views

Standard Input (cin) Skipped in While Loop [duplicate]

Experience I am relatively new to C++ so there maybe some noob mistakes here... Scenario I need to check if the input given is an integer or not and if not, keep asking for it until the input is an ...
0
votes
2answers
35 views

Java do while loop back to the beginning of application

This question is a follow-up from this link Java SE do while loop issues This is an application asking for a room's name then second prompt to ask for its dimensions to perform some calculations. ...
0
votes
2answers
47 views

Java SE do while loop issues

I have a problem with my java application when i compile my codes it says that it cannot find symbol roomLength. what the application supposed to do is prompt the user to input a room name then if it ...
-2
votes
3answers
46 views

Python: How to end while True loop

How would I go about ending this while True loop, I want the loop to end at the marked location, but i tried both break and continue, both don't end the loop. It just keeps the script running and it ...
-3
votes
3answers
69 views

sum using while loop in java [on hold]

Can anyone help me? I'm confused. My teacher gave me homework which is to implement addition (sum) using while loop in java. Additionally, when you press 1 at runtime it should end the program. ...
0
votes
1answer
29 views

PHP loop x number of times, using while and if

So this has been driving me nuts for several days. I've tried THIS and THAT but nothing is working. Here's the basic rundown: I have a MySQL database with 200 or so locations. The user enters ...
0
votes
1answer
31 views

Loop until it finds a string

I need to write a script that will configure some network devices. It logs in to the device through ssh, then it lists all available ports and devices connected to them. In order to properly ...
0
votes
2answers
72 views

Loop and variable php

I never use php and I have to do a simple things; I have to take a string, substring it, explode it and then explode the string of the array I found after the first explode. Finally i have to save the ...
1
vote
1answer
25 views

While Loop Print List formatting

I wanted to create a list of factors from any given number only using the formula below. I am not allowed to use list therefore, I have imitate using strings as follows: for example and lets say we ...
-3
votes
1answer
31 views

Break while loop after one execution? Ruby [closed]

I'm trying to find the greatest prime number based on a max value...I just want this to print the largest prime number but I can't figure out how to break this loop after printing the first number. ...
0
votes
1answer
22 views

To get all checked items from a while loop (HTML & PHP)

I am hoping that you guys could give me some tips or help on how I should allow the codes to work. Firstly, I am trying to get a list of names of those who have signed up for an event, and having to ...
0
votes
3answers
29 views

PHP while statement issues

I am having issues with my PHP while statement. It is: $row = mysqli_fetch_array($result); $time_in_12_hour_format = date("g:i a", strtotime($row['Time'])); while($row = mysqli_fetch_array($result)){ ...
0
votes
3answers
77 views

Need another set of eyes on my loops

Starting with a list of coordinates, I'm trying to create a new list with interpolated coordinates included. I'm missing something and it just appends the first and last coordinate over and over ...
1
vote
3answers
35 views

How can I make raw_input tolerance more robust in Python 2.7?

I'm new here and to programming so please take it easy. I understand that almost anybody reading this knows more than I do and that I'm probably doing it wrong. That being said, this is what I'm ...
2
votes
3answers
73 views

How to show the values in the LOOP for every 10 second in java

I have a while loop where in it constructs a JAVA String by appending the output from a shell script. System.out.println("Here is the standard output of the command:\n"); while ((s = ...
0
votes
1answer
35 views

multithreaded server, loop is working only once

I have problem with my multhreaded server for bridge auction. The topic of it is less important, all I need to do so far is to make the loop inside the run method work for more than only one "lap". I ...
0
votes
3answers
60 views

Replace simple while loop by recursion

If I have an simple function (pseudocode) like fun(a, b): x = a i = 0 while i < b do x = x + a i ++ return x Can I replace the while loop in this function by a recursion?
0
votes
3answers
74 views

Loop with numbers in rows of the csv file

I wrote a python script to run a sql in PostgreSQL, import sys, os, math os.chdir(r'C:\Users\Heinz\Desktop') print os.getcwd() #set up psycopg2 environment import psycopg2 #shortest_path module ...
1
vote
4answers
74 views

Inner and outer loop in C

int a = 0, b = 0, c; while ( a < 10){ while (b < 10){ c = a * b; b++; } a++; } Variable b is being incremented but a isn't. A stays 0 and doesn't change until the ...
-8
votes
1answer
62 views

Finding the biggest and smallest number in a group of numbers

Well it is as the title says. To find the biggest and smallest number in a group of numbers, when done , it has to print the biggest number with the message "BIGGEST" and it has to print the smallest ...
0
votes
2answers
34 views

Wait for file to delete, then copy a folder

I have a couple of scripts that have to sync a folder from the network server, to the local terminal server, and lastly into the %LOCALAPPDATA%. I need to first check if a folder is being synced (this ...
2
votes
4answers
79 views

Finding if two triangle are congruent

The problem goes like this: Write a program that reads the three angles and sides of two triangles and print if they are congruent or not. We do not how many times the user wants to ...
-1
votes
4answers
56 views

Java endless Scanner loop

Im trying to print the same strings as the user are pasting into the console. My code looks like this: import java.util.Scanner; public class reader { public static void main(String[ ] args) ...
-1
votes
0answers
15 views

Having a WHILE loop error— Call to a member function fetch_array() on a non-object [duplicate]

I am attempting to call every row from a table and fill in a "customer_id" field in a table that never used to store a customer_id. This table I call the "staff_pay" table. It does however, in each ...
-5
votes
0answers
36 views

using the loop statements: for while do etc. in c++ [duplicate]

What i have to do is Write a program that reads a set of integers and then finds and prints the sum of the even and odd integers. The numbers have to be then be read in from the user using the cin ...
2
votes
1answer
50 views

While loop in R giving “argument is of length zero” error

I've been doing some topic modelling (LDA), and I've created a matrix of the posterior probabilities that each document (in this case, a day's worth of tweets). I'd like to measure how focused each ...
0
votes
0answers
20 views

Custom Checkboxes don't work in a whileloop as intended

I have searched the site and cannot find any solutions, hopefully someone will be able to help me out.. I am working on a simple mail system so I can view messages in the browser and I was creating a ...
0
votes
1answer
49 views

How to use arrays created by loop? Matlab

The code I'm using imports data from multiple files and saves them into an array of cells, the code is as follows: [FileName,PathName,FilterIndex] = uigetfile('*.txt*','MultiSelect','on'); numfiles ...
-1
votes
1answer
62 views

The simple while loop [closed]

I'm trying to use while loop in R, I used a function for three parameter but I need to find a parameter for a specific function value so I used while loop for iteration. Simply, I wrote my codes as ...
0
votes
3answers
67 views

Basic while loops in Python

I have been trying to make a simple game in Python 3.3.4, at the beginning of the game I want the user to select a difficulty between 1 and 3 and if they put in another character other than 1, 2 or 3 ...
5
votes
2answers
68 views

Avoiding while loops in SQL when a counter is required

I feel like this is a common problem, but it seems that none of the answers that I have found on SO or other sites seem to address the issue of a while loop with a counter. Let's say that I am ...
-7
votes
3answers
45 views

how to break out of this while loop [closed]

guys i am trying to break out of this while loop.. starterP=input("Would you rather Torchik, Mudkip, or Bulbasaur? Choose wisely.") if starterP=='Torchik' or starterP=='torchik': print("You ...
-4
votes
1answer
57 views

How to stop a infinite while loop

I am writing this simple game for an assignment in my class. I am trying to make it so that once the user enters “yes”, it stops asking them if they would like to proceed to the Kanto region. But if ...
0
votes
1answer
19 views

How to break infinite loop in this script

I am doing something interesting with bash I wrote script below: #!/bin/bash while : do if [ -s /tmp/file.txt ]; then for line in $(cat /tmp/file.txt) do echo $line ...
-1
votes
2answers
38 views

while loop within while loop

"hello" is printed by puts only three times. It is supposed to be printed six times, isn't it? i = 0 j = 0 while(i != 2) while(j != 3) puts "hello" j += 1 end i += 1 ...
1
vote
0answers
38 views

PHP While loop order

I am trying to make a follower post kind of thing in PHP and whenever Ajax refreshes my page, they are not in the correct order. The output I am getting is that the content of a post always sticks to ...
0
votes
4answers
78 views

While-Loop Use in Python

When you come to the 2nd while loop while x == 2: it's still repeating the whole script even though x /= 1 (not if "n"is entered). Let say we enter "y" on the prompt "Is this correct?" shouldn't x ...
-2
votes
2answers
73 views

Any difference between while(true) and for(;;)? [duplicate]

I know both of these create intentional infinite loops, and I have a friend who bugs me to no end about using for(;;) as opposed to while(true). Is there any difference between the two besides ...
0
votes
2answers
81 views

while true loop in python can't be stopped [closed]

I have a problem with this loop in python: i = 1 while True: with open('/tmp/file.txt', 'r+') as f: for line in f: work = 'word1' + line + 'word2' + line + 'counter=' + str(i) ...
-1
votes
1answer
22 views

How do i search an array for a value in a loop and ends with -1?

Define original and diff as two integer arrays that could store 10 numbers each. Initialize a third integer array called newArray also for size 10 with any ten positive numbers. Write code that ...
0
votes
0answers
33 views

while loop doesn't show, and no error [duplicate]

My while loop doesn't show up, but I get no errors. there seems to be somthing wrong with my query beceause when i insert it in phpmyadmin it doesn't give my anything back, but again no error. can ...
-1
votes
4answers
47 views

Bash while read : output issue

Updated : Initial issue : Having a while read loop printing every line that is read Answer : Put a done <<< "$var" Subsequent issue : I may need some explanations about some SHELL code : I ...
0
votes
0answers
19 views

store each result (filenames) of a while loop to compare them and select most recent file

i'm new here and have almost always found the solutions i was looking for by reading the forums. I'd like to thank you all for this. I've got a loop which selects every file in a dir starting with a ...
1
vote
0answers
39 views

curl to bing web site in bash from list

I want to get host of a web site like filehippo.com: What I tried is: #!/bin/bash AGENT='Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1' page=1 for line in $(cat ...
0
votes
1answer
47 views

Bash script to show range of IP addresses

I want to write a bash script in order to get two IP addresses and shows me whole range between them... I'm trying but unfortunately no result... Could you possibly help me? I found this one but ...
-6
votes
3answers
45 views

Loops in loops and increment staying at 0 in C++ [closed]

I have 2 while loops in a while loop like so in the code: #include <iostream> using namespace std; int main(int argc, char *argv[]) { int p = 0; int p2 = 0; int p3 = 0; while(p ...