Archive for the 'Ruby' Category

For heaven’s sake, please just install hoe!

Thursday, February 21st, 2008

This is why people get annoyed about the silly gem install dependency mess (esp WRT hoe):
$ gem install heckle
Need to update 31 gems from http://gems.rubyforge.org # fair enough, you’re allowed
………………………….
complete
Install required dependency ruby2ruby? [Yn] Y # Yeah, I know you need these
Install required dependency ParseTree? [Yn] Y [...]

ISBN10 to ISBN13

Thursday, January 24th, 2008

As of the beginning of 2007, ISBN10 is dead. Now we’re in a world that allows “979″ prefixes, though the following code doesn’t expect them yet…
Here’s some stuff to turn your 10-digit ISBNs into 13-digit ISBNs, naively assuming “978″, following an the API post doing the same from LibraryThing. There’s another one at isbn.org for [...]

RubyConf 2007 Second Day Afternoon

Saturday, November 3rd, 2007

Ed Borasky: Profiling and Tuning Ruby 1.8
Slides are available here. Cougar is the name of the project that this is coming from?
Is Ruby 1.8 Slow?
To benchmark: Collect a set of benchmark times, then normalize them, then compute the geometric mean of the ratios.
Alioth is a popular (if controversial) set of benchmarks. Using gcc as the [...]

RubyConf 2007 Second Day Morning

Saturday, November 3rd, 2007

John Lam: State of IronRuby

Photo by dwortlehock
Who works on IronRuby? The core is: John Lam, Hiabo Luo, Tomas Matousek, & John Messerly.
Why did John move from Toronto to Seattle to start working at Microsoft on IronRuby? He was in love with RubyCLR and couldn’t turn down the opportunity to work on a “real” implementation.
Goals
John [...]

RubyConf 2007 First Day Afternoon

Friday, November 2nd, 2007

Nathaniel Talbott: Why Camping Matters
“I don’t know about you, but I am totally psyched about this conference!” Nathaniel has spoken at every RubyConf.

Photo by laurafries.com
Every talk needs a metaphor, and this talk’s will be the bacon, egg, and cheese biscuit.
Bacon
The bacon is the connection to the creator, and to chunky bacon. It’s a 4k [...]

RubyConf 2007 First Day Morning

Friday, November 2nd, 2007

I’m at RubyConf 2007 for the next few days. Here’s a stream-of-consciousness blog of the first morning’s talks. Apparently there will eventually be video of the talks online.

Photo by jremsikjr

David Black kicks it off
This year is bigger than ever, with attendance 15 times greater than the first one in 2001. New tracks have been added [...]

More Clever GMail Ads for Programmers

Tuesday, July 10th, 2007

Just like the folks from Jane Street Capital, Swivel really knows how to write good, eye-catching ad copy (for some crazy subset of the population):

JRuby + Jetty

Wednesday, June 6th, 2007

I finally figured out how to get JRuby to serve a Jetty servlet today (thanks to Charles). The key was flipping what I’d been trying to do for a while (getting Jetty to run JRuby). Here’s code that implements the AbstractHandler interface pretty trivially:
$ cat jetty_example.jrb
require ‘java’
include_class ‘javax.servlet.ServletException’
include_class ‘javax.servlet.http.HttpServlet’
include_class ‘javax.servlet.http.HttpServletRequest’
include_class ‘javax.servlet.http.HttpServletResponse’

include_class ‘org.mortbay.jetty.Server’
include_class ‘org.mortbay.jetty.servlet.Context’
include_class ‘org.mortbay.jetty.servlet.ServletHolder’
include_class ‘org.mortbay.jetty.handler.AbstractHandler’

class [...]

The Code Behind DocBook Elements in the Wild

Tuesday, May 1st, 2007

[UPDATE: Added a link to the categorized CSV file below]
Here’s some of the nitty-gritty behind DocBook Elements in the Wild. We’re trying to get a count of all of the element names in a set of 49 DocBook 4.4 <book>s.
First, go ask the O’Reilly product database for all the books that were sent to the [...]

JRuby + JFreeChart = Sparklines

Friday, April 13th, 2007

Inspired by how easy it was to get JFreeChart working and some code from former colleague Andrew Bruno, I thought it’d be nice to write some JRuby to generate Edward Tufte’s Sparklines.
Here’s some simple example code on a semi-random dataset:

# Mostly inspired by
# http://left.subtree.org/2007/01/15/creating-sparklines-with-jfreechart/
# have JFreeChart in your classpath, obviously, as well [...]