Skip to content

Instantly share code, notes, and snippets.

View jfhbrook's full-sized avatar
💭
KNEE DEEP IN THE HOOPLA

Josh Holbrook jfhbrook

💭
KNEE DEEP IN THE HOOPLA
View GitHub Profile
%mirror.m
%calculates mirror geometry action for MTUAF
function main()
%inputs, Units in inches
b=cart2both([-0.5,-0.5]); %bottom of screen
[th,r]=pol2cart(deg2rad(90),0.5*12); %top of screen
a=[th,r]+b{1};
topangle=deg2rad(40);%top inside angle
bottomangle=deg2rad(100);%bottom inside angle
m_dist=12;%distance down c where mirror starts
function xn = subset(x,n)
%subsets array x to xn with every nth row
%Written by Josh Holbrook and Marcus Curley
%for Thermal Systems Lab
xn = x(:,1);
for i = 1:n:size(x,2)
@jfhbrook
jfhbrook / lab1.py
Created February 8, 2010 05:11
My uncompleted calculations for a Thermal Systems lab.
import csv
from libtsl import subset,htparams,sphere
from numpy import array, exp
from matplotlib.pyplot import *
from keas.unit.unit import UnitConverter
#Reads in data points
datareader=csv.reader(open('friday_aluminum_sphere.csv'))
time=[]
temp=[]
@jfhbrook
jfhbrook / subset.m
Created February 10, 2010 02:15
A subsetting function for matlab for Thermal Systems
function xn = subset(x,n)
%subset(x,n)
%sub sets array x to xn with every nth row
%example:
%> x=[1:10];
%> subset(x,2)
% ans = [2 4 6 8]
xn = x(:,1);
for i = 1:n:size(x,2)
xn = [xn x(:,i)];
@jfhbrook
jfhbrook / subset.m
Created February 11, 2010 19:42
An alternate, shorter/vectorized version of subset.m from before. Product of bouncing ideas off Dustin.
function out=subset(in,n)
%subset(row_vector,spacing)
%subsets a row vector
%by Josh Holbrook and Dustin Ray
out=in(floor(linspace(1,size(in,2),n)));
end
@jfhbrook
jfhbrook / factorfinder.csv
Created February 12, 2010 00:49
A "Factor Finder" table for a digital viscometer from TSL.
model number rpm factor
RV 1 0.5 200
RV 1 1 100
RV 1 2 50
RV 1 2.5 40
RV 1 4 25
RV 1 5 20
RV 1 10 10
RV 1 20 5
RV 1 50 2
@jfhbrook
jfhbrook / segfault?!??!
Created February 14, 2010 07:45
A snippet for my comsol running scriptz0r
josh@gengar:~$ if echo 'segmentation fault {mlroot} {butt} {fruit}' | grep -c 'segmentation fault' ; then echo "true"; fi
1
true
@jfhbrook
jfhbrook / lolfinitedifference.lol
Created February 17, 2010 22:38
An attempt at using lolcode for numerical shit (for great justice?) Currently doesn't work >_<
OBTW
USED MATHIFIED VRSN OF INTERPRETER FROM http://www.icanhaslolcode.org/
NAOW INCLUDES POWR AN LOLG (pow() and log() from math.h)
U CAN FIND @ http://github.com/jesusabdullah/lolcode
ALSO http://lolcode.com/specs/1.2 AN http://lolcode.com/proposals/1.3/bukkit
O AN SOME OBJECT STUFF?? IZ CONFUSING
CRUISE CONTROL ETC
WRITTN BY JOSHUA HOLBROOK
ADOPTED FROM `Computer Code to Calculate h "RODS-415"' FROM ZARLING
LICENSED UNDER THE WTFPL
@jfhbrook
jfhbrook / lolcode_conductivity.lol
Created February 27, 2010 02:49
another attempt at homework in lolcode
HAI 1.2
BTW USING LOLCODE FOR A MUCH EASIER LAB
BTW THIS IS A PANEL OBJECT
O HAI IM PANEL
I HAS A THIKNISS
I HAS A THOT
I HAS A TCOLD
I HAS A HFM
I HAS A K
import random
'''
generates a pdf with a bunch of randomized bingo cards using entries from bingo.txt
Having issues getting formatting to work exactly how I want, though,
and, of course, it'd be a lot more useful if it could run on windows without
depending on latex and tikz and everything else... >_<
making it a webapp would be nice, but that sounds like a lot of work. :P
'''