Skip to content

Instantly share code, notes, and snippets.

Avatar

Neal McBurnett nealmcb

View GitHub Profile
View pack.rb
# just playing
def self.pkg(platform, opt)
# short time solution <start>
extension = case platform
when "win32" then
"exe"
when "linux" then
"run"
when "osx" then
"dmg"
@nealmcb
nealmcb / rankconvert.py
Created Oct 7, 2009
Convert ranked ballots from the CSV format provided by CIVS to BLT
View rankconvert.py
#!/usr/bin/env python
"""Convert ranked ballots from the CSV format provided by CIVS
(http://www.cs.cornell.edu/andru/civs.html) to the BLT format
used by, e.g., OpenSTV (www.openstv.org/).
http://code.google.com/p/stv/wiki/BLTFileFormat
TODO: support the popular "text" format and equal rankings via the "=" delimiter.
%InsertOptionParserUsage%
View replicate_trick.r
## Climate analysis R code based on Steve McIntyre's example at
## http://camirror.wordpress.com/2009/11/29/replicating-the-trick-diagram/#more-130
## with some fixes by Neal McBurnett.
## Usage: R --save < replicate_trick.r
## which produces an "Rplots.ps" file
##COMPARE ARCHIVED BRIFFA VERSION TO CLIMATEGATE VERSION#
#1. LOAD BRIFFA (CLIMATEGATE VERSION)
# archive is truncated in 1960: ftp://ftp.ncdc.noaa.gov/pub/data/paleo/treering/reconstructions/n_hem_temp/briffa2001jgr3.txt”
View fgdb.rb install on ubuntu 10.04
Peter Lyons' notes on installing fgdb (Free Geek Database) from the trunk:
git://git.freegeek.org:/git/fgdb.rb
Note that after running into some problems with that, we tried using the one at github which is close to version 1.0.30 of the main project, and that has been working better.
http://wiki.github.com/markstos/fgdb.rb/
But for the record, here is the procedure we tried for the trunk version (about version 1.0.50):
-Installed Ubuntu Server 10.04 amd64 (Lucid)
@nealmcb
nealmcb / testkernel.py
Created Feb 24, 2012
testkernel: automate many linux kernel testing steps - great for a git bisect
View testkernel.py
#!/usr/bin/env python
"""
The testkernel command does these things to make linux kernel testing easy:
looks in the indicated folder on the web
downloads the .deb files for the kernel of the given type
installs them locally
configures grub2 to reboot to the given kernel on the next reboot
TODO:
@nealmcb
nealmcb / track_session_inhibitors.py
Created Jul 16, 2012
Track and print out the apps and clients that are inhibiting Gnome session actions like log out, user switching, suspending or idle/dpms/screensaver, under Linux.
View track_session_inhibitors.py
#!/usr/bin/python
"""
Print out the apps and clients that are inhibiting session actions like log out, user switching, suspending or idle.
%InsertOptionParserUsage%
Example:
track_session_inhibitors &
Todo:
@nealmcb
nealmcb / xkcd-greek-t-shirt.md
Created Mar 18, 2015
XKCD Greek t-shirt, with mathematical, scientific and engineering uses for greek letters
View xkcd-greek-t-shirt.md

xkcd has some great t-shirts in the xkcd store. One of them, which I got in late 2014, is the uber-geeky "greek" shirt, though I don't see it in the official store right now.

For background, see Greek letters used in mathematics, science, and engineering (Wikipedia), though that doesn't have all the uses listed by Randall.

Here are the letters and uses presented on the shirt, row-by-row:

δ  delta: dirac & kronecker deltas; isotope ratio
ε  epsilon: a small number; strain; permittivity
ψ  psi: quantum wavefunction, the planet Neptune
η  eta: impedance, viscosity, efficiency
@nealmcb
nealmcb / LearningSparkCh03.ipynb
Last active Aug 29, 2015
IPython Notebook with examples, and TypeError, in Learning Spark book dated 2015-03-27: "Second Release"
View LearningSparkCh03.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nealmcb
nealmcb / README.md
Last active Jun 16, 2016
OpenAI cartpole evaluation ala iaroslav-ai
View README.md

This gist documents my OpenAI evaluations at

I attempted to reproduce the quickest documented CartPole-v0 solution to-date, reporting 29 episodes to solve,by iaroslav-ai, documented at https://gym.openai.com/evaluations/eval_yCJkgBGRl2Nfn3TKbvkkg

I don't know why I had a different result the first time, or indeed why it was faster the second time.

I also saw it fail with a traceback:

@nealmcb
nealmcb / pg-pong.py
Last active Jun 21, 2016 — forked from karpathy/pg-pong.py
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
View pg-pong.py
"""pg-pong.py: Trains an agent with (stochastic) Policy Gradients on Pong.
Uses OpenAI Gym.
Saves model every 100 episodes. Resume by setting resume = True
Set render = True to watch the action.
Modified from https://gist.github.com/karpathy/a4166c7fe253700972fcbc77e4ea32c5
to print timestamped self-contained progress rows in TSV format (filter
for just lines containing 'episode').
For background, see http://karpathy.github.io/2016/05/31/rl/
You can’t perform that action at this time.