Using the Apple remote in Ruby

After playing with iremoted and Ruby’s IO.popen I guess I am convinced that Ruby really works as a glue on many levels. So, using iremoted and capture Apple remote commands in the terminal it is trivial to use the remote to control a Ruby application. Of course, calling OS commands isn’t limited to Ruby. Here is a minimal dungeon game which you control with the apple remote. If you ever manage to find your way out I would be surprised…...

February 5, 2007 · Peter Krantz

Making open-uri play nice with HTTPS and expired certificates

I was using the open-uri library to download HTML in an accessibility test when I found that it does not work well when the remote site has an expired certificate. In this case open-uri will throw a “certificate expired” exception. This may be ok as a default behaviour, but there is no option to override the check. Fortunately you can easily change the behaviour by editing the open-uri source. If you are on Windows it is available in C:\ruby\lib\ruby\1....

January 27, 2007 · Peter Krantz

Fixing Overscan Issues for the Mac Mini Mediacenter

I have been running a Mac Mini (Core Duo 1.66) as a media center since I got it at RailsConf last June. Following advice from a friend I invested in a DVI to HDMI cable to hook it up to our Sony LCD TV. This actually improved the image quality noticeably. However, like everyone else using the same setup I was annoyed with the overscan issue. Overscan makes the OS X menu bar fall outside of the visible area of the screen....

January 17, 2007 · Peter Krantz

Staying Up-to-date With Technology During Parental Leave

So, after Christmas and New Year’s Eve I am on parental leave until October 2007. Nine months is a long time in the technology industry so I am planning some projects to keep up-to-date. My project list is getting longer every day but for some reason no-one is taking it seriously. My wife tells me I should be happy if I manage to read the morning paper while taking care of our son…...

December 23, 2006 · Peter Krantz

Bigger Screens for the Glorious Benefit of Productivity!

I have been seeing more and more information on how bigger screens increase productivity of software developers (or professional computer users in general). The latest entry is by Martin Fowler in “How do you improve the productivity of software developers?”: I used to raise eyebrows fifteen years ago by recommending that every developer should work on a 21 inch screen. These days I say that everyone should have at least two 20 inch screens....

December 17, 2006 · Peter Krantz

Professor Saves Newbie Programmers From Shame

“Error: division by zero” is a commonly seen error for inexperienced programmers. The BBC reports that Dr. James Anderson, of the University of Reading, has finally conquered the problem of dividing by zero. His new number, which he calls “nullity” solves the 1200 year old problem that niether Newton nor Pythagoras could solve, the problem of zero to the zero power.

December 7, 2006 · Peter Krantz

Things I miss in Apple's Front Row

I have been using a Mac Mini as a media center since I got it when attending RailsConf in Chicago this summer. Together with the Logitech Z-5500 speakers it is working great. I have taken the time to digitize the entire CD collection into iTunes and we store the family photos in iPhoto. The computer is accessed via Front Row and has no keyboard or mouse hooked up to it. In fact, it is sitting behind a curtain out of sight from the preying eyes of greasy toddlers....

October 27, 2006 · Peter Krantz

The Ideal VIM Keyboard

My colleague Niklas nagged me for not having disabled the caps lock key on my MacBook Pro. I was a bit disoriented at first but coming to think of it, I haven’t used the caps lock key since I got the MBP back in April. This made me think about which keys I actually use. Being a recent VIM convert I wonder if Apple’s designers hate VIM. Efficient editing in VIM require you to use the escape key a lot....

October 26, 2006 · Peter Krantz

Google Code Search Reveals Anger, Frustration and Hate

Google’s Code search is a great way to spend an evening. Indexing a hefty amount of source code reveals anger, frustration and hate. Some favourites: I hate Java Java sucks Python sucks I hate Microsoft I hate DTDs (that is REXML by the way…) Interestingly, searching for “Ruby sucks” does not return any matching documents…

October 11, 2006 · Peter Krantz

Programming Languages for Cineasts: Ruby is Jackie Chan

My colleague Niklas Lindström has put together a list of programming languages for cineasts. Ruby is Jackie Chan which, I guess, is a pretty much spot on: asian, agile, get things done but with poor support for european languages. Java is Richard Gere which pretty much says it all. His complexion is in decay from being in the Sun for too long…

October 5, 2006 · Peter Krantz