jlaine.net

rubyonrails.fi

A few months ago I registered rubyonrails.fi to get wider adoption for Ruby and Rails in Finland, but haven’t really so far got it off the ground. The idea of the site in my mind would not be to duplicate stuff in rubyonrails.org but to bring together the Finnish Rubyists and build a real community for them. The interest in Rails and Ruby is growing rapidly in Finland and I feel lacking a central spot for that interest is slowing down the adoption.

The initial features I’d like to have on the site would be the pretty traditional blog, mailing list/forum and a wiki. I set up a Basecamp project for the site, so if you’d like to get involved, drop me a mail and I’ll setup a user account for you. I hope a few active contributors would help to get my head out of my procrastinating ass.

Current_page? And Rails Named Routes

current_page? is a nifty Rails helper that can be used to check whether a URL points to the current page. This is very useful in navigation lists where you’d want the link to the current page to be styled differently from other items. However, if you’re using named routes in Rails (and you should, keep it DRY, man), current_page? doesn’t work correctly. The reason for this is that request.request_uri (which current_page? uses internally to get the current URL) doesn’t contain the domain name, whereas your_named_route_url1 will return the whole URL, including the domain name and the port.

While this small incompatibility is being fixed, you can circumvent it by using hash_for_your_named_route_url instead. It is just about the same magical method as your_named_route_url, with one difference. It returns the params hash instead of running it through url_for and returning the URL as a string. Thus current_page? will work happily with it.

1 your_named_route_url will return the url you have specified in routes.rb by a route like:

map.your_named_route '', :controller => 'default', :action => 'index'

Rails Job

My friends at Starnet Systems are looking for a full-time Rails developer to join their international development team. See the full job posting and my translation below:

We’re looking for a Web Application Developer to join our product development team in Jyväskylä.

We’re awaiting skills in database-backed web applications (e.g. PHP, Python, Java, .NET), basic knowledge in web technologies (XHTML, XML, CSS, DOM, Javascript, AJAX) and experience in Unix/Linux environments and networks. University degree and knowledge in agile software development methodologies, Ruby programming language and Ruby on Rails framework are considered a plus.

Your tasks will include:

  • Designing and programming web-based applications using Ruby on Rails.
  • Designing and maintaining databases.
  • Systems support.
  • Working as a part of a skilled team.

This is a full-time position. If you’re ready to acquire new and apply old knowledge in responsible projects, send your application and resume to Hermanni Hyytiälä (hermanni.hyytiala at starnet.fi).

Etsimme tuotekehitystiimiimme Jyväskylään: WEB-SOVELLUSKEHITTÄJÄÄ
(Web Application developer).

Odotamme sinulta tietokantapohjaista Web-ohjelmointiosaamista (esimerkiksi PHP, Python,
Java, .NET), Web-teknologioiden perustuntemusta (HTML, XHTML, XML, CSS, Javascript, DOM, AJAX)
sekä kokemusta Unix/Linux -ympäristöistä ja tietoverkoista. Korkeakoulututkinto, agiilien
ohjelmistokehitysmenetelmien, Ruby-ohjelmointikielen tai Ruby On Rails -ohjelmointikirjaston
tuntemus katsotaan eduksi.

Tehtäviisi tulee kuulumaan muun muassa:

  • web-pohjaisten sovellusten suunnittelu ja ohjelmointi käyttäen Ruby On Rails -ohjelmointikirjastoa
  • tietokantojen suunnittelu ja ylläpito
  • järjestelmätuki
  • työskentely osana taitavaa tiimiä

Olet valmiina kokopäiväiseen työhön sopimuksen mukaan sekä oppimaan uutta ja soveltamaan
vanhaa vastuullisissa projekteissa.

Lähetä hakemuksesi ja ansioluettelosi Hermanni Hyytiälälle osoitteella hermanni.hyytiala (a) starnet.fi

(posted with the new TextMate Blogging Bundle)

Hello Chicago

Countdown to RailsConf

What does a Finn do when he gets to US for the first time in his life in the midsummer week? Watches hockey, of course. I have to admit I fell asleep during the second period, though, at about 4AM Finnish time.

Entering the country was much more convenient than I thought.

The clerk at the passport control: What are you here for, mister Lane?
Me: Line-eh. I’m here for a conference.
Clerk: So what do you do, mister Lane?
Me: I’m a web hacker (oops, think, man, think!)
Clerk: Oh, a web developer?
Me: Yes, that is correct.
Clerk: Ok, left index finger, please… right index finger, please… look at the camera, please… have a good day, sir.

Customs clerk: What kind of food do you carry?
Me: Just some Finnish rye bread.
Clerk: OK, thank you and welcome to US.

Renting a car was whole nuther story. We had just winged the reservation and thought we would compare the prices and pick the cheapest supplier. It turned out to be a lot harder than we thought. All the car rentals at O’Hare are placed quite a bit away from the airport so the companies have shuttle busses bringing customers to and from the terminal. There is a phone at the terminal that can be used to contact all the companies, but we couldn’t get it to work for any of them. So we just walked to the bus stop and jumped to the first bus, which happened to belong to AVIS.

At the counter we were served by a lady who seemed to prefer to do anything else than give us a car for a good price. We withdrew from the counter to consider our options. We were in the middle of a fenced area long way from everything else. We could have taken the shuttle bus back to the terminal but that didn’t sound too pleasant either. Fortunately AVIS provides a wifi network at the service center and while a real internet connection is not free, avis.com is exempt from any fees. We did a reservation through the net and got the same car for $50 less than what the price was at the counter.

So here we are now, everything ok. We spent most of Tuesday hanging around Woodfield mall, buying some stuff and getting my MacBook battery replaced (it was suddenly dying a few seconds after unplugging it even with a full battery) at the local AppleStore. Lauri will go golfing today, while I will do some training in the morning and then have lunch with Joe Sackett, the secretary of CAOC. Later today I’ll run a local sprint-O competition further south from O’Hare. Somewhere in between we’ll need to move our bags to Wyndham O’Hare.

(posted with the new TextMate Blogging Bundle)

RailsConf, T-8.days

Instead of getting back to my backlog of blog posts, let’s look ahead. After the Christmas of every orienteer, Jukola relay, I will jump to a plane and fly to Chicago for the first-ever RailsConf.

Countdown to RailsConf

(I snatched the countdown pic from Geoff, go see his post about the graphic)

I will travel together with Lauri Jutila on Monday and we should be at O’Hare at around noon (SAS flight SK0945 from Stockholm). We’ll stay the first two nights in Sheraton Suites Elk Grove Village and move to the conference hotel on Wednesday.

I will stay in Chicago (alone) until Thursday June 29th. My plans are to crash to some B&B or hostel near downtown Chicago after the conference ends and do touristing, running and (maybe) bike trips from there around the city. If you’re staying in Chicago for longer than just the conf, ping me and we can hook up.

I also contacted and got a very warm response from the Chicago Area Orienteering Club. I’ll run a sprint-O event on Wednesday 21st, just before the conf, and they also promised me some maps where I can go training during my stay. I was even invited to a dinner by a local orienteer whose wife happens to be Finnish. Clark is renting out very nice historic apartments around Chicago, so if you’re looking for a place to stay there for longer periods, get in contact with him.

I’m really excited about the whole trip. It’ll be my first visit to US and there are so many people I’ve known for a long time from the Rails community but whom I’ve never met in person. See you all in Chitown!

Hidden Rails Goodies: Blank?

When submitting forms in a web app, you often need to check whether a variable is set and not an empty string, because unfilled text input fields will be set but empty. In OpenACS there was a procedure called exists_and_not_null for this.

In Ruby you could do something like:

if params[:string] and !params[:string].empty?

However, that is both laborious and risky. If the variable happened to be something else than a string, calling empty? would bomb.

Fortunately, Rails defines a pretty much undocumented method blank?. blank? is defined in the Object class so every possible class in a Rails app will respond to it. By default, blank? returns true only for nil, false, an empty array or hash and "" (an empty string, after stripping the whitespace). Of course, you can overwrite the method in your own classes to make blank? behave as you please for them.

>> 5.blank?
=> false
>> o = Object.new
=> #
>> o.blank?
=> false
>> n = nil
=> nil
>> n.blank?
=> true
>> n = ""
=> ""
>> n.blank?
=> true
>> f = false
=> false
>> f.blank?
=> true

So using blank? you can replace the code above by

unless params[:string].blank?

and you’re good to go. Enjoy!

Rebooted

And from the ashes rises… No May 1st Reboot here, not even redesigned realigned outlook. But hopefully the June 9th Reboot made posting work again.

Talking about Reboot, it was again a great event. There were some great speeches – maybe not quite as many as last year, though – but the biggest feat for me is the passionate and enthusiastic spirit of the conference and the endless discussions it fosters.

We had a very nice Rails discussion session where I (as promised) talked very little and let the participants take care of the talking. I met a great deal of nice people, from old friends to those I’d only met online to those I’d never heard of before. We had lengthy discussions with a guy from the original Sun Java team (Hi Reno :) who was totally in love with Rails now and gathering a team for a startup. It really feels like it’s the summer of ’99 again (with hopefully more than a few things learned).

SOLD: 2 Pcs 1GB Kingston RAMs for 1.67GHz Powerbook G4’s

Update: SOLD OUT

I have two Kingston ValueRAM 1GHz modules (KTA-PB533/1G) for 1.67GHz Powerbooks (both 15 and 17 inch) for sale. I bought them as upgrades for my upcoming 17-inch Powerbook, but the introduction of MacBook Pro changed my plans and now I don’t have use for these modules anymore. They sell around €125 in Finland at the moment ($140 in US). I’ll sell mine for €85/each (including VAT 22%) + shipping (which isn’t much since they’re small and light).

The modules are unused and in unopened, sealed packages. They come with the standard 5 year Kingston guarantee. Sold on first come, first serve basis.

Lock in, Look Out

I was sitting in a workshop panel in an open source seminar given by my research group this Tuesday. The idea behind the afternoon workshop was to collaboratively create a simple business plan for a company entering the “corporate wiki” market, competing with companies like SocialText.

The end result was that it’s not critical in the end whether the system is built on open source or not. Using open source can give an edge but the stack is still just a tool. I agree with all this.

However, the final conclusion was that making the company succeed they should get a big client and build such hooks to the system that the client can never get out of the deal. That, people argued my resistance, was how all the successful software companies did it. To paraphrase Jason Fried, “F for give me a fucking break.” Granted, the conclusion was a kind of tongue-in-cheek one, but I just couldn’t help feeling like shoving Kathy Sierra down their throats. Fortunately for everyone, including Kathy, she wasn’t present.

Sure, you can get by very well with this kind of strategy. Just look at Microsoft. But the world changes, my friend. When things get worse, you need people who love you, people who go to the end of the world to find your products. Remember Lotus, and its once infamous Notes mail and intranet system? It was once on every enterprise desktop. There wasn’t many options back then and Lotus did everything to create customer lock-in to the system. And they were successful. For a while.

But people hated Notes. I have with my own eyes seen “Notes sucks!” Dymo labels stuck on people’s monitors. So when the field evolved and companies started to have more options, some of which were very open in nature, they weren’t very fond of sticking with Notes anymore, even though the migration away from it was very painful. So Lotus tripped and ended up in the arms of IBM, and even though the Big Blue still tries to push Notes, I know of very few companies that are moving towards using it.

The lesson: Be nice and honest to customers, both current and prospective. People aren’t stupid, they can see true your plots. Buy Getting Real (featuring yours truly) and The Cluetrain Manifesto and take them to the heart.

And no, everyone else is not trying to fuck their customers. Asserting that is just like a cheating athlete assuring himself that everyone else is taking drugs, too. When you start justifying your ploys by lying to yourself, you’re in pretty deep shit. Nat Torkington has an interesting discussion with Doc Searls about Business as Morality. There Doc depicts an image of Flickr as a company that understands how to succeed really long term: not by locking in customers but by creating passionate users with excellent products and service:

At eTech, I saw a preview of a browser-based Photoshop/Album organizing/print product front-end service. The biggest thing the creator wanted to show was how generous Flickr is. “Watch this,” he said, before using Flickr’s API to suck all 6000+ of my photos from Flickr into his product. All the metadata, all the tags and associations, were intact. His point: Flickr isn’t a silo. Their closed and proprietary stuff doesn’t extend, not is it used, to lock up customer or user data. It’s wide open. Free-range. Most of all, however, it is a “good citizen”. It is generous where it counts.

P.S. As it turns out, according to Paul Graham, having few big clients might not be that good a plan for a startup anyway:

Start by writing software for smaller companies, because it’s easier to sell to them. It’s worth so much to sell stuff to big companies that the people selling them the crap they currently use spend a lot of time and money to do it. And while you can outhack Oracle with one frontal lobe tied behind your back, you can’t outsell an Oracle salesman. So if you want to win through better technology, aim at smaller customers.