Getting Boostrap Popovers to play nice with Ember and Handlebars

Sep 7, 2012

I love Twitter Bootstrap: it’s a great framework for web front-ends and it has been a life safer ever since I downloaded the 1.0 version over a year ago. The power and acceleration it provides to web application development easily justifies why it is the most popular project on GitHub.

I recently stumbled upon Ember.js during a market study on JavaScript MVX frameworks. My company needed to build an AJAX front-end to one of our cloud services and I was trying to determine whether I should stick with the good old Backbone.js or go for something newer. (I’d actually met with Ember a while ago, back when it was called Sproutcore. I must admit that back then, I couldn’t really see the value in client-side MVC frameworks.

Eventually, I decided to go with Ember, despite the fact that it wasn’t entirely production-ready (today, most of the rough edges can actually be attributed to the Ember Data library).

I coded away for a couple of weeks until I decided it would make sense to add a few tooltips and popovers here and there. So I added the required attributes to the element and activated the two plugin via a jQuery selector. I ran the application and… surprise… it wasn’t working!

Continue Reading

Elegant random string generation in Scala

Apr 7, 2012

A long long time ago… Well, maybe not that long ago… I was a Bachelor student at EPFL in Martin Odersky’s Advanced Programming class (which was really just another name for Functional Programming) learning about Scala.

We had an amazing Teaching Assistant during the exercise sessions who used to give us small extra problems to solve. One day, during the exercise session on Streams, he gave us the following task:

Can you write a function which generates a random string of length n in any given alphabet?

Continue Reading