Politics, Programming and Possibilities
8 Jul
My brother, Dan, and his fiancee Elizabeth came to Provo about a week and a half ago to hang out with us (ok, maybe not just for us… Elizabeth came down to attend a conference).
We went to a music festival in Salt Lake City, and ate at Carrabbas for dinner. We also saw a fire off of I-80 that we caught on video (I mentioned the fire in another blog post). Overall, a fun, fun time! Thanks guys!
Dan & Elizabeth Visit Provo from Duane Johnson on Vimeo.
P.S. Dan made most of the music video while he was here, and I finished it up. He used iMovie HD which, I must say, is soooo much better than the newer iMovie ‘08 (Apple, what the heck are you doing?)
8 Jul
Even though I like development in Rails, I’ve been frustrated at times with the whole Rails deployment rigamarole. The joy of Rails for me, however, comes primarily from its underlying language, Ruby, so I’ve been thinking about ways around Rails.
There are a number of up-and-coming solutions to the problem of deploying Rails, but one of the simplest has been around the longest: eRuby. Basically, this is a way to use Ruby like you would PHP… embedded in HTML files using <%= and %>. Another way to think of it is Rails without controllers.
I recently wrote an eRuby Howto at A Small Orange hosting. The “howto” describes how I set up my shared account.
If you’re interested in an inexpensive hosting solution for Ruby, or if you just want a reliable and friendly hosting solution, may I recommend
A Small Orange? I have had nothing but good experiences with their responsive support department, and I am quite happy with their shared hosting service. I also get a small referral credit if you sign up via one of the links in this blog entry.
I may be writing a little more about simple eRuby solutions to problems in the future.
3 Jul
I’m sure that something like this has made the rounds before, but I’ve recently started to think about what makes code “beautiful” in the same sense that prose can be beautiful. How do you capture another programmer’s attention? What should you avoid if you don’t want your coworkers’ eyes to glaze over when they see your code? In short, what guidelines should we, as programmers, follow if we want our code to be well-received by other programmers?
Here is a short list that I’ve thought of so far. Please feel free to add to or improve on these points. I will probably do the same by updating this list later.
2 Jul
Ok, it’s a little silly… but I really like Firefox.

It’s a certificate that says I successfully downloaded Firefox 3 on Jun 17, 2008, thus helping set a Guinness record for most downloads in a 24 hour period ![]()
The total for the day came to 8,002,530!
29 Jun
While traveling to AA Calister’s (which turned out to be closed on Saturday evenings) Kelty and my brother Dan and I saw a huge fire off of I-80 in Salt Lake City. Since we weren’t actually on the freeway, we had the opportunity to get up close and catch it on camera. Here are some photos. I have some video, too, which I will post soon.

27 Jun
After winning the Republican primary last month, B. J. Lawson is now up against his Democratic rival, Mr. Price, in the general election. We need to give him the resources to win this, and bring another voice of steadfast constitutional government to Congress.
Please join me in supporting B. J.’s bid by donating this Sunday (Jun. 29th) to the Lawson Liberty Fund (i.e. donate via his Lawson for Congress website).
Imagine what power we the people wield if you and I (who have nothing to do with North Carolina) are yet willing to fund this campaign because we know that Liberty upheld over there will affect our own liberty here—in other words, if we are willing to support good women and men unilaterally on principle, rather than on location.
The lobbyists have been unilaterally supporting congressional seats for years—but for profit, not on principle. And now, it’s possible to do something about that, via the internet. We can make a difference, and maybe even reverse the lobbying trend by collectively supporting educated and principled people who know and believe in the constitution. I say, let’s do it!
If you’d like to get to know Lawson and Price a bit, watch the fourth video on the site to see Mr. Price fail to answer the question, “Did you read the bills (Patriot Act, HR 1955 etc.) before you voted in favor of them?” It’s awesome!
Liberty is Priceless!
25 Jun
I signed up for a 2-year Mozy account a little while ago. I like their approach to backup—it’s simple, and automatic. And it’s off-site, so if my office burns down or has things stolen, the data is somewhere else. It’s just the sort of thing I need in order to feel safe about my data being backed up.
The trouble is that this is “theoretically” safe, because I can’t seem to get it to consistently do its job on the Mac. I sent my first experience to Mozy support (their response was “make sure you’re using the latest code”) :
1. I tried backing up my home folder, a total of 70.1 GB. That 11 day process was interrupted when I closed my clamshell laptop.
2. I tried letting it continue, but realized that, actually, I don’t care about *all* of the data for now, I’d much rather know that my *most important* data is backed up. So I reduced the things Mozy should back up to about 300 MB.
3. The process continued to back things up, but paused at about 80% of 300 MB and then said it had been cancelled. I didn’t cancel it, so I’m not sure what caused that.
4. I now have the following message in my “Mozy Backup Status” window: “No successful backups yet. Last backup was cancelled 5 hours ago.”.
5. If I press the “Start Backup” button, it switches to a message that says “Backup in progress… Scanning for files…” and remains in that state indefinitely. The “Total prepared” remains at 0%, the “Total transferred” remains at 0%, and the transfer rate in both cases remains at 0.0 bits/sec.
6. I then went to my online account to see what might be listed there. Under “My Computer” it claims to have stored 268.4 MB of something (whether from the original batch, or the second, or third, I’m not sure).
Eventually, after reducing the backup load to a fraction of what I wanted to backup, it finally went through. Then I slowly increased the backup set to include most of my mission-critical files. I still wish I could backup some of my home videos and/or music collection, but that can wait.
Now, however, things are still not fully satisfactory. Today, Mozy tried to back things up again, and send my CPU into overload as it showed me that it was doing nothing (screencast here, 1 min).

I hope their Mac product is improved in the near future. I may reconsider Mozy as a backup option if not.
23 Jun
P.S. The 1.0 gem is available on rubyforge:
$ sudo gem install rubydoctest
23 Jun
As Dr. Nic mentioned in the comments of a previous post, we’ve updated the Ruby DocTest bundle for TextMate’s syntax highlighting. It’s available at:
http://github.com/drnic/ruby-doctest-tmbundle/tree/master
The syntax highlighting looks like this:

In addition to syntax highlighting, the bundle adds a “command+shift+R” command that will quickly run your current file through the ‘rubydoctest’ tool.
Install the Ruby DocTest TextMate bundle like so:
$ cd ~/Library/Application\ Support/TextMate/
$ cd Bundles
$ git clone http://github.com/drnic/\
ruby-doctest-tmbundle/tree/master Ruby\ DocTest.tmbundle
Reload TextMate, or choose the “Reload Bundles” option in the Bundles->Bundle Editor menu.
The next time you open a ruby (*.rb) document, you’ll need to choose “DocTest (Ruby)” as the file type in the footer of the window.
21 Jun
Ruby DocTest hits 1.0 today. I’ve done a lot of testing and work with the project. Tom Locke and Dr. Nic have been very helpful in getting this off the ground and in relaying information.
Also, a special thanks to Roger Pack for linking his version of doctest to the new project. (Well, I think it’s linked to the project… but I can’t find the link right now).
There should be a gem up on RubyForge soon.