Monday, December 20, 2010

Best Curry Yet.

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.

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.

Command Line Audio Manipulation

Sound eXchange can be found, here. I think you need to convert ogg -> wav using sox, and then wav -> mp3 using lame.

Soundconverter, a GNU GUI for translating between formats can be found, here. It appears to also have a command-line capability.

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

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

Tuesday, November 30, 2010

cat is for concatenate (tfw?)

I always forget how to use the cat utility. Here's how.

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' )

Wednesday, November 24, 2010

Robot Scientist

A robot scientist, here.

Genetic algorithm equation maker, here.

"Distilling Free-Form Natural Laws from Experimental Data." By Michael Schmidt and Hod Lipson. Science, Vol. 324, April 3, 2009.

"Automating Science." By David Waltz and Bruce Buchanan. Science, Vol. 324, April 3, 2009.

Pthreads!

A good introductory tutorial to pthreads can be found here.

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

Color Schemes

Kuler?

Misc Linux Commands

Commands found, here, banner and cal are pretty neat.

GPU Gems 2

Book available in HTML format, here.

Friday, November 5, 2010

GPGPU Shtuff

Supercomputing for the Masses can be found, here.

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

Wednesday, October 20, 2010

Cheat Sheets

Here is a good place to find some math related cheat sheets.

Here is a fine place to get any cheat sheet you could want. Programming, math... just about everything.

Friday, October 15, 2010

C++ Sources

Cpluplus dot comma is found here.

Wednesday, October 13, 2010

GSL - GNU Scientific Library

A set of scientific libraries for C/C++ can be found here.

Installation and compilation instructions found here.

Cython

The Cython documentation can be found here.

Tuesday, October 12, 2010

Monday, October 11, 2010

SSH and SCP

This is my ssh and scp goto page. (goto. lol.)

Friday, October 8, 2010

Microsoft fonts in Ubuntu

Here is a good tutorial for loading the traditional Microsoft fonts into Ubuntu.

Open Course Work from MIT

MIT's open course work website can be found here.

Call for Abstracts

A good resource for writing abstract can be found here.

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.

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.

GNU Octave

GNU Octave Manual, version 3, is found here.

Wednesday, September 29, 2010

Tilings

Girih tiles can be found here.

Penrose tiles can be found here.

Aperiodic tiles in general are found here.

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.

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.

Gnuplot

Not So Frequently Asked Questions is a large and accessible set of examples for gnuplot.

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

Statistics Websites

StatSoft Electronic Statistics Textbook

Social Research Methods Knowledge Base

Statistics Solutions

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.

Saturday, March 20, 2010

LaTeX to Image

Roger's Online Equation Editor lets you create images from LaTeX code.