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
15 views
a do loop within a do loop no giving the correct outputfiles/images
I am writing a piece of code which requires me to input get information about this image form a starfile. Then print out a smaller image using pyfits. this code works perfectly when I do it with one ...
-1
votes
7answers
70 views
Nested “for” loops c++
On the way to understand working of nested for loop i wrote a program that takes a input and display a pyramid upto that input value like this:
1
22
333
4444
It's displaying just the height of ...
2
votes
1answer
33 views
Logical operators in if-else in R
I have the following table (5 columns and 3 rows) called mat :
AC CA RES
1 0
2 2
1 3
0 0
0 1
The operation being performed is mat[1]/mat[1]+mat[2]
I am testing for the following :
...
0
votes
3answers
14 views
Using switch on $_GET with if
So I'm trying basically to make it like: ?p=blabla&dep=blabla
switch($_GET['p'])
{
case 'home':
include("template/index.html");
break;
case null:
include("template/index.html");
...
0
votes
1answer
63 views
PHP $_POST not clearing itself in loops and causing errors
I"m using a PHP script to access a remote server with cURL to process some photo gallery info and files. When I process this function, I get 4 of everything because there are 4 photos, so somehow the ...
0
votes
1answer
24 views
Adding a for loop to include all columns in my data set
How can i manipulate this code using perhaps a for-loop?
tbl1 <- table(Column1Name)
cbind(tbl1,prop.table(tbl1))
This code works well for one column but there is over 100 columns in the
data ...
-2
votes
1answer
31 views
Python - Helper function
I am using the print_board(board) to display the modifying board string with '|' in the beginning, between each letter, and in the end. Then, print_board_continued to create a 7 by 6 board created ...
0
votes
2answers
50 views
Breaking Out Of A Loop Using A Method In Java
I am trying to use a method to double check before a user exits a while loop in my program.
private static Scanner input = new Scanner(System.in);
public static void ays() {
...
0
votes
1answer
17 views
How to process 2 ranges/lists in sync with each other in bash
I assume this question has been asked before but I don't know how to ask/search for it so if this is a repeated question, please point me to the solution and close this one.
I have a file with 2 ...
2
votes
3answers
57 views
If Statement and while loop
I'm a self taught programmer, and I just started using python. I'm having a bit of a problem, when I execute this code:
x = 0
while x == 0:
question = raw_input("Would you like a hint? ")
if ...
0
votes
2answers
20 views
Looping through perl constant
I have the following code in perl:
package SignatureScheme;
use strict;
use warnings;
use constant {
SHA256_RSA_V1 => 'SHA256-RSA-V1',
SHA256_HMAC_V1 => 'SHA256-HMAC-V1',
...
0
votes
1answer
26 views
How do I join results of looping script into a single variable?
I have looping script returning different filtered results, I can make this data return as an array for each of the different filter classes. However I am unsure of the best method to join all of ...
0
votes
1answer
41 views
how do you keep loop count when looping through the output of a property in python?
so I'm looping through a property in python.
By the way this is just example code... not what I'm working with:
I did not wan't to post what I'm working on, because it's hundreds of lines.
but I ...
0
votes
2answers
46 views
How do you convert a series of javascript (jQuery) button “on clicks” into a loop?
I have a series of buttons (25 of them) used to set the height of something in a web application. I know it's an odd way of doing it, but there's a reason. Each button has an id equivalent to the ...
1
vote
6answers
58 views
Looping a list returning a value in dict
I am trying to read from a list and return a corresponding value in a dict.
Please help me where I am going wrong.
Thank you
DICT = {"b": "21", "g": "54", "f": "121", "t": "1", "j": "33"}
n = ['b', ...