Top "Generator" questions

A generator is a generalisation of a subroutine, primarily used to simplify the writing of iterators.

Should I include a <meta generator> tag?

Suppose I have some sort of proprietary web framework. Should I include a <meta generator="My framework"> tag …

html generator meta-tags
Is there a generator version of `string.split()` in Python?

string.split() returns a list instance. Is there a version that returns a generator instead? Are there any reasons against …

python string generator
Java Generator for Poisson and Uniform Distributions?

From what I understand, the standard generator is for the Normal Distribution. I have to generate random numbers according to …

java distribution generator random poisson
How to yield results from a nested generator function?

I have a function which yields results as it downloads them. For the purposes of this question, lets say I …

python function nested generator yield
How to implement an efficient infinite generator of prime numbers in Python?

This is not a homework, I am just curious. INFINITE is the key word here. I wish to use it …

python generator primes
forEach using generators in Node.js

I'm using Koa.js framework and Mongoose.js module. Normally to get a result from MongoDB I code like this: …

node.js foreach mongoose generator koa
How can I traverse a file system with a generator?

I'm trying to create a utility class for traversing all the files in a directory, including those within subdirectories and …

python recursion iterator generator yield
How to clone a Python generator object?

Consider this scenario: #!/usr/bin/env python # -*- coding: utf-8 -*- import os walk = os.walk('/home') …

python object clone generator
How does this lambda/yield/generator comprehension work?

I was looking through my codebase today and found this: def optionsToArgs(options, separator='='): kvs = [ ( "%(option)s%(separator)…

python ssh lambda functional-programming generator
Backend administration in Ruby on Rails

I'd like to build a real quick and dirty administrative backend for a Ruby on Rails application I have been …

ruby-on-rails admin generator scaffolding backend