Questions tagged as 'loop'

1
answer

___ ___ Do erkimt the cumulative value in the loop ______ qstntxt ___
%pre%

I need to get the next value adding the former to have a build-up.

    
______ ___ azszpr325514
%pre%

To add integers use the parseInt function. Full Example:

%pre%     
___

var previsto = []; for(var i = 0; i < $(".previsto").length ; i++) { previsto[i] = $(".previsto").eq(i).text(); } I need to get the next value adding the former to have a build-up.     
asked by 28.08.2018 / 16:02
1
answer

jquery how to receive data line by line in a loop

In the test.php file I have: <?php echo "<input type='button' value='Envia' class='btenvia'/><br><br>"; echo "<div id='mostradados'></div>"; ?> <script src="jquery.min.js"></script> <sc...
asked by 17.04.2018 / 15:11
1
answer

Undefined method '+' for nil: NilClass - Ruby error

I have the following Ruby codes in three different files. Follow them: programa.rb require_relative "product" require_relative "store" cd = Product.new("CD",20.5) pinico = Product.new("Pinico",30.6) store = [cd,pinico] test = Store.new(...
asked by 03.04.2018 / 14:15
2
answers

Group of images in gird of the bootstrap getting out of the loop

I have a list of images where I'm using grid to organize them, getting the exact amount I need for lines. With this I looped to control the grids and I also have the loop of the images. Question: What could you do to fix why grids and images a...
asked by 22.11.2017 / 09:45
2
answers

How can I create sequence and math functions in python?

How can I make the interpreter understand what the previous value of a mathematical function is, for example: "Xn = 3.7 (xn-1)" where "n-1" means the result of the previous operation of the loop. Hard to understand but this is nothing less than...
asked by 23.12.2017 / 23:58
2
answers

Tie "for" inside another "for" (nested repetition)

I would like to save these 9 lines repeated in my code: for (int n1 = 1, n2 = 1; n2 < 11;){ Console.Write(n1 + "x" + n2 + "=" + (n1 * n2) + "\t"); n1++;//1 Console.Write(n1 + "x" + n2 + "=" + (n1 * n2) + "\t"); n1++;//2 Console....
asked by 27.09.2017 / 03:39
1
answer

Why does this loop with goroutines only repeat the last value?

This loop is always repeating the last value, consider the following: type unique struct { id, nonce uint64 } func (unique *unique) print() { fmt.Println(unique.id) } func main() { teste := []unique{unique{1, 2}, unique{3, 4...
asked by 24.06.2017 / 11:19
1
answer

Can anyone explain to me what is a generic loop in Lua?

I already know the while , repeat and for ties, but when I was looking at the types of loops, in the section I found the "Loop for generic" section. The text was in English.     
asked by 19.04.2017 / 18:57
1
answer

why does the loop while True access the if and the else in sequence to each complete loop in that code?

#! /usr/bin/python3 valor = int(input("Digite o valor a pagar: ")) cedulas = 0 atual = 50 apagar = valor while True: if atual <= apagar: apagar = apagar - atual cedulas += 1 else: print("%d cedula(s) de R$%d"...
asked by 28.03.2017 / 17:35
2
answers

How do I prevent my site from crashing when running a "heavy" script?

I have a script that traverses a directory looking for video files in it and then I use shell_exec with ffmpeg to convert it, the problem is that my site is falling during script execution, after starting even on the server, the si...
asked by 08.04.2017 / 01:38