My blog has been moved to

Sunday, June 29, 2008

return of the graphics dojo: OpenGL-accelerated widgets and Bloom effect

After almost a year without any sign of life, Samuel and I decide that we should resurrect the Graphics Dojo, i.e. by populating it with some new fresh examples.

Being a graphics ninja, Samuel's first example is on how to (finally) put widgets on OpenGL viewport. This is now made possible thanks to Qt 4.4's new feature of adding widgets to the graphics scene. Check out his example code, it looks awesome and you can play with it for hours!

Qt widgets and OpenGL

Since I'm new to all this magical graphics world, my first example is however fairly simple: Bloom effect (with pure Qt of course). If you are an avid gamer, you know what I am talking about here. And just for the fun of it, I coded it so that you can drag-and-drop an image right from the web browser, e.g. Blooming your favorite Flickr photo easily.

Feedback is warmly welcomed. Enjoy!

Bloom effect with Qt

Sunday, June 22, 2008

on Jim Rohn quotes

Jim Rohn quotes have been always my favorites. Here are my picks:

  • Success is doing ordinary things extraordinarily well
  • Maturity is the ability to reap without apology and not complain when things don't go well
  • Miss a meal if you have to, but don't miss a book
  • Let others lead small lives, but not you. Let others argue over small things, but not you. Let others cry over small hurts, but not you. Let others leave their future in someone else's hands, but not you

midnight in Oslo

Taken today, half an hour past midnight, where the night lasts for only roughly 5 hours 10 minutes. And Oslo is only at 59° 56' North. I wish I would have gone further north.

Sunday, June 15, 2008

JavaScript speed race

Just for fun, I tested JavaScript performance of several web browsers, using the well-known SunSpider benchmark tool. The test machine is a fairly old Fujitsu-Siemens Amilo notebook with AMD Turion64 1.8 GHz processor and 1 GB RAM, running Microsoft Windows XP SP2.

SunSpider benchmark results

The result is not surprising. Internet Explorer is notoriously slow but there is hope with IE8. Mozilla developers have done a great job optimizing Firefox. WebKit with SquirrelFish (and surely the upcoming Safari 4) really shines in speed.

Tuesday, June 03, 2008

creating fancy screenshots with Screenie

Screenshot of SpeedCrunch composed using Screenie

There are tons of open-source projects, on SourceForge, Google Code, etc. If you check a project, most likely you see the screenshots first (don't be ashamed, to look at a screenshot is human). And there lies the problem. There is a fairly small amount of coders that are both very good at writing codes and composing good-looking screenshots.

So we had a terribly hot weekend in Oslo. Too hot to be outside the whole day. So after populating the wonderful weekend with banana brownies (I still favor the one with mango, though), fresh chocolate waffles (let's see if I can still continue the Sunday morning waffle tradition), huge delicious pizza (as usual I underestimated the size), pasta bolognese ala myself (but still can't beat the best one, so I was told), every now and then my own interpretation of alcohol-free SOTB (guess what it is. hint: a cocktail of course), and finally some of the worse sushi rolls I ever made (they got it right when they say practice makes perfect), I still have some free time. Then...

I sat down and checked again this old piece of code, Screenie, that I never had time to finish (note to self: do that more often and clean up the junk). It was a tool to compose a screenshot with some style. By style here I mean of course just copy Apple. Why? If you check e.g. Apple Keynote site, you see the proof that simple transformation and effects can make a big difference. What Screenie can do for you should be predictable: to create a screenshot like that.

Assuming you have Qt 4.4 and git, here are the steps:

git clone git://
cd screenie && qmake && make

(Likely you need qmake-qt4 for (K)ubuntu and Debian).

Basically you have a window where you can drag-and-drop an image from Konqueror (either local file or from the Internet) and place it there. You have three spots on the screen to fill. Tweak the parameters to achieve the 3-D goodness and translucent reflection that you want. Finally right-click to save the result.

As some Apple web pages show, there are certain cases where you want two images instead of three. So use your imagination and the check boxes are at your disposal. In the following example, I just drag-and-drop the two Plasma screenshots (one, two) I have on my Flickr straight from Konqueror. Don't you agree that visually it does make a difference?

Plasma screenshot composed using Screenie

Benjamin was already playing with that. Helder was using it for SpeedCrunch. Who else wants to join the club?

Monday, June 02, 2008

Web Inspector under Linux

Are you a web developer, using Linux, and still running Safari under Wine to use its lovely Web Inspector? How about an alternative: use Web Inspector natively under Linux, e.g. inside Arora. Check out my blog post on Trolltech Labs for details.

The obligatory screenshot for your pleasure:

Web Inspector in Arora

Sunday, June 01, 2008

learning git the easy way: gitcasts

Think you have problem understanding git? Want to fast-forward your git skills? Just follow Scott Chacon's excellent and newbie-friendly GitCasts, a collection of screencasts on how to use git.