Tuesday, May 31, 2011

the most bizarre case of lost and found

My first reaction when I read it was WHAT?. On a recent trip to the USA, Bollywood actor Rishi Kapoor decided to search for his former co-star and headliner of the yesteryears, Raj Kiran (surely you remember Arth, Karz, Hip Hip Hurray) and finally managed to find him ... in a mental institution in Atlanta. I don't know what to say or write. This is worse than the lonely fate of Tony Vaz.

Sunday, May 29, 2011

selling seashells on the shores on bollywood

बेईमान मोहब्बत is one of the songs from Shankar-Ehsaan-Loy's ouevre that does not quite sound like one of their songs; it does not yet bear any of their trademarks. I was listening to it again a few days ago and I noticed some interesting lapses in pronunication that I had probably missed because I was enjoying the song. The line in question is the second line of the mukha.Daa: जो रांझा थे वो चले गए. There's a palatal consonant () followed by a dental consonant () and this makes the line tricky to say right, especially when you're singing energetically and not reciting poetry.

The song opens with Shankar Mahadevan singing these lines and he can only muster जो रांझा ते वो चले गए. When it's Gayatri Iyer's turn she flubs the palatal with जो रांजा थे वो चले गए. KK wins the battle when he gets to the microphone with the right palatal and the right dental.

It's still a nice enjoyable song.

hitchgopal varma?

In chapter three of his book Spellbound by Beauty, Donald Spoto writes:
Hitch could certainly take credit for his visual inventiveness, and for his brilliance in adding to a script precisely the right images, the proper tone and atmosphere. But screenwriters from [Charles] Bennett in the 1930s to Ben Hecht in the 1940s, Samuel Taylor and Ernest Lehman in the 1950s and Evan Hunter in the 1960s all quickly realised that this director's gift was not for writing dialogue but for minimising it and allowing action and reaction, gaze and glance, to tell stories. Perhaps because he wanted to write the script entirely on his own but could not, he often resented his writers, who quickly knew not to expect gratifying compliments.

As I read this passage, I found myself thinking about a similar problem with Ram Gopal Varma, whose Factory promised to offer cinephiles different stories interpreted without the trappings of mainstream convention, with interesting technique and in different creative voices. Unfortunately, if one looked at just his jaunt in Bollywood, one noticed that his writers (who even turned director under his wing) were soon fleeing the coop and trying to make hay elsewhere. The reasons may have been myriad and most of them have always acknowledged the value of their formative time with RGV. But the steady departure of competence has left RGV and his Factory hollow. Without decent writers, the quality of his recent output has been on the decline. Long gone are the likes of Saurabh Shukla, Anurag Kashyap, Sriram Raghavan, Shimit Amin, Prawaal Raman and Manish Gupta.

Spellbound by Beauty is Donald Spoto's third book on the life and work of Alfred Hitchcock. It is also likely his most controversial, because it describes the often "difficult and even painful circumstances" under which the leading ladies in his films had to work. I own a copy of (and highly recommend) The Dark Side of Genius: The Life of Alfred Hitchcock, the second book in the series.

Saturday, May 28, 2011

true and really true: what's the difference?

I was forced to return to the murky depths of the Java-Web Services marsh and specifically to the quadrant dominated by Axis2 and a variation of it adopted by a behemoth peddling an enterprise-grade application container. This is what they called nostalgia (for those who do not enjoy etymology, that almost literally means a return to pain). As the flashbacks ensued, I found myself drawn to an old favourite in the Axis2 code base, org.apache.axis2.util.JavaUtils. The class contains several methods that seem dedicated to an exploration of verity and falsitude. Here are the methods devoted to the truth, the whole truth and all variants of it.

/**
   * Tests the String 'value':
   * return 'false' if its 'false', '0', or 'no' - else 'true'
   * Follow in 'C' tradition of boolean values:
   * false is specific (0), everything else is true;
   */
  public static boolean isTrue(String value) {
    return !isFalseExplicitly(value);
  }

  /**
   * Tests the String 'value':
   * return 'true' if its 'true', '1', or 'yes' - else 'false'
   */
  public static boolean isTrueExplicitly(String value) {
    return value != null &&
        (value.equalsIgnoreCase("true") ||
            value.equals("1") ||
            value.equalsIgnoreCase("yes"));
  }

  /**
   * Tests the Object 'value':
   * if its null, return default.
   * if its a Boolean, return booleanValue()
   * if its an Integer,  return 'false' if its '0' else 'true'
   * if its a String, return isTrueExplicitly((String)value).
   * All other types return 'true'
   */
  public static boolean isTrueExplicitly(Object value, boolean defaultVal) {
    if (value == null) {
      return defaultVal;
    }
    if (value instanceof Boolean) {
      return ((Boolean) value).booleanValue();
    }
    if (value instanceof Integer) {
      return ((Integer) value).intValue() != 0;
    }
    if (value instanceof String) {
      return isTrueExplicitly((String) value);
    }
    return defaultVal;
  }

  public static boolean isTrueExplicitly(Object value) {
    return isTrueExplicitly(value, false);
  }

  /**
   * Tests the Object 'value':
   * if its null, return default.
   * if its a Boolean, return booleanValue()
   * if its an Integer,  return 'false' if its '0' else 'true'
   * if its a String, return 'false' if its 'false', 'no', or '0' - else 'true'
   * All other types return 'true'
   */
  public static boolean isTrue(Object value, boolean defaultVal) {
    return !isFalseExplicitly(value, !defaultVal);
  }

  public static boolean isTrue(Object value) {
    return isTrue(value, false);
  }

Needless to say, there are similar methods that handle the dark side. Jack Nicholson's famous line from A Few Good Men would be the best summary of a code review, should one ever happen.

Monday, May 23, 2011

gender-agnostic love

I was listening to दस बहाने from Dus today and remembered how, when I had heard it the first time, I wondered if the singers were actually saying दस बहाने कर के ले गए दिल instead of दस बहाने कर के ले गयी दिल. I am quite sure now that it's the former. This is a strange choice of conjugation, because the references to the loved one use उसकी and not, as one would expect, उनकी. Of course, one does not look to Bollywood as an informal school of Hindi grammar (surely one remembers how Guru Dutt convinced Majrooh Sultanpuri to go easy on the grammar in सुन सुन सुन सुन ज़ालिमा for Aar Paar). What I found even more interesting this time around was that the song almost completely eliminates any notion of gender. Both KK and Shaan go on and on about the other one and the heart and so on and Vishal Dadlani tosses in DJ toasts every one and then to punctuate the dance floor number, but never (well, almost never) is there a sign that we're talking about her. It makes you wonder if this was because the song was originally written to be sung by girls. Now that it's just the boys singing, one also wonders if nobody noticed that it might have become the trendiest paean to gay guys all around except for one pesky detail (remember I had said almost): one of the lines Vishal Dadlani spits out is you stole my heart from me girl. girl is the clincher. He just saved this song from being an ode from him to him. Bring on the two large sunflowers and whack them against each other.

Sunday, May 22, 2011

BSP revisited

I stumbled upon an article featuring a review of the code of the Doom engine. I wish someone had written something like this years ago ...

One of the classes during the undergraduate days required that students deliver a short presentation on some piece of technology they had found interesting. I was interested in computer graphics and games. I was especially fascinated by Doom -- a friend had introduced me to the shareware version of the game and I got my first taste of addiction when I found myself sitting up late one night trying to get past a level without being killed by balls of flame spat out by ugly imps lurking behind closed doors. When Id Software released Quake, I also discovered BSP trees. An article in the now-extinct Dr. Dobb's Journal and articles written by Michael Abrash about working at Id Software (the "Ramblings in Realtime" series) had me hooked. Abrash also made studying computer graphics more exciting. He restored the joy of making the simple things work while the textbooks offered Bresenham's algorithm in a dry academic tone. When I found a copy of Michael Abrash's Graphics Programming Black Book (now out of print, but the PDFs are legally available online) in the bookstore, I did not hesitate in snagging a copy and reading the chapters over and over. Since I was not destined to approach the eerie smartness of Jon Carmack, some of things Abrash wrote about did not immediately make sense. Admittedly, I would have had to "get my feet wet" in code before I could appreciate them or even understand more of the items in Jon Carmack's .project and .plan files in the days when finger was used to support a form of micro-blogging. I also remember

My presentation was an experiment in fonts and slide styles, which made a label like avant garde more appropriate than educational. Since it was all meant more for a grade than for sharing knowledge (although a few classmates were interested in the idea and noted that my enthusiasm for it was evident), nothing more came out of it, although I continued to follow Id (even after Abrash quit) for years and also continued reading articles about game programming. I just never became a competent game programmer.

Sunday, May 08, 2011

pithy words in the style of a bestseller

In the third part of The Tenth Commandment by Lawrence Sanders, our protagonist Joshua Biggs has just participated in a ploy to get one guilty party to spill the refried beans on the other (arguably more guilty) and begins to wonder about justice and how it does not always seem absolute:
I should have been exultant but I wasn't. It was the morality of what I had done that was bothering me. All that chicanery and deceit. I would have committed almost any sin to demolish [primary guilty party], but conniving in the escape of [guilty party that was the object of the ploy] from justice was more than I had bargained for. And I had connived. I had worked almost as hard as [police office] to convince [guilty party that was the object of the ploy] to betray [primary guilty party]. It had to be done. But as [police officer] had said, [guilty party that was the object of the ploy] was going to walk. An accomplice to murder. Was that fair? Was that justice?
I realised I didn't really know what "justice" meant. It was not an absolute. It was not a colour, a mineral, a species. It was a human concept (what do animals know of justice?) and subject to all the vagaries and contradictions of any human hope. How can you define justice? It seemed to me that it was constant compromise, molded by circumstance.
I would make a terrible judge.

Edward X Delaney managed to find his own way of dealing with this dilemma, but Sanders unfortunately never wrote another novel featuring Joshua Biggs, so we'll never know what Mr. Biggs did.

Friday, May 06, 2011

music is a nail

Although he hasn't been churning out much stuff in the last few years, the once-prolific Bappi Lahiri still manages to deliver his little scoop to the delight of all those who relish a smidgen of surprise in their news. This time the bejewelled bopper has decided to rope in a famous name for a chitty-chitty ditty called I Got the Music in a film called Will to Live (surely the Hindi version will be titled जी ले ले जी ले ले). After he had elicited the services (in voice and flesh) of Samantha Fox for Rock Dancer, Pritam had bested his record with Snoop Dogg showing up on the soundtrack of that film with a title whose terrible spelling was inspired by unfortunate numerological ideas. Bappi ain't gonna take no jive from the man whose torrent client offered a higher return on investment in the department of plagiarism than Bappi-da's ears. So now welcome M C Hammer, who will write and perform some rap on Bappi's track. Will Mr. Burrell do better than Shri Dev Anand who had ensured that Mr. Prime Minister would have something to keep it in the canals of Bollywood infamy? Will Bappi-da outshine Park Chan-Wook? Will Mr. Burrell resort to a reissue of his classic hits after the fruits of the collaboration are made available to the ears of the world? Or will it all be गान with the wind?

While we wait, it's time to sneak another look at his tribute to Michael Jackson (if you are lucky, you can snag a copy of the release from United White Flag, a label whose website is a remarkable fusion of eyecandy with eyesore).

Tuesday, May 03, 2011

real panic

Have you seen Panic Room? If you have, do you remember the scene when Meg Altman (Jodie Foster) calls 911 and is asked to hold? I remember the entire hall groaning a nod. Somehow, it seemed right to a lot of people. How about a real-life example?
X calls 911 to report an accident and is asked to provide the address after which the operator asks for the zip code
X:
911 operator: that's Cobb County. You need to call the Cobb County Police Department. (and cuts the line).

Fact. Not Fiction. To avoid such problems in future, please keep a list of phone numbers for the police departments in all 159 counties in Georgia and also the PD for the city of Sandy Springs.

Sunday, May 01, 2011

the joy of comments

(in code, I mean). Truth is funnier than fiction. Comments in source code, to be precise. Consider, for example, the following worthy addition to the list of classic lines for fortune cookies:
// later is to be
or a declaration of principles:
// THIS method is not calling anywhere
or a declaration of the laws of the jungle:
// All transactional processing classes are responsible
// for calling this method and for providing what action is provided
or perhaps an example of stating the obvious:
// This abstract class houses default and common
// implementation for some interfaces

// This class is the message-driven bean implementation class
// which acts as the listener to queues which hold the messages that affect other 
// business objects
it is unclear why the following comment should even appear in code (perhaps the reader is not expected to be a developer):
// It is restricted to change this API without testing all the references
how does one say a lot without making much sense? how about (some of the funny names in camel case are euphemisms to protect the innocently dangerous; any others are changes just to keep the legal eagles awbay):
/*
 * DefectNumberInOneTrackingSystem Fix : Added this flag becoz
 * misspelledMethodName() in Abstract Object Check Against Null String of
 * FieldThatCannotBeDisclosed String While in This Defect Although it was Not
 * ______ Update But then also FieldThatCannotBeDisclosed string was
 * Not Null Becoz the default value stored in database is
 * 0.0 So it is Not Null and MisspelledFieldName Become true and
 * Then it dont set the AnotherFieldThatCannotBeDisclosed if it is True...See
 * DefectNumberInAnotherTrackingSystem
 */
{includes material that previously appeared hereabouts}
 
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.