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

Wednesday, October 31, 2007

10 signs that you aren’t cut out to be a developer

As pointed out by Andry, Justin James' 10 signs that you are not cut out to be a developer is an absolutely obligatory reading for anyone.

Here is the checklist, go there for the details:

  • You’d rather be trained than self-teach
  • You like regular working hours
  • You prefer regular raises to job-hopping
  • You do not get along well with others
  • You are easily frustrated
  • You are close-minded to others’ ideas
  • You are not a "details person"
  • You do not take personal pride in your work
  • You prefer to shoot first and ask questions later
  • You do not like the geek type of person

My favorite is the close-mindness. Long time ago, I was told by someone that in order to be a great programmer (substitute this with other type of profession), you must unconditionally accept the fact that there are better ones than you. Only then you can reach the "enlightment".

Which one is your favorite?

Tuesday, October 30, 2007

Motorola w205: some tips

After using Motorola w205 for some time, here I would like to share common tips which might be useful for others new w205 users:

Does it support key lock? Yes, of course. To lock the keypad, press menu button (middle button in the four-way pad) followed by * (star). If the screen becomes suddenly black, then the key locking is successful. To unlock, do the same step.

How to disable iTAP? iTAP is intelligent typing (or rather TAP-ping) technology from Motorola, used for writing text message (SMS). It's claimed to be better than T9 (text-on-nine) which is used everywhere else (Nokia, SE, Siemens, ...), but my personal experience shows that iTAP is inferior to T9.

There is no really menu item for disabling iTAP. The trick here is to switch the input method from iTAP to TAP . So iTAP means intelligent typing and TAP means non-intelligent typing. Yes, it's very confusing and not usable at all.

While you're composing an SMS, just press the menu button so that Input IME Menu shows up. There you can move from iTAP English (or German, French, etc) to TAP English (or German, French, etc). Then press the soft-button for Select. Now, word autoguessing is inactive and you can enjoy normal typing thumbing again.

If you feel like using iTAP again, just change the input method to iTAP English (or German, French, etc).

How to switch between capital and lower-case letters? This is also not obvious. When typing an SMS, suppose now the display always shows capital letters for each button that you tap. When you press 2, A will show up and it is highlighted. Right away press 0 and that A will be transformed to a. If you continue thumbing, only lower-case letters are produced. To switch to capital letters, just do it again (press a button, continue with 0 while the character is highlighted).

Why right away? Because 3 seconds after you press a button, the displayed letter will not be highlighted anymore and thus you can't change the case from lower-case to capital and vice versa.

Why 0 button? If you see carefully, there is a symbol that resembles an up-pointing arrow that button. So, it is supposed to be a shift key like in a typewriter or a keyboard.

(Picture from official Motorola w205 site)

Monday, October 29, 2007

PictureFlow on real device (or CoverFlow on Chumby)

Update: see also PictureFlow running on different mobile devices, from Greenphone to HTC smartphones.

Chumby is a new hardware widget with open systems design. Jesper recently showed how to put Qt on Chumby, along with PictureFlow, as can be seen in his YouTube video:

Chumby is not even yet available on stores, you got it only if you're an insider. And it's like only a week after I placed the code of PictureFlow on the net. And with Jesper's nice work, this cool little Chumby has already CoverFlow-like effect on par with iPod.

It is also a proof that PictureFlow's performance is satisfactory even on portable device. Chumby has only a 300Mhz ARM9 processor, but the effect is quite smooth.

So, who's next?

Thursday, October 25, 2007

Still PictureFlow: improving the rendering quality

Still about PictureFlow, my CoverFlow-effect clone, I did give some thoughts on improving its rendering quality without sacrificing the performance and still doing it in software (no help from graphics card).

The first that came to my mind is by using bilinear filtering in the texture mapper. As you might predict, the texture mapper itself needs only affine transformation, each cover/slide is rendered column-by-column. Since the z distance for all pixels in a column is constant, affine transformation is enough and can be implemented efficiently. Adding bilinear filter, however, means doing linear interpolation for each and every pixel. If it is done in one dimension only, i.e. vertically, that is still manageable. But since (to assure the quality), we need to perform it in both dimension, the whole stuff would become too slow.

Then one morning I realized that I don't really need to do the filtering on-the-fly. Just transform the cover image before it is rendered to screen, we can take advantage of Qt's smooth pixmap scaling for this purpose. Won't be as good as real interpolations, but everything up to now are dirty hacks anyway.

Here is the result so far (clink to enlarge). Compare the filtered version against the original nearest-neighbor approach. Can you spot the improvement?

For starter, you can see that the jaggy lines between the cover images and the black background (obvious when the cover is white) become less noticeable in the filtered version, as shown below. Left is nearest neighbor, right is bilinear filter:

There is no impact at all on performance when doing the animation effect, everything is as smooth as before.

There are however disadvantages with my first approach. First, the cover image is enlarged four times in both dimension, thus making it consuming 16x more memory space. The surface cache becomes very large. Even for book covers (150x200, stored in ARGB32 format), each of them requires 1.8 MB. This is terrible for portable device, although still manageable on modern desktop machine. In addition, creating the surface cache is slower now due to the necessary image scaling.

The next steps would be more optimizations. First, the surface cache will still keep the original dimension (150x200 in the above example). The scaled version will be constructed only whenever necessary, i.e. right before it is texture-mapped. In addition, there is no need to perform filtering while the animation still takes place. The covers move so fast, a bit sacrifice in the quality won't be noticeable to human eyes.

Let's see where this brings me further. Seems that software-rendered CoverFlow effect done in C++ with a quality that can match hardware-assisted version is quite feasible.

Monday, October 22, 2007

PictureFlow, a clone of CoverFlow as a Qt widget

Another no-time-yet-to-finish-it pet project of mine is a media player, something like for media center or portable device. I code it in SDL, in a hope that targeting platforms like GP2x and Nokia N800 are easy. But knowing that Qtopia (soon) runs also on N800, I am thinking of moving the code to pure Qt for ease of maintenance.

Unless you live under the rocks, CoverFlow should sound familiar. For the said media player, I have an efficient implementation of CoverFlow effect, called PictureFlow. Last weekend I decided to port the code to sane C++ and Qt and here is what I get now:

PictureFlow: a clone of CoverFlow effect

or, like the trend nowadays, in the following short screencast (if it is not visible, go to http://youtube.com/watch?v=uwE_UIHSWnY directly):

You can see that the typical "flowing" ala CoverFlow is implemented already. Even, the first and last covers always fades in and fades out during the animation (so a cover just doesn't come in out of nowhere). Reflection is also there, done by crude-blending the cover with black (that's why black background is so sweet!) and then placing it in the surface cache.

The important feature of PictureFlow is that it does not need 3-d accelerated graphics system. Everything is done in a software renderer. This is not so surprising, consider that I target the original media player for portable device(s). Even the latest sub-GHz iPod can have CoverFlow, so there is no reason to demand fast OpenGL implementation just to enjoy this little piece of eye candy. As long as blitting to screen is fast, you're set. Moreover, no floating-point operation is carried out so that it's fast enough even on ARM-like platforms.

On the other, using pure software renderer has a major drawback, namely the rather lower rendering quality (traded for optimal speed). As you witness from the screenshot, the edges of the tilted images are jaggy. However, with 225 dpi screen like in N800, these jaggy lines (hopefully) won't be noticeable. This can't be avoided without causing too much performance penalty. In fact, technically there is not even a perspective-correct texture mapper. It is just the same hack like the texture mapper done in raycasting-based game, e.g. the classic Wolfenstein 3-D ages ago. This is also the reason to bypass Qt own rasterizer, as we can do some sort of "cheating" and map the texture really fast. Texturing is done more like nearest neighbor approach rather than bilinear filtering, which gives less pleasant result if you stare at the rendering result too long.

Also, software renderer is much slower than hardware-assisted one. Thus, the trick is to keep the widget as small as possible, but not smaller. With reasonable size like 800x350 pixels, on fairly modern machines, you'd get something like 45 fps, which is quite satisfactory. I even tested on old 800Mhz box, it is not as smooth as in a dual-core system, but runs nevertheless well enough.

Overall, this widget is still very basic though already functional. For example, there is no text nor fancy scrollbar which are typically superimposed on bottom side. I guess, in this case, you can subclass PictureFlow widget and add the extra gimmicks by yourself. In addition, as trade-off, covers with alpha channel and covers with non-uniform size won't be supported, this is to minimize texture overdraw.

Anyway, this widget is released as open-source (under MIT license), see http://pictureflow.googlecode.com. So, just grab it while it's hot.

Some ideas where it could be useful elsewhere:

  • For album browsing in Amarok. At the moment, Amarok for KDE4 has its own CoverFlow-like feature, but last time I check it requires OpenGL so it works well only when the graphics system is 3-d accelerated.
  • Choosing a slide in a presentation (so maybe it could be integrated into KPresenter?). Imagine you're running your presentation and one of your audience ask you to show some previous slides, wouldn't be cool when you flip through the slides with this flowing effect?
  • Quickly skim through photos, useful in Digikam, Gwenview, or similar imaging tools. Since it's used as a chooser, not full-fledged slide show, the size could be kept small and thus the performance should be acceptable.

Any more ideas?

Sunday, October 21, 2007

Thai Sambal Oelek?

Starting from Monday, for few days Lidl Germany will sell some Thai stuff, mostly food and spices. While reading the flyer and also its website, I stumbled upon this:

I have no doubt that similar type of strong sambal is available elsewhere, and/or maybe the supplier of the said sambal oelek is indeed from Thailand. But at least let's not claim it as Thailändische Würzpaste. It is even so obvious from the van Ophuijsen spelling of "oelek". When speaking about sambal oelek, it is definitely typical Indonesian sambal.

Das ist die Wahrheit.

Wednesday, October 10, 2007

back to basics: Motorola w205

During my adventure to find an ideal mobile phone, I often get arguments like: well, if you don't need a particular feature, just don't use it. The counter-argument is easy: if I don't need a feature, why should it exist after all? Reducing the complexity of software and hardware in a mobile phone could simplify a lot of things, increase the battery life, ease the technical support, and possibly even as far as improve its environment-friendliness factor. However, normally it also means less profit for phone sellers.

Fortunately, for those who are old-fashioned and need simple and basic mobile phone without all the unnecessary gimmicks, nowadays there are already choices from Nokia (1110, 1600, 2610), Sony Ericsson (J110, J120, J220), Samsung (SGH-C300), Motorola (F3, w205, w208), and many others.

Some time ago, I decided to bite the bullet and switch from the lovely black Motorola RAZR V3 to another phone: Motorola w205 (SAR head: 0.83 W/kg, body: 0.48 W/kg). It is considered one of the latest entry-level basic mobile phone as it is available only since Q1 this year. From Amazon.de, it costs only 46 euros including VAT and shipping. There are even cheaper offers, if you are willing to take SIM-locked phone in a prepaid bundle.

The phone is compact and light. It can do SMS but not MMS. I don't really care for MMS, all these 6 years using mobile phone, I have sent like 2 or 3 (useless) MMS. As for typing SMS, instead the common T9, again Motorola's own iTAP is used for intelligent/predictive typing. It is a minus point for me, for I always hate iTAP and disable it all time, but I guess I can live with that.

Its 1 MB memory is enough for 500 address book entries or 750 SMS. With 850 mAh Li-Ion battery, it is claimed to have talk time up to 8 hours and stand-by time up to 12 days. For sure, I reach the charger less often than with RAZR. If this is not enough, more powerful 1700 mAh battery is available for less than 7 euros.

The phone has a decent color display, 128x128 pixels with 65 thousand colors. Actually, I'd prefer to get a sharp black-and-white display with e-ink technology (as in Motofone F3, but the dot-matrix version thereof) as I'm sure the battery life would even be improved. But again, this one is already good enough.

There is no camera in this phone. Also no infrared. No Bluetooth. No WAP. No GPRS. No MP3 player. No radio. No singing-and-dancing stuff. No extra bells-and-whistles.

I am a happy man.

(Picture from official Motorola w205 site)

Sunday, October 07, 2007

OpenSUSE 10.3: first look

I know I should be doing something "useful", but the fresh-from-oven OpenSUSE 10.3 is just too good to skip. Thus, I decided to waste a weekend to try it. In short: it's very solid and attractive, without doubt the best OpenSUSE release so far.

Installation (and upgrade) was easier than ever. Now we need only one CD. I choose KDE of course. For most users, this means getting openSUSE-10.3-GM-KDE-i386.iso through http/ftp/torrent, burning it, and using it to perform the installation.

The first boot after the installation (yes, it's green again!) shows that boot time is needed really improved. My laptop needs 54 seconds until I get a fully functional KDE desktop, it takes at least 70 seconds with OpenSUSE 10.2, 90 seconds with Windows XP.

Green Desktop

Post installation, I had little problem trying to connect to Internet using my DSL modem, even after the usual steps of removing NetworkManager and installing KInternet. It turned out, somehow smpppd is not activated by default. If you experience the same problem, the solution is easy: run YaST, System, System Services (Runlevel) and then enable smpppd. While you're there, try to tweak some services and turn off what you don't need (e.g. for pure desktop, no need for postfix).

And while doing software management, one quickly notices that package management is thousand times better compared to the previous versions. With OpenSUSE 10.1/10.2, doing things with packages is just unbearable without Smart, IMO zmd along with its Mono stuff are not for mere mortals. However, now zmd is gone, zypp is already greatly improved and thus making application installation in OpenSUSE 10.3 significantly faster than ever. Even better, if you are used to subscribe to alternative repositories (e.g. Guru, Packman, KDE:Backports, etc), there is a new Community Repositories module in YaST which allows you to add common non-official repositories with only few mouse clicks. This is extremely simple even for novices.

OpenSUSE 10.3: Click-and-install feature

But the best is yet to come. Now OpenSUSE offers one-click application install. This is a new feature which will be appreciated by typical desktop users. Rather than using YaST to install new software, you just go to http://software.opensuse.org/search, search for the program, and then click on the 1-Click Install button to start the installer, which will download the packages (and handle the dependencies, if necessary) and install them for you. It couldn't be easier, extremely useful for Linux newbies. It also resembles the way most applications are installed in Windows, a plus for those who switched or want to switch.

Of course you can still use the familiar YaST to install and remove programs as usual. At first, maybe you'll be a bit surprised because the icons in YaST have been changed. Looks like these new icons are designed to match Tango icon sets. If you prefer the good old Crystal style, just follow binner's tips: remove package yast2-theme-openSUSE and install yast2-theme-openSUSE-Crystal instead.

As with any fresh Linux box nowadays, you need to perform the extra steps to install non open-sourced stuff so that you can enjoy e.g. your MP3 music. With the new click-and-install, this also couldn't be easier. Just go to http://opensuse-community.org/Restricted_Formats/10.3 and click on codecs-kde.ymp link. The same installation wizard will pop-up, then just follow the step-by-step instructions. In addition to multimedia codecs, you can have the option to install Java (1.5 or 1.6) and Flash plug-in as well. All with few mouse clicks.

The same easy procedures apply also for installation of proprietary NVIDIA or ATI driver. For example, for ATI graphics card, just read the super-simple instructions, again a matter of clicking a link (even a child can do that!). You don't even need to know the model of the graphics card.

Conclusion: with one CD install, faster boot, easier package management, single-click application install, OpenSUSE 10.3 is definitely worth to try. For 10.2 users: upgrade!

just one chance, just one breath

It is definitely interesting to know Oslo, one of the most beautiful and also most expensive city in the world.

My first touchdown wasn't that smooth, however. Just a day before I left, I caught a terrible cold. This was likely because I was too tired after the 5-day conference in Berlin and had only few hours to rest. I travel very seldom, but just when I had these important flights, both were delayed and caused some incoveniences. I still managed to get the very last express train from the Oslo airport to the crowded downtown (this was weekend afterall) and found my hotel. So here I was cold, sick, hungry, with this bad fever, looking around trying to feed myself with some sensible food and hot drink at over midnight in a completely foreign land, at the same still trying to understand the Norwegian Kroner. Fortunately everyone here does understand English. And fortunately there is Deli de Luca everywhere. In the end I was finished with my business at 3 am and fell asleep almost immediately.

Nationaltheater Oslo

I took the time on Sunday to take some needed rest. In the afternoon I met Helder, the current maintainer of SpeedCrunch, and he became my just-in-time guide and showed me some nice spots of Oslo, although the weather wasn't so friendly. We had a nice dinner together. Of course we discussed a bit about SpeedCrunch. Unfortunately Johan did not manage to come here; otherwise we're set for a SpeedCrunch Developer Conference :-)

I spent Monday mostly in Trolltech office. Some faces were already familiar to me and it's good also to finally meet some others chaps I know only in names as well as few other famous Trolls. Simon gave me a tour of all the cool stuff they have. It was definitely very impressive.

My time in Oslo was obviously too short. And due to the weather, I still missed some beautiful sights Helder told me. For sure, I must go back again someday...