I hereby claim:
- I am eihli on github.
- I am eihli (https://keybase.io/eihli) on keybase.
- I have a public key whose fingerprint is ED9F 8D1F A0DD 191A 9844 F72F A2FF 66D6 1D56 E0B5
To claim this, I am signing this object:
| #include <stdio.h> | |
| #include <stdint.h> | |
| int main() { | |
| // Mimic reading that TCP header file 1 byte at a time into a buffer. | |
| // The first 2 bytes are the source port. | |
| // In this case, port 257. | |
| unsigned char buffer[2] = { 0x01, 0x01 }; // 0000001 00000001 = 257 | |
| // Now convert those two bytes into a single int, since ports are 16 bits. |
| (ns weighted-rand | |
| (:import clojure.lang.PersistentQueue)) | |
| (defprotocol Rand | |
| (nextr [_ rng])) | |
| ;; Vose's alias method | |
| ;; http://www.keithschwarz.com/darts-dice-coins/ | |
| (deftype Vose [n ^ints alias ^doubles prob] |
I hereby claim:
To claim this, I am signing this object:
| def attempt_to_deliver | |
| rand(10) > 8 | |
| end | |
| class Deliverable | |
| def deliver | |
| if attempt_to_deliver | |
| puts "Delivered" | |
| true | |
| else |
| import os | |
| from circus.plugins import CircusPlugin | |
| from circus import logger | |
| from zmq.eventloop import ioloop | |
| import time | |
| import pdb | |
| class CircusWatcher(CircusPlugin): |
| #!/bin/bash | |
| # | |
| # Watch current directory (recursively) for file changes, and execute | |
| # a command when a file or directory is created, modified or deleted. | |
| # | |
| # Written by: Senko Rasic <senko.rasic@dobarkod.hr> | |
| # | |
| # Requires Linux, bash and inotifywait (from inotify-tools package). | |
| # | |
| # To avoid executing the command multiple times when a sequence of |
| class Game (object): | |
| """ | |
| Game represents a single pre- or regular-season game. It provides a window | |
| into the statistics of every player that played into the game, along with | |
| the winner of the game, the score and a list of all the scoring plays. | |
| """ | |
| def __new__(cls, eid=None, fpath=None): | |
| # If we can't get a valid JSON data, exit out and return None. | |
| try: |