First steps into Scala

For over a full year now, I’ve been looking into Scala. I have heard many people talk about it passionately and it just got me interested. Also a lot of big companies are investing in this new language. I just figured I had to check it out.
In my 4 years of Java programming, I’ve learned the Java EE stack, (Spring and Java EE) and I must say, not much has changed since then. We got the long awaited release of Java 7 (with lots of features missing) and in 2009 Sun released Java EE 6.
Java EE 6 was a cool release and I have blogged about it for a few times but it is not more than just more abstraction of the same concepts. Spring hasn’t really been moving forward at all. When you look at the release which was used when I started programming professionally and the one we use in production, it is largely still the same version. There is a 3.0 release but to be honest, it is not very compelling.
So after hearing people like Dick Wall talk about Scala for a long time, I decided to pick it up. The first thing I have tried was the Scala Koans.
Scala cones is a project on github that helps you to learn a language by correcting failing tests. At the time the Scala Koans project was still in the very early stage and I did not get them to work and gave up rather quickly.
My second attempt at Scala was when I had some spare time and I wrote a simple application which parsed some XML. This worked but in the end this only took me 5 minutes, looking back at it now, I did not use any language feature that was an added value. The only thing I did, was write Java in Scala.
In the mean time I joined the Belgian Scala Enthousiasts and I’m following the mailing list, but still, I couldn’t really write a true Scala application. I didn’t even get the feeling I was hitting it off.
At Devoxx 2011 I was determined to go and see the Scala talks and things that have to do with Scala. I ended up seeing 2 talks about the Play! framework, 3 talks about Scala and a talk about Akka. I did also talk to the guy’s at MongoDB and Typesafe.
Devoxx 2011 was a real eye opener for me to get started with Scala. There were many reasons, first of all there were the talks.

The talk about play! 2.0 showed me how to build a web application with Scala. It also demonstrated what a cool framework Play! is.
The Akka talk showed me how to create super scalable and decoupled applications. It is written in Scala and integrated with the play! framework (version2.0) which was a plus for me.

The talk from Matt Raible didn’t really show me something technical. His talk was about some technologies he wanted to learn (Scala, Play, Coffeescript, {Less}, scalate and jade). He wanted to talk on Devoxx so badly so he just submitted a talk. At the time when he submitted the talk he didn’t know any of the technologies he was going to talk about. He even waited to start learning them until his talk got accepted. Only after the approval, he started learning and blogging about these technologies and then showed what he built at Devoxx. His talk was about the same thing which I was trying to do for over a year, but never pushed through. It might sound corny, but this talk was the real boost for what I’m doing now.

On the other hand I had 2 interesting chats in the downstairs hall.

One was with a mongoDB guy. He showed me the API he had built for connecting with mongoDB from Scala. Unfortunately, I did not get his name… The other was with Henrik Engström, a developer who works at Typesafe (A company founded by Martin Odersky, the creator of the Scala language and next to Scala they also house the play! framework and akka).

We just talked about how you can use scala in web applications.

When I got back from Devoxx, I literally got home and downloaded the Scala runtime, the Typesafe stack (at the time this was only Scala, Akka and the Scala IDE) and the beta of the Play! framework. I have a small project in my head that I’ve been thinking about for some time now and I started implementing it.

Based upon the 3 Scala examples with which the Play! 2.0 beta ships, I’m learning the language bit by bit. But there were a lot of language features I didn’t really grasp. I tried to look into the scala doc but got even more confused. I knew that Typesafe is offering a free book ‘Scala for the Impatient‘, so I decided to check it out. I downloaded that book and started reading it. Things cleared up immensely. I now understand why people say Scala isn’t complex, it just looks that way. Well it’s true. It also explains the weird things you see in the Scala API documentation.
Now I’m working with Play! 2.0 and Scala. When I’m getting the hang of it, I’ll also try integrating Akka and probably deploy it on Heroku and see what it can do.
I’m going to try to keep documenting my steps into Scala, Play! and Akka. I’ll see where It takes me.

Bootstrap, from Twitter

On Devoxx 2011, about a month ago, I heard about this cool new concept, ‘Bootstrap from Twitter’. The idea is brilliant in its simplicity.
It targets developers of new applications. If you are playing around with a proof of concept, hacking away in some new programming language or just focussing on getting the something to work right, then this is just the thing for you.
The basic idea is that Twitter gave away some basic css and javascript for building web applications. That’s just it. Bootstrap just gives you the most common used styles and javascript that Twitter uses. You can download it, plug it into whatever you are building and get stared.
Currently I’m playing around with the beta release from play 2.0 (see what I did there). And now I’m building a text based app with ugly formatted forms etc. Everyone who has ever build something from scratch probably knows what I’m talking about. Just by adding the css (I use the less version of it since bootstrap is build with less from the start), I go from this

to this

Perhaps the difference is not very impressive but everything looks a bit more web 2.0. When we start to apply some basic css classes to our login form we can easily improve it more.

As you can see the botstrap css contains basic css for most, not to say all aplications. This way you can build a demo without having to worry that it looks slick.
Eventually I ended up with this, I won’t use it and I know it is a bit redundant, but I just wanted to show the potential lying in this cool project

Bootstrap also includes other features, a short summary

  • Example Layouts (based on the but without the 10px margins)
  • Basic Typography
  • Media grids
  • Table styles
  • Forms layout
  • Navigation styles
  • Styles for Alerts & Errors
  • Popovers (modal windows)

I know this is not the most technical topic to blog about, but I think that every developer sees the benifit of using this.
You can download Bootstrap here and check out the other features here or just go ahead and fork the project on github.

Devoxx 2011: A crash course in Scala

Devoxx time again, 4th year that I’m attending. This morning I went to see the talk by Mario Fusco and Kevin Wright. The first part was by Mario and handled the Scala basics. The talk itself was a bit messy. It was a mix of API features and a comparison with Java, Groovy and Haskell.
He showed some cool language features, but overall it was just an API features list, but the demo that was given was pretty cool. The demo showed how easily you could create a DSL with Scala.
In 2 minutes he was able to write something like this.

   3 times{

Eventually the code printed “hello” 6 times. It is a bit a trivial example, but really fun to see what the power is of scala.

The second part of the talk was about how Scala would be agile in a project. Kevin also emphasized on the way we can write code that is very readable for developers and for the business users. He started with an example that he apparently stole from Dick Wall :-). The example just showed how everything in Scala is manipulable.

A long time ago in a galaxy far far away

translated into


So these are just a class (A), a few methods (long, ago, a, far and away) and some vals (time, in, galaxy and again far).
This was quite nice and showed the potential to build readable code for the business users.
For a more powerful example he referenced to a gist he created on github, where a string of validation rules can easily be added to a processor and then return the result. (on top you have the method declarations, on line 44 you got the actual processor that is being defined and at the bottom you find some test with the result in comment).
Again, I heard that the best way to start with Scala is to write your tests in Scala. This code does not go into production so it does not create a risk, but the developers start playing with and learning Scala so they get a good feel about what is possible.
The most important thing I remember from this talk is that you can learn a fair amount of Scala in 2 weeks, but you’ll need more time to learn a specific business domain. By writing your business apps in readable Scala, you could lower the step to get into the business.
It was an interesting talk that showed possible usages of Scala in a real environment, but I’m not sure it convinced many people to start using Scala.

Vogue Vogue Vogue Vogue Vogue…

Vogue was just one of those bands. The first note I head of their fast and dirty hardcore, I was sold. They were from Belgium and brought a fresh sound to the scene. They have put out their first demo around 2005 and will play their last show somewhere in the beginning of 2012. They are know for their childish remarks and they are a lot of places where they are forbidden to play once they’ve played there. The live performance is a bit off, mostly due to the hyperactive singer.
I’ve been collecting all their releases since they started playing. I think I only miss their first demo tape, but I also don’t know anyone who has it.
First Demo tape
Vogue not responsible for causing trends 7″
These first 2 releases we’re independent. For here on they ave signed with Holy Shit Records. I was able to get the preorders for the next 2 records
No Vogue 7″ (Pre-order /50)
Dickfaced LP (Pre-order /200)
By now the first releases are hard to find, so Holy Shit release a compilation album. The pre-order contained a very nice booklet with interviews with the band and cool photos.
Holy Shit records seized to exist so hardware records took care of their last album. Its a maxi called Pompshit.

I guess this is where my collection ends. If they would release a special version of the pompshit album for the last show, I would probably still buy it. Vogue was and is just an awesome band with an awesome live reputation.

Java EE6 in the Cloud – Getting started with Red Hat Openshift

OpenShift For a while now I’m looking into ‘the cloud’. Looking into its features, what it can do, why we should switch to ‘ the cloud’, going to talks, talking to people like @maartenballiauw, who is a cloud specialist at RealDolmen. I’ve already deployed an application on google app engine (for java) and I really liked the experience. Some new concepts come into play like distributed data and so on.
But in the recent chain of events, being more interested in the future of java EE, I looked into OpenShift.
OpenShift is a PaaS offerd by Red Hat. The basic idea is to run Java EE 6 in the cloud and that is exactly what we want to do. I’m using Ubuntu for this, so all my commands are based upon the Ubuntu distro. Be sure to register for an account on, you will need it to create a domain and application.

Starting of we have to install ruby gems. The ruby gems are the interface to manage our cloud domain. So first we install the gems.

$ sudo apt-get install git ruby rubygems ruby1.8-dev

We need git to checkout the code, the ruby packages is to install the gems. Now we install the gems.

$ sudo gem install rhc

The rhc (red hat cloud I presume) is the base for all the commands that will be used to manipulate our openshift domain. So first we need to create a domain.
The gems are standard deployed installed in the /var/lib/gems/1.8/gems/bin folder. We best add it to our $PATH variable for easy access. Now everything is ready to start working with openshift.

Now we want to create a domain. The domain is your work directory on OpenShift. Choose something unique and you will be able to access your applications via To create your domain we need the ‘rhc-create-domain’ command.

$ ./rhc-create-domain -n domainname -l loginid

Now you will be promted for you password, just type it and you are done. Your domain is created.
Your domain is setup, we now want to create an application.

$ ./rhc-create-app -a applicationName -t jbossas-7.0

The -t parameter indicates we will be running the application on a jbossas-7.0. The cool thing about creating an application on OpenShift is that we now have a fully setup git repository. When we push, the application is pushed to OpenShift.
To start of I forked the seambooking example on github ( I did not really need to fork it, but it offers a good basic setup for OpenShift project. Once I’ve added the code to my OpenShift git repository, I can simply do a git push.

$ git push

The sample app is running, running in the cloud…

More information on and