Questions tagged as 'loop'

1
answer

Repetition structure

I'm studying repetition structure in Java here. And I came across the urge to do the following: public class Teste { public static void main(String[] args) throws IOException { for (int i = 1; i <= 2; i++) { for (i...
asked by 04.03.2017 / 19:22
1
answer

Check current index and next index equal to zero python

I need to walk through a list in Python, for example: l = [2313, 1221, 1333, 66, 0, 0, 0, 0] I would like if the current and next element in the list are equal to zero     replaces the current element and the next element by 1. Or if the...
asked by 19.06.2016 / 02:16
1
answer

Looping jquery setInterval

I'm making a slider, and I need it to start again when I see the images, but I can not. Could someone help? JS $(function(){ // Buttons Hover Effect buttonsHover(); function buttonsHover(){ var buttons = $...
asked by 24.11.2015 / 23:41
1
answer

Share and tanned facebook count in the wordpress loop

Next I'm trying to put just one share count I've had on Facebook in the loop of my theme. For this I found the following function and tried to modify it for my need. Follow the function: function ia_fb_count($url_post) { //Get the transie...
asked by 09.03.2015 / 14:46
1
answer

How to make a recursive sum in a JSON object in Angular 6?

Using Angular 6, how could you fill in the total field that represents the total number of direct and indirect bosses of each employee? I have the following data: const employees = [ { id: 1, firstName: 'a',...
asked by 07.06.2018 / 20:23
2
answers

Use a variable as the name of a file in C

I'm using the system("pathping xxx.xxx.xxx > c:\i.txt") function to leave the program running pathping tests and saving the result to a file to analyze later. Basically I wanted to play this function inside an infinite loop...
asked by 08.12.2016 / 18:57
2
answers

problems increasing decimal within loop for

var iniciaEm = 0; var terminaEm = 20; var variacao = 0.1; var s = ""; var str = ""; for(var i =iniciaEm; i<=terminaEm; i=i+variacao){ str += i; s += "<option value=\""+i+"%\">"+i+"%</option>"; } $("#teste").append(s); /...
asked by 10.05.2016 / 17:01
2
answers

Looping on an array to always choose the next value

I have an array of users and I need to loop between them. It will work like this, every time someone makes a request on the page, I need the next user to be saved in the database of the one that was previously chosen. This is my array, which...
asked by 11.03.2014 / 22:52
2
answers

Make line break after semicolon;

I have a text file (word) composed of four pages with several e-mail addresses separated from each other by semicolons. It's like this:    [email protected]; [email protected]; [email protected];     [email protected]; example5@email....
asked by 13.07.2015 / 17:53
2
answers

Repeat loop logic with for [duplicate]

Consider the JavaScript code below. var r = [2, 5, 6, 18, 20, 10, 23, 12, 19, 10]; var s = [1, 5, 7, 13, 18, 21, 10, 25, 32, 17, 3]; var x = [0]; var i; for (i = 0; i <= 9; i++) { x[i] = r[i]; } for (i = 0; i <= 10; i+...
asked by 19.04.2018 / 23:58