This file contains 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
from scipy.misc import imread | |
import numpy as np | |
# These are flower images from the PROJCAM garden bundle. | |
path = "C:\Users\Mark\Documents\ProcJam\PROCJAM2016-Tess2D\PROCJAM2016-Tess2D\Garden\\" | |
names = [ "flower{:02d}.png".format( i ) for i in xrange( 0, 22 ) ] | |
original = [ imread( path + name ) for name in names ] | |
def flatten( image ): |
This file contains 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
from scipy.misc import imread | |
import numpy as np | |
# These are flower images from the PROJCAM garden bundle. | |
path = "C:\Users\Mark\Documents\ProcJam\PROCJAM2016-Tess2D\PROCJAM2016-Tess2D\Garden\\" | |
names = [ "flower{:02d}.png".format( i ) for i in xrange( 0, 22 ) ] | |
original = [ imread( path + name ) for name in names ] | |
def flatten( image ): |
This file contains 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
0x0748bd33b4f11064f70cb9e2d56534cdb7dfa40c |
This file contains 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 heapq | |
import math | |
from fractions import gcd | |
D = 33 | |
n = 10000 | |
mx = int( math.sqrt( n ) ) | |
my = int( math.sqrt( n / D ) ) |
This file contains 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
const INPUT : &str = "R4, R4, L1, R3, L5, R2, R5, R1, L4, R3, L5, R2, L3, L4, L3, R1, R5, R1, L3, L1, R3, L1, R2, R2, L2, R5, L3, L4, R4, R4, R2, L4, L1, R5, L1, L4, R4, L1, R1, L2, R5, L2, L3, R2, R1, L194, R2, L4, R49, R1, R3, L5, L4, L1, R4, R2, R1, L5, R3, L5, L4, R4, R4, L2, L3, R78, L5, R4, R191, R4, R3, R1, L2, R1, R3, L1, R3, R4, R2, L2, R1, R4, L5, R2, L2, L4, L2, R1, R2, L3, R5, R2, L3, L3, R3, L1, L1, R5, L4, L4, L2, R5, R1, R4, L3, L5, L4, R5, L4, R5, R4, L3, L2, L5, R4, R3, L3, R1, L5, R5, R1, L3, R2, L5, R5, L3, R1, R4, L5, R4, R2, R3, L4, L5, R3, R4, L5, L5, R4, L4, L4, R1, R5, R3, L1, L4, L3, L4, R1, L5, L1, R2, R2, R4, R4, L5, R4, R1, L1, L1, L3, L5, L2, R4, L3, L5, L4, L1, R3"; | |
#[derive(Debug)] | |
enum Heading { | |
North, | |
South, | |
East, | |
West | |
} |
This file contains 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
# Problem: | |
# How many possible mazes are there on an NxN grid? Where a maze is a | |
# collection of links between grid nodes such that each node has 1-4 links | |
# and has a path to every other node. | |
# -- @relsqui, https://twitter.com/relsqui/status/970555868390465536 | |
# | |
# This counting approach implements a method similar to that described in | |
# "Spanning Trees in Grid Graphs", Paul Raff, https://arxiv.org/pdf/0809.2551.pdf | |
# | |
# The key idea is to create a transition matrix counting the number of |
This file contains 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
words = set() | |
with open( "sowpods.txt", "r" ) as wordFile: | |
for x in wordFile: | |
words.add( x.rstrip() ) | |
maxLen = max( len(x) for x in words ) | |
alphabet = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', | |
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', |
This file contains 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
var shuffleGrammar = { | |
"origin": "#buildstack##element##element##element##element##element##element##element##element##element#", | |
"element" : "#stack#[stack:POP]", | |
"e1" : "[stack:1][e1:]", | |
"e2" : "[stack:2][e2:]", | |
"e3" : "[stack:3][e3:]", | |
"e4" : "[stack:4][e4:]", | |
"e5" : "[stack:5][e5:]", | |
"e6" : "[stack:6][e6:]", | |
"e7" : "[stack:7][e7:]", |
This file contains 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 heapq | |
from fractions import gcd | |
import math | |
import sys | |
import time | |
def initialValue( maxA, b, power ): | |
y = b ** power | |
# Better too low than too high and miss one | |
a = min( int( math.ceil( math.pow( y, 1.0 / 3.0 ) ) ), |
This file contains 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
#!/usr/bin/python3 | |
from steem import Steem | |
from pprint import pprint | |
import sys | |
startTime = "2018-05-01T00:00:00" | |
endTime = "2018-05-31T23:59:59" | |
if len( sys.argv ) > 1: |
OlderNewer