Hit +1

Hey guys!! If you like this blog please hit the +1 button on the left... Its for a contest. The more number of hits, better the chance of us winning!

Wednesday, 23 October 2013

The Zen of Python

I would start off with clarifying a popular misconception. The Python programming language does not in any manner associate itself with the reptile python. Nor does it draw inspiration from the viscous beast. The name was inspired by the 'Monty Python' comic series, which they say is a popular comic series in the West. (Trust me, this was the first time I knew a comic by this name existed. 'Monty Python' seems a very strange name for a comic though). "Monty Python was a British surreal comedy group that created Monty Python's Flying Circus, a British television comedy sketch show that first aired on the BBC on 5 October 1969" quotes Wikipedia. Oh yes, 1969! Way before our generation to be precise. Lets leave it at that folks.
We'll just dive into Python, the programming language.

Python is the "most powerful language you can still read".

This statement was made by Paul F.Dubois who's one of these elite persons in the world of computers. His profile says PhD from University of California and a couple of awards for contributions to the American physics community. Very impressing indeed! Well I don't know what he's doing right now, but his words above make two important facts about Python language. One thing is about its power and the other is about its readability. 
Python has a lot of power in terms of flexibility, objected-oriented-programming, libraries and so on! And yes, it had tons and tons of libraries, like literally! Doesn't that make writing code easier for you? Well, if there are code blocks for everything all you got to do is to use them wisely.
The second part is about its readability. Whenever you see a large chunk of code, you get intimidated don't you? For some of us, its plain Greek and Latin. Well like Dubois puts it, its the language you can still read as in its the most friendly language. For this very reason, many people refer Python to as a "great first language". It's a clear, simple, versatile language with well thought out syntax and has a myriad of libraries that makes it so appealing. The possibilities that one can imagine with Python is infinite.

Now that we're well briefed, let the Zen of Python reveal itself!

The Zen

There are two words I would like to say to you. They are "import this". When you type these two words and hit Enter in a Python interpreter a set of quotes pops up. As it says, its by Tim Peters. Must've been a great person, this "Tim". Frankly speaking, I do not understand all these statements, but some of these few simple but powerful lines have changed the way I think. They said these are the founding guidelines of the Python community, but I say these are the guidelines for life.

"Simple, yet powerful",the whole ideology of Python.

Number ONE! Beautiful is better than ugly.

Woah! Stop your thoughts right there. I wasn't talking about physical appearances of guys and girls. Its the inner-beauty I'm talking about. The innate uniqueness that is associated with each one of us is truly remarkable. Aren't we all beautiful in the eyes of our creator? Nature is one of the best examples. Do flowers and trees have captions on top of them and a "Like" button at the end? They are all beautiful from the *inside*.  Same with code!

Number TWO! Explicit is better than implicit.

Python gives an easy solution to all of our relationship-issues. Ain't it smart? Just open yourself and dance in the rain, my friend. Don't be a closed book. Let your code reach the people. And make them understand, so that they can write on their own.

Number THREE! Simple is better than complex, Complex is better than complicated. 

How true! What have I been telling you all night? Keep it simple, Keep it straight. Same with code, same with life. Enough said, lets move on. 

Number FOUR! Readability counts.

Oh yes, this is the first lesson for any programmer. Unless someone understands the code you write, your code really does not help. That's the sad truth and I know how hard it is to do this. My suggestions would be to keep this fact at the back of your mind always, "The computer is not just a machine, but a person." It helps me, I don't know if it'll help you. And from a life perspective, you should express your thoughts! Does not matter if its correct or wrong. Go on top of a mountain and shout out, loud!

Number FIVE! Special cases aren't special enough to break the rules.

This is kind of tricky. Well, we all do bend rules, grease it and suit it to ourselves. But each time we do that, we're cheating ourselves. In real life you can't say, "I don't care if your baap(father) is the CM or PM ".  But you sure can do one thing. Teach that "special case" a lesson. Be smart, don't just code away.

Number SIX! In the face of ambiguity, refuse the temptation to guess.

There comes a quick-fix answer to all our Multiple Choice Questions(MCQ). I don't say no to instincts, but just give a thought if there's a logical explanation to the instinct. Think harder, code more to code less.

Number SEVEN! There should be one-- and preferably only one --obvious way to do it.

Here's where Python shows its "cool dude" attitude. For a problem, there should be one obvious way to do it right? It might be a little hasty and you might even mess up, but what's life without all that? Make mistakes, learn from them, un-learn, repeat the process all over! You have one life, live it.

Number EIGHT! If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.

Doesn't this say it all? Take an example of arranging the furniture at your new home. You put in all the cupboards and cabinets first, then bring in the sofas and chairs. What if you do it the other way round? Bad idea! So whenever you think of ideas think about their practicality as well. 

And lastly : 

NUMBER NINE!  Now is better than never.
Although never is often better than *right now*.

Time is of paramount importance, and those who realize it are smart!(unlike me). Somethings are to be done right now, some never. I don't get it when people say that there's a right time for everything. All  I know is that the clock's ticking. You are the master of your life! Choose wisely. 

Summing up,   

Antigravity, yeah!

PS: I've not put in the Python Logo cause I've to still figure which color's on top.
Disclaimer: To see not so ambitious Python projects click here.

Sunday, 20 October 2013

Firefox - Take the Fox, spread the Fire!

Registrations said 8.00 - 9.00 am. And so, I had to leave home by 6.30 for the two hour ride. I wish I could say, "The early-morning wake up call was compensated by the scenic view of the lake near my place." Well, the lake truly was splendid because I couldn't see nothing of it! Obviously, at 6.30 in the morning there's zero visibility folks! Mist and fog everywhere. Ideal time for a smoke-ring. Mind you, a 'smoke-ring' and not a 'smoke'. ;)

 After an uneventful journey, I reached my destination, the erstwhile M S Ramiah Institute of Technology. When the whole of Bangalore is sleeping, you can just whiz through the city as if it were it a race circuit, trust me! No traffic-lights, no cops. No autos too! (Very irritating they are.) To find the correct block at the deserted and massive college took me some time and to my luck, there were only a handful of people in the laboratory assigned. My logic was - with larger people around, I'd make a larger fool of myself. Smaller the crowd, lesser the embarrasment.  Yes people, I had landed myself at the Firefox OS AppDays event without a single clue as to what app I would be making!

So, What's all the fuss about Firefox OS? 

First things first. Firefox is a mobile operating system(OS) and as Jai Pradeesh puts it, its the most happening OS.

 "Its open and you have the power to make it better."

He believes that though there are major and established players like Android and iOS in the smart-phone market, FirefoxOS (once launched) will create a major impact in the field owing to its amazing features. 
  • The whole thing is powered by HTML5 – it’s all about escaping Google and Apple’s walled gardens and frolicking freely in the wilds of the open web.
  • Half the code is written by volunteers like you and me. Isn't that something great? 
  • At Firefox OS, you create web-apps and not normal the usual apps. Web apps have the flexibility to run on low processor requirements, thereby considerably reducing the cost of your handset.
  • Firefox OS has the capability of running on low end phones due to the above said factor. Who doesn't like a cheap but trendy phone? :)

Well you can find all these on the net, but what really impress me about the Mozilla Foundation are just two things. Their ideology and their commitment.
Their ideology, as in "making web open" is truly amazing. Also, its a patron of the Open Source community which is always better. I believe in one of my own quotes: 

  "Never trust a code you can't see."

And about their commitment, I'm speechless! The Mozilla community is one of the largest Open Source groups in the world I've seen and the best part is that they have a great deal of respect towards the cause. And did I just miss that they are brainy? My goodness, each volunteer at Mozilla has a story behind him which makes you salute them. The talent pool that Mozilla has generated is truly awesome.

Enough said! What did I do?During the course of the introduction, an idea flashed! It was about a gift app. Gifts, birthdays and management! The idea is to make the whole process of gifting your loved ones, easier and effective. So, I shared my idea with one of the volunteers, Saikiran Chandha who helped me formalize the app idea and also told me a lot about how to really make it work! He literally sat down with us, went through our logic, voiced differences and finally set up an action plan.

In conversation with Saikiran

My faithful friends Vignesh and Rahul stuck to me till the very end, answered my naive questions and even complemented the idea! I finally made some sense of Rahul's user interface ideas and we were done with the app. I'm not letting you into the finer details of the app not because its confidential, but because this post is about the Fox, and let it stay that way. Nevertheless, I will tell you this one thing. The app-making was one helluva experience! Now that I think of it, the restriction of Facebook at the venue was a boon as it enabled everyone to work without distractions.

Photo: GiftR app demo. :)
App Demo with Rahul
Credits: Galaxy

There were other interesting innovations like Multimedia app, IMDB app, a Search Engine app, Rotten tomatoes app, Weather report app and many more which were way too advanced and way too brilliant. I had a great time knowing how the hands and minds behind these apps work, live in action. ;-)

Also, if my Gift app gets published on Firefox Marketplace, I'll be placing my hands on one of these. Fingers crossed! :)

Ain't she a beauty?
[Firefox Keon by ZTE]

PS : I just forgot to mention the swags I got. To know them, come take part in the next Mozilla event.  

Thursday, 17 October 2013

When I went from 'Google it' to 'Duck it' !

When I first heard of the phrase "Duck Duck Go" I thought its something to do with ducks. If someone else would've told me that Duck Duck Go was a search engine I would have thought it was a pretty lame joke on me.  Well, actually the joke is on me now! To my utter surprise, Duck Duck Go is in reality a fairly popular search engine! Yes, after the initial shock of such a ridiculous name for a search engine subsided I looked up about what Duck Duck Go really is. And this time for a change I used Duck Duck Go, not Google. :)

For a person like me who treats the words "search" and "Google" analogously, to think of a search engine other than Google was close to impossible.  Oh please, until 2 months ago my homepage was set to Google. I'm pretty sure that most of you navigate to "www.google.com" which redirects you to "www.google.co.in"  to check if your network is working or not. Well, I used to do the same thing some days ago, so nothing to be weary about! Now that I've found other efficient ways to check if the net's on or not, I can't really forget my roots can I ! ;-)

The site

Moving further, what is this DuckDuckGo?
In three words, its Google's best competitor. In more words, DuckDuckGo is an Internet search engine that uses information from many sources from Yahoo, Bing, etc to fetch results. Straight from the Wiki! Well we've all seen that Bing and Yahoo haven't been very popular. So another search engine which combines all these results? "Oh please, who's gonna look at that!" was my initial reaction.
Well, there's more to it.

When I told about how "www.google.com" redirects your browser to "www.google.co.in", I forgot to mention an important fact. The re-direction happens because Google knows where you are from! That means whenever you visit a Google site, it keeps track of you. Follows you.(like a "Hutch" pug) Suggests to you. Manipulates you. Isn't that something to be apprehensive about? You log onto a search engine to look up for something you need and in the process, you sell out information about yourself! Now its up to you to decide who's the smarter of you both.

where does DuckDuckGo come in?

This says it all. Quoted from their own site, "DuckDuckGo does not collect or share personal information. That is our privacy policy in a nutshell. "  Other search engines feed on the searches you make. Based on your searches, they identify you, mold you and make an identity for you. For example, you'll no longer be buying the things you need, but the things suggested to you. At DuckDuckGo, you can be completely anonymous. No one tracks you, nor does anyone interferes with your choice-selection. All users, irrespective of the fact that they are from India or Uganda, will be shown the same search results for a given search term.
Just Duck it!
I have changed my homepage to "www.duckduckgo.com". When are you going to change?
Remember, your privacy is your freedom. Use it well! ;)