Sunday, September 30, 2012

GaDiMa-4

One of the aspects of GaDiMa's music that has always amazed me is the sheer range of emotions expressed in his songs. Being a lyricist for movies offered him many opportunities to write about all sorts of situations. He utilized these situations to write simple, touching and amazing lyrics.

The noted Marathi poet Suresh Bhat has penned many songs that are famous for the sensuous feelings expressed in them. This song written by GaDiMa from movie "मुम्बईचा जावई" is in the same category. Now it's not my unfair intention to pigeon-hole Suresh Bhat lke that. He has written amazing GHazals in Marathi. But, it's also true that many of his sensuous songs are very well-known. I am just comparing this GaDiMa song to those.

कारे दुरावा, कारे अबोला,
अपराध माझा, असा काय झाला ?

I have a complaint against this song. This is a blatantly unrealistic मुखडा (refrain). Which wife in this world even entertains a suggestion that she is the one to be blamed ? And asks her husband why he is not talking to her ? The husbands are not asked the reason for their silence, they are supposed to stay silent. :-)

Asha sounds just wonderful here. In a song that is less about स्वर (notes) and more about भाव (emotions), she adds a nice touch of  लाडिकता when she sings

नीज येत नाही मला एकटीला,
तरी ना विचारी धरी हनुवटीला,
मान वळविसी तू वेगळ्या दिशेला ...

The tune by the great Sudhir Phadake is sublime. Just as the lyrics become more direct in the last stanza, he shifts the gears a bit.

रात जागवावी असे आज वाटे,
तृप्त झोप यावी, पहाटे पहाटे,
नको जागणे हे, नको स्वप्नमाला ...

Quite explicit for that age, but not cheap.

The movie was remade in Hindi as "Piya Ka Ghar", starring Jaya Bhaduri, Anil Dhawan with the famous Kishore song, "Ye Jeevan Hai". Still no comparison to the soundtrack of the Marathi movie. I will cover the other songs from the movie in later posts.




Previously :

Sunday, September 16, 2012

Spartacus


Review : Spartacus (A TV series)
Aired on : Starz
Released : 2010
My Rating : 5 out of 10

Starz released the first season of the Spartacus series in 2010, titled "Spartacus : Blood and Sand". The lead actor - Andy Whitfield - was diagnosed with cancer, and production of the sequel had to be stopped. While he was being treated, Starz produced a prequel instead. Sadly, Whitfield passed away in 2011 and the sequel was later produced with Liam McIntyre playing the lead role.

I have only watched the season 1 on DVD, and this review is specifically of that season.  It consists of 13 episodes, each of 1 hour.

The story is loosely based on historical facts. In ancient Roman empire, around 70 BC, there was indeed a slave gladiator called Spartacus. He was probably captured from Thrace (modern day Bulgaria) and served in a "ludas" (gladiator school) in the city of "Capua". He organized a rebellion by forming an army of fellow slaves. The Roman Army eventually crushed their rebellion in what's now known as the "2nd Serville War".

Season 1 starts with the capture of Spartacus, and ends with the successful start of his rebellion. Almost all events in between are completely fictional as historical details of Spartacus remain obscure.

When I wrote the review for "Rome", I added a strong warning that it's not fit even for teenagers. Spartacus leap frogs Rome in the aspect of being offensive, and falls woefully short in everything else. If you couldn't watch Rome because it was too explicit, you shouldn't even think about watching Spartacus. If you liked Rome (and I did), for its gripping narrative, you shouldn't expect the same from Spartacus.

The idea here is to shock the viewers. Plain and simple. The appropriate name for this series would have been "Blood and Skin", as that's all the series seems to be interested in. It's possible that for some viewers, this is a guilty pleasure. To me, it was beyond saturation. The same types of scenes are shown over and over again.

There is a small kernel of a good plot here. Although these are gladiators, they are just glorified slaves, with no rights, no freedom and just objects that can be sacrificed for the entertainment of the elites. It's impossible to not feel their plight. There are some political machinations, and they add some intrigue to the storyline. The focus of the series is elsewhere. To appeal to the base instincts, by showing beautiful women fawning over bare chested savage hunks, who are bent on killing each other in the most grotesque way. With the topic being gladiators, one might expect fight sequences that keep you on the edge of your seat. Alas, they are quite unrealistic - inspired more by the movie 300, than say Troy. (Note : Troy was NOT a good movie, but had great duels. And 300 was a visually impressive movie, but it's not famous for duels.)

The acting is a bright spot. Andy Whitfield as the lead actor is superb and convincing. A trivia : In the late 90s, there was a series with more modest aspirations, called "Xena: The Warrior Princess". It had good ratings in the demography "adult male", solely because of Lucy Lawless. She expertly plays the role of Lucretia here. The best performance though is by John Hannah who plays the role of Quintus Batiatus, owner of the ludas, which happens to be the only multidimensional character in the story.

I am not sure if I can recommend Spartacus. It's not that it fails at being good art. It's just that it has no intention of being a good art. The series is very clear about its goals. There is no point watching this series with the expectation of watching a historical fiction, and complaining that it fails to deliver. It delivers perfectly well, but something totally different - lot of sex and lot of unrealistic violence. If that's not what you want, don't watch this.

Monday, September 10, 2012

Finding Arithmetic Sequences

As a final step of solving a problem, I needed to find out arithmetic sequences within a series of numbers. I am not sure if there is a more efficient algorithm than what I wrote. This one will do the job just fine - the complexity is quite close to O(N^2), which seems fair to me.

The problem.
Given a series of integers in ascending order, we have to find all the arithmetic sequences that occur in the entire series. An arithmetic sequence is defined as a sequence of 3 or more integers in ascending order such that difference between any pair of consecutive integers is same.
For example.
In the series, 2 3 4 5 6 7 8 9, there are 5 sequences. The entire series is a sequence with difference as 1. Then there are (2 4 6 8), (3 5 7 9), (2 5 8) and (3 6 9).
A number can be part of multiple sequences, and multiple sequences can have the same difference between the consecutive integers.

This possibility of a number being in multiple sequences may make the problem seem harder. It isn't that hard.

The idea behind my solution is simple.
1. Iterate over the sorted array from the first element to the second last.
2. For each number i, iterate from the next number j to last. This gives us all the pairs [i,j].
3. For each pair, find the difference, d = j - i.
4. Keep a map with this difference d as the key, and for value - a list of all sequences that have this difference in its consecutive numbers. Note that this will be a list of sequences, as there can be more than one sequence for that difference.
5. See if the difference was already encountered, if not create a new list of sequences.
6. If there was an existing list of sequences, find the sequence in that list that has the first number i. If a sequence was found, add j to it. If not, we create a new sequence and add i and j to it. It's very important to note that for a given difference, there can be only one sequence that has the number i in it. For a sequence, we will use a set data structure.
7. At the end of all iterations, we have created an interesting data structure. At the top level is the map, that uses an the difference between consecutive integers as the key, and for value it has a list of sequences that have that difference. And each sequence is a set.
8. When using this data structure, we have to discard the sequences that have only 2 elements in it.
Let's see how this work for the sequence 2 4 5 6 8 9. The following list shows how the data structure will look after each iteration.

i = 2, j = 4. Map { 2:[(2,4)] }
i = 2, j = 5. Map { 2:[(2,4)] 3:[(2,5)] }

i = 2, j = 6. Map { 2:[(2,4)] 3:[(2,5)] 4:[(2,6)] }
...
i = 4, j = 5. Map { 1:[(4,5)] 2:[(2,4)] 3:[(2,5)] 4:[(2,6)] 6:[(2,8)] 7:[(2,9)] }

i = 4, j = 6. Map { 1:[(4,5)] 2:[(2,4,6)] 3:[(2,5)] 4:[(2,6)] 6:[(2,8)] 7:[(2,9)] }
i = 4, j = 8. Map { 1:[(4,5)] 2:[(2,4,6)] 3:[(2,5)] 4:[(2,6) (4,8)] 6:[(2,8)] 7:[(2,9)] }

Note that till these iterations, there is only one true sequence in the data structure above : 2:[(2,4,6)]. Of course more would be found in later iterations.

With this, let's look at the Java code.
/**
 *  Finds arithmetic sequences within a list of sorted numbers
 */
public static void findSequence (int[] nums)
{

    // Iterate over the array
    // Starting from first element, till second last element
    // For every element, iterate over the list again to find all pairs
    // For every pair, find the difference
    // For the difference, find the sequences
    //
    // There can be multiple arithmatic sequences for the same difference.
    // See if the lower number is already part of any sequence for that diff.
    // If yes, then add the higher number to that set.
    // Else, create a new set, add both numbers to it
    //
    // Any set that has 3 or more elements
    // is an arithmetic sequence.


    // Note the data structure.
    // Map the difference to a collection of sequences.
    // Each sequence is a SortedSet

    Map >> arith_sequences
        = new HashMap >> ();

    for (int i = 0 ; i < nums.ltheength - 1 ; i++ ) {
      for ( int j = i+1 ; j < nums.length ; j++ ) {
        // work on each pair
        long diff = nums[j] - nums[i] ;
        if ( ! arith_sequences.containsKey (diff) ) {
          // create the collection when the diff is
          // encountered for the first time
          arith_sequences.put (diff, new ArrayList>()) ;
        } //
       
        Collection> sequences_for_diff
                   = arith_sequences.get (diff) ;

        boolean found_sequence = false ;
        for (SortedSet sequence : sequences_for_diff) {
        if ( sequence.contains (nums[i]) ) {
            found_sequence = true ;
            sequence.add (nums[j]) ;
            break ;
        } //
      } //
      // if no sequence was found that contained i,
      // then create a new one
      if ( ! found_sequence ) {
        SortedSet sequence = new TreeSet () ;
        sequence.add (nums[i]) ;
        sequence.add (nums[j]) ;
        sequences_for_diff.add (sequence) ;
      } //
    } //
  } //



} //

The complexity is obviously at least O(N^2). For every pair of thse N*N pairs, we iterate to find the sequence that has the lower number in it. Intuitively, it may seem that the worst case will happen when the array contains N consecutive integers from 1 to N. Then the map will have keys for each number from 1 to N-1. But the value will have a list that contains only one sequence, and it will be found in just one iteration. For multplying the complexity, we need the list to have many sequences for the same difference. This depends on the data. Honestly, I do not know how to compute that complexity. Of course the cost of manipulating the data structure - adding a number to the sorted set should also be taken into account. Again, it's getting added only at the end - so that should be fast.

In any case, this is simple, and reasonably efficient algorithm for the job.

Friday, September 7, 2012

Work In Progress

One of the strengths of Alan Jackson's music is the lyrics. If "Remember When" was very sentimental, this "Work In Progress" is a humorous admission of every husband's incompetence, and their inability to win some approval from their better half. Let's call it Husbands Anthem.

Admittedly, this tune is not all that great. But Alan's singing makes up for it, and it is funny.
Alright, I admit it; I forgot our anniversary.
I did pick up the baby this morning at the nursery.
That ain't no big thing; It's a gold star for me.

You get tired and disgusted with me,
When I can't be just what you want me to be.
...
I even asked the Lord to try to help me:
He looked down from Heaven, said to tell you please;
Just be patient, I'm a work in progress.

My personal favorite is
I try to do that health thing like you want me to do,
That low-fat, no fat's gettin' hard to chew.
Now, I love your cookin', honey,
But sometimes, I need some real food.



Previously :
It's a little too late
Remember When

Monday, September 3, 2012

Is Everyone Hanging Out Without Me?



Book Review : Is Everyone Hanging Out Without Me?
Author : Mindy Kaling
My Rating : 3 out of 5

The complete title of the book is "Is Everyone Hanging Out Without Me? (And Other Concerns)".

Like so many other books, I came to know about this book when the author was interviewed on The Daily Show. I became interested, because I had never heard of Mindy Kaling before.

So a couple of admissions before I begin the review. I have not watched the NBC show "Office". I have heard great things about it (and the original BBC show), but never saw it. After reading the book, I definitely plan to watch it on DVD.

Secondly, I am not a fan of the genre "auto-biography" or "memoir". I think there are very few people in this world who live a truly extra-ordinary life, and should tell the details about their own lives to others.

With this bias and the complete lack of knowledge about the author, I started reading the book with some curiosity. Curious, because I was pleasantly surprised to find a lead writer of "Office" to be a child of Indian immigrants. And the title is definitely catchy.

This is a memoir sprinkled with many random observations. Some chapters are about her life as child of loving parents. Some about how she got to be where she is today. Some chapters are just randomly inserted observations.

She comes across as a very normal person. Someone who you would love to have as a friend. She doesn't shy away from bragging once in a while, but is mostly honest. The writing is smart, frank, quirky, cute and definitely funny. All this adds up to a book that can be hilarious at many places and be read quickly.

But still, all that cannot hide the flaws. One of which is, the book oozes with narcissism. I do not want to take away any of her achievements. I just don't think these are great enough to write a book about - yet. I wish her well, I hope she continues her success. But right now, there is not enough substance to be written about. Hence, lot of small chapters are added about various lists, such as what is her definition of friendship, what she looks for in a guy and all those topics that everyone thinks of themselves as an authority. Then, there are many inside jokes that I didn't really care about.

I am on the fence about recommending this book. It is funny. Maybe you can browse through some chapters (in any order, it really doesn't matter), and see if you want to read more. It's a pleasant read that will make you laugh, but I am not sure if it's worth the time to read from start to finish.
Related Posts Plugin for WordPress, Blogger...