This file contains hidden or 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 collections | |
import importlib | |
import inspect | |
import sys | |
MODULES = """\ | |
string | |
re | |
difflib | |
textwrap |
This file contains hidden or 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 struct | |
import bitstream | |
import dotdict | |
import numpy as np | |
import pytun | |
def read_uint(stream, n=None): | |
integer = 0 | |
for _ in range(n): |
This file contains hidden or 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 struct | |
import bitstream | |
import dotdict | |
import numpy as np | |
import pytun | |
def read_uint(stream, n=None): | |
integer = 0 | |
for _ in range(n): |
This file contains hidden or 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 collections | |
import itertools as it | |
import subprocess | |
import sys | |
class Sudoku: | |
def __init__(self, size): | |
self.width = size*size | |
self.height = size*size | |
self._opts = size*size |
This file contains hidden or 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 as ft | |
import itertools as it | |
import operator as op | |
def generate_factors(b, n, smallest_number=1): | |
if n == 1: | |
yield [b] | |
else: | |
for i in range(smallest_number, b // 2 + 1): | |
for s in generate_factors(b-i, n-1, i): |
This file contains hidden or 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
class Piped: | |
def __init__(self, fn, terminal=False): | |
self.fn = fn | |
self.terminal = terminal | |
self.args = [] | |
self.gotval = False | |
self.val = None | |
def __call__(self, *args): | |
self.args = list(args) |
This file contains hidden or 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
#!/bin/bash | |
update_gist() { | |
GITHUB_USERNAME=aib | |
GIST_ID=1881c25137724b47f916aec3e87028de | |
python -c "import json, sys; json.dump({ \"files\": { sys.argv[1]: { \"content\": sys.stdin.read() } } }, sys.stdout)" $(basename "$0") <"$0" | curl -f -s -H "Accept: application/vnd.github.v3+json" -H "Content-Type: application/json" -u "$GITHUB_USERNAME" -X PATCH "https://api.github.com/gists/$GIST_ID" -d@- >/dev/null | |
} | |
if [ -z "$1" ]; then | |
printf "Usage:\n" >&2 |
This file contains hidden or 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/env python | |
import math | |
import pygame | |
import random | |
import rtmidi | |
from rtmidi.midiconstants import * | |
import time | |
TAU = 2 * math.pi |
This file contains hidden or 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
/* | |
* A static class with misc. utilities | |
* | |
* aib, 20071120 | |
*/ | |
package | |
{ | |
import flash.display.DisplayObject; | |
import flash.display.Graphics; |
This file contains hidden or 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
#include <stdlib.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <time.h> | |
#define PROCS 10 | |
int child(int n) | |
{ | |
while (1) { |