Monthly Archive for December, 2011

EPL: Wigan Athletic vs Chelsea – Dec 2011 – Post Match

Villas Boas

Villas Boas

My reaction after the substitutions – WTF is going on in AVB’s mind?

Bringing on Kalou in place of Romeu made technical sense. A 0-0 scoreline against a weaker opponent suggests the introduction of a more attacking player. The choice of player in this case wasn’t something that pleased me though. Whenever I see Kalou, I am reminded of the handball and subsequent penalty given by him to Valencia in the dying moments. This guy doesn’t inspire confidence.

AVB’s next move is more baffling. He brings on Mikel for Mata! Dude. Just 1 up against a team fighting the relegation threat, one must always be on the offensive. Sacrificing your most creative piece for a player who doesn’t deserve a place in any of the top teams makes no sense at all. With this move, Chelsea went into a 4-2-1-3 formation. The only motive at this point was to desperately hang to the lead. And that’s something you do against a better opponent and not Wigan!

The third substitution was absolutely scandalous. Pray tell us the name of the Oracle that told you removing your goal scorer for a lame runner will benefit your side. At this point Wigan were already pouring forward trying to get the equalizer. AVB’s move – let me pick up someone randomly from the field and the bench and swap them. Gosh! That’s terrible.

All this while when Chelsea were in trouble I have defended AVB. But today I am forced to ask what his plans actually were? What was he really expecting his substitutes to accomplish? How can he publicly state that he’ll help Torres find his best form and never give him a chance to play?

I think AVB has totally lost his plot. The pressure’s gotten to him. He has finally bowed down and abolished his attacking principles. The complete 90 minutes Chelsea were playing a purposeless game. There was no real passion or determination to win the game. They just sat back to defend and hoped they get a goal as a gift. It was a drab, dull and boring match. A waste of 90 minutes. Nightmarish. This was just as terrible as the 5-3 drubbing by Arsenal. They could have just bent over and saved themselves the humiliation of almost getting beat by an 18th placed team.

I don’t know what else to say. There was not a single minute in the game when Chelsea looked confident or a title challenger. Easily one of the worst games of the season so far.

Popularity: 2% [?]

Opportunity For The Golden Boy?

Fernando Torres

Fernando Torres

It’s been an year of disappointment for our new number  9 – Fernando Torres. Having sealed a big money transfer from Liverpool on the  January deadline day, he has failed to match the expectations. Yes he was completely out of form when he joined us, but he’s had an year to improve on that. An year is no little time.

With AVB and his new philosophy Torres looked like getting some of his charisma and form back for good. He was good against Manchester United -discount the missed chance – played well in the next match before getting red carded and also scored in the next Champions League game. More importantly, his movement was good and he was willing to run and create opportunities for himself. And then somehow all the hard work was undone and Torres became the same lonely sad figure he was earlier. He has now lost his position in the Chelsea first team. Even for Spain he starts on the bench!

But then yesterday such events unfolded that could revitalize his campaign. There were rumors that he had been put on the market. AVB quashed the rumor insisting that there were no plans to offload the striker – not now nor in summer – a morale boost? Then Drogba will be leaving for the African Cup of Nations in January. We will be left with Torres, Sturridge and Lukaku as the only strikers. Sturridge will start on the wings till we get a new winger. Lukaku still needs to adapt to the English football. This could mean that Torres start each match in January as the central striker – golden opportunity. And then David Villa got himself injured and is expected to face some 6 months on the side lines. Torres does well for Chelsea and he’ll be an automatic selection for the Spain national team – does one need a bigger motivation than this?

The next 50 – 60 days could make or break Torres’s career at Stamford Bridge. I hope he shines. I am desperate for him to score goals for us.

Popularity: 1% [?]

EPL: Chelsea vs Manchester City – Dec 2011 – Post Match

Chelsea vs Manchester City

Lampard converts a penalty to hand Manchester City their first loss of the season

Did you just see how Lampard celebrated his penalty conversion? Did you notice his passion for the club? Well one thing is certain, he won’t be leaving the club any time soon. And if any manager dares to put him on the transfer list he’ll receive a lot of stick for such an action.

But the writing on the wall is a sure sign that we are moving away from the era dominated by Terry, Cech, Lampard and Drogba. In the past it was mostly Lampard who would take the free kicks. 99% of the penalties were also taken by him. But that role has now passed on to Mata as AVB explained after the match. Slowly but surely a new team is being built with Malouda and Anelka already relegated to the bench in favour of Sturridge and Mata. Also Mikel finds no place for himself as the more technical and quick Romeu has proven to be more than adept at that position. And with Drogba leaving for the African Cup of Nations in January, who knows how much good will it do to Torres and Sturridge. Perhaps when Drogba returns we’ll already have 3 top central strikers – Lukaku being the third.

The game began just as I had expected. Chelsea started with the same attacking philosophy and the high defensive line and were immediately penalized by a marvelous Aguero setting up Balotelli’s goal. Another 10 minutes of misery and our defenders decided to abolish the high line and defend deeper. The impact was immediate. Manchester City were no longer able to find space to trouble Cech and our quick midfield counter attacked whenever given the chance. And then with a moment of Sturridge’s brilliance Meirless found the net to equalize.

Second half started on a better note for Chelsea. Now that we were defending deeper, the confidence cascaded across the team and we got forward a lot more. Clichy’s wretched night saw him earn a second yellow. In all fairness he was no match for Sturridge on that day. With Manchester City down to 10 men, their game plan was to defend and hold out for a draw. This spurred us on. And once again Sturridge was the man of the moment. His shot was blocked by Lescott’s hand and a penalty awarded to Chelsea. Lampard converted the penalty with ease. From that moment on, there was no looking back. A deserved victory saw us cut down the difference to the top of the table to 7 points now. With any luck, if Manchester City were to lose to Arsenal and Chelsea win against Spurs, we will have a great shot at the title.

Romeu seems to have made the DM position his own. He is so calm at the ball, it’s as if he has a while minute to decide whom to pass the ball. That was something missing with Mikel. Ramires and his bursts of energy has seen Chelsea attack a lot more through the right wing this year. Earlier it was the combination of Cole and Malouda on the left that did the trick for Chelsea.

But once again we had to rely completely on Drogba for the central position. This is something that continues to worry me. Lampard is already being phased out and we need to do the same with Drogba. Torres needs to play more. We need to have faith in him for the long term.

Popularity: 1% [?]

EPL: Chelsea vs Manchester City – Dec 2011

Chelsea vs Manchester City

Chelsea vs Manchester City

It’s the big one today. We face the table toppers at our home. It’s the clash of a fearsome attack against a shaky defense. And I’m afraid. Already AVB has declared that if we lose this game our title race is all but over. A win is vital today and nothing else will do.

Manchester City has set the premier league alight with an amazing display of attack. Having scored 48 goals in the first 14 matches they’ll beat Premier League’s record of highest number of goals – 103 by Chelsea in 2009 – 2010 season – by a big margin. It’s their latest acquisition – Sergio Aguero – who has been the most devastating. He is a potent goal scoring machine. And what makes it worse is that Chelsea had kept tabs on this guy and he could have been in our team had things turned out differently (we put our faith in Torres).

Not to forget David Silva. The guy picked up from where he left the previous season. He’s arguably among the best midfielders in the league, if not the best. He is their main architect.

I’m afraid that these two could rip apart the Chelsea defense just the way they did it with Manchester United, more so if AVB decides to revert back to the high defensive line that our back four are so uncomfortable with. That brings us to the main question – what is going to be AVB’s strategy today? Will he defend deep like he did against Valencia in a do-or-die game? Seems likely because he cannot risk losing this game and slipping 13 points off the top. In fact, he might just play the same team that defeated Valencia by counter attacking which means that Torres will spend another game watching from the bench. Mancini would suspect the same. So will AVB surprise everyone by doing just the opposite and play like Chelsea played against Manchester United – remember had our strikers been more accurate we could have won that day.

For this game I do not want to voice my opinion. I just want us to win this one – hook or by crook. We cannot afford any more losses. And AVB needs a few victories for all the unpleasant rumors to die down. Only by winning a few matches can he gain the confidence of fans and experiment.

I’ll be watching the game with my fingers crossed.

Popularity: 1% [?]

Impossible Null Pointer Exceptions

I must admit this had never occurred to me before but after reading, the explanation seems so obvious!

You can get NullPointerException from lines in Java which appear to have no possibility of throwing them, such as;

this.setCount(num)

The null pointer exception can come about when num is of type Integer and setCount takes an int parameter. Java’s auto-boxing will automatically call num.intValue(), and if num is null you get an exception.

Of course, the fix is to check for null-ness and treat it however the semantics of your operation requires.

From the SDE Tip – Amazon

Popularity: 1% [?]

Find Files Of A Given Name Instantly

Usually when I have to find a file, I use a find and a grep command together – because I still haven’t learnt to use find properly. This is what I do:

find -L . | grep <name>

But this process is usually slow as it traverses the whole directory structure recursively following the symlinks to find all the files and then greps for the name that I need.

Recently I learnt about a faster way of doing the same – use locate to find files of a given name quickly. The command is:

locate <name>

It creates an index of all the files on the system and searches off it when called for. The index is rebuilt (by default) once a day by a cron’d find so results maybe stale by 24 hours.

If locate is not already present on your system, you could install it by:

sudo yum install mlocate

From the SDE Tip – Amazon

Popularity: 1% [?]

Save File With Sudo Permissions In VIM

A lot of time I open a file, make changes and when the time comes to save it realize that I hadn’t sudo’ed it. Learnt that the following command helps:

:w ! sudo tee %

Here’s the reason:

:w tells the vi to save modification of the file

! sudo tee executes the tee command with sudo permissions taking it’s input from :w

% here means the current file name

From the SDE Tip – Amazon

Popularity: 1% [?]

CL: Chelsea vs Valencia – Dec 2011 – Post Match

Chelsea vs Valencia

Chelsea vs Valencia - The Drog Show

The match result left me ecstatic.A 3-0 victory on a night when there was everything to lose speaks volumes of our players nerves. I am a Chelsea fan and loved the Champions League results – the arrogant Manchester United dumped out by Basel and Manchester City humbly shown the exit door by Napoli.

It was a vintage performance by our team – reminds you of the Mourinho and Anchelotti era. Without the ball we defended passionately and with it tried quick counter attacks. There was no desire of ball retention at all.

This was a night dictated by our Old Guard – Terry, Cech and Drogba, sadly Lampard was missing the action. Once again they rose from the ashes of criticisms to put on a grand show. Cech made wonderful saves diving full length. He kept the Valencia attack at bay with ease. There was only one chance when the ball hit the side bar immediately after Chelsea had scored. Otherwise Cech commanded the goal majestically. Terry and Ivanovich stood like walls in front of their goal keeper. Diving into everything, they made sure that the opposition strikers don’t get a chance to come any where near the goal. Valencia had to be content with long range attempts.

But most of all, it was The Drog Show on display at the Stamford Bridge. I am among the people who have voiced for Drogba to be replaced by Torres in the starting line up. But he proved yesterday night that Torres will always find it difficult to be the automatic choice. His strength, aerial prowess and the ability to hold up play was what got us through that night. In times when defending desperately, you could just lop the ball to this man and he’ll take care of the rest.

Yes, it was the experience and not the youth that got us through. It was the will to prove themselves that got us through. People have been talking a lot about a subdued Stamford Bridge and a fortress that once was and can never be again – it was the need to silence them that got us through.

But this was so uncharacteristic of AVB. At the end one can argue that the strategy was effective,  but would I want my team to play like this every match? Definitely no!

AVB was brought to transform the style of our play. He wants more ball retention and higher tempo. Chelsea has found it difficult to adjust to these new demands. But you have to go through a painful learning curve. Dumping one philosophy and adopting another is not an easy task as AVB must have realized. Yet one must not give up.

AVB is young and this is his first big assignment. He is also learning. The positive I can take out of the match is that he can have two styles of play – the attacking and the defensive one. Quite often this season we have given away last minute goals. This is because we always stick to the high line of defense – something our defenders are not super comfortable with. Also since we want more ball retention the defenders, when challenged by the other team, try to play the ball to one another or a midfielder instead of just kicking it out of play. Luiz being more comfortable with the ball is able to do this, though he over does it. The others are still learning.

What we can do is to attack and get a bit defensive towards the end of the game when playing a tough opposition – when playing against Manchester City and Spurs for example. As seen yesterday, Terry and co. are very comfortable sitting deep and defending as if their life is at stake. But when we play lesser opponents, I want us to attack all the time. Maintain the high line, press a lot and convert shots on goals. With time we can completely transition to the more attractive style.

There have been lot of rumors in the papers lately. But I want Lampard, Terry and Drogba to see off their playing career with us. They’ve given so much to the team. They were the first revolution. Let’s see what the future holds for them.

Popularity: 1% [?]

I Am Super Hungry

It’s 5 in the morning. I haven’t slept yet. And then I realize that I am feeling super hungry. I need something to eat like right now!

Everything’s so quite. Everyone’s asleep. Not a sound to be heard. I did not want to wake anyone up. I find my way through the darkness to the kitchen. Switch on the lights. Look around in desperation but find nothing. Damn! I remember Pappu had cooked kheer a couple of days ago. Fingers crossed I open the refrigerator. Tons of boxes lying around and any of them could be the one containing delicious kheer for me. Patiently I open each box one by one, always replacing them in their correct place. All boxes checked but no kheer. Huh! The very thought of kheer makes me hungrier still. Cruel. God I need something to eat.

Papad is what comes to mind. Same sad story – cannot find papad to roast. There’s a bottle of Pepsi I don’t want to drink. There’s soda for squash. I remind myself that it’s hunger and not thirst that I need t get rid of.Look around once again just to find something to eat. Heck! There’s nothing in the kitchen. No ice-cream. No kheer. No fruits. I don’t want to eat the cold dinner food.

I give up. I walk back towards my bedroom. That’s when I remember that we have some snacks stacked up in the television cabinet. There it is. A packet of Haldiram’s Aloo Bhujia! Get it to my room. There’s Eagles – New Kid In Town playing. A mouthful of Haldiram. Ah! Bliss. If only Birinder Tiwana was here, he could have made a half-fried egg for me.

Well fed and watered, I am feeling sleepy now. I need to wake up for the afternoon show. Going to the movie – Dirty Picture – along with roommates. Good night!

Popularity: 1% [?]

Project Euler 43: Pandigital Numbers With Unusual Substring Divisibility Property

Anuvrat Singh Project Euler Badge

Anuvrat Singh Project Euler Badge

This was one of those questions that can be solved using a pen and paper. Problem 53 requires one to find all the 10-digit pandigital numbers which satisfy the following properties:

d_2d_3d_4 is divisible by 2

d_3d_4d_5 is divisible by 3

d_4d_5d_6 is divisible by 5

d_5d_6d_7 is divisible by 7

d_6d_7d_8 is divisible by 11

d_7d_8d_9 is divisible by 13

d_8d_9d_{10} is divisible by 17

Just to reiterate, a pandigital number is one in which each digit occurs only once. This is how we proceed:

  • d_4d_5d_6 is divisible by 5
    • This implies that d_6 is either 0 or 5.
  • d_6d_7d_8 is divisible by 11
    • This implies that d_6 + d_8 - d_7 is a  multiple of 11.
    • If d_6 were to be 0, it would mean that d_8 = d_7 or d_8 = d_7 + 11, neither of which can be true given that the number we seek is pandigital.
    • So we can assert that d_6 = 5.
    • We need all the pairs of d_7 and d_8 satisfying d_8 - d_7 = 6 or d_8 - d_7 = -5.
      • Possible (d_7, d_8) pairs are (6,1), (7,2), (8,3), (9,4), (1,7), (2,8), (3,9)
  • d_5d_6d_7 is divisible by 7
    • This essentially means that 10*d_5 + d_6 - 2*d_7 is a multiple of 7. We already have the value for d_6 and have narrowed down the possible values of d_7.
      • d_6, d_7 = 5, 6 \Rightarrow d_5 = 7
      • d_6, d_7 = 5, 7 \Rightarrow d_5 = 3
      • d_6, d_7 = 5, 8 \Rightarrow d_5 = 6
      • d_6, d_7 = 5, 9 \Rightarrow d_5 = 2
      • d_6, d_7 = 5, 1 \Rightarrow d_5 = 6
      • d_6, d_7 = 5, 2 \Rightarrow d_5 = 9
      • d_6, d_7 = 5, 3 \Rightarrow d_5 = NA
    • Possible (d5, d6, d7, d8) tuples are (7,5,6,1), (3,5,7,2), (6,5,8,3), (2,5,9,4), (6,5,1,7) or (9,5,2,8).
  • d_7d_8d_9 is divisible by 13
    • This implies that d_9 + 10*d_8 + 9*d_7 is a multiple of 13. We have already identified the possible d_7, d_8 pairs. We can get the possible d_9 values now.
      • d_7, d_8 = 6, 1 \Rightarrow d_9 = NA
      • d_7, d_8 = 7, 2 \Rightarrow d_9 = 8
      • d_7, d_8 = 8, 3 \Rightarrow d_9 = 2
      • d_7, d_8 = 9, 4 \Rightarrow d_9 = NA
      • d_7, d_8 = 1, 7 \Rightarrow d_9 = NA
      • d_7, d_8 = 2, 8 \Rightarrow d_9 = 6
    • Possible (d_5, d_6, d_7, d_8, d_9) tuples are (3,5,7,2,8), (6,5,8,3,2) or (9,5,2,8,6).
  • d_8d_9d_{10} is divisible by 17
    • This implies that 10*d_8 + d_9 - 5*d_{10} is a multiple of 17. Again using the possible values of the other two variables, we can narrow down the value of the third one.
      • d_8, d_9 = 2, 8 \Rightarrow d_{10} = 9
      • d_8, d_9 = 3, 2 \Rightarrow d_{10} = NA
      • d_8, d_9 = 8, 6 \Rightarrow d_{10} = 7

So we now have the following tuples for the values of (d_5, d_6, d_7, d_8, d_9, d_{10}): (3,5,7,2,8,9) or (9,5,2,8,6,7).

d_2d_3d_4 is divisible by 2 tells us that d_4 is even. So in the first case it can take the values 0,4,6 and in the second case the values 0,4.

Finally, using the last condition that d_3d_4d_5 is divisible by 3, we conclude that d_3, d_4 in the first case can be either of 6,0 or 0,6 and in the second case is 0,9.

Thus we have the six possible numbers as: 1406357289, 1460357289, 4106357289, 4160357289, 1430952867 and 4130952867. And we are done! Sum of these 6 numbers is what the problem asked for.

Popularity: 5% [?]