View Makefile
SHELL = /bin/bash
images:
python expansion.py
gifs:
for fn in *png; do convert "$$fn" "$${fn%.png}.gif"; done
anim.gif:
gifsicle --colors 16 --delay=35 --loop x_*.gif > anim.gif
View webshare.go
// webshare serves the current directory on port 3000.
package main
import (
"log"
"net"
"net/http"
)
func loggingHandler(h http.Handler) http.Handler {
View gcd_and_lcm.py
# Greatest common divisor of more than 2 numbers. Am I terrible for doing it this way?
def gcd(*numbers):
"""Return the greatest common divisor of the given integers"""
from fractions import gcd
return reduce(gcd, numbers)
# Least common multiple is not in standard libraries? It's in gmpy, but this is simple enough:
def lcm(*numbers):
View GIF-Screencast-OSX.md

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

View estimators.md
  • fit* = fit_partial
|--------------------------------+---------+---------+----------|
|  Class                         | fit     | fit*    | predict  |
|--------------------------------+---------+---------+----------|
|  AdaBoostClassifier            | x       | -       | x        |
|  AdaBoostRegressor             | x       | -       | x        |
|  AdditiveChi2Sampler           | x       | -       | -        |
View 38805840-logistic.py
#!/usr/bin/env python
from sklearn.linear_model import LogisticRegression
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
signal = [1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0]
def create_training_data(signal, size=3):
View awkfri.txt
From ACM SIGPLAN 32, August 1997
Why GAWK for AI?
Ronald P. Loui
Most people are surprised when I tell them what language we use in our
undergraduate AI programming class. That's understandable. We use
GAWK. GAWK, Gnu's version of Aho, Weinberger, and Kernighan's old
pattern scanning language isn't even viewed as a programming language by