Questions tagged [loops]
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.
loops
96,562
questions
0
votes
0
answers
36
views
Loop models multiple times
I am trying to run the following code multiple times with different values for the 'aux' object.
time <- seq(0, 30, 1)
stock <- c(sK=0, sF=1)
aux <- c(aH=0.4, aRel=0.5, aRes=0.5, aS=0.8)
...
-1
votes
0
answers
21
views
pygame .rumble() function running into a syntax error when placing in a loop
I recently began learning Python and intend to create a Python script that activates vibration in a PS4 controller inside a for loop. The goal is to run a while loop at a specified time interval that ...
1
vote
1
answer
23
views
Pass element form character vector in loop to function and use in assign
I have a function that chooses, reads and formats Excel reports from Workday, and produces data.frames. I've simplified for purposes of begging for your help. :-)
In the function, I pass a parameter ...
0
votes
1
answer
10
views
Creating a Repeating/Looped Table in Cognos
I need to create a table of lat/lon coordinates with repeating values, in order to calculate distances between all locations.
In the DB I have the following fields to use:
Location Code
Latitude
...
0
votes
0
answers
30
views
How to calculate the Relative Strength Index (RSI) through record iterations in pandas dataframe
I have created a pandas dataframe as follows:
import pandas as pd
import numpy as np
ds = { 'trend' : [1,1,1,1,2,2,3,3,3,3,3,3,4,4,4,4,4], 'price' : [23,43,56,21,43,55,54,32,9,12,11,12,23,3,2,1,1]...
-1
votes
1
answer
55
views
Python input validation won't end
I am trying to make sure a user only chooses an option between 0 and 2. If they don't choose that, I want them to be able to try again. Nothing seems to be an infinite loop, but the program will never ...
0
votes
1
answer
58
views
Loop Splitting Decreases Performance in Intel Fortran
Compiler: Intel Fortran 2024
Operating System: Windows 11
I'm pretty new to Fortran, working on a Fortran project and found out that the loop splitting will decrease the efficiency dramatically.
For ...
-3
votes
0
answers
21
views
QT6 multi butons change parameters in loop [duplicate]
I apologize for the bad English (translator),
I am looking for a solution for a dynamic name for the buttons so that I can go through all the buttons in a cycle and then name them individually ...
0
votes
0
answers
40
views
Breaking Loops in Python
I have a long, I2C python program for a I2C MUX Board that I am making. I have 4 MUXs, in my program I am using a while loop for each one. Within the while loops, I have this structure (to make it ...
-2
votes
0
answers
73
views
what are the major differences between case1 and case2? [closed]
//case 1:
main()
{
int i=1;
while(1)
{ // your text
printf("%d \n",i);
++i; // your text
}
//case 2:
main()
{
int i=1;
...
0
votes
1
answer
49
views
How to loop through an array?
How do I loop through an array?
The idea is to go to the Names worksheet, Where I have a list of users Initials and names in a list. Create 2 arrays that record the initial and name of each person. ...
0
votes
2
answers
66
views
Bash loop on two sets of files simultaneously
I have two sets of files in the same directory :
1.bam
2.bam
3.bam
and
1.txt
2.txt
3.txt
I need to run a command where 1.bam and 1.txt are interpreted together, and so on..
I tried looping through ...
-1
votes
2
answers
33
views
Extracting values from array and adding them to new elements
I've got some code which loops through an array of products, it records new categories found and also how many times a category is found:
const categoriesFound = (catArray) => {
let categories = {...
-1
votes
3
answers
40
views
How to run map() after fetch has completed React
I'm trying to fetch data and then get my React App to map through the data to render each product on the page.
However it fails to find the data to perform the .map() and I assume that's because the ...
1
vote
1
answer
28
views
How can I expand the range for a code? How to create a proper loop?
I have a code that is doing what I want, but now it works only for one column of the sheet and I would like to create a loop that will works on multiple columns.
Now the code is checking if column L (...