< February 2006 >
SuMoTuWeThFrSa
    1 2 3 4
5 6 7 8 91011
12131415161718
19202122232425
262728    
Mon, 27 Feb 2006:

Just for kicks, I did a small XSL hack on my blog feed. Actually it is not completely XSL, there's a bit of javascript in there to change back the xml encoded text into HTML. There is no unescape XPath function, you see. So if you're running Firefox 1.0.3+ or better, give the rss feed a hit with the browser and see what I'm talking about. The XSL style-sheet is in rss2html.xsl.

Clientside XSLT - all the cool kids are doing it.

--
Never offend people with style when you can offend them with substance.

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

While the blug meet was in full flow on saturday, my dev box at work was building a clean copy of firefox off CVS. I just started to build it out of curiousity, but soon I realized that the world of web programming is going to be taken by storm when people start writing code for deerpark. Though it revolts my sense of propriety when browser specific hacks are introduced, this one's a pretty corking feature.

For a few years now, we've been using Applets to display dynamic data from the server side. At that point they were the only real way to actually fetch data from the server without refreshing the page. With the advent of Ajax, that no longer limits writing apps in javascript rather than in java. But still the only way to show dynamic charts and graphs was still to use an applet - No More .

HTML Canvas: This is a new standard from the WHATWG to do procedural graphics. Canvas is different from SVG in that this has context operations like rotation or other transoformation and resemble OpenGL or Postscript rather than SVG. In fact, Mozilla has built its canvas so that SVG is a data model which is rendered on a canvas view.

Since I am too lazy to actually do any graphics work, I'll point you to some excellent examples. Here's the classical tiger sample which keeps popping up whenever someone wants to show off graphics - tiger.xml. For those who still don't believe in the power of this new widget, I present you the graph charts on liquidx. Or the ultimate sample - a wolfenstein model first person shooter written in javascript. Pretty decent game, if you could play one at 8 FPS.

Believe me it is certainly worth downloading one of the nightly tarball if you are averse to building it yourself. Go get it, try it and see it work. I'm surprised that not too many people are blowing hot & cold over this particular feature.

--
Never invest your money in anything that eats or needs repainting.

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

Humans didn't live in cities till a few generations ago. And it shows. We still behave in some very primitive subconscious ways which show our ancestry as hunter-gatherers in a jungle. I suggest you take a closer look at two different (for the record, wholly imaginary) people walking through a mall. One is a mid twenties guy in jeans and a t-shirt which says Look the other way. The other one is a early twenties girl with two friends. They walk down the shop floor extremely confidently but very differently.

Hunter & Gatherer: Who'd be hunting for clothes and who's be gathering ? Even a casual observer will not have any problem finding an answer for that question - which is left as an exercise to the reader. The traits are almost painfully obvious on second thought.

Rather than head off into a discussion of how/why this evolved and end up pissing off half the human race (by intention or accident), I'll just go ahead into the subject.

Threat, Opportunity and Other stuff: That is exactly how an ideal hunter would see the world. You'd want as few distractions as possible. Gather enough information to remove one more variable of the landscape from your conscious thought system. It is either a threat or an opportunity - anything else can be ignored. Of course, when there's a mammoth thundering towards you, you can hardly be bothered by how beautiful the sunrise is.

Since humans were never intended to be carnivores and lack any real professional equipment for the job, we can't completely remove the imagination and creativity from the hunter either. A complete lack of imagination would spell disaster for a creature which would be helpless without crafted tools and co-operation.

The Hunter was not just a way of life, it was a state of mind too. There's still a bit of Hunter in each one of us. It revels in the chase rather than the result, where as the gatherer prefers to accumulate rather than capture. We are both, but we are neither truly.

For, thus the book of Genes read - ' Call me not the hunter or the gatherer. Call me a survivor'.

--
Calvin: I wonder why we think faster than we speak.
Hobbes: Probably so we can think twice.

posted at: 12:44 | path: /observations | permalink | Tags:

Fri, 24 Feb 2006:

I was reading through the php5 parser yesterday and something just hit me. The grammar author had created a static_scalar non-terminal which incidentally expands into a T_ARRAY '(' static_array_pair_list ')' which is wrong (IMHO, of course). The real problem was that who ever wrote the rest of the code assumed that a static_scalar would be a real scalar and it ended up with a parser which would parse the following bad code and even execute it.

<?php

function f( $a = array( 
                     array('x') => array('y')
          ))
{
    print_r($a);
}

f();
?>

Apparently andrei already tried to fix it last night (1.168) - but I don't think so. The right way to fix it would probably be to change the static_scalar expansion to exclude arrays and add a static_variable which has scalars and vectors. Then walk the whole codebase and replace as appropriate. Lot of work and lot of validation needed - which is exactly why I didn't submit a patch ;)

Still, php's the best web templating language around.

--
I never made a mistake in my life. I thought I did once, but I was wrong.

posted at: 15:23 | path: /hacks | permalink | Tags: ,

Thu, 23 Feb 2006:

So there I was watching Simpsons episode 9F21 where Homer talks about his barbershop quartet - the The Be Sharps. It was a quite unmistakable take on the original fab four - The Beatles. But what I hadn't counted on was the amount of research the screenplay and directors had been willing to put into this (or the one I was about to undertake).

I am not talking about the storyline and the parallels between the incident of Pete Best or the arrival of Barney's japanese girlfriend. I am talking about things which you'd miss out unless you took pains to research yourself. Take the Meet the Be Sharps album cover, for example. Compare it with the original cover of the Sgt. Pepper album .

Then there are the stunts which would've been hard to capture easily if it were not for the fact that Simpsons was a cartoon. In one of the studio stills from the recording of Let it be, Yoko Ono is in frame and hiding behind Lennon. In Simpsons we see the same with the machine playing a Number 8 which is sneaky take on the controversial Revolution 9 soundtrack.

John Lennon became infamous for one of his statements which in more cultured terms could be put as - "music transcends all borders, even religion". But he had to brashly put it down as "We're more popular than Jesus now." - this and the previous statements about religion and rock-n-roll cause no end of trouble for the beatles. It does put the following sequel album cover (of the quartet walking on water, like the Abbey Road album) in context (for the Be Sharps).

I can't imagine to quantify the effort pushed into twenty minutes of comedy where all these jokes just fade away on the TV screen before two in a hunderd thousand note these down on a pad to laugh later. I just had the luxury of screenshots and dynamic pausing to actually enjoy these jokes interspersed in the actually story. Of course, it takes a hardcore fan to note down the Moe's *C*avern and that Skinner's prisoner number (#24601) is the same as Jean Valjean.

Simpsons, the Most Accurate Cartoon ever.
And I am a night bird.

--
Real computer scientists don't write code and therefore hardly count (and rarely count accurately; precision is for applications).

posted at: 16:53 | path: /movies | permalink | Tags: ,

Even though libCrayons is taking its sweet time, the drawing library on top of it is actually moving along pretty nicely recently. Brubbel has been working quite hard on the path handling (as the changelog shows). He checked in an absolutely brilliant sample which should show off what pnet's graphics drawing is actually capable of. I've pulled out the code out of the FormsTest for the sake of those who just want to play around with it - TigerPath.cs.

The anti-aliasing and fill curve patches just rock, just take a look at the state the codebase was in before. Three patches in CVS and it is all smooth as silk - *sweet*.

It isn't often a huge patch hits pnetlib - but 600 odd lines in one week sort of makes me happy to just sit back and look at the pretty pictures :)

Now, I'm headed deep to investigate what XmlNodeReader really does...

--
These are merely lines to me, but they paint a picture for you.

posted at: 13:14 | path: /dotgnu | permalink | Tags: , ,

Halfway through debugging APC last night, I started to get seriously bored with the complete lack of success I was having. So I just kicked back and implemented a new feature for pnet. So far pnet's System.IO.Ports implementation has support for regular serial ports, USB ports and Infrared ports - I wanted it to work with bluetooth. For no good reason, the thought popped into my head - backup my phone numbers with a program.

So I started to recall all the AT commands I'd studied so hard while doing mobile phone testing in Wipro. I didn't have a document for GSM AT commands, neither was I sure how to set up a serial simulation via bluetooth. I cheated a bit by doing a strings libgnokii.so | grep "^AT" but I knew what those commands did. After starting the bluetooth daemon, I discovered that hciconfig/hciattach is *NOT* the tool to attach stuff to hci0. The point to note is that you need to know the bdaddr of the phone you want to hook into.

[root@phoenix ~]# rfcomm -i hci0 connect rfcomm0  00:13:70:C3:AA:7A 
Connected /dev/rfcomm0 to 00:13:70:C3:AA:7A on channel 1
Press CTRL-C for hangup

Now this is what happens when I give rfcomm0 as the resource in pnet's System.IO.Ports implementation.

Uncaught exception: System.ArgumentException: Arg_PortName
Parameter name: value
        at System.IO.Ports.SerialPort.set_PortName(String) in ./IO/Ports/SerialPort.cs:574
        at System.IO.Ports.SerialPort..ctor(String, Int32, Parity, Int32, StopBits)
        at System.IO.Ports.SerialPort..ctor(String, Int32)
        at Phonebooker..ctor(String) in phonebooker.cs:52
        at Driver.Main(String[]) in phonebooker.cs:22

Because the terminal I/O device should work with the same API no matter whether it is USB, bluetooth or regular serial ports, there was no real change to the entire code to make it work. Let's just say that it just works and leave it at that.

Then it was smooth sailing to write a small app which would read/write data from the serial port. Essentially the code looks something like the following.

port.Write(command+"\r");

while(port.BytesToRead > 0)
{
	String line = port.ReadLine();
	if(line.StartsWith("ERROR") || 
		line.StartsWith("OK"))
	{
		break;
	}
}

With these four AT commands

  • AT+CSCS='8859-1'
  • AT+CPBS
  • AT+CPBR?
  • AT+CPBR=n
I can select the charset and phonebook I want, check phonebook status and read the nth entry in there. And that basically is what the whole program does.

Just a quick reminder, you need the latest CVS head code of pnet and pnetlib to test this toy out :)

--
If you find a solution and become attached to it, the solution may become your next problem.

posted at: 12:19 | path: /hacks | permalink | Tags: , ,

We've always seen them around. We've also at some level or other accepted and acknowledged them. I'm not talking about the BMW in the garage (bought by daddy dearest) or the bachelor pad full of dim lights & candles. I am talking about some very muted down social signals I've run into over the course of my academic and professional life. These are signals which reflect the granularity of the social grade structure which we all unconsciously are trained to perceive and act accordingly.

Before I dig into my bag of stories, let us look at local social badges. Fair skin is one on the top of my list. In a historical context, it meant that the person was not forced to move around in sunlight and implied a protected life style commonly associated with the rich (always been rich). A prison pallor which is considered unhealthy in some other places would be a glowing social symbol somewhere else. In short, the badges I'm talking about have no significant value in the present context other than what it has been provided by the group.

Tag, you're IT: Anybody who visits an Indian software company (as in a true blue services company) should take a few moments and take a good long look at the identity cards carried around in office. Usually companies have different coloured badges for different graded employees, that is quite normal. Those are signals of a real organizational structure - but look closer. There will be a small group in the crowd who'd be carrying their company ID cards with a customer tag - one that distinguishes them as people who've been onsite and back. This is meant to convey - I'm an important man for my project and I've been abroad . This is a social badge which had nothing to do with the company organization and is purely a product of the office community. The perceived social status of someone who has been onsite completely vanishes when the group is no longer an exclusive elite.

And all I got was: That was probably a bad example, but here's a better one. Anyone who has visited a recurring conference has seen this one. People show up with souvenirs from the the previous events. I've seen people around FOSS.in this year wearing the first Linux Bangalore t-shirt and a larger number wearing the 2004 t-shirt. At Linux.Conf.au I saw a crowd in the old green t-shirts and the red ones too. After resetting my natural ignore switch, these seem to ask the unspoken question - I've been around for a while, what about you ?

Bower Bird Approach: The same scenario shows up when everyone's pushed into a nearly identical cubicle somewhere. Cubicle decorations are another one of the interesting social badges found in the software industry. For some, his/her workplace is a second home - you end up decorating it to be yours. There is a sort of permanence about a cube with half your house moved in that appeals to the ones who have just joined. The elements of decoration might also move towards advertisement - full of free or branded things from the company. I'm not talking about showing off your Employee of the Month rock or I mad a Difference (*heh*) coffee mug. I am talking about pinning up the conference badge from the last one you went, sticking on that chest sticker from the last marathon you ran and of course, the poster that you couldn't find room for in your bedroom. All these say to the guy who walked past that I've been there, done that and still have the poster.

These badges communicate in ways words can't. They are powerful because they can't be denied, they can only be outdone by others. And just because I understand what is happening does not exclude me from participation. So if you see me wearing a t-shirt with New Zealand on it and lugging a LCA laptop bag - just smile.

--
If you are a police dog, where's your badge ?

posted at: 09:44 | path: /observations | permalink | Tags:

Tue, 21 Feb 2006:

Out on the road today, I saw a black flag sticker on a cadillac
A little voice inside my head said, "don’t look back. you can never look back."

Twenty years have come and gone ... but ...

--
Never look back. The view is never as good...

posted at: 18:46 | path: /me | permalink | Tags:

For all those Coupling fans out there, Julia is dead. Those who have watched her say the immortal "don't mind me, I'm dead... " in Season 3 can take a moment to wish her soul to the big white theatre in the sky. Actress Lou Gish succumbed to cancer on 20th February 2006 at the age of 35.


Lou Gish, 1970 - 2006

To say the least, she was funny. She was funny in exactly the ways Jeff wasn't - the wanton pranks over the accidental coincidences. Her fake french accent in The End of the Line was of course the beginning of the line and then the entrance at the right moment to say "Susan, I was Giselle on the phone" are just icing on the cake. After all if Jeff had to have a girlfriend, could it be any ordinary woman ?

They say that when a comedian (or in this case comedienne) dies, they should be remembered with a few tears and lot of laughter. So dig out those episodes again and laugh a bit ...

--
Dying is easy, Comedy is hard

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

Just wondering about how much of it is just hyped up and how capable she is in actually doing stuff. Are stars created on newspapers and tabloids rather than on centre court. I still remember seeing Sharapova struggle against Sugiyama, going through multiple deuces to win every point, hearing the commentator say - " win or lose, this is going to be a good lesson for young Sharapova". So far I haven't actually seen Sania win a match uphill, to quote a newspaper last page heading - Sania beaten... , but not lost. A quite different attitude, don't you think ?


Centre court ignored, from Hindu, 16th Feb

True that we have no super-stars outside the game of cricket, but I feel that the spotlight of attention towards Sania might do more harm than good. Let us wait and see what happen to the Sania vs Hingis from Dubai ... I might be totally wrong :)

--
I always turn to the sports pages first, which record people's accomplishments.
The front page has nothing but man's failures.

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

Went to Cochin for the weekend. To start off with, I missed the Jet airways flight in the morning. I missed out on all the family gathering and all the food. But I still couldn't stop myself from actually going - so I got on the evening flight and got to cochin. But I was really a bit too late to meet anyone...

Then I just slept for the next two days and came back ... Oh, I wandered around the shore road with a broken camera too. But other than that, there's nothing much.

But all said and done, there are few other places I'd have gone to do nothing and meet nobody.

Come to think of it, that's what we really go home for ...

--
If your aim in life is nothing, you can't miss.

posted at: 14:11 | path: /travels | permalink | Tags: ,

Fri, 17 Feb 2006:

Just got back from FOSS.MCC and was wondering about the state of educational instituions and students trapped with in. These kids don't have enough exposure to what is going on outside. You could say that it is their fault for not going out and finding out things for themselves - but it is not '99 anymore.

Me and spo0nman walked back from the event and ended up talking about what happened out there. The audience, at least what was left of it by the time I got there, emanated vibes of helplessness at what was happening up there. Swaroop's attempts to download Feedparser from sourceforge, Shreyas's tricks with gdb and emacs and finally Atul's talk about because you can felt quite out of place. I went through a similar experience talking about compilers at Freedel, with the whole crowd wondering what the hell this guy is talking about. It is not fun when you talk about what you really like doing and have the audience indirectly say we don't care.

The solution is to go back to 1999 when we were all kids looking at FOSS and saying oooh. Next time someone organizes a sort of first level talk at a college, please do the following at least for half a day. Just pull 10-15 machines off the college computer lab, bring enough ubuntu/knoppix/<whatever> liveCDs, boot them up and let the kids wander through them. There will be a few interested questions about mail, chat and what not - but they have to see the utilitarian side of these before they see the l33t world of emacs whizes or gdb gurus.

I say this with a bit more pain because I've actually convinced a bunch of people to use FOSS not because of the coolness of being able to read the code, but simply because they saw what I was doing with it. A big percentage of those have run away behind shiny things (Silver XP !!!) later, but I've got more real users (who understand the word Freedom now) out of it than if I had taken the path of showing them how I debug thunderbird to fix a thread-order bug in message views. Developers aren't that easy to come by, sometimes you've got to settle for users and bait them with eye-candy. That's what was missing today.

Sadly our colleges are the same they were in '99, though we and the world has moved on. So, back to 1999 I say ... back to '99.

--
We cannot disregard philosophy merely for personal gain, no matter how important that gain might be.
               -- Spock, "Journey to Babel", stardate 3842.4

posted at: 22:44 | path: /conferences | permalink | Tags: ,

Tue, 14 Feb 2006:

I finished reading The Last Continent over the weekend and was wondering where Pratchett went wrong. The book is a lost cause in philosophy - complete with a God of Evolution, the continent EcksEcksEcksEcks and Mrs Whitlow. Then there's the obvious parodies of Mad Max and Skippy the Bush Kangaroo.

The book is a rambling mess in terms of plot. The faculty of the Unseen University is stuck on a small deserted island and then we see Rincewind saving the entire continent of XXXX. There are some funny moments in the book - but they are few and far too sparse. Evolution by itself isn't funny and neither is the God of Evolution, especially when the wizards try to explain Sex as a way of reproduction to him. The part about the epitome of creation being the Cockroach was indeed funny. But all of Rincewind's adventures are too obvious and saving him from danger,Deus Ex Machina, in a diety in the form of a Kangaroo. The vegemite (I had eaten some while in NZ and *yech*) and sheep stealing parts just do not belong in the story either. But there was one really profound joke in there :-

It is about time and space. The more geography you have, the less history you had.

Origin of the name EcksEcksEcksEcks for the continent.
If it had been called BEER, they'd have trouble spelling it after the third.

The book looks as though it was written while Pratchett was on vacation in Australia. I wouldn't really read it again unless I was on a desert island waiting for a boat.

--
'I'll tell you this!' shouted Rincewind. 'I'd rather trust me than history!'

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

Today is February 14th - the Singles Awareness Day. Before you jump to any conclusions, I didn't actually name this day. After having sold all the cards and chocolates, this seems to be the latest thing from Hallmark to harness the other and largely under-utilized market of single people. What is written here is largely inspired by the perverse genius of spo0nman.

SAD is a humorous holiday celebrated on February 14. Its a day for
people who are single; that is, who are not involved in a romantic
relationship and can therefore not participate in Valentine's Day
traditions. 

Some observers of SAD do so out of spite for Valentine's Day as a Hallmark holiday or for other reasons. Hallmark spokesmen were unavailable for comment as they were too busy at the moment (rolling the stuff, I suppose).

--
" Nobody shot me "
    -- Frank Gusenberg, last words to police, St Valentine's Day Massacre

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

Mon, 13 Feb 2006:

Yes, I did have Fun with Dick and Jane yesterday. Watched the movie and about half-hour of commercials in Symphony. Awesome good fun to just stop thinking and watch the movie. The movie has Jim Carrey in it, which in itself is a good reason to watch it (once). Ever since I saw Ace Ventura - When Nature Calls I've been attracted to Jim's particular style of comedy which has been merely about doing things as they came to him. Bruce Almighty just stamped his pass into my hall of fame - occupied by such as Steve Martin and Leslie Nielsen.


See Dick Run !!

Téa Leoni also seems to find her funny side - mainly by quick thinking in unfortunate situations rather than by outright comedy. Imagine Téa and Jim in bed and she says We should have sex and a definite pause later completes with on saturday with candles. That is definitely funny if your head autocompletes pauses in conversation.

On the other hand there is the classical humour where Jim's in an elevator and dancing to I believe I can fly and the moment the lift touches 51st floor we see him standing with his back to the wall as if nothing happened. Or when you see him walking with his hand stretched out for ten feet to shake hands with the CFO. Even the stock ticker going down as Jim Carrey stutters during the quarterly financial report. Even the hunt in Georgia when the CEO misses but the spotter shoots the duck and says you got him boss.

Jane: when this week is over, we're all out of options
Dick: there's always prostitution
* Jane does a look LOOK
Dick: I meant me !!

Then the accident, getting deported to mexico and all that compounded with the kid speaking spanish on the phone. I mean you have to watch the movie to get the joke. The movie's sort of feel good finally - stealing money back from the bad guy.

And finally a sting in the tail - Alec Baldwin driving by in his new Mercedes saying You gotta join this new company, they have the best benifits. It's called ... Enron. That was double funny because the movie started with 'A long long time ago ... in the year 2000'.

--
"The dynamics of inter-being and mono logical imperatives in Dick and Jane : A study in psychic transrelational gender modes".
Academia, here I come.
                                -- Calvin

posted at: 19:12 | path: /movies | permalink | Tags: , ,