Friday, February 27, 2015

Prof... how do I get there?

Today I watched Larry Smith's TED Talk (https://www.ted.com/speakers/larry_smith). Larry Smith is an Economics professor who helps his students pursue their passion. In the talk, he said that we are afraid to pursue our passion. We are afraid to look stupid and find any excuse to avoid doing what we really love to do. He said that a person might have 10 interests out of which one could be their true passion. He said that we must explore new things of interest continuously until we find our true destiny. Otherwise our talent is being wasted.

The trouble is everyone says that. Find your passion. Do what you love to do. Life is simple etc etc. Nobody ever explains how to get there. For example, while exploring those ten areas of interest, how will I know that I have really explored them? I could write a program and say that hey I explored programming and loved it. How does it really feel to be passionate about something? Once I read somewhere that passion is fuelled by success. The more successful you are at something, the more passionate you become about it. But success is dependent on so many factors that there's no guarantee that what I am passionate about today will be something that I will be passionate about tomorrow. I could be a great programmer today because I am capable of facing the challenges put forth in my plate. What if I face something that I fail at? Will I stop being passionate about programming? With the huge variety of advice we get on passion (it is such an overused word...), how do we know the direction in which to chart our course of action? How does it feel to be on that journey? How does one know that one is going in the right direction? Using the right techniques? Does it bring contentment? Or does it mean being comfortable outside your comfort zone all the time? I would love to talk to people who've found what they're passionate about and are living their dreams. After watching Prof. Larry's TED talk, I wanted to talk to him because he helps his students. I want his opinion on the how.


What do I want out of my life?

Yes I want to find my passion. And once I find it, I want to live it. But irrespective of whether I find it or not, I want to know that I really lived. And I will feel that way only if I know that I completely immersed myself in everything that I do. If I am selling Bananas, then I want to know everything about selling Bananas. I want to know that I did everything I could to the best of my abilities while doing so. In the end, I want to know that I was my best whether I liked what I was doing or not. I want success to be a habit for me. Uptil this point, I have had that feeling of satisfaction for very short bursts of time only. So for the most part, I am not really living. I just exist. My current goal is to fix that. Personally, I feel that that will lead my to my passion. Cause in that case, I will be in a positive state of mind. And happiness is contagious. It makes more of itself. Leads us to make better decisions.

Trivia Quiz!

Today, I went to Newtowne Grille at Porter square with Tess and her colleague kaylee after work. The food was decent w.r.t. the price. We had to stand in the beginning as the place was completely packed. The big attraction was the Trivia quiz. Every table got a questionnaire. The Trivia master was announcing questions. Each team had to provide their answers and team name on a piece of paper and submit it after every question. Most of the questions were about American movies, songs, US geography, history and politics. And I don't know much about any of that. Luckily Tess knows a lot about movies and songs. And to some extent Kaylee too. The only question I knew the answer to was 'Who was the first African-American woman to win an Oscar for a Female Actress in 2002?' The answer was Halle Berry. Although I couldn't recall his name, I knew that the first man to fly in space was a Russian (Yuri Gagarin) because the first man to walk on the moon was an American (Neil Armstrong) and that happened because Americans had to beat the Russians who went into space before them. We had a few lucky guesses. For example Helium is the lightest Noble gas and Aioli is a sauce made using Mayonnaise, Garlic and Olive oil. We also had a few close misses. For example, we were not sure whether or not Lake Michigan was the largest Great Lake totally inside the U.S.. And it is completely inside the U.S. However, our answer was Lake Erie which turned out to be wrong. Overall we had a good time discovering intersting tidbits.


P.S.: It was against the rules to use a google the answers.

Wednesday, February 25, 2015

HTTPS in NGINX

Been reading about NGINX. When you install and run NGINX, its operation is controlled by a configuration file called nginx.conf. This file has a tree like structure that defines contexts with the help of directives. The http context is a misnomer. It leads you to think that HTTP connection settings are governed by the directives defined in it. But guess what, it can also be used to control HTTPS connections. You just have to specify HTTPS directives in it.

http {
server {
listen 80;
listen 443 ssl;
server_name www.helloworldexample.com;
ssl_certificate www.helloworldexample.com.crt;
ssl_certificate_key www.helloworldexample.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
...
}
}

Using this configuration for the http context will enable your NGINX server to handle both HTTP and HTTPS requests.

Tuesday, February 24, 2015

Passing a Boolean in JQuery

Yesterday, while updating a UI to include a boolean flag controlled by a checkbox, I got stuck. The flag was being persisted, but was not being rendered correctly when fetched from memory. I printed the fetched value in a DIV element. It was printed correctly. Then it hit me. It was a String, and not a Boolean. Upon further investigation, I found out that the value was being persisted as a String and not a Boolean. The JQuery Ajax POST request was sending it as a String. I simply fixed the situation by converting it to a Boolean value before persisting. :)

Saturday, February 7, 2015

Why shampoo bottles need to be smaller than conditioner bottles!

Have you ever run out of conditioner even though you have a half empty bottle of shampoo? I used two bottles of conditioner for my last shampoo bottle, which is still not empty. It still has enough for 2-3 washes. Which makes me think... why do shampoo companies make the conditioner and shampoo bottles in the same size? Surely they realize that people need more conditioner than shampoo. Shampoo is soap... it makes hair clean, but also saps it of moisture. I use a very small amount that cleanses. Comparatively, more amount of conditioner is needed to moisturise hair. Not copious amounts, but definitely more than shampoo. And when your conditioner runs out.. you buy some more knowing that you will have to go back again to get shampoo at a later date cause it's not over yet. It gets trickier if you want to try the latest moisture renewing conditioner from Organix with Argan oil. Companies design these products so you have to use the counterpart shampoo with the conditioner to get the best results. So you keep buying the same conditioner until your shampoo finishes... But then you might run out of shampoo and still have conditioner left in the end... and it becomes a cycle. You're stuck! What a mess!

More revelations... How much conditioner does that bottle really hold?

I was so frustrated that I might have to buy a third bottle of conditioner for the same bottle of shampoo that I decided not to buy one until the shampoo finished... so I've been putting water in the conditioner bottle, shaking it and using whatever comes out. I was surprised to notice that everytime, I get enough conditioning foam for my hair. This means that I've been wasting conditioner all this time by throwing away conditioner bottles without properly using all the conditioner in them. This has another depressing implication. Once the shampoo bottle is empty, if I put water in it and shake it, then I will probably get enough shampoo for 2 or 3 more washes. Urrrgh... I just want to throw it away!