My blog has been moved to ariya.ofilabs.com.

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://github.com/ariya/screenie.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.

Monday, May 19, 2008

on teamwork

Good coders solve problems. Great teams make history.

-- tagline of Microsoft Visual Studio ad

Tuesday, May 13, 2008

HTML5 video with reflection

Poor Tor Arne. After his super-secret project is leaked, our HTML5 Media ninja has no other choice but to reveal all his cards. HTML5 video/audio, important for next-gen web content, will be available in Firefox, Opera, and Safari, is finally supported in QtWebKit, thanks to Tor Arne. As he wrote there, basically we use Phonon, the multimedia API available from Qt 4.4 onwards.

Since WebKit (thus also QtWebKit) already supports CSS reflections, I decided to combine both the video and the reflection effect. Of course, it just works (click-to-enlarge):

HTML5's Media element with reflection

(As a new WebKit hacker, my skill is only at cranking HTML+CSS like this. Credits should go to Tor Arne and other WebKit chaps for doing the real work).

If you have sharp eyes, you can see that the following HTML snippet is all you need:

<video src="videofile.ogg" controls="true" style="-webkit-box-reflect:below 1px;" />

More info on the video tag is available elsewhere. Bear in mind that this probably does not work in many common browsers like Firefox 2. You need the next-gen web browsers, try Safari 3.1. You can even use Arora, if you build it against WebKit trunk.

Note that all the bleeding-edge features are available only in WebKit trunk. Unless you want to experience the hassle of building QtWebKit yourself (hint: it is not that difficult actually), the best bet is of course to wait for the Qt 4.5. With the recent addition of NSAPI plugin support (yes, you can watch YouTube using QtWebKit) and now HTML5 Media element, I am excited to see the what kind of plasmoids will show up. But likely within the frame of KDE 4.2, if not 4.3. So, yes, it will take time. Once it is there, however, the sky is the limit. Using both Flash and Media element, imagine all the QtWebKit-based plasmoids deliver the best of YouTube videos, the highest rated movie trailers from the theaters in your neighborhood, some webcam views from your upcoming holiday destination, hand-picked favorite Internet radios and podcasts, etc etc to your desktop.

Sunday, May 11, 2008

the ninja made a movement

So you think Ken Lee is the best Internet meme? Hold on, you haven't seen Benny Lava yet!

Saturday, May 10, 2008

before you know it you're frozen

Screenshot of AccuWeather.com just now (to those who said "Gee, it is cold up there!" the moment they knew I was about to move to Oslo):

Tuesday, May 06, 2008

quattro quattro zero

In case you live under the rock and miss Thiago's latest blog post, Qt 4.4.0 is just released. This latest release packs a lot of exciting new features such as Phonon for multimedia stuff, integration of WebKit (open-source web rendering engine), powerful XML processing with XQuery and XPath, the famous Widgets on Canvas and Alien Widget, concurrent programming support for multithreaded processing, Qt for Windows CE, and tons of other enhancements.

Surely you wouldn't want to miss this one!

Sunday, May 04, 2008

I'll walk the seven seas when I believe that...

Holmenkollen ski jump

Finally the weather permits some wonderful sightseeing! The above is Holmenkollen ski jump, with its 60 meter high tower.