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 functools | |
import inspect | |
def implicit_cast(f): | |
sig = inspect.signature(f) | |
def cast(param, arg): | |
typ = sig.parameters[param].annotation | |
if typ is sig.empty: | |
return arg | |
if isinstance(typ, str): |
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
The problem is underspecified. | |
## Actual contiguus US states | |
All 48. There's only a handful of constraints (like ME has to be at the start or the end), and you can easily tell by inspection that they aren't going to conflict. | |
Or, just draw a route by hand, and you'll probably be able to hit 48 on the first try as long as you keep the constraints in mind. Here's my first attempt, from CA to ME mostly going up and back down a column at a time: | |
CA OR WA | |
ID UT NV AZ |
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
// Compile with clang++ or g++ with -std=c++11 | |
// (Doesn't actually need any C++11 features, just a bit more readable | |
// with auto, etc.) | |
#include <iostream> | |
struct pstatus; | |
struct status { | |
int eggs, spam; |
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 tkinter as tk | |
from time import * | |
from random import randint, choice | |
myInterface = tk.Tk() | |
s = tk.Canvas(myInterface, width=800, height=800, background="black") | |
s.pack() | |
xblock1 = 0 | |
yblock1 = 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
import os | |
import sys | |
import time | |
print('Hi!') | |
time.sleep(1) | |
os.execl(sys.executable, sys.executable, *sys.argv) |
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
diff -r 18802076b52c Lib/random.py | |
--- a/Lib/random.py Wed Sep 09 22:46:51 2015 -0400 | |
+++ b/Lib/random.py Thu Sep 10 00:58:04 2015 -0700 | |
@@ -49,7 +49,7 @@ | |
"expovariate","vonmisesvariate","gammavariate","triangular", | |
"gauss","betavariate","paretovariate","weibullvariate", | |
"getstate","setstate", "getrandbits", | |
- "SystemRandom"] | |
+ "SystemRandom","DeterministicRandom"] | |