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
View README.md
View gist:f5a0c0c6977d9d24e237f1b5ba9afd18
#!/bin/sh
## Information
## http://carlo-hamalainen.net/blog/2007/12/11/installing-minion-pro-fonts/
## http://www.ctan.org/tex-archive/fonts/mnsymbol/
## 0: Install
## http://www.lcdf.org/type/
## I used --without-kpathsea to configure (with MacTeX 2011):
##
## ./configure --without-kpathsea
View catpdf
#!/bin/bash
if [ "$#" -ne 1 ] || ! [ -e "$1" ]; then
echo "Usage: $0 FILE"
exit 1
fi
hash pdftotext 2> /dev/null || { echo "pdftotext required"; exit 1; }
F=$(mktemp)
pdftotext -layout "$1" "$F" && cat "$F" && rm -f "$F"
View sampling.go
package main
import (
"fmt"
"math/rand"
"strconv"
"strings"
"time"
"github.com/fatih/color"