Questions tagged as 'loops'

0
answers

Associative array iteration

How can I get the data from the array with an index? Example: $colors[$color["IdColor"]] = array( 'IdColor' => $color["IdColor"], 'Color' => $color["Color"] ); I tried using two foreach but it did no...
asked by 20.12.2017 / 15:34
0
answers

error when compiling

I get an error when compiling several files, these are the errors:    93 20 [Error] request for member 'get_aceptacion' in '((nfa *) this) -> nfa :: statements_.std :: vector :: operator [] > ((( std :: vector :: size_type) i)) ', which i...
asked by 17.10.2017 / 02:33
1
answer

Error modifying an object within a cycle

As the title says, I have a problem when trying to modify an attribute of an object at the time of being traversed; what I do is create a cycle to go through a list, within this cycle I create an object which I will fill from a SQLite database,...
asked by 12.10.2017 / 03:45
1
answer

print quantity of columns of a mysql search in fpdf

I have a query of MySQL in which there may be x number of communications radios stored there, the table prints perfect if I do it without the counter, but as it is necessary to know how many radios there are according to the query, I need...
asked by 21.09.2017 / 07:08
1
answer

Duplicate files when reading text file line by line with java

My questions is Why, when reading a file .txt , do you duplicate the lines contained in my .txt? That is, if I have a String variable which I read, for example . Juan, Pedro, so-and-so. If I show on screen what is loaded in that variable...
asked by 05.09.2017 / 21:13
1
answer

java.lang.StringIndexOutOfBoundsException: String index out of range: - 1

I have the following error when wanting to read content from a .txt file and compare it with the contents of an ArrayList which I do: public void leer(ArrayList<String> arrayList) { try { // Abrimos el archivo con la...
asked by 30.08.2017 / 04:01
3
answers

python loop for a xml

I have a file where with a regular expression I get 3 data that can be repeated up to 30 times matches = tools.findall(pattern, html, re.MULTILINE) for match in matches: pattern = 'umber\":(.*?),\"g' dato1 = tools.findall(pattern, mat...
asked by 21.06.2017 / 19:43
2
answers

How to make a generic loop in JS

I have programmed in other languages but now I am using JavaScript. I have the following code: function Mix2( ValoresJ ) { var ai = ValoresJ var l00 = ai[0] var l01 = ai[1] var l02 = ai[2] var l03 = ai[3] var l04 =...
asked by 31.05.2017 / 13:32
1
answer

Javascript closure in for loop

What I want is to go through the matrix material and generate a div for each element and that in the first div put elemento1 , in the second elemento2 etc. This is what I have: var material = [{nombre: 'elemento1'},{nomb...
asked by 21.03.2017 / 14:20
0
answers

Conditions using foreach in C #

I need to do a foreach in C # , in which several conditions must be done like this: a can be of type 1 , 2 , 3 or 4 . b can be of type 1 , 2 , 3 or 4 . The set of...
asked by 10.03.2017 / 21:54