Questions tagged as 'loop'

2
answers

Why is this loop "for" not infinite?

public class Loop { public static void main(String[] a) { int cont=0; for (int i=0; i>=0; i+=2, cont++); System.out.println("cont:"+cont); }} I was struck by the condition of the loop for i>=0 . At the time I thought: loop infini...
asked by 31.08.2018 / 21:04
2
answers

Application of the assign function in loops

I want to assign names to variables with a loop. With for I get: library(tidyverse) for(i in 1:6){ names<-str_c('var',i) assign(names,runif(30,20,100)) } But with lapply and map not: lapply lapply(1:...
asked by 14.12.2018 / 19:25
1
answer

Why does the enhancer "lose" the loop? [duplicate]

Making a simple loop FOR , I encountered a strange behavior that I could not understand. The count is "lost" in the AJAX request, keeping the incrementer value with the last one. The URL request always returns 200 and still doe...
asked by 27.05.2016 / 00:01
1
answer

How to create loop to issue an event in socket.io?

I have an architecture problem. I have a code using socket.io at nodejs : socket.on('images',function (aData){ ... socket.sockets.emit('show', JSON.stringify({imagens : json})) }); I'm trying to broadcast a broadcast from tim...
asked by 20.01.2014 / 11:16
2
answers

Show loop result in real time

I'm using a loop to send mail from an array. Each time the loop runs the sleep(4); function is executed. The problem is that the output of php only happens at the end, ie the echo "</br>n:".$ne."&nbsp".$user["email"]."<...
asked by 19.01.2016 / 17:14
1
answer

Loop overload with foreach use [closed]

Hello I'm having a serious problem at least and what the hosting company aqual this my site is claiming that my code below is overloading queries or doing several loops, and I do not know what else I can do. / p> Is there any way to unify or r...
asked by 13.11.2015 / 17:08
1
answer

Working with errors inside the loop in R

I inserted the non-linear adjustment function gnls into a loop for so that I could test a series of start values automatically. The issue is that eventually any of these start values generate error in the gnls...
asked by 02.03.2015 / 15:46
4
answers

How to know the highest value of an Array?

I'm doing 1 calculator that adds values entered by the user and when the values of the sums reach 1000 or exceed, the loop ends. So far so good, the problem is to be able to identify the highest value entered by the user Each time the loop...
asked by 08.10.2014 / 04:54
5
answers

How to concatenate String within a loop of repetition?

I need to add some values in a string . How do I concatenate values in a string with a loop of repetition. Example: for($c=0; $c < $tam; $c++){ //concatenar sempre o valor $minhastring = $valor[$c].','; } That is, I need...
asked by 22.09.2015 / 13:43
5
answers

How to use the loop for (for) in Portugol?

I'm learning algorithm, but I was in doubt about the use of Loop para ( for ). I know it's a silly question, but unfortunately I have little access to the internet. I have the book but the doubt is that!     
asked by 01.05.2015 / 02:00