Category "loops"

How to call a function once in a while loop

I have a robotic code, that does the following: camera starts processing and taking images Mounting Holes (hough transform) function detection is activated The

How to create an array of random security codes in Java? [duplicate]

I am trying to write a program that would ask the user how many security codes he wants to generate, then it would output as many codes as he

Creating an array from each key in an array of objects

I have an array that looks similar to this: The array of objects is much larger and each object has more properties, this is the structure though. let arr = [

Having a loop issue

I am running the following code for pi value to calculate the first value which yields 3.14. I used manual values for range which works, but I want the values t

Why doesn't R dplyr arrange sort properly using a vector element within a for loop

I'm having trouble getting r's dplyr::arrange() to sort properly when used in a for loop. I found many posts discussing this issue (like ex.1 with the .by_grou

For loop through different excel files AND different worksheets (Matlab)

I try to loop not only through different excel sheets(~125), but also through different excel files (~12). I managed to write a code for the sheets, but now I

Strange result in loop when use special chars

I have strange problem when special chars in loop when add br and use specal chars, if don´t use words with special chars no have problems but when use sp

Subtract the date from each cell in a column, skip cells that have string values

I have an Excel sheet of expiration dates. Some rows lack an expiration date so I chose to fill those cells with the string “NO DATA”. I want to loo

dataframe to save csv: not accumulating the records only saving the last dataframe group records

dataframe question in web scraping data group example:the first loop-eg:5 records, second loop-eg:3 records when I did my below code, the csv file was saved the

How to run a compare though multiple sheets?

I'm trying to run a compare though multiple sheets. I get Runtime error 9 subscript out of range Sub Comp_TEST() Dim ar As Variant Dim var() Dim i As Long Dim

How do I implement the looping functionality in my BrainFuck Interpreter?

There's multiple questions here already, but I'll still proceed. This is a simple BrainFuck interpreter. I figured out all the other symbols, but I can't figure

R: converting text with irregular length into dataframe

Simplified example of a text i have after importing with readlines: text <- c("just", "stuff", "nothing", "interesting", "date", "06.05.2022", "number", "1/

how to exit this loop in python

why does break doesn't work? I want the code to stop when I click the specific key import keyboard def loop(): x = 1 while True: print(x)

Return Array After For Loop

Having a hard time understanding for loops in arrays. Trying to create a Thank You card creator and these are the steps I'm trying to follow: Create a new, empt

While loop not terminating even after the 'return'

I am using the while loop to iterate through an array and trying to terminate the loop using the return (I tried foreach before which doesn't terminate for retu

Loops: How can I loop case_when function in R?

Here's the code, where I am trying to create a variable by detecting the words and matching them. Here I use dplyr package and its function mutate in combinatio

How do I keep grabbing bytes and encrypting them in Python?

cipher = Cipher(algorithms.AES(key), modes.CTR(iv)) decryptor = cipher.decryptor() plaintext = decryptor.update(data[0:4]) paramEntry1 = int.from_bytes(plainte

R : How loop a function creating named dataframes according to dataframes contained in a list passed in argument?

I made a function that takes a dataframe as argument, and creates two dataframes in output according to a threshold value of one of the columns. These 2 output

How to update XML with reading it only once with PowerShell?

Can someone please help me to do the following more efficiently? I am running this code 4 times for updating specific below protocols/file types. I would like t

Loop numbered variables in Excel VBA - [duplicate]

How can I loop through a set of variables which are numbered consecutively (Bay1, Bay2, Bay3, etc.)? I have 10 variables and I need to examine