10 years in NC

Exactly one decade ago, my family and I spent the 4th of July watching fireworks from an airplane as we flew across the USA from San Francisco to our new home in Cary, NC. We had moved here from Minnesota first in 1998, and although we enjoyed it very much, by late 1999, the lure of the Bay Area was irresistible for me as a software engineer. Recruiters were hounding me daily with promises of stock options that would allow me to retire in 4 years. A few trips to San Jose and I was hooked. So off we went to California, with our 3 babies in tow.

An exhaustive search of every neighborhood in commutable distance of downtown San Francisco resulted in the purchase of a home in lovely San Rafael. At the time, we thought the place was way overpriced, but to our amazement, our home’s value continued to increase during the next 6 years, while my salary dropped and job prospects in the North Bay dwindled. When a job offer came through that would allow us to move back to Raleigh, we decided it was time to head back to NC.

10 years later, I am pleased to say that I have absolutely no regrets about that decision. Our 6 year stay in the Bay taught us that indoor space is more important to us than outdoor space. Before the move, I was worried about our kids growing up with a lack of diversity, but our neighborhood turned out to be a veritable United Nations. I was also worried that I might have a hard time finding opportunities for music-making, but my cup runneth over with great venues like C Grace and the Beyu Cafe, amazingly talented musicians, and appreciative audiences. The rapid influx of people from all over the country and the world has made the Triangle an incredibly dynamic and exciting place to live. The renaissance of downtown Durham and Raleigh has been wonderful to experience and participate in.

Despite the politically conservative state government, with its world-famous reputation for passing stupid, hateful laws, North Carolina has been a great place to call home. Given that our boys have both chosen to go to college here (did I mention the great schools?), it looks like we’ll be around for a while longer.

Notes on shopping for a digital piano

This holiday season, my mom decided to start playing piano again after nearly 50 years! (Good for you, Mom!!)

I was naturally enlisted to help with this process.

My parents are snowbirds, and wanted a keyboard they could easily transport between their winter and summer homes. This ruled out an acoustic piano, which I always recommend to my piano students. Despite many major advances in digital keyboard technology, there is no substitute for the rich, vibrant sounds provided by even a cheap acoustic piano. The resonance with the other strings and the sound board are extremely complex. Also, the action of piano keyboard is very sensitive to the touch, and the interaction with this mechanism with a physical string results in tremendous variations in color, which few electronic keyboards can come even close to emulating.

My mom also wanted a keyboard she could plug headphones into so her playing wouldn’t bother my dad. I decided not to press the issue and began searching for deals on an electric keyboard.

After a fairly exhaustive Google search, we settled on a Casio CDP-130. We went to the local Guitar Center and tried all of the pianos they had on display. The Casio had the best sound for under $500. The $100 cheaper Williams Allegro we tried sounded terrible in comparison. The Casio Privia ($600) sounded even better than the CDP, but not quite worth $200 more. The CDP had the weighted keys and the sound we wanted, without the bells and whistles we didn’t need. We did have to buy a stand and a bench, but for around $500 total my mom is very happy.

I’d recommend to anyone looking for a digital piano that they go to a store like Guitar Center and actually compare the instruments. The feel of the keys and the sound are the most important features by far. Don’t just get the cheapest thing you can find. In my experience, most people who buy a cheap keyboard with a poor sound and without weighted keys never play it and quickly abandon their aspirations of learning to play the instrument.

Reflections on RubyConf 2013

Last weekend I had the great privilege of attending RubyConf 2013 with a few of my co-workers from RentPath.

This was the first major software development conference I’ve attended in many years. It was a great opportunity to meet the luminaries of the Ruby development community, including “Matz” himself (Yukihiro Matsumoto, the creator of Ruby).

The presentations ranged from fairly technical (details about new features and performance improvements in Ruby 2.1) to mildly entertaining (11 year old Katie Hagerty sharing her experiences with KidsRuby). Some highlights for me were Luca Bonmassar’s overview of Elasticsearch, Michael Fairly’s rapid game prototyping demo (writing a working Pong implementation using Gosu before our eyes in 15 minutes), and Ernie Miller’s talk entitled “That’s Not Very Ruby of You”. It was very inspiring to be around so many smart and talented developers.

The conference was very well organized and well run. The sessions started and ended on time, free hot Starbucks coffee was always available, and the A/V systems worked flawlessly. The free lunches provided were quite tasty. My only complaint was that there was no food provided for breakfast; some simple bagels or muffins would have been great, especially since the only alternative available at the gorgeous, swank Loews hotel was a $30 breakfast buffet. But really, that’s the only thing I can think of that the organizers could have done to improve the experience.

I will say that a few of the presentations seemed a bit under-prepared. In particular, when presenting code examples in a very large space, some presenters did not take font sizes into account. I was a little confused by the choice to let young Katie Hagerty have a keynote spot for a full half hour on Saturday morning. As adorable as she is – and while I think it’s totally awesome that she’s learning to code – I would have preferred something with a bit more substance. (Why not get the creators of KidsRuby up there as well, for example?)

Based on what I saw at this conference, I think Ruby is entering the “awkward teenage” phase of its lifecycle. No longer the “cute new kid” on the block, it’s experiencing growing pains, and some insecurity. The Ruby community is starting to learn lessons from more mature technologies (e.g. metaprogramming is bad, ‘mkay? Garbage Collection is important… etc. ) At the same time, lots of great companies are adopting it and job opportunities are plentiful. It’s an interesting time to be a rubyist!

Come and get your Micro-blues!

The band is warming up as you and your sweetie take your seats at the bar. You order a couple of local beers and kick back as the band launches into their set. You feel your cares melt away as the sweet strains of Muddy Waters wash over you like a cool Mississippi rain. You join the other couples on the dance floor, and the band takes another chorus so you and your friends (some new, some old) can dance your troubles away.

The experience of enjoying live, local music is just like a good micro-brew. Unlike the corporate, mass-produced, pre-recorded stuff you hear on the radio, live music is produced especially for you, in the moment, with loving attention by people who do it because they love it. Just like a good local beer, live local music taps into the creative juices flowing through your community. Get out and enjoy some tonight!

Why Rails isn’t “just another web framework”

I recently heard a software engineering director candidate with many years of web development experience describe Ruby on Rails as “just another web framework”.

That’s what I thought too, until I spent some time working with it over the past 8 months.

The fact is, Rails is much more than that. It is a radical paradigm shift away from both the bloated, configuration-based methods of J2EE and the chaotic hackfest that is PHP.

Here are my top 3 reasons why I think Rails sets itself apart:

– The ActiveRecord ORM. This is the first ORM I’ve worked with since NeXT’s Enterprise Object Framework that really lives up to the promise of ORM’s, and does so with minimal configuration and fuss.

– Terseness. The syntax of Ruby on Rails applications is remarkably terse. It can be a bit daunting at first, but after a while you begin to realize what a huge cognitive win this is. Getting rid of all that unnecessary syntactical noise makes it much easier to focus on solving problems.

– Gems. The eco-system of 3rd party components for rails in unlike anything I’ve ever seen in any development community. There are some truly remarkable gems, such as this one for authenticaion, or this one for creating seed data for your project. The time savings these gems provide cannot be overstated. And it’s fascinating to watch how the Rails community seems to converge on certain gems, which become almost part of the “standard”.

Rails is making web development fun again. I’m so glad I jumped in the pool – the water’s fine!



Ruby script for extracting email addresses from a text file

Here’s a handy Ruby script I wrote a few months ago to extract email addresses from a blob of text.

In this case, all of the email addresses are surrounded by angle-brackets, so that makes the script much easier.

It’s kind of trivial, but a nice little example of the elegance of Ruby:

#!/usr/bin/ruby -w
IO.foreach("data.txt") {|line|
    line.scan(/<.*?@.*?>/).each{|addr|puts(addr.delete('<>') + "\n")}

The Return of the Blog!

I shut down my blog about two years ago for a number of reasons.

However, now that I find myself working for Federated Media Publishing, a company that specializes in helping bloggers monetize their web sites, I thought it would be a good idea to fire it back up again. We’re doing some interesting integrations with WordPress, so if nothing else I figured it wouldn’t hurt to re-familiarize myself with WordPress.

You won’t find much here about my personal life though. For that, you’ll have to friend me on Facebook or, better yet, come to one of my gigs! 🙂

WordPress Upgrade Hell

My blog was starting to have major problems recently – most notably, Akismet stopped working, and the spammers were getting through again. I tried to upgrade WordPress, but my database was out of date.

So I finally bit the bullet and did a clean install of the version of WordPress supported by my hosting service, and began the painful process of converting my data to the new version.

I’m in the process of restoring things (my user table for example). So if you want to leave a comment before that happens, you might have to sign up again. Very sorry for the inconvenience!

How to Read ExtJS documentation

I’ve been working with ExtJS now for about 7 months. It’s an amazing library for building Rich Internet Applications in Javascript, arguably the best available. However, as I’ve blogged about previously, the API is so huge and rich that it can be hard to find what you’re looking for.

For example, here’s a problem I ran into today:

– I note that a long field label is wrapping and would like to fix this.
– checking the code, I see this is an Ext.form.Textfield inside an Ext.form.FormPanel
– using Firebug I see it has a width of 100px. I verify that setting it to 200px fixes the wrapping issue.
– I check the Ext.form.Textfield docs.* No obvious way to set the width of the fieldLabel.
– try setting autoWidth: true on the Textfield. no change.
– try setting grow: true on the Textfield. no change. although not specified in the docs, these properties seem to apply to the field only, not its label.
– try google: “Ext.form.Textfield change fieldLabel width”
– found forum post that refers to the “labelWidth” property of Ext.form.FormPanel. Voila!

*Here is where I made my mistake. I assumed Ext.form.Textfield would contain the property to control its labelWidth, but it was actually the FormPanel that controls this for all of its elements. This is a common pattern with ExtJS – if the property you’re looking for isn’t on the object you expect, check its “container” object.

Of course I still don’t know how to override the labelWidth for a specific TextField, but I’m sure it’s in there somewhere…