Archive for the 'Code' Category

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 [...]

More JRuby Play: JFreeChart

Thursday, April 12th, 2007

I’ve been messing around at work trying to make some automated scheduling charts (basically Gantt-like) in Ruby. I’ve implemented it a couple of times using SVG::Graph, which is close to what I need, but I end up having to rewrite a lot of methods whenever I really start using it. It occurred to me today [...]

Jane Street Capital Is On To Me

Monday, March 26th, 2007

If you search for the right strings, you’ve probably already seen the Jane Street Capital ads for OCaml programmers in Gmail or elsewhere, but today I got a new one that really cracked me up:

I’ll even link to the ad because it was so funny… and I do think in closures, and you certainly got [...]

“Literate” Programming, Technical Writing

Friday, March 16th, 2007

There’s been some recent discussion on ruby-talk about “literate” programming after the new O’Reilly title Beautiful Code was announced (Matz has written an essay for it). Matz’s response made me listen to all-things-Knuth, so I was pleased to read Philip Wadler’s post today on Three ways to improve your writing, which includes a PDF link [...]

Borrowing Java’s XSLT Support for Ruby

Friday, March 2nd, 2007

Well, I finally caught up with the crowd and got JRuby running on one of my dev boxes. The reason I’d been interested in it from the getgo was because Ruby lacks any support for internal XSLT processing. All those system()s were starting to get me down, especially as I’m trying to get a DocBook->PDF [...]

Exploiting FrameMaker MIF as XML, Reading Bookfiles

Sunday, February 25th, 2007

[Read this for an introduction to what I'm talking about].
Now that we’ve got our FrameMaker documents in XML, how can we exploit their new format? One of the first things I did was to create new ways of reading (eventually changing) the simple data stored within them. This isn’t all that earth-shattering, but when you [...]

Ruby and the Atom Publishing Protocol

Saturday, February 24th, 2007

I gave a short talk at the first North Bay Ruby Users Group last Thursday (Feb 15, 2007) about my recent work implementing an Atom Publishing Protocol library in Ruby. Here’s the presentation:

Language Designers Should Listen to Psychologists

Saturday, February 10th, 2007

There are a ton of interesting take-aways from The
Landscape of Parallel Computing Research: A View from Berkeley, a nice, readable introduction to what a multidisciplinary
group of Berkeley researchers think might be the future of parallel computing. I’d like to share just one that really got me thinking (from page 35):
It is striking, however, that research [...]

Exploiting FrameMaker MIF as XML, Back into MIF

Saturday, February 3rd, 2007

[Read this for an introduction to what I'm talking about].
The first step of doing anything useful with MX is the ability to get back out into MIF. Thankfully, this is an entirely trivial job in XSLT.
[This code thanks to my boss, Andrew Savikas.]

<?xml version=”1.0″?>
<xsl:stylesheet version=”1.0″
xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”>
<!– author: Andrew Savikas, O’Reilly Media –>

[...]