Archive for the 'devel' Category

Re: Outsourcing the performance-intensive functions

While I’m waiting to board my (delayed, once again) flight to London, I am doing some blog surfing and just came upon this quote from DHH:

“The era of islands is over for most development scenarios. You don’t have to make one definitive choice. Instead, you get to hog all the productivity you can for the common cases, then outsource the bottlenecks to existing packages in faster languages or build your own tiny extension when it’s needed.”

Well, the era of islands did never actually begin for pragmatic developers, to be honest, but anyway I think this sentence, and all of David’s piece, could very well be taken as an endorsement of the work I’ve been doing: investigating the integration between the Ruby and Java worlds.

I like is so much that I’ve just added a slide with the above sentence to my presentation for tomorrow.

And no, I don’t even want to touch the “language wars” thread with a pole. Use the right tool for the job and to each his own.

So long, RSS

I was pretty sure I had modified the Atom feed for this blog to output Atom 1.0, using James Snell’s templates for Wordpress. I was certainly serving Atom 1.0, because I remember I validated it and even proudly displayed the badge.

Then my certainties were shattered when I tried running some tests with Abdera on my feed and, to my surpirse, discovered I was still producing Atom 0.3. *Blush*. Something must have happened in the meantime and the Atom 1.0 template has apparently been replaced by the original one. Maybe it was the system crash the other day, I really don’t know.

Wanting to fix the issue once and forever and with the minimum amount of manual intervention, I remembered reading on Sam Ruby’s blog about a Wordpress plugin. In a couple of minutes I downloaded, installed and activated it and now I’m proudly serving Atom 1.0 again.

As a side effect, all RSS feeds are gone (OK, if you really want an RSS 2.0 feed, look here). I can’t say that I’m sad to see them go: Atom is so much better.

No joy with camping on JRuby

camping.pngWednesday I’m flying to London, where I’ll be speaking at the European Rails conference. I’ll be presenting on the same subject I did at OSCON: Ruby for Java Programmers.

At OSCON I demoed installing and running Rails on JRuby during the second half of the talk, but for EuroRails I’m trying to think of something different, mostly because I don’t want to steal the scene from Charles, who will be demoing exactly that. My backup plan involves demoing an installation of camping, following Ola Bini’s tutorial.

I’m not sure it’s a good idea to talk at a Rails conference about something else than Rails. In any case, I’m not even sure I can make it, since I cannot even get camping to install using either JRuby 0.9.0 or the latest code from svn:

Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR:  While executing gem ... (NoMethodError)
    undefined method `rubygems_version' for 0.9.7:Gem::Version

I’ve opened a new issue about this, but I doubt it’ll get fixed by tomorrow. So I probably need to find a backup plan to my backup plan.

Conference going

Arrangements have finally been made, so I can tell you that I’ll be at the following conferences:

Since I also cannot spend all my time traveling and attending cool conferences, this means I’m not going to attend the annual Cocoon GetTogether in Amsterdam, which is actually a pity. I will certainly regret not meeting all the nice Cocooners once again, but looks like quite a number of them will be at ApacheCon too, fortunately.

Enabling Atom 1.0 on Wordpress

James Snell: “Ok, so it’s about time I got around to offering some more helpful advice on how to enable Wordpress to use Atom 1.0. First off, there are the templates. Download the tar, pull out the wp-atom.php and wp-commentsatom.php and drop them into your wordpress folder (overwriting the Atom 0.3 template). You’ll likely want to make a few customizations of the templates if you want to associate feed icons and licenses with the feeds and entries.”

Done! If you are currently fetching my RSS feed, I suggest switching to the Atom 1.0 one.

[Valid Atom 1.0]

OSCON 2006 Wrap-up

OSCON 2006 was a blast! Lots of great speakers, flawless organization, nice location. As always, the best part of technical conferences is meeting people. I’ll briefly list the ones I had the opportunity of exchanging some words with: James Duncan Davidson, Ted Leung, Dave Thomas, Mike Clark, John Lam, Garrett Rooney, Jim Weirich, Sam Ruby, Tim Bray, J Aaron Farr, Justin Erenkrantz, Susan Wu, David Welton, Stuart Halloway, Matt Raible, Greg Wilkins, Matt Asay. It was my pleasure to meet you.

A special mention for an old friend: Alex Martelli, who I first met many years ago, completely lost contact with, and met again at OSCON. It’s been a pity I couldn’t attend any of his talks: one was scheduled at the same time as mine and another one was in the last slot on Friday, when I had to leave to board my plane. Maybe next time.

As for talks, of notable interests were the one by Stu Halloway on Streamlined—I think Streamlined is going to do much towards the acceptance of Ruby on Rails in the “enterprise”— and the presentation of Google’s Open Source project hosting service: Sourceforge, be alarmed. Both were packed with paople being refused entrance at the door when there wasn’t even standing room anymore.

During the last keynote session, we were treated to another show by Damian Conway. If “The Da Vinci Codebase” was dubbed the best presentation ever, this one could aspire to the title of “Best presentation ever, ever. No, seriously”. The guy should be given a show on Comedy Central, together with Jon Stewart. He’s that good.

Technorati Tags: , .

Slides of my OSCON talk

This post is just to provide a pointer to my slides: they are here if you’d like to have a look at them. I’m not going to write anything more about the OSCON today: my head is exploding with all the things I listened to. Plus I need to decompress after the tension that always goes with speaking in front of an audience, especially in a tongue that is not your own. I’m just looking forward to the exhibit hall reception that is going to kick off at 6. Hope they have lots of beer.

Technorati Tags: , .

OSCON, Days 1 and 2

davinci_codebase.jpgThe first two days at OSCON 2006, filled with tutorials and some keynotes, have gone by. Here’s my wrap-up.

Businesses Partnering with Open Source Communities: Opportunities, Perils, and Pitfalls, James Howison.
Nothing that I hadn’t already heard, or read. Still, James is a good speaker and knows his subject.
Rails Guidebook, Mike Clark and Dave Thomas.
Again, nothing new to me, apart for something about RJS, which I never used before. Useful for not letting things slip out of memory when you’re not practicing them daily, and Mike and Dave are very good teachers.
Ajax on Rails, Stuart Halloway.
Stu is a captivating speaker. Brilliant tutorial. I’ve marked his talk about Streamlined on my calendar. That’s one presentation you don’t want to miss if you’re using Rails.
Open Source Clue Training: How to Market to People Who Hate Marketing, Doc Searls.
We all know and love Doc, at least since the Cluetrain Manifesto. Still his talk left me with many “huh” moments and few “a-ah” moments. I guess I was again too jet-lagged to be able to really grasp it all. Note to self: find the slides and go over them once again.

In the evening we had a plenary session with three keynotes that would have been worth the ticket price alone.

First, Larry Wall delivered hist tenth “State of the Onion” talk. It was the second time I heard it—I think I my first one was at the 2002 ApacheCon— and sorry, but Larry isn’t my kind of speaker. It could be because I don’t care about Perl much anymore, but the parallel between language design and raising kids was just, hmmm… lame. Anyway, it had some good moments and I have heard much more boring stuff in the past. Plus, Larry is very human and likable.

Then it was Kathy Sierra and her “Cognitive Seduction” talk. Kathy is one terrific speaker. I found her speech funny and thought-provoking. What more can you ask?

The evening closed with Damian Conway delivering not a keynote, but an incredibly funny parody of “The Da Vinci Code”. You have to be a real geek in order to appreciate that kind of humor, but then that’s what the audience was made of, and we sure got lots of laughing out of it. He got a standing ovation at the end.

Today I get to present my talk, which is making me a bit nervous. I have the feeling I have too few material to cover 45 minutes, but that is something you always feel and it usually turns out not to be true. Luckily I have some demo material that I can choose to present or not, depending on the remaining time.

Technorati Tags: , , , , , .

Italians at OSCON 2006

Looking at the map where OSCON 2006 attendees can (literally) pinpoint their origin, it looks like there are at least four other Italians here. I wonder who they are. If you are one of those and are reading this, please get in touch. We might have a beer together and stop talking and listening to English only for a while.

OSCON Attendees

Technorati Tags: , , .

OSCON, Day 0

Sunset Through the Steel Bridge, PortlandOSCON actually started today, but yesterday evening a bunch of geeks with a penchant for photography met for a walkabout around Portland. If you were in the vicinity of Portland’s Steel Bridge at that time you could have spotted this group of people pointing cameras around, shooting at the weirdest objects and taking pictures of someone taking pictures of someone taking pictures of someone … ad infinitum.

One of the most interesting aspects of it all was that you could have seen the whole gamut of equipment, ranging from very professional cameras, lenses and tripods, down to compact point-and-shoot models. But I bet that, by looking at the results here, you’d be surprised to learn that some of the most intriguing shots were taken with the least expensive equipment.

Earlier on the same day, I did lots of walking around Portland, mostly in downtown and across Washington Park, which I walked through from the MAX station up north to the Japanese Garden and the International Rose Garden, then back down to Pioneer Courthouse Square. I stopped only when the heat really started to be intolerable (I spotted 95F on a display in downtown) and my feet started developing blisters. Then I jumped on the MAX and got back at the hotel for a few hours of rest and refreshment.

The Rose Garden, PortlandMy sightseeing is chronicled by a bunch of Flickr sets that you can find here, here and here. Now, what I would like some digital photography guru to explain me is why my shots of red flowers—roses in particular—come out with the reds completely saturated, giving them a very “flat” and unnatural look. What can I do to avoid this defect, besides changing my camera?

Technorati Tags: , , .

Speaking at ApacheCon about Atom

After going to Portland next week to speak at OSCON, it looks like I’ll be crossing the ocean once more in October to speak at ApacheCon US 2006, where my proposals for two talks titled:

  • Ruby for Java Programmers, and
  • Atomized: How to consume and publish Atom using Open-Source Java tools

were accepted. Many thanks to the ApacheCon organizers for giving me this wonderful opportunity!

I’m curious to know who else will be speaking. The only other one I know of at this time is Andrew.

The talk about Atom reflects my recent interest in the format, the publishing protocol and its applications. I can’t say much about that since most of what I’ve been doing around it is covered by NDA, but Atom rocks. Looks like Tim Bray shares the same feeling, to the point of being horrified to see nothing about the Atom Publishing Protocol on the OSCON schedule. Luckily he has enough clout to convince Nat to include him in the program. That’s one talk I’m not going to miss!

Using the Ruby Bindings for Subversion

Today I set out to develop a simple proof of concept: a Wiki developed in Ruby on Rails using Subversion as a repository.

Doing a very basic Wiki using RoR is a piece of cake, given the availability of RedCloth and BlueCloth. However, having it use Subversion instead of a relational database is something that needs more work.

Luckily, the latest Subversion release (1.3.2 at the time of this writing) includes full Ruby bindings using SWIG. Unluckily, the precompiled package for OS X that I was using (from the fine folks at Metissian) doesn’t come with the bindings, so I had to reinstall Subversion from the source: nothing really complicated here, but the options for getting it to work over HTTPS should be documented better.

Speaking of documentation, there is apparently none for the SVN Ruby bindings… which is a shame. I could only find something regarding installation thanks to PJ Hyett, why the lucky stiff and Garrett Rooney, but armed with the source, using BountySource’s bsSvnBrowser as a sample (read-only code though, while I need to read and write) and especially Garrett’s book Practical Subversion1, I managed to conjure up some code that, on the surface of it, seems to work.

Here’s a snippet that saves an ActiveRecord instance to the SVN repository:

  def save(validate = true)
    return false if (validate && ! valid?)
    repo = Svn::Repos.open(REPO_PATH)
    repo.fs.transaction { | txn |
      txn.root.make_file(title)
      stream = txn.root.apply_text(title)
      stream.write(text)
      stream.close
    }
    return true
  end

I’m not sure this the correct way to implement save, but it works.

1. When I reviewed Garrett’s book, I wrote: “It’s written largely from the perspective of a repository administrator or a power user wanting to extend the system and develop new applications on top of it, as the long (73 pages) chapter on Subversion APIs demonstrates.” Finally that long chapter has been useful to me!

Rails 1.1.4 Does Run Unmodified in JRuby

Yes, I was dumb. The second step should have been:

jruby bin/rails myapp

With that in mind, Rails is able to generate an application and run Webrick, without any apparent glitches, apart from a warning from the Oracle adapter, as is demonstrated by the screenshot below:

JRuby-Rails.png

Moreover, in order to avoid waiting a lot of time while it is processing docs, it is advisable to install Rails as:

gem install rails --include-dependencies --no-rdoc --no-ri

Technorati Tags: , , .

RailsConf 2006 Keynote Videos

If you, like me, couldn’t attend the RailsConf 2006 in Chicago last month, you’ll perhaps be glad to know that ScribeMedia is putting online the videos of all the keynote speeches. Martin Fowler’s and Dave Thomas’ videos are already online and the other ones will follow shortly.

Also, keep in mind that registration for RailsConf Europe is open, so if you couldn’t make it to Chicago because of distance, you have another opportunity to hear some of the same presenters, like Dave Thomas and DHH himself, plus Kathy Sierra, Chad Fowler et. al.

Rails 1.1.4 Should Run Unmodified in JRuby

Charles Nutter: “Now, with the release of 1.1.4, the following will all work out-of-the-box with JRuby 0.9.0 (currently in RC status):”

gem install rails --include-dependencies

Check

# and use --no-rdoc for now...it's too slow

Check, even though it insisted on building documentation and yes, it was slow, but it finished eventually.

rails ~/myapp
lib/ruby/gems/1.8/gems/rails-1.1.4/bin/../lib/rails_generator/options.rb:33:
        in `method_missing’: undefined method `write_inheritable_attribute’ for
Rails::Generator::Base:Class (NoMethodError)
        from lib/ruby/gems/1.8/gems/rails-1.1.4/bin/../lib/rails_generator/options.rb:33:
        in `default_options’

OK, we’re almost there, but not quite there yet:

Keep in mind that we don’t officially “support” Rails just yet; there’s more work to do. We are, however, another leap beyond the JavaOne demo, and at this rate things are looking very good for an end-of-Summer JRuby 1.0.

I’m not sweating over it. Take your time and make it really rock, folks.

An Eclipse Rant

Why is it that everytime I try to upgrade from one stable Eclipse version (3.1 in this case) to a new one (3.2) I invariably end up having to do an install from scratch? Unzipping the new version over the old one resulted in lots of errors and non-functioning stuff, so I installed it all in a new directory, but then had to copy some plugins by hand and reinstall others using the Update Manager.

I also lost some of my preferences, like Java editing templates. Why aren’t those in my workspace directory, which is under my home directory and shouldn’t therefore get lost if I delete the old /Application/eclipse directory? The mind boggles.

Anyway, I’ve now got Eclipse 3.2 running on both my machines (the upgrade on the MacBook was relatively painless, being from a 3.2 milestone release instead of from 3.1). All is well that ends well.

Eclipse and Intel Macs

This is for a bunch of people I know that routinely use Eclipse on their Intel Macs:

EclipseZone - Eclipse and Intel Macs - apply …: “It’s quite likely that this is a driver issue with Mac OS X on Intel that was causing some of these problems, and Apple’s released QuickTime 7.1.1 that claims to fix some issues with startup items for Intel macs. In any case, bug 142892 has been tracking it, and it looks like applying this fix solves whatever the graphics card issue is, and Eclipse is running again. “

I didn’t have this particular problem (UI is freezed, even though mouse pointer moves, and you cannot even login from remote) when running Eclipse, but rather with other applications, like Opera for example. However, the symptoms were the same, so I dutifully upgraded Quicktime to 7.1.1, hoping they won’t surface again.

Technorati Tags: , , , .

Apache Abdera and ROME: alea jacta est!

Great news on the Atom front! The ARI project I mentioned a few days ago has changed its name to Abdera. This gives it a new fancy name while at the same time removing any ambiguity around its “reference” character. I’m really looking forward for it to come out of incubation.

As I had anticipated, I changed my code to use Abdera instead of ROME and it was a relatively quick and painless process. Just changing all Java package names and keeping references to “Entry” and “Feed” classes was enough to get most of the code to compile cleanly.

Last but not the least: James Snell suggested on the ROME developers’ list that Rome could use Abdera instead of its own Atom implementation, and he was met with loud cheers, as Pat reports. Personally, I’m all for dropping ROME’s feed model and replacing it with one based on Atom, as Atom can do everything that RSS does, and much better.

There’s also been talk of moving ROME to Apache, a move which I would personally applaud.

Technorati Tags: , , , , , , .

Atom Reference Implementation

atom-logo75px.gifJames Snell: “Just a couple of minutes ago I sent off a new proposal to the Apache Incubator PMC to consider incubation of ‘ARI’, a reference implementation of the Atom Syndication Format and Atom Publishing Protocol specifications.”

I’ve been working with Atom lately, specifically with the Publishing Protocol side of things, and have been using Rome, supplemented by some of Dave Johnson’s code. While Rome is a fine toolkit for all kinds of syndication needs, its support for the many variations of RSS tends to get in the way when all you need is Atom, and Dave’s code is too blog-centric for my needs, which have nothing to do with blogging.

So I welcome ARI and will have a look at the code ASAP but, judging from the latest spat of articles on James’ blog, it looks like it already provides a good set of features on the syndication front and some support on the publishing one. I’ll try to swap it in in place of my homegrown, Rome-based code and see if it works out.

Technorati Tags: , , , , , .

SOAP really stands for…

… no, not Simple Object Access Protocol, that was dropped long ago and with good reason, as “simple” is not a very fitting connotation for it.

Rather, it probably stands for Snakes on a Plane. If there’s something that many people are afraid of is snakes, and another one is flying. There’s no doubt that you should be very afraid of something that tries to combine the two, as in SOAP. Not to mention that scary WS-* stuff that is infested by vendor-pires. Brrrrr ;).

Technorati Tags: , , .