Questions tagged as 'bucles'

1
answer

Simplify / Optimize FOR

How can I simplify the second for , that is, I would like to improve it / optimize it, I see it as repetitive but I do not understand how to improve it: var book =[ { title: "The Giver", stars: 4, author: "Manuel G. H.", color...
asked by 09.04.2017 / 15:41
1
answer

How to do a little Christmas in PHP?

I have this code that this pine generates me But I want it to come out like this: <html> <body> <h2>Pinos Examen</h2> <form action="examenpinos.php" method="post"> Cantidad de nivel:<br>...
asked by 18.12.2018 / 22:37
1
answer

ConcurrentModificationException when iterating over a list

I skipped a ConcurrentModificationException when iterating over a list: List<Attribute> attributes This list contains objects of type Attribute , which will be used to create views AttributeView : The method I use to create t...
asked by 01.12.2018 / 22:32
0
answers

Delete all items from a list and add them to another list

I have a method that removes nodes from a list until it is empty. What I need is that after I empty it, I add the elements that I removed to a new list. Here is the method: public void vaciarD(){ while(!estaVacia()){ //mientras que la list...
asked by 12.11.2018 / 06:11
0
answers

is it possible to use a loop with this line of code that uses index?

This is the line that I do not know if it can be put in a loop: segunda_m = segunda_m[-1] + segunda_m[-2] + segunda_m[-3] + segunda_m[-4] #abajo esta todo el codigo completo. es simplemente sumar index. #El primero es -1 el segundo es -2 y asi...
asked by 03.11.2018 / 22:19
0
answers

How can I repeat a Java Swing function?

Good I want to repeat my function that generates a random position in the frame and moves me a place label. But I execute function 1 only once. Does anyone have a solution? I leave the code, my idea is that when you press a -button, the function...
asked by 28.10.2018 / 22:34
0
answers

how to assign data from a matrix to several objects in python

Good day to all I am programmed a movement in Vpython for which I used a "for" loop that allowed me to create a number of 20 spheres in random positions stored in matrices, after that use a second "for" that It allowed me to create the new posit...
asked by 18.07.2018 / 21:16
1
answer

How to execute js file to iterate a mongo collection

I know it's a very generic question but this is a concept, I'm not sure since I've run everything, I've created a mongo collection with mongoImport and there I can find and find everything from the mongo shell, making node file.js runs line by l...
asked by 19.06.2018 / 09:41
1
answer

JS Pass a trigger to the value of a variable at the instant it is created

For example: var items = jq(".li"); for(var i=0; i<items.length; i++){ var item = jq(items[i]); item.click(function(i){ console.log("i: ", i); }); } The problem with this code is that when the click event is triggered...
asked by 23.05.2018 / 14:43
0
answers

ASSEMBLED CYCLE IN ASSEMBLY

You will see I am doing an assembler drawing and I am already coloring it but I have to be drawing line by line the lines I draw with this code: MOV CX,20 ;CORD X MOV DX,21 ;CORD Y CG6:       MOV AH, 0Ch; DRAW PIXEL       MOV AL,...
asked by 20.05.2018 / 05:43