Sunday, October 30, 2005

desktop search (read beagle) vs web search (google)

Its been 5 months since I was introduced to beagle and started using it. And thanks to Joe, Jon, Daniel, Fredrik, Varadhan (and many others), beagle is quite mature now. They would say (and me too) home-use safe.

Hanging out in beagle irc channel and sometimes fiddling with the code has given me quite a good exposure of beagle internals. I liked it. With the C bindings (libbeagle) and python bindings (pybeagle), non-C# users can also create cool apps for beagle. I am waiting for somebody to write a kicker applet.

Anyway, I am recently feeling a bit separated from beagle. I was inclined towards beagle because I had to search something and I wasnt sure where to grep and what to locate. But for the last few months, I have hardly used beagle to find something in my computer. On the contrary, I use google probably 100 times a day or more. Why is it that searching in my files is so less infrequent than searching on the web ? It might be that its only me. A computer science research student doesnt need to find a lot of stuff (e.g. papers) among his own files. For him, a lot more is available on the web. So for me, I dont search a lot in my files not because I dont have the tool to search but because I dont have the data to search. Given that desktop-search is the new buzzword in the town, I just hope not many people are like me.

- d.

PS: Next in coming, more KDE support for beagle. Konqueror web-history indexing, Konqueror Bookmark indexing and (probably) thumbnail preview for best results in KDE!!! Stay tuned.

Friday, October 21, 2005

beagle superkaramba

python bindings for beagle is done. Fancy stuff should start pouring in like kicker, gnome applets, superkaramba widgets etc...

[kblogger] test-2

I think I understand the current problem. lets see if this helps :)

last post from kblogger was horrible. lets see if this one work ok.

[kblogger] test

Monday, October 17, 2005

Yeah Quake!

One word YaKuake.

Consequences:
I dont need to click the xterm button or konsole button now and then, type a 1-2 line command to do something and then close it. A konsole is just an Window key.
I dont need the window, better than minimizing - press the window key once again - it hides smoothly.
The hiding and reapperaring animation is pretty cool.
I have access to the same terminal (which can open multiple tabs, btw) on every desktop.
Less number of konsole running, so less resource wasted.
I have my animation time set as ~50ms - so I get the terminal (its already preloaded) without any significant lag (for konsole and even with xterm, it took ~1 second to launch).
And many more ... give it a try. Visit kde-apps for packages etc.

Vim Emacs flamewar

I always like to get in the middle of Vim-Emacs fight. Of course I am on the Vim side. Yesterday, Vim 6.4 was released. And what made me laugh ? The following post from slashdot:
...
Look, as good as vim could be, at this rate, you are not going to catch up with emacs, which is already at version 21.x or something. Which just proved that emacs is much better. If you don't believe, here is some proofs:

1- Emacs has a much higher version number, which proves to be a more mature software, which proves to be better (more mature is better)

2- Even an icon such as RMS whom has been proved to be more intelligent than the average USians, uses Emacs. This shows that smart people always make the right choice, and in reverse, proves that Emacs is better than Vim.

3- Everyone in Cryptonomicon, which is the bibile of all geeks, uses Emacs. We even have a module for encryption. It would take a long time for Vim to catch up to that kind of functionalities.

4- Only in Emacs can you do Ctrl-A to move the beginning of a line. In one shot. How could you do that in
Vim? You have to Esc, then press 0, which is lame. Which just shows how advanced Emacs is in terms of maturity and functionality.

5- As the theorem goes, computer science is a science for minimizing keystrokes. Emacs, in contrast to Vim, can prove this theorem right. Emacs users press less keys than Vim users.

6- Humans have 10 fingers (some may have more, but I don't know how to grow them), and Emacs allows you to use all your fingers at one. Which shows you that Emacs has a better human user interface. In contrast, Vim users can only type one key at a time, which has no concept of fingers. That is like an interface for dogs, which can only press one key at a time with their paws.

7- Emacs allows users to stretch their fingers more, and finger exercise has been proved, again and again, scientifically, to help increase human intelligence. The more you use Emacs, the more you become intelligent. Unlike Vim users, who become dumber and dumber, and end up with paws.

8- Everyone knows that geeks do no exercise. But we Emacs users have our daily dose of finger exercise. As a result, Emacs users have better shape. Take a look at the comparison: RMS (Emacs user) vs ESR (Vi user). RMS definitely looks better, with a nicer beard too. ESR can only have a lousy Asterix moustache. And look at what these two persons said in public, which just proved points 2, 6, and 7.

9- Look at this deductive proof I'm giving right now. Only an Emacs user can attain this level of intellect.

10- As a result of the last 9 points, this proves that Emacs is better. And from an evolutionary point of view, Emacs is like modern humans, and Vim like chimpanzee.

* putting on flame suite *

Tuesday, October 11, 2005

Duff's Device

I thought I was quite good in C. Duff's Device got me wrong! Check the wikipedia page for details; the original post is here. This is what it is, in brief.


Consider the following function in C to copy count integers from from to to:

void copy (int *from, int *to, int count)
{
do {
*(to ++) = *(from ++);
} while (- - count > 0);
}

This requires count comparisons. One way to cut down on the number of comparisons is to use partial loop unrolling:

void copy (int *from, int *to, int count)
{
int n = count/8;
int rem = count % 8;

// copy rem times
do {
*(to ++) = *(from ++);
} while (- - rem- > 0);

// copy 8*n times
do {
*(to ++) = *(from ++);
*(to ++) = *(from ++);
*(to ++) = *(from ++);
*(to ++) = *(from ++);
*(to ++) = *(from ++);
*(to ++) = *(from ++);
*(to ++) = *(from ++);
*(to ++) = *(from ++);
} while (- - n > 0);
}


Tom Duff had this ingenious idea of exploiting case-fall-through behaviour of C switch-case statement to write a smaller code:

void copy (int *from, int *to, int count)
{
int n=(count+7)/8;
int rem = count % 8;
switch(rem){
case 0: do{ *to++ = *from++;
case 7: *to++ = *from++;
case 6: *to++ = *from++;
case 5: *to++ = *from++;
case 4: *to++ = *from++;
case 3: *to++ = *from++;
case 2: *to++ = *from++;
case 1: *to++ = *from++;
}while(- - n > 0);
}


While you are trying to understand whats going on, let me answer the first question covering your mind, Yes! This is a prefectly legal C (even more, legal C++).

Thursday, October 6, 2005