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 January, 2014. Clear

count_by in Ruby

by Ben

This is just a simple addition to Ruby’s Enumerable that both Dan Bernier and I agreed should be a part of Ruby’s standard library.

# count_by.rb
# License: MIT
# 
# Authors: Benjamin Oakes, Dan Bernier

module Enumerable
  def count_by(&block)
    group_by(&block).map { |criteria, group| [criteria, group.count] }
  end
end

require 'minitest/spec'
require 'minitest/autorun'

describe 'count_by' do
  it 'counts the groups' do
    counts = %w(a b b c d d e e e e).count_by { |s| s }
    assert_equal(counts, [["a", 1], ["b", 2], ["c", 1], ["d", 2], ["e", 4]])
  end
end

KnightOS – An open source OS for TI calculators

by Ben

KnightOS – An open source OS for TI calculators.

terminal

This seems like a strange thing to appear in 2014… an open source OS for TI calculators, including the 83-plus that I used in high school.  It’s kind of amazing that this could even be created, but also a little disappointing that calculators have barely changed.  (I get the standardized-testing angle but… those black-and-white displays look like they’re a million years old.)

And of course, there’s a relevant XKCD:

How Should This Work?

by Ben

One day, I had an epiphany. When making a change, rather than surveying the current landscape and asking “How can I make this work like I need?”, take a step back, look at each relevant abstraction and ask, “How should this work?”.

via How Should This Work? – Code Climate Blog.

What we can learn from dialect maps

by Ben

What we can learn from dialect maps – Boing Boing.

I always find this sort of thing fascinating.

A Huge List of Free Programming Books

by Ben

A Huge List of Free Programming Books.

Lots of topics. Not all are suitable for offline- or tablet-reading (web-only). Many PDFs are marked with “(PDF)”.

Podcast URL Extractor

by Ben

Podcast URL Extractor.

Extracts RSS URLs from iTunes Store URLs. Useful if you’re using something other than iTunes to download podcasts.