This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Note that this script is intended to be included at the *end* of the document, before </body> | |
| */ | |
| (function (window, document) { | |
| if ('open' in document.createElement('details')) return; | |
| // made global by myself to be reused elsewhere | |
| var addEvent = (function () { | |
| if (document.addEventListener) { | |
| return function (el, type, fn) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| from time import clock | |
| # Calculates all the primes from 0 to stop_at using a sieve on an array. | |
| def primes(stop_at): | |
| if stop_at is None: | |
| print("This algorithm doesn't support unbounded ranges") | |
| return [] | |
| if stop_at <= 2: return [] |
NewerOlder