jlaine.net

Closing... And Opening

217 words · 2 min read

After a magnificent week sunbathing and orienteering in Gotland, we finished the week by moving our stuff from the well-served jlaine.net mansion to our new home. I always tend to be really tired after week-long training camps, but topping it off by two days of hauling things over has got the better of me. I’m thus closing this office now, wishing for two things:

  1. A long night sleep.
  2. A fast broadband delivery to the new apt. Until then, I will be heading a mobile office from cafes and universities around Tampere.

Oh, and did I mention the just ripened raspberries in our new garden?

[]{lang=”UPDATE”} I finally settled on an ADSL provider and the connection should be live mid next week. The lead time for an installation ranged from a decent 9 days to a staggering 6 weeks, which is pretty amazing for a flip of a switch (there is no work needed on site). I’ve been burned by the unreliability of ADSL a few times before, so I was contemplating getting a business broadband and circumventing the aging phone lines altogether. However, with prices starting from 400\€/month for a 4/4Mb connection I decided I would settle for an 8/1Mb ADSL (for 10% of the price) for now and see whether the service has gotten any better.

rubyonrails.fi

149 words · 1 min read

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

159 words · 1 min read

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_url<sup>{=html}<a href="#fn1">{=html}1</a>{=html}</sup>{=html} 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.


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

Rails Job

247 words · 2 min read

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

476 words · 3 min read

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?<br />{=html}
Me: Line-eh. I’m here for a conference.<br />{=html}
Clerk: So what do you do, mister Lane?<br />{=html}
Me: I’m a web hacker (oops, think, man, think!)<br />{=html}
Clerk: Oh, a web developer?<br />{=html}
Me: Yes, that is correct.<br />{=html}
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?<br />{=html}
Me: Just some Finnish rye bread.<br />{=html}
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

279 words · 2 min read

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?

217 words · 2 min read

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:

<filter:code lang="ruby">{=html}
if params[:string] and !params[:string].empty?
</filter:code>{=html}

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.

<filter:code lang="ruby">{=html}
>> 5.blank?
=> false
>> o = Object.new
=> #<Object:0x10f8c6c>{=html}
>> o.blank?
=> false
>> n = nil
=> nil
>> n.blank?
=> true
>> n = “”
=> “”
>> n.blank?
=> true
>> f = false
=> false
>> f.blank?
=> true
</filter:code>{=html}

So using blank? you can replace the code above by

<filter:code lang="ruby">{=html}
unless params[:string].blank?
</filter:code>{=html}

and you’re good to go. Enjoy!

jlaine.net Visualized

31 words · 1 min read

<a href="http://www.flickr.com/photos/jarkko/166407495/" title="jlaine.net DOM structure">{=html}<img src="http://static.flickr.com/53/166407495_472cb0f68b.jpg" width="500" height="499" alt="jlaine.net graph" />{=html}</a>{=html}

Late as always, here’s the DOM structure of the jlaine.net homepage visualized by <a href="http://www.aharef.info/static/htmlgraph/">{=html}Websites as Graphs</a>{=html}. (via <a href="http://mentalized.net/journal/2006/06/08/mentalized_visualized/">{=html}Jakob</a>{=html})

Rebooted

168 words · 1 min read

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

105 words · 1 min read

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.