Monday, 27 March 2017

Best note ever...

Two days after his marriage, the groom went to the Beauty Parlour and met the beautician who made her wife the bride. After the introduction, the groom handed over an iPhone to the beautician. The beautician graciously accepted the gift.

After the groom left the parlour, the beautician happily opened the box...

The box had a Nokia 1100 and a note...

"Same Feelings"

;) :P

Collected from WhatsApp Forward !!!

Sunday, 26 March 2017

Skill + Luck + Intelligence = Successful execution

A young programmer and his project manager board a train headed through the mountains on its way to Wichita. They can find no place to sit except for two seats right across the aisle from a young woman and her grandmother. After a while, it is obvious that the young woman and the young programmer are interested in each other, because they are giving each other looks. Soon the train passes into a tunnel and it is pitch black. There is a sound of a kiss followed by the sound of a slap.

When the train emerges from the tunnel, the four sit there without saying a word. The grandmother is thinking to herself, “It was very brash for that young man to kiss my granddaughter, but I’m glad she slapped him.”

The project manager is sitting there thinking, “I didn’t know the young tech was brave enough to kiss the girl, but I sure wish she hadn’t missed him when she slapped me!”

The young woman was sitting and thinking, “I’m glad the guy kissed me, but I wish my grandmother had not slapped him!”

The young programmer sat there with a satisfied smile on his face. He thought to himself, “Life is good. How often does a guy have the chance to kiss a beautiful girl and slap his project manager all at the same time!”


Saturday, 25 March 2017

Programmer visiting Hell and find its beautiful...

A programmer finds himself in front of a committee that decides whether he should go to Heaven or Hell.  The committee tells the programmer he has a say in the matter and asks him if he wants to see either Heaven or Hell before stating his preference.
“Sure,” the programmer replies.  “I have a pretty good idea what Heaven is like, so let’s see Hell.”  So an angel takes the programmer to a sunny beach, full of beautiful women in skimpy bikinis playing volleyball, listening to music and having a great time.  “Wow!” he exclaims, “Hell looks great!  I’ll take Hell!”
Instantly the programmer finds himself in red-hot lava with demons tearing at his flesh.  “Where’s the beach?  The music?  The women?” he screams frantically to the angel.
“That was the demo,” the angel replies as she vanishes.


Friday, 24 March 2017

Differentiate DBMS with File System

Some of my readers asked me a question - What is the difference between DBMS and File System and which one to use where.

This topic has been discussed within forums millions of times, still there are many newbies who get stuck with the terms. They often ask why to invest time/energy over learning something new while we already can store data using our favourite programming language. Some Java Developers also think that Serialization is there to save us, why to again learn DBMS for our development activities ?

To answer this question in the simplest way possible is, DBMS is a wrapper over File Systems. This wrapper provides functionalities apart from the storing, retrieving and manipulating data.

Now keeping this mind, I will try to find what DBMS and File System is -

File System: File system is a way Operating System uses to organise, store and retrieve data with the help of logical grouping. Using programming languages, we ask Operating System to provide the control of the file system, so that we can use it as per our purpose.

Database: Database is an organised collection of data. Essentially it means that anything can be used in context of Database. In reality, a database is Data with its Meta-Data.

DBMS: DBMS is an application that interacts with database and aids us with different data related solutions.

That's one part of it, very simple. Isn't it ?

No, actually not. A DBMS is actually an application which deal with multiple sub systems. Now let us look what are the things DBMS comprise of -

  1. Bare minimum is a backing file system where all data resides.
  2. A network system which connects to different clients who essentially requests for CRUD Operation.
  3. A Query Language processing system. This subsystem takes care of the standard communication system between any programming language and the database itself.
  4. Data Management System. This thing actually deals with the data and processes it accordingly.
Major four components are listed above. With these things a database is functional. Now, apart from these basic features DBMS also provides more features like security, concurrency control, reporting, administration etc.

Actually within a database server, many components run on its own space and they all work together to perform operations as requested by a client.

Now, for a moment, let's think of a situation where no database exists. So, how would that system look like ?

You have one application which has to store some data and also retrieve from it for future uses or you want to share the data across multiple machines. How would you do that ?

Well, let's take this part by part.
  • Write an application programm which deals with storing the data.
  • Write another application programm which reads the data.
  • As you have the option to read, write and modify the data while on the go, you need another application to keep track of read and write. Also, if required, this can block one or more clients for read/write operation.
  • You need another application which keep track of memory and disk usage. Other than this module, you are supposed to end up with memory over flow or heavy disk usage or both.
  • You need another application to deal with sharing the data across clients.
Now, think of the complexity of a very basic database. Actually these are the bare minimum features a DBMS must have.

Now, you have completed the basics of a DBMS. Now, let's dig deeper and think of some more features,
  • You don't want all the data to be shared to all the clients. So, you need authentication and authorization.
  • When you are dealing with Data Security, you must not ignore data integrity.
  • When Data Security and Data Integrity comes into picture, you need to think of Concurrency.
  • Once all these are done, you need to think of reporting the usage of DBMS.
Once you are done with all the above sections, you must integrate all of them into a single hood to operate in a better way.

Now, you have implemented all of them and your system works fine. Now, the biggest nightmare....

You ended up creating a very large file while appending your data in it. Now, your system looks up the file system, picks the file and now reads records one by one sequentially. To find a row, it takes almost 2-3 minutes. Or may be your system hangs while querying a partiular row. Or the worst, it crashes. How will you handle this ?
  • You decided to create multiple chunks of data in multple files. Again add another application which takes care of data storage and retrieval using chunks.
What next ???


I cannot think of this anymore....

But a DBMS handles many other features than mentioned above.

But you might think that, OK, I don't need all these, I have a smaller use case and really don't want to have another segment to deal with DBMS.

For a smaller user case, handling the data with File System or Network Transfer is a good choice. There is no single silver bullet for this discussion about how much data you can deal in file system/network transfer, but as a general suggestion if you answer the following questions, you can find which one perfectly suits your need - File System/Main Memory/Network Transfer/DBMS or a combination of one or more -
  1. How much data to handle ?
  2. How many applications use the same data ?
  3. How applications interchange the data ?
  4. How much probablity of manipulating the data ?
  5. How secured data it is ?
  6. What if data mismatch happens to occur in the system ?
Generally, answering these questions can answer if you really need a DBMS or not.

Genie granted a programmer's wish

A programmer is walking along a beach and finds a lamp.  He rubs the lamp, and a genie appears.  “I am the most powerful genie in the world.  I can grant you any wish, but only one wish.” 
The programmer pulls out a map, points to it and says, “I’d want peace in the Middle East.” 
The genie responds, “Gee, I don’t know.  Those people have been fighting for millennia.  I can do just about anything, but this is likely beyond my limits.” 
The programmer then says, “Well, I am a programmer, and my programs have lots of users.  Please make all my users satisfied with my software and let them ask for sensible changes.”
At which point the genie responds, “Um, let me see that map again.”


Monday, 13 March 2017

A story of an Engineer, a Physicist and a Programmer.

A physicist, an engineer and a programmer were in a car driving over a steep alpine pass when the brakes failed. The car was getting faster and faster, they were struggling to get round the corners and once or twice only the feeble crash barrier saved them from crashing down the side of the mountain. They were sure they were all going to die, when suddenly they spotted an escape lane. They pulled into the escape lane, and came safely to a halt.
The physicist said "We need to model the friction in the brake pads and the resultant temperature rise, see if we can work out why they failed".
The engineer said "I think I've got a few spanners in the back. I'll take a look and see if I can work out what's wrong".
The programmer said "Why don't we get going again and see if it's reproducible?"