.::t3rmin4t0r::.
< April 2009
SuMoTuWeThFrSa
    1 2 3 4
5 6 7 8 91011
12131415161718
19202122232425
2627282930  

Wed, 08 Apr 2009:

The Footfall of Consequences

We are haunted by our mistakes.

Our successes, they will leave us while we're dulled by that afterglow of satisfaction. Your mistakes, however - they follow you around, as you drag your feet through the journey of your life. Like a shadow in the darkness, but their footfalls ever so muffled for you to suspect your sanity. They linger on, to provide that tinge of regret, which unfortunately is the mark of a life lived, instead of slept through.

As I headed out to watch Dev D for a second time, I wasn't expecting to feel any different from what I felt the first time. But I was to be surprised at what I felt for the protagonist - the disdain I had felt for him vanished into thin air, to be replaced with a sense of despair if only by empathy. I felt for his dillemma, the internal conflict that is the core of it all. Maybe it's a twist of perspective, but the experience was different.

To anyone who's made a mistake, there's an irrational urge to run away from everything that's headed your way - to leave consequences to others and withdraw. That the solution to everything was just to be not there. Not like it hasn't worked before, it just wont work this time - because you didn't wrong someone else, you wronged yourself.

But as you watch Dev and Chanda both go through their lives running away from the consequences of their actions - the realization hits home that you can run, but then that's all you'll ever do in life. Run and run. Run into the arms of drugs, alcohol or any other crutch that could make your mind just stop. Saving you from the monsters that inhabit you, dulling the pain and make you smile, all in ignorance. Anything to stop thinking, stop everything and keep running.

Consequences are strange beasts. They give chase when you run, but wait for you when take your time to walk to them. No one else can make you walk upto your consequences and introduce you to them. The last mile is yours alone to walk. It's not an easy one to walk back, knowing what awaits you at the end. But there comes a point when you're tired of running. When running away is not getting you where you want to be.

There was that moment of epiphany for Dev, standing next to that phone booth picking up the coins. The moment when you realize that this life is just too short to take the long way around. In perhaps what's the most unappreciated twist in the movie, you see the protagonist actually stop and walk back. Back to Delhi, back to Chanda and back to the police station.

On his own feet, to meet his past & make way for his future.

--
I have learned silence from the talkative, toleration from the intolerant, and kindness from the unkind;
yet, strange, I am ungrateful to those teachers.
              -- Kahlil Gibran

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

Mon, 23 Mar 2009:

The Slumdog Millions

I hate Slumdog Millionaire.

I don't hate it for artistic or aesthetic reasons. I hate it out of principle - because it is an act of third world emotional blackmail for anyone who's seen it for real - meant to repel and disgust. And it turns me off, pushes me into denial and just turns me into someone numb about reality. Freeze over my emotions when I saw the child being blinded with red hot irons. Maybe there are those who seek numbness over pain.

I've had one too many conversations with people from elsewhere about this movie. In response to their curiousity about whether this is how India is, I can only answer "Some parts of it, yes". It's almost like they want to believe what they see and won't settle for an India where people go to work at 8 and drive autorickshaws everyday.

To draw an analogy, when you think of Paris, the image that pops into your head immediately is the lit skyline with the Eiffel Tower. But imagine a quintessential paree movie of your preference and throw in all the moroccan ghettos which have sprung up around. That stark, depressing but real face of the city wouldn't be something I'd enjoy.

Art is about selecting what to represent and what is irrelevant. And the movie makers made a choice, that was completely theirs to make. Now that I think about it, what I'm hating is not the movie. It's the condescension that the movie invites on my bit of the world. Not because it's dishonest or that I'm patriotic, but the intentions behind it are suspect. It's pandering to the needs of someone filled with Schadenfreude.

What I'm hating is the tourist who says "I want to go see a slum".

--
Nothing ever becomes real until it is experienced.
          -- John Keats

posted at: 11:45 | path: /rants | permalink | Tags: , ,

Wed, 18 Mar 2009:

Love, Explained

Yet again, I find myself in a strange position. I observe, I learn and I contemplate. Spend much time on those, travel by thought and arrive at conclusions. Only to find out that I'm a century too late with them; That in fact, I was a century late when I started. Like once before, I'm not ashamed to borrow the unforgettable words of a soul long passed by.

No, we never sicken with love twice. Cupid spends no second arrow on the 
same heart. Love's handmaids are our life-long friends. Respect, and 
admiration, and affection, our doors may always be left open for, but 
their great celestial master, in his royal progress, pays but one visit 
and departs. We like, we cherish, we are very, very fond of—but we never 
love again. 

Love is too pure a light to burn long among the noisome gases that we 
breathe, but before it is choked out we may use it as a torch to ignite 
the cozy fire of affection.

But of the fire we all know, but let him speak of the embers left behind - the death of love and the journey ahead.

I am afraid, dear Edwin and Angelina, you expect too much from love. You 
think there is enough of your little hearts to feed this fierce, devouring
passion for all your long lives. Ah, young folk! don't rely too much upon 
that unsteady flicker. It will dwindle and dwindle as the months roll on, 
and there is no replenishing the fuel. You will watch it die out in anger 
and disappointment. To each it will seem that it is the other who is growing
colder.

Both are astonished at the falling off in the other one, but neither sees 
their own change. If they did they would not suffer as they do. They would 
look for the cause in the right quarter—in the littleness of poor human 
nature—join hands over their common failing, and start building their 
house anew on a more earthly and enduring foundation. 

But we are so blind to our own shortcomings, so wide awake to those of 
others. Everything that happens to us is always the other person's fault.

It is a cheerless hour for you both when the lamp of love has gone out and 
the fire of affection is not yet lit, and you have to grope about in the 
cold, raw dawn of life to kindle it. God grant it catches light before the 
day is too far spent. Many sit shivering by the dead coals till night come.

And from a page penned more than a century ago, the man stabs at the heart of our modern lives - only to go unheard again & again. But reader, to you I repeat, words that will make sense of this world - the creed of its people, of self and nothing more.

Ah, those foolish days, those foolish days when we were unselfish and 
pure-minded; those foolish days when our simple hearts were full of 
truth, and faith, and reverence! Ah, those foolish days of noble longings 
and of noble strivings! 

And oh, these wise, clever days when we know that money is the only prize 
worth striving for, when we believe in nothing else but meanness and lies, 
when we care for no living creature but ourselves!

If you enjoyed reading the paragraphs above, this is all quoted verbatim from Jerome K Jerome's "Idle Thoughts of an Idle Fellow". And at least in my ears, it rings absolutely true - scarily so, for something written in 1886 - a different era altogether. In some strange sense, for all the progress we've made, we haven't changed at all. And if you think so, read the whole thing.

--
Men love in haste, but they detest at leisure.
                -- George Gordon, Lord Byron, "Don Juan"

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

Sat, 14 Mar 2009:

The Goto Girl

She's perhaps the most important person in your life - and you'll never acknowledge it.

Perhaps the only constant relationship you maintain over the years, without realizing it. It won't be hard - You'll do nothing more for each other than just listen - hear each other out. And it'll be enough, in fact it'll be more than enough.

She's a friend - a friend you never reached out to. A friendship born out of coincidence and chance. Not someone you want or desire, but someone who's always seemed to be just background to your life. All that makes her special is that your soul is naked to her - she's the one with whom you have never put up on your pretensions. She's the one who's never judged you for it. She's just this girl in your life, never platonic with a hint of impossibility to it. She's just there, somewhere.

But, when shit happens; She's the first one you go to.

--
All my friends and I are crazy. That's the only thing that keeps us sane.

posted at: 01:46 | path: /observations | permalink | Tags: , ,

Fri, 06 Mar 2009:

Click *click*

Spend every day watching your life pass you by. The days, they go on interminably without any identity of their own. Your thoughts become memories, turn into dreams and fade away like breath on a window pane.


Freeze a moment in time, store them away and chase them back down memory lane. Lay down the breadcrumbs marking your way, mementos held close to your heart, of a day that you'll never forget.

Click, *click* ... and that's all it took.

--
The moving finger writes; And having writ, moves on.
The writing, it stays written.

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

Tue, 03 Mar 2009:

One Monday morning four years ago ...

One Monday morning morning four years ago, I walked into an office.

In retrospect, it was a very important moment in my life. But all I did that day was to dump my bags and go to the cafeteria.

But it was going to be my home for years to come. Lived in that little sheltered world for four years. Made friends, made enemies, got a life, then gave it up, discovered myself, travelled the world, grew my hair & shaved it, found love, even lost it, lost a father and nearly killed myself too - picked my life up out of a rut, ran alongside my career and didn't have to give up either.

Ah, good times ...

--
We are so busy watching out for what's just ahead of us that we don't take the time to enjoy where we are.
                  -- Calvin

posted at: 17:03 | path: /yblr | permalink | Tags: , ,

Thu, 19 Feb 2009:

McPhilosophy

The word intellectual has been hijacked. That epithet was reserved for those who held views of their own on this world. For those who used their intellect and abilities to percieve the world in their own light. For the renegades of thought, not restricted by the dogmas of their time and life.

Somewhere along the way, it became impossible to distinguish between the true leaders of ideas from those who have squandered their potential as independent thinkers. It's not like the fundamental roots of philosophy have changed over the years, but the world of print is seducing those that wish to futher their development onto the beaten paths of the last century. I do not deny that on shoulders of giants we should stand, but not on their toes.

I meet people like that all the time. I in fact, enjoy the crossfire of ideas that results in. I'm growing, I'm learning without being taught. But I often feel like what I've wandered into is not the melting pot of ideas, the half-bakery of them - but the McDonalds of ideas. Ingredients sourced from all over the world, made with a recipe, packed and tastes the same all over the world. There's a pervading sense of sameness about it - the names dropped, the vocabulary and the people I meet.

The ends remain the same, but the means have lost their meaning. Existential angst is the source of all my philosophy. The contemplation of suicide is perhaps the only source of truth for me - to veer off that path, I've looked far and wide for meaning in my life, till I realized that ironically, that very same quest is the fundamental meaning of sentient existence. To find an answer would be a death unto itself - cogito ergo sum. There's only one certainty and depressing as it might be, the evasion of which is what's so uplifting about every day lived.

I'm not an intellectual. But I like to pretend to be one, because of the social acceptance it provides for my quirks. But beyond that, I'm merely a student of human nature - mine first and everybody's later. And that's just my arrogance claiming how unique I am.

--
The error of youth is to believe that intelligence is a substitute for experience.
            -- Lyman Bryson

posted at: 17:31 | path: /observations | permalink | Tags: , ,

Wed, 18 Feb 2009:

Lockhammer!

The really hard part of APC is the internal locking code it has - it's not that hard to do, just hard to figure out if you've done it wrong. And I'm just about to really mess around with the assembly spin locks and pthread mutex locks to make them cross-process locks which live in shared memory (remember that "volatile" keyword in C?). The other couple of lock modes are already cross-process and slow (because of the syscall). If these work right, I won't really have to cripple the fast part of the code to implement the features I have in mind.

But before I start to go MIA into the locking code, I'd like to get my testing in place. So I've written a small and tiny test app called lockhammer - read the makefile and please run it on every platform you want APC to work. (make APC_DIR=~/apc link; make)

The code in lockhammer.c should be easily understood - basically it allocates some shared memory, creates a lock in it, forks, re-attaches the memory in each process. Every process is a loop of lock, write PID into shm, sleep, check the PID. In case someone has a better idea of how to test locks, I'll also like modifications to it, in case any of you think there's some corner case I missed (yes, random sleep & random fork-order is also on my list of TODOs).

Fundamentally, the information about locks is privately held within the lock type code in APC. The information needs to be moved into a shared mode (or at least, transparent) for multiple un-related processes to be able to share the cache without collisions. Eventually, you should be able to use APC in a standard FastCGI deployment without allocating a cache per-process.

And if you're a user, I'd like read something other than a bugreport, occasionaly.

--
They're gonna lock me up and throw away the key!

posted at: 19:07 | path: /php | permalink | Tags: , ,

Tue, 17 Feb 2009:

A Creative Generalization

We condemn the most in others that which we hate in ourselves. For it is our nature to be honest and judge oneself so harshly, so much so that your judgement passes onto the actions of others. It's never their deed that you despise, but the bitter taste of your own which rises like bile from your gut. And you can never forgive, never forget.

At some fundamental level, we are incapable of being with people like us.

--
I'm a man, you're a woman. We're just too different.

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

On Freedom

Freedom isn't degeneracy. Oppression is never constructive.

Rebellion isn't the answer, it's merely a step. Freedom is a state of mind, reality checks are moot.

The ability to be whoever you want to be is no excuse to slip & be somebody you aren't, someone you don't recognize anymore. You are not truly free inside your mind, until you know your Ego & your Id - in your decisions, reasons and emotions. Until that day, freedom from the comfortable clasp of social norms is meaningless. Free from others, but still a captive of your desires and whims. Merely an illusion of isolation, holding onto it; Changing everything, seeking instability, perpetually emptying out your soul. Hoping to be free in solitude, but still not succeeding.

Perhaps I'm wrong and freedom's just another word for nothing left to lose, nothing left to keep and nothing left to fight for.

But how would I know? I'm not free, at least not yet, not for a long time to come.

--
Man is free the moment he wishes to be.
        -- Voltaire

posted at: 18:12 | path: /philosophy | permalink | Tags: ,

Sat, 14 Feb 2009:

The Redemption of the Eternal Loser

It was always the story of a loser. A loser who lost it all and held onto his sense of loss, because here's the kicker, he's afraid to lose that too. A man who fails to own up to the loss, but keeps it alive, hoping to fill it one day with a replacement. A man so intent on keeping his loss, that what we see of him is a man with a hole where his heart was - wearing it proudly, but in disgust of a world which doesn't care.

What sets him apart from the regular losers of this world is his arrogance, which blinds him. His loss is something the world will never understand, because the world will never understand him. With this utter conviction, he embarks upon a demonstration of his loss - a path of self destruction and deterioration.

continue reading "The Redemption of the Eternal Loser"....
--
It is better to have loved and lost than just to have lost.

posted at: 06:13 | path: /movies | permalink | Tags: ,

Tue, 10 Feb 2009:

Nothing but echoes ... (again)

Maybe it's because my life feels so empty right now, but I keep hearing echoes of my past.

And now, I feel like revisiting those thoughts - this, that, the other and then some, pulling all together into a single page of the book that is my life.

--
Have the courage to take your own thoughts seriously, for they will shape you.
                -- Albert Einstein

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

Thu, 05 Feb 2009:

Lovingly cliched...

We delude ourselves into thinking we are original. That all our interactions, love, hate and relationships are nothing like what the other six billion are going through. Feel like slapping the friends who said "I know what you're going through", because they just can't. Can they? Only one day to actually snap out of it, wake up and realize that you've been ad-libbing your way through a lost script written and replayed unrehearsed in pretty much every corner of the planet.

The realization that I'm ordinary is pretty much a revolting thing to digest. But it's kinda hard to dodge, when you can just press play and listen to this.

continue reading "Lovingly cliched..."....
--
It is amazing how many eggs one can break without making a decent omelette.

posted at: 13:31 | path: /me | permalink | Tags: , ,

Wed, 04 Feb 2009:

Running Out of Time

As I leaned on the wall of the bathroom, huddled down to reach the
payphone to my ear, all I was waiting for was the voice at the other
end to smile and say Hello.

As much as I wish I could talk to it, just listening didn't seem to
help. People walking by constrained me, timezone you were in restrained
me and thus the payphone betrayed me. Couldn't shout what I wanted,
couldn't hear what I needed - not even hear a goodbye right, nor
say those thoughts which burst into my mind.

Perhaps it's the hope that brings the pain, that to talk to you would
fix my day - but to have it denied again & again. You are busy, I'm
eating lunch, reasons many and then a bunch.

Can't blame the system, can't blame the phone. It's just that you
& I can't find the time. Miss each other, but miss the time.

I guess sometimes what you really run out of is time. It's a long way round to the start and I guess it'll just take time, what I have & what I don't.

--
Perhaps the magic would last. Perhaps it wouldn't. But then, if it doesn't, what does?

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

Thu, 08 Jan 2009:

I'm Sorry, This Memory's not Real

About six years ago, in a classroom somewhere I was daydreaming while some out-of-work CS grad was trying to earn his rent, babbling about operating systems to kids who didn't want to be there. This is not about that classroom or what happened there. This is not about the memories I treasure from those days or the tumultous years that were to follow. This is about the here, now and virtual memory.

The essential problem writing code that is suppossed to be transparent is that you can't enforce your will on other code. For instance, when dealing with shared memory, it would be impossible to walk through & prevent all code using it from stomping all over the memory returned from the functions. The rather obvious solution is to deal with this is to make a copy for every case and hand it out. But doing that for all the data basically hammers over memory of the process and basically chews out the entire memory space. For a long time, I've been repeatedly debugging my entire code base with a hacked up valgrind with watchpoints. But eventually, there's that once-in-six-million errors which just won't be reproducible no matter what.

It's Not Real: The thing about memory addresses is that they're merely an abstraction. Once that idea settles down, things like fork(), CoW and mmap() start to make more and more sense. The translation from an address to a real page in memory is fairly complicated - but the actual details are irrelevant. Just like an address gets re-mapped to a different physical location when a process forks, it is possible to engineer a situation where multiple addresses point to the same location.

But why?: Sure, there's no real reason to have two addresses point to the same page, if they behave identically. But what if they behaved differently? With the help of mmap() or shmat() it's possible to create multiple virtual address spaces for the same real memory with different permissions. I discovered this particular trick thanks to someone pointing me to the Xcache Wiki. But it bears more explanation than there was. Here's how it's done.


  char template[] = "/tmp/rowr.XXXXXX";
  int fd = mkstemp(template);

  ftruncate(fd, size);

  void *rw = (void*)mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
  void *ro = (void*)mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
  
  close(fd);

By mmap'ing the same fd twice, the same pages are available as RDONLY and RDWR addresses. These two addresses are different, but modifying the RW space will be reflected in the RO space - sort of like a read-only mirror of the data. A nearly identical example is possible with the use of shmat() with different permissions.

protect/unprotect: Since these are different address spaces, it is easy to distinguish between the two. Converting a RW ptr to RO, can also be accomplished simply with a little pointer arithmetic. The code would look somewhat like the version below without any bound checking. But ideally, some sort of check should be put in place to ensure double conversions don't cause errors.

  int *p = (int*) rw;

  #define RO(p) (p) += (ro - rw);
  #define RW(p) (p) += (rw - ro);

  RO(p);

  *p = 42; /* causes segv */
  
  RW(p);

  *p = 42; /* safe to do */

The essential task left is that all the pointers stored should be RO pointers. After storing the data, the pointers have to be flipped RO. After which, any memory walking would essentially walking over the RO "mirror" and cannot corrupt memory. All the unprotect operations would have to be inside a lock to ensure safe operation. And I do really have to thank Xcache for the idea - I'll finally have to stop hiding behind the "Zend did it!" excuse soon.

For those intrigued by my code fragments, but too lazy to fill in the blanks, here's a fully functional example.

--
Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats.
       -- Howard Aiken

posted at: 21:43 | path: /hacks | permalink | Tags: , ,

Wed, 07 Jan 2009:

'Sup Twisted?

I had a very simple problem. Actually, I didn't have a problem, I had a solution. But let's assume for the sake of conversation that I had a problem to begin with. I wanted one of my favourite hacked up tools to update in-place and live. The sane way to accomplish is called SUP or Simple Update Protocol. But that was too simple, you can skip ahead and poke my sample code or just read on.

continue reading "'Sup Twisted?"....
--
Success just means you've solved the wrong problem. Nearly always.

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