When a space is moved, or added to, or another space is drawn next to it (causing edges to split), the edge_ids will change. Since windows are associated by reference to an edge, we need some way to carry them along.
Click to add new points. Hit the DELETE key to remove the selected point. Based on mbostock's spline editor: https://bl.ocks.org/mbostock/4342190
from collections import namedtuple, Counter | |
import heapq | |
from pprint import pprint | |
from operator import attrgetter | |
import struct | |
Tree = namedtuple('Tree', 'weight left right') | |
Letter = namedtuple('Letter', 'weight char') | |
get_weight = attrgetter('weight') # same as def get_weight(o): return o.weight |
(The best SQL database)
Best bet is to use http://postgresapp.com/ .
Make sure to set up your path once it's installed:
- Run
atom ~/.bash_profile
.
Create a program that will play the “cows and bulls” game with the user. The game works like this:
Randomly generate a 4-digit number. Ask the user to guess a 4-digit number. For every digit that the user guessed correctly in the correct place, they have a “cow”. For every digit the user guessed correctly in the wrong place is a “bull.” Every time the user makes a guess, tell them how many “cows” and “bulls” they have. Once the user guesses the correct number, the game is over. Keep track of the number of guesses the user makes throughout the game and tell the user at the end.
Say the number generated by the computer is 1038. An example interaction could look like this:
Welcome to the Cows and Bulls Game!
Enter a number:
<head> | |
<link rel="stylesheet" href="https://rawgit.com/novus/nvd3/05cfaafa872ec8f941f7349bcf83fc7d344db857/build/nv.d3.min.css"> | |
</head> | |
<body> | |
<svg class="chart-target"></svg> | |
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.16/d3.min.js"></script> | |
<script type="text/javascript" src="https://rawgit.com/novus/nvd3/05cfaafa872ec8f941f7349bcf83fc7d344db857/build/nv.d3.min.js"></script> | |
<script type="text/javascript"> | |
var data = [ | |
{"data_key":"historical_entered_pipe","historical":true,"key":"Historical Entered Pipe","color":"#ff0000","values":[{"y":356447,"x":90},{"y":318113,"x":89},{"y":318113,"x":88},{"y":318113,"x":87},{"y":318113,"x":86},{"y":318113,"x":85},{"y":318113,"x":84},{"y":289780,"x":83},{"y":289580,"x":82},{"y":288347,"x":81},{"y":288347,"x":80},{"y":288347,"x":79},{"y":288347,"x":78},{"y":288347,"x":77},{"y":288347,"x":76},{"y":238347,"x":75},{"y":238347,"x":74},{"y":238347,"x":73},{"y":230013,"x":72},{"y":230013,"x":71},{"y":230013,"x":70},{"y":2300 |
I hereby claim:
- I am bgschiller on github.
- I am bgschiller (https://keybase.io/bgschiller) on keybase.
- I have a public key ASAX_KmZ-zLBMZUuVoVkT19ronpk7I-jxQ6_fbjQNO9NYwo
To claim this, I am signing this object:
<head> | |
<style> | |
body { | |
background-color: #DFDECC; | |
} | |
svg path.walk { | |
fill: none; | |
stroke: #4b4b4b; | |
stroke-width:1.3; | |
} |
There is a club called Undecidable, but they don't let in just any old question. In order to be admitted to the Undecidable Club, a question has to prove that she's seriously hard. How hard? Well, let's talk about the membership process.
First, the applicant needs a sponsor (Let's call the sponsor S
). Your sponsor is some question who's already in the club (so you know they're hard). In order to get into the club, an applicant has to show she's just as hard as her sponsor (Let's call the applicant A
). How does A
prove her difficulty? She has to show that if some Turing Machine could solve A
's problem, it could solve S
's problem as well. Since we know S
is hard (he's in the club already!), A
's problem must be just as hard.
These problems are all known to be hard. You can choose whichever you like to be your sponsor.
function AcceptsOwnEncoding(T)
function AcceptsSomething(T)
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
body { | |
font: 10px sans-serif; | |
} | |
.axis path, | |
.axis line { |