Tuesday, April 19, 2011

Commentary - Newcastle United v Manchester United

First Half:
----------
Tim Krul with an awesome reflex save off the Chicharito effort. Judged the perfect time to dive for the save.

Evra, apart from the lob that put Rooney through, has given the ball away every time.

Chicharito already with a couple of great shots on goal. Rooney and Nani looking potent, everyone else apart from Vidic and Smalling looking jittery still.

Newcastle playing some nice expansive football.

Giggs hasn't done much apart from bundling players over. Early days in the game yet . Come on you legend!

Jose Enrique looks like a player. Gets himself out of tough stops by some nice passes.

United finally with some measure of control in the Newcastle half.

Liking McManaman's commentary. On Newcastle's counter attack, United had 7 in the box compared to Newcastle's one for the Ameobi cross.

O'Shea dummy. Whoa. Nice unexpected play.

Sir Alex Ferguson looking on with a modern headset plugged into his ear. For once he has ditched the age-old landline phone.

What a useless booking for Michael Carrick. McManaman is right, the yellow card is more for the accumulated fouls from Man Utd, and a nothing foul on its own.

What a cross field pass from Rooney. Hernandez denied yet again!

End of half.


Sunday, April 10, 2011

Java stores a reference to the value when you put in hashmap, not a copy! #chilldownthespine

Literally shocked. Alright, this kind of feeling is not something I have experienced while working with Java before. Mostly it has been frustration leading me to take a long long break before returning to the code only to find that I was just plain silly. But this is different.

The offending piece of code: (simplified)

Double[] arr = new Double[N];

for (String key : sampleHashMap.keySet()) {
for (int i = 0; i < N; i++) {
arr[i] = get_some_random_value();
}
myHashMap.put(key, arr);
}

When we get to the line for updating arr[i], believe it or not, all values of arr already in myHashMap hashmap get updated!
There is just one double array arr. Every iteration, it gets updated with new values, and somehow, these values are reflected in the myHashMap for all keys which are already stored in there. It is as if all the value mappings in myHashMap, still point to the same address where tfIdfForAllDocs is written.

To solve this, I made sure I am creating a new double array every iteration.


for (String key : sampleHashMap.keySet()) {
   Double[] arr = new Double[N];  
for (int i = 0; i < N; i++) {
arr[i] = get_some_random_value();
}
myHashMap.put(key, arr);
}



When you do put operation on hashmap, the value that you are giving to the function, a copy of the value is NOT getting stored in the hashmap. Just the reference of the original value!


Monday, January 17, 2011

Verizon iPhone

Back after a long hiatus from blogging. And what an apt story to report on the groundbreaking event of my comeback. The iPhone 4 has been announced on Verizon, finalllyyy.

I am not going to talk about the specs or other technical facts. My interest in this story is rather selfish. Living in Foster City CA, I experience many call drops when I am in my apartment. I can't remember a day when I wasn't faced with the ignominy of an irritating call drop. It is widely reported that it is because AT&T's current infrastructure cannot handle the massive iPhone customer base, therefore the drops. Lets see if there is any improvements on that front.

Samsung Focus has been my preferred device for a long time, only for the irritating upgrade date to be in July of this year. I don't want to fork out 400 bucks for a device which will be available for $50 if I was eligible. Either way, I plan to wait till July 26th, holding my breath, hoping for a better WP7 device or a revolutionary phone to come along in the meantime. All thoughts about upgrading my phone are hereby put to rest. Amen.

Wednesday, November 10, 2010

Dropped points by us and them (weekly updated list)

Note: I have now discontinued updating this table. There have been so many points dropped that it is pointless to find any logic in this exercise. However, Man Utd is still unbeaten in the league, even after playing like crap for most of the season. Only Vidic's defensive gladiatorness is saving our asses. Yeah, I just coined that word. Fits our captain invincible aptly, doesn't it?

Manchester United
-------------------
Draw v Fulham (Away) - 2 points
Draw v Everton (Away) - 2 points
Draw v Bolton (Away) - 2 points
Draw v Sunderland (Away) - 2 points
Draw v West Brom (Home) - 2 points
Draw v Man City (Away) - 2 points
Draw v Aston Villa (Away) - 2 points

Chelsea
--------
Lost v Man City (Away) - 3 points
Draw v Aston Villa (Away) - 2 points
Lost v Liverpool (Away) - 3 points
Lost v Sunderland (Home) - 3 points
Lost v Birmingham (Away) - 3 points
Draw v Newcastle (Away) - 2 points

Friday, October 22, 2010

Quotes from the Rooney situation

"To suggest Wayne Rooney will be sold in January is nonsense'' - a United spokesman on Sunday, October 17.


"I was in the office on August 14 and David (Gill, chief executive) phoned me to say (Rooney) wasn't signing a contract. I was dumbfounded. Only months before he was saying he was at the greatest club in the world. I asked to have a meeting with the boy. He reiterated what his agent said, that he wanted to go'' - United manager Sir Alex Ferguson on Tuesday, October 19.

Google India Music Search

Impressive step taken by Google India. What defines India better than Bollywood music? And what do Indians use to find songs online? Answering these questions, the nice folks at Google India have announced Hindi Music Search. Its a win win for all. People continue using Google, the content providers are SaReGaMa, In.com and Saavn. Google must be giving a percentage of revenue generated from the traffic to these content partners to keep them happy.

Either way, most significantly, its a much needed tool for Indian music lovers, and almost guaranteed to be a hit.

To make it better, we would like to see a Pandora way of discovering similar music. Looking forward to it!

Rooney staying!

Wow, what a crazy world we live in! After the agony and controversy over the last week, we learn today that Rooney has executed the mother of all U-turns and signed a 5 year deal with the club. I would like to postulate the events that led up to this conclusion. There are many theories out there, and none of them can be confirmed in any way simply because WE DON'T KNOW ENOUGH. I have some realistic and some utterly insane theories in mind, which I will post soon, one by one. Watch this space.