Questions tagged as 'ciclos'

5
answers

Execute $ .ajax within a cycle

I have a problem with the following code, I want to execute within a cycle for a call $.ajax until the exit condition of the cycle is fulfilled, however the cycle does all its iterations and in the final iteration run the ajax...
asked by 05.01.2017 / 21:33
2
answers

Help with Python cycle

Someone could explain to me the process that carries out the following line of code (see the image for more details). Specifically, this one: langs = [language for language in languages if language['name'] == name] I have already tried t...
asked by 29.07.2017 / 11:40
2
answers

closure inside a loop

I have the following code, I do not understand the result var funcs = []; for (var i = 0; i < 3; i++) { funcs[i] = function() { console.log("el valor: " + i); }; } for (var j = 0; j < 3; j++) { fun...
asked by 30.12.2016 / 06:19
2
answers

Browse an Array Saved a Query in PHP

Greetings to all, my subject is the following, I have saved a query $datosMotivos= array(); while($row = mysqli_fetch_array($result)) { $cod=$row['cod']; $descripcion=$row['descripcion']; $motivo=$row['motivo']; $lugar=$row['lugar']; $dato...
asked by 21.11.2016 / 05:37
3
answers

Add a for cycle within an echo with php

Greetings, I'm doing a for loop in an echo and it gives me a syntax error. This is the code <?php $resultado = '<html><h2>Productos:</h2><p>'.for ($i=0; $i<count($_POST["productos"]); $i++){ echo '<b>'.$...
asked by 24.11.2017 / 00:09
1
answer

String stored inside an array becomes undefined in JavaScript

I have some text strings stored in an array and I want to use them to add a CSS property to a series of images. var img = document.getElementsByClassName("post-image"); var link, w, h; var margenes = []; for (var i = 0; i < img.length; i...
asked by 18.05.2017 / 04:05
1
answer

The for cycle in javascript, can you alter variables?

I have a question, I found the following code to calculate the factorial number of a whole number, but I am doing my desktop run and I can not understand the code because it is assumed that in the process of the factorial it multiplies by all th...
asked by 06.04.2017 / 21:36
3
answers

How to use for cycle in bash script?

I have a little bash script that does not work the way I want to Here is the code #! /bin/bash echo "Escriba la cantidad de letras" read x for i in $x;do echo "Letra $i" read y echo $y done #export Mensaje #./recibir.sh Image of the log...
asked by 10.11.2016 / 21:45
1
answer

List the number of records in Java

How can I list the number of records that appear in a program? It is assumed that the user enters the number of records you want, once this is done, the data is output but they need to be listed. import java.util.*; public class practica1Labor...
asked by 13.01.2017 / 07:44
1
answer

Error with the format of a foreach cycle, web service

I am creating a client in php, which consumes a web service in php, when trying to execute the client in the browser a message appears, Warning: Invalid argument supplied for foreach () in C: \ xampp \ htdocs \ 04_soap_mysql \ index.php on li...
asked by 05.06.2017 / 03:09