Tuesday, September 8, 2009

Sleepless in Seattle

Movie: Sleepless in Seattle (1993)
Star Cast: Tom Hanks, Meg Ryan
Genre: Romantic
Duration: 105 min
 
Plot: What if someone you never met, someone you never saw, someone you never knew was the only someone for you? 

Annie (Meg Ryan) is happily engagged with Walter, someone whom she met at her office. Just a day before Christmas eve, she was driving home, listening to radio, when an 8 year boy, Jonnah from Seattle called the radio station telling that he wants to give his father a new wife for Christmas. The boy's father is a recently widowed man, Sam Baldwin (Tom Hanks) who is still deeply in love with her dead wife Maggie, doesn't think it can happen twice. Yes, Tom Hanks is the sleepless in seattle.Thousands of women write to Sam. Annie also can't stop thinking about him and starts to doubt what if he's the one, the one for her...

Review: Sleepless in Seattle is a timeless classic. It's a story of the 'Magic'. It is one of the movies that will stay close to your heart for a long time. Music is excellent. Just listen to "A wink and a smile", and you won't be able to stop humming it for long. Just watch it....

I would rate it as: 5/5

Sunday, September 6, 2009

An interesting read - Divide and Conquer

The slow spread of a fast algorithm

In 1963, during a meeting of President Kennedy's scientific advisors, John Tukey, a mathematician from Princeton, explained to IBM's Dick Garwin a fast method for computing Fourier transforms. Garwin listened carefully, because he was at the time working on ways to detect nuclear explosions from seismographic data, and Fourier transforms were the bottleneck of his method. When he went back to IBM, he asked John Cooley to implement Tukey's algorithm; they decided that a paper should be published so that the idea could not be patented.

Tukey was not very keen to write a paper on the subject, so Cooley took the initiative. And this is how one of the most famous and most cited scientific papers was published in 1965, co-authored by Cooley and Tukey. The reason Tukey was reluctant to publish the FFT was not secretiveness or pursuit of profit via patents. He just felt that this was a simple observation that was probably already known. This was typical of the period: back then (and for some time later) algorithms were considered second-class mathematical objects, devoid of depth and elegance, and unworthy of serious attention. But Tukey was right about one thing: it was later discovered that British engineers had used the FFT for hand calculations during the late 1930s. And—to end this chapter with the same great mathematician who started it—a paper by Gauss in the early 1800s on (what else?) interpolation contained essentially the same idea in it! Gauss's paper had remained a secret for so long because it was protected by an old-fashioned cryptographic technique: like most scientific papers of its era, it was written in Latin.

[ Courtesy : Algorithms by Dasgupta, Papadimitriou, Vazirani ]

Saturday, August 29, 2009

Movie Review: Amal

Movie: Amal (2007)
Star Cast: Rupinder Nagra, Naseeruddin Shah, Koel Puri, Sima Biswas, Rosan Seth
Director:Richie Mehta
Duration: 101 mins
Genre: Not commercial





Plot: The movie revolves around a poor man’s richness. His wealth is goodness, honesty and sense of responsibility.

Review: Amal is a critically acclaimed Canadian Hindi movie. After reading great reviews and knowing the fact that movie was showcased at Toronto film festival my expectations were very high, and I consider my expectations the main reason for my disappointment. Very good cinematography, subtle storyline, good background score, average performances (really bad dialogue delivery by lead character), good end.



I would rate it as: 2.5/5

Movie Review : Via Darjeeling

Movie: Via Darjeeling (2008)
Star Cast: K.K.Menon, Sonali Kulkarni, Parveen Dabas,
Vinay Pathak, Simone Singh, Rajat Kapoor, 
Prashant Narayanan
Director : Arindam Nandy
Duration : 104 min
Plot : A honeymoon couple Ankur and Rimli (Menon and Sonali) was about to return home from Darjeeling, but on the last day the husband (Menon) went missing. Local Inspector Robin (Vinay Pathak) carried out basic investigations and got to know from Rimli that throgh out their honeymoon she was followed by a man (Parveen Dabas). Story then moves to a couple Preeti and Ronodeep's drawing room where we see Robin narrating the story of "Ankur got missing" to Preeti, Ronodeep and two other friends - Mallika and Kaushik (Sandhya Mridul and Prashant Narayanan). To kill time on a rainy night each of them narrates his/her own version of "How Ankur got missing" story one by one. The movie is pushed to the climax as the stories unfold.

Review : Something 100% experiemental and unconventional. What we see is 5 different versions of the same story and an open climax. I've always found open climaxes abrupt and irritating but not this time. Sonali Kulkarni and K.K.Menon are superb playing 5 roles of the same character. Vinay Pathak is good too. Rest of them are ok. Songs are good and the background score too. Could have been a better movie if wrapped up in an hour. Still worth watching on a rainy night. 
I would rate it as: 2.5/5

Movie Review: Last Train to Mahakali



Movie Name: Last Train to Mahakali [1999]
Star Cast: K.K.Menon, Nivedita Bhattacharya
Director: Anurag Kashyap (Debut movie in direction)
Genre: Thriller, Suspense
Duration: 45 minutes



Plot: A journalism intern (Nivedita Bhattacharya) asks a criminal & prisoner (K.K.Menon) to do an intervew. She is especially interested in doing his interview after finding out that he was a scholar (dropout) student of Medicine at AIIMS, delhi. He permits. The interview starts with Menon's life at Delhi, Medical School. He wanted to bring difference to the world. Do some ground breaking research and find out a cure which can kill any virus. And continues with Menon telling her his struggle story, about how he managed to come up with the cure and how he managed to convince strangers he met on Last local to mahakali to be test objects and how each one of them except the last girl died after being injected with his vaccine. Now, he couldn’t prove his cure because the last test object , a crazy girl who didn’t die had ran away and he is locked up in the jail. Menon gives a speech to Nivediata on what happens to researchers in this country etc. Moved by this, Nivedita manages to get Menon's solution from Police Custody and offers him to inject her with the solution and prove that his cure works. What follows her this move is [SPOILER REMOVED].

Review: Movie was technically poor, but considering the fact that it was a low budget film shot in 4 days, I would rather not criticize it on that line. Plot was good and the suspense too. Not so innovative or something but strong and good. What makes me appreciate the movie is the fact that it was a stepping stone to success for both Anurag Kashyap and K.K.Menon as well as Menon's wife Nivedita. (though she didn't become as popoular as Menon, she's made her place in theatre)

I would rate it as: 3/5

Header Files in C

This post might be helpful if you are reading a C header file or wish to write one and baffeled to see unknown keywords and begin to think of header files as alien objects in C.

Header files are just another C files which commonly contain function declarations, identifiers and variables.

A Programmer will prefer to write a header file than having these declarations in main stram code either to give the program more structured appearance by using standardized identifiers or there are more than one source files which aims to use these identifiers or functions, these files can rather include a single header file whenever the identifiers are required.

At the time of compilation, the task of including header files is taken care of by pre-processor. A pre-processor is a separate program which is invoked by the compiler prior to the compilation process. A C pre-processor will modify the source code before handling it to the compiler.

Pre-processsor deals with three things,
Directives: which instructs the pre-processor to do the needful; they always begin with ‘#’ (Read: Sharp). Examples of directives are #include, #define, #if etc.
Constants and Macros : they are defined using #define. A task of pre-processor is to take care of these  #defined macros and constants.

Moving back to header files... Whenever a  ‘#include’ statement is seen by the pre-processor, the content of the header file is directly placed into the current file. There are a few directives which shall catch your attention whenever you read a standard (well-written) header files, they are related to conditional compiling of the codes.
-#if -
#if
....
#else
....
#endif

They have the same meaning as normal if  else statement with the only BIG difference being that they are not conditionals for execution but conditionals for compilation. If the after #if has a zero value, compiler will skip compiling the code till #else, and if #else is not present then till #endif

Another Similar directive is -#ifndef-
When a header file is #include'd in multiple source files, the result is that, all the variables, identifiers and functions are defined multiple times. The pre-processor , with the help of #ifndef directive can ensure that each header file is included once and only once. Here's an example showing use of #ifndef [ Read:  if NOT defined ]


#ifndef _FILENAME_H
#define _FILENAME_H
....
#endif

This simply means : include the following content only if a particular expression is undefined; then, if it is undefined you can define the expression. This ensures that the code in the #ifndef is included only the first time the file is loaded and not as many times as the #include statement is compiled.. [Rather pre-processed ]

[ Readers: This is out of my understanding. Corrections are welcome, I might be wrong at a place or two… or even entirely :) :)  ]

- Happy Programming -