Skip to content

Instantly share code, notes, and snippets.

@gorlum0
gorlum0 / gist:5721558
Created June 6, 2013 13:42
fbreader old skin
font color: black
background color: #F5F2E7
@gorlum0
gorlum0 / str2nums.py
Created September 7, 2012 15:49
Some convenience funcs for algs4partI-class exercises - easier in numbers for me than in alphabet.
#algs4partI-class
def str2nums(s):
return [ord(x)-ord('A') for x in s.split()]
def nums2str(l):
return ' '.join(chr(x + ord('A')) for x in l)
@gorlum0
gorlum0 / quix.txt
Created March 26, 2012 13:48
quix.txt for quixapp
> This is a Quix Command File
>
> For the syntax of this file, please refer to http://quixapp.com/syntax/
>
@Basic commands
@These are the most basic commands Quix offers, but possibly also the most powerful ones.
a http://www.amazon.com/s/?field-keywords=%s Amazon Search
d http://www.google.com/search?q=define:%s Google Define a word
dict http://www.google.com/dictionary?langpair=en%7Cen&q=%s&hl=en&aq=f Google Dictionary for a word
@gorlum0
gorlum0 / count-inv-lr.py
Created March 16, 2012 19:17
Count inversions in an array, not "in-place"
#!/usr/bin/env python
"""(c) gorlum0 [at] gmail.com"""
import random
from sys import maxsize as inf
def merge_sort(A):
"""merge-sort which counts inversions"""
def merge(L, R):
m = len(L)-1
B = []
@gorlum0
gorlum0 / ex2_reg.py
Created January 28, 2012 09:45
ml-class - ex2_reg (python)
#!/usr/bin/env python
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from scipy import optimize
from numpy import newaxis, r_, c_, mat, e
from numpy.linalg import *
def plotData(X, y):
pos = (y.ravel() == 1).nonzero()
@gorlum0
gorlum0 / ex2.py
Created January 28, 2012 09:43
ml-class - ex2 (python)
#!/usr/bin/env python
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from scipy import optimize
from numpy import newaxis, r_, c_, mat, e
from numpy.linalg import *
def plotData(X, y):
#pos = (y.ravel() == 1).nonzero()
@gorlum0
gorlum0 / ex1_multi.py
Created October 31, 2011 09:11
ml-class - ex1_multi (python)
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
from numpy import newaxis, r_, c_, mat
from numpy.linalg import *
def featureNormalize(X):
X_norm = X.A
m = X.shape[0]