Skip to content

Instantly share code, notes, and snippets.

View bryan-lunt's full-sized avatar

Bryan Lunt bryan-lunt

  • Department of Computer Science, UC San Diego
  • Urbana, Illinois
View GitHub Profile
@bryan-lunt
bryan-lunt / noise_injector.py
Created February 26, 2016 17:22
Noise Injection
#!/usr/bin/env python
import argparse
from gemstat.matrix import *
import sys
import scipy as S
parser = argparse.ArgumentParser()
@bryan-lunt
bryan-lunt / ffsget.py
Created February 24, 2016 16:40
Getter for FlyFactorSurvey data
#!/usr/bin/env python
import BeautifulSoup as BS
import argparse
parser = argparse.ArgumentParser()
args, other = parser.parse_known_args()
@bryan-lunt
bryan-lunt / z_KerasSequence-try_reverse.py
Created February 15, 2016 18:21
Test Keras.io reverse recurrences
# coding: utf-8
# In[1]:
get_ipython().magic(u'matplotlib inline')
# In[2]:
@bryan-lunt
bryan-lunt / HID.cpp
Last active August 29, 2015 14:23
Arduino HID altered to handle joysticks. ( I took the files from here and merged their changes with the newer Arduino headers. http://www.imaginaryindustries.com/blog/?p=80 )
/* Copyright (c) 2011, Peter Barrett
**
** Permission to use, copy, modify, and/or distribute this software for
** any purpose with or without fee is hereby granted, provided that the
** above copyright notice and this permission notice appear in all copies.
**
** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
** WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
** WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
@bryan-lunt
bryan-lunt / NodeBoxMend.py
Created February 2, 2015 19:03
Mandelbrot Set generators in Python
window = (500,500)
mwindow = ((-1,1),(-1,1))
size(window[0],window[1])
pinf = float("inf")
ninf = float("-inf")
def isBad(x):
return x != x or x == pinf or x == ninf
def inMend(z,c):
@bryan-lunt
bryan-lunt / telescope_resolution
Created December 22, 2014 18:04
Calculate Telescope properties
import scipy as S
import pylab
#My Cheap Telescope
APPERTURE = 0.114
FOCAL_LENGTH= 0.910
#http://en.wikipedia.org/wiki/Visible_spectrum
min_visible = 380e-9
@bryan-lunt
bryan-lunt / xephem.rb
Last active August 29, 2015 14:05
Homebrew formula for Xephem : http://www.clearskyinstitute.com/xephem/ SEE TERMS THERE.
require "formula"
# Documentation: https://github.com/Homebrew/homebrew/wiki/Formula-Cookbook
# /usr/local/Library/Contributions/example-formula.rb
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
class Xephem < Formula
homepage ""
url "http://97.74.56.125/free/xephem-3.7.6.tar.gz"
sha1 "2b07e05b7ea1fe72f5f52983a15b34c7f7b2d75b"
@bryan-lunt
bryan-lunt / TelescopeFocus
Last active August 29, 2015 14:02
Electric focus for my telescope
#include <Servo.h>
/*
The buttons switch in a voltage divider so that the left and right buttons both use the same pin.
The speed controller is a potentiometer.
/*
@bryan-lunt
bryan-lunt / probabilities_female_speakers.py
Created May 8, 2014 22:22
Calculate and graph the probabilities of only N (or fewer) female speakers at a conference of M, at various compositions of female/male for the field.
#!/usr/bin/env python
import scipy as S
import scipy.misc as MISC
import pylab
ticks=100
KP = 26
set style data lines
set term aqua 1
set title "absolute speed"
plot "data" u 3
set term aqua 2
set title "absolute windspeed"
plot "data" u 4