Top "Iteration" questions

Iterations are the successive repetitions in loops such as for, foreach or while.

Ruby array each_slice_with_index?

If I have arr = [1, 2, 3, 4] I know I can do the following... > arr.each_slice(2) { |a, b| puts "#{a}, #{b}" } 1, 2 3, 4 ...…

ruby iteration built-in
Numpy Root-Mean-Squared (RMS) smoothing of a signal

I have a signal of electromyographical data that I am supposed (scientific papers' explicit recommendation) to smooth using RMS. I …

numpy iteration scipy smoothing moving-average
How do I group items in an array by date?

Given the following array of objects: [ { "notes": "Game was played", "time": "2017-10-04T20:24:30+00:00", "sport": "hockey", "owner": "steve", "players": "10", "game_…

javascript arrays for-loop iteration grouping
jq - How to iterate through keys of different names

I've got JSON that looks like this { "keyword1": { "identifier1": 16 }, "keyword2": { "identifier2": 16 } } and I need to loop through the keywords to …

json key iteration jq
How to use SCAN commands in Jedis

I was using redis and jedis for quite some time and never needed the SCAN commands so far. Now however …

redis iteration jedis
How to do in-order traversal of a BST without recursion or stack but using parent pointers?

Is it possible to do an iterative in-order-traversal on a BST whose node has a parent pointer (the parent of …

algorithm binary-search-tree tree-traversal iteration inorder
Generic iterator

I am trying to find a generic way of accessing a set of containers. I have a standard vector and …

c++ generics iteration containers
velocity: do something except in last loop iteration

In velocity, I want to do something different in the last loop. What is the correct idiom? RELATED: Last iteration …

java loops iteration velocity
Are for-loops in pandas really bad? When should I care?

Are for loops really "bad"? If not, in what situation(s) would they be better than using a more conventional "…

python pandas iteration vectorization list-comprehension
How do you estimate an agile project up front?

When working on fixed price software development projects, I frequently find myself having to estimate the total number of hours …

agile schedule iteration