Start some brown rice with mashed ginger. Chop some yams or sweet potatoes and carrots and roast them halfway. Lightly toast some cumin seeds in a skillet and then grind them in a mortar. Put the half-roasted root vegetables into the skillet with some minced onion and garlic. Add dried basil, cayenne, cinnamon, cardamom, corriander, and cumin. Cook until the onions are translucent and then add to the rice. Mix in siracha, green onions, peanuts, banana chips and raisins. (The peanuts should add enough salt.)
I don't think Indians use cayenne, but instead rely on the combination of other spices and cinnamon to create a heat. Whatever. It was my birthday and I liked it.
Monday, December 20, 2010
White/Pink/Red Noise Generation
This guy uses some scripts and sox to produce different kinds of noise, here.
This guy has some Matlab/Octave code to generate pink noise, here.
The wikipedia article on spectral density is helpful. It is found here.
The scholarpedia (?) article on 1/f noise is here.
A python pink noise generator is here.
A Matlab script for pink noise is here.
This guy has some Matlab/Octave code to generate pink noise, here.
The wikipedia article on spectral density is helpful. It is found here.
The scholarpedia (?) article on 1/f noise is here.
A python pink noise generator is here.
A Matlab script for pink noise is here.
Command Line Audio Manipulation
Monday, December 13, 2010
Thursday, December 9, 2010
Tutorial Ideas
+ Predator-Prey Modeling
+ Other Dynamic Models
+ Differential Equations
+ Kalmann Filter
+ Using Cyphers
+ Image Processing
+ Color Schemes
+ Random Numbers and Chaos
+ Other Dynamic Models
+ Differential Equations
+ Kalmann Filter
+ Using Cyphers
+ Image Processing
+ Color Schemes
+ Random Numbers and Chaos
Handling Images in Python via Matplotlib
This page describes how to use the matplotlib.image module to load and work with images. Here.
Monday, December 6, 2010
Wednesday, December 1, 2010
Tuesday, November 30, 2010
Monday, November 29, 2010
Lotka-Volterra Predator-Prey Model in Three Part Harmony
#!/usr/bin/env python
import os
def system( u, v, w, uinit, vinit, winit, time ):
ut = list(); ut.append( uinit )
vt = list(); vt.append( vinit )
wt = list(); wt.append( winit )
for i in range( time ):
ut.append( u.update( ut[-1], vt[-1], wt[-1] ) )
vt.append( v.update( vt[-1], ut[-1], wt[-1] ) )
wt.append( w.update( wt[-1], ut[-1], vt[-1] ) )
return ( ut, vt, wt )
class Component:
def __init__( self, a, b, g, h ):
self.alpha = a
self.beta = b
self.gamma = g
self.step = h
def update( self, x, y, z ):
self.body = self.alpha*x + self.beta*x*y + self.gamma*x*z
return x + self.step*self.body
step = 0.08
u = Component( -1.0, 0.025, 0.035, step )
v = Component( 1.5, -0.45, -0.024, step )
w = Component( 1.45, -0.75, 0.026, step )
( ut, vt, wt ) = system( u, v, w, 5.0, 50.0, 20.0, 4000 )
ubuff = open( "ut.txt", "w" )
vbuff = open( "vt.txt", "w" )
wbuff = open( "wt.txt", "w" )
for i in range( len( ut ) ):
ubuff.write( str( ut[i] ) )
ubuff.write('\n')
vbuff.write( str( vt[i] ) )
vbuff.write('\n')
wbuff.write( str( wt[i] ) )
wbuff.write('\n')
ubuff.close(); vbuff.close(); wbuff.close()
foo = list()
foo.append('#!/usr/bin/env octave\n')
foo.append('\n')
foo.append('load ut.txt ; load vt.txt ; load wt.txt ;\n')
foo.append('t = 0:4000 ; plot( t, ut, t, vt, t, wt ) ;\n')
foo.append('print -djpeg foo.jpeg;\n')
f = open( "foo.o", "w" )
f.writelines( foo )
f.close()
os.system( 'octave -qf foo.o' )
os.system( 'evince foo.jpeg &' )
os.system( 'rm ut.txt' )
os.system( 'rm vt.txt' )
os.system( 'rm wt.txt' )
os.system( 'rm foo.o' )
import os
def system( u, v, w, uinit, vinit, winit, time ):
ut = list(); ut.append( uinit )
vt = list(); vt.append( vinit )
wt = list(); wt.append( winit )
for i in range( time ):
ut.append( u.update( ut[-1], vt[-1], wt[-1] ) )
vt.append( v.update( vt[-1], ut[-1], wt[-1] ) )
wt.append( w.update( wt[-1], ut[-1], vt[-1] ) )
return ( ut, vt, wt )
class Component:
def __init__( self, a, b, g, h ):
self.alpha = a
self.beta = b
self.gamma = g
self.step = h
def update( self, x, y, z ):
self.body = self.alpha*x + self.beta*x*y + self.gamma*x*z
return x + self.step*self.body
step = 0.08
u = Component( -1.0, 0.025, 0.035, step )
v = Component( 1.5, -0.45, -0.024, step )
w = Component( 1.45, -0.75, 0.026, step )
( ut, vt, wt ) = system( u, v, w, 5.0, 50.0, 20.0, 4000 )
ubuff = open( "ut.txt", "w" )
vbuff = open( "vt.txt", "w" )
wbuff = open( "wt.txt", "w" )
for i in range( len( ut ) ):
ubuff.write( str( ut[i] ) )
ubuff.write('\n')
vbuff.write( str( vt[i] ) )
vbuff.write('\n')
wbuff.write( str( wt[i] ) )
wbuff.write('\n')
ubuff.close(); vbuff.close(); wbuff.close()
foo = list()
foo.append('#!/usr/bin/env octave\n')
foo.append('\n')
foo.append('load ut.txt ; load vt.txt ; load wt.txt ;\n')
foo.append('t = 0:4000 ; plot( t, ut, t, vt, t, wt ) ;\n')
foo.append('print -djpeg foo.jpeg;\n')
f = open( "foo.o", "w" )
f.writelines( foo )
f.close()
os.system( 'octave -qf foo.o' )
os.system( 'evince foo.jpeg &' )
os.system( 'rm ut.txt' )
os.system( 'rm vt.txt' )
os.system( 'rm wt.txt' )
os.system( 'rm foo.o' )
Wednesday, November 24, 2010
Robot Scientist
Thursday, November 18, 2010
Sanderson and Croft, Deriving Concept Hierarchies from Text
Monothetic clusters: membership is based only on one feature.
Polythetic clusters: a document's membership to a given cluster is defined by its possession of a sufficient fraction of terms from that cluster. See Scatter/Gather.
The topic of a monothetic cluster is usually more intuitive than the topic of a polythetic cluster.
Five basic principles:
1) Terms in hierarchy extracted from documents, and reflect topics covered in documents
Wednesday, November 10, 2010
Friday, November 5, 2010
Monday, November 1, 2010
stdint.h with g++ on Ubuntu
The header file stdint.h, needed for larger integer types, has at line 24:
#include
but on Ubuntu you need to change this to:
#include
#include
but on Ubuntu you need to change this to:
#include
Wednesday, October 20, 2010
Cheat Sheets
Friday, October 15, 2010
Wednesday, October 13, 2010
GSL - GNU Scientific Library
Tuesday, October 12, 2010
Monday, October 11, 2010
Friday, October 8, 2010
Microsoft fonts in Ubuntu
Here is a good tutorial for loading the traditional Microsoft fonts into Ubuntu.
Thursday, October 7, 2010
Variance
Different programs implement variance in different ways. This can lead to confusing results when you move from one set of functions to another.
scipy.stats.cov() normalizes by (N-1), by default, bias=False. By setting bias=True, you will normalize by N.
However, scipy.var() normalizes by N.
In Octave, var( x, 0 ) biases by N-1, and var( x, 1 ) biases by N.
Matlab and R, I think, do things slightly differently.
scipy.stats.cov() normalizes by (N-1), by default, bias=False. By setting bias=True, you will normalize by N.
However, scipy.var() normalizes by N.
In Octave, var( x, 0 ) biases by N-1, and var( x, 1 ) biases by N.
Matlab and R, I think, do things slightly differently.
Friday, October 1, 2010
NumPy and Input/Output
Super dooper resource for NUmPy I/O can be found here. Includes information on how to interpret binary data, and use the NumPy alias of the the MATLAB fread() function.
Wednesday, September 29, 2010
Monday, September 27, 2010
CUDA, PyCUDA, and PyCUBLAS
Andreas Klöckner's PyCUDA page.
Some documentation for PyCUDA and PyOpenCL.
Moire Patterns using PyCUDA and PyGame.
Use PyCUBLAS to multiply matrices smaller than 65536-by-65536.
Some documentation for PyCUDA and PyOpenCL.
Moire Patterns using PyCUDA and PyGame.
Use PyCUBLAS to multiply matrices smaller than 65536-by-65536.
Thursday, August 26, 2010
Statistics Examples
Some useful examples can be found at Dr. Hockings STAT 636 webpage.
Examples of Statistical Computing, including R and SAS and SPLUS.
Examples of Statistical Computing, including R and SAS and SPLUS.
Data Sets
UCI Machine Learning Repository has a wide variety of popular data sets and lists of publications that have used those data sets.
Wednesday, August 25, 2010
Tuesday, August 24, 2010
Scipy and NumPy Documentation
Python has modules several modules, Scipy and NumPy, that offer very similar functionality to the functions offered by Matlab. (This is not a conclusive list of math/science related Python modules, but this is a good place to start.)
N.B. I found that to use scipy.linalg.eig(A), I needed to say: import scipy; from scipy import linalg. That did the old tricking.
The Tentative NumPy Tutorial may be found here.
NumPy for Matlab users may be found here.
N.B. I found that to use scipy.linalg.eig(A), I needed to say: import scipy; from scipy import linalg. That did the old tricking.
The Tentative NumPy Tutorial may be found here.
NumPy for Matlab users may be found here.
Sunday, March 28, 2010
Saturday, March 20, 2010
Subscribe to:
Comments (Atom)