Skip to main content
Filter by
Sorted by
Tagged with
3 votes
2 answers
54 views

I'm trying to find the outbreak time (when the number of zombies >= number of humans) as a function of the zombification rate gamma, using the following code: arrOutbreakT = [] arrGamma = np....
me1ll0's user avatar
  • 33
-2 votes
2 answers
128 views

it's not breaking and I don't know why This is the problem section of the code. It is working fine, the try except is fine, and the check if not in range's break is working fine. But not the second ...
Sheep Doom's user avatar
3 votes
1 answer
89 views

I am trying to re-run a nested for loop within a while loop if the while condition is not met. If the condition is met then I want the inner loop to terminate and proceed to the next iteration of the ...
user3500717's user avatar
1 vote
2 answers
82 views

I'm reformatting a big file with sample metadata. I have a file (let's call it File2) with the group each sample belong to, with one id and pop per line. My idea was to while read over that file and ...
Pedro Morell's user avatar
-9 votes
1 answer
145 views

I was trying to get the last word of the sentence using the .find() method in a loop. My code: sentence = "please write a program which keeps asking the user for words" index = 0 substring = ...
krish mundra's user avatar
0 votes
1 answer
152 views

I am using Nginx + Lua (OpenResty, LuaJIT), and I did some performance tests on various loops. local ngx_log = ngx.log -- https://openresty-reference.readthedocs.io/en/latest/Lua_Nginx_API/#nginx-log-...
C0nw0nk's user avatar
  • 992
-4 votes
4 answers
180 views

Task: to make console to display a message "Happy birthday!". Number of messages equals the number which user inputs to console. Condition: program should break the cycle, when number of ...
Uroboros First's user avatar
1 vote
2 answers
117 views

I have constructed a for loop that I though would given me a "circular" index that starts at some number (n) and cycles around again to that number through the series 0 to n, that is "...
Anne Eve's user avatar
2 votes
3 answers
156 views

I have a function called escape that copies over a character array into a new one while replacing the \t and \n characters with raw characters \t and \n i.e single character '\n' becomes 2 characters '...
saberton's user avatar
-1 votes
2 answers
96 views

I face the following problem, which looks like a bug (or maybe am I the bug): I have a loop: #!/bin/bash # TARGET=/sd/REMOTE_BACKUP LOGDIR=/sd DEBUG=: # Init daily information (reset on each run and ...
Alan's user avatar
  • 7
0 votes
6 answers
231 views

I need to create a program that can do this: Input: args2 one two three Output: You have entered 3 arguments: #1: one #2: two #3: three This is what I have so far: #!/bin/bash echo "You have ...
waterscapes's user avatar
0 votes
2 answers
156 views

The code is supposed to reverse the words that have the length equal to longest word length from the phrase. Input string: #Voi#da#bacu#la#info# Expected output string: #Voi#da#ucab#la#ofni# I ...
Mihai's user avatar
  • 9
1 vote
1 answer
186 views

I am a novice to programming, and I'm doing it for fun. I encountered a strange bug I do not understand while trying to parse simple user input. My problem is that when an invalid character is read (...
violetRM's user avatar
0 votes
0 answers
30 views

I don't know why, but only the '0' option works, unless the 'clear' command is removed or commented out. See the script: NUMERO=-1 while [ $NUMERO -ne 0 ]; do clear echo "------ M E N U -...
Luiz Moura's user avatar
0 votes
0 answers
59 views

I have code that has two warnings. The code is from a commandline Expense manager project that uses a List to save and access expenses. Saving and retrieving the List is done via serialisation and ...
Andruid929's user avatar
1 vote
2 answers
92 views

I was presented with this question as part of my Intro to Prog & Logic class. Problem 5: Write a simple program that the user can enter any number of positive and negative integer values and ...
Miranda Cataldi's user avatar
-6 votes
2 answers
69 views

This is a Python 3 question for loops using 'for' Why does the print(num-1) still execute at range 4? In my mind when range is 4 it should skip print(num-1) and go straight to else: print(num). for ...
Jay B.'s user avatar
  • 11
0 votes
0 answers
45 views

I had this piece of code: While match <> Nil Var block As New Glyph block.Abstract = match.SubExpressionString(1) block.Noun = match.SubExpressionString(2) block.Verb = match....
Anna Vahtera's user avatar
0 votes
1 answer
93 views

The following code is simple and works when trying to compare previous values from one column to the next. The only problem is that it is displayed one row below where I want. So the numbers do not ...
user26136009's user avatar
1 vote
3 answers
159 views

Suppose I have a piece of C code while(1) { switch(a){ case 1: if(b==1) break;//first break break;//second break } } ...
Turbo's user avatar
  • 87
0 votes
1 answer
97 views

I'm trying to create a way of inserting aggregated data into a table by using a loop with a moving cursor. I want to count records in a 1h timeframe and compare it to the average number in ...
Mikis's user avatar
  • 11
0 votes
0 answers
106 views

I have a JSON file which looks like this [ { Mem id:12345 DOB: 04041994 }, { Mem id:5678 DOB: 05061987 } ] I want to take each mem details and validate in my application using loops. ...
user29427449's user avatar
1 vote
1 answer
133 views

I'm writing a script that will transfer large amounts of data to an SFTP server, and I'd like to have some sort of terminal print-out during the long loading time for troubleshooting/debugging. I'm ...
Jwok's user avatar
  • 752
0 votes
0 answers
33 views

I am using TRADER package in RStudio in my dendrochronology project and this error keeps popping up after entering the function growthAveragingALL(). Error in while ((!is.na(above[iil - 1, i])) & (...
user29574866's user avatar
4 votes
4 answers
186 views

Only started learning Python a few days ago. I followed freecodecamp's while loop word guessing game tutorial and wanted to add the statement, "Wrong answer!" after every wrong guess. This ...
user29472044's user avatar

1
2 3 4 5
530