Most voted "loop" questions
Loops are a type of flow control structure in programming in which a series of statements can be run repeatedly until some condition is satisfied.
Learn more…671 questions
Sort by count of
-
0
votes1
answer1036
viewsHow to send messages at time intervals to a batch of emails
How do I get the loop to send every 10 emails or every X seconds? I want to prevent emails from falling into the spam list. And how can I get the code to read a file . txt with the listed emails and…
-
0
votes1
answer195
viewsadd to array after loop
I have some loops in my php and want to get an array like this: Array ( [nome1] => valor [nome2] => valor ) inside a loop I tried : $array_dos_pagamentos[nome] = $variavelnome; and another…
-
0
votes1
answer103
views2-second pause between emails
I have the Swiftmailer library sending the emails correctly, but I would like to pause 2 seconds between submissions of the various emails in my array. I tried to use the sleep(2) in the loop, but…
-
0
votes1
answer43
viewspq the input x iteration DOES NOT interfere with the while loop x iteration, where it is the same variable?
I am learning programming logic with Python and I don’t understand how the input x DOES NOT interfere with the iteration of the x from the while loop, which is the same variable. Please explain to…
-
0
votes2
answers89
viewsHow to rescue large amount of variables sent by POST and use them?
I have a problem rescuing large amount of variables sent by the method $_POST. I was using this code earlier: import_request_variables("gp", "rvar_"); But the same was discontinued and my script…
-
0
votes1
answer30
viewsDoubt with operator
I’m solving this simple algorithm when I came across a silly question, there on line 4, that even means < or <= ? In the case for(k=4;k<7;k+=3) or for (k=4;k<=7;k+=3)? Grateful.…
loopasked 7 years, 5 months ago Mateus Nícolas 3 -
0
votes1
answer135
viewsError inserting image loop in report pdf Reports.dll . net
I have a while that will repeat 3 times an insertion of a barcode but I am using lib Reports.dll to create the report in pdf. This lib only accepts images saved in some directory (as far as I know),…
-
0
votes2
answers739
viewsHow to add +10 whole seconds to date in a loop in PHP
I need the loop be executed 10 times, and that each loop the variable $tempo that has the date, hour, minute and seconds receive +10 seconds, but that in the final result is not displayed in…
-
0
votes0
answers38
viewsLarge Inside Loop of Other
The challenge is to find x different ways to divide the object, for 3 people where each has to receive a value less than or equal to M, and the sum of the value that each won has to be equal to N,…
-
0
votes1
answer177
viewsHow to loop, capturing the keys and values of an object
I would like to loop an object in order to capture the key and the corresponding value. For example: const obj = { 'Chave 1': 'Valor 1', 'Chave 2': 'Valor 2', 'Chave N': 'Valor N' }; I’d like to…
-
0
votes1
answer40
viewsLoop Wordpress coming out uneven!
Good morning guys, I’m making the loop using wordpress + bootstrap and at the time of shows the content the loop some posts as shown in the following image: Follow the loop code: <div…
-
0
votes2
answers880
viewsEnd loop when an entry is empty
I have the following situation: A repeat loop that asks for name, and 2 notes, where the data input should end when an empty name is read, but in the way below the second time the program runs the…
-
0
votes3
answers454
viewsLoop of repetition in C
Hello, I’m a beginner in programming and I have a question: I’m making a program that has a menu and a registration to be performed by the user. I would like to know how to make the menu of the…
-
0
votes1
answer49
viewsCategory Loop in Wordpress
Does anyone know how to create a loop to display categories and how many posts are in each one? Example: Category X (15) Category-y (32) Category-z (40) Where "category"=category name and the number…
-
0
votes1
answer98
viewsWhy does this infinite loop happen?
I made this code but it keeps giving endless loop and I can’t fix... #include <stdio.h> int main (){ int x, z; while("x=100; x!=65; x-=5"){ z=x*x; printf("%d --> %d\n", x, z); } }…
-
0
votes2
answers62
viewsIncorrect Printed Form Values
I don’t know where I’m going wrong. #include <stdio.h> int main (){ int i, num, soma, maior, menor; float media; printf ("Informe 10 valores:\n"); for (i=1; i<=10; i++){ scanf ("%d",…
-
0
votes3
answers41
viewsCount sql results in table with or without values
I have a table subcategorias and I have another anuncios, where it has the id of the subcategory. I need to search all subcategories and return together, by subcategory, the amount of ads it has,…
-
0
votes1
answer88
viewsJavascript - Run multiple times
Everybody, good afternoon, everybody I have a JS + CSS code to open an image in normal size through a reduced image. I was able to do this with a single image, however when I put a looping in php,…
-
0
votes1
answer44
viewsReturn values from Database
I’m getting this mistake: Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 1640 bytes) in C: Appserv www muweb class Connect.php on line 31 When I run these scripts:…
-
0
votes2
answers90
viewsError trying to scan an array
I am trying to scan the array within the loop, as per the code below: import java.util.Scanner; public class RapidoPora { public static void main(String[] args) { int[] nota = new int[10]; for(int c…
-
0
votes0
answers70
viewsUpload and show on-screen at runtime loop with PHP, Jquery, AJAX, javascript
I want to upload an array and at the same time I want to show each file that was "uploaded" in a loop, at the time of execution of the loop, (for this the page can not refresh), avoiding to do all…
-
0
votes1
answer2243
viewsHow to fill an array [ ][ ] with struct in C++, in the code below
Need to put the employee code in a [2][100] matrix and the sum of children multiplied by how much each earns, in the module: int calculo(CADASTRO_FUNCIONARIOS cadastro[100], int n) Code:…
-
0
votes0
answers61
viewsJquery is only loading in the first table item
Good morning, I have a table that displays the budgets (coming from the bank) within a while loop... For each budget there is the button to view more details, in which opens a modal And in this…
-
0
votes1
answer84
viewsPHP: Group data without using group_by
Does anyone know how to group data without using group_by in consultation? I need every 10 loop results (foreach), create a div, that is, 10 records within each div, I don’t care about the values.…
-
0
votes1
answer182
viewsForeach and multidimensional associative array with only one item
All right guys, I am facing a problem with foreach in PHP, in which I receive an xml and convert it to array. Only that in some cases xml has only one item (See the example below) <?xml…
-
0
votes3
answers1982
views"for" with step "float": Typeerror: 'float' Object cannot be Interpreted as an integer
I want to loop 0 to 100 with step 0.1: for x in range(0, 100, 0.1): a = cos(radians(x)) But I get this mistake: Typeerror: 'float' Object cannot be Interpreted as an integer How can I make a loop…
-
0
votes2
answers921
viewsLoop of the Wordpress category
I’m trying to make a loop just the category I’m in Wordpress and I’m not getting. Somebody give me a light? I’m trying to file Archive.php of the theme. obs. Should display only posts in the open…
-
0
votes0
answers55
views -
0
votes1
answer156
viewsHow to show 5 in 5 hidden elements?
I was struck by a doubt recently, by which I must manipulate a certain number of elements hidden through the display:none; that it is defined on the span that involves all of them. Example…
-
0
votes1
answer205
viewsMore efficient way to compare two variables type List
I have two variables of the type List that need to be compared to each other to verify possible duplicates. Example of Variable Contents Variable 01: [01, Test, Active] Variable 02: [01, Test,…
-
0
votes1
answer36
viewsInteracting all items on a list
I have the following situation: I have 4 numerical lists ranging from 1 to 30. Ex.: AP_X = [1,2,3,4,5...30] AP_Y = [1,2,3,4,5...30] demanda_X = [1,2,3,4,5...30] demanda_Y = [1,2,3,4,5...30] I have…
-
0
votes1
answer31
viewsWrite word in succession until the end of the cycle
let palavra="1234567";; let tamanho=String.length palavra;; for i = 0 to 6 do print_string String.sub palavra i (tamanho-i); print_string "\n"; done;; I tried to execute the code, but it won’t…
-
0
votes2
answers117
viewsLoop with columns and Rows
I’ve been trying to do it like this: <?php foreach ($unfollow as $row): ?> <div class="row"> <div class="col-md-4"> <?php var_dump($row)?> </div> </div> <?php…
-
0
votes1
answer52
viewsGenerate a new array dynamically with php
How could I generate a new array in a loop? for example make the machine generate array1[], array2[] I can create a variable like this with the following code: ${'var'.$i} // E isso virar $var1,…
-
0
votes3
answers400
viewsMake a Static method in the main class that writes on the screen all even numbers from 1 to 10000 that are palindromes
This is my method: public static void B() { int vet[]=new int [100]; int vet2[]=new int [vet.length/2]; for(int i=0;i<=vet.length;i++) { vet[i]=i+1; } for(int i=0;i<vet.length;i++) { int rest…
-
0
votes1
answer37
viewsThe difference between FOR and DOSEQ in clojure
What difference between for and doseq? I wrote a program, which returns me the highest value within the parameters informed. Note: I know that there is a function max and max-key, but I don’t want…
-
0
votes1
answer27
viewsReversing the process of a function
I was thinking about a project for testing Skills, about a load bar and I thought, we can undo a modification on a page normally, but and do the opposite process ? for example, we have an automatic…
-
0
votes1
answer43
viewsRepeat result when reading local xml
I need to capture two attributes of an xml (date and type), even managed to make the script returns the values, but is repeating in the result of print and I can’t understand why. XML file: <?xml…
-
0
votes0
answers49
viewsHow to optimize a power loop of 2 n and (2 n)+1 in java?
Good, I’m doing a job where I have to do tests in Stacks, and the tests have to be done when I push and pop of powers of 2 and powers of 2 plus one (1,2,3,4,5,8,9,16,17, etc...) I got some code…
-
0
votes2
answers332
viewsCalculation of the smallest divisible number giving infinite loop in C
I did a C program to solve the following exercise: Code: #include "stdio.h" #include "stdlib.h" int main(int argc, char const *argv[]) { int num = 0; int count = 20; int contaDivisores = 0; for(int…
-
0
votes0
answers14
viewsHelp with the while loop in a Python quiz
The intention is if the answer is s he executes that completed the registration successfully, but if it is n or other than s prints the message: registration canceled or thank you and come back…
-
0
votes2
answers80
viewsProblem with neighboring positions in C++ arrays
#include <iostream> using namespace std; int main(){ int myVector[] = {2,6,4,1,9,5,7,3,8,0}; int tamanhoVetor = sizeof(myVector)/sizeof(myVector[0]); //Imprime for (int i=0;…
-
0
votes1
answer279
viewsWhile C++ does not enter the loop using string getline
Good afternoon guys, I’m having a problem with my code. When I ask if the user wants to repeat the program, it just doesn’t loop. I’ve tried using the user as numerical information and it worked,…
-
0
votes1
answer400
viewsIn R: How to group the results of a loop into a rbind function?
Whereas I have a dataframe called page whose number of lines varies regularly, I wrote this code so that it fits the number of lines that my page$id owns and wrote this while so that he manages a…
-
0
votes2
answers707
viewsChecking repeated numbers in PHP
I’m doing a choice job that’s a lottery. In this lottery I need to check if the numbers are equal, if they are, I must substitute for another number and this number may not have already been…
-
0
votes2
answers165
viewsPython how to repeat my code
I would like to repeat this code not to iterate it 300 times , is a robot to click on the screen,I wanted it to repeat , the code is this ,I am new here and in programming I did not put the format…
-
0
votes3
answers103
viewsWhy is this piece of code looping endlessly?
All variables are declared and Eclipse is pointing out no error in the entire code. What I need to do: The user can only choose between 1, 2 and 3. Any other input, including text (example: test)…
-
0
votes1
answer34
viewsRepeat number at each count
How do I do this in php, please help me: ( Every three times ) 0 = 0 1 = 0 2 = 0 3 = 1 4 = 1 5 = 1 6 = 2 7 = 2 8 = 2 So on and so forth. This is a simple example of what I would like to do, because…
-
0
votes0
answers188
viewsstruct that stores the number of rows and columns of the matrix and of a vector
I used a struct to store the number of rows (m) and columns (n) of the matrix and another to store the number of columns of the vector (n). I make the product of two matrices in function prod() and…
-
0
votes1
answer460
viewsLabel update in loop
How do I update a label in a loop in the tab FXMLDocumentController? The Abels only update after it completes the entire loop and then plays the last info on the screen; package musicaisfx; import…