the two halves of my tasty brain

Learn You a Haskell for Great Good

To be completely honest, I’m not much of a reader. My reading speed lies somewhere between “painfully slow” and “potentially illiterate,” so reading fiction, in particular, is more chore than hobby. I love works of reference when they have well constructed indices or, better yet, hyperlinks between related topics — my bookshelves and wikipedia usage can attest to this. I’m also fascinated with “meta-reading” fiction, where I read summaries, critiques and so forth of some work to gain insights into what it’s all about, but without reading the actual source material. This fascination is probably the only reason I didn’t fail every high school English class. The point of this, which I’m dangerously close to completely losing, is that my thoughts on a book are generally not of much use to anyone else.

Terrible Ideas

While lurking on the #ruby-lang channel on, oddmund suggested creating a method_missing handler that would “auto-correct” misspelled method. His suggestion was of course a joke, but it was a pretty good one, so he implemented it. I provided my own implementation, along with some other terrible ideas.

Bayesian Classification

After using the classifier I originally laid out in this post, I discovered that my method of calculating was very flawed. I have made the appropriate revisions.

The Un-Ruby

A follow up to Properties of Code: Functional Complexity is coming. It’s much less “mathy” than its predecessor but serves as a jumping off point for the next in the series. However, there is something that has been nagging at me after watching some of the talks at this year’s RailsConf. It’s a ubiquitous and seemingly trivial thing, but it bothers the hell out of me: ActiveSupport::Concern.

Let's Get Wonky!

So, the email I (and scads of other people) got from Slicehost the other day was pretty uninformative, referenced a “forum” for continuing the conversation and didn’t link to it, and did very little to ease many of the anxieties it raised. After determining that the email (with a Rack Space letter head) was referring to the Slicehost forum, I spent some time reading up on the coming changes, and was underwhelmed. There’s a lot of re-assurances, a fair bit of hand-waving and talk of everything moving to the Rack Space Cloud. Clouds are grand, what with their puffy and ephemeral qualities, but I’m just after simple web hosting. This site uses almost no real bandwidth (a testament to my inability or un-desire to actually engage an audience) and serves up static HTML. My requirements are pretty minimal. I really don’t need the ability to dynamically add instances to handle the load.

A Thought on Books in the Cloud

Suppose we want to create a service that allows authors to upload digital books to be stored in “the cloud.” Let’s also suppose that each book weighs in at 5 Mb, on average. We also want to compile some meta-data for each book so we can categorize an author’s library, select an excerpt from each book to serve as a good summary of its topic, and expose an author to others who write about similar subjects. Finally, let’s suppose that we have attracted the attention of scads of prolific authors, perhaps a million authors each having a hundred books to their name. Assuming no duplicates, we’re looking at about 475 Tb of data that need stored and processed.

Hello, Jekyll

I had been pretty happy using Enki to drive this site. It’s minimal but sufficient, and very easy to tweak. However, one of Enki’s major design decisions drove me into the loving arms of Jekyll: the use of OpenID for authentication. To be fair, I’m mostly pissed at myOpenID, which has failed to authenticate me several times over the last few months and today appears to have lost my account entirely (sort of.) Nonetheless, Enki relies on OpenID for authentication, and myOpenID divorced me, took the kids, and sold my house.

Stomper 2.1.maybe?

After a significant re-tooling of Stomper’s IO handling, I’ve got something that seems very fast and very stable, using non-blocking IO.


Every post I make to the stomp-spec group that isn’t a “+1” or “me, too!” is often followed up with a thought of “you’re a moron” about 10 minutes later. I’m going to improve this situation by spending some time hashing out my thoughts here, and if they still look good a couple hours later, then I’ll post them.

Quirks of Array#each

I’m probably just late to the party, but at least with Ruby 1.8.7 and 1.9.2, there’s nothing special that has to be done for each of these examples to produce the same output:

mathlib Found

Roughly 5-6 years ago, I made an effort to take Fractal rendering code I developed during college and refactor it into a general purpose Java library, mathlib.jar. A hard drive failure and desktop replacement later, and I had assumed that code was lost. In fact, I seem to recall a fight between my former wife and I over the matter, but at any rate, it appears I was wrong.

Mandelbrot Sets in Javascript

I’m a big fan of fractals. From Lindenmayer Systems to variations on the Mandelbrot set, they all have a special place in a statistically self-similar region of my brain. Archimedes can keep his circles, I’ll stick with the striking complexity of chaos. Given this mild obsession, it should not come as surprise that one of the first applications I enjoy making when working with a new GUI environment is a fractal generator. With the addition of Web Workers and programmatic drawing via <canvas> elements in modern JS implementations, I find the past repeating itself with affine self-similarity.

pg gem on OS X

After PostgreSQL has been installed with ports, pg_config and other tools can be found in "/opt/local/lib/postgresql84/bin". Add this path to $PATH and set ARCHFLAGS="-arch x86_64".

OpenSSL in Ruby

The following code assumes that there is a subdirectory named certs containing known certificates in PEM format, and a subdir keys containing the client’s private RSA key. Further, there are lots of comments specific to my actual needs, namely exporting keys generated in Java using keytool for an Apache ActiveMQ message broker. Lastly, to use the ca_path method, the certs directory needs to be properly indexed using c_rehash (make sure the underlying version of openssl matches the version Ruby’s OpenSSL extension was built against, otherwise the hash algorithm may not be the same.)