Saturday, September 6, 2008

Movies and superheroes

I've always been a big fan of comics and superheroes. There is something magical about seeing a crusader standing up for the weak, and triumphing over not just evil people, but evil itself. Someone with the power to change the world, and someone who uses it. A person bigger than life itself.

There's a simple charm to such tales. It's much easier to see black and white separately in such stories rather than the muddled grey we usually see. Yet the people behind the heroes are very human themselves, they're usually shy, honest and truthful. They stand behind curtains looking at the ones they love, the ones they would like to be with, the ones they may never have. It's something I guess every geeky and nerdy guy, and comic fan would relate to. But oddly so, I think others do too. People are inherently nervous, in times where they feel powerless to prevent harm to what they hold dear, they tend to look to higher powers for help and guidance. Ample proof is provided by the thousands of miracle stories just about any recently devout person will tell you, how the lord helped them overcome great misery and problems. I feel that little scared kid never quite dies in anyone, he or she is the core of anyone's persona, and in times of peril, we tend to recede to that very persona. Every scared kid needs someone to hold their hand and tell them it's gonna be ok. Though this might sound like an extremely twisted proof to such a claim, an interesting "research" was published in the media some time back. The reason research is in quotes is that the authors were from the (in)famous Playboy magazine. They simply correlated the centrefolds' vital statistics to the times when people were under duress, for e.g. economic downturns etc. What they found was extremely interesting. Men (well , people is a useless generalization here) chose more curvaceous women in times of economic upturn, or when things were going well. In times of depression, they chose women who looked more liked they could take care of them.

Well you may ask what does this have to do with movies exactly? That's simple, try to find the biggest hits of the past 7 years or so, and they'll mostly be fantasy tales about superheroes and the like. 7 is kind of the pivotal number here, cause I'm making a reference to 9/11 here. It seems a lot of the american public hasn't quite emerged from the shock of that time. They still feel that the wrongdoers have not been punished, and they are still at risk. Movies have also adopted a very politically active role, making snide references here and there to the ongoing events.

One might ask, why do things take so much time to heal as we grow older. Well, a major part of the answer is in the question itself, we grow older, more rigid. Another big part is probably that as an adult you are expected to take care of others, and generally hide your fears. Our problems tend to accumulate inside us and we have no one to turn to for answers. And no one to put our problems in perspective, we're pretty likely to get excessively tense about trivial things.

I sometimes wonder if it would be better if there was someone who had all the answers, or atleast someone who could point us in the right direction. Someone who knew exactly what to say, when we're lost for words. Someone who could prevent bad things from happening and people we care about go away. Someone who could be our very own ... superhero.

Tuesday, July 29, 2008

There and Back Again, an Indian's tale

I recently arrived in USA for pursuing a Ph.D. . For people who know me and haven't been in touch :P , that might be a shock, but I believe my self from one year back would feel the same way. Anyways, I decided to enjoy some time before joining the course, and am staying for some time with my brother in New Jersey.

USA in general is very different from India, almost diametrically opposite actually. The first time I landed here, the scale of infrastructure is beyond anything ever seen in India. I once heard a slogan, "Everything is bigger in Texas", as compared to India, I feel the statement is fitting for the whole of USA. Everywhere you see, things are bigger, people are bigger ( :P ), and buy in bigger quantities. It really makes me wonder why George Bush thought that India and China are causing food shortages! no one there ever eats on this scale. The effects of having many magnitudes of land more, and a similar fraction smaller population is plainly visible. There's greenery everywhere, and things can be built to a larger scale. There are hundreds of small cities compared to a few huge ones. I feel the biggest difference is that people are, atleast on the surface, more polite and warmer. Strangers greet each other, cars stop for pedestrians, generally stuff that you would never expect in India.

All in all, people live very different lives than in India. That's probably why they like people from India, who focus on their work mostly, and pay very little attention to other things. A trip to the Indian dominated part of New Jersey quickly illustrates the difference. Cars suddenly don't stop for pedestrains as easily. A different odor hangs in the air, a smell distinctly indian, but from an unidentified source. The people, obviously look different. You can actually see people from every part of India in one place, something very difficult to see even in India. Once I entered an Indian store outlet and turned my back to the entrance, it was difficult to see that I was not in India. For most of my time, I was smiling and close to laughing, why? dunno, maybe it was that the sight of familiar faces brought back some sense of assurance. More so, it was the understanding that nowhere you go, indians will remain the same. I believe that throughout our childhood we learn to interpret emotions from facial expressions, and a lot more. Moving to another place with different people probably sets this instinct off, you no longer know what's the right custom, what people mean when they say the most common of things (apart from the obvious meanings of course) etc. etc. That probably is the source of culture shock, something that been "right" is not right anymore. You've suddenly been returned to the stage where u were as an infant, plus you don't learn as fast anymore. It's quite easy why it's unsettling for people, and the reason some need help.

The fact that Indians mostly overcome greater problems, fighting for everything against others and the system, is probably the reason why they are successful. They can battle anything, succeed in spite of all odds. That is the difference with China as well, China is an example of how, a system perfectly optmized for attaining certain goals can work. On the other hand, India is more of a game theory playground, how even when everyone selfishly thinks for himself, a country can progress at such a pace. In spite of apathy from the government, other people, the people still have created a wonderful example for success. Usually at this point, people say how if there was a better "system" and "governance", India could so so much more, but what they miss out is that the bad system has made the people this way so that they can tackle anything. It's a simple give and take, adversity shows the best or worst in people, but it always shows the extreme, and optimized response, which ensures the maximum possible results, good or bad.

Saturday, July 19, 2008

Political correctness

Today I was reading an article on how the USA's negotiator with Brazil for the upcoming WTO trade negotiations, Susan Schwab was hurt by the Brazilian counterpart's remarks. He had apparently compared the tactics employed by negotiators from developed countries to Goebbels, the Nazi propaganda chief, and Schwab is descendant from Jewish holocaust survivors. His exact statement? as quoted by Yahoo, "Goebbels used to say if you repeat a lie several times it becomes a truth," and "I am reminded of Goebbels", quoting certain parts. Though I know that forming an opinion on the basis of incomplete comments is dangerous, my point is not entirely based on this.

Recently Britain's schools have changed the nursery rhymes taught in schools (see here). Britain, or the United Kingdom to be more correct, has almost been at the forefront of political correctness, replacing black with rainbow, etc. etc. Some of the changes are actually quite hilarious. Before you start raising fingers at me, let me point out that I'm also a "coloured" person. But the simple fact is that when you say baa baa black sheep, I can't see any semblance of racial discrimination. In a contorted way, possibily yes, but then you can see innuendos in just about any statement. Language, any language is an approximate representation of what we wish to express. In algebra, we call this dimensionality reduction. One of the most common ways of doing this is PCA or Principal Component Analysis, which is that you try to gauge the common thread in the data, to put it very crudely. This is done with almost rampant disdain in computer vision to remove noise in data collected from natural sources (:D no offense, I know it's necesary). Which is why it's quite beyond my comprehension, why we haul up someone based on some part of a statement. Isn't it relevant as to what thread was being followed and the context in which the statement was made? I always find that the media, press in particular, tends to highlight such things to gain TRPs, taking out small sections of statements and contorting them. Problem is that these sections are used by a majority of people to form opinions even without knowing the full fact.

While I do accede that little knowledge is a dangerous thing, and the press may claim that it is the responsibility of the people to find the truth, but the press are most people's only source for such information. Even more so, we must allow some leeway for people's inherent stupidity. You may not notice it, but everyday you'll make many insensitive comments to a multitude of people. But, being part of everyday occurence, people ignore them, as part of the lost art of common sense. If you feel that you're not part of such a group, try and listen to what you said, you'll be shocked.

Every statement can be taken in atleast 2 ways, so don't try to create a context out of a statement. Like my favourite PCA, gauge the common thread. And though I concede I've never as yet been a victim of discrimination on the basis of colour or the other common things, I still feel some judgement call should be made the statements that are held as discriminatory. Though it's probably a better thing for people not to say stupid things, but that's quite a thing to ask, don't you think? I mean, in India, being a general category male is like a curse. People have a tendancy to blame this category for all evils that plague society. And being part of this category implies that you have to slog for everything a little more than everyone else, meaning people having reservations, even though I myself didn't do anything against them, nor have anything against them. Without digressing, let me just say that reverse discrimination is as prevalent as discrimination.

To conclude, I just want to say, that it's been more than 50 years since the Nazi's were overthrown. Give them germans and others a break. Referring to a person of that group doesn't mean that you condone their actions, you're simply using them as an example. They did terrible things, and it can cause a lot of hurt to be reminded of them, but they're still the past. A new generation has now emerged who don't grasp the brutalities of the actions done in the past century, as well as people of the developing world who didn't have anything to do with it. These people are already paying some price or another for what happened, even though they were direct or indirect victims, and not the perpetrators. Political correctness can seriously stifle free communication, and lead to more problems that it can solve. In my opinion, though people should be educated to be more careful about what they say, they should also be educated to be more tolerant. Being all prickly and quick to get insulted is probably not the best way to go about things. In that spirit, I apologize to anyone who finds this article insulting in any way.

Monday, May 5, 2008

Art, depressed artists and nervous exam takers

I'm one of those people who, when looking at some piece of modern art, do seriously wonder what people see in them. Mind you, some pieces are seriously good, but some actually look like someone's baby puked on them. I once took a philosophy course in college, called art and technology (though I never quite saw the tech part :D ). It was interesting, to say the least. Though my limited philosophical skills saw me scrape throught the course, I did pick up some interesting insights into what is art, and how do people perceive it.

As part of my class presentation, I picked up music as the art subject of interest, and tried to go about thinking, how and why do we actually like music?? or even hate it, or worst of all, go from hating to liking it!. Trust me, songs do have this way of growing on you. And I saw these 2 concepts, "Beauty is in the eyes of the beholder", and the obvious one, that beautiful things, are beautiful cause they have something in them. Which actually contradict each other, so u can't pick both.

You know, there was something taught in school which I never quite figured out a purpose for, resonance. It's quite wonderful in essence, and it says that everything, i mean everything has a certain resonant frequency. Which means that if u send waves of a certain frequency into the object, it'll vibrate like hell, much more than any other frequency. Still don't get it? remember that cool gadget Bond used to shatter glass? that's it. In school we actually had this experiment to determine the resonant frequency of something, don't remember what. In fact, there's this story that while walking on bridges, armies march out of step so as not to accidently make the bridge collapse, cause supposedly it's happened.

So you may ask why does resonance come into the picture?? well the answer's half already there. Forget the physics of it, and just focus on the concept, everything responds more to a certain input than any other. For more clarity, try and remember any memory in your head, and apart from that vivid image in your head, notice that you'll remember how you felt then. Sometimes those emotions might not even make sense to you, most people just ignore them. But the fact that your brain records them in the same detail as any sensory input gives an important clue to the importance your brain gives to emotions. Before I finally state my claim, consider this fact, you'll always like certain songs when you're in certain moods. It may differ for different people, but there are certain clear trends, like mopey songs when you're sad etc. etc. Well, that's it, isn't it, resonance. Your brain responds to certain types of songs when facing certain emotions. It's like your radio receives signals (resonance again :P) you tune it to a particular frequency, and voila music. Similarly, I believe, emotions tune your brain to accept certain input better, or look at things in a different way.

Still don't believe me? try playing different songs when in different moods, they'll seem seriously different. For me, when I'm pensive, like when writing this blog, I like songs more like Friday, by Goldspot, when i'm depressed or trying to drive myself to work, Linkin Park or other heavy metal style music is more like it. Forgive me, if my music classification is off, never got around to figuring it out. I especially give an example of music, because more people experience this form of art than any other.

With this done, you should be wondering, why does this resonance happen? well your brain gives you clues. It'll faintly reminisce about the past. I believe your brain keeps recalling memories, it's its way of understanding stuff, fitting current experiences to past ones. Which is why, if the song brings back memories whose dominant emotion matches your current state, you'll like it. But you'll still have stronger reactions to sad emotions, that's something I never quite understand. Which brings me to art in general, its appreciation requires that you have experiences some of those emotions expressed by its creation. And creation of art is even more problematic.

Most of you would have noticed, how many artists die of depression related stuff like suicides, drug overdoses etc. And as I said, people have stronger recalls of adverse emotions. Even more personal experiences, I feel that creating art requires a certain amount of depression, sadness. When seems plausible, when you're happy, why would you go through the whole process? why wouldn't you rather enjoy. This probably requires more thought, and so I'd rather leave it for another post considering how long this one has become.

My last topic for this post, nervous exam takers :D, well I'm one too. This too does have some relation to all of this, cause, as I said recall brings back emotions as well. So if u were not too confident while studying, in addition to having low confidence, you run the risk of having those emotions come back during your exam. Try thinking about it sometime.

Well, that about does it, that should clarify some things about art, but u're always welcome to use my opinions about some work of art when I don't like it, a baby could've done it!

Sunday, April 20, 2008

Moments...

Have you ever felt, for a moment, that time would stop, and this moment would stop forever? Know it sounds awefully cliched, almost movie worthy cliched, but it's interesting. Better minds than me, have said “Life is not measured by the number of breaths we take, but by the moments that take our breath away.” So it might be worth paying moments more than a cursory glance. I truly do believe in the statement, so if have never have had any such moment, look for one, mebbe you had one but never noticed.

In your free time, try reminiscing for once. What you'll notice, that with each memory, you also tend to recall some bit of the emotions that you felt at the time. In fact, the moments clearest in our minds tend to coincide with our emotional moments (ya that includes being angry as well). Depending on the kind of person you are, you'll probably pay more attention to certain emotions than others. If you think I'm picking up from some theory, nope, in fact I'll be highly surprised if there's a theory that says so.

Why is it important? if what I'm saying is right, then maybe at the fag end of your life, with nothing much to do, you will reminesce. And it's these moments that'll come up in your mind, so it pays to pay some attention, as you might just have some choice in what your life's movie reel look's like. This is mirrored in a lot of literature you'll find, and I'll mention one line from one very nice poem I read once, "Don't dance so fast, time is short, the music won't last"

So try and live life in the moment, mebbe you'll pick a memory that you'll cherish for all life. But don't live in that memory, it's a memory, and is best left in the mind, not to be wondered about. It can never come back, never be changed, only remembered.

Thursday, April 17, 2008

Exhausting efforts of optimization!

Warning: Any non-geeks, avoid this article, u're unlikely to appreciate, let alone understand the article(no offense, but it is the case here).

I write this post after having spent the past 8 hours on trying to optimize my program. My code was originally written in Visual C++ (i.e. Windows) and on finding no tools to let me profile my code, i shifted to gcc (i.e. linux). Why a commercial programming suite lacks a profiling tool is baffling. It would only let me do a profile guided optimization. In my experience, a good programmer with a profiler can do a hell lot better job at optimization than any compiler. In fact, after my efforts, adding any other optimization flag other than the obv -O3 actually slowed down the code!. That is one big reason i like linux and gcc. It's a developer's os, meant expressly for development, which is why its adoption by other people baffles me a bit, they're not using the most powerful features of the os, and giving up quite a bit of user friendliness in the process.

One of my professors once said, that some code written by a novice programmer can be speeded up about 10-20 times by an highly experienced programmer who knows his hardware, even without knowing what the program does. Though this might be a bit of an insult to some, it's true to an extent. I've actually hit the 10 times mark on some of my own code :D , and the code wasn't badly written to begin with. But, something the confuses me is that there is no comprehensive guide to writing fast code. There are some basic tenets which if followed, can give very good performance on any machine. In my opinion, hardware specific optimizations are best left to compilers, unless u're really gud at it. you'll always find the basic stuff like locality of reference, pass by reference etc. Yet no one usually talks about the stuff you can do if you spend some time with the program. Statistical analysis is an amazing tool. The biggest thing that tend to slow down code is branching. Only very experienced people can truly minimize the branch penalty. But you can do some things on your own. See which options are more likely to occur, and try to keep these options higher up in the 'if' condition checks. Simple as this may sound, it's often ignored. Plus, removing unnecessary conditional checks. See if some condition checks can be reduced, e.g. if u're using nested if's see if conditions on the outer loop variable can be confined to the outer loop, it can speed things up by quite a bit.

Adding threads is also a good idea, especially for scientific codes. OpenMP is an amazing tool that you can use if you don't want to get your hands dirty with thread management. Most modern compilers support it, and using it, you can usually speed up your code by about twice (in most cases which can be parallelized) with about 5 minutes of effort. But not always, it actually slowed down my code by twice, even though it's eminently parallelizable. The fact that it was GCC may have something to do with it, their OpenMP implementation is still new. Open source guys, don't scream that i don't know what i'm doing, that's the reason and it's not gcc's fault, I'm decently experienced at code optimization, and i quite put the blame squarely on gcc, cause the same code was speeded up by vc++ when openmp was switched on.

You'll be amazed how some basic thinking can help you write code that can make those crappy looking algos run better than more sophisticated ones. To those who only believe in big-Oh's , try meeting a systems guy with programming experience, you'll be amazed at how O(n2) may be less than O(nlogn) :D

Sunday, April 6, 2008

Wonderful childhood

As kids, we're always in a hurry to grow up. We want to outgrow the dictatorial regime that is our parents and get the freedom to do whatever we want, do whatever we want (and probably eat whatever we want :D). We're carefree, have nothing to think about, and tend to generally have fun. Ok, this is getting a little movie-like perfect, but that's an opinion of a grown up. One of the most, if not the most wonderful parts of childhood, in hindsight, is the freedom from making decisions. Everything is decided for us, be it which school, what to wear (to a certain extent) etc. etc. At that time, we little realise what a perk this is. Resolving a quarrel is so easy! a parent just has to intervene, and we're done, their word is the law.

These last 2 lines are probably the most important. As you come to the nervous teens and adolescence, you realise how much decisions can hurt, and haunt. Your decisions can be small and insignificant, or ones that shape your life. Don't know about you, but I'm cursed to wonder about what ifs, about each an every decision I make. I'm probably built that way, and my upbringing and having to sit cooped up indoors for long times (I was sick a lot as a kid, asthma), makes me wonder about each and every decision I make, and how that affects me, and more so, others. I always remember my carefree childhood, when the most difficult decision to make was probably which ice-cream flavour to take. Talking about the best time, the worst time is probably adolescence. I have had the opportunity of going to one of the best universities in India, but as I near the end of the degree, I still wonder whether how I spent my 5 years here was right. Whether doing something differently would have made things different, whether the path I've picked is the right one. I believe, decisions taken during this period will stay with one for all life, be it as cherished memories, or nightmares that haunt. This is what makes one realise the true value of the innocence and carefree times that were our childhood. Which is why I hate reports of child prodigies, a child should live their childhood with as little burden as possible. Let them go outside and experience the world, don't push them to work 3 hours a day to master some instrument or chess. What you do as a child makes or breaks you as a person. Most of us focus on working harder and harder, making our minds toil to the ends of their limits, trying to push a little further. Don't trust me? try asking some undergrad from a top institute to sit down and do nothing, just relax and take in the atmosphere, they won't be able to. Why? because your mind aggressively trims powers in the early years which it considers irrelevant, to make space for what, we and it, consider important. And running in the rat race makes you exactly that, a rat, running mindlessly in its wheel, unware that it can stop. Still wondering why many brilliant minds burn out? or sportstars retire in their prime because nothing drives them? See if Phelps or Hingis ring bells. When you work hard, so hard, something inside you dies, that child. That child inside you lets you laugh, to enjoy, to love, and look wonderously at every new day.

Remember my next point? that wonderous resolution of quarrels? well, as you grow up, you become more and more sure of yourself. Gaining knowledge breeds confidence, and whether we like it or not, confidence breeds arrogence. Just as courage is not lack of fear but the ability to overcome it, humility is not the lack of arrogance, but the ability to overcome it. As we become more and more sure of ourselves, we disregard authority, of everyone around us. As we become powerful, even more so. Why do you think that global problems are so hard to resolve? there no one to scold the 2 idiots and make them say sorry. Plus, the slight problem that things that people do as adults tend to become hard to tide over by a simple sorry. Maybe they are, but we attach more to them than as kids. Maybe resolving things this way would be easier, but we'll probably never find out.

So, the next time you try to look at that little kid and think you're better, think again. They have a lot more things you can never have, and can be someone you never will.