Saturday, August 20, 2005

Carmacks number

News: Quake-3 source code has been officially released.
Interesting consequence: I come to know about Carmacks number.

In brief, this function was found in the source code of Quake-3 (in 2002, when they released the source code sans engine) to find (read: approximate) the inverse of the square root of x:

float InvSqrt(float x) {
float xhalf = 0.5f*x;
int i = *(int*)&x; // get bits for floating value
i = 0x5f3759df - (i>>1); // gives initial guess y0
x = *(float*)&i; // convert bits back to float
x = x*(1.5f-xhalf*x*x); // Newton step, repeating increases accuracy
return x;

Its basically two iterations of the Newton method - the interesting line to note here is the value of the initial guess 0x5f3759df. This was used by one of the authors of Quake-3 and might not be the great great great Carmack himself but generally attributed to him. Isnt is amazing ... this number hack! Its a pretty unique number - so Google it to find more.

- d.

Wednesday, August 17, 2005

KIO magic

In short its a pandoras box. KIO slaves are wonderful things; it is sad that they are not advertised that mush. KDE can appoint Apple to promote KIO and I bet it will be instantly hotcake.

Two KIO slaves that I recently came to know of:
- locate: - yes, it gives you the obvious extension of locate to konqueror
- newimap: - and yes, this gives you the ability to check and show imap mails in konqueror

Now I will periodically scan the kio protocol database to find cool stuff... That gives be an idea - how about a beagle: kio slave. Hmm... lets see. Keep watching this space.

- d.

Wednesday, August 10, 2005

thumbnail preview of search results in beagle

Beagle doesnt show thumbnail of all retrieved search results (e.g. for HTML, PDF, txt files). This patch (based on Nautilus code) does half of the required work. It shows a thumbnail of the file if the thumbnail exists (i.e. if the file has been previewed by nautilus or konqueror before).

As you will see in the code, the patch tries to create the thumbnail if it doesnt exists but for whatever reason I dont understand, it fails to create a new thumbnail, everytime. Boohoohoohooho...

Beagle advanced/Keyword query

Added support to Best (beagle GUI client) for querying via keywords (aka Advance Search) i.e. based on title/author/mail_sender etc.

Details at bugzilla. Here is the patch.

Happy beagling,
- d.

Sunday, August 7, 2005

End of a Chapter

Today I returned the XBox DVD for Warrior Within. It was comfortably halfway through it, thouroughly enjoying it and was so much into the game. But yesterday after I finished one of the levels, I just felt tired and decided to return the game. Maybe its one of my usual slump-period looming over or maybe I have played with a companion, someone to enjoy the game with me or maybe I have become tired of computer games. Whatever is the cause it means a lot of freedom to me, currently. I dont have to rush home to play the next level nor I have to dream about the fighting styles and waste my dream. And of course, that means I can understand where naive explanation of causality goes wrong in Quantum computing.

- d.

Wednesday, August 3, 2005

Yuppie - nerd :)

Took areqgrfg and scored
My computer geek score is greater than 79% of all people in the world! How do you compare? Click here to find out!
. Hah!

Tuesday, August 2, 2005

beagle kmail/maildir

repolished (but still with a lot of debug messages and comments) version at