jlaine.net

Back From Madeira

I’m back from a training camp in Madeira. The week was a pleasure, although I didn’t feel really snappy in the whole week (probably due to the preceding Finlandia-hiihto).

Here’s some random thoughts about Madeira and the camp (I’m still too tired to get anything organized on paper):

  • There’s only a few orienteering maps from Madeira but they are invariably in very nice terrains with breath-taking views.
    !http://photos3.flickr.com/6178810_01815ce541_m.jpg (Madeira orienteering terrain)!:http://www.flickr.com/photos/jarkko/6178810/
  • The surroundings of Funchal are very crowded with a lot of traffic. Therefore, about the only good running training facilities in the neighbourhood are the (short) Lido street promenade and the (longer) “urban levada”, Levada dos Piornais_, starting right above Lido.
    !http://photos7.flickr.com/6178612_0aa4f7fab4
    m.jpg (City levada in Lido)!:http://www.flickr.com/photos/jarkko/6178612/
  • Levadas, the narrow irrigation canals Madeira is full of, are quite well suited for training. They are often really narrow, tho, and hover over 50-meter cliffs so don’t even think about doing hard trainings or intervals along them.
    !http://photos5.flickr.com/6178700_466ba85832_m.jpg (Mats looking down from a levada)!:http://www.flickr.com/photos/jarkko/6178700/
  • You shouldn’t miss the peninsula of Ponta de São Lourenco in the far east end of Madeira. The place is perfect for a full day trip or (as we did) for an orienteering training extended with jogging to the end of the peninsula. Be prepared to some really strong winds, though, and leave your cowboy hats at the hotel.
    !http://photos4.flickr.com/6178670_9ff4f2acba_m.jpg (Simon poses on a cliff edge)!:http://www.flickr.com/photos/jarkko/6178670/

Not Your Average Speaker

I will not be presenting at OSCON like others nor even at a Java Users Group but I will be giving a guest lecture on Rails for students of Programming Hypermedia at the Hypermedia Lab of Tampere University of Technology.

Yes, I’m thrilled. And already tense as hell. It will be my first real talk if you don’t count the seminars in school. But, standing on the shoulders of giants (and talking about something I’ve fell in love with), I feel I just can’t fail.

Oh, and the last October’s edition of Design In-Flight, the excellent design magazine distributed as pdf, D. Keith Robinson has a take for first-time speakers.

Stay tuned. The lecture will be on April 13th. I hope I can get someone to tape the two-hour session but even if not, I will make the slides and notes available here. And if you happen to be in Tampere on that inevitably glorious day, why won’t you sneak in the hall S3 and give it a whirl. Maybe you’ll be bitten, too.

“Undocumented” Rails Finesses, Part I

Undocumented in quotes because they’re really not undocumented, I just didn’t know about them before.

  1. Automatic handling of creation time and modification time in ActiveRecord. Just put two timestamp fields in your database, created_at and updated_at, and you’re done. The fields will be automatically used by ActiveRecord whenever a new object is saved for the first time or updated. You don’t have to worry about them anymore.
  2. Optimistic locking. Just read about this one in the mailing list. Add a field called lock_version (integer) into your table and ActiveRecord will use optimistic locking for that table from now on, as long as you put a hidden field with that version to your edit form.
    What does it mean? When you start editing an object, its lock_version is read from the database. As you submit your changes, your lock_version is compared to the current one in the database and if the db version has been bumbed up, your submittal is not accepted and an exception is raised. You (as an application developer) can then inform the user (hey, that was you, too!) about the situation and show her the latest version . Preferably show her her changes, too, otherwise she has to write the whole story again. You don’t want that, do you?

Rails is full of this kind of candies, so it’s worth exploring the API documentation. It’s still a fairly moving target so I try to keep popping these ‘rubies’ up to the surface as I discover them.

MPAA in Action

Boing Boing reports that MPAA has been shutting down and taking over several BitTorrent hubs.

Reader Brad Clarke says, “Taking down a site is one thing but putting up their own content has GOT to be illegal. He’s to hoping they finally went too far.”

This reminds me of the Monday night when I went to watch Team America in the local cinema. Among the pre-movie commercials there was an “infomercial” from MPAA. The shoot showed several “normal-life” crimes like burglary and then ended with huge letters stating that “DOWNLOADING IS A CRIME”.

The problem? It’s not. Distributing copyrighted material (other than fair use) is a crime in Finland, downloading is not. That seems to be a fact conveniently “forgotten” by MPAA (and RIAA, BSA, you name it…) in every possible occasion. Anyone smell double standards here?

New Firefox/Safari Exploit

Both BoingBoing and The Register report about a security exploit affecting most modern browsers. The vulnerability makes it possible to create links that look ok in the browser (like www.paypal.com) but that actually lead to another site that has non-7-bit-ascii characters in their address. Secunia has prepared a test you can run to see if your browser is vulnerable to the exploit.

In the BoingBoing story, they tell about a way to secure Firefox by changing a config parameter. However, in a later update they say that the fix doesn’t stand restarting the browser. Another update tells how to make the fix permanent. The fix is for Windows users, so here’s a rewrite of it for all Mac Firefox people:

  1. Exit Firefox
  2. Open ~/Library/Application Support/Firefox/Profiles/ ###.default (or default.###) in finder (### being a number of random characters)
  3. Backup compreg.dat
  4. Open compreg.dat in a text editor (right-click => open with… => other => select textedit or some other text editor)
  5. Scroll down to [CONTRACTIDS] section and find this row: @mozilla.org/network/idn-service;1,{62b778a6-bce3-456b-8c31-2865fbb68c91}
  6. change the 1 after idn-service; to 0, so that the line will be @mozilla.org/network/idn-service;0,{62b778a6-bce3-456b-8c31-2865fbb68c91}
  7. Save the file and restart Firefox. Navigate to Secunia’s test and run the test. If you get a “not found” error, you should be all fine.

I’ve tested the fix and it works fine for me, but I can’t promise it will for you. So stay tuned for security updates. And don’t forget Safari is vulnerable to this exploit, too, as is Opera.

Save Us From All This

Cory Doctorow points to a Slashdot post:

The Tokyo District Court has ordered the destruction of Ichitaro, a software product that is the only serious competitor in Japan to Microsoft Word, and has been on sale since 1985. The ruling is based on the claim of a competitor, Matsushita, that the use of a help icon to invoke a help function infinges on one of their patents. ‘We are a global enterprise and we are just following international practice to enforce our IP rights,’ Kitadeya (Matsushita) said."

Please, God EU parliament, don’t let us sink to this level of absurdity.

Desktop Manager Sacked for Virtue

I’ve been an avid user of Desktop Manager ever since I learned about it. I’ve been a bit frustrated with some of its shortcomings, tho. The most annoying thing is that I have often a hard time finding a given window from the four desktops.

A new kid in town

Virtue is built on the shoulders of Desktop Manager and tries to get around the biggest cons of its predecessor. With Virtue you can click on an application icon and you’ll be swapped into the right desktop automatically. That alone made me switch to using it. There should be a lot more in it, but I haven’t yet had time to dive into other details. All in all, Virtue is a great addition to the arsenal of any hard core OS X user.

Skype 1.0 for Mac Is Out

Skype launched today version 1.0 for OS X (and Linux) of its great internet phone application.

I’ve been using the beta version for a while and although it’s got a few glitches, it has saved me a lot of time and cell phone bills. I still wish the sound quality would be better. Even though they claim to beat normal phone in quality, even domestic connections between two broadband nodes have been flaky at times.