Skip to content

Instantly share code, notes, and snippets.

View d2207197's full-sized avatar
🌴
On vacation

Joseph Yen d2207197

🌴
On vacation
  • http://www.pinkoi.com/
  • Hsinchu, Taiwan
View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division
from mrjob.job import MRJob
from collections import Counter
from math import log
from nltk import word_tokenize
import re
@d2207197
d2207197 / Fun Programming HW2.markdown
Last active August 29, 2015 13:57
lambda calculus hw2

###predefines for Peter Sestoft's Lambda Calculus reducer http://www.itu.dk/~sestoft/lamreduce/lamframes.html

Nil =   (\c.\n.n);
isnil = (\l.l (\h.\t.fal) tru);
Cons =  (\h.\t.\c.\n.c h (t c n));
head = \l.l (\h.\t.h) l;
tail = \l.fst (l (\x.\p.pair
                     (snd p)
@d2207197
d2207197 / ipython_notebook_snippet.py
Last active August 29, 2015 14:02
Use full python snippet
from IPython.display import Image
from IPython.display import HTML
def website(url):
return HTML('<iframe src={} width=800 height=600></iframe>'.format(url))
def image(path):
return Image(filename=path)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def split_balls(total, splits):
print total, splits
if splits == 1:
yield (total,)
else:
for i in range(1, total):
for subs in split_balls(total -i, splits -1):
yield (i, ) + subs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@d2207197
d2207197 / bopomofo.schema.yaml
Last active August 29, 2015 14:03
squirrel 設定檔 ,改用 dvorak
# Rime schema
# encoding: utf-8
schema:
schema_id: bopomofo
name: 注音
version: "1.6"
author:
- 佛振 <chen.sst@gmail.com>
description: |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.