Popular recipes tagged "of"http://code.activestate.com/recipes/tags/of/2013-06-13T15:33:41-07:00ActiveState Code RecipesConway's Game of Life In Python (Python)
2013-06-13T15:33:41-07:00alexander bakerhttp://code.activestate.com/recipes/users/4166679/http://code.activestate.com/recipes/578559-conways-game-of-life-in-python/
<p style="color: grey">
Python
recipe 578559
by <a href="/recipes/users/4166679/">alexander baker</a>
(<a href="/recipes/tags/game/">game</a>, <a href="/recipes/tags/life/">life</a>, <a href="/recipes/tags/numpy/">numpy</a>, <a href="/recipes/tags/of/">of</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/windows/">windows</a>).
</p>
<p>Conway's Game of Life In Python</p>
Evolutionary Algorithm (Generation of Prime Numbers) (Python)
2011-11-27T06:45:00-08:00Alexander James Wallarhttp://code.activestate.com/recipes/users/4179768/http://code.activestate.com/recipes/577964-evolutionary-algorithm-generation-of-prime-numbers/
<p style="color: grey">
Python
recipe 577964
by <a href="/recipes/users/4179768/">Alexander James Wallar</a>
(<a href="/recipes/tags/algorithm/">algorithm</a>, <a href="/recipes/tags/example/">example</a>, <a href="/recipes/tags/genetic/">genetic</a>, <a href="/recipes/tags/genetic_algorithm/">genetic_algorithm</a>, <a href="/recipes/tags/genetic_algorithms/">genetic_algorithms</a>, <a href="/recipes/tags/list/">list</a>, <a href="/recipes/tags/number/">number</a>, <a href="/recipes/tags/of/">of</a>, <a href="/recipes/tags/prime/">prime</a>, <a href="/recipes/tags/primelist/">primelist</a>, <a href="/recipes/tags/primes/">primes</a>, <a href="/recipes/tags/theory/">theory</a>).
</p>
<p>This is an evolutionary algorithm that returns a random list of prime numbers. This code is highly inefficient for a reason. This algorithm is more of a proof of concept that if a prime was a heritable trait, it would not be a desired one. </p>
<p>Parameters:</p>
<p>isPrime --> n: number to check if it is prime
allPrimes --> n: size of list of random primes, m: the primes in the list will be between 0 and m</p>
Prime Number Generator (Python)
2009-02-03T15:47:06-08:00dthhttp://code.activestate.com/recipes/users/4169078/http://code.activestate.com/recipes/576640-prime-number-generator/
<p style="color: grey">
Python
recipe 576640
by <a href="/recipes/users/4169078/">dth</a>
(<a href="/recipes/tags/eratosthene/">eratosthene</a>, <a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/number/">number</a>, <a href="/recipes/tags/of/">of</a>, <a href="/recipes/tags/prime/">prime</a>, <a href="/recipes/tags/sieve/">sieve</a>).
Revision 7.
</p>
<p>Generate all prime numbers up to n.</p>
Pad images to power-of-two dimensions. (Python)
2008-08-12T18:46:40-07:00Martin Wilsonhttp://code.activestate.com/recipes/users/4166376/http://code.activestate.com/recipes/576416-pad-images-to-power-of-two-dimensions/
<p style="color: grey">
Python
recipe 576416
by <a href="/recipes/users/4166376/">Martin Wilson</a>
(<a href="/recipes/tags/graphics/">graphics</a>, <a href="/recipes/tags/imaging/">imaging</a>, <a href="/recipes/tags/library/">library</a>, <a href="/recipes/tags/of/">of</a>, <a href="/recipes/tags/opengl/">opengl</a>, <a href="/recipes/tags/pil/">pil</a>, <a href="/recipes/tags/power/">power</a>, <a href="/recipes/tags/power_of_two/">power_of_two</a>, <a href="/recipes/tags/python_imaging_library/">python_imaging_library</a>, <a href="/recipes/tags/two/">two</a>).
Revision 4.
</p>
<p>Pads any amount of images each to power-of-two dimensions, useful for OpenGL programming.</p>