I hereby claim:
- I am blinks on github.
- I am blinks (https://keybase.io/blinks) on keybase.
- I have a public key ASAvUWquxqT-GPdAtf3e40GJRMZ1FaTZ_0s4TJlPPuz8rQo
To claim this, I am signing this object:
""" | |
Scanner: match text to generate tokens. | |
Adam Blinkinsop <blinks@acm.org> | |
First, construct a scanner with the tokens you'd like to match described as | |
keyword arguments, using Python-syntax regular expressions. | |
WARNING: Group syntax in these expressions has an undefined effect. | |
>>> simple = Scan(ID=r'\w+') | |
#!/usr/bin/env python | |
""" | |
Check that a particular email address exists. | |
Adam Blinkinsop <blinks@acm.org> | |
WARNING: | |
Checking email addresses in this way is not recommended, and will lead to | |
your site being listed in RBLs as a source of abusive traffic. Mail server | |
admins do like it when they get connections that don't result in email being | |
sent, because spammers often use this technique to verify email addresses. |
#!/usr/bin/env python | |
import logging | |
import random | |
import re | |
import sys | |
ROLL = re.compile(r'(\d*)d(\d+)') | |
def roll(dice): | |
"""Randomly generate the result of a dice roll. |
#!/usr/bin/env python3 | |
# A simple currency board tracker for For-Ex. | |
# Needs `pip3 install colorama` and normal Python3. | |
from collections import defaultdict | |
from colorama import Fore, Style | |
import os | |
currency = { | |
'GBP': Fore.RED, | |
'EUR': Fore.BLUE, |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env python | |
# A simple monte carlo simulation for a specific kind of die pool. | |
# | |
# Usage: ./pool.py --trials=1000 4d6+3d8 | |
import collections | |
import random | |
def main(args): | |
result = collections.defaultdict(lambda: 0) |
-- Master: Mastermind Solver | |
-- Adam Blinkinsop <blinks@google.com> | |
import Data.Ord | |
import Data.List | |
-- Types for pegs and codes, mainly for display. | |
data Peg = Red | Green | Blue | White | Yellow | Orange | |
deriving (Eq, Ord, Show) | |
data Code = Code [Peg] deriving Show | |
data Response = Respond (Int, Int) deriving Eq |
(ns bgm.core | |
(:use [overtone.inst sampled-piano]) | |
(:require [clojure.set] | |
[overtone.core :as overtone]) | |
(:gen-class)) | |
(def golden-ratio 1.61803398875) | |
(def golden-ratio-conjugate (/ 1.61803398875)) | |
;;; COMPOSITION |
/** | |
* MIDI Helper Methods | |
*/ | |
class MIDIConnection { | |
MidiOut mout; | |
fun void connect(int port) { | |
if (!mout.open(0)) { me.exit(); } | |
} |