Sunday, December 16, 2007

Sony Cybershot DSC H7

Finally I decided to settle with Sony Cybershot DSC H7. It's a cool SLR Like camera with some cool & smart features that I was looking for. DSC H7 comes with Carl Zeiss Vario-Tessar Lens with 15x Optical Zoom, 30x digital zoom, 8.1 Mega Pixels, 2.5" LCD Screen, W: Approx. 50cm to Infinity, T: Approx. 120cm to Infinity auto focus range and many more features. It cost US$ 409 and it really worth for the price. So I'm looking forward to capture some scenes (specially natural and wild life) with this new smart piece. 

Wednesday, October 17, 2007

Writing data into XML files

You can use XmlTextWriter to write XML. XmlTextwriter is an implementation of the XmlWriter class. This class provides number of validatins to make sure xml is well formed. Here is the code to create a XML file.

using System.Xml;

XmlTextWriter myXmlTextWriter = new XmlTextWriter("student.xml", null);

myXmlTextWriter.Formatting = Formatting.Indented;
myXmlTextWriter.WriteDocType("students", null, "students.dtd", null);
myXmlTextWriter.WriteComment("This file represents a student in the institute");
myXmlTextWriter.WriteStartElement("student", null);
myXmlTextWriter.WriteAttributeString("category", "Bsc");
myXmlTextWriter.WriteAttributeString("course", "Computer Science");
myXmlTextWriter.WriteElementString("birthdate", null, "1979-05-22");
myXmlTextWriter.WriteStartElement("Name", null);
myXmlTextWriter.WriteElementString("first-name", "Shawn");
myXmlTextWriter.WriteElementString("last-name", "Tait");
myXmlTextWriter.WriteElementString("GPA", "4.55");


WriteStartDocument(Boolean) - writes the xml declaration with the version 1.0 and the standalone attribute.
WriteComment - writes a comment containing the specified text.
WriteStartElement - writes the specified start tag.
WriteElementString - writes an element containing a string value.
WriteEndElement - writes the specified end tag.
WriteAttributeString - writes an attribute with a specified value.

DevDay 2007

Yesterday I've been to DevDay 2007 organized by Sri Lanka .Net forum held at Mount Lavinia hotel. There were 4 interesting technical sessions and later the party. All the 4 sessions were great. It was worth to attend.

Discover Next Generation Visual Studio and .NET 3.5
An Adventure with C# 3.0 and LINQ
By: Chua Wen Ching (MVP - C#)

WPF, a new way of looking @ your Windows Applications
Silverlight: The web just got richer
By: T.N.C. Venkata Rangan (Microsoft Regional Director)

Tuesday, October 02, 2007

Rugby World Cup 2007 - Knockout Stage

Rugby World Cup 2007 first round is over and 8 teams were selected to play the second stage. This will be a knockout out stage and unbeaten team in next 3 games will get the opportunity to lift the cup and crown as RWC 2007 champs.

As the tournament started with a upset by Argentina beating host France, Argentina managed to continue their rhythm and finish the first round as the top of their pool. They will be a strong contender in the knockout stage and it'll be a very interesting quarterfinal Argentina Vs Scotland.
Fiji managed to enter to the second round by beating Wales. So they'll meet South Africa in their first match in the second round.

Other 2 quarterfinals will be Australia Vs England and New Zealand Vs France. New Zealand finished all their first round matches very promisingly and they are the favorites in this tournament. But their lack of performances in the big games is always a huge disadvantage for them and also France is seeking for an opportunity to cover their humiliation defeat by Argentina in the first round, so they'll play their hearts out in front of their own crowd, in their own grounds. Nevertheless as I said earlier this is the best NZ team in a world cup after 1992 So they'll smell the cup as no one else does.

Creating a new XML file using XMLDocument

Here is the XML file:

version="1.0" encoding="utf-8"?>
    <name>Michael Jones</

Here is the code to generate the XML file:

using System.Xml;

XmlDocument xmlDoc = new XmlDocument();
XmlDeclaration xmlDeclaration = xmlDoc.CreateXmlDeclaration("1.0", "utf-8", null);

// Create the root element
XmlElement rootNode = xmlDoc.CreateElement(
xmlDoc.InsertBefore(xmlDeclaration, xmlDoc.DocumentElement);

// Creating the parent node
XmlElement parentNode = xmlDoc.CreateElement(

// Create the required nodes
XmlElement eleId = xmlDoc.CreateElement(
XmlElement eleName = xmlDoc.CreateElement(

// retrieve the text
XmlText textId = xmlDoc.CreateTextNode("1");
XmlText textName = xmlDoc.CreateTextNode("Michael Jones");

// append the nodes to the parentNode without the value

// save the value of the fields into the nodes

xmlDoc.Save(Request.MapPath() + "Students.xml");

Wednesday, September 12, 2007

Satellite TV

          Today I got my satellite TV connection. I'm quite impressed about the setup, devices, picture and audio quality and the service provided by the provider. Anyway still we have only one satellite TV provider in sri lanka. I hope government won't ban satellite TV again in the future and there is no reason to do so.

          I like mostly the educational channels and the sports channels. Quality of programs broadcast through educational channels are impressive. Children can study so many things from there. I hope now we can see some good/productive programs when we watch TV but I'm not sure that I'd get enough free time to watch TV.

Monday, September 10, 2007

Rugby World Cup 2007 has started

          Rugby world cup 2007 has officially started on the 07th September 2007 in Paris, France. In the Opening match host France were beaten 12-17 by Argentina. Top 4 teams, New Zealand, Australia, France, South Africa played their first matches and it seems top 3 out of 4 teams (France is current no 2 in IRB rankings) are in good form.

          New Zealand was awesome against Italy who were beaten by 76-14 and this is the best New Zealand World Cup team I have seen after Sean Fitzpatricks team in 1992 world cup. 2nd row Chris Jack, flanker Jerry Collins, No8 Rodney So'oialo, scrum half Byron Kelleher, wingers Sitiveni Sivivatu, Doug Howlett and fullback Leon MacDonald played a great game. RWC is scheduled till 20th October so there are many more actions to come. I hope we can see some good rugby.

Monday, August 27, 2007

Adding Meta Tags to ASP.Net 2.0 Pages

Recently, I was looking for a way to add meta keywords and description into web pages programmatically. After implementing a method to do that I wanted to add different meta keywords and description to the same page but when loading different data. So I came across with this method which you can change meta keywords and description even with in the same page when loading different data.

HtmlMeta htmlMetaDesc = new HtmlMeta();
htmlMetaDesc.Name = "Description";
htmlMetaDesc.Content = "Nalaka Sanjeewa Aluthwala Hewage";

HtmlMeta htmlMeta = new HtmlMeta();
htmlMeta.Name = "Keywords";
htmlMeta.Content = "Nalaka, Sanjeewa, Aluthwala, Hewage";

Friday, August 24, 2007

Ran Home

It's 107 days for my last post and it's about the new comer to my family, Sedani. I gave up spending time for blogging for the past 107 days as I gave up spending time for couple of things in my regular life style because I wanted to see my little girl is growing.

In weekdays, morning I only get couple of minutes to spend with her but sometimes she's in a sleep when I'm leaving. If I come home late she's in a sleep so I hardly get a chance to talk to her, spend sometime with her. So I didn't spend any time at office unnecessarily. As soon as I finished my work at office, I ran home to see my little baby girl.

Now she's 109 days old. Now she's responding to most of the things we are doing and saying. She smiles with me, she talks by saying aaahs, uuuhs and heeees. Now she knows me very well. And sometimes she's waiting to see me till I finish my work and coming home.

Wednesday, May 09, 2007


Today we decided a name to the new comer of our family, our little baby girl. Her name will be Sedani Dahamdee. Sedani means clever and instant ideas or solutions by thinking. Dahamdee means the person who presents dharma. So I’m glad that I could give her a meaningful name.

Monday, May 07, 2007

I am a father

Dinee gave birth to a baby girl in this evening. She's so tiny and cute. She's the cutest baby in the world to me and undoubtly it was the happiest moment in my life. I can't explain that feeling when i heard our baby is crying for the first time.

The experience of bringing a new life to this world is unexplainable. I was looking forward to this day with anticipation but I never thought that I was going to be this exited! When you hear your baby is crying for the first time, you'll feel like that you are beyond the universe, like you have won the greatest thing in this world and you don't need anything else... How can I write that feeling in a blog post?

All that time I was with my wife. As a father I appreciate that I was allowed to stay with my wife when she's giving birth to my kid and I think it's something every father should experience. That's the closest you can get to your wife and kid. At Ninewells, fathers are allowed to be with their wives at the birth.

I must thank Dr.Nandadeva Senevirathne who was our gynecologist. You guided us from the beginning. You made everything so simple to us and you took everything so seriously. You are one of the best in the field.

At Ninewells, enviornment was excellent. I never saw that continuous smiling face, kindness, caring hands of nurses and all the other staff at ninewells. We always felt that we are in a maternity hospital and both the baby and the mother are in safe hands. I think Ninewells is the best maternity hospital.

Sunday, April 29, 2007

Sri Lanka became runner up in the cricket world cup 2007

Sri Lanka became the runner up in the cricket world cup 2007. For sri lank this is the most successful world cup tournament after winning the cup in 1996. This time also sri lankans were very close to the world cup victory until the damage done by Adam Gilchrist in the final. Anyway this has been a great tournamant for couple of young sri lankan players like Lasith Malinga, Chamara Silva as they shown they are ready for the first 11 and senior players like Mahela, Sangakkara, Jayasooriya, Muralitharan as they returned back in to a good form at the end of the tournament.

well done !!!

Wednesday, April 25, 2007

Sri Lanka beat New Zealand by 81 runs

It was the first semi final match of the cricket world cup 2007. Sri Lanka won the toss and elected to bat first. Master blaster Sanath Jayasuriya went back cheaply for 1 run and Sangakkara couldn't do much because he's out for 18 runs. Sri Lanka were 67/2 in the 14th over. Then Mahela Jayawardene joined Tharanga and lift up the score upto 111 when Tharanga balled out to Vettori for 73 off 74 balls. Mahela started his innings very slowly, spared too many balls to score his first few runs but the accelaration was superb and never seen such an innings in recent one day cricket. He kept his head cool and played a captions knock. Mahela was 115 off 109 balls. He played a mind game. At the end Sri Lanka has scored 289/5. Again Mahela has proved that he's not a good batsman but a class batsman. Australia will play against South Africa in the second semi final. Good luck to Sri lankan team for the Final on the 28th of April. Let's hope it'll be a tight game and we can see some good cricket.

Tuesday, April 10, 2007

Session variable not getting updated

I was doing the final touches to the price calculation process of the shopping cart of the e-commerce web site which we(rasika & me) have to deliver on next week.

I was updating a session variable and subsequently redirecting to another web page. In the second page I'm checking the updated value of the session variable and came across this weired behavior that session variable is not getting updated sometimes.

I tried in many ways to figure out the problem and spent half a day. Finally when I'm testing with the Firefox browser, realized that it takes a constant time to update the session and before updating the session it is checking the status of that session variable from the second page. so what I did is put a delay before redirecting to the second page and it is working fine. Weired...

Tuesday, April 03, 2007

White Water rafting.

For the past month I couldn't spend any time to blogging because I had to catch up work in my new work place. It was a pretty cool month in the new office. I got a chance to learn some new technologies, time to do R&D and most of all, guys decided to have some fun, so yesterday we went kithulgala for white water rafting. It was a pretty exciting expericience and looking forward to participate in more adventure sports.

Thursday, February 15, 2007

Ten Secrets of Effective Management

I found this article when I was surfing the web to search something. When I was going through the article I found that these facts are very true and how we can campare these facts with our experiences when working with our manager/supervisor.

What I always say is that in sri lanka we are lack of managers. Most of the time manager works as a person who gets the things done. They don't try to plan and work. they just do the things they have to do. Enen they plan, hardly implement those plans. Most of the managers handover their work to subordinates and wash their hands. Manager should understand the role of a manager and must practise to plan and implement those plans.

Ten secrets of effective management from the pros.

The costs of poor management are severe and manifest themselves in countless negative ways including demotivated, demoralized staff, high staff turnover, reduced employee productivity, increased employee uncertainty, a client/company disconnect and increased customer complaints. While a plethora of literature exists on the myriad ways managers can up their performance and positively impact and influence their companies and their teams, below we outline ten basic management tips from the pros.

1. Lead don't manage

Leaders who 'inspire' their teams to perform by example and by communicating and eliciting excitement for a common vision, mission and set of values and goals are far more effective over the long run than their more subdued counterparts who 'manage' rather than 'lead'. While managers control, meddle, limit and demoralize, the leaders excite, enthuse and infuse the organisation with their own contagious positive energy, motivation and dedication to professional principles and ideals as well as their solid, passionate and unwavering commitment to the company and the clients. Leaders manage less rather than more and while guiding and overseeing broad strategic issues and communicating closely with their teams, refrain from regularly interfering in the day-to-day tasks and workloads or micromanaging. As people take their cues from the boss, the boss's principles, tone, work ethic, values, workstyle, energy and motivation will largely influence and determine the corporate culture.

2. Hire the best

A manager's performance is a direct function of the performance of his team - by definition his role is to achieve a specific output or desired result through his employees and as such there is no substitute for surrounding yourself with the best possible players in the field and grooming them to excel. Confident managers are not afraid to hire Grade A players, they do not fear such employees will downplay their own track record or undermine their profile and abilities. To the contrary, good managers recognize that top performers will lift the whole division and will reflect directly in purely positive terms on their boss. Grade A players are motivated, driven, energetic, innovative, have the right attitude, aptitude, experience, abilities and their enthusiasm and quest for excellence usually sifts through the entire organization infusing it with renewed vigor and competitiveness. Just as excellence is contagious, so is mediocrity and incompetency - good managers are vigilant to never permit mediocrity in the front door and to excise it immediately should it rear its uncompetitive head before it manifests itself further across the organisation to everyone's detriment.

3. Set clear goals

Setting goals is the first step towards achieving peak performance. These goals must be clear, specific, reasonable and attainable. The team must be able to articulate these goals in no uncertain terms and commit to them. Once the expectations are set, training programs and resource allocation can be tailored around these milestones and performance measured accordingly. A team that cannot articulate the company's mission and goals and their own is a team destined for failure. A team set unreasonable, unrealistic goals is also set for failure. Good managers understand what is reasonable and attainable and ensure that the teams have the tools, training, infrastructure, resources and know-how necessary to achieve these goals. A good rule is to tell your team "what" needs to be done and "why" and leaving them to determine the "how" based on their best professional judgement and all the resources and know-how made available to them.

4. Listen to your team

A good manager listens to his team, closely monitors the issues they are facing and acts as a sounding board for their concerns, problems and ideas. Good listening starts with being open minded and approachable and involves paying close attention and making an effort to truly understand the issues raised while respecting the different viewpoints, communicating your understanding and offering nuggets of wisdom, direction, guidance or advice where sought for or appropriate. Ask questions where you are unclear about something. Probe. Reiterate key points to make sure you understand correctly. A manager divorced from the unique needs of his team cannot begin to motivate or inspire them toward a common goal. A manager who listens with objectivity, respect and discipline translates into a team that listens, both to each other and to the client and this is often the first step towards a winning, client-oriented service and product line. Good listening need not stop with the team - ideas, feedback and advice can come from anywhere, often from unlikely sources, and a good manager is always receptive to them.

5. Communicate effectively

Effective communication means clear, concise and timely communication and open lines of communication between the manager and his team. This goes beyond effective listening to communicating the mission, goals, standards, values and job expectations, giving ongoing and regular feedback to employees, seeking and acknowledging feedback from the team on decisions that affect them, relaying both positive and negative news in a timely manner, motivating and coaching the team and positively reinforcing employees in both public and private for jobs well done.

6. Respect your team

A good manager is consistently and unwaveringly respectful towards his team in attitude, words and actions. They do not look down on their teams nor do they consider themselves above maintaining a healthy, robust and direct line of communication with them. Good managers never belittle, humiliate, embarrass, threaten or otherwise undermine the integrity of their employees. When they need to criticize they do so professionally, constructively and in private; in public they laud, commend and motivate. Good managers never single out an employee to publicly flog or scream at nor do they create a culture where anger, ranting, raving, blaming, accusing or screaming are acceptable. Autocrats and dictators fail as managers over the long run; respectful leaders win the loyalty and commitment of their teams and succeed.

7. Create a learning culture

Teaching is a high leverage activity - the amount of time you spend training and coaching an employee or group of employees will generate a high return on investment that should with positive ramifications infiltrate many levels of the organisation. While you teach, your own learning and understanding of the subject matter will be enhanced. Make sure your own training and self-education remains uninterrupted as you progress up the career ladder even as you teach and provide training programs for subordinates. In this knowledge-economy age we live in, education, skills, knowledge rapidly become obsolete and it is essential to stay ahead of the productivity and innovation curve through constant training and education. Competitiveness necessitates a highly trained workforce - make sure you allocate key resources including some of your own precious time to the regular and ongoing training and development of employees. Groom them for success and cultivate great future leaders by providing the best training feasible while continuously updating, refining and enhancing your own skills.

8. Delegate Don't Abdicate

Good managers don't hire a team then do the job themselves - they delegate then supervise, monitor, inspect and provide feedback. Delegating does not mean a handover then washing your hands clean of the project - delegation without supervision is abdicating! Make sure you set a clear schedule for follow-up and regularly track progress towards agreed goals. Managers who delegate without ensuring their teams receive the proper resources, tools and training are setting their teams up for failure. Similarly, managers who assign responsibilities then rob their subordinates of all decision-making ability and authority while maintaining complex bureaucracy and rigid, archaic policies/procedures are dooming their teams to failure. Finally, managers who meddle, control, micro-manage and routinely take over tasks that veer off-course rather than leaving their subordinates to take charge and see the project through to completion are also inefficiently allocating valuable resources and undermining their subordinates. Employees who are routinely divorced of their responsibilities in such a manager cease to feel accountable and eventually lose motivation.

9. Remove barriers to success

Make sure the policies and procedures in place in your company help rather than hinder peak performance and success. Workplace rules and regulations should be minimized and facilitated to be easy to comprehend and follow rather than a barrier to success. Any rules/procedures, bureaucracies or other boundaries that paralyze, delay and frustrate rather than catalyze the efficient production process should be rethought and wherever possible removed or alternatives found. Workers should be encouraged to constantly innovate and optimize on their work processes and output and work processes should consequently be flexible enough to allow for this constant redefining and innovation. Strive to give employees freedom - the unfettered freedom to create, innovate, improve and exceed all expectations and performance targets.

10. Focus on the Customer

Effective managers realize that the customer is the real boss. Customers through their purchasing decisions hire and fire employees every day and their actions, attitudes and habits ultimately determine the shape, focus and size of the organisation. A boss's focus on the customer will permeate the organization and create a customer-driven organization where everyone realizes that they work for and are ultimately paid by the customer. All positions in an effective organisation should be geared towards either getting or keeping a customer. The successful manager will take responsibility for training the employees in the fine art and science of getting and keeping customers while removing all corporate and procedural barriers that fetter these activities.

Tuesday, February 13, 2007

3-minute management course

One of my good,old friends indika(Dela) sent me a mail named 3-minute management course. There were couple of stories/lessons. I think they are very interesing & worth to post on my blog. so here ...

Lesson 1
A man is getting into the shower just as his wife is finishing up her shower, when the doorbell rings. The wife quickly wraps herself in a towel and runs downstairs. When she opens the door, there stands Bob, the next-door neighbour. Before she says a word, Bob says, "I'll give you $800 to drop that towel." After thinking for a moment, the woman drops her towel and stands naked in front of Bob. After a few seconds, Bob hands her $800 and leaves. The woman wraps back up in the towel and goes back upstairs. When she gets to the bathroom, her husband asks, "Who was that?" "It was Bob the next door neighbour," she replies. "Great!" the husband says, "did he say anything about the $800 he owes me?"

Moral of the story:If you share critical information pertaining to credit and risk with your shareholders in time, you may be in a position to prevent avoidable exposure.

Lesson 2
A priest offered a Nun a lift. She got in and crossed her legs, forcing her gown to reveal a leg. The priest nearly had an accident. After controlling the car, he stealthily slid his hand up her leg. The nun said, "Father, remember Psalm 129?" The priest removed his hand. But, changing gears, he let his hand slide up her leg again. The nun once again said, "Father, remember Psalm 129?" The priest apologised "Sorry sister but the flesh is weak." Arriving at the convent, the nun went on her way. On his arrival at the church, the priest rushed to look up Psalm 129. It said, "Go forth and seek, further up, you will find glory."

Moral of the story:
If you are not well informed in your job, you might miss a great opportunity.

Lesson 3
A sales rep, an administration clerk, and the manager are walking to lunch when they find an antique oil lamp. They rub it and a Genie comes out. The Genie says, "I'll give each of you just one wish." Me first! Me first!" says the admin clerk. "I want to be in the Bahamas, driving a speedboat, without a care in the world." Puff! She's gone. Me next! Me next!" says the sales rep. "I want to be in Hawaii, relaxing on the beach with my personal masseuse, an endless supply of Pina Coladas and the love of my life." Puff! He's gone. "OK, you're up," the Genie says to the manager. The manager says, "I want those two back in the office after lunch."

Moral of the story:
Always let your boss have the first say.

Lesson 4
An eagle was sitting on a tree resting, doing nothing. A small rabbit saw the eagle and asked him, "Can I also sit like you and do nothing?" The eagle answered: "Sure, why not." So, the rabbit sat on the ground below the eagle and rested. All of a sudden, a fox appeared, jumped on the rabbit and ate it.

Moral of the story:
To be sitting and doing nothing, you must be sitting very, very high up.

Lesson 5
A turkey was chatting with a bull. "I would love to be able to get to the top of that tree," sighed the turkey, "but I haven't got the energy." "Well, why don't you nibble on some of my droppings?" replied the bull. They're packed with nutrients." The turkey pecked at a lump of dung, and found it actually gave him enough strength to reach the lowest branch of the tree. The next day, after eating some more dung, he reached the second branch Finally after a fourth night, the turkey was proudly perched at the top of the tree. He was promptly spotted by a farmer, who shot him out of the tree.

Moral of the story:
BullSh!t might get you to the top, but it won't keep you there.

Lesson 6
A little bird was flying south for the winter. It was so cold the bird froze and fell to the ground into a large field. While he was lying there, a cow came by and dropped some dung on him. As the frozen bird lay there in the pile of cow dung, he began to realize how warm he was. The dung was actually thawing him out! He lay there all warm and happy, and soon began to sing for joy. A passing cat heard the bird d singing and came to investigate. Following the sound, the cat discovered the bird under the pile of cow dung, and promptly dug him out and ate him.

Morals of the story:
(1) Not everyone who sh!ts on you is your enemy
(2) Not everyone who gets you out of sh!t is your friend
(3) And when you're in deep sh!t, it's best to keep your mouth shut!

This ends the 3-minute management course.