Friday, December 29, 2006


Today I came to work after 1 week's vacation. It was a good break because last couple of months I was very busy and did hell of work and took only 3 days as leaves for past 10 months.

Last saturday we(dinee,dumma,dhanushka,my self,siri bappa & some of his friend) went dinee's place at Balapity. It was always happening everytime we went balapity and we really missed jana this time because he was our organizer for the past few years for all our trips & parties.(Jana is in UK these days)

It was bit late when we woke up in Sunday morning. We plan to get up early to go for a sea bath before the sun rise but everybody got late because of the late night party. Beach is few meters away from dinee's place. we were lucky because sun light was not that strong because of the rainy weather. That's the first time we went for a sea bath after tsunami.

Dumma,Dhanushka,siri bappa & his friend went back colombo after lunch. Dinee, Akki, Chuti nangi and myself came back on monday evening.It took about 2 and half hours to reach colombo because there was a small traffic on our way because everybody is comming back to colombo after the long vacation I think. After came back home I watched couple of movies. some of them are Insomnia, Derailed, Flight of Phoenix, Lucky number slevin and Longest yard. Dinee went to work on thursday and I watched the cricket match Sri lanka Vs New Zealand. Sri Lanka won the match by 7 wickets.

It's always better to have a break before starting your work in the New year. Because you'll have work!! work!! work!!

Thursday, November 16, 2006

Returning Row number in Query

I wanted to return the row number with the data set in my query. I achieve that without much effort but after that I had to modify that to return the line number according to a group as,

StudentName CourseName      Row Number
---------- ------------- ---------
Nalaka      Computer Science 1
Nalaka      Economics        2
Nalaka      Marketing        3
Dineesh     Economics        1
Dineesh     Marketing        2
Indika      Computer Science 1

After some time I found the solution. It's very interesting and I think It's a breakthrough to SQL beginners where they can expand their SQL knowledge. Here it is.

create table #Student(StudentID int,StudentName varchar(20))
create table #Course(CourseID int,CourseName varchar(20))
create table #CourseDetails(StudentID int,CourseID int)

insert into #Student values(1,'Nalaka')
insert into #Student values(2,'Dineesh')
insert into #Student values(3,'Indika')

insert into #Course values(1,'Computer Science')
insert into #Course values(2,'Economics')
insert into #Course values(3,'Marketing')

insert into #CourseDetails values(1,1)
insert into #CourseDetails values(1,2)
insert into #CourseDetails values(1,3)
insert into #CourseDetails values(2,2)
insert into #CourseDetails values(2,3)
insert into #CourseDetails values(3,1)

select S.StudentName,C.CourseName,
(select count(*) from #CourseDetails CD1 where CD1.StudentID = CD.StudentID and CD1.CourseID <= CD.CourseID) as 'Row Number' from #Student S, #Course C, #CourseDetails CD where S.StudentID=CD.StudentID AND C.CourseID=CD.CourseID order by CD.StudentID,CD.CourseID

drop table #Student
drop table #Course
drop table #CourseDetails

Paste this in your SQL Query Analyzer and run. You'll get the result with the row number as I expected earlier. It's bit tricky. examine "(select count(*) from #CourseDetails CD1 where CD1.StudentID = CD.StudentID and CD1.CourseID <= CD.CourseID) as 'Row Number'" part of the query with the data in #CourseDetails table.

I'll blog when ...

I hardy post in my blog these days and when I'm posting something, most of the time I mentioned about this and thought to update the blog regularly. But i failed with the heavy work load. So from now on I decided to post only when I have time.So I'll blog when I blog.

Friday, October 27, 2006

Work!! work!! work!! time!! time!! time!!

Couldn't blog for a long time. It's almost 2 and half months since the last post. Last 2 months were terrible. Huge work load. worked late night continuously.I saw this post when I'm going through mahasen's blog yesterday.
Work life in US. I think project mismanagement is the reason for this problem in most of the software companies in Sri Lanka. What I think is most of the managers plan a lot but implement very little. We should practice implement what we plan, stick to the project plan.

Friday, August 11, 2006

New machine

Today I got a new machine in my office. Previous machine was little bit slow. It was a AMD Athlon(tm)XP 1800+ with 512 MB RAM. New one is Intel Pentium 4 3GHz with 1 GB RAM and this is super fast.

Friday, July 21, 2006


Couple of days ago I got an opportunity to involve in a java project. Even I didn't write a java code in 3,4 years, I desperately wanted to dig it inside. What I believe is for developers there's a time they take a decision and select the technology stream to proceed their career. Sometimes it happens naturally according to the materials gather around the person. In my case I choose Microsoft and started to develop in VB. Considering Microsoft, today C# has become my favorite language. Now I feel I always had a liking to java all through these 4,5 years in my development career even I didn't know it.

I think i didn't have much choice those days when .Net took the IT world by a storm. Everybody talked about the beauty of .Net. When I look back i just realized for the last 2 years I never thought about any other technology except .Net. In the recent past has made a huge impact in this industry than any other, and it proceeds.

When talking about .Net Vs Java Or Microsoft technologies Vs Open source always it has been a hot topic. I found this thread in forum which is very interesting and there are lot of stories inside this thread which is useful to us as Developers, as a 3rd world country or else as a nation.

It's worth post a separate article about this. So I won't express my ideas deeply regarding this. Anyway I like both the technologies. Microsoft and Open source. And I don't like to compare these two. Definitely there are advantages and drawback in both over one another.

It's very nice to have strong representations of both the communities in SL. Sri Lanka .Net forum has been doing a good job for the past 2 years. Tech Ed and VS 2005 Launch was great. Open source community is also blooming up. is still limited to events. It'll be more active if they start a forum. If so developers will gather around it more and more and community will become more stronger.

I wish best of luck to both the communities and dreaming of something comes out by the unity of these two local communities as a nation.


Monday, July 17, 2006


Couple of days ago one of my friends called me and told that he needs to find some good .net guys urgently & is there anyone I know ?

He said they selected some out of received CVs and conducted interviews. Since their company is looking for a degree as the minimum paper qualification, they've short listed Cvs of software engineers only who has at least a Bachelor's Degree.
Some of those who had over 4 years of industrial experience with over 1 year .net experience. After interviewed 16 applicants they could select only 1 but that one is also not up to the level they expected.

They had called CVs for the position of Senior Software Engineer but some of applicants were not even fit for the position of a Trainee software Engineer. They've mentioned as "A good understanding of OOP concepts" but didn't know what an
abstract class is or how to Overloading methods.

I told him there might be something wrong in your recruitment process...something wrong with the way they selected
those CVs. "Don't you call for an interview for someone who has a Bachelor's degree with over 4 years of industrial
experience and having worked in the biggest outsourcing company in SL?" He replied...

Is it this hard to find couple of good .net resources? Is it true?

There was one of my friends looking for a break who has worked with me in my previous work place. Unfortunately he hasn't had a Degree. not even a certificate except a MCP. I told about him to my friend. He finished the conversation by
taking my friends CV without a hope.

After 2 days my friend who's looking for .net developers called me and said he has just interviewed my friend who wants to take a break from his current work place. "He is kind of a guy we were looking for. he's easily got through
the technical interview. I recomended him and through to the second interview with the Management. Hope management won't consider the minimum paper qualifications. I might neglected hundreds of CVs like this only because they didn't have a Degree." Hs said.

Thursday, July 13, 2006

Adding User-defined Function Libraries to Crystal Reports

Crystal comes with it's own number of Functions that can be used in formula field objects. While crystal provides a huge number of functions that are useful to developers, there are mechanisms to enhance the product with user defined functions libraries. It comes with the ability to accept new functions you develop to meet your needs.

Both available syntaxes (Crystal syntax and Basic syntax) have a branch with additional functions on the bottom of the middle tree. User-defined functions can be added to the additional functions branch of the tree just like if they were existing crystal reports functions.

Creating a user-defined function library

There are two types of function libraries supported by Crystal. Dynamic link libraries and COM Automation server. These libraries can be written in several languages. Dynamic link libraries are usually written in C and must include those files shipped with Crystal. you can also download these files from Crystal Decisions support site.

How to create a project to write functions?

It's really simple and you don't need to worry about interface definitions. Let's write a small function using Visual Basic.

- Create a ActiveX DLL project in Visual Basic
- Add a function named "DateFormat" to your class module or copy the following code.

Public Function DateFormat(ByVal sDate As String) As String
DateFormat = Format(sDate, "dd/MMM/yyyy")
End Function

- Save the project with a meaningful name. Make sure it starts with "CRUFL". For now let's name it as "CRUFLformat"
- Go to --> Make and compile your project into ActiveX DLL (Which will serve as an automation server for Crystal Reports)
- Copy the CRUFLformat.DLL into a directory(better if Windows or crystal reports directory) and register it using regsvr32 exe.

Using it in Crystal Reports

- Create a new report using a database you prefer.
- Insert a formula field. Formula window must appear with 3 panes.
- In the middle pane, go to the Additional functions branch andd you'll see DateFormat function. use it to format the date in a date field.
- Edit the function (changing the date format) and see the difference

I will ...

Couldn't write in the blog for a long time.
Just saw where I stoped. hmm...It was damn right.
I thought I'll update the blog regularly from today onwards.

Tuesday, February 14, 2006


I got the opportunity.

For better or worse we must take decisions of our lives.....
Because we might not get those chances for the rest of our lifetime.....

Friday, February 03, 2006

After a long time...

Well...Well, after a long time I'm writing something in my blog..

I missed TechEd2005 & e-Carnival but I was there for the Launch.
Wow it was cool. SQL Server 2005 and Visual Web Developer 2005 sessions were great.
I met a bunch of mates which I didn't meet for years and met some of the guys in the dotnetforum for the first time.

Last year I haven’t had much plans. Actually I haven’t had a chance to plan 'coz I got married and I was away from SL for couple of times. Only thing I planned was my wedding. I missed TechEd and e Carnival too. But I was in touch with .Net even I didn't get much opportunities to use in developments. Yeah I was a Vb 6.0 developer for last 4 years because my current employer is maintaining a lot of VB 6.0 applications. But I'm desperate to start fulltime .Net developments. Yeah That will be my main objective in this year and "Ready to Rock the Launch" gave me a good start. Today is a very good/special day to achieve that. I have all the determination and energy to approached the task.

We were ready to Rock 'cos it was Ready To Rock
It has started in a rocking style with Wild Fire on stage
There were 2 rocking sessions in SQL Server 2005 and Visual Web Developer 2005
They said we rocked them 'coz there were around 1200 enthusiasts

When the night has come, had couple of beer glasses
And Wild fire’s playing (Another brick in the wall...)

You rocked us!!!

Monday, January 02, 2006

Working class hero

As soon as you’re born they make you feel small
By giving you no time instead of it all
Till the pain is so big you feel nothing at all
A working class hero is something to be

They hurt you at home and they hit you at school
They hate you if you’re clever and they despise a fool
Till you’re so fucking crazy you can’t follow their rules
A working class hero is something to be

When they’ve tortured and scared you for twenty odd years
Then they expect you to pick a career
When you can’t really function you’re so full of fear
A working class hero is something to be

Keep you doped with religion and sex and tv
And you think you’re so clever and classless and free
But you’re still fucking peasants as far as I can see
A working class hero is something to be

There’s room at the top they are telling you still
But first you must learn how to smile as you kill
If you want to be like the folks on the hill
A working class hero is something to be

If you want to be a hero well just follow me
If you want to be a hero well just follow me...

~ JL