Finding the TCP Port of SQL Server 2008

I faced this problem when doing my Research in the office machine... ;)

We use SQL server 2000 in the office ( Ya Ya i know this is 2011 and there are newer versions  :) )

For my research i needed to install SQL server 2008 because of the new features it provided to location based data, to storing and manipulating them.

So i installed SQL server 2008 and started working. When i tried to connect to the server using Java i faced the problem. i was unable to connect to the database using the connection string

String url = "jdbc:sqlserver://localhost;databaseName=LocationBasedResearch;";

problem problem... :(

Then i understood that the SQL server 2000 is taking the default port that is 1433, the newer installation must have took another port... :)

Then tried to find the port, again problem, can't find the port normally,,, when Googled got two suggestions...
one to use    netstat -abn     command in the command prompt...

Can't find using that method,,, then found out that there is a little piece of soft ware given by Microsoft... TCPView

Used it also , not any use... it's like a nice to see version of the command line which executed the  netstat -abn command.. :D

Then i was Googling  for a while and found out the solution, it's our old friend the registry editor :)

Just have to navigate to the following place...

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQLServer\MSSQL10.\MSSQLServer\SuperSocketNetLib\TCP

After that in the TCP menu there is a registry entry  TcpPort by double clicking on that you can see the port of the SQL server, in my case SQL server 2008 :)

Now you can use the port in the program and enjoy the coding... :)

I modified my connection String like this and continued the coding... :)

String url= "jdbc:sqlserver://localhost\\RANGANA:3117;databaseName=LocationBasedResearch;";

Million doller space pen and the Science community

This is about the urban legend of the Million Dollar Space Pen. I'm sure you've heard the legend before. It's the one in which NASA pays a million dollars to develop a pen that will write in space. The Russians, meanwhile, being a bit more practical and budget-conscious, just use a pencil for their space missions.

The truth is that the space pen was independently developed in the mid-1960s by Paul Fisher of the Fisher Pen Company. He did it completely on his own, without prompting by NASA and without NASA money. It turned out to be a good pen, and NASA later started to use it. But they paid around $2 a piece for them. Not $1 million.

"The Million Dollar Space Pen Myth is just that, a myth. The pens never cost a lot of money and were not developed by wasteful bureaucrats or overactive NASA engineers. The real story of the Space Pen is less interesting than the myth, but in many ways more inspiring. It is not a story of NASA bureaucrats versus simplistic Russians, but a story of a clever capitalist who built a superior product and conducted some innovative marketing. That story, however, is a little harder to sell to a public that believes what it wants to believe."


Here goes what i have to say based on this, when a person comes to the top of a institution (s)he can present ideas as (s)he is representing the institution, as that idea is the idea of the whole community, but the fact we have to consider that there can be a biasness of what that person is saying because that person is a human being. humans have a tendency to be bias because they favor somethings than others.

As intelligent people when we are looking at matters we have to consider the facts of biasness and personal beliefs of the statements a person make, and the crucial thing to consider is (s)he is a person,his/her idea or view point doesn't always represent the whole community although that person is appointed as a representer to that community. As in the space pen case the person might trying to sell something that is a little harder to sell to a public,something that he believes by getting the privilege of the position.

He is a team player :)

Here contains the video of the last stage of the match between Sri lanka and England, where Anjelo mathews the cricket star in Sri lanka showing a classy act of being a team player and trusting the partner, his team mate. I don't need to give lectures on Management but it is a known fact that by empowering a employee and letting him be a part of the organization is very vital to organizational well being :) by empowering Dinesh Chandimal the young 21 year old cricketer,and believing on him Mathews just did this basic management thing :) a new energetic member for the SL cicket team will be born from now on :)

What ever the things said we can't deny the fact that it is a massive thing to get a century at lords to a new player,and get the feeling that his team relies on him, trusts him... I really appreciate Mathews act. :) Wish a bright future to SL cricket :)

engsl3o4 by slippingonboredom

Hello World in C++ on Linux, using Pico :)

Are you interested in programming on the terminal? Typing the code on the Terminal? it gives some feeling right? for me it is :) ; well i'm going to tell you about programming C++ on the terminal using pico :) any one not familier with pico read all about pico in this link what is pico ?

pico is a simple text editor based on the terminal here how it looks when we run it, it's just like vim,but much simpler as i think :)

let's get started run the terminal by the application launcher (Ubuntu 11.04) , or by pressing Ctrl+Alt+T, you will get a window like this if you are in Ubuntu

then type pico and press enter key, not to worry about weather Pico is installed or not in your machine, Linux distributions these days have Pico installed by default :)

then your terminal should appear like this , changed but very simple

then you can start typing your first C++ program , traditionally let's do the Hello world one :)

after successfully entering the code you have to save the code, for this press Ctrl+O then the terminal would appear like this

then enter the name for your file and end it with the .cpp extention, then press enter key to save the file,we will name our file hello.cpp, after saving the file press Ctrl+x to return to the terminal once again, then the terminal will be shown like below :)

then you have to compile and run the file you have saved, to compile the file type g++ .cpp and press enter , in our case g++ hello.cpp like the image below

if you have successfully compiled the file then the terminal prompt should appear again :) after that to run the file just type ./a.out in the terminal and press enter like shown below

you can see the out put hello world in the image above :)

that is how we do a C++ program using Pico you can now practice C++ in this method. :)

Ubuntu 11.04 වලදී Google Chrome වල සිංහල අක්ෂර හරි හැටි නොපෙනීමේ ප්‍රශ්නය

මමත් ඉතින් Ububtu වලට තියෙන ආසාවට 11.04 අත පත ගාල බලන්නත් එක්ක 11.04 install කරගත්ත :)

 මොන version එක උනත් ඉතින් නොවරදින එකම සහ අනිවාර්යයෙන් install කරන Browser වෙන්නෙ අපේ Google Chrome එකනෙ ඉතින් ( Firefox වලට අමතරව ;) )... ඒකත් install කරගත්ත කියමුකො..

ඔන්න දැන් දත කට මැදගනම browse කරන්න ගන්නකොටම.... මෙන්න කොටු කොටු  :O :'( මේ මොකද මේ... මේන්න සිංහල අකුරු වෙනුවට කොටු කොටු පෙන්වනව,, සමහර අකුරු අතර අලියෙක්ට යන්න තරමෙ ඉඩ... :( මෙහෙම පුලුවන්ද browse කරන්න මම ආයෙත් Firefox වලට මාරු වෙලා browse කරා ඉතින්... :) මේ තියෙන්නෙ සිංහල පෙනුන විදිය.. :(

මම ඉතින් නිකන්ම හිටියෙත් නෑ :) මේ ගැන ටිකක් විපරම් කරල බැලුව... මට විතරක් නෙවෙයි වෙන අයටත් මේ ගැටලුවම තියෙනව මේ තියෙන්නෙ එක්කෙනෙක් දාල තිබුන image එකක්

මම ඉතින් ඉන්න බැරි කමට වගේ පරන ubuntu version වලදි කලා වගේ siyabas එක පැත්තෙ පොඩ්ඩක් බැලුව... 11.04 වලට හරියන සිංහල language pack එකක් තියෙනවද කියල... ඒකෙ තිබුන විදියට

කියල තියෙන නිසා මම ඒ command එක Terminal එකේ Enter කරල බැලුව නිකමට වගේ :)

 ඒකත් install උනා කියමුකො... දැන්වත් හරි ගියාද කියල බලන්න Chrome run කරල බැලුව... නෑනෙ තිබුන විදියමයි... :(
දැන් මොකද කරන්නෙ.. බලමු Chrome වල Settings පොඩ්ඩක්...

Preference වල Under the Hood යටතේ තියනව Customize Fonts කියල Button එකක්  ඒක click කලාම මෙන්න මේ වගේ window එකක් එන්නෙ

මේකෙ තියන මේ font type එක වෙනස් කලොත් මොකද වෙන්නෙ? වෙනස් කරලම බලමු.. :) සිංහල font type එකක් තියනවද මේකෙ වෙනස් කරන්න...නෑ වගේනෙ... මොකද කරන්නෙ... software center එකෙන් Sinhala font කියල search පාරක් දාල බලමු... අහ් මේ තියෙන්නෙ LK Linux User Group font එක :)
ඒක install කරල බලමු ,මේක font type එකක් නිසා ඒක Google Chrome වල font type list එකට එන්න ඕනනෙ..අහ් මේ ඇවිත් තියෙන්නෙ... :)

මෙන්න මේ විදියට font එක select කරල settings හදල බලමු .. එහෙම උනාම හරියන්න ඕනනෙ මොකද browser එකට සිංහල fontනෙ දීල තියෙන්නෙ අපි... දැන් බලමු කොහොමද සිංහල පේන්නෙ කියල...

අහ් ඔය තියෙන්නෙ තේරුම් ගන්න පුලුවන් විදියට... :) :) ඔය ඇතිනෙ... :) :)
අපි කලින් දැකපු විදියට වඩා හොදයි නේද? මේක දිගටම තියමු එහෙනම්.. :)

මේ තියෙන්නෙ මම කරගන ආපු අනු පිලිවෙලට සටහන් කරල... ඇත්තටම වෙන්න ඕන LKLUG font එක install කරල ඒක Chrome වල preference වලින් font type එක විදියට add කරන  එක... මම හිතනව මම ප්‍රශ්නෙට විසදුමක් හොයාගත්ත කියල... කවුරු හරි මීට වඩා හොද එකක් දන්නවනම් පහල එකක් විදියට දාල යන්න... :) මේකෙ වැරැද්දක් තියනවනම් කියන්නත් අමතක කරන්න එපා :)


ඔබේ අත ගෙන, නිසසල සැදෑවක
උයන් කෙලවර, සිහිල් සෙවනක
හිදිනට පතන්නෙමි, පහස ලබමින්
දිවිතුරා මා සෙනෙහසින්....

ගෙවී යන හැම නිමේෂයකම
විදිමි ඔබෙ හස සිතින් සිතමින්
පැතුම් පතනෙමි, දිවිතුරා මා
ලබන්නට එය එක්ව හිදිමින්....

අපේ පැතුමන්, අපේ අදිටන්
ඉ‍ටුව මතුදින සිතන අයුරින්
සැදේවා අප සොදුරු ලෝකය
ඔබේ වී මා මගේ ඔබ වන්...

C# Access Modifiers Quick Reference

I saw this image in code-project a long time back, thought to upload it here, since this is very helpful diagram to understand about the access modifier behavior in C#

source :