Questions tagged as 'iterator'

9
answers

Traverse an Array and check if any element is empty

Is there a native PHP function to loop through array and check if any element of this array is empty null ? Look at the code below: if(isset($_POST['btnCriaModelo'])){ $instArray = $_POST['idInstrucao']; $orderArray = $_P...
asked by 31.01.2014 / 08:47
1
answer

What would it be Iteration?

In a question I asked, I questioned what it was and what the function of ListIterator would be, so the term iteration came up, what would it be? Link to question     
asked by 20.02.2017 / 21:55
2
answers

How to iterate over a huge amount of records with scala sorm

I want to iterate over a lot of records in a table with sorm, but I want to do it in an efficient way in terms of memory. Today I use this code: Db.query[Items].whereEqual("title", someTitle).fetch.foreach { webCount => //do so...
asked by 12.08.2014 / 17:16
2
answers

String Comparison

Problem: I have to get the object that displays the content in the English language (lang == en) But depending on the search the order of the languages comes completely different and I tried to create a loop obj.take['http://dbpedia....
asked by 01.02.2017 / 02:20
2
answers

How to iterate correctly all the records of a structure with multiple depth levels in Rust?

I would like to know how to iterate correctly in Rust all the results contained in a data structure arranged like this: struct Node { id: i64, nodes: Vec<Node> } Where records entered in this structure have several levels of d...
asked by 13.12.2017 / 06:57
1
answer

Dealing with nested objects (nesting) using an ORM

Let's assume that in a system for a bus company I have entities: Line, car and travel. Each has three classes: The entity itself, class Linha extends Model { protected $id; // outras propriedades. public function getId() {...
asked by 08.09.2016 / 05:15
2
answers

Python accumulator list

I'm developing a function that takes 3 parameters fctn (function, list, element) and you have to return a list with the intermediate states of the accumulator, as in the example below: >>> fctn(lambda acc, x: acc + x, [1, 2, 3, 4], 0)...
asked by 09.04.2017 / 17:42
1
answer

Loop problem for

I have a problem and I can not identify it in my code, I have a for 60 iterations, and it is falling on if's when I identify it (i in this case) is divisible by 5 or by 3 only in the first iteration , when i is 0. After this it passes the others...
asked by 30.06.2015 / 00:55
0
answers

Different ways to create an iterator for values

Is there any difference between creating an iterator for the values of an array using these two forms? let myIterator = arr[Symbol.iterator]() let myIterator2 = arr.values() I did some testing and at least the result looks the sa...
asked by 22.06.2018 / 20:15
2
answers

How to use an iterator twice within an understanding?

Let's say I have a list: lista = [(1,1), (1,2), (1,3), (2,6), (2,4), (3,1), (3,2)] And I want to know the maximum and minimum values of the second element, grouped by the first. That is: { 1:(1,3), 2:(4,6), 3:(1,2) } I thought about us...
asked by 19.03.2015 / 21:05