Sad demise of Narendra Dabholkar

It was saddening to know that anti-superstition crusader Narendra Dabholkar was shot dead in Pune yesterday. Dr. Dabholkar had worked tirelessly in fighting against superstition. He founded the Maharashtra Andhashraddha Nirmoolan Samiti, wrote several books, had given countless talks against these practices and worked really hard in tabling anti-superstition and black magic bill in Maharashtra Assembly.

Here are some videos of Dr. Dabholkar to give a glimpse into his personality and work:

Why doesn't amazon allow me to add a donation to some charity when the items that I want to buy qualifies for "Free super saver shipping", but do not quite add up to $25. It makes me search for some other junk item that I don't want just to qualify for free shipping.

Quora answers “Brilliant” problem

Came across this question on Quora (Quora is an infinite time sink BTW!) The original question is at https://brilliant.org/i/ge9jJs/

Wonder why people post puzzle-type questions on Quora!

Anyway, the highest ranked answer gives a nice way to approach the problem. I would not be able to think that way and just used the brute-force:
Here is the ruby code to solve it:

def testit(a)
  (x,y,z)= a/100%10,a/10%10,a%10
  return a == x*x+y*y+z*z + 543
end

q=(111..999).select{|q| testit(q)}
q.reduce(:+)

The answer is 2626, the last 3 digits being 626.

HTML5 Up and Running

HTML5 Up and RunningHTML5 Up and Running is Mark Pilgrim's book on HTML5. The entire text of the book is also available at DiveintoHTML5.org. Just like the other books written by Mark (Dive into Python, Greasemonkey Hacks), this book will serve as a very comprehensive introduction to the topic.

The book begins with history of HTML specification starting from conversations on www-talk mailing lists to formation of W3C and to WHAT Working Group. Then it moves on to Feature Detection, high level view of new features - canvas, video, Storage, Web Workers, Geolocation. The next chapter is a dive into details of the Document elements, new semantic elements. The next few chapters cover in detail each of the new features - Canvas, Video & Audio, Geolocation, Local Storage, Offline applications, Form semantics, Microdata. Each of these later chapters can be read stand-alone without depending on others.

There are some open source projects mentioned in the book - Modernizr for HTML5 feature detection, geo.js for smoothing out differences over gelolocation APIs. These pointers should be of great value to developers.

The book website is itself a great study in HTML5 with its very detailed attention to live examples, typography. Great work by Mark once again and kudos to O'Reilly for allowing full version (which is in fact more up-to-date than the printed book) online and also for selling the ebook in DRM free formats!

Disclaimer: I am writing this post as a part of Blogger Review program. I am not being paid to write this review. But I received the ebook free for doing this.

twitter auto refresh

Google chrome - CTRL+SHIFT+J to open javascript console. Type the following line there...

function updateIT(){$('#new-tweets-bar,.new-tweets-bar').click();setTimeout(updateIT, 1000);}updateIT();

Update: Here is a small extension if you are on google chrome (or using Firefox with greasemonkey installed).

Update (2013-01-15): Playing with twitter is a cat and mouse game! Here is what works as of today:
window.setInterval(function(){$(".js-new-tweets-bar").click();},10000);

Google Finance bookmarklet

I use Google Finance to track stock/fund portfolios. Many of these portfolios track some investment policies and I enter the actual trades in there too. But the portfolios keep showing the old (i.e. closed) positions in the table making it look cluttered. I checked on their product blog/forum and this seems to be requested by some people (and ignored). Here is a small bookmarklet which will do this. You will need to drag the link to your bookmarks bar (Tested only with google chrome). Next, when you are on the google portfolio page, just click on the bookmark and it will hide all the closed positions! Woohoo!

Drag this link to Bookmarks bar: GFinance: Hide Closed Positions

P.S. If there is interest, I can turn this into a google chrome extension (greasemonkey) so this gets done automatically when you go to google portfolios page.

Book Notes – The Investor’s Manifesto – by William J. Bernstein

Cover Art - Amazon
Just finished reading a book by one of my favorite personal finance authors: William Bernstein. It appears that with every book he writes, he is making them easier to read and addressed to broader audience. In this book, he uses the recent financial "meltdown" as a "teachable moment".

Chapter 1 - A Brief History of Financial Time

  • Throughout history, there have always been providers and consumers of capital; today it is no different.
  • Also throughout history, that capital has taken two basic forms: loans (including bonds) and equity (partnership or stock). The latter has a lower legal standing than the former, and it is thus riskier and necessitates a higher long-term return to attract investors.
  • During times of great social, political, and military turbulence, the prices of both stocks and bonds usually decline precipitously. Most often, this sets the stage for high future returns. Less frequently, however, the losses can be permanent and even total. Financial history demonstrates vividly the fact that just because this has not happened in the U.S. stock and bond markets yet is no guarantee that it might not occur in the future.

Chapter 2 - The Nature of the Beast

(To be completed)

 

Derek Sivers has a great page on this book. Refer to it for more details. I recommend this book to any investor.

Restoring Send, Menu, Home keys on your HTC mytouch android phone

I had this frustrating experience before on my android phone (HTC MyTouch 3G). This usually happens after powering on the phone after some time, it does not respond to the physical keys like "Send", "back", "home", "menu". The keyboard lock pattern is gone and you just cannot seem to lock the phone and you need to use the dialer application to make a call! The last time this happened, the factory reset fixed it. But it's a pain trying to reinstall all of your apps and settings back on the phone. So this time I was determined to fix this somehow.

I called the customer service and convinced them to ship me a new phone. Which is nice, but I will still need to reinstall all the apps again. I just searched the forums to see if there is a solution and it seems there is! Unfortunately, many people still seem to have the issue, so this hopefully helps someone.

Basically you need to fool your phone to run the setup wizard that is automatically run when you get your phone. Somehow this kicks out the bug that disables these buttons! But there is no way you can find that wizard (maybe it is possible to launch it somehow from the filesystem, but I don't know how to do that). But this is a way to do that:

  • Go to android market and search for the application Anycut and install it. (This application allows you add a shortcut to any activity on the home screen, so it is good to have it anyway.) (Or scan this QR code: Anycut Android Application
  • On the home screen, long press and add  "Shortcuts" to add to home screen. Choose Anycut from the list.
  • Choose Activity and scroll through the long list of activities.
  • Select "Setup Wizard". I had three of them in the list, third one worked for me. (Thanks Mr. Murphy). You might want to try all of them. (First one is for enabling Google Location, second for "Backing up settings to google account and third for Initial Setup)
  • It will prompt you to edit the name of the shortcut, you can just accept the default and select it from the home screen and complete through all the screens (use the same google account as you are using).
  • Your keys should now be magically working!

The problem might be happening because of some hardware issues (bad internal flash?), but its good to know that it's possible to fix it without factory reset.

Mahishasur Mardini Stotra

Courtesy: http://carnatica.net/lyrics/mahishasuramardini.doc


Audio Download/Listen.
Devanagari

English

In Devanagari:

अयि गिरिनन्दिनि नन्दितमेदिनि विश्वविनोदिनि नन्दनुते
गिरिवर विन्ध्य शिरोधिनिवासिनि विष्णुविलासिनि जिष्णुनुते |
भगवति हेशितिकण्ठकुटुंबिनि भूरि कुटुंबिनि भूरि कर्ते
जय जय हे महिषासुरमर्दिनि रम्यकपर्दिनि शैलसुते  || १ ||
सुरवरवर्षिणि दुर्धरधर्षिणि दुर्मुखमर्षिणि हर्षरते
त्रिभुवनपोषिणि शङ्करतोषिणि किल्बिषमोषिणि घोषरते |
दनुज निरोषिणि दितिसुत रोषिणि दुर्मद शोषिणि सिन्धुसुते जय
जय हे महिषासुरमर्दिनि रम्यकपर्दिनि शैलसुते  || २ ||
अयि जगदंब मदंब कदंब वनप्रिय वासिनि हासरते
शिखरि शिरोमणि तुङ्ग हिमालय शर्ङ्ग निजालय मध्यगते |
मधु मधुरे मधु कैटभ गञ्जिनि कैटभ भञ्जिनि रासरते
जय जय हे महिषासुरमर्दिनि रम्यकपर्दिनि शैलसुते || ३ ||
अयि शतखण्ड विखण्डित रुण्ड वितुण्डित शुण्ड गजाधिपते
रिपु गज गण्ड विदारण चण्ड पराक्रम शुण्ड मर्गाधिपते |
निज भुज दण्ड निपातित खण्ड विपातित मुण्ड भटाधिपते
जय जय हे महिषासुरमर्दिनि रम्यकपर्दिनि शैलसुते  || ४ ||
अयि रण दुर्मद शत्रु वधोदित दुर्धर निर्जर शक्तिभर्ते
चतुर विचार धुरीण महाशिव दूतकर्त प्रमथाधिपते |
दुरित दुरीह दुराशय दुर्मति दानवदूत कर्तान्तमते
जय जय हे महिषासुरमर्दिनि रम्यकपर्दिनि शैलसुते  || ५ ||
अयि शरणागत वैरि वधूवर वीर वराभय दायकरे
त्रिभुवन मस्तक शूल विरोधि शिरोधि कर्तामल शूलकरे |
दुमिदुमि तामर दुन्दुभिनाद महो मुखरीकर्त तिग्मकरे
जय जय हे महिषासुरमर्दिनि रम्यकपर्दिनि शैलसुते  || ६ ||
अयि निज हुङ्कर्ति मात्र निराकर्त धूम्र विलोचन धूम्र शते
समर विशोषित शोणित बीज समुद्भव शोणित बीज लते |
शिव शिव शुंभ निशुंभ महाहव तर्पित भूत पिशाचरते
जय जय हे महिषासुरमर्दिनि रम्यकपर्दिनि शैलसुते  || ७ ||
धनुरनु सङ्ग रणक्षणसङ्ग परिस्फुर दङ्ग नटत्कटके
कनक पिशङ्ग पर्षत्क निषङ्ग रसद्भट शर्ङ्ग हतावटुके |
कर्त चतुरङ्ग बलक्षिति रङ्ग घटद्बहुरङ्ग रटद्बटुके
जय जय हे महिषासुरमर्दिनि रम्यकपर्दिनि शैलसुते  || ८ ||

जय जय जप्य जयेजय शब्द परस्तुति तत्पर विश्वनुते
भण भण भिञ्जिमि भिङ्कर्त नूपुर सिञ्जित मोहित भूतपते |
नटित नटार्ध नटीनट नायक नाटित नाट्य सुगानरते
जय जय हे महिषासुरमर्दिनि रम्यकपर्दिनि शैलसुते  || ९ ||
अयि सुमनः सुमनः सुमनः सुमनः सुमनोहर कान्तियुते
श्रित रजनी रजनी रजनी रजनी रजनीकर वक्त्रवर्ते |
सुनयन विभ्रमर भ्रमर भ्रमर भ्रमर भ्रमराधिपते
जय जय हे महिषासुरमर्दिनि रम्यकपर्दिनि शैलसुते  || १० ||
सहित महाहव मल्लम तल्लिक मल्लित रल्लक मल्लरते
विरचित वल्लिक पल्लिक मल्लिक भिल्लिक भिल्लिक वर्ग वर्ते |
सितकर्त पुल्लिसमुल्ल सितारुण तल्लज पल्लव सल्ललिते
जय जय हे महिषासुरमर्दिनि रम्यकपर्दिनि शैलसुते  || ११ ||
अविरल गण्ड गलन्मद मेदुर मत्त मतङ्गज राजपते
त्रिभुवन भूषण भूत कलानिधि रूप पयोनिधि राजसुते |
अयि सुद तीजन लालसमानस मोहन मन्मथ राजसुते
जय जय हे महिषासुरमर्दिनि रम्यकपर्दिनि शैलसुते  || १२ ||
कमल दलामल कोमल कान्ति कलाकलितामल भाललते
सकल विलास कलानिलयक्रम केलि चलत्कल हंस कुले |
अलिकुल सङ्कुल कुवलय मण्डल मौलिमिलद्भकुलालि कुले
जय जय हे महिषासुरमर्दिनि रम्यकपर्दिनि शैलसुते  || १३ ||

कर मुरली रव वीजित कूजित लज्जित कोकिल मञ्जुमते
मिलित पुलिन्द मनोहर गुञ्जित रञ्जितशैल निकुञ्जगते |
निजगुण भूत महाशबरीगण सद्गुण संभर्त केलितले
जय जय हे महिषासुरमर्दिनि रम्यकपर्दिनि शैलसुते  || १४ ||
कटितट पीत दुकूल विचित्र मयूखतिरस्कर्त चन्द्र रुचे
प्रणत सुरासुर मौलिमणिस्फुर दंशुल सन्नख चन्द्र रुचे |
जित कनकाचल मौलिपदोर्जित निर्भर कुञ्जर कुंभकुचे
जय जय हे महिषासुरमर्दिनि रम्यकपर्दिनि शैलसुते  || १५ ||
विजित सहस्रकरैक सहस्रकरैक सहस्रकरैकनुते
कर्त सुरतारक सङ्गरतारक सङ्गरतारक सूनुसुते |
सुरथ समाधि समानसमाधि समाधिसमाधि सुजातरते
जय जय हे महिषासुरमर्दिनि रम्यकपर्दिनि शैलसुते  || १६ ||
पदकमलं करुणानिलये वरिवस्यति योऽनुदिनन स शिवे
अयि कमले कमलानिलये कमलानिलयः स कथं न भवेत |
तव पदमेव परंपदमित्यनुशीलयतो मम किं न शिवे
जय जय हे महिषासुरमर्दिनि रम्यकपर्दिनि शैलसुते  || १७ ||
कनकलसत्कल सिन्धु जलैरनु सिञ्चिनुते गुण रङ्गभुवं
भजति स किं न शचीकुच कुंभ तटी परिरंभ सुखानुभवम |
तव चरणं शरणं करवाणि नतामरवाणि निवासि शिवं
जय जय हे महिषासुरमर्दिनि रम्यकपर्दिनि शैलसुते  || १८ ||
तव विमलेन्दुकुलं वदनेन्दुमलं सकलं ननु कूलयते
किमु पुरुहूत पुरीन्दुमुखी सुमुखीभिरसौ विमुखीक्रियते |
मम तु मतं शिवनामधने भवती कर्पया किमुत क्रियते
जय जय हे महिषासुरमर्दिनि रम्यकपर्दिनि शैलसुते  || १९ ||
अयि मयि दीनदयालुतया कर्पयैव त्वया भवितव्यमुमे
अयि जगतो जननी कर्पयासि यथासि तथाऽनुमितासिरते |
यदुचितमत्र भवत्युररि कुरुतादुरुतापमपाकुरुते
जय जय हे महिषासुरमर्दिनि रम्यकपर्दिनि शैलसुते  || २० ||
|| इति श्रीमहिषासुरमर्दिनिस्तोत्रं संपूर्णम  ||

In English :

ayi girinandini nanditamedini vishvavinodini nandanute

girivara vindhya shirodhinivAsini viShNuvilAsini jiShNunute |

bhagavati heshitikaNThakuTuMbini bhUri kuTuMbini bhUri k.rte

jaya jaya he mahiShAsuramardini ramyakapardini shailasute  || 1 ||

suravaravarShiNi durdharadharShiNi durmukhamarShiNi harSharate

tribhuvanapoShiNi shaN^karatoShiNi kilbiShamoShiNi ghoSharate |

danuja niroShiNi ditisuta roShiNi durmada shoShiNi sindhusute jaya

jaya he mahiShAsuramardini ramyakapardini shailasute  || 2 ||

ayi jagadaMba madaMba kadaMba vanapriya vAsini hAsarate

shikhari shiromaNi tuN^ga himAlaya sh.rN^ga nijAlaya madhyagate |

madhu madhure madhu kaiTabha ga~njini kaiTabha bha~njini rAsarate

jaya jaya he mahiShAsuramardini ramyakapardini shailasute || 3 ||

ayi shatakhaNDa vikhaNDita ruNDa vituNDita shuNDa gajAdhipate

ripu gaja gaNDa vidAraNa caNDa parAkrama shuNDa m.rgAdhipate |

nija bhuja daNDa nipAtita khaNDa vipAtita muNDa bhaTAdhipate

jaya jaya he mahiShAsuramardini ramyakapardini shailasute  || 4 ||

ayi raNa durmada shatru vadhodita durdhara nirjara shaktibh.rte

catura vicAra dhurINa mahAshiva dUtak.rta pramathAdhipate |

durita durIha durAshaya durmati dAnavadUta k.rtAntamate

jaya jaya he mahiShAsuramardini ramyakapardini shailasute  || 5 ||

ayi sharaNAgata vairi vadhUvara vIra varAbhaya dAyakare

tribhuvana mastaka shUla virodhi shirodhi k.rtAmala shUlakare |

dumidumi tAmara dundubhinAda maho mukharIk.rta tigmakare

jaya jaya he mahiShAsuramardini ramyakapardini shailasute  || 6 ||

ayi nija huN^k.rti mAtra nirAk.rta dhUmra vilocana dhUmra shate

samara vishoShita shoNita bIja samudbhava shoNita bIja late |

shiva shiva shuMbha nishuMbha mahAhava tarpita bhUta pishAcarate

jaya jaya he mahiShAsuramardini ramyakapardini shailasute  || 7 ||

dhanuranu saN^ga raNakShaNasaN^ga parisphura daN^ga naTatkaTake

kanaka pishaN^ga p.rShatka niShaN^ga rasadbhaTa sh.rN^ga hatAvaTuke |

k.rta caturaN^ga balakShiti raN^ga ghaTadbahuraN^ga raTadbaTuke

jaya jaya he mahiShAsuramardini ramyakapardini shailasute  || 8 ||

jaya jaya japya jayejaya shabda parastuti tatpara vishvanute

bhaNa bhaNa bhi~njimi bhiN^k.rta nUpura si~njita mohita bhUtapate |

naTita naTArdha naTInaTa nAyaka nATita nATya sugAnarate

jaya jaya he mahiShAsuramardini ramyakapardini shailasute  || 9 ||

ayi sumanaH sumanaH sumanaH sumanaH sumanohara kAntiyute

shrita rajanI rajanI rajanI rajanI rajanIkara vaktrav.rte |

sunayana vibhramara bhramara bhramara bhramara bhramarAdhipate

jaya jaya he mahiShAsuramardini ramyakapardini shailasute  || 10 ||

sahita mahAhava mallama tallika mallita rallaka mallarate

viracita vallika pallika mallika bhillika bhillika varga v.rte |

sitak.rta pullisamulla sitAruNa tallaja pallava sallalite

jaya jaya he mahiShAsuramardini ramyakapardini shailasute  || 11 ||

avirala gaNDa galanmada medura matta mataN^gaja rAjapate

tribhuvana bhUShaNa bhUta kalAnidhi rUpa payonidhi rAjasute |

ayi suda tIjana lAlasamAnasa mohana manmatha rAjasute

jaya jaya he mahiShAsuramardini ramyakapardini shailasute  || 12 ||

kamala dalAmala komala kAnti kalAkalitAmala bhAlalate

sakala vilAsa kalAnilayakrama keli calatkala haMsa kule |

alikula saN^kula kuvalaya maNDala maulimiladbhakulAli kule

jaya jaya he mahiShAsuramardini ramyakapardini shailasute  || 13 ||

kara muralI rava vIjita kUjita lajjita kokila ma~njumate

milita pulinda manohara gu~njita ra~njitashaila niku~njagate |

nijaguNa bhUta mahAshabarIgaNa sadguNa saMbh.rta kelitale

jaya jaya he mahiShAsuramardini ramyakapardini shailasute  || 14 ||

kaTitaTa pIta dukUla vicitra mayUkhatirask.rta candra ruce

praNata surAsura maulimaNisphura daMshula sannakha candra ruce |

jita kanakAcala maulipadorjita nirbhara ku~njara kuMbhakuce

jaya jaya he mahiShAsuramardini ramyakapardini shailasute  || 15 ||

vijita sahasrakaraika sahasrakaraika sahasrakaraikanute

k.rta suratAraka saN^garatAraka saN^garatAraka sUnusute |

suratha samAdhi samAnasamAdhi samAdhisamAdhi sujAtarate

jaya jaya he mahiShAsuramardini ramyakapardini shailasute  || 16 ||

padakamalaM karuNAnilaye varivasyati yo.anudinan sa shive

ayi kamale kamalAnilaye kamalAnilayaH sa kathaM na bhavet |

tava padameva paraMpadamityanushIlayato mama kiM na shive

jaya jaya he mahiShAsuramardini ramyakapardini shailasute  || 17 ||

kanakalasatkala sindhu jalairanu si~ncinute guNa raN^gabhuvaM

bhajati sa kiM na shacIkuca kuMbha taTI pariraMbha sukhAnubhavam |

tava caraNaM sharaNaM karavANi natAmaravANi nivAsi shivaM

jaya jaya he mahiShAsuramardini ramyakapardini shailasute  || 18 ||

tava vimalendukulaM vadanendumalaM sakalaM nanu kUlayate

kimu puruhUta purIndumukhI sumukhIbhirasau vimukhIkriyate |

mama tu mataM shivanAmadhane bhavatI k.rpayA kimuta kriyate

jaya jaya he mahiShAsuramardini ramyakapardini shailasute  || 19 ||

ayi mayi dInadayAlutayA k.rpayaiva tvayA bhavitavyamume

ayi jagato jananI k.rpayAsi yathAsi tathA.anumitAsirate |

yaducitamatra bhavatyurari kurutAdurutApamapAkurute

jaya jaya he mahiShAsuramardini ramyakapardini shailasute  || 20 ||

|| iti shrImahiShAsuramardinistotraM saMpUrNam  ||

Friendconnect recommendations module

I have been thinking about adding more "social" features to my song lyrics website. Have been looking at google friendconnect for some time and had added their initial friend-wall module. But that did not quite integrate well into the website.  There is an appeal to having people using whatever identity they have (google, yahoo, aol, openID), and use it to collaborate on other websites. The recommendations module works great on such listing websites. However I did not want to club all the recommendations into a single pool, instead I wanted to keep the recommendations for songs, movies and people separate from each other. The example code does not make this clear. This post just clarifies how to do that.

Step1: Go to Friendconnect and create the recommendations widget.

Step 2: In the generated code, change the view-params parameter for the google.friendconnect.container.renderOpenSocialGadget function to use a unique docId for each of your container. Use the same string in the aggregation gadget code and the recommendation button code.

You can see this in action on the lyricsindia.net pages where I have three different recommendations containers for songs, people and movies.

Default file sort order in DOS

This is just a quick tip - I use mp3 players mostly for listening to audio books. So when I rip the CDs, I take extra care to create properly named files. But recently I found out that the new mp3 player I got (Great product BTW to listen to mp3 files in your car FM radio; how can they pack so many features at such a low price?) was mangling the file sequence.

On investigation, I found that DOS sorts file names by creation date/time by default. To fix this problem, all you need to do is cut and paste all the files to a different directory. This probably resets the creation time to current time and the files are then sorted by the filename.

Hot, Flat and Crowded – Friedman’s new book

Hot, Flat and Crowded

After the success of "The World is Flat", Friedman turns to the negative effects of the globalization; the global warming and its the chilling consequences in his new book "Hot, Flat and Crowded - Why We Need a Green Revolution--And How It Can Renew America". He makes an argument that America needs a big problem to re-motivate itself. It was a dominant force in the industrial and information era. But as the world gets hotter -- due to greenhouse emissions by increasing spread of the technology, flatter -- due to IT and communications revolution and crowded -- due to population growth, America needs to provide leadership in providing sustainable solutions to the world.

The book gives a good insight into the global warming. Though I have been aware of the term, it was eye-opening because of the different examples and quotes. Friedman proposes many ideas, some of which are intriguing. e.g. establish a floor price of $5 per gallon on gasoline for next N years. This will motivate the alternative energy industries to accelerate their development of their technologies. (He also argues the government will get benefited (because of the tariff collected), but that point is debatable, because the oil-producing nations will immediately bump their prices up to extract the profits). He also dreams up some scenarios of energy technology companies coming up with energy dashboards to help you monitor and optimize your energy usage. There are some examples of how going green helps the US military gain an upper hand. (It seems a lot of money is spent by the military in air-conditioning! By building unconventional and greener bases, they reduce or eliminate the demand for transporting gasoline to the bases, thus saving money and the lives of people who transport the gasoline!)

Overall, I liked this book a lot. It surely increased my awareness to the global warming and taught me to look at all perspectives (including the negative externalities) of different alternatives.

Some links:

Book Notes – The Adventures of Johnny Bunko

Finished reading a new book The Adventures of Johnny Bunko by Dan Pink (whose previous book - A Whole New Mind I liked a lot).

This book is unique because it is made entirely of manga style cartoons and it has clear and simple career advice. Instead of listing down the key ideas, I will just embed a presentation by Garr which does a much better job of presenting the ideas (in the same manga style no less!)