This year I somehow didn't feel like writing a post about every single day of WWDC (you can look at some pictures, though). It's Friday now, 4:30 pm and I'm on the Caltrain back to San Jose. It has been a fun week. Unfortunately a lot of the sessions were geared towards new iPhone developers, so they tended to be very basic. There were, however, still a lot of in-depth sessions which I really enjoyed.
Snow Leopard will come with some great additions for us developers. Playing around with them and then actually talking to the very Apple engineers that built those things is priceless (actually it's not: you just have to buy a ticket). Catching up with people that I haven't seen for a year as well as meeting lots of new people is one of the nicest things about WWDC. It's a very friendly and helpful community.
I've also realized once more this week that iPhone and Mac development is a lot more fun than web development. It makes my eyes light up to be able to run my code "so close to the hardware". I love Ruby, it's a beautiful language, but optimizing your Objective-C code so that you get the last bit of performance out of this wonderful device that is the iPhone simply is a lot more exciting than writing web apps. The 4 years of writing ANSI C on OS/2 really pay off now: Having a deep understanding of C and of memory management is extremely valuable. Even if you mostly work with garbage-collected dynamic languages: Pick up a book and learn C. It will make you a better developer.
During this conference I also wrote my first native Ruby extension and decided that OpenGL ES is the next technology that I want to learn and master.
The beer bash yesterday was great. The food was good (but not as good as the last 2 years) and they got the band Cake to give a great concert for us. Good times. Two more points of critique: No reception on Monday night and no Espresso guy! What was up with that? I mean Apple must have been doing extremely well because of all of our apps that they sold through the AppStore last year, so this is not the time to get cheap and not offer such essential WWDC essentials like the Espresso guy!
Anyway, greetings to all the interesting people I had the pleasure of meeting and see you all again next year. I'll stay in California for another week: Vacation with my sweet wife!
Saturday, June 13, 2009
WWDC 2009 - Recap
Tuesday, June 9, 2009
WWDC 2009 - Day 1
Wednesday, May 27, 2009
Xapian Search Extension for Radiant
I'm working on a project involving the Radiant CMS and a legacy DB2 database. We need full-text search and initially I would have liked to use Sphinx (because Ferret is too unstable) but the available Rails plugins for Sphinx only work with MySql or Postgres. So I came across a little-known search engine called Xapian. It's very fast, it's used by Gmane to index millions of entries every day and (alas!) it works with every DB that Rails works with (which includes DB2).
Tuesday, May 26, 2009
Rake: "no such file to load" although it exists
I'm working on a search extension for the Radiant CMS that uses Xapian at the moment. I ran into a weird issue where rake complained about not being able to load a file although it existed. It listed the full - and correct - path of the rake file I wanted to include in another rake file and aborted with "no such file to load". Lies! All lies! Reading the RDoc of Rake revealed that dependencies loaded with "require" are loaded before the Rake targets are evaluated. So alternatively you can use the "import" statement instead of "require". That's what solved my problem. The "no such file to load" error is quite misleading, though.
Friday, April 3, 2009
Ruby Deutsche Bank CSV Converter
I've recently signed up with FreeAgentCentral. It's a really great service, but it didn't like Deutsche Bank's CSV files. That's why I wrote a converter. Check it out on Github.
Friday, March 27, 2009
WWDC 2009 - Got My Ticket
This year, Apple has waited excruciatingly long to announce the dates for their annual Worldwide Developers Conference (WWDC). Last year they announced the dates on March 13th, 2 weeks earlier. Anyway, yesterday the dates were finally announced: June 8 - 12, just like everyone expected. I got my ticket right away because WWDC sold out last year and I expect it to sell out even quicker this year because of all the new iPhone developers.
I really hope they won't just cater to new developers with lots of introductory sessions. But usually they have a good mix. It'll be good. See you there!
Monday, March 23, 2009
Passenger and Ruby Enterprise Edition on Solaris 10
I recently had the pleasure of setting up REE and Passenger on Solaris 10. I set the server up using the ibm_db gem for the IBM DB/2 database. I'm not covering this part in this tutorial and I also haven't replaced it with instructions for MySQL. I'm sure you'll figure out how to set up MySQL on Solaris.
- Create httpd.conf:
cp /etc/apache2/httpd.conf-example /etc/apache2/httpd.conf
- Start Apache:
sudo svcadm enable http:apache2
More info here. - Install Ruby Enterprise Edition:
wget http://rubyforge.org/frs/download.php/51100/ruby-enterprise-1.8.6-20090201.tar.gz
- Install GNU Tar (needed for Capistrano, if you use the copy strategy. If not, you don't need it.):
sudo pkg-get install gtar
- If you do use the Capistrano copy strategy, you also need a link from tar to gtar:
cd /home/myapp mkdir capistrano-links cd capistrano-links ln -s /opt/csw/bin/gtar tar
- Unpack Ruby Enterprise Edition:
gtar -xvzf ruby-enterprise-1.8.6-20090201.tar cd ruby-enterprise-1.8.6-20090201/source
- Configure:
./configure --with-openssl-dir=/opt/csw --with-readline-dir=/opt/csw --with-iconv-dir=/opt/csw --prefix=/opt/rubyenterprise --enable-pthread
More info at Dark As Light and at Joyent. - Install REE:
make make install
- Edit your profile:
vi ~/.profile
Then add this:export PATH=/opt/rubyenterprise/bin:/opt/rubyenterprise/lib/gems/bin:$PATH export GEM_HOME=/opt/rubyenterprise/lib/gems export RUBYLIB=/opt/rubyenterprise/lib export RUBYOPT=rubygems
Save and source it:source ~/.profile
- Install RubyGems:
wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz gtar -xvzf rubygems-1.3.1.tgz cd rubygems-1.3.1 /opt/rubyenterprise/bin/ruby setup.rb install --prefix=/opt/rubyenterprise/
- Install some gems:
gem install daemons fastthread gem_plugin rake tzinfo rack passenger
- Set some environment variables you that you will need for the passenger installation:
export APXS2=/usr/apache2/bin/apxs export APR_CONFIG=/usr/apache2/bin/apr-config
More info here. - Install Passenger:
passenger-install-apache2-module
- Create a wrapper script for ruby that sets some environment variables:
cd /home/myapp vi ruby_with_env
Then enter this:
#!/bin/sh export PATH=/opt/rubyenterprise/bin:/opt/rubyenterprise/lib/gems/bin:$PATH export GEM_HOME=/opt/rubyenterprise/lib/gems export RUBYLIB=/opt/rubyenterprise/lib export RUBYOPT=rubygems exec "/opt/rubyenterprise/bin/ruby" "$@"
I know that this is a bit hackish and not very elegant. More elegant and working solutions and warmly welcomed. - Put the Passenger stuff into the Apache config:
vi /etc/apache2/httpd.conf
Add these lines:LoadModule passenger_module /opt/rubyenterprise/lib/gems/gems/passenger-2.1.2/ext/apache2/mod_passenger.so PassengerRoot /opt/rubyenterprise/lib/gems/gems/passenger-2.1.2 PassengerRuby /home/myapp/ruby_with_env
- Also add this:
<VirtualHost *:80> ServerName myapp.mycompany.com DocumentRoot /opt/myapp/current/public </VirtualHost>
Also change Group to myapp and User to myapp. - Create a directory for your rails app:
mkdir /opt/myapp
- Restart Apache:
sudo svcadm restart http:apache2
Check that it's online:svcs apache2
- Add this to the bottom of /etc/ssh/sshd_config:
# for capistrano PermitUserEnvironment yes
- Install Rails:
gem install rails
- Change to the shared/config directory:
mkdir /opt/myapp/shared/config
- Copy your database.yml to /opt/myapp/shared/config/database.yml.production and enter your production values. IMPORTANT: remove all other entries, that might use a different database adapter! This prevented Passenger from working for me.
- Deploy:
(I assume that you have capified your project)
On your client machine, in your project directory, run this:
cap staging deploy:setup cap staging deploy:cold
- That's it!
If this was useful for you, please take a minute and recommend me:

Thank you!



