Skip to content

Instantly share code, notes, and snippets.

View austensatterlee's full-sized avatar

Austen Satterlee austensatterlee

View GitHub Profile
#!/usr/bin/env python2
####################################################
# #
# Markov Mixer #
# EE 126 #
# #
####################################################
# +envelope #
@austensatterlee
austensatterlee / print_matrix
Created January 31, 2015 21:36
Handy Python
def print_matrix(mat,rvalues=None,cvalues=None):
# print a 2d numpy array as a table, using the optional rvalues
# and cvalues as row and column labels
if rvalues==None:
rvalues=np.arange(mat.shape[0])
if cvalues==None:
cvalues=np.arange(mat.shape[1])
print ("{:5}"+"{:^6} "*mat.shape[1]).format('',*cvalues)
print ("{:5}"+"{:^6} "*mat.shape[1]).format('',*["-----" for i in cvalues])
for i,r in enumerate(rvalues):
@austensatterlee
austensatterlee / roundrobin.ksp
Last active December 11, 2015 13:36
Kontakt Round Robin Script
on init
declare $last_groupid := -1
declare $new_groupid
declare $N
end on
on note
$N := $NUM_GROUPS
disallow_group($ALL_GROUPS)
@austensatterlee
austensatterlee / kde.py
Last active March 22, 2017 21:55
Neat-o Mathematics
import numpy as np
# Example kernels
def uniform_kernel(x):
norm_coeff = .5
return .5*np.bitwise_and(-1<x,1>x)
def normal_kernel(x):
norm_coeff = (2*np.pi)**-.5
return .5*np.exp(-.5*x**2)