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
@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
'''
@jfhbrook
jfhbrook / ssshow.py
Created March 6, 2010 00:29
A quick lil' python script that uses gnumeric's ssconvert and the standard library's csv to, y'know, show me the contents of gnumeric files wif less.
#!/usr/bin/env python
from os import system
from re import sub
from sys import argv
from csv import reader, writer
def main(filename):
system('ssconvert -T Gnumeric_stf:stf_csv '+filename+' /tmp/ssconv1.csv')
read = reader(open('/tmp/ssconv1.csv','r'), 'excel')
@jfhbrook
jfhbrook / crossings.py
Created March 23, 2010 01:30
stupid code that does things with shapefiles or something
#!/usr/bin/env python
#experimenting with Shapely
from shapely import geometry, wkb
#also need gdal stuff--YUCK :C
from osgeo import osr, ogr
#since these things take time...
from progressbar import ProgressBar, Percentage, Bar
@jfhbrook
jfhbrook / tsl_week_8.m
Created March 30, 2010 19:20
Soon to be a part of the libtsl repository, this file is used to compare real-world results what the pump affinity laws predict.
% tsl_week_8.m
% Written by Joshua Holbrook, week of March 28th 2010
% Since people actually seem to be using this, it's licensed
% under the WTFPL (http://sam.zoy.org/wtfpl/).
% A little snafu with matlab is that you can't define a function within a
% non-function script. So, I wrapped these codes in a function!
function tsl_week_8()
% Prompt 1: *Using Matlab*, perform a sum of least squares non-linear
@jfhbrook
jfhbrook / sigdigs.py
Created April 9, 2010 00:49
a long time ago, I was gonna try doing this for matlab. This looks easier. :S
"""
A sketch for an idea I've had since forever regarding significance arithmetic.
http://en.wikipedia.org/wiki/Significance_arithmetic
Yeah, that annoying shit you did in chemistry class and hoped never to see again.
With this, maybe you can?
"""
class significants(number):
# note: not actually sure how to do some of these things
def __init__:
#!/usr/bin/octave --silent
% This test demonstrates the use of GNU octave with scripts.
% Use: chmod +x test.m && ./test.m
% Not sure if/when this will be handy. Being able to do this
% with MATLAB would probably be more useful for me.
disp('hello world!');

matlab's cli interpreter is dumber than octave, in that it doesn't know what to do with the #! magic number, and it doesn't know to exit at the end of a file (I can actually see the point in that, kind of). So, this is my quick attempt to make something that would allow you to, well,

./test.m

It ALMOST works. ALMOST. No errors are thrown or anything! :v On the other hand, you don't actually see "hello world!!!!1!" either. Haven't tried anything like, say, printing to a file.

@jfhbrook
jfhbrook / README.md
Created June 12, 2010 00:20
A server-side parallel to arsc_remote, so to speak.

#ABOUT: #

After talking with a colleague about some stuff, I came to this realization that the ARSC user experience could use some explaining too. At the same time, I've had my own issues with wanting to run things without having admin priveleges, which I'm not used to. In addition to that, the ARSC workstation setups have their own SNAFUS for us to deal with.

#TODO: #