Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python2
# Adam Gashlin
# compute number of possible canonical Huffman trees
from math import log, pow, factorial, ceil
from sys import argv
def f(n):
return sum(map(lambda i: g(n, i), range(2,n+1)))
@hcs64
hcs64 / PKGBUILD
Last active August 29, 2015 14:04
Spell checking fix for pygtkspellcheck as embedded in CherryTree 0.33.4
# $Id$
# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Bartłomiej Piotrowski
# Contributor: Brad Fanella <[email protected]>
# Contributor: Allan McRae <[email protected]>
# Contributor: Tomas A. Schertel <[email protected]>
# Contributor: Adam Gashlin <[email protected]>
pkgname=cherrytree
pkgver=0.33.4
@hcs64
hcs64 / gs_arduino_direct.ino
Created July 10, 2014 06:28
gsuploader via arduino
#include <string.h>
#define DIRECT 1
#define VERIFY 0
const int out_pins[5] = {3,2,0,1,4};
const int in_pins[5] = {22,21,20,19,18};
void setup_pins() {
for (int i = 0; i < 5; i++) {
// first byte
if (_mod_packets)
{
// need to rebuild packet type and window info
if (!mode_blockflag)
{
throw Parse_error_str("didn't load mode_blockflag");
}