Monthly Archive for December, 2005

Happy Holidays

In a few hours, we’ll be leaving for the mountains (to the only valley in the whole of Europe where it didn’t snow an inch for the whole of December, incidentally) so don’t expect much from me until January 9th, 2006. I’m bringing my laptop with me, but mainly for downloading photos, as connections, if available at all, will be spotty, slow and unreliable.

So, Happy New Year everybody and see you in 2006!

Book review: Agile Web Development with Rails

Agile Web Development with Rails, by Dave Thomas, David Heinemeier Hansson.

Book coverRails, or more appropriately Ruby on Rails is the new web application development framework that everyone is so excited of and raving about how it cuts development time by a factor of 10 and does away with the cumbersome XML configuration files that are the hallmark of J2EE.

Being an old Java hand, I wanted to see firsthand if there was some substance beneath all the hype. I was also intrigued by the fact that many other old Java hands whom I respect and admire, like James Duncan Davidson, Elliotte Rusty Harold, Bruce Tate, Graham Glass, and Brian McAllister are now fervent (to different degrees) rubyists and Rails-enthusiasts. If it weren’t for them, I would never have undertaken this journey, probably.

But anyway, this is supposed to be a book review, not a chronicle of my ongoing discovery of Rails.

I mostly like using books to discover and learn about new technologies, so it’s perfectly natural that I decided to take off with what is considered the book about Rails. And how could it be not, with Rails’ creator David Heinemeier Hansson as one of its authors?

It is also the only one published so far but, even though the choice was a bit, uhm … limited, I wasn’t disappointed. The book, as is customary with titles from The Pragmatic Programmers’ bookshelf, is very good. It lays down in detail almost everything you need to know to be productive with Rails, save for the language Ruby itself. To be honest, the book includes an appendix introducing the basics of Ruby, but it’s just the bare minimum. I suggest getting yourself a good Ruby book (like Programming Ruby, also from The Pragmatic Programmers, which I am currently reading and will review shortly) if you really want to get the most out of Rails.

Another caveat you have to be aware of is that Rails is a quickly moving target. The book covers version 0.13, which was current around mid-2005. There was a 0.14 version after that and we are now at 1.0, since a few weeks ago. However, I didn’t find I had much to change while experimenting with Rails following the book. As always with Open Source software, resorting to the mailing lists, forums or the #rubyonrails@freenode.net IRC channel is the best avenue for finding answers to your doubts and asking support questions.

The book is organized in four parts:

Part I introduces the design principles behind Rails, its most important concepts and briefly covers how to get started by installing it and writing your first program. The part about installation is the one that is bound to become quickly obsolete, as new and easier installation methods for the various supported platforms are developed.

Part II dives into Rails by guiding you along the development of a real (albeit much simplified) e-commerce application. I find this approach to be very good and “pragmatic” indeed. Of notable interest is the chapter on testing. It’s great to see that providing a good test scaffolding was one of the main design concerns in Rails and not just an afterthought.

Part III goes deeper into Rails and can be used as a reference for its components, like Active Record, Action Controller, and Action View. Bonus chapters on AJAX, Web Services, security, deployment and scaling issues are included here and will make the book even more valuable when you need to deal with “real world” applications.

Part IV contains the appendices, like the above mentioned introduction to Ruby, a reference of configuration parameters (be warned again: these might change), the full source code for all samples (of dubious value, in my opinion), and a list of online resources (once again, a list bound to be more and more incomplete as time passes and the excitement around Rails grows).

Overall, I find the quality of this book to be excellent. It’s not thick to the point of being too heavy to carry around in your laptop bag, for those times when you need to peek at it, yet it covers enough of Rails to be considered a complete and authoritative reference. This is probably a testament to Rails’ simplicity too.

The writing style is eminently readable. You can read it cover to cover, if you like, without getting bored. The frequent sidebars make it lively without being too distracting. A great amount of care and craftsmanship went into producing this book, and it shows.

Highly recommended!

(1)

It’s snowing

SnowstormIt’s been snowing like crazy since early this morning. I wanted to go out and buy some stuff we need, but I’ll have to postpone it, hoping this afternoon or tomorrow it gets better. No need to get stuck in traffic for that.

In the meantime, I snatched a couple photos out of my office window. By systematically overexposing, I managed to do some interesting shots, like the one above. Hope you’ll like it.

Google Web Comments Firefox Extension

Google Blogger Web Comments for Firefox ExtensionJust found and installed this nice Firefox extension from Google: It lets you see which bloggers have linked the web page you are on. Don’t be fooled by the reference to Blogger in the name. It uses Google Blog Search, so all entries known to it will be shown. However, if you want to post to your blog straight from the extension, you must have a Blogger blog. They say they hope other blog services will be supported in the future, however.

N.B.: Requires Firefox 1.5 or later.

Performancing for Firefox

Just a test of Performancing for Firefox.

Performancing for Firefox is a full featured blog editor that sits right within Firefox. Just hit F8 or click the little pencil icon at the bottom right to bring up the blog editor and easily post to your Wordpress, MovableType or Blogger blogs.

Looks cool, but I don’t think I’ll let go of MarsEdit, even though the WYSIWYG editor is nice to have.

Intelligent Design is dead

I’m almost giggling while reading the accounts of the Dover trial sentence. PZ Myers has some of the best commentary here, here, here and here. What really made my day was the following quote from the sentence:

After a searching review of the record and applicable caselaw, we find that while ID arguments may be true, a proposition on which the Court takes no position, ID is not science. We find that ID fails on three different levels, any one of which is sufficient to preclude a determination that ID is science. They are (1) ID violates the centuries-old ground rules of science by invoking and permitting supernatural causation; (2) the argument of irreducible complexity, central to ID, employs the same flawed and illogical contrived dualism that doomed creation science in the 1980’s; and (3) ID’s negative attacks on evolution have been refuted by the scientific community. As we will discuss in more detail below, it is additionally important to note that ID has failed to gain acceptance in the scientific community, it has not generated peer-reviewed publications, nor has it been the subject of testing and research.

Oh, sweet words!

Now I’m not familiar with the American judicial system, so I don’t know how much of a precedent this sentence will constitute. It’s even entirely possible that there will be an appeal and that the appeal court will overturn this decision.

However, I think that this sentence pretty much nails the coffin on ID. The ID-iots have been thoroughly and finally discredited and I foresee that they will abandon this avenue of attack. After all, ID was just an instrument that they used to try to “wedge” creationism in the classroom.

This is not to say that I think creationism is dead. We’ve had “scientific creationism” and we’ve had “Intelligent Design”. Both are dead, but creationism will find another disguise to try to make itself more acceptable and hide its religious motives.

Google Analytics ups number of profiles

Google Analytics logo.gifShortly after Google Analytics was opened to the public, they had lots of scalability problems and almost immediately blocked the creation of new accounts and limited the number of available profiles per user to one.

But logging in today, I saw the following announcement:

As part of our efforts in expanding system capacity, your account now has the ability to utilize additional profiles. The total number of profiles enabled is: 5.

So I immediately created another profile for The Open Source Zone, and installed the necessary Javascript snippet in all pages. Unfortunately, it looks like there’s still some problem:

Tracking Unknown (Last checked: 0000-00-00 12:00 AM PST.)
The Google Analytics tracking code has not been detected on your website’s home page. For Analytics to function, you or your web administrator must add the code to each page of your website.

I’m pretty sure the tracking code is correct. I’m also sure, by looking at the webserver logs, that no kind of Google bot requests my homepage every time I ask it to check the status. Moreover, the “last checked” date seems highly suspect.

Has anybody else been able to successfully add a new profile to Analytics, or is this yet another of Google’s missteps with Analytics?

Update: A few hours later, Analytics reports that my tracking code is OK and data is being collected. I guess you just need to be patient.

Adium is the Future

Adiumy.pngTim Bray: “Software of the future will be Open Source, will have a sophisticated and smart user interface, will take responsibility for making sure it’s up to date, and will meet essential human needs. Like Adium.”

And maybe it’s not entirely coincidental that software exhibiting these kind of characteristics, more often than not, was made for the Mac.

MarsEdit public beta

Testing new MarsEdit 1.1 public beta, with Technorati tags.

marseditIconLarge.png

Technorati Tags:

On Rails

On the trainNo, this post is not about Ruby on Rails (they just released version 1.0, by the way), but it’s half about rails, as in “railways”, and half about Ruby the language.

With respect to the former, I was finally able to book my railway trip to Rome, despite my previously reported problems. I enjoyed traveling by train much more than traveling by plane. It’s true that it takes more time, but when you compare having to wait in line at the check-in counter, at the security control, at the gate, at the plane door, then traveling for one hour in a crammed space and finally having to wait for your luggage, to sitting quite comfortably for four hours, at half the price, the choice is clear.

Ruby die-hards might comment that the experience of traveling by plane is akin to programming in Java, which brings us to the second half of this post. While traveling, I did a bit of Ruby programming, just for fun. One thing that struck me negatively about Ruby is learning that Ruby strings are made up of 8-bit bytes. Uh-oh, I smell trouble ahead. Indeed, I hit trouble as soon as I tried to parse (using Lucas Carlson’s SimpleRSS library) some RSS feeds that used different encodings (UTF-8 vs. ISO-8859-1, for example). If I were using Java and a Java XML parser, I’m pretty sure that the strings containing the text values extracted from the feed would have all been Unicode string and I would have had no problems mixing them or storing them in a UTF-8 encoded database.

I’m pretty sure this problem is mostly due to my ignorance of Ruby, but still I wonder whether using 8-bit characters in the era of globalization was a wise decision. I’d rather have Java’s 16-bit characters, if possible.

Update: Got it to work by determining the original encoding using open-uri’s charset method and iconv to convert between it and UTF-8. Suboptimal, but it works.

Say “Hello!” to the TSS crowd

Spring FrameworkMy recent post on Spring 2.0 was featured on the front page of TheServerSide. This brought some nice traffic, but most people left immediately and nobody bothered to leave even a short comment. Probably those who felt like commenting did so on TheServerSide’s own forum.

Reading those comments, I’m amazed at the amount of ignorance that is on display there. Comparing Spring to Struts and turning the former down because it’s not “standard” doesn’t reflect to well on the poster’s knowledge or intelligence.

Anyway, what I want to tell the TSS crowd is that you should take my extreme assertion (”I seriously wonder why anyone would want to develop anything substantial in Java nowadays without using Spring.”) with a grain of salt. Can you say “hyperbole”?

What prompted me to write that sentence was not much my fondness of Spring’s features and architectural beauty, which is certainly there. I just wanted to express my admiration for Spring’s core team dedication to its users and to the quality of its product. Doing a major release that is 100% backward-compatible, to the point of being able to simply drop the new library in place of the old one and have everything still work perfectly, is not something that happens frequently, particularly in the Open Source world.

So, if you want to find a way to architect your J2EE applications in a simple, lightweight, flexible and testable way, have a look at Spring. You won’t probably use everything of it, but that’s just fine. And you’ll certainly find that the parts you end up using will make your life easier.

Hani bileblogs Basecamp

I’m surprised to see that David Heinemeier Hansson took offense at
the latest BileBlog:

This is awesome. In the sense of awesome meaning funny in a sad, tragic way where you feel sorry for the person.

It’s surprising that David fell for Hani’s prank, just like an ordinary Andy C. Oliver. Know what, David? Hani’s biles are the self-inflicted punishment that we Java-types deserve for our sins, like XML configuration files, EJB and all the JCP madness. We enjoy them just like Xians enjoy being punished for their sins. It’s all guilt.

Note for the humor-impaired: the above was largely ironic. However, there’s also some serious debate material in this thread, buried under all the mudslinging. We can start from the following Hani quote:

There’s no doubt that ajax, tagging, semantic fappery and all that other gibberish have some potential. Ultimately though, there is no revolution, nor even an evolution. It’s simply the ability to toss in a few more tools in the toolbox. Specialised tools, that can be effective when used against the right obstacle.”

Google Earth for the Mac

Some time ago, I prayed for an OS X version of Google Earth. Looks like my prayer was answered. There isn’t an official version yet, but I tested the one that has leaked (link below) and it works fine. Yay!

Nathan Weinberg: “Gary Price writes that it appears a Mac OS version of Google Earth has leaked ahead of its release. That is a surprising development, Google releasing anything for the Mac. A Mac-head friend of Gary’s says it works just fine, but download at your own risk. AppleInsider has some info and screenshots, which look identical to the Windows version.
(via Steve Rubel)”

Spring 2.0: What breaks?

Matt Raible: “Spring 2.0: What breaks?

Nothing.

Of course, some things might break – but Rod can’t think of anything significant will. It should be a drop-in replacement for 1.x JARs. This really goes to show the value of a non-invasive POJO programming model. There will be some changes in best practices, but you are not forced to change anything.

This should be the norm, but hasn’t been so in enterprise Java.

Alef just did a demo of migrating JPetstore from 1.2.6 to 2.0. He copied the 2.0 JAR over the old one and redeployed to Geronimo 1.0 M5. After proving everything worked (in a browser), he changed some of the XML syntax and redeployed. Again, everything worked as expected. “

When I read things like this, I seriously wonder why anyone would want to develop anything substantial in Java nowadays without using Spring.

YPN adds 1000 beta testers

Darren Rowse: “YPN has added another 1000 beta testers to their system today and takes another step towards going live. As far as I can see they are still only adding US publishers.”

I received an invitation too. Cool! I thought, I am one of the 1000. Unfortunately my joy turned to dismay as soon as I read about the US-only restriction.

Looks like my plan of swapping YPN ads in place of AdSense ones and reaching $100 a day just like Russ will have to be delayed once again.

Web 1.0 Companies Definitely NEED To Scale

Jeremy Wright: “Listen up. If your company relies on the web to stay alive, you’d damn well better be using at least some of the following “ladder to high availability”:

Backups, Redundant, Failover, Cluster, Distributed, Grid and finally Mesh.”

logo_home.gifI actually tend to agree with most comments to Jeremy’s post: It’s not so important for Web 2.0 startups to really scale so well, at the beginning.

However, I got bitten today by a particularly nasty failure on part of Trenitalia (sorry, no link here; I don’t want their scalability problems to become even worse), the Italian national railways company. I have been trying all afternoon to reserve a seat on a train to Rome, but their online reservation system is totally non-functioning. I’ve phoned their call center and they said their own terminals are stuck too. They even told me it’s been going like this since yesterday.

I tried going to the station, but the kiosks there display a large, red, “Out of order” message. There was a lot of people standing in queue at the manned counters. Apparently the terminals there are still functioning, or maybe they are distributing hand-written tickets, like in the days of yore.

I was planning to go to Rome next monday, but there’s a strike on that day. The train I was planning to take leaves one hour before the beginning of the strike, and the call center operator told me that he would have been able to reserve me a seat, strike notwithstanding, if only his terminal had worked.

Given that most trains will be suppressed on monday, the planes are of course all sold out. In the end, I thought it safer to leave on tuesday, so I cancelled one night at the hotel, but still I haven’t been able to reserve a train seat for tuesday.

Now, I don’t know whether this is a scalability problem or some kind of catastrophic failure, but given the reliance we’re starting to put into being able to conduct most of our businesses online, this is scary.

Today’s non-news: Google Calendar

Contrary to the expectations of many, Google Calendar was not announced yesterday at When 2.0 conference. Speculations regarding the motives of the non-annoucement are running wild ;) .

Olympic Soul

Olympic Soul.pngMy good friend Paolo is blogging about the Olympic Games at Olympic Soul. There you can find news and opinions about the upcoming Turin 2006 Winter Olympics, the Beijing 2008 Summer Olympics and the preparations for the next editions.

Paolo has a particular interest in the subject: He’s hoping to qualify for the decathlon competition in Beijing 2008. Good luck, Paolo!

How many pages per visit?

darren-rowse.jpgDarren Rowse: “While my “research” is far from scientific or accurate it’s an interesting figure. The average blog reader spends looks at less than two pages per visit.”

My statistics, as exemplified by the graph shown below (thanks to Google Analytics) are remarkably similar to those computed by Darren. I’ve tried to increase this ratio by linking to older articles in most entries here and this worked, to a point. Now I know that this is typical of most blogs: they just aren’t “sticky”.

Pageviews per visit

If you have a blog, what is the average number of pages per visit that you see?

Partial content feeds headed for irrelevancy

Alex King: “Remember in the early days of the web when newspapers wouldn’t put their content online? Same thing here… eventually enough quality content will be in full content feeds and the partial feed folks will have to play along or they will become irrelevant.”

Hell, yes! I was trying to put my finger on the real motive why I dislike partial feeds, and Alex’s post pretty much nailed it. There’s so much content in RSS/Atom nowadays that I’m spending far more time in my aggregator than in my web browser (excluding the time I spend developing web apps). If you publish a partial feed, you are forcing me to first look at a snippet in the aggregator and then open the browser (or a new browser tab in NetNewsWire, which is not that much different). This makes my news reading much slower and, in the end, it sucks.

The RSS web is going to be as relevant as the HTML web. For us early adopters, it already is more relevant. Get over it and start providing full feeds.