Skip to content

Instantly share code, notes, and snippets.

@rhunter
rhunter / error
Created December 11, 2014 00:18
Game Evolution / Volatilia stack trace
Exception in thread "Display" java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016)
at sun.java2d.opengl.CGLGraphicsConfig.createCompatibleImage(CGLGraphicsConfig.java:201)
at java.awt.GraphicsConfiguration.createCompatibleImage(GraphicsConfiguration.java:178)
at sun.awt.image.SunVolatileImage.getBackupImage(SunVolatileImage.java:236)
at sun.awt.image.VolatileSurfaceManager.getBackupSurface(VolatileSurfaceManager.java:263)
at sun.awt.image.VolatileSurfaceManager.initialize(VolatileSurfaceManager.java:126)
at sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:88)
at sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:98)
at sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:109)
@rhunter
rhunter / Intro.markdown
Created September 13, 2014 10:35
ruby-rdf performance

I have some data I'm playing with that seemed like a good fit for RDF-style interaction, so I thought I'd give ruby-rdf a whirl.

I'm using ruby-rdf, sparql, and rdf-do (backed by do_sqlite3).

I've found that even on a relatively small dataset (just a couple of hundred statements), it takes minutes to execute a SPARQL query like the following:

Keybase proof

I hereby claim:

  • I am rhunter on github.
  • I am rjhunter (https://keybase.io/rjhunter) on keybase.
  • I have a public key whose fingerprint is FADE 7A2E A6D4 2D3A 0790 26C5 9EC9 C1D2 7B59 D54E

To claim this, I am signing this object:

@rhunter
rhunter / roadtrip.md
Created June 30, 2014 07:59
International number one songs and DBpedia

The scenario we were exploring, helping make a music playlist for a road trip, focused on the following:

  • reminiscibility
    • time and place
    • high exposure at an impressionable age
      • tied to life events
      • social music, nightclubs
        • ->teens, esp. late teens (16-20)
    • nothing to do with "goodness" of music
  • singalongability
@rhunter
rhunter / spec.rb
Created October 22, 2013 23:47
One way to do Cucumber-style scenario tables in RSpec (in reply to @jbrains's question <https://twitter.com/jbrains/status/392794624416579584> )
describe 'scenario tables' do
scenarios = [
{given_balance: 10, when_withdrawing: 10, expected_balance: 0},
{given_balance: 20, when_withdrawing: 10, expected_balance: 10},
{given_balance: 30, when_withdrawing: 30, expected_balance: 0}
]
scenarios.each_with_index do |scenario, n|
context "given a starting balance of #{scenario[:given_balance]} (scenario #{n})" do
it "should have #{scenario[:expected_balance]} left after withdrawing #{scenario[:when_withdrawing]}"
end
@rhunter
rhunter / bundler-profile-default.txt
Created April 10, 2013 04:48
Profiling `bundle update`, showing the bulk of the time goes into remote (Rubygems.org) resolution. Bundler 1.3.0 on Ruby 1.9.3 with a 40-gem, ~370 line Gemfile.lock, on Mac OS X. Inspired by @mipearson's question about "bundle update" taking so long: https://twitter.com/mipearson/status/321799739765055489
% cumulative self self total
time seconds seconds calls ms/call ms/call name
48.12 616.23 616.23 2344047 0.26 0.38 Gem::Version#<=>
4.72 676.70 60.47 166869 0.36 25.08 Array#each
3.92 726.89 50.19 10225362 0.00 0.00 Module#===
3.54 772.18 45.29 9053267 0.01 0.01 Array#[]
2.96 810.10 37.92 2298520 0.02 0.41 Bundler::Index#same_version?
2.95 847.90 37.80 2312095 0.02 0.39 Comparable.==
2.66 882.01 34.11 4668218 0.01 0.01 Gem::Version#segments
1.87 905.96 23.95 4584889 0.01 0.01 Fixnum#+
@rhunter
rhunter / gist:4508463
Created January 11, 2013 06:34
English words that contain exactly one of each vowel, in order. I blame Fraser for this. ``` grep -i '^[^aeiou]*a[^aeiou]*e[^aeiou]*i[^aeiou]*o[^aeiou]*u[^aeiou]*$' /usr/share/dict/words ```
abstemious
abstemiously
abstentious
acheilous
acheirous
acleistous
affectious
annelidous
arsenious
arterious
@rhunter
rhunter / README.md
Created December 31, 2012 07:55 — forked from anonymous/README.md

Precursor Remix Pack 4

A quick and unofficial UQM package for the fourth and final Precursors album. I'm sure someone working on this already -- someone with better knowledge and experience than me -- but I put this together to gain a bit of experience.

Hopefully you'll find it useful too (at least until the official package comes out).

How do I install it?

### Setting up a Mac OS X 10.7 "Lion" machine for Python development
# for Buckets
## get a per-user-safe distutils ("easy_install")
# strictly speaking you can use the built-in one (as long as you sudo)
# but I prefer to be sudo-free and keep thing self-contained
# so that I don't tangle the system up by accident
#
# use Distribute's alternative easy_install instead of sudo-ing the Mac-provided easy_install
@rhunter
rhunter / gist:2962814
Created June 20, 2012 23:07 — forked from jennifersmith/gist:2962703
release_dates.sh
pattern='release_'
all_release_branch_names=($(git show-ref | egrep "$pattern" | cut -d' ' -f 2))
for branch in "${all_release_branch_names[@]}"; do
commit_where_it_branched_from_master=$(git merge-base ${branch} master)
git show $commit_where_it_branched_from_master -s --pretty=format:"$branch branched from master on %cd"
done