< December 2005 >
     1 2 3
4 5 6 7 8 910
Fri, 30 Dec 2005:

Does penny arcade use Ruby on Rails. I knew that they used Postgresql, but Rails is quite a bit of stretch for an image serving system.

By the way, the most outrageous penny-arcade ever was the Fruit F**ker 2000, which they subsequently replaced with a hmmm ... And of course the ipod tribute version of the Fruit F**ker.

Do you like your peanut butter HTTP body smooth or chunked ?

posted at: 18:11 | path: /fun | permalink | Tags: , ,

Jan 2002, college main block, post lunch :

A bike screams up the hill at around 90 kmph, canons into a group of three girls and drags one out for 20-odd metres.

A short gurgling scream, shocked silence. All hell breaks loose. Can't sleep for three days, can't close my eyes.

All over again - yesterday night. I thought I had forgotten - I had, I *have*.

This world has a lot fewer terrors - if you could forget ...

        -- Terry Pratchett, Feet of Clay

posted at: 09:44 | path: /me | permalink | Tags: ,

Thu, 29 Dec 2005:

Was listening to Pink Floyd - Wish you were here and wondering how it applies to a programmer. Of all the things you had to give up to become good at something. The sweet innocence of childhood for the ruthless logic of professionalism. The carmaderie of friends for the competition for the top. Last night, while watching Underworld at home - I took from you, but I gave you so much . Was it a fair deal or were the scales of justice crooked ?

Running over the same old code, 
what have we found - the same old bugs?
Wish you were here ...

Maybe I don't have a reason to be happy. My cousins have fled Bangalore to Dubai and Trivandrum - I couldn't get a ticket to go to Cochin. And it doesn't help at all when people around you, harp on how they are alone.

Let me crank up the volume and forget that the world exists.

posted at: 01:33 | path: /fun | permalink | Tags: ,

Let me repeat, this is not a DRILL. A Mathematics professor was shot dead today at the IISc. The attack is suspected to be by terrorists armed with AK-47s. But I have my suspicions - Math teachers have a lot more enemies than just international terrorists.

Of course, it affects me directly. I was sitting in Purple Haze with Queen playing loud, when I get a call from home asking if I'm ok. And I was stupid enough to pick up the call while in a pub. Now for some awkward explanations of why I was in a pub ... tomorrow.

Btw, if you are afraid - the terrorists have already won.

Don't panic.

posted at: 01:20 | path: /misc | permalink | Tags: , ,

Wed, 28 Dec 2005:

My absolute favourite dilbert, ever

This image is hosted on the Internet archive

posted at: 16:44 | path: /fun | permalink | Tags: ,

There was this thesis that SuperIlu was doing. The general aim was to study if we could freeze a virtual machine on one machine/cpu and migrate it to another - and now we understand a lot more about acorn nut burying squirrel migration patterns than we ever did before. Did you know that evil squirrels say we own your nuts just before they ship you off to the nut mines ? Amazing things they can do these days ...

The jokes aside, it is an excellent example of how Portable.net can be made to do things which it wasn't designed for - in a sort of Model-T driving a flour mill sense. The engine can be stopped ,moved to another machine and the whole thing will keep ticktocking as if nothing happened at all.

If you can read German, you can look at the real thesis. Or if you are like me you can read his implementation notes, which are thankfully in English. for the

Hackers are just a migratory lifeform with a tropism for computers.

posted at: 15:33 | path: /dotgnu | permalink | Tags: ,

Tue, 27 Dec 2005:

With all this discussion about What are you doing on new year's eve, I was just thinking about how simple life was last year.

When 2005 was slowly dawning, I was sleeping in an APSRTC semi-luxury bus headed for Bangalore with all my earthly possessions in a couple of bags.

Of course, now that life is a lot better - I can feel genuinely depressed that I don't have anything to do this 31st Dec. Ironic, isn't it ?

The solution of this problem is trivial and is left as an exercise for the reader

posted at: 18:11 | path: /me | permalink | Tags: ,

Mon, 26 Dec 2005:

It is not a personal opinion. My spam filter seems to seriously suspect Livejournal to be running an email scam - after the latest upgrade.

Of course a quick read through of the junk mail controls showed that the <form> tag is what triggered the scam alarms. But yeah, it's all a big conspiracy.

Common-sense is thinking everyone is out to get you. That's normal -- they are. Paranoia is thinking that they're conspiring.

posted at: 15:42 | path: /fun | permalink | Tags: , ,

Sun, 25 Dec 2005:

I went to a party yesterday night. I don't drink. And generally I am asked why ? - because I look like a dopehead with red blurry eyes. I don't drink, because the word Moderation does not make sense to me. If I drink, I will end up a drunk.

I came up with the quote 'Moderation knows no limits' while walking to office today. It must've been the heat or something, but I was just replaying the conversations at the yesterday's party and the part about moderation struck me. You can interpret this in any way you want. My favourite is you can always be more moderate - sort of going against the word moderation.

Paradoxical word play is often the only way to get yourself out of the cage of well defined concepts. But rarely do I have anything original.

There is nothing wrong with abstinence, in moderation.

posted at: 19:01 | path: /philosophy | permalink | Tags: , ,

Sat, 24 Dec 2005:

Dr Susan Blackmore wrote a very nice book called - The Meme Machine. Essentially it describes that the next form of self-replicating life to evolve are the memes which exist orthogonally from the carrier minds in just the same way organic life lives in comparison to the inorganic matter.

So let me follow up on the latest meme doing the circuit. Yes, the superhero quiz.

You are Batman
Green Lantern
The Flash
Wonder Woman
Iron Man
You are dark, love gadgets and have vowed to help the innocent not suffer the pain you have endured.
And I get a super hero who has no super powers. Well, back to finishing that 'absolut anger' pic.
Now, release your anger! Only your hatred can destroy me!

posted at: 17:47 | path: /fun | permalink | Tags: ,

Disclaimer: I work at Yahoo! and opinions expressed here are truly my own except for the mails quoted, in which I had no part at all.

This is quoted from a thread about Guido Van Rossum joining Google and proves that some people have a sense of humour. This is starting from the fourth thread to spawn off. The subject line stays the same through out the thread.

> No, I take that back. The Most Serious Crime is not putting in "{"s,
> leaving out horizontal space, and adding gratuitous parens and spaces:
> int foo( int bar )
> {
>      if(bar)
>          return(bar+1);
>      return (bar);
> }

I sort of like:

int foo( int bar ) {
    if (bar) return(bar+1);
    return (bar);

That's my "gziped" indentation...

Reply #1: introducing the ternary operator

> I sort of like:
> int foo( int bar ) {
>     if (bar) return(bar+1);
>     return (bar);
> }


int foo (int bar) {
  return bar ? bar + 1 : bar;
> int foo (int bar) {
>    return bar ? bar + 1 : bar;
> }


foo( ....

Then I can reliably locate the implementation with the find function
of my IDE:

$ grep -n '^foo(' *.c

reply: tools make a hacker

> $ grep -n '^foo(' *.c

man ctags

> man ctags

ctags on steroids: man cscope

Of course by then the language wars started :-

All languages must be ultimately compared with The One True Language 
of course...

(defun foo (bar) (return (if bar bar bar+1)))
> (defun foo (bar) (return (if bar bar bar+1)))

(+ bar 1)

But again the C programmers prove that they rule ...

// golf ?

int foo(int bar) {
	return bar + !(! bar);

C++ programmers try to top the effort at simplification - I am too embarrassed to push that code here right now. It is a bunch of code with templates and operator overloading. And finally the killer discussion ...

> formatting. Try arguing with people about size of TAB (You can get 2, 4,
> 8 and even 3!!) or whether there should be space after an 'if'

A tab should be exactly one tab in length.  No more, no less.

Friday nights, eh ? It was as if the entire crowd said - who cares whom Google hired, let's discuss important things like where to put braces.

The reason why worry kills more people than work is that more people worry than work.

posted at: 17:29 | path: /fun | permalink | Tags: ,

I usually work on the command line. 80x25 columns are a lot easier to read than the X terminals with fonts. With my old box, I used to use mpg321 to play music on Alt+F6 terminal. mpg321 sucks totally here - but xmms works well, except for an application xmms uses obsolete OSS audio interface warning in the kernel. Also these days, a lot of what I have are .ogg files. I don't really like mplayer - mainly because it doesn't let me enqueue songs, like xmms does. I could use xmms easily, if I didn't have to switch back to X to skip a song or reduce the volume.

Necessity is the mother of invention, but I didn't have to invent an entire media player here. I had the xmms-remote code in my distfiles directory and I started poking in there. Before soon, I discovered that I had python bindings installed as well. The API is amazingly easy to use. I wrote the xmms code in about 10 minutes - doing curses without any documentation took some time (thank $deity for the test_curses.py)

You can get my original 100-odd lines of cxmms.py. It is pretty much self-explanatory, except for the gratuitous use of lambda. Also it is a good example of how to wait for user input while other screen updates are required. And I want to use the j search shortcut - any volunteers to hack that into the current code ?

It was now 4 AM saturday morning. Sleep is slowly starting to become an optional requirment for me. I went back to the bed and picked up the book to continue reading and the next page had these lines in it.

He was in the company of ... another man who would stay up all night 
in order to invent an alarm clock to wake him up in the morning.

I got distracted by this while I was hacking away in jit-interp.c trying to fix stack allocation ordering. Reminds me of the last chapter of So Long and Thanks for all the Fish.

Maybe I should trade in this life and ask for a refund ?

There was a point to this story, but it has temporarily escaped the chronicler's mind.
             -- Douglas Adams

posted at: 16:44 | path: /hacks | permalink | Tags: , ,

RAID-0 has been causing problems for me over the last few days. Finally I opened up the bloody box and re-connected the two 200 GiB hdds to the main SATA controller. Took some time to actually push all the data onto a borrowed 250 Gib usb hdd - before I broke up the RAID-0 setup. After all that, now the system is back to normal.

/dev/sdb1              47G   42G  4.9G  90% 
/dev/sdb2              47G   15G   33G  31% 
/dev/sdb3              92G   48G   40G  55% 
/dev/sdc1              48G   34G   15G  71% 
/dev/sdc2              48G   48G  159M 100% 
/dev/sdc3              90G   42G   44G  49%

Looks like I can finally throw out Fedora Core 3 out of the box.

posted at: 16:31 | path: /hardware | permalink | Tags: , ,

Fri, 23 Dec 2005:

Got thunderbird 1.5rc2 compiled and with all the debug options in there.

[tbird@gopalv ~]$ /opt/thunderbird/bin/thunderbird --debug

/usr/bin/gdb /opt/thunderbird//lib/thunderbird-1.5/thunderbird-bin \
             -x /tmp/mozargs.AD6303
(gdb) r
Starting program: /opt/thunderbird/lib/thunderbird-1.5/thunderbird-bin 

Break points in place and broken into

(gdb) break nsImapProtocol::Logout
Breakpoint 1 at 0x238c9a9: file mozilla/mailnews/imap/src/nsImapProtocol.cpp, line 5677.

(gdb) bt
#0  nsImapProtocol::Logout (this=0x9b91f60, shuttingDown=1, waitForResponse=1)
    at ./mozilla/mailnews/imap/src/nsImapProtocol.cpp:5677
#1  0x0237df2a in nsImapProtocol::TellThreadToDie (this=0x9b91f60, 
    at ./mozilla/mailnews/imap/src/nsImapProtocol.cpp:1035
#2  0x0237f8ee in nsImapProtocol::ProcessCurrentURL (this=0x9b91f60)
    at ./mozilla/mailnews/imap/src/nsImapProtocol.cpp:1475
#3  0x0237e4f4 in nsImapProtocol::ImapThreadMainLoop (this=0x9b91f60)
    at ./mozilla/mailnews/imap/src/nsImapProtocol.cpp:1140
#4  0x0237d985 in nsImapProtocol::Run (this=0x9b91f60)
    at ./mozilla/mailnews/imap/src/nsImapProtocol.cpp:931
#5  0x007e9ba2 in nsThread::Main (arg=0x9b91f30)
    at ./mozilla/xpcom/threads/nsThread.cpp:118
#6  0x00288f9e in _pt_root (arg=0x9b9aa90)
    at ./mozilla/nsprpub/pr/src/pthreads/ptthread.c:220
#7  0x001163ae in start_thread () from /lib/tls/libpthread.so.0
#8  0x00672aee in clone () from /lib/tls/libc.so.6
###!!! ASSERTION: syntax error in generic parser: 'PR_FALSE', 
file ./mozilla/mailnews/imap/src/nsIMAPGenericParser.cpp,
line 94

Some progress, at least - we know that somewhere the syntax parser is screwing up :)

(gdb) break nsIMAPGenericParser::SetSyntaxError if error!=0
Breakpoint 4 at 0x233407b: file ./mozilla/mailnews/imap/src/nsIMAPGenericParser.cpp, line 90.

Breakpoint 4, nsIMAPGenericParser::SetSyntaxError (this=0x9c937ac, error=1)
    at ./mozilla/mailnews/imap/src/nsIMAPGenericParser.cpp:90
90        fSyntaxError = error;
(gdb) bt 4
#0  nsIMAPGenericParser::SetSyntaxError (this=0x9c937ac, error=1)
    at ./mozilla/mailnews/imap/src/nsIMAPGenericParser.cpp:90
#1  0x023a2243 in nsImapServerResponseParser::SetSyntaxError (this=0x9c937ac, 
    at ./mozilla/mailnews/imap/src/nsImapServerResponseParser.cpp:2922
#2  0x0239ffcf in nsImapServerResponseParser::msg_obsolete (this=0x9c937ac)
    at .mozilla/mailnews/imap/src/nsImapServerResponseParser.cpp:2122
#3  0x0239cffb in nsImapServerResponseParser::numeric_mailbox_data (
    at ./mozilla/mailnews/imap/src/nsImapServerResponseParser.cpp:1031
(More stack frames follow...)

(gdb) p this->fNextToken
$2 = 0x9bdf13f "NO"
(gdb) p this->fCurrentLine
$6 = 0x9b76f50 "* 1072 NO  message error; can't fetch that message\r\n"

Ok, so the IMAP server returns some error message which my t-bird fails to understand ? bienvenu_ asked me to get an IMAP client side log

export NSPR_LOG_FILE=/tmp/tbird.log

The log file data is a bit interesting, but not really anything to wake anyone up.

112905136[b6562480]: ReadNextLine [stream=b6562750 nb=52 needmore=0]
112905136[b6562480]: b6559af8:us.f318.mail.yahoo.com:S-foss.in:
  CreateNewLineFromSocket: * 1072 NO  message error; can't fetch that message
112905136[b6562480]: b6559af8:us.f318.mail.yahoo.com:S-foss.in:PARSER:
  Internal Syntax Error: %s: * 1072 NO  message error; can't fetch that message
112905136[b6562480]: b6559af8:us.f318.mail.yahoo.com:S-foss.in:SendData:TellThreadToDie: 8 logout
112905136[b6562480]: b6559af8:us.f318.mail.yahoo.com:S-foss.in:TellThreadToDie: close socket connection

Let us move onto the RFC - 2060 (IMAP version 4, revision 1). Scroll down to section 6.4.8. The UID command seems to expect 'NO' as a valid response - but it is not entirely clear whether "* 1072 NO" is valid in the current context. (updated: bienvenu_ told me that's a valid response). Right now, hacking on a quick fix to ignore 'NO' lines in that output.

Index: nsImapServerResponseParser.cpp
RCS file: /cvsroot/mozilla/mailnews/imap/src/nsImapServerResponseParser.cpp,v
retrieving revision
diff -u -r1.122.8.2 nsImapServerResponseParser.cpp
--- nsImapServerResponseParser.cpp	22 Sep 2005 23:29:11 -0000
+++ nsImapServerResponseParser.cpp	23 Dec 2005 02:29:24 -0000
@@ -1027,6 +1027,11 @@
         fFlagState->ExpungeByIndex((PRUint32) tokenNumber);
+    else if(!PL_strcasecmp(fNextToken, "NO"))
+    {
+       /* crude !! */
+       skip_to_CRLF();
+    }

One night's sleep - wasted.

Users who debug, shouldn't be punished for it

posted at: 07:57 | path: /hacks | permalink | Tags: , ,

My box had to be powered down - overheating. All this recompiling thunderbird is driving it up a wall. It has been a while since I had it reboot.

03:30:22 up 76 days,  7:23,  6 users,  load average: 1.91, 2.06, 1.65

Sad, very sad ... but sometimes you've just got to power cycle and hope everything is back to working condition.

Think of all that wasted power.

posted at: 04:54 | path: /misc | permalink | Tags: , ,

Managed to do too many things and screwed up everything ... Now I am stuck up shit creek without email.

+++ making chrome /tmp/thunderbird/mozilla/netwerk/resources  => ../../dist/bin/chrome/en-US.jar
error: file '../../toolkit/locales/en-US/chrome/necko/contents.rdf' doesn't exist at ../../config/make-jars.pl line 418.
gmake[4]: *** [libs] Error 2
gmake[4]: Leaving directory `/tmp/thunderbird/mozilla/netwerk/resources'
gmake[3]: *** [libs] Error 2
gmake[3]: Leaving directory `/tmp/thunderbird/mozilla/netwerk'
gmake[2]: *** [tier_9] Error 2

Screwing up - it's my gift, it's my curse...

posted at: 04:12 | path: /rants | permalink | Tags: , ,