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 October, 2013. Clear

CISCO Announce New Open Source H.264 Codec

by Ben

CISCO Announce New Open Source H.264 Codec | OMG! Ubuntu!.

Not sure of the implications of this… but it sounds like a good thing for Firefox at least.

Programming Language: Objective CorporateSpeak++ – Floopsy’s Sketchpad

by Ben

Programming Language: Objective CorporateSpeak++ – Floopsy’s Sketchpad.

Business speak and programming languages, mixed together…   Funny if you’ve ever spent time in either world..

From the page:

Inspired by the constant corporate speak I have had the pleasure of hearing, I have undertaken the arduos task of developing the next generation of programming language:

Objective CorporateSpeak++

In this essay, I will demonstrate the usage of some of the programming idioms:

Classes

Value-Added Class Foo {
  Private Value-Added String Name;

  Public Mission Critical Function sayName( Value-Added String Name) {
    System.Out_of_The_Box.Println(“Hello {}”, Name)
  }
}

More examples at the link.

Responsibility-centric vs. data-centric design

by Ben

Issue 4.11: Responsibility-centric vs. data-centric design – Practicing Ruby.

A good read; got me thinking about how we should structure our coming projects.  However, my feeling is that in a Rails app, a hybrid approach seems to work well… leave persistence and querying to ActiveRecord objects, and use services in the way this article suggests.

fastdom

by Ben

wilsonpage/fastdom.

Eliminates layout thrashing by batching DOM read/write operations

Snowden Offers to Fix Healthcare.gov

by Ben

Snowden Offers to Fix Healthcare.gov : The New Yorker.

I haven’t seen the slowdown with with healthcare.gov, but this is pretty funny.

Hacker Typer

by Ben

Hacker Typer.

Type code like you’re in a movie!

Ruby QuickRef

by Ben

Ruby QuickRef | zenspider.com by ryan davis.

Cheatsheet for Ruby, including exception hierarchy and lesser used features.

Fewer Federal Register updates than normal because of government shutdown

by Ben

Just as proof that the government shutdown does have an affect, this is a problem we ran into today.

From the GitHub issue I opened:

We noticed the Federal Register was giving us fewer results than normal. At first we thought it was a problem with our code… but it’s actually because of the government shutdown. There are only updates that “address imminent threats to the safety of human life or protection of property” — which would seem to explain the issue.

Full text of a banner on the Federal Register site:

Due to an appropriations lapse, the Office of the Federal Register (OFR) is not updating this site. OFR is publishing documents in the daily Federal Register that are directly related to the performance of governmental functions necessary to address imminent threats to the safety of human life or protection of property. You can view those documents on FDSys. You can read more about OFR services in our blog post.

I’m opening a GitHub issue for this “known issue” in the hope that it will help another user of the federal_registergem. It can/should be closed after this mess is over.

Superclass mismatch when inheriting from Struct.new

by Ben

We recently ran into an error that took a little thought:

TypeError: superclass mismatch for class FooJob

Specifically, FooJob was a DelayedJob custom job class. Unfortunately, DelayedJob had recommended a structure like this:

class FooJob < Struct.new(:bar, :baz)
  def perform
    # ...
  end
end

When this class was required more than once, it gave us our TypeError. (I think it was loaded from two different paths.) Although the two structs made by Struct.new were created with the same arguments, they're actually different objects, hence the superclass mismatch.

Moral of the story: you should never inherit from Struct! Do this instead:

FooJob = Struct.new(:bar, :baz) do
  def perform
    # ...
  end
end

After that change, our TypeError went away. Good to know!

Update: I submitted a pull request to hopefully prevent other people from falling into this same trap.

Reactions

Node.js-based Ghost blogging platform

by Ben

Ars Technica user chocoruacal wrote this comment for Node.js-based Ghost blogging platform opens to the public:

and what’s so special about it?

It’s trendy. You get a heightened sense of self-satisfaction knowing that your tiny blog is served by Node.js and written in Markdown. I cloned the repo and within minutes found myself bearded, in a coffee shop, listening to music that hasn’t even been released yet.

Quite possibly one of the best comments on tech-trendiness ever.