Skip to content

Instantly share code, notes, and snippets.

View fingertree_simple.erl
%%% @author Alex S
%%% @copyright (C) 2016, Alex S
%%% @doc
%%% Homegrown Hinze/Paterson FingerTree implementation optimized for speed and
%%% occasionally size.
%%% Note that despite Erlang being an eager language, we do not use
%%% Kaplan-Tarjan implementation because I didn't want to descend into
%%% madness of stacks of stacks upon stacks; thus, this implementation
%%% gives no real-time guarantees but good amortized guarantees.
ElectronicRU /
Last active Sep 30, 2015
A simple snake game
# snake
from collections import deque
import functools
import operator
import time
import tkinter
from tkinter.constants import *
import random
class point(tuple):
ElectronicRU /
Last active Dec 14, 2015
dmenu script for providing unlimited history sorted by number of uses/most recent use.
if [ $# -lt 1 ] ; then
echo 1>&2 "usage: dmenu_history hist_file dmenu_opts..."
exit 1
if ! [ -e "$f" ]; then touch "$f"; fi
( sort -r -k 1,1 -n -s "$f" | cut -d' ' -f2- ; cat - ) | dmenu "$@" |
import random
def recase(w):
return ''.join(x.upper() if random.randint(0, 1) else x.lower() for x in w)
import sys
n = int(sys.argv[2])
for i in range(n):
print(recase(sys.argv[1]), end=' ')