C# code to return last day of the month

Sure this will be important one day for all the coders out there. A simple way of returning the last day of the current month;

1. public int getLastDateoftheMonth()
2. {
3. DateTime firstDay = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
4. DateTime lastDayOfMonth = firstDay.AddMonths(1).AddTicks(-1);
5. return lastDayOfMonth.Day;
6. }

Pretty simple approach, but sure will save lot of thinking time. Hope it'll be useful to someone.

On the way to work

It was a just another working day. I got into a 122 bus from Maharagama and everything was quite normal till the bus came in to Wijerama Junction.

At Wijerama two people from a bus which was coming behind came in to our bus and started a argument with the Conductor of the bus which I was in. It has something to do with the regular races they have. It got little hotter and started a fight. Boy it was disgusting people in the bus were shocked. The conductor of the bus which I was in had a good share of hits from those two fellows, apparently those two were passenger (may be regular) of that bus. There was a Buddhist monk in our bus as well, he was really helpless together with all the other passengers.

Then again bus started to move and while the buses are going parallel they started scolding at each other and also throwing things between the buses. We, passengers were helpless and the fighter never gave a damn about us. It was a typical fast moving fighting scene from a movie, and I was living inside the movie. Again near a police station one of the fighters from the other bus came in to our bus and started a fight again, I rushed in to the police station and complained about the incident to the Police man who was at the gate. Understandingly he couldn't come because his priority was to guard the gate. And there was another policeman who is just coming to work, and he came with me. But he had no intention of cooling down the
situation, even infront of him the both parties were scolding at each other in filth. Then again buses started to move while the conductor of our bus calling to all of his friends for help using his mobile to kill his revivals. That is technology at its best use. And at last I managed to reach my destination.

It was like being in a Hindi movie. It simply had everything heroes, villains, action, adventure, jokers and little romance from the couple sitting in front of me. At the end I thought what a eventfull country this is, where else you can have such a eventfull way to work. I simply proud to be a Sri Lankan.

Why Mahela's Resignation is good for Sri Lankan Cricket

Aftermath of Mahela's resignation from the Cricket Captaincy is not something I am surprised of, specially the media hype. What is most hilarious factor is same media people who criticized Mahela when he fails are now saying he should remain as the Captain. But this is not something new for Sri Lanka as we experienced these type of things with Arjuna and Marvan in the past.

Mahela is my favourite batsman, also the most gifted and talented batsman Sri Lanka produced after Aravinda de silva. The inning he played to see Sri Lanka trough against England in Australia was one of the best for me. Also the master piece of 2007 World Cup semi final against New Zealand. He has given lot to Sri Lankan Cricket there is no doubts about that. As a captain he has brought a lot for SLC as well. He has transformed a team which had lot of potential but less success in to a winning team in both forms of the game. Apart from that he has brought new culture in to the team which has ultimately provided us a winning team.

But it is really the time for him to quit the job. As Jayasooriya did in the past which ultimately gave the birth to two most successful captains Marvan and Mahela. Mahela is a very smart person who knows exactly what he is doing in and off the field. There are lots of talks about the political pressure and stuff. Regardless of those things if we concentrate on Cricket, Sri Lankan team really needs a change here. Mahela's era should end and team should start fresh for 2011 World Cup. If he delayed his call as it would have being a desaster for SLC which he understood perfectly. He knew if the team continue to loose more matches and if he continue his bad period with the bat, his farewell will be very much painful. Also the selectors will have to find a Captain in a rush and will not have time to build a new team. Now, even we loss few more matches we can take it as the transition period and build up. And also in Mahela's perspective this will give him time to comeback as a ODI batsman by only concentrating on his batting.

So hats off to this talented stroke player and one of the best captains we had, for not being selfish and giving 100% to his country and the game.
Blog Directory - OnToplist.com