Theme images by Storman. Powered by Blogger.

Sunday 25 June 2017

Self Development : Cockroach Theory- A beautiful speech by Sundar Pichai.

- No comments
In this post I am going to share A beautiful speech given by Sundar Pichai for self development. I want you to read this story and watch the video. This will help you to change your perspective to think about situations and events happening in life.




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 behavior 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 behavior?
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 the ladies 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: “Do not react in life. Always respond.“

The women reacted, whereas the waiter responded. 

Reactions are always instinctive whereas responses are always well thought of, just and right to save a situation from going out of hands, to avoid cracks in relationship, to avoid taking decisions in anger, anxiety, stress or hurry.

Happy Reading  :-)

Most inspirational speech by steve jobs

- No comments
In this post I am going to share Most inspirational speech given by steve jobs.

Steve Jobs was an American entrepreneur, businessman, inventor, and industrial designer. He was the co-founder, chairman, and chief executive officer (CEO) of Apple Inc.CEO and majority shareholder of Pixar, a member of The Walt Disney  Company's board of directors following its acquisition of Pixar, and founder, chairman, and CEO of NeXT. Jobs and Apple co-founder Steve Wozniak are widely recognized as pioneers of the microcomputer revolution of the 1970s and 1980s.(Source : wikipedia)



Read complete speech here : http://news.stanford.edu/2005/06/14/jobs-061505/




These quotes will help you to keep moving.

- No comments



Your whole life can never depend on one single event. Life always have more to offer than you think it would.

Life is like riding a bicycle. To keep your balance you must keep moving.

You can not stop a bird from landing on your head, but you can keep it away from building a nest.

Don't Take Anything Personally. Nothing others do is because of you. What others say and do is a projection of their own reality, their own dream. When you are immune to the opinions and actions of others, you won't be the victim of needless suffering. ~ Don Miguel Ruiz

You can spend minutes, hours, days, weeks, or even months over-analyzing a situation; trying to put the pieces together, justifying what could’ve, would’ve happened… or you can just leave the pieces on the floor and move on.

You will be thrown down again and again, will fail countless times, and you will be beaten to the point where every doubt and fear will creep up to fight you. But you have to just keep going.

Don't be afraid to shake the apple tree a bit to see what fruits remain after.


These quotes will help you to create your better version.

- No comments



Don't be worst company of yourself 

Whenever you find yourself wasting time, remember. There is someone out there who is equipping him/her at this very moment. The day you compete with him, you’ll lose.

Your problem is you have spent your whole life thinking there are rules. There aren’t. We used to be gorillas. All we had is what we could take and defend.

If you spend too much time thinking about a thing, you’ll never get it done. ~ Bruce Lee

Life can be hard. But remember, while the difficult moments may decrease happiness, they’re essential for building meaning. And that’s what matters in the long run."

You don't get frustrated because of events. You get frustrated because of your beliefs.

Act the way you’d like to be and soon you’ll be the way you’d like to act.

Anger is not a real emotion. It is fear clothed. Figure out what you are afraid of before you get angry.

God gives his hardest battles to his toughest soldiers." You are being redirected and made strong for a purpose in your life. Its not suffering, its training. Training for you to make it big.

Eat a frog everyday(do your worst task first thing in the morning). It would be actually difficult in the beginning. But as you do it, you will start feeling better and procrastinate less in life.  

And in the end, it’s not the years in your life that count. It’s the life in your years.


Install and use MongoDB in Windows

- No comments
In this post I will share you how to install and use MongoDB in Windows in easy steps.

Step 1 : Download  MongoDB

Go to  MongoDB's official site and select the suitable version for your system and download.
Here is the link to download : https://www.mongodb.com/download-center?jmp=nav#community

       








Step 2 : Install it

To install  MongoDB go to download location on your computer, double click the file and press Run when pop-up appears.

Step 3 : Add  MongoDB to System Path Variable

Go to control panel then “Edit the system environment variables". when “System Properties” window appears, click on “Environment Variables…” and click on "New.." which appears in the bottom.

 Give Variable name as "Path" and Variable value  as "C:\Program Files\MongoDB\Server\3.4\bin" (navigate to MongoDB's bin folder to get the right path based on your system and folder location). Variable value depends on where you  MongoDB script folder resides.




Step 4 : Run MongoDB server
Open a command prompt window and run the "mongod" command, this command run the "MongoDB" server at "27017" port and ready to connection with a client.



Step 5 : Run MongoDB  client
Open another command prompt window and run the "mongo" command, this command create a client and establish the connection to server running at port "27017".




Step 6 : Create a new database
use studentDetails






Step 7 : Insert Data into database
db.students.insert([{"studentName":"Ankur","marks":"20"},
                                {"studentName":"Raj","marks":"30"}])



Step 7 : Check inserted Data into database
db.students.find().pretty();

I think today you learnt enough about mongoDB, Now go and give a try.

Happy Learning :-)


Saturday 10 June 2017

Javascript interview questions: typeof

- 2 comments
Question : what is typeof in javascript
Answer : The typeof operator returns a string indicating the type of the unevaluated operand.
Example : var a = 1;
               console.log(typeof a);// number

Question : Write the output
                console.log(typeof Infinity);
Answer : number

Question : Write the output
                 console.log(typeof null);
 Answer : 'object';

Question : Write the output
                 var a = [1 ,2 ,3];
                 console.log(typeof a);
 Answer : 'object';

Question : Write the output
                 console.log(typeof String('abc'));
 Answer : 'string';

Question : Write the output
                 console.log(new String('abc'));
 Answer : 'object';

Question : Write the output
                 typeof g;
 Answer : "undefined";

Question : Write the output
                 console.log(typeof NaN );
 Answer : "number";
* In ES6 use Number.isNaN() function for checking the value. Otherwise you can also use isNaN() .


Javascript interview questions: Hoisting , delete , use strict

- 1 comment
Question Hoisting in Javascript.
Answer: Hoisting is JavaScript's default behavior of moving declarations to the top.

Question: Write the output
              x = 5;
             console.log(x);
             var x;
Answer: 5;

Question: Write the output
           var x;          
           x = 5;
          console.log(x);    
Answer: 5;

Question: Write the output
         "use strict";
         console.log(x);    
         var x;          
         x = 5;
Answer: undefined;

Question: Write the output
         "use strict";
         console.log(x);
          var x = 5;
Answer: undefined;

Question: Write the output
           "use strict";
           console.log(x);
            x = 5;
Answer: Uncaught ReferenceError: x is not define;

Question.  "use strict" in Javascript.
Answer: The purpose of "use strict" is to indicate that the code should be executed in "strict mode".
Syntax : "use strict";

Question: Write the output
       "use strict";
         x = 5;
         console.log(x);
Answer: ReferenceError: x is not defined

Question: Write the output
          x = 5;
          console.log(x);
 Answer: 5
* x will be create as a global varible

Question: Write the output
          "use strict";
          console.log(x);
           x = 5;
Answer: ReferenceError: x is not define;

Question: Write the output
          "use strict";
         var x = y = 2;
Answer: ReferenceError: y is not defined;

Question.  delete in Javascript.
Answer: it will delete object properties.The delete operator will not delete ordinary variables.However, it will delete "global variables," since they are actually properties of the global object.if in strict mode it will throw an error.


Question: Write the output
          "use strict";
           var x = 2;
           delete x;
           console.log(x);
Answer: SyntaxError: Delete of an unqualified identifier in strict mode.

Question: Write the output
            var x = 2;
            delete x;
             console.log(x);
Answer: 2

Question: Write the output
             x = 2;
           delete x;
           console.log(x);
Answer: undefined

Question: Write the output
            var t = "test";
           var test2.t2 = t;
           delete test2.t2;
           console.log(t);
Answer :  "test";