Friday, August 2, 2019

COCKROACH THEORY By Google CEO Sundar Pichai - A beautiful way to understand LIFE

The cockroach theory for SELF-DEVELOPMENT:

At a restaurant, a cockroach suddenly flew from somewhere and sat on a lady. She started screaming out of fear. With a panic stricken face and trembling voice, she started jumping, with both her hands desperately trying to get rid of the cockroach. Her reaction was contagious, as everyone in her group also got panicky. The lady finally managed to push the cockroach away but ...it landed on another lady in the group. Now, it was the turn of the other lady in the group to continue the drama. The waiter rushed forward to their rescue. In the relay of throwing, the cockroach next fell upon the waiter.


The waiter stood firm, composed himself and observed the behaviour of the cockroach on his shirt. When he was confident enough, he grabbed it with his fingers and threw it out of the restaurant. Sipping my coffee and watching the amusement, the antenna of my mind picked up a few thoughts and started wondering, was the cockroach responsible for their histrionic behaviour? If so, then why was the waiter not disturbed?

He handled it near to perfection, without any chaos.

It is not the cockroach, but the inability of those people to handle the disturbance caused by the cockroach, that disturbed the ladies.

I realized that, it is not the shouting of my father or my boss or my wife that disturbs me, but it's my inability to handle the disturbances caused by their shouting that disturbs me.

It's not the traffic jams on the road that disturbs me, but my inability to handle the disturbance caused by the traffic jam that disturbs me.

More than the problem, it's my reaction to the problem that creates chaos in my life.

Lessons learnt from the story:

I understood, I should not react in life. I should always respond.

The women reacted, whereas the waiter responded.

Reactions are always instinctive whereas responses are always well thought of.

“Person who is Happy is not because everything is Right in his Life.
He is Happy because his Attitude Towards Everything in his Life is Right..!”

Sunday, July 21, 2019

10 Advice from Warren Buffet for Young People Who Want to Be Rich

Warren Buffet became a millionaire in 1960 at the age of 30 and ever since then, He has been one of the richest people in the world. Over the years he has given various advice to young people about how they can be rich and successful.



Advice No. 1. “I will tell you how to become rich. Close the doors. Be fearful when others are greedy. Be greedy when others are fearful.”

Advice No. 2. “No matter how great the talent or efforts, some things just take time. You can’t produce a baby in one month by getting nine women pregnant”.

Advice No. 3. “It’s better to hang out with people better than you. Pick out associates whose behavior is better than yours and you’ll drift in that direction.”

Advice No. 4. “You won’t keep control of your time, unless you can say ‘no.’ You can’t let other people set your agenda in life.”

Advice No. 5. “You don’t have to be smarter than the rest. You have to be more disciplined than the rest.”

Advice No. 6. “Risk comes from not knowing what you’re doing.”

Advice No. 7. “The chains of habit are too light to be felt until they are too heavy to be broken.”

Advice No. 8. “Enjoy your work and work for whom you admire.“

Advice No. 9. “You can’t buy what is popular and do well.”

Advice No. 10. “Never invest in a business you cannot understand.”

Thursday, June 13, 2019

Sample program to create custom SVG Marker with Label for Google Map Api

Here is a sample program to create custom SVG Marker for Google Map Api. The marker will look like shown in the below image. You can change the color of the marker by passing the color as the parameter for the pinSymbol function.
HTML :
<div id="map_canvas" style="height: 400px; width: 100%;">
CSS :
html, body, #map_canvas {
    height: 500px;
    width: 500px;
    margin: 0px;
    padding: 0px
}
JAVASCRIPT :
function initializeMap() {
 var center = new google.maps.LatLng(30.5, -98.35);;
  var markerLatLng = new google.maps.LatLng(30.5, -98.35);

    var map = new google.maps.Map(document.getElementById('map_canvas'), {
        zoom: 12,
        center: center,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    });

    var marker = new google.maps.Marker({
        position: markerLatLng,
        map: map,
        draggable: true,
        raiseOnDrag: true,
        label: { text: 'WXYZ', color: '#fff', fontSize: '12px' },
        icon: pinSymbol('green')
    });
}

function pinSymbol(color) {
    return {
        path: 'M 0,0 C -2,-20 -10,-22 -10,-30 A 10,10 0 1,1 10,-30 C 10,-22 2,-20 0,0 z',
        fillColor: color,
        fillOpacity: 1,
        strokeColor: '#000',
        strokeWeight: 2,
        scale: 2,
        labelOrigin: new google.maps.Point(0, -30)
    };
}
OUTPUT IMAGE :