Categories
Life

Curiosity and Exploration

You ask a question
ok, that is a lie!
You ask many questions!!
Always curious!
Always fascinated!
Reminds me to look
Reminds me there is so much left to explore
What should one explore?
How to choose?
Life is finite,
I guess some are able to figure out, and some remain lost,
But lets keep exploring, this and that and more, before the end comes.

Categories
Philosophy

Philosophy

My first encounter with philosophy was Buddhism in 2003. I stumbled upon Buddhism through a book. But, at that time I did not know that philosophy was a field in itself. Recently, for some reason, I have become interested in philosophy. Actually, it was my interest in history which led me to reading “The Story of Philosophy”. And, then I joined the introduction course on philosophy at Coursera.
What is philosophy? According to professor in Coursera – Good philosophy is the activity of working out the right way of thinking about the things that matter most to us. What a wonderful definition! Don’t we face situations in life where we wish we could think through things and take an appropriate decision.The professor also says that philosophy is fundamental –

This is because philosophy involves stepping back and examining the presuppositions of what you’re doing, or the questions you’re asking. What are those presuppositions? Are they the right ones?

In a way, philosophy seems like scientific thinking 🙂 Can we use philosophy to explore the IPL saga.

In last few weeks the betting scandal has rocked the IPL. Should IPL be banned? Why? Why IPL is so successful? Why people love watching T20? I prefer test match cricket anytime. Why do we watch sports? Should we go back to amateur era? Is any sport clean? Chess, my favorite game, is also facing crisis due to cheating by players using technology. So, is any sport completely clean? In fact, is any institution completely clean? Seems corruption is very much part of human organisations. The severity of corruption varies. To tackle corruption steps are taken. Some steps work, some don’t. So, IPL too has to take steps to clean the mess and carry on.

Philosophers ask various fundamental questions. Philosophy has some specific topics.

1) What is Knowledge? – Epistemology
2) What is morality? Is there a universal moral? – The Definition of Morality
3) Utilitarianism Utilitarianism is a theory in normative ethics holding that the proper course of action is the one that maximizes utility, specifically defined as maximizing happiness and reducing suffering
4) Most confusing is Metaphysics
5) Absurdism – From wikipedia, “In philosophy, “the Absurd” refers to the conflict between the human tendency to seek inherent value and meaning in life and the human inability to find any“. The ‘Myth of Sisyphus’ by Albert Camus is a famous work on absurdism. One can read the notes here – http://www.sparknotes.com/philosophy/sisyphus/

I end with this quote by Socrates, as mentioned in, ‘The Story of Philosophy’,

Do you then be reasonable and do not mind whether the teachers of philosophy are are good or bad, but think of Philosophy herself. Try to examine her well and truly; and if she be evil, seek to turn away all men from her; but if she be what I believe she is, then follow her and serve her, and be of good cheer.

Categories
Programming

Useful tools to analyse a website

SEO compatibility check – gives an overview of whats right and what can be improved
Google page speed insight – “PageSpeed Insights analyzes the content of a web page, then generates suggestions to make that page faster”
Yslow – Can add as extension to Firefox or Chrome
webpagetest.org
Pingdom
Optimize images
Markup Validation Service

Recently I used these tools (including Firebug) for a client’s WordPress based blog. The areas of improvement –

1) There was no caching of static assets – added max-age with conditional check (last-modified). Read this explanation
2) Scaling images – Do not scale images in HTML
3) Optimizing images – This helped a lot. Images were of much bigger size than needed to be.
4) Minimize HTTP requests – too many images, so one possible solution is CSS Sprites
5) Minification of js and css files

Categories
Life

Decoding the word 'discipline'

What is discipline? Is disciplined life the way to a better life? Was Mahatama Gandhi disciplined? Yes. Einstein? Don’t know. Were both successful? Yes, both believed in something and had courage to live their ideas.
I always thought discipline meant to have a structured life – rise early, do exercise, eat well, sleep early. Sounds boring! But most homo sapiens struggle through life without having the tools to live an enriched life.
As, M Scott says in , The Road less Traveled, inspired by Buddhism, ‘Life is difficult‘. And he goes on to say – ‘Discipline is the basic set of tools we require to solve life’s problems‘. These words caught my attention. And, I continued reading with enthusiasm. He suggests 4 tools – delaying of gratification, acceptance of responsibility, dedication to truth and balancing.

Delaying gratification is a process of scheduling the pain and pleasure of life in such a way as to enhance the pleasure by meeting and experiencing the pain first and getting it over with. It is the only decent way to live

We must accept responsibility for a problem before we can solve it. The difficulty we have in accepting responsibility for our behavior lies in the desire to avoid the pain of the consequences of that behavior. The entirety of one’s adult life is a series of personal choices.

What does a life of total dedication to truth mean? It means, first of all, a life of continuous and never-ending stringent self-examination.

Balancing is the discipline that gives us flexibility. The essence of this discipline of balancing is ‘giving up’. The pain of giving up is the pain of death, but death of the old is birth of the new.

Categories
Life

Decoding the word ‘discipline’

What is discipline? Is disciplined life the way to a better life? Was Mahatama Gandhi disciplined? Yes. Einstein? Don’t know. Were both successful? Yes, both believed in something and had courage to live their ideas.

I always thought discipline meant to have a structured life – rise early, do exercise, eat well, sleep early. Sounds boring! But most homo sapiens struggle through life without having the tools to live an enriched life.

As, M Scott says in , The Road less Traveled, inspired by Buddhism, ‘Life is difficult‘. And he goes on to say – ‘Discipline is the basic set of tools we require to solve life’s problems‘. These words caught my attention. And, I continued reading with enthusiasm. He suggests 4 tools – delaying of gratification, acceptance of responsibility, dedication to truth and balancing.

Delaying gratification is a process of scheduling the pain and pleasure of life in such a way as to enhance the pleasure by meeting and experiencing the pain first and getting it over with. It is the only decent way to live

We must accept responsibility for a problem before we can solve it. The difficulty we have in accepting responsibility for our behavior lies in the desire to avoid the pain of the consequences of that behavior. The entirety of one’s adult life is a series of personal choices.

What does a life of total dedication to truth mean? It means, first of all, a life of continuous and never-ending stringent self-examination.

Balancing is the discipline that gives us flexibility. The essence of this discipline of balancing is ‘giving up’. The pain of giving up is the pain of death, but death of the old is birth of the new.

Categories
Programming python

Exploring Counter and defaultdict in python collections

I needed to count frequency of items in a list. Given a list like below

some_data = ['a','b','v','c','l','c']

The ugly way was using the dictionary
[gist id=”5520902″]
The end result is
{'a': 1, 'c': 2, 'b': 1, 'l': 1, 'v': 1}

But we can use Counter which is much cleaner
[gist id=”5520864″]

Result –

Counter({'c': 2, 'a': 1, 'b': 1, 'l': 1, 'v': 1})

But, more elegant, as suggested in comments by Andy
[gist id=5567806]

And, another way is using defaultdict

[gist id=5520913]

Result

defaultdict(, {'a': 1, 'c': 2, 'b': 1, 'l': 1, 'v': 1})

You can read more here http://docs.python.org/2/library/collections.html