Wednesday, February 27, 2008

God does exist

Another "gem" that I received in today's mail :-

A man went to a barbershop to have his hair cut and his beard trimmed. As the barber began to work, they began to have a good conversation. They talked about so many things and various subjects.

When they eventually touched on the subject of God, the barber said: "I don't believe that God exists."

"Why do you say that?" asked the customer. "Well, you just have to go out in the street to realize that God doesn't exist.

Tell me, if God exists, would there be so many sick people? Would there be abandoned children?

If God existed, there would be neither suffering nor pain. I can't imagine a loving God who would allow all of these things." The customer thought for a moment, but didn't respond because he didn't want to start an argument. The barber finished his job and the customer left the shop.

Just after he left the barbershop, he saw a man in the street with long, stringy, dirty hair and an untrimmed beard. He looked dirty and unkempt. The customer turned back and entered the barber shop again and he said to the barber:

"You know what? Barbers do not exist."

"How can you say that?" asked the surprised barber.

"I am here, and I am a barber. And I just worked on you!"

"No!" the customer exclaimed. "Barbers don't exist because if they did, there would be no people with dirty long hair and untrimmed beards, like that man outside."

"Ah, but barbers DO exist! That's what happens when people do not come to me."

"Exactly!" affirmed the customer. "That's the point! God, too, DOES exist!

That's what happens when people do not go to Him and don't look to Him for help.

That's why there's so much pain and suffering in the world."

The Hinderer

Another "gem" that I received in today's email :-

One day all the employees reached the office and they saw a big advice on the door on which it was written:

"Yesterday the person who has been hindering your growth in this company passed away. We invite you to join the funeral in the room that has been prepared in the gym".

In the beginning, they all got sad for the death of one of their colleagues, but after a while they started getting curious to know who was that man who hindered the growth of his colleagues and the company itself.

The excitement in the gym was such that security agents were ordered to control the crowd within the room.
The more people reached the coffin, the more the excitement heated up. Everyone thought: "Who is this guy who was hindering my progress? Well, at least he died!".

One by one the thrilled employees got closer to the coffin, and when they looked inside it they suddenly became speechless. They stood nearby the coffin, shocked and in silence, as if someone had touched the deepest part of their soul.

There was a mirror inside the coffin: everyone who looked inside it could see him/herself.

There was also a sign next to the mirror that said:
"There is only one person who is capable to set limits to your growth: it is YOU.
You are the only person who can revolutionize your life. You are the only person who can influence your happiness, your realization and your success. You are the only person who can help yourself.

Your life does not change when your boss changes, when your friends change, when your parents change, when your partner changes, when your company changes. Your life changes when YOU change, when you go beyond your limiting beliefs, when you realize that you are the only one responsible for your life.

"The most important relationship you can have is the one you have with yourself"
Examine yourself, watch yourself. Don't be afraid of difficulties, impossibilities and losses: be a winner, build yourself and your reality.

The world is like a mirror: it gives back to anyone the reflection of the thoughts in which one has strongly believed.

The world and your reality are like mirrors lying in a coffin, which show to any individual the death of his divine capability to imagine and create his happiness and his success.

It's the way you face Life that makes the difference

Tuesday, February 26, 2008

Different Attitude

Another "gem" that I received in today's mail :-

A Cold December night in West Orange, New Jersey. Thomas Edison's factory was humming with activity. Work was proceeding on a variety of fronts as the great inventor was trying to turn more of his dreams into practical realities. Edison's plant, made of concrete and steel, was deemed "fireproof". As you may have already guessed, it wasn't!

On that frigid night in 1914, the sky was lit up by a sensational blaze that had burst through the plant roof. Edison's 24-year-old son, Charles, made a frenzied search for his famous inventor-father. When he finally found him, he was watching the fire. His white hair was blowing in the wind. His face was illuminated by the leaping flames. "My heart ached for him," said Charles. "Here he was, 67 years old, and everything he had worked for was going up in flames. When he saw me, he shouted, 'Charles! Where's your mother?' When I told him I didn't know, he said, 'Find her! Bring her here! She'll never see anything like this as long as she lives.'"

Next morning, Mr. Edison looked at the ruins of his factory and said this of his loss: "There's value in disaster. All our mistakes are burned up. Thank God, we can start anew."

What a wonderful perspective on things that seem at first to be so disastrous. A business failure, personal dream gone sour . . . whether these things destroy an individual depends largely on the attitude he or she takes toward them. Sort out why it happened, and learn something from the blunders.

Think of different approaches that can be taken !

Monday, February 25, 2008

Soldier and the Spider

Another "gem" that I received in today's mail :-

During World War II, a US marine was separated from his unit on a Pacific island. The fighting had been intense, and in the smoke and the crossfire he had lost touch with his comrades.

Alone in the jungle, he could hear enemy soldiers coming in his direction.
Scrambling for cover, he found his way up a high ridge to several small caves in the rock. Quickly he crawled inside one of the caves. Although safe for the moment, he
realized that once the enemy soldiers looking for him swept up the ridge, they would quickly search all the caves and he would be killed.

As he waited, he prayed, Lord, if it be your will, please protect me.
Whatever your will though, I love you and trust you. Amen.
After praying, he lay quietly listening to the enemy begin to draw close.

He thought, well, I guess the Lord isn't going to help me out of this one.
Then he saw a spider begin to build a web over the front of his cave.

As he watched, listening to the enemy searching for him all the while, the spider layered strand after strand of web across the opening of the cave.

Hah, he thought. What I need is a brick wall and what the Lord has sent me is a spider web. God does have a sense of humor.

As the enemy drew closer he watched from the darkness of his hideout and could see them searching one cave after another. As they came to his, he got ready to make his last stand. To his amazement, however, after glancing in the direction of his cave, they moved on.

Suddenly, he realized that with the spider web over the entrance, his cave looked as if no one had entered for quite a while. Lord, forgive me, prayed the young man. I had forgotten that in you a spider's web is stronger than a brick wall.

We all face times of great trouble. When we do, it is so easy to forget the victories that God would work in our lives, sometimes in the most surprising ways.

Remember: Whatever is happening in your life, with God, a mere spiders web can become a brick wall of protection. Believe He is with you always and you will see His great power and love for you.

Network Troubleshooting - 6 : Application Issues

I believe that after eliminating the possibilities of problems at the previous steps, the only remaining option at this step is to troubleshoot the application. You may need to scrounge through log files, check application consoles, etc.

However, the possibility of a problem occurring due to the underlying network is extremely minimal at this level - even if it does, it's probably due to some idiosyncrasies of the Operating System or the Application Platform.

Network Troubleshooting - 5 : NETSTAT

You need to now move on to the Remote System & check if the program / process is listening on a particular port that you are trying to connect to.

Netstat (network statistics) is a command-line tool that displays network connections (both incoming and outgoing), routing tables, and a number of network interface statistics.

- Wikipedia


You can use the simple NETSTAT command on the remote system to check the open Network ports, active connections, etc . You just need to open a Command Prompt ( Terminal in LINUX ) & type :-

( LINUX )

netstat -an | grep port_name

OR

( WINDOWS )

netstat -an | findstr port_name

You should see a bunch of Network statistics like this :-

TCP 0.0.0.0:1521 0.0.0.0:0 LISTENING
TCP 127.30.22.11:1521 10.177.239.210:2527 ESTABLISHED
TCP 127.30.22.11:25271 10.177.239.210:1521 ESTABLISHED
TCP 127.30.22.110:28802 10.177.145.53:1521 ESTABLISHED


If you don't get this response, you can conclude on these :-

1. The program / process on the remote system that should be "listening" on the port is not running.

Now, it's time to call up the IT Help Desk & tell them that there's a problem with Network Access.

At the end of this exercise, you have :-

* tried some basic troubleshooting steps.
* identified the source of the problem.
* communicated effectively to the IT Support Staff.

You can now confidently communicate with the IT Support Staff & they'd be more than happy to work with an "educated" colleague.

Network Troubleshooting - 4 : TELNET

A TCP/IP standard for remote terminal connection to another machine.

- Wikipedia


You can use the simple TELNET command to ensure that you can communicate with the remote system, by opening a connection to a port on the remote system. You just need to open a Command Prompt ( Terminal in LINUX ) & type :-

telnet ip_address port

OR

telnet hostname port

You should see a blank screen that allows you to type commands.

If you don't get this response, you can conclude on these :-

1. The program / process on the remote system that should be "listening" on the port is not running.
2. The remote system is protected by a "firewall" that's preventing access.

Now, it's time to call up the IT Help Desk & tell them that there's a problem with Network Access.

At the end of this exercise, you have :-

* tried some basic troubleshooting steps.
* identified the source of the problem.
* communicated effectively to the IT Support Staff.

You can now confidently communicate with the IT Support Staff & they'd be more than happy to work with an "educated" colleague.

Network Troubleshooting - 3 : PING

Ping!

Ping is a computer network tool used to test whether a particular host is reachable across an IP network.

- Wikipedia


You can use the simple PING command to ensure that you can communicate with the other system. You just need to open a Command Prompt ( Terminal in LINUX ) & type :-

ping ip_address

OR

ping hostname

You should see a reply from the Network Card like this :-

Pinging sandeep-personal [127.0.0.1] with 32 bytes of data:

Reply from 127.30.22.11: bytes=32 time 1ms TTL=128
Reply from 127.30.22.11: bytes=32 time 1ms TTL=128
Reply from 127.30.22.11: bytes=32 time 1ms TTL=128
Reply from 127.30.22.11: bytes=32 time 1ms TTL=128

If you don't get this response, you can conclude on these :-

1. Your system is not connected to the same network as the remote system.
2. The remote system is not connected to the same network as your system.
3. Your system / the remote system is protected by a "firewall" that's preventing access.

Now, it's time to call up the IT Help Desk & tell them that there's a problem with Network Access.

At the end of this exercise, you have :-

* tried some basic troubleshooting steps.
* identified the source of the problem.
* communicated effectively to the IT Support Staff.

You can now confidently communicate with the IT Support Staff & they'd be more than happy to work with an "educated" colleague.

Revision Control for Rows

Revision Control deals with managing multiple revisions of an entity. The core functionality in any Revision Control system is to ensure that the previous version is not lost. Revision Control is a vast topic that merits hours of study & practice.

I definitely don't have the breadth of knowledge or experience to comment on various "must-have" features, etc. However, I did encounter an interesting scenario where I put Revision Control to practice for information stored in rows of a Database Table.

We can achieve Revision Control for rows in a Database Table in a simple way - with two columns. We can use one column to store the Row version and another to "flag" the row that contains the latest version.

I am using an Oracle XE Database & Oracle SQL Developer to model the tables, fashion out the queries, etc. You could do the same with any other Database & your favorite tools.

Here, I consider the example of an Item "on display" at a shop. The Product is available in multiple version ( different colors ), but only one "version" of the product is currently on display ( the item ).

First, I'll model the database table. I have made a few assumptions to arrive at this model :-

Assumption # 1 :- All the rows are linked by a common identifier ( in my case, the Product ID ).
Assumption # 2 :- At any given point of time, only one version of the product is "active".
Assumption # 3 :- Each "version" is saved into the database. Any "undo" will simply revert back to the previous saved version.
Assumption # 4 :- Each "undo" or "redo" is saved into the database as the current version.

Here's a table that shows this design :-

CREATE TABLE ITEM
(
ITEM_ID NUMBER PRIMARY KEY,
ITEM_PRODUCT_ID NUMBER,
ITEM_DESCRIPTION VARCHAR2(100),
ITEM_COLOR VARCHAR2(10),
ITEM_VERSION NUMBER,
ITEM_CURRENT_VERSION VARCHAR2(1) CONSTRAINT check_ver_flag CHECK(ITEM_CURRENT_VERSION IN ('Y','N'))
);


Here's the data that I stuffed into the table :-

INSERT INTO ITEM VALUES (1,566,'Smiley Dolls','Red',1,'N');
INSERT INTO ITEM VALUES (2,566,'Smiley Dolls','Blue!',2,'N');
INSERT INTO ITEM VALUES (3,566,'Smiley Dolls','Yellow',3,'Y');
INSERT INTO ITEM VALUES (4,566,'Smiley Dolls','Cyan',4,'N');

COMMIT;


Now, to dish out the queries...

Which is the current version of the Product ?

SELECT ITEM_DESCRIPTION, ITEM_COLOR FROM ITEM WHERE ITEM_CURRENT_VERSION = 'Y';

ITEM_DESCRIPTION ITEM_COLOR
------------------- ----------
Smiley Dolls Yellow

1 rows selected


Can we "undo" the current version & revert to the previous saved version ?

SELECT a.ITEM_DESCRIPTION, a.ITEM_COLOR FROM ITEM A, ITEM B
WHERE A.ITEM_VERSION = B.ITEM_VERSION-1 AND B.ITEM_CURRENT_VERSION = 'Y'


ITEM_DESCRIPTION ITEM_COLOR
----------
Smiley Dolls Blue!

1 rows selected


( After this, we set the current version flag to "Y" )

Revision Control can be achieved in this simple manner.

Sunday, February 24, 2008

Parent Child Relations in a Database Table

Parent - Child relationships ( hierarchical relationships ) are very common & often crop often during database designs.

You can expect to find Parent -Child relationships while modeling employee-manager, office-outlets & other similar concepts. I recently encountered the need for a parent - child relationship in a need to model a product-sub product concept.

You can find a lot of literature that talks about this topic in detail. I just want to add my 2 cents..

The hierarchical relationships are best explained by examples. Here, I consider a popular fast food chain of outlets ( "Yummies" ) that has outlets across the city.
Al the outlets in a particular part of the city "report" to a single outlet - the "parent" outlet.

All these "parent" outlets in turn "report" to a single "parent" outlet - something like a "head office".

The "report"s could be anything - daily sales figures, inventory status, customer feedback, staff shortages, etc. However, at this point of time, the main focus is to model the relationship of a parent-child outlet chain.

I am using an Oracle XE Database & Oracle SQL Developer to model the tables, fashion out the queries, etc. You could do the same with any other Database & your favourite tools.

First, I'll model the database table. I have made a couple of assumptions to arrive at this model :-

Assumption #1 : Each child outlet has a single parent outlet.
Assumption #2 : Each outlet has a parent outlet, except the "root" outlet ( head office ) .

Here's the table structure that I have designed :-

CREATE TABLE OUTLET
(
OUTLET_ID NUMBER PRIMARY KEY,
OUTLET_NAME VARCHAR2(30) NOT NULL,
OUTLET_PARENT NUMBER
);


The OUTLET_ID of the "parent" outlet is stored in the "child" outlet's OUTLET_PARENT.

Here's the data I stuffed into the table :-

INSERT INTO OUTLET VALUES(1,'Yummies M G Rd',null);
INSERT INTO OUTLET VALUES(2,'Yummies BSK ',1);
INSERT INTO OUTLET VALUES(3,'Yummies BSK I Stage ',2);
INSERT INTO OUTLET VALUES(4,'Yummies BSK II Stage ',2);
INSERT INTO OUTLET VALUES(5,'Yummies BSK III Stage ',2);
INSERT INTO OUTLET VALUES(6,'Yummies Food World ',3);

COMMIT;


Now, to dish out the queries...

Which outlet is the "mother of all outlets" ? ( root outlet / head office )

The outlet that has no parent ( OUTLET_PARENT is null ) is the "mother of all outlets".

SELECT * FROM OUTLET WHERE OUTLET_PARENT IS NULL;

OUTLET_ID OUTLET_NAME OUTLET_PARENT
--------- ------------------ ---------------
1 Yummies M G Rd


1 rows selected

Which are the outlets under the root outlet ?

SELECT
a.outlet_id,
a.outlet_name,
a.outlet_parent,
b.outlet_parent
FROM outlet a,
outlet b
WHERE b.outlet_id = a.outlet_parent
AND b.outlet_parent IS NULL;


OUTLET_ID OUTLET_NAME OUTLET_PARENT OUTLET_PARENT_1
--------- ------------------ --------------- ---------------
2 Yummies BSK 1


I can now dish out various queries that involve parent-child relationships on the chain of outlets.

The model described above works best only if the two critical assumptions are satisfied. If not, you may need to explore alternate ways to achieve this relationship - e.g.: moving the relationship data ( OUTLET_ID, OUTLET_PARENT) to a separate table, etc.

Ten Common Database Design Mistakes

I recently chanced upon an article written by Louis Davidson titled "Ten Common Database Design Mistakes". The article summarizes the list of critical mistakes that should be avoided while designing a database.

As the author humbly points out in the article, the list also summarizes the mistakes he too did during the early stages of his career. I liked the article as I had to endure the same learning curve as the author.

Here's a summary of the most common mistakes :-

1. Poor design/planning
2. Ignoring normalization
3. Poor naming standards
4. Lack of documentation
5. One table to hold all domain values
6. Using identity/guid columns as your only key
7. Not using SQL facilities to protect data integrity
8. Not using stored procedures to access data
9. Trying to build generic objects
10. Lack of testing

I couldn't have summarized it better !

Wednesday, February 20, 2008

MouseTrap

Another "gem" that I received in today's mail :-

A mouse looked through the crack in the wall to see the farmer and his wife open a package.

"What food might this contain?" The mouse wondered - he was devastated to discover it was a mousetrap.

Retreating to the farmyard, the mouse proclaimed the warning.

"There is a mousetrap in the house! There is a mousetrap in the house!"

The chicken clucked and scratched, raised her head and said, "Mr. Mouse, I can tell this is a grave concern to you but it is of no consequence to me. I cannot be bothered by it."

The mouse turned to the pig and told him, "There is a mousetrap in the house! There is a mousetrap in the house!"

The pig sympathized, but said, "I am so very sorry, Mr. Mouse, but there is nothing I can do about it but pray. Be assured you are in my prayers."

The mouse turned to the cow and said, "There is a mousetrap in the house! There is a mousetrap in the house!"

The cow said, "Wow, Mr. Mouse. I'm sorry for you, but it's no skin off my nose."

So, the mouse returned to the house, head down and dejected, to face the farmer's mousetrap-- alone.

That very night a sound was heard throughout the house -- like the sound of a mousetrap catching its prey.

The farmer's wife rushed to see what was caught. In the darkness, she did not see it was a venomous snake whose tail the trap had caught.

The snake bit the farmer's wife. The farmer rushed her to the hospital and she returned home with a fever. Everyone knows you treat a fever with fresh chicken soup, so the farmer took his hatchet to the farmyard for the soup's main ingredient.

But his wife's sickness continued, so friends and neighbors came to sit with her around the clock. To feed them, the farmer butchered the pig.

The farmer's wife did not get well; she died. So many people came for her funeral, the farmer had the cow slaughtered to provide enough meat for all of them.

The mouse looked upon it all from his crack in the wall with great sadness.

So, the next time you hear someone is facing a problem and think it doesn't concern you, remember -- when one of us is threatened, we are all at risk.

We are all involved in this journey called life. We must keep an eye out for one another and make an extra effort to encourage one another.


REMEMBER:
EACH OF US IS A VITAL THREAD IN ANOTHER PERSON'S TAPESTRY; OUR LIVES ARE WOVEN TOGETHER FOR A REASON.

Sunday, February 03, 2008

Health Care : HL7 V3 Foundation Documents

The HL7 V3 Foundation documents provide rich insight into this wonderful standard. The Foundation Documents are very well organized & are comfortable to read.

You can find the foundation documents here.

The Foundation Document details the new approach in HL7 V3 :-

  • HL7 V3 adopts an Object Oriented (OO) approach using Unified Modeling Language (UML) principles.
  • Reduced Optionality. Limiting optionality is a primary goal of HL7 V3. Within HL7 V2.x, almost every field is optional.Optionality makes it harder to precisely define the semantics of a specific message and makes it virtually impossible to generate conformance claims for messaging.
  • Conformance to HL7 V3 will be testable.
The Foundation documents are the best starting point to learn the HL7 V3 Standard.