Cricket Commentators, Are they really expert?

We all know Cricket is a very unpredictable game. But have these so called expert commentators really understand that? Given the fact that most of them have played lot of cricket and matured with the game they should be seeing things beyond our view. Instead they predict things like armatures.

Find Modified date of a Stored Procedure

This will be very helpful since the GUI doesnt show the modified date of a SP in SQL Server.

SELECT name, create_date, modify_date
FROM sys.objects
WHERE type = 'P'
AND name = 'spname'

T-Sql NOT IN is not returning expected results in SQL Server

I ran into this problem several times and when ever I encountered this problem I used to change my query to avoid this. But today I had sometime to dig into the root of this issue. Here are the problem, cause and the solution;

Lets take a simple example where you have a Customer table and a Invoice table (this is my favourite scenario since a POS system was my first ever commercial project). Invoice table has a foreign key to Customer table. Let say you have come across a situation where you want to find out customers who doesn't have any Invoices against them. You would probably write the following T-SQL (There are few other ways you can write this, but I know most of the SQL coders prefer IN and NOT IN);

SELECT customerName FROM customer WHERE customerID NOT IN (SELECT DISTINCT customerID FROM Invoice);

Sanga and the team : We are proud of you guys

When our cricket team looses, most of the times we used to criticise them. But this T20 World Cup final was one of the rare occasions we feel proud about the team despite the loss. The passion and the spirit the whole team showed through out the tournament was outstanding. There was always someone who stood up and took the responsibility either in batting or bowling. I am really proud of them and whole world would never forget specially how Dilshan, Sanath, Sanga, Mahela, Murali, Mendis, Mathews and Malinga played in this tournament. You all have made Sri Lanka proud. Cheers to all of you guys!!!!

How Indian Cricket fans can show their anger in a peaceful manner

This is an innovative thinking from Nishi Narayanan from Cricinfo. But as we all know Indian supports are the last in the line to accept these kind of CIVILISED ways.

1. Send an anonymous tip to airport authorities regarding possible swine flu among the Indian team contingent. Getting them quarantined will be much more satisfying than breaking a few windows.

2. Hold a press conference. Have all aggrieved Indian fans stand on a stage behind Bishan Bedi, who will read out a hand-written letter telling the players what a bunch of wusses they are for not staging a walkout to protest the short-ball barrage by England.

3. Don't bawl or cry foul murder when reporters stick their mikes into your faces asking for reactions. Be cool. How do I feel now that India have exited the World Twenty20? A little constipated, but I think that's the Chinese takeout from last night.

4. Threaten to support England in the next tournament in that country. The concept of English grounds being filled by thousands of fans cheering for England is bizarre enough to mess the minds of the Indian players so much that they'll need John Buchanan to explain it to them.

5. Invite the players to parade in an open-top bus through the streets of Mumbai as a we-forgive-you gesture. If they survive the ride in the city's monsoons, organise a function for them to watch their post-match interviews where every "obviously" and "of course" is replaced by the sound of nails on a chalkboard.

6. Spread a rumour through the press that Shahrukh Khan plans to buy the whole team for his franchise. If the thought of playing for Kolkata Knight Riders doesn't depress them, the fear of fakeiplplayer leaking all their dirty secrets will surely get to them.

7. And finally, do as Gandhi would. Boycott products endorsed by cricketers. Don't buy shampoos, soaps, cellphones, colas, water, satellite TV, motorbikes, cars, clothes, electricity, chocolate, chips, air conditioners and refrigerators. That leaves books and maybe air. A refreshing and uplifting lifestyle. The Mahatma would approve.

LINK

BBC and Mahinda Rajapakshe

I was reading the news in BBC website on yesterday's (03rd June 2009) celebrations in Colombo. It really made me feel better, purly because the tone that artical was written. It makes the sound of a nation who are really hurt. Mahinda you ROCKS. Keep it up!

http://news.bbc.co.uk/1/hi/world/south_asia/8080626.stm

Why Prabakaran's dead body is the key to end the War

I personally was never a believer of the concept of "Every Tamil is a LTTE supporter". There are so many examples I could gather from Tamil friends I had and I have in Sri Lanka. I have now been in UK for 2 weeks and my belief has totally changed. I met few of my tamil friends, one of them is a very known one from the school times. We used to talk about LTTE, Elam and the tamil sinhala issue from those days. I always have put him among my POSITIVE examples to not to say EVERY TAMIL IS A LTTE SUPPORTER. I spent few hours with him talking about the current situation. I couldn't believe my ears that I am hearing all those stuff from him. He said this is never going to be over and he quoted a lot of examples such as "where are all these air crafts, weapons, ships" etc. From my heart I knew that he was trying to pretend this is not over. Anyway I was shocked by his change over, he believes they can start it all over and from his words I would suggest he will personally commit to that.

I was so upside down and couldn't believe how he is changed. He was here for more than 5 years and either that changed him or he kept his all the thoughts to him self and showed a different face in Sri Lanka.

Lets say it is an isolated case, I talked to two of other tamil friends of mine who always used to say Prabakharan is a killer, and there is no real issue for Tamils in Sri Lanka. But now they believe Prabakaran brought hope to sri lankan tamils to fight the struggles they faced from Sinhalase.

So is every tamil in Sri Lanka pretending that they hate LTTE? Do they like them secretly somewhere from inside their conscious? Given a chance to open up their own view in another country will they actullay support them? I am not sure about this, but I was so sure it is not when I was in Sri Lanka. But now I am totally confused.

After experiencing all these I had little bit of thinking on this. Then I thought what would happen if the SLA could not find Prabakaran, at least his dead body. It will add an inspirational mystery to his story like Hitlor's. Remaining leaders can easily use this to motivate others to say he is still alive and operating from somewhere. This will give HOPE to all the ealamist all over the world.I would suggest there are nearly half a million of them all around the world, may be more than that. If he manage to either escape or to destroy his body all the bloodshed our forces did will be in vain. There will be another VERSION of this again for sure. What I belive is finding Prabakaran Dead or Alive is the winning factor of this war.

Facebook, the modern age Detective Service

This is a very interesting news which I read today. A boyfriend of a rape victim has started Facebook group called "Find the Sale rapist", where he is asking help from the Facebook community to help the police to identify the suspected rapist. He has included some CCTV images in this group. This is what he has to say about this

"I WANT THIS "SUSPECT" TRIED AND CONVICTED FOR WHAT HE DID TO MY FIANCEE AND TO STOP IT EVER HAPPENING TO ANYONE ELSETHIS "SUSPECT" IS INNOCENT UNTIL PROVEN GUILTY AT TRIAL A TRIAL I WANT TO HAPPEN!"

This is a very interesting move and apparently the first time the social networking site has been employed to identify a criminal.

And what is more interesting is the way Technology is contributing to a better society. Lets wish him best of luck.

Facebook group link

Read the full story here

Enable Remote Connections in SQL Server 2008

Another annoying change to SQL Server 2008 tool set. I don’t know why Microsoft keeps shuffling things here and there. One basic principle of Software Engineering is the Consistency, and that is what never there with Microsoft Products. Every time they release a new version of any product, rather than learning new things users always have to spend lot of time learning how to do things they used to do with the earlier version.

Anyway I am writing this post to save others time. "SQL Server Surface Area Configuration Tool" the one shipped with SQL 2005 is no longer available with 2008. If you want to enable remote connections for your SQL Server 2008 after the installation you have to follow these steps.
1. Right click on the SQL Server 10.0 instance and go to properties, then go to connections tab. In that you have to check the box "Allow remote connections to this server" (See the screenshot). Optionally you can set the remote query timeout property which is in seconds. Click Ok button to save changes and close the window.


2. Then you have to open TCP/IP connections to your SQL Server. To do this you have to use the "SQL Server Configuration Manager" tool. You can open this tool by either typing "SQLServerManager10.msc" as a Run command or through the Programs menu as follows
SQL Server 2008 -> Configuration Tools -> SQL Server Configuration Manager
In the right hand side click on
"SQL Server Network Configuration" -> "Protocols for MSSQLSERVER" -> Right click on TCP/IP in the right hand side list -> Select Enable.
Now you will have to restart the SQL Server service.

3. You can restart the service by either going into the Services in the control panel or from the SQL Server Configuration Manager screen itself. Following screen shows how to do it from the Configuration Manger tool. In the services you have to restart the service named "SQL Server (MSSQLSERVER)" service.

4. Now you may be able to access your SQL Server from a remote client or application if you are using Windows XP or a Server version. But if you are using Windows Vista you may still not be able to access your server if the Windows Firewall is enabled. To solve this issue, you have to enable SQL Server TCP/IP port which is 1433 in the windows firewall. To do this go to;
Control Panel -> Windows Firewall -> Click on Change Settings hyperlink -> Exceptions Tab -> Add Port -> Give any meaningful name for Name textbox -> In to the Port Number textbox 1433 -> Protocol should remain as TCP/IP -> Click OK.
It's recommended to restart the firewall.
These steps should solve your issue with remote connections.

Enable FileStreaming in SQL Server 2008

I was trying to restore a database to a SQL Server 2008, and I got this error

System.Data.SqlClient.SqlError: FILESTREAM feature is disabled. (Microsoft.SqlServer.Smo)

Was bit confused, and after digging it out I Found that under default configuration of SQL Server 2008, FILESTREAM feature is disabled. Microsoft always has these kind of SMART default configurations with new releases. If you can remember SQL Server 2005 came with disabled Remote Connections in the first release. Then they enable it with the built in SP1 setup release. Anyway this is how you can make it enable,

Using the following TSQL is the easiest way,

EXEC sp_configure 'filestream_access_level', '2'
RECONFIGURE

0= Disabled (which is the default)
1= Enables FILESTREAM for Transact-SQL access
2 = Enables FILESTREAM for Transact-SQL and Win32 streaming access

Also you can use SQL Server Configuration Manager to do this,

1. On the Start menu, point to All Programs, point to Microsoft SQL Server 2008, point to Configuration Tools, and then click SQL Server Configuration Manager.
2. In the list of services, right-click SQL Server Services, and then click Open.
3. In the SQL Server Configuration Manager snap-in, locate the instance of SQL Server on which you want to enable FILESTREAM.
4. Right-click the instance, and then click Properties.
5. In the SQL Server Properties dialog box, click the FILESTREAM tab.
6. Select the Enable FILESTREAM for Transact-SQL access check box.
7. If you want to read and write FILESTREAM data from Windows, click Enable FILESTREAM for file I/O streaming access. Enter the name of the Windows share in the Windows Share Name box.
8. If remote clients must access the FILESTREAM data that is stored on this share, select Allow remote clients to have streaming access to FILESTREAM data.
9. Click Apply.

This will sort out all of your problems with file handling which you get under default configuration of the SQL Server 2008. Anyway later I found that we can change this default configuration at the time of the installation.

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.

Creative Christmas Advertisements

Here are few very creative Christmas advertisements,












Artificial Intelligance at its best : EpiSimdemics

US researchers are focusing on creating a simulation of movements of all 300 million Americans. This is a huge project and they are going to use this to predict contagious diseases, such as a flu epidemic, might spread through different regions. That is the first step but there can be lots of hidden agendas here. Anyway it is a very interesting work, lets see how its going to come out in the near future.

Read Full Article Here : http://www.physorg.com/news148018856.html

Dooms Day 2012: Leaks Found in Earth's Protective Magnetic Field

Does the Dooms Day 2012 is going to be a reality???? I just saw this news post in the web and according to that, This field (Earth's Protective Magnetic Field) is protecting our planet from severe solar storms. And it has leaks in some unexpected locations. So according to NASA the bottom line is "When the next peak of solar activity comes, in about 4 years, electrical systems on Earth and satellites in space may be more vulnerable".
In about 4 years is very much close to 2012 December 21st, which is the date of Doomsday according to Mayans mythology. And if these leaks will get wider and the impact of the solar storms can be more severe than just an electric blackout. (Am I seeing Crocodiles in the basin???) So hope its time to go back to your prayers guys.

Read the full article here : http://www.livescience.com/space/081216-agu-solar-storm-shield-break.html

Retrun row numbers from a TSQL query

I came across a situation where I need to get the row numbers together with the result set. And finally found a very tricky way of doing it which I felt worth sharing;

SELECT col1,col2,(SELECT COUNT(*) FROM Table1 T2
WHERE T2.pkid <= T.pkid) AS rownumber
FROM Table1 T

And if you have a where condition it will return the original row number regardless of the no of the filtered rows. Hope this will be helpful to someone.

Second life : The revaluation of modern web


If you have ever heard of Second life (http://www.secondlife.com/) you must know how exciting it is. When I came across this for the first time I felt like it will be the next generation of web. It has given a birth to the most lacking part of the web (virtual representation of the community).
For those who don’t know what it is this is how SL defines itself:
"Second Life® is a 3-D virtual world created by its Residents. Since opening to the public in 2003, it has grown explosively and today is inhabited by millions of Residents from around the globe. "
When you get registered there you can create an avatar which is basically virtual you. And you can build your own house according to your own design. You can buy stuff using Linden Dollars (SL currency) or start your own business. Also there are lots of events everyday you can participate from community service events to fashion shows. The most important thing is each and every person you meet there is actually a real person. And also for the people who do code can use Linden Script Language (LSL) to code a small game or a highly complex program. If you build something interesting you will have a good consumer market so you can earn money. And also you can exchange your Linden Dollars to USD at any stock exchange inside the SL.
This site has initialized in 2003 and now it has more than 1 million residences, so if you go there you can meet lots of people and if you are smart enough you can be rich or famous in the second life. There is a real chance that you may feel the second life is better than your first life. At the moment there are people who has addicted to this and spent most of their time in this virtual world and live less time in the real world.

JR the Savior for Sri Lankan Politicians

There are lots of controversies regarding yesterday’s mass strike planned by opposition parties. But as a whole it was a failure even though Mr. Lal Kantha says it was a trial run. And once again Mahinda Rajapaksha government was able to come out of the trouble.
As far as I think people had 1980 July incident in back of their mind and that’s what made this a failure. So it’s another instance where JR's tactic has paid out for this generation of politicians. We have heard lots of people(even presidential candidates) blaming for Executive presidency as well but all these time each and every President has benefited from that. So the things he did still count well being for today’s politicians. He has done his part in the history for the politicians to survive for another decade or two. Also he has ruined our chances to develop as a country by making stupid decisions which we haven’t reverse even after more than 30 years. And we have no hope those will happen in the future as well. All together we are a hopeless nation with bunch of selfish politicians.


Cartoon by Dasa for Lankadeepa says it all

Ajantha Mendis : Rising of a Legend






















I was so fascinated to watch Medis in action yesterday against India. It was a while since we saw Sri Lankan Cricket team doing this well in a competition. Followed by Jayasooriya's brilliant innings in the upfront it was all Mendis show. Following are the few interesting comments I found :
"It was like you were playing something else, and the ball was something else. I won't really blame the batsman, we couldn't pick the deliveries. If you see our bowling, it was the best bowling line-up we could offer when we wanted one more extra batsman in the side. They tried their best and we could have got 274 but for the Mendis factor." - MS. Dhoni
"I wonder how good he was as a kid at carrom. Take the "red" boy!" - Crickinfo Live Scorer on Mendis
"We had never played him before. We had only seen videos and you can visualise and all, but he was difficult to pick out there in the middle. We never had any real reply against him." - MS Again
"A mystery spinner he has been thus far. The mystery is now out in the open and every batsman is out to solve it. The real challenge for Mendis, of uncertain categorization, to maintain that secrecy, begins now. " -Osman Samiuddin
"Dhoni, whose innings stood out for its sensible approach, was mesmerised even at the press-conference. For every question demanding explanations for the defeat, he the same answer: Mendis." - Sidharth Monga
'The 23-year-old plays his cricket for the Sri Lankan army. I suggest he's going to make a right officers' mess of hundreds of international batsmen's stumps in years to come" - Sportingo's Mark Rivlin
 
Blog Directory - OnToplist.com