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 collections | |
| import math | |
| import os | |
| import cv2 | |
| import numpy as np | |
| import time | |
| MAX_LINES = 4000 | |
| N_PINS = 36*8 | |
| MIN_LOOP = 20 # To avoid getting stuck in a loop |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>p5js fullscreen template</title> | |
| </head> | |
| <style type="text/css"> | |
| canvas { | |
| position: fixed; | |
| top: 0; left: 0; | |
| z-index: 1; |
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
| // set it up | |
| firebase.storage().ref().constructor.prototype.putFiles = function(files) { | |
| var ref = this; | |
| return Promise.all(files.map(function(file) { | |
| return ref.child(file.name).put(file); | |
| })); | |
| } | |
| // use it! | |
| firebase.storage().ref().putFiles(files).then(function(metadatas) { |
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 | |
| def atkin(nmax): | |
| """ | |
| Returns a list of prime numbers below the number "nmax" | |
| """ | |
| is_prime = dict([(i, False) for i in range(5, nmax+1)]) | |
| for x in range(1, int(math.sqrt(nmax))+1): | |
| for y in range(1, int(math.sqrt(nmax))+1): | |
| n = 4*x**2 + y**2 | |
| if (n <= nmax) and ((n % 12 == 1) or (n % 12 == 5)): |