Author Archive

Big news: I’m migrating

September 7th, 2009 19:00

Let me just cut to the chase: I'm moving to Stockholm.

For real. Not just for a holiday, or something else. I'm moving there to start a new life. Some months ago, I met an incredible girl and fell in love. She's living in Stockholm, Sweden and since I've had a long distance relationship before, I know that being apart for too long is not going to work for me. We spoke about how a relationship would be possible and the only way seems to be close to each other. Because of circumstances, I would be the one that should move and after some consideration, I decided to take the plunge an just go.

Of course, there will be stuff and people that I leave behind. Family and friends, but Stockholm isn't so far (cheap 1.5 hour flights from and to Eindhoven), my house (I will rent it to someone), my company (this was actually the hardest part of the decision) and swimming with my visually impaired friends. I told most of the people close to me about my plans already (I'm really sorry for the people who I didn't tell yet. It's not something personal).

Since I want me and her to be boyfriend and girlfriend like other people, I will rent my own place at first. Next to that, I'm currently looking for a job as a Ruby developer in Stockholm, so if you happen to have connections there or you are looking for a developer in Stockholm, let me know. I deliberately decided to quit my current job, since I also want to build social life. I know it sucks for my current colleagues, but this is something I need to do. Some time ago (before I met her actually), I figured that I don't want to regret stuff I didn't do. Some things I did, I regret, but I learned from my mistakes, but not doing things that I could have done.. It's a whole different story.

My house, I will rent to someone. Preferably to a friend or an acquaintance, so if you would like live in Utrecht, 5 minutes from the central station, in the middle of the great neighborhood of Lombok, let me know. It's a two story house (about 85 m2) with a large living room, two bedrooms, kitchen, bathroom (with bath) and a small back yard. I'm considering renting it furnished, but this depends who is going to rent my house (I might do it through a rental company if I don't find someone I know).

Of course there will be things that I'm going to miss (think peanut butter, stroopwafels and other typical Dutch things), but most of all, I'll miss my friends and family. But since flying is cheap, I will still be able to see all of them. Because of the Internet, everybody is only 30ms away. The only thing is that if someone will visit me there, he or she needs to take alcohol, since in Sweden alcohol is very expensive. Swimming every Wednesday, I will miss. If there's anyone out there that wants to do some voluntary work and drive 2 or 3 people from Utrecht to Amersfoort once a week and swim for an hour, let me know. I've been doing this for over 2 years now and I still like it a lot.

Luckily people speak English very well in Sweden, but I've already started learning the Swedish language. I bought Rosetta Stone and I really like it. Swedish isn't so hard for Dutch people; there are a lot of similarities and the grammar is not so difficult (no cases, no conjugation of verbs), so I'll manage.

As said, I already told most people that are really close and I got great support from all of them. Since I've never done this before, I'm very open for advice from anyone. Over the coming months, I'll keep all of you updated on the progress I make on my blog and probably also on Twitter.

All in all, this feels like the right decision and I'm looking forward to living there, in a beautiful country, with a beautiful girl.

And oh, my cats will be moving too ;)

Edit: I forgot to mention the date. I'm moving before the 1st of February 2010

HAR2009 and a social experiment

August 16th, 2009 22:37

Last 4 days I spent at Hacking At Random, a festival for hackers held here in the Netherlands and I really enjoyed everything that was going on there. The atmosphere was great and I had great conversations with a lot of people from all over the world. This time, I really liked that a small project was born amongst the people I was with (mainly pruts.nl members). At the festival, visitors had the ability to register their DECT telephone to Eventphone, so you could use your own phone to call other visitors and even call to the outside world. More than 800 visitors (out of 2200) had their phone registered which made meeting people very easy. Next to using a DECT phone, you were also able to hookup SIP enabled stuff to the telephony network.

Since we wanted to stimulate social interaction at the festival, we set up an Asterisk server and connected it to the telephony network via SIP. Then we took the whole address book that is published by Eventphone and put it in a database. After writing some scripts, we had the possibility to randomly select a phone extension and call this. After listening to an announcement, the call was put into a conference call. Since not all phones were connected and not everybody picked up, we participated in the calls sometimes, to keep things alive. Normally a person would pick up the phone and we'd pretend that we were also randomly called, so that an actual conversation was held. When more people picked up and added to the call, we stopped talking and let the others (mostly 2) people have their conversation.

The nice thing about this was that everybody reacted in a very positive way. People who were called and also the (not so many) people we told what we were up to were all enthusiastic by the whole thing.

This years holiday

July 25th, 2009 21:22

Since I've started taking lessons to ride a motorcycle, I decided not to go on a holiday this year. I'm going to both HAR2009 and Lowlands and thought that would be enough fun this summer, but things turned out differently. Currently, I'm in Stockholm, Sweden. My two colleagues are on a summer vacation for two weeks and I really didn't want to sit at the office by myself, so I decided to go to Stockholm. Since I can work anywhere when I have my laptop and an internet connection, I'm doing some work here. Next to that, I'm partying with friends and just having fun. Stockholm is a great city. Swedish culture is quite close to the Dutch one and even the language has a lot of resemblance (although it's hard to understand when spoken). Because I didn't want to travel by plane and wanted to see a bit more of Northern Europe, I drove here by car. It was a 16 hour drive, but it was doable. I left Utrecht at 7:30 in the morning and arrived here 15 hours later. Some days ago, we went on a booze cruise to Finland. It was a one-day trip in a big cruise ship (Love Boat style) from Stockholm to Aland. On the boat, there was a huge tax free shop where all Swedish people went crazy. I've never seen so many people buying so much alcohol. Apparently alcohol is expensive here.

Although the countries I drove through (Germany, Denmark and Sweden) are quite similar, there are some things that I noticed and I need to write down for future reference (I might edit this list over the course of my stay):

  • In Germany, a Frikadelbrotchen is something different than in the Netherlands.
  • Danish people can't drive. They stick on the left lane, which is quite annoying when you want to put the pedal to the metal.
  • Swedish ATMs and other machines that eat credit cards want your card upside down.
  • Supermarkets and other shops have an ingenious system of giving you cash change. Everything is automated.
  • Swedish highways are great. Not a lot of cars (except around Stockholm).
  • Parking is much cheaper in Sweden then in the Netherlands. Where I'm staying, it's 5 SEK (0,50 euro) per hour and 30 SEK (3 euro) for a whole day.
  • Traffic lights go to orange before switching to green (we should have this in NL too..)
  • Only saw one police car (without cops in it).
  • Most people drive exactly the maximum speed.
  • There are some nice rock and metal radio stations here in Stockholm. Not only mainstream crap.
  • There is a toll system in Stockholm. It's automated with license plate recognition, but I'm not sure if they can read mine and if, where and when I have to pay.
  • The bridges in Denmark and the one from Denmark to Sweden is awesome.

Ruby SOAP – the story continues..

May 27th, 2009 11:39

As written before, I've been struggling with Ruby and SOAP. Apart from the fact that I really don't understand why the world likes to use SOAP, I've ran into a couple of issues I'd like to share for future generations:

  • soap4r and ActionWebService don't play nicely. The SOAP implementation that is included in the standard Ruby distribution isn't very nice at all (issues with validating WSDLs), so I tried using soap4r to make SOAP requests to remote services. Single scripts worked eventually, but when including this in a Rails project that also acts as a SOAP server (using AWS), things broke majorly. Not spending too much time, I decided to make SOAP requests from external scripts that I call with exec().
  • soap4r doesn't set the xsi:nil attribute to elements that allow this when the content is nil, but the element is a ComplexType. The solution here was to manually construct the SOAP elements (using SOAP::SOAPElement).
  • On my development machine (OSX with Ruby 1.8.6) things finally worked fine, but when deploying to a production environment (Linux with Ruby 1.8.7), things broke when calling "id" on a SOAP result object with the message "warning: Object#id will be deprecated; use Object#object_id" and instead of the id in the SOAP result, I got the object_id (which is an internal id for the object and utterly useless for my purposes). The solution here was to not call methods on the result object, but treating it as a Hash. So result.id becomes result['id'].

Cultural ignorance

May 11th, 2009 00:48

Just before I was going to sleep, I was reading my daily news sources and stumbled apon a small article about Gordon, a famous Dutch singer, who's competing in the Euro Vision Song contest, saying he's not going to sing at the EVS if some gay people in Moscow can't have a gay pride there during the song contest. Now I think this is such a stupid action that I had to sit behind my computer and write something about this.

First of all, don't get me wrong here. I'm totally cool with gay people. I have gay friends and I'm absolutely tolerant on the way people are (I'm not even going to defend myself on this one). But what bothers me is that some gay singer from a tiny country called the Netherlands thinks he's somebody internationally and trying to make a statement by not performing at the EVS. As if the Russians would care. This really shows that Gordon has absolutely no sense of the (in this case) Russian culture. Now, I've been to Russia a couple of times, and I'm no expert on Russian culture, but I have tasted a bit of Russian culture in general and from what I have experienced, I can say that it's so very different from Dutch culture. Here, people would be shocked if a celebrity would cancel a gig for an idealistic reason, but I'm afraid that Russia doesn't work that way. Of course there are gay people everywhere, even in Russia (although most straight Russians would disagree with me), but the general mentality isn't as tolerant and progressive as we have here in the Netherlands. I think we live in one of the most progressive and tolerant countries in the world (or at least I love to think I do), but that doesn't mean that the rest of the world works in the same way and that we should expect that people react the same way as we are used to. (I have the same feeling about forcing democracy on people that are not used to this, but that's something for a different post, I guess). Russians are proud people that have a strong opinion that they don't change for nothing, so why would they care if some gay singer from a tiny country is not going to sing at an already very gay contest? Of course I understand that Gordon wants to make a statement and that he wants to fight for gay emancipation worldwide, but as with many things I think that every culture needs its own way of dealing with issues. If you really want to change peoples views, use the right way. In my opinion, Gordon should perform and use the moment he's performing to make a statement. Do a speech in Russian and tell all Russian viewers what you want them to know. That will at least make the headlines.

Festivals and other concerts

April 17th, 2009 23:01

Over the last two weeks, I bought some tickets for the upcoming festival season and some concerts. I have no materialized ideas where I'll spend my summer holidays (thinking about a trip to Ukraine; Kiev, Crimea, Odessa), but I know which festivals and concerts I'll go to. For this year it will be Dredg (Melkweg), The Mars Volta (Paradiso), Hacking at Random (Vierhouten), Lowlands (Biddinghuizen) and Porcupine Tree (HMH)! Really looking forward to all these nice events!

A Song

April 11th, 2009 23:01

As some people might know (mostly close friends and family), last year, I wrote a song. I wrote it for my (then) girlfriend, initially on acoustic guitar and I planned to only play it a couple of times for her and keep it a private thing. After some time, I decided to make a non-acoustic version and recorded different instruments using my computer. The only problem was that I didn't have a good microphone to record the vocals and the drums were very flat, since I punched them in using a keyboard. But nevertheless, I distributed amongst some friends and family. As a birthday present from my Russian family, I got a session in a professional recording studio in Russia to record the vocals. Back home I mixed those in and the thing got better. Since I really wanted the thing to be sort of complete, I bought an electronic drum kit and recorded the drums as well. Just before christmas, my girlfriend broke up with me and my song was put on a shelf. I didn't listen to it for some time, but a couple of weeks ago, I played it again and I figured that I should do something with it. Today I decided to just put it in the wild for everybody to hear. The song is released under Creative Commons License.

Listen to it and let me know what you think. You can download it here.

Rails and SOAP part II

April 7th, 2009 16:32

As written in a previous last post, I've been busy with Rails and SOAP. I've been figuring out how to pass hashes to my remote calls instead of an argument list.

The default API requires something like:

api_method :get_my_thingy, :expects => [:id => :int, :name => :string], :returns => [Thingy.struct]

When calling this (e.g. with a ruby soap thingy) it looks something like:

soap.getMyThingy(2, "foo")

But I would like to do:

soap.getMyThingy(:id => 2, :name => "foo")

For this to happen, I introduced an OptionStruct:

module ActionWebService
 class OptionStruct < ActionWebService::Struct
 member :id, :int
 member :name, :string
 end
end

After this, the API should be like:

api_method :get_my_thingy, :expects => [OptionStruct], :returns => [Thingy.struct]

See my previous post for the Thingy.struct

Jewel Labs

April 6th, 2009 21:44

Over the last couple of months I've been starting new business with two friends. With one pal, I've been working on and off over the last couple of years and last autumn we decided to join forces in software development. We started developing a system for festival management (initially inspired by the lack of good systems for managing complex film festivals) and over the last months our product has taken shape. We're currently doing all the legal stuff, but we've already launched our website at http://www.jewellabs.net. Work will be done on the site over the coming weeks (some people requested screenshots of our product so I guess we'll have to make those), but I'm pretty pleased for now.

If you have any questions/comments/remarks/business proposals, let me know!

Rails and SOAP

April 2nd, 2009 14:56

For a project, I'm currently implementing a SOAP API in Rails. The Rails application will function as a SOAP server and I'm using the datanoise activewebservice plugin for this. Implementing a SOAP API is pretty easy with this, however, I ran into some problems with returning complete model objects.

I have a model called Customer that I want to expose via my API. After setting up the API controller, I specified the following in /app/services/customer_api.rb:

class CustomerAPI < ActionWebService::API::Base
  api_method :get, :expects => [:int], :returns => [Customer]
end

Implemented with:

def get(id)
  return Customer.find(id)
end

Requesting the WSDL nicely gives the definition of Customer, but when making a request for a specific customer errored with the message "Cannot map Customer to SOAP/OM.". It appears that boolean values (in Ruby presented as true/false) and emtpy values (presented in Ruby as nil), were the problem. SOAP wants them as "true", "false" and "".

I solved this by extending my models with a to_struct() method that returns all attributes in a Struct. I extended both ActiveRecord::Base instances to get the instance method to_struct() inside my models and I extended ActiveRecord::Base class so it would return a Struct. The latter is needed, since the SOAP plugin wants to know the attributes and types of the Struct, without actually creating one. Here's what I did:

To extend ActiveRecord::Base with class methods create a module and put the following in your /config/environment.rb:

require 'model_extensions'
ActiveRecord::Base.send(:extend, ModelExtensions)

Then in the module:

module ModelExtensions
  def struct
    # Check if the DataStruct is already defined
    begin
      eval("#{self}::DataStruct")
    rescue
      # Define the DataStruct class and fill it with
      # members that resemble the model
      class_eval <<-EOF
        class DataStruct < ActionWebService::Struct
          #{self}.columns.map{|c| member c.name.to_s, c.type.to_s}
        end
      EOF
    end
    return eval("#{self}::DataStruct")
  end
end

Now to create a DataStruct in a model, we define the following:

module ActiveRecord
  class Base
    def to_struct
      # Get a DataStruct and instantiate
      struct = self.class.struct.new
      # Set the attributes after clean-up
      self.attributes.each do |k,v|
        v = (v.nil?) ? "" : ((v == true) ? "true" : (v == false) ? "false" : v)
        struct.send("#{k}=", v)
      end
      return struct
    end
  end
end

To finish off, we change the API implementation a bit to the following:

class CustomerAPI < ActionWebService::API::Base
  api_method :get, :expects => [:int], :returns => [Customer.struct]
end

Implemented with:

def get(id)
  return Customer.find(id).to_struct
end