Thursday, 29 September 2011

Pair of Old Shoes!

A young man, a student in one of the universities, was one day taking a walk with a professor, who was commonly called the students’ friend for his kindness to those who waited on his instructions.

As they went along, they saw lying in the path a pair of old shoes, which were supposed to belong to a poor man who was working in a field close by, and who had nearly finished his day’s work . . .

Student turned to the professor, saying: “Let us play the man a trick: We will hide his shoes, and hide ourselves behind those bushes, and wait to see his perplexity when he cannot find them …”

“My young friend,” answered the professor, “We should never amuse ourselves at the expense of the poor . . . But you are rich, and may give yourself a much greater pleasure by means of this poor man.

Put a coin in each shoe, and then we will hide ourselves and watch how this affects him..” The student did so and they both placed themselves behind the bushes close by. The poor man soon finished his work, and came across the field to the path where he had left his coat and shoes . . .

While putting on his coat he slipped his foot into one of his shoes, but feeling something hard, he stooped down to feel what it was, and found the coin. Astonishment and wonder were seen upon his
countenance.

He gazed upon the coin, turned it around and looked at it again and again.

He then looked around him on all sides, but no person was to be seen. He now put the money into his pocket, and proceeded to put on the other shoe; but his surprise was doubled on finding the other coin . . .

His feelings overcame him… He fell upon his knees, looked up to heaven and uttered aloud a fervent thanksgiving in which he spoke of his wife, sick and helpless, and his children without bread, whom this timely bounty, from some unknown hand, would save from perishing…

The student stood there deeply affected, and his eyes filled with tears.

“Now,” said the professor, are you not much better pleased than if you had played your intended trick?”
The youth replied, “You have taught me a lesson which I will never forget… I feel now the truth of these words, which I never understood before: “It’s more blessed to give than to receive.”

If you want happiness… .For a lifetime – help someone…

Wednesday, 21 September 2011

Are you Joining The ' The 99 CLUB"? -- Nice Story..

Once upon a time, there lived a King who, despite his luxurious lifestyle, was neither happy nor content.

One day, the King came upon a servant who was singing happily while he worked. This fascinated the King. Why was he, the Supreme Ruler of the Land, unhappy and gloomy, while a lowly servant had so much joy? The King asked the servant, “Why are you so happy?” The man replied, “Your Majesty, I am nothing but a servant, but my family and I don’t need too much – just a roof over our heads and warm food to fill our tummies.” The king was not satisfied with that reply. Later in the day, he sought the advice of his most trusted advisor. After hearing the King’s woes and the servant’s story, the advisor said, “Your Majesty, I believe that the servant has not been made part of The 99 Club.” “The 99 Club? And what exactly is that?” the King inquired. The advisor replied, “Your Majesty, to truly know what The 99 Club is, place 99 Gold coins in a bag and leave it at this servant’s doorstep.”

When the servant saw the bag, he took it into his house. When he opened the bag, he let out a great shout of joy… So many gold coins! He began to count them. After several counts, he was at last convinced that there were 99 coins. He wondered, “What could’ve happened to that last gold coin? Surely, no one would leave 99 coins!” He looked everywhere he could, but that final coin was elusive. Finally, exhausted, he decided that he was going to have to work harder than ever to earn that gold coin and complete his collection. From that day, the servant’s life was changed. He was overworked, horribly grumpy, and castigated his family for not helping him make that 100th gold coin. He stopped singing while he worked. Witnessing this drastic transformation, the King was puzzled. When he sought his advisor’s help, the advisor said, “Your Majesty, the servant has now officially joined The 99 Club.” He continued, “The 99 Club is a name given to those people ho have enough to be happy but are never content, because they’re always yearning and striving for that extra 1 telling to themselves: “Let me get that one final thing and then I will be happy for life.” We can be happy, even with very little in our lives, but the minute we’re given something bigger and better, we want even more! We lose our sleep, our happiness, we hurt the people around us, all these as a price for our growing needs and desires.

That’s what is called joining The 99 Club!

Eye - Opening Story -- Must Read

A boat docked in a tiny Mexican village. An American tourist complimented

the Mexican fisherman on the quality of his fish and asked how long it took

him to catch them.

“Not very long , ” answered the Mexican.

“But then , why didn’t you stay out longer and catch more?” asked the

American.

The Mexican explained that his small catch was sufficient to meet his needs

and those of his family.

The American asked , “But what do you do with the rest of your time?”

“I sleep late , fish a little , play with my children , and take a siesta with

my wife. In the evenings , I go into the village to see my friends , play the

guitar , and sing a few songs… I have a full life.”

The American interrupted , “I have an MBA from Harvard , and I can help you!

You should start by fishing longer every day. You can then sell the extra

fish you catch. With the extra revenue , you can buy a bigger boat.”

“And after that?” asked the Mexican.

“With the extra money the larger boat will bring , you can buy a second one

and a third one and so on until you have an entire fleet of trawlers.

Instead of selling your fish to a middle man , you can then negotiate

directly with the processing plants and maybe even open your own plant. You

can then leave this little village and move to Mexico City , Los Angeles , or

even New York City ! From there you can direct your huge new enterprise.”

“How long would that take?” asked the Mexican.

“Twenty , perhaps twenty-five years , ” replied the American.

“And after that?”

“Afterwards? Well my Friend , That’s when it gets really interesting , ”

answered the American , laughing. “When your business gets really big , you

can start selling stocks and make millions!”

“Millions? Really? And after that?” said the Mexican.

“After that you’ll be able to retire , live in a tiny village near the

coast , sleep late , play with your children , catch a few fish , take a siesta

with your wife and spend your evenings doing what you like and enjoying

your friends.”

“With all due respect sir , but that’s exactly what I am doing now. So

what’s the point wasting twenty-five years?” asked the Mexican.

And the moral is:

Know where you’re going in life… you may already be there…! Be Content..! Be Happy with what you have..!

Check My Performance -- Nice Story...

A little boy went into a drug store, reached for a soda carton and pulled it over to the telephone.
He climbed onto the carton so that he could reach the buttons on the phone and proceeded to punch in seven digits.

The store-owner observed and listened to the conversation:

The boy asked,” Lady, Can you give me the job of cutting your lawn?

The woman replied, “I already have someone to cut my lawn.”

Lady, I will cut your lawn for half the price of the person who cuts your lawn now.” replied boy.

The woman responded that she was very satisfied with the person who was presently cutting her lawn.

The little boy found more perseverance and offered,” Lady, I’ll even sweep your curb and your sidewalk, so on Sunday you will have the prettiest lawn in all of North Palm beach, Florida.”

Again the woman answered in the negative. With a smile on his face, the little boy replaced the receiver.

The store-owner, who was listening to all, this, walked over to the boy and said,” Son… I like your attitude; I like that positive spirit and, would like to offer you a job.”

The little boy replied, “No thanks, I was just checking my performance with the job I already have. I am the one who is working for that lady, I was talking to!”

Thursday, 25 August 2011

Normalization Basics – 1NF 2NF and 3NF

Description of Normalization


Normalization is the process of organizing data in a database. This includes creating tables and establishing relationships between those tables according to rules designed both to protect the data and to make the database more flexible by eliminating redundancy and inconsistent dependency.


Redundant data wastes disk space and creates maintenance problems. If data that exists in more than one place must be changed, the data must be changed in exactly the same way in all locations. A customer address change is much easier to implement if that data is stored only in the Customers table and nowhere else in the database.


What is an “inconsistent dependency”? While it is intuitive for a user to look in the Customers table for the address of a particular customer, it may not make sense to look there for the salary of the employee who calls on that customer. The employee’s salary is related to, or dependent on, the employee and thus should be moved to the Employees table. Inconsistent dependencies can make data difficult to access because the path to find the data may be missing or broken.


There are a few rules for database normalization. Each rule is called a “normal form.” If the first rule is observed, the database is said to be in “first normal form.” If the first three rules are observed, the database is considered to be in “third normal form.” Although other levels of normalization are possible, third normal form is considered the highest level necessary for most applications.


As with many formal rules and specifications, real world scenarios do not always allow for perfect compliance. In general, normalization requires additional tables and some customers find this cumbersome. If you decide to violate one of the first three rules of normalization, make sure that your application anticipates any problems that could occur, such as redundant data and inconsistent dependencies.


The following descriptions include examples.


First Normal Form


















Eliminate repeating groups in individual tables.
Create a separate table for each set of related data.
Identify each set of related data with a primary key.

Do not use multiple fields in a single table to store similar data. For example, to track an inventory item that may come from two possible sources, an inventory record may contain fields for Vendor Code 1 and Vendor Code 2.


What happens when you add a third vendor? Adding a field is not the answer; it requires program and table modifications and does not smoothly accommodate a dynamic number of vendors. Instead, place all vendor information in a separate table called Vendors, then link inventory to vendors with an item number key, or vendors to inventory with a vendor code key.


Second Normal Form














Create separate tables for sets of values that apply to multiple records.
Relate these tables with a foreign key.

Records should not depend on anything other than a table’s primary key (a compound key, if necessary). For example, consider a customer’s address in an accounting system. The address is needed by the Customers table, but also by the Orders, Shipping, Invoices, Accounts Receivable, and Collections tables. Instead of storing the customer’s address as a separate entry in each of these tables, store it in one place, either in the Customers table or in a separate Addresses table.


Third Normal Form










Eliminate fields that do not depend on the key.

Values in a record that are not part of that record’s key do not belong in the table. In general, any time the contents of a group of fields may apply to more than a single record in the table, consider placing those fields in a separate table.


For example, in an Employee Recruitment table, a candidate’s university name and address may be included. But you need a complete list of universities for group mailings. If university information is stored in the Candidates table, there is no way to list universities with no current candidates. Create a separate Universities table and link it to the Candidates table with a university code key.


EXCEPTION: Adhering to the third normal form, while theoretically desirable, is not always practical. If you have a Customers table and you want to eliminate all possible interfield dependencies, you must create separate tables for cities, ZIP codes, sales representatives, customer classes, and any other factor that may be duplicated in multiple records. In theory, normalization is worth pursing. However, many small tables may degrade performance or exceed open file and memory capacities.


It may be more feasible to apply third normal form only to data that changes frequently. If some dependent fields remain, design your application to require the user to verify all related fields when any one is changed.


Normalizing an Example Table


loadTOCNode(2, ‘moreinformation’); These steps demonstrate the process of normalizing a fictitious student table.





















1. Unnormalized table:





























Student# Advisor Adv-Room Class1 Class2 Class3
1022 Jones 412 101-07 143-01 159-02
4123 Smith 216 201-01 211-02 214-01

2. First Normal Form: No Repeating Groups


Tables should have only two dimensions. Since one student has several classes, these classes should be listed in a separate table. Fields Class1, Class2, and Class3 in the above records are indications of design trouble.


Spreadsheets often use the third dimension, but tables should not. Another way to look at this problem is with a one-to-many relationship, do not put the one side and the many side in the same table. Instead, create another table in first normal form by eliminating the repeating group (Class#), as shown below:















































Student# Advisor Adv-Room Class#
1022 Jones 412 101-07
1022 Jones 412 143-01
1022 Jones 412 159-02
4123 Smith 216 201-01
4123 Smith 216 211-02
4123 Smith 216 214-01

3. Second Normal Form: Eliminate Redundant Data


Note the multiple Class# values for each Student# value in the above table. Class# is not functionally dependent on Student# (primary key), so this relationship is not in second normal form.


The following two tables demonstrate second normal form:


Students:




















Student# Advisor Adv-Room
1022 Jones 412
4123 Smith 216

Registration:

































Student# Class#
1022 101-07
1022 143-01
1022 159-02
4123 201-01
4123 211-02
4123 214-01

4.

In the last example, Adv-Room (the advisor’s office number) is functionally dependent on the Advisor attribute. The solution is to move that attribute from the Students table to the Faculty table, as shown below:


Students:

















Student# Advisor
1022 Jones
4123 Smith

Faculty:




















Name Room Dept
Jones 412 42
Smith 216 42