Skip to main content

Benjamin Oakes

Photo of Ben Oakes

Hi, I'm Ben Oakes and this is my geek blog. Currently, I'm a Ruby/JavaScript Developer at Liaison. Previously, I was a Developer at Continuity and Hedgeye, a Research Assistant in the Early Social Cognition Lab at Yale University and a student at the University of Iowa. I also organize TechCorridor.io, ICRuby, OpenHack Iowa City, and previously organized NewHaven.rb. I have an amazing wife named Danielle Oakes.

Filtering for the month June, 2010. Clear

“Ruby, White and Blue Hackfest” tomorrow!

by Ben

I’ve had the great pleasure of working with some other local Ruby developers to reignite NewHaven.rb over the last few weeks. Our second official event is a “Ruby, White, and Blue Hackfest” tomorrow, July 1st. It’s going to run from 6-9 pm at Blue State (the Wall St location). Everyone is welcome — don’t worry about skill level! You bring a laptop, we bring the community.

Right now, the plan is to get together and work on a few projects that group members are interested in, including our upcoming website. I’d also like to talk about what we should do for our next event.

If you’re planning on coming, please RSVP.

New on GitHub: utilities

by Ben

I spent some time over the last few weeks pulling together lots of command line tools that I’ve written over the last few years. I’ve shared them on GitHub.

Some fill in gaps that I wish *nix systems would have by default (such as prune vs uniq or reverse vs rev). Others just script things that I do commonly or are just tedious to do (such as backups2git, github-init, timestamp, latest-migration-path, and std-timestamps). Some are just there for fun (such as is-computer-on). Most of them are written in Ruby, but some are plain old Bash scripts. Lots of the Ruby scripts make heavy use of ARGF, which is awesome for writting shell scripts if you’ve never used it.

I also spent some time documenting (and remembering) how they worked. (Most of it was just shuffling comments around.) Almost every command has a --help option that prints usage information and a short synopsis now. I hope you find them useful!

See them on GitHub

Throw exception when re-assigning a constant in Ruby?

by Ben

This has bothered me for a while, so I made a question on StackOverflow:

I’ve long been aware that “constants” in Ruby (i.e., variable names that are capitalized) aren’t really constant. Like other programming languages, a reference to an object is the only thing stored in the variable/constant. (Sidebar: Ruby does have the facility to “freeze” referenced objects from being modified, which as far as I know, isn’t an ability offered in many other languages.)

So here’s my question: when you re-assign a value into a constant, you get a warning like so:

>> FOO = 'bar'
=> "bar"
>> FOO = 'baz'
(irb):2: warning: already initialized constant FOO
=> "baz"

Is there a way to force Ruby to throw an exception instead of printing a warning?

Awesome: Super Mario Bros. Crossover

by Ben

This has to be one of the coolest things I’ve seen in a while. Such an awesome idea! I think he should have used Link from Zelda II when you get a mushroom, though.

Play the game (requires Flash)

Website Redesign

by Ben

Old design New design

I’ve been working hard on redesigning this site. You can see what it used to look like, above. It’s been a fun ride: I took this opportunity to learn more about HTML5 and CSS3. I’m pleased with what I’ve made. The result of my work is the custom WordPress theme you see now. I learned a lot in redesigning this site (mostly HTML and CSS, but a little PHP too). Over time, I’ll be rolling out some summaries of what I learned in blog posts.

Geek section: As it’s just a personal site, I’ve been experimenting with new HTML5 features and semantic tags, keeping the markup as minimal as possible, and applying visual effects only through CSS. As a result, there are very few images (all the gradients, shadows, rounded corners, and animation are pure CSS3) and the design degrades elegantly for older browsers. It even looks decent in the 9-year-old IE6. I’m preferring the new video and audio tags instead of Flash or other plugins as much as possible. The site even works (and looks) great on my iPhone. HTML5 and CSS3 still have problems, but the future of the web looks bright.

I also took the time to pull together some old content from other sites. There are still some gaps, but there are posts going all the way back to 2002. (I cringe a little reading some of it, but it’s interesting to see how much I have—and haven’t—changed.) Some posts have only been living on a hard drive for the last 8 years, but others have been on other services like Blogger. I’ve done my best to redirect links here.

Please let me know what you think in the comments.

Musicolio

by Ben

Say what you will about Tay Zonday, but his new song Musicolio is pretty catchy. There’s also a free MP3, like normal.

I didn't know it was so cut and dry

by Ben

I mean, the data is probably massaged a little, but still. Look:


Road to Recovery job loss/growth graph

There’s more on the Road to Recovery site.

The Role of Government

by Ben

I originally found this mini-essay on Slashdot, but it seems like it’s been copied and pasted all over the internet. In any case, it’s an insightful rant that made me think about the role of government in our lives.

This morning I was awoken by my alarm clock powered by electricity generated by the public power monopoly regulated by the U.S. Department of Energy. I then took a shower in the clean water provided by a municipal water utility. After that, I turned on the TV to one of the FCC-regulated channels to see what the National Weather Service of the National Oceanographic and Atmospheric Administration determined the weather was going to be like, using satellites designed, built, and launched by the National Aeronautics and Space Administration.

I watched this while eating my breakfast of U.S. Department of Agriculture-inspected food and taking the drugs which have been determined as safe by the U.S. Food and Drug Administration.

At the appropriate time, as regulated by the U.S. Congress and kept accurate by the National Institute of Standards and Technology and the U.S. Naval Observatory, I get into my National Highway Traffic Safety Administration-approved automobile and set out to work on the roads build by the local, state, and federal Departments of Transportation, possibly stopping to purchase additional fuel of a quality level determined by the Environmental Protection Agency, using legal tender issued by the Federal Reserve Bank. On the way out the door I deposit any mail I have to be sent out via the U.S. Postal Service and drop the kids off at the public school.

After spending another day not being maimed or killed at work thanks to the workplace regulations imposed by the Department of Labor and the Occupational Safety and Health administration, enjoying another two meals which again do not kill me because of the USDA, I drive my NHTSA car back home on the DOT roads, to my house which has not burned down in my absence because of the state and local building codes and Fire Marshal’s inspection, and which has not been plundered of all its valuables thanks to the local police department. And then I log on to the internet — which was developed by the Defense Advanced Research Projects Administration and post on Freerepublic.com and Fox News forums about how SOCIALISM in medicine is BAD because the government can’t do anything right.