Instantly share code, notes, and snippets.

# Jason K. Mooremoorepants

• Sort options
Created Dec 4, 2010
Yumi's data analysis in R
View Redox.r
 # bring in the data Redox = read.csv('Redox.csv', header=TRUE) print(names(Redox)) # make an example plot for iron, PH average ironsub = subset(Redox, trt == "High Fe(II)" | trt == "Low Fe(II)") xlim = range(Redox\$day, na.rm=TRUE) ylim = range(Redox\$pH, na.rm=TRUE)
Created Dec 7, 2010
shows how to loop through a subset of columns
View test.r
 Redox=read.csv('Redox.csv', header=TRUE) col = c("pH", "mmol.DOC", "SUVA", "mmol.fe2") newRedox = Redox[col] # removes columns not in col for(item in newRedox) # for each column in newRedox { ylim = range(item, na.rm=TRUE) xlim = range(Redox\$day, na.rm=TRUE)
Created Jun 3, 2011
Basic Matlab Animation
View gist:1007366
 t = 0:0.001:1000; x = cos(t); y = sin(t); fig = figure(); ax = axes(); hold on dot1 = plot(x(1), y(1)); dot2 = plot(1.5 * x(1), 1.5 * y(2)); hold off
Created Jul 21, 2011
Aurelia's pydy code
View gist:1098315
 from sympy import * from sympy.physics.mechanics import * theta, phi, omega, alpha = dynamicsymbols('theta phi omega alpha') thetad, phid, omegad, alphad = dynamicsymbols('theta phi omega alpha', 1) gravity = symbols('gravity') m, l = symbols('m l') I1, I2, I3 = symbols('I1, I2, I3')
Created Jul 22, 2011
problem that hangs in pydy
View gist:1100050
 from sympy import * from sympy.physics.mechanics import * # the unknown steer torque Tdelta = dynamicsymbols('Tdelta') # constants we measure on the bicycle d, ds1, ds3 = symbols('d ds1 ds2') c = symbols('c')
Created Sep 15, 2011
vim settings for luke
View vimstuff
 this is my html file that i keep in .vim/after/ftplugin ------------------------------------------------------- set tabstop=2 " hard tab shows up as 2 spaces set shiftwidth=2 " autoindent and >> make 2 spaces set textwidth=79 " wrap lines after 79 characters this is my vimrc ----------------
Created Feb 8, 2012
Whipple Model Transfer Functions
View whipple_transfer_functions.py
 #!/usr/bin/env python # This script calculates the numerators and denominator polynomials of the # Whipple bicycle model tranfer functions as a function of the canonical matrix # entries given in Meijaard2007. import numpy as np import matplotlib.pyplot as plt from sympy import Symbol, Matrix, symbols, eye, zeros, roots, Poly import uncertainties as un
Created Aug 8, 2012
vim command to convert my Sphinx citations to sphinxcontrib-bibtex format
View convert_cite.txt
 %s/\[\(\w*\d\d\d\d\w*\)\]_/:cite:`\1`/gc
Created Aug 16, 2012