Page 2 of 36

Previous page

My first attempt at a mobile web app

German-English Dictionary Web App
Is this thing on? So it’s been a forever since I’ve blogged, but we’ll see if I still can. Happy Thanksgiving at least! Anyway, I’ve been wanting to build stuff for my iPhone. While I’ve been experimenting with Objective C for a native app, I wanted to actually build and publish something. So I have abandoned my Objective C code snippets for now and decided to go with things I know and build a Ruby on Rails site. There are various libraries to let you style a site for mobile browsers. I went with jQTouch, which is covered pretty well by these Railscasts and Peepcode screencasts. I like using the German-English dictionary site Beolingus, but I wanted to use it more easily on my iPhone. It turns out the data is downloadable, so I decided to build a web application with mobile front-end. Here it is:

Denglisch (that’s a term for English and German mixed together) I really wanted to build the site in Rails 3, but most of my stuff is hosted on Dreamhost, and I’ve read about various problem getting those apps running right now. So it’s done in Rails 2.3.10 instead. The Rails side is pretty simple, just one model for the data, a rake script to import the textfile into the database, one controller and two actions. Then there’s a little bit of jQuery Javascript code to handle the Ajax form submission.

Home Screen Icon
I knew how to do a lot of these bits, but I learned things along the way too. For one, I didn’t know that the iPhone could make a native-looking app out of a website. The website can include icons and a splash screen, and when you add the bookmark to your home screen, the icon will show up there. The splash screen shows up when the website is loading, and then the web app uses the full screen without the Safari toolbars. Cool. I found jQTouch to be fairly easy to use, but the download from their home page is a good bit older than the code they have on Github. I ran into an issue with the latest version that I had to look for a solution from the bug list. They don’t have much documentation either. The Peepcode screencast was very helpful, but it isn’t free, and jQTouch has changed a bit since it was published (e.g. the new “jqt” div).

Anyway, I’ve tested this on my iPhone…I’m curious to hear if it works for the iPad and other mobile devices. It was a good hobby project anyway. Have fun!

Update 2016-01-17: I eventually rewrote this code with Sinatra instead of Rails. I stopped hosting either version, but here’s the Sinatra-based source code.

Time on the Trail

Mike on the Trail

So, back in April, my friend Rusty, his brother, and I tackled a section of trails in Great Smoky Mountains National Park. It was the same trail Rusty and I had started in 2006 but turned back due to a severe weather forecast. So we were eager to “finish the job” and see what there was to see. And we did. I wrote a long post about it which I never finished (the pictures are here though). But I wanted to get something up here. You see, our route took us along part of the Appalachian Trail, and we encountered several groups of “thru-hikers” intent on hiking the entire 2,000+ mile trail. Each had already hiked more than 200 miles from the beginning in Georgia. Among those I talked with, I met two women from Massachusetts. Each had decided to hike the trail separately but had teamed up. “Mother Nature’s Daughter” and “K-Bar” are both blogging. So I wanted to link to their blogs here, as they are both in Maine now and should be finished with the entire AT soon. They hike faster than I can blog, apparently. :)

  • MND’s blog — she is hiking to raise money to fight MS…maybe you could contribute a few dollars since she has walked over 2,000 miles!
  • K-Bar’s Blog

Best wishes to both of these ladies and maybe someday I’ll get to tackle the whole trail myself!

Columbia Open Chess Tournament

This was my first real chess tournament.


Greenwood Chess Simul

Last night was the Greenwood Chess Simul exhibition and my first time participating in one. The SC Chess Association had arranged for chess Grand Master Gregory Kaidanov to play exhibitions in four cities.

We didn’t have a huge turnout in Greenwood, maybe 15 players and a small crowd of spectators. This allowed the GM to play quickly and it seemed like every time I looked up, he was coming around for another move. I think everyone would have played better with a little more time to think. I was amazed when two of the Greenwood club’s strongest players were out quickly. I somehow managed to hang on for a few more minutes but was just as soundly defeated. A few more guys hung on for a little longer, but the simul was over quickly. Here is my game for your enjoyment.

  1. Nf3 d5
  2. d4 Nf6
  3. c4 e6
  4. Nc3 Bb4
  5. Bg5 Bxc3+
  6. bxc3 O-O
  7. e3 b6
  8. Bd3 Ba6
  9. cxd5 Bxd3
  10. Qxd3 Qxd5
  11. Bxf6 gxf6
  12. e4 Qh5
  13. O-O Rd8
  14. Qe3 Nc6
  15. Rfe1 e5
  16. h3 Rd7
  17. d5 Ne7
  18. Nh2 Rad8
  19. Ng4 Rd6
  20. c4 f5
  21. exf5 Nxf5
  22. Qxe5 Kf8
  23. Qh8#

In retrospect I wish I had moved 8…Bb7 instead, but I’m sure there are plenty of other mistakes in my moves.

As if the regular simul event wasn’t fast enough, it was followed by a couple rounds of speed chess, 5 minutes per side, with the GM playing four simultaneously. I still had nearly 90 seconds on my clock when I was checkmated.

The coolest part of the exhibition was the “blindfold” game. The GM sat facing away from the board and each player called out moves. Despite drawing one of the better Greenwood players, the GM made quick work of him. It’s amazing to be able to keep track of the entire game in your head.

I really enjoyed the event and want to thank Mr. Kaidanov for taking the time to come to Greenwood.

One of those Non-descriptive Errors

This one stumped me for a while today. I had an application to deploy which worked fine in development. Deploying to production led to this error:

/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.5/lib/activesupport/dependencies.rb:249:in `loadmissingconstant’: Expected /myapp/releases/20090617160914/app/models/widget.rb to define Widget (LoadError)

Googling that error turned up lots of pages for Rails 1.2.x and issues with underscores in names. None of it applied. Widget was definitely being defined in widget.rb. Following the stack trace it appeared that the error was thrown in the Ultrasphinx plugin. After trying a lot of other things, I decided to comment out the Ultrasphinx code in the model and retry. The error changed to this, which was helpful:

Errno::EACCES: Permission denied - /myapp/releases/20090617160914/public/widget/myfile

This model was also using the file
column plugin, and the underlying error was just a permissions problem in the file attachment target directory. I fixed the permissions and put the Ultrasphinx code back in the model, and all was happy. If only that permissions error had shown up first!

Next page