All posts by amit

First impressions on Google Wave

I was really looking forward to get a chance to play with Google Wave. If you have not heard about this, Google is experimenting with a new means of communication and collaboration (to destroy any remains of your unused time!). Watch the video of the demo from Google IO conference to get a feel for the technology.

The catch line is - How would email be if it is designed today ?

Being Google, they are fairly open about the entire technology.Google Wave is a collection of several components which work in concert to bring us this amazing way to collaborate and communicate. There is the wave server (which hosts the waves. Google provides an implementation and others are free to implement it in their own control), federation protocol (which is open specifications protocol and allows the servers to talk to each other), the client (typically your web browser which you use to interact with the wave server, but there is a sample text client and emacs based client in development as well!), the gadgets (small pieces of code that are embedded in documents and provide rich look and feel and additional functionality to the wave) and the robots (robot participants in the wave which can do cool things like correct spelling as you type, syntax highlight code while it is being pasted in the wave, translate language etc.)

I have spent some time in developing a robot called Nokar (meaning assistant or servant in Marathi/Hindi) which can do several things when invited to a conversation - Insert images based on specified keywords, translate text between a set of 20 languages among some other geeky functions. The intention was to learn about the robot protocol. I also created some pages which use the embed API. This allows any web page to embed a wave conversation (or a subset of it). I am also going to experiment with the Gadgets in the next few weeks. I will try to document my process in next few posts.

डिपाडी डिपांग

डिपाडी डिपांग डिचिबाडी डिपांग
इडिबाडी डिचिबाडी डिपांग ।२। ||ध्रु||

काळी माती निळं पानी हिरवं शिवार
ताज्या ताज्या माळव्याचा भुईला या भार
ज्वानीच्या या मळ्यामन्दी पिरतीचं पानी
बघायाला कवतिक आलं नाही कुनी
मळ्याला या मळेवाली भेटलीच नाय
अन् राणी माझ्या मळ्यामन्दी घुसशील काय ||१||

काकडीचा बांधा तुझा मिरचीचा तोरा
मुळ्यावानी कडू तरी रंग गोरा गोरा
लिंबावानी कांती तुझी विटावानी ओठ
टम्बाट्याचं गाल तुझे भेंडीवानी बोटं
काळजात मंडई तु मांडशील का
अन रानी माझ्या मळ्यामन्दी घुसशील का ||२||

नको गाऊ भाजीवाल्या पिरतीची गानी
शिळ्या शिळ्या भाजीवर शिंपडुन पानी
ओसाड्याच्या गावी तुझा ओसाडाच मळा
गुलाबाला सोसवना उन्हाळ्याच्या झळा
strawberry ला कांदा कधी शोभनार नाही ||३||

तुझ्यासाथी जिवाराची केली मशागत
खुरपला जीव दिलं काळजाचं खत
राखायला मळा केली डोळ्याची या वात
बुजगावन्या च्या परी उभा दिन रात
नको जळू दिन रात नको जीव टांगू
ठाव हाय मला सारं नको काही सांगू
पिरतीत राज्या तुझ्या नाही काही खोड
तुझ्या हाती मिरचीबी लागतीय गोड
माज्यासंग मळा तुझा कसशील काय ||४||

Video Link!

Book Notes – The New Coffeehouse Investor

This is the second edition of The Coffeehouse Investor. I had really liked the first edition and I dug this up to see what has changed.

This book is all about three lifelong principles:
1. Don't put all your eggs in one basket - Diversify your assets to maximize the chances of reaching your financial goals with minimum risk. (Asset Allocation)
2. There is no such thing as free lunch - Markets are efficient. If you find an investment with better returns, it comes with more risk. (Approximate market averages - indexing)
3. Save for rainy day - It's important to save more than rely on unusual investment returns.

The author stresses the importance of these principles and then advises you to ignore the Wall Street and get on with your life!

Trivia:

Fun with microsoft “bing”

Bing (the microsoft way of googling information) has gone live today! Seems nice and googly! Had some fun with the search suggestions: type linux in the search box (but don't press enter). Watch all the suggestions :)

Seems like they are making AJAX request to http://api.search.live.com/qson.aspx?query=linux every second or so for anything that is typed and it returns those wonderful unbiased suggestions.

It sounds like they are trying to do more than just running the search query, like adding their own interpretation to the query, organizing results, paying you money (i.e. if you buy something using the search links). I haven't seen anything here that Google does not already have (or cannot implement very quickly) i.e. except for the cash-back bait. So let's see how this goes.

RSS Feeds for Indian Columnists

Frustrated by Indian Express's inability to provide individual syndication feeds for its columnists, I have written scripts to parse the HTML pages and generate the feeds myself.

Here are the feeds for
Shekhar Gupta
Tavleen Singh.
R. Jagannathan (DNA India)
Arun Shourie
Sudheendra Kulkarni
Ila Patnaik
Pratap Bhanu Mehta

If you want this for another columnist, let me know and I will add that too. This is very easy to do for Indian Express columnists as I already have the script, but I can also help with other websites.

P.S. The script is in ruby and I will release the source after I fix some things and clean it up some more.

Update: May 29, 2009
Added new feeds for Arun Shourie, Sudheendra Kulkarni and Ila Patnaik

Update: June 22, 2009 - Added columns feed for R. Jagannathan of DNA India

Update: August 11, 2009 - Feeds for C. Rajamohan , Harsha Bhogle , Shailaja Bajpai.

Update: Sept. 10, 2009 - You can use my shared page from Google Reader to see all the new posts from all of these columnists on a single page.

Update: July 18, 2011 - Added Karan Thapar.

Simple way to share files on intranet.

If you want to download files from machine A to machine B and have python installed on machine A, here is a very simple way to do it:

On machine A, open a command window and change directory to where the files are and run this command:

python -m SimpleHTTPServer

This command starts a web server serving files from that directory.

On machine B, just open a browser and type the ip address of machine A and port 8000 and you can see all the files. When the transfer is done, simply press control-C in the command window. A simple way to temporarily share your files across the network!

Seminar: Lars Ekman – EVP & President Global R&D – elan

From Rags to Riches and back again - 7 Year Learning Experience with eLan
History -
Deal driven
Cash Flow - Drug Delivery

Acquisitions - 22 companies in 2.5 years
Model - JV between Biotech and elan which will buy IP from elan using money from elan!

MS Tysabri Tlymphosites
reverse memory loss on cover of nature December 2000 (big achievement)

Perfect Storm brewing!
Enron, SEC investigation, Halt Trials Generic Threat, Critical WSJ Article

Share Price - $62 - $1.30 (Market cap 24 B to 400 mill) had 4B debt (looks okay for 24B company, but not for 400 mill company)

Recovery
New management
Debt Reduction - 2.4B from asset divesture, 1.2B LT convertible Debt
Headcount reduction - 5400 to 1800
Cost Reductions

Tysabri got FDA approval. filed MAA

New Challenges
Cox2 Congressional Hearings. Two adverse events.

Share Price: 29-3 11.5 - 2.6 Billion

New Trials
Approval by EV and VS
AD - phase 3
Market Cap 11 B

Lessons Learned:
1. Maximum Transparency - dispense all bad news at once
2. Delineate Facts from opinions
3. Select Data Setets? (Monitoring Board w/ease)
4. Don't look back - Address next 3 steps.
5. Don't look down

Date: 11/16/2007

opml to csv converter

This is a first step in being able to make all  my  planets    configurable from anywhere. The following ruby script parses the opml file specified on the command line and generates a comma separated file with XML feed URL and feed title. In case of nested outline elements, it just picks the elements which actually have xmlUrl attribute (this will flatten the opml hierarchy which is used by google reader - for implementing labels and bloglines - for implementing folders)

require 'csv'
require "rexml/document"
include REXML
if ARGV.length >=1
fname = ARGV[0]
else
fname = "opml.xml"
end

doc = Document.new File.new(fname)
CSV.open('csvfile.csv', 'w') do |writer|
doc.elements.each("//outline[@type='rss']") {|element|
writer < <  [element.attribute("xmlUrl").value, element.attribute("text").value]
}
end

Hridaynath Mangeshkar in Los Angeles

Had the pleasure of attending the live concert of Pandit Hridaynath Mangeshkar (Feb 21, 2009). It was a blast - with Panditjee's rendition of the memorable songs that he has composed and sung (in some cases). There were around 400 people attending and still it had a feel of a private mehfil with Panditjee responding to farmaish for most of the concert. He also broke into the background stories of each of the songs and the people behind the magic of them. He also showed his typical tricks like making plenty of fun of the Marathi Mandal's secretary and testing the local singer by starting out the opening lines of the duets in different scales :-)

Here is a list of all the songs in sequence: (The video links are not the videos from the program, but just links to youtube videos of the same song)

  1. Gagan Sadan Tejomay - गगन सदन तेजोमय (Video)
  2. Tu tevha tashi - तू तेव्हा तशी (Video)
  3. Sarja Raja - सर्जा राजा (Video)
  4. Sunya Sunya Maifilit majhya - सुन्या सुन्या मैफ़िलीत माझ्या (Video)
  5. Ti Geli Tevvha Rimjhim - ती गेली तेव्हा रिमझिम पाऊस निनादत होता (Video)
  6. Jambhul Piklya Zada khali - जांभुळ पिकल्या झाडाखाली (Video)
  7. Yaara Seeli Seeli - यारा सीली सीली (Video)
  8. Gorya Dehavarati Kanti - गोर्‍या देहावरती कांती (Audio)
  9. Ne Majasi Ne Parat Matrubhumila - ने मजसी ने परत मात्रुभुमीला (Video)
  10. Valhav Re Nakhava - वल्हव रे नाखवा (Video)
  11. Daya Ghana - दया घना (Video)
  12. Runu Jhunu Re Bhramara - रूणू झूणू रूणू झूणू रे भ्रमरा (Video)
  13. Sarnar kadhi raN Prabho - सरणार कधी रण प्रभो Video
  14. Shur amhi sardar - शूर आम्ही सरदार आम्हाला Video
  15. Vedat marathe veer doudale saat - बेडात मराठे वीर दौडले सात Video
  16. kevha tari pahate - केव्हा तरी पहाटे (Video)
  17. malavoon taak deep - मालवून टाक दीप (Video)
  18. chandanyat phiratana - चांदण्यात फिरताना (Video)
  19. Mee maj harapun basale - मी मज हरपून बसले (Video)
  20. Jivalagaa - जिवलगा (Video)

Password protect GNU screen sessions

Or, How do i get a crypted password for .screenrc ?

Here is a quick tip, hopefully it helps someone, I struggled with this for some time...

I have been using GNU screen program since a long time. This program is like a window manager for terminals and is especially useful for ISP and home shell accounts. You can have multiple shells running under the same session and can easily detach the sessions and reattach them from a different computer later etc.

I usually password protect my sessions by using the password command (ctrl A :password). But I had a hard time figuring out how to set that password in .screenrc file. The file obviously does not store it in plaintext and uses a crypted version of password. To get the crypted password, simply set your password in the screen session (ctrl A :password and then enter the password twice), then the crypted version gets automatically saved to screen's copy buffer! All you need to do is have a line in your .screenrc which looks like this
password DTWxS2voQWkgI

After this all your new screen sessions will be automatically password protected (meaning you will need the password to reattach a session.)

Sony Bravia Internet Link Unofficial API

Some notes from experimenting with my new toy!

The device (DMX) plugs into HDMI port of the TV and has its own HDMI input allowing pass-through. The control of DMX is done from a USB cable which is attached from the TV to DMX (Wonder why they do not use the HDMI for that!). DMX has an ethernet port which can get autoconfigured using DHCP (or can also be configured for manual settings from the TV). Sony has licensed a lot of content providers (slacker for radio and tons of other video providers like youtube, Amazon, Yahoo, Blip.tv). They have a portal (http://internet.sony.tv/) which allows you to add your own video links and some browser extensions which allow you to link your favorite videos which the DMX can then play for you. The firefox extension unfortunately requires older (2.X) version of firefox and does not work with newer versions (3.X). I tweaked that extension and it now works okay without significant changes. Here is a link to it. This extension adds a context menu to firefox and you can use it to direct the DMx to start playing the linked video, bookmark it etc. The caveats are that the link needs to be a raw video file (mp4, mov, avi, divx etc.) and not HTML file or any other kind.

Here is what I learned from reverse engineering the extension code.

The DMX runs a primitive web browser on port 9784. The server is reportedly called "Callisto Debug Server v0.2". There is a php script running which responds to URLs like the following
Send commands using the following REST API:

http://192.168.0.101:9784/renderer.php?method=play&url={encoded URL}

The firefox and internet explorer generates these URL's.

Here is what I gathered from the extension code about the API:

Available commands and arguments:

  • play (url => encoded URL to mp4, AVI, MOV file to play)
  • pause
  • stop
  • addbookmark (title=> encoded bookmark title, description=>encoded description, icon => ???, source =>encoded URL)

It seems to play the mp4 files quite well (I had good success with HD mp4 links from youtube and dailymotion websites which have a lot of bollywood movies). The streaming is very smooth and video quality is acceptable. You can use a website like http://keepvid.com/ to see the hidden video links. These links are then directly playable by DMX. I will experiment with AVI, MOV, DIVX files next...

Next step for me is to create a simple webservice which does all of these steps and posts the link to the DMX! Can't wait till I can manage to do that...

बाल विहार प्रार्थना

To play the file, click on the small triangle before the name. (needs javascript and flash plugin)
To download the file, right click on file name and select “Save Link As” or “Save Target As”

१ एकदन्तम्‌ महाकायं लम्बोदर गजाननम्‌ ।
विघ्ननाशकरम्‌ देवं हेरम्बं प्रणमाम्यहम्‌ ॥
(Ekadantam mahakayam lambodaragajananam
Vighnanashkaram devam herambam pranamamyaham)

O Lord Ganesha, who has a single tusk, mighty body, pendant bellied,
I pray to Thee Oh Lord, to remove the obstacles from all actions I intend to perform

२ गुरूर्ब्रह्मा गुरूर्विष्णु: गुरूर्देवो महेश्वर:।
गुरूरेव परं ब्रह्म तस्मै श्रीगुरवे नम:॥
( Gurur Brahmaa Gurur Vishnuh Gurur Devo Maheshvarah;
Gurureva param Brahma tasmai Shree Guruve namah)

Gurur Brahma Gurur Vishnu Audio

Guru is Brahma, guru is Vishnu, guru is Lord Maheshwara; guru is the visible
supreme divinity incarnate, salutation to that guru.

३ सरस्वति नमस्तुभ्यं वरदे कामरूपिणि ।
विद्यारंभं करिष्यामि सिद्धिर्भवतु मे सदा ॥

(Sarasvati namastubhyam varade kaamaroopini
Vidyaarambham karishyami siddhir bhavatu me sadaa)

Salutation to you, O Saraswati, grantor of blessings and embodiment of all wishes;
I am getting inducted to studies, may there be fulfilment for me forever.

४ कराग्रे वसते लक्ष्मी: करमध्ये सरस्वती ।
करमूले तु गोविन्दम्‌ प्रभाते करदर्शनम्‌ ॥

(Karaagre vasate Lakshmi, karamadhye Sarasvatee
Karamoole tu Govindam prabhaate karadarshanam)

Karagre Vasate Laxmi Audio

At the fore of the hands resides Lakshmi, and at the middle, Saraswati;
at the root is seated Gauri, (so) see the palm of the hand at dawn (first).

शांति मंत्र
ॐ सह नाववतु सह नौ भुनक्तु, सह वीर्यं करवावहै ।
तेजस्वि नावधीत्मस्तु मा विद्विषावहै ॥
ॐ शान्ति: शान्ति: शान्ति: ॥

Shanti Mantra (Om saha naavavatu saha nau bhunaktu saha veeryam karavaavahai
Tejasvinaavadheetamastu maa vidvishaavahai,
Om Shaantih, Shaantih, Shaantih.)

May he protect us both—the teacher and the taught. May he nourish us both.
May we acquire more strength (from knowledge).
May our study be enlightened and may we not dislike each other.

६ सर्वे भवन्तु सुखिन: सर्वे सन्तु निरामय: ।
सर्वे भद्राणि पश्यन्तु मा कश्चिद्‌ दु:खभाग्‌ भवेत्‌ ॥

(Sarve bhavantu sukhinah, sarve santu niraamayaah;
Sarve bhadrani pashyantu, maa kashchid duhkhabhaag bhavet.)

Oh Loard in Thee may all be Happy, may all be free from misery
May all realise goodness and may no one suffer pain.

गायत्री मंत्र

ॐ भूर्भुव: स्व:।
ॐ तत्सवितुर्वरेण्यं भर्गो देवस्य धीमहि।
धियो यो न: प्रचोदयात्‌ ॥ ॐ ॥

Gayatri Mantra
(Om bhur bhuvas suvaha, Om tat savitur vareNyaM, bhargo devasya dhimahi
Dhiyo yo nah prachodayaata, Om.)

Listen to ॐ भूर्भुव: स्व:
We meditate on the glory of the Creator, ; Who has created the Universe;
Who is worthy of Worship; Who is the embodiment of Knowledge and Light;
Who is the remover of all Sin and Ignorante; May He enlighten our Intellect.

८ ॐ पूर्णमद: मूर्णमितं पूर्णात्पूर्णमुदच्यते ।
पूर्णस्य पूर्णमादाय पूर्णमेवावशिष्यते ॥

(Om poornamadah poornamidam poornat poornamudachyate
Poornasya poornamadaaya poornamevaavashishyate.)

That (pure consciousness) is full (perfect); this (the manifest universe of matter;
of names and forms being maya) is full. This fullness has been projected
from that fullness. When this fullness merges in that fullness, all that
remains is fullness.

महा मृत्युंजय मंत्र
ॐ त्र्यंबकं यजामहे सुगन्धिं पुष्टिवर्धनम्‌।
उर्वारूकमिव बंधनान् म्रूत्योर्मुक्षीयमाम्रुतात्‌॥

Maha Mrutyunjay Mantra
(Om Tryambakam yajaamahe sugandhim pushtivardhanam
Urvarukamiva bandhanaat mrutyor mukshiya maamrutaata.)

Om. We worship the three-eyed One (Lord Shiva) Who is fragrant and
Who nourishes well all beings; may He liberate us from death for the sake of
immortality, even as the cucumber is severed from its bondage (to the creeper).

१० असतो मा सत्‌ गमय। तमसो मा ज्योतिर्गमय।
म्रुत्योर्माऽ म्रुतं गमय। ॐ शान्ति: शान्ति: शान्ति: ॥

(Asato Maa sat gamaya, tamaso maa jyotir gamaya
mrityor maa amrutam gamaya, Om Shaantih, Shaantih, Shaantih.)

O Lord, please lead me from unreal to real. Please lead me from darkness to light.
(i.e. from ignorante to knowledge). Lead me from death to immortality.

११ वक्रतुण्ड महाकाय सुर्यकोटी समप्रभ ।
निर्विघ्नम कुरुमे देव सर्व कार्येषु सर्वदा ॥

(Vakratunda mahaakaaya suryakoti samaprabhaa
Nirvighnam kurumedeva sarvakaryeshu sarvadaa)

Vakratunda Mahakaya Audio

O god with the twisted trunk, broad-bodied, brilliant as thousand suns, bless me with
freedom from obstructions and hindrances in all my works and for all times.

१२ ओंकारम्‌ बिंदुसंयुक्तम्‌ नित्यं ध्यायन्ति योगिन:।
कामदं मोक्षदं चैव ओंकाराय नमो नम:॥

(Aumkaaram bindusanyuktam, nityan dhyayanti yoginah;
Kaamadam mokshadam chaiva, aumkaaraaya namo namah.)

Yogis meditate forever on Aumkara associated with the Bindu, salutation to the
Aumkara, the grandor of wishes and salvation.

१३ कायेन वाचा मनसेंद्रियैवा बुध्यात्मना वा प्रक्रुते: स्वभावात्‌।
करोमि यद्यत्‌ सकलं परस्मै नारायणायेति समर्पयामि ॥

(kaayena vaachaa manasendriyairva, budhyatmanaa vaa prakruteh swabhaavaat;
Kaaromi yadyat sakalam parasmai, naaraayanaayeti samarpayaami.)

Whatever I do either by body, speech, mind or sensory organs, either with my personal
knowledge or natural trait, I surrender and submit all to that supreme divine Narayana.

१४ त्वमेव माता पिता त्वमेव त्वमेव बन्धुश्च सखा त्वमेव।
त्वमेव विद्या द्रविणं त्वमेव त्वमेव सर्वं मम देवदेव ॥

(Tvameva maataa cha pitaa tvameva, tvameva bandhushcha sakhaa tvameva;
Tvameva vidyaa dravinam tvameva, tvameva sarvam mama devadeva.)

You are the mother, you are the father, you are the relative, you are the friend,
you are education, you are wealth, you are everything for me, O Lord, O Lord.

१५ शुभं करोति कल्याणं आरोग्यं धनसंपद: ।
शत्रु बुद्धि विनाशाय दीपज्योति: नमोऽस्तुते ॥

(Shubham karoti kalyanam, aarogyam dhanasampadah;
Shatru budhhi vinaashaaya, deepajyotih namoostu te.)

The grantor of auspices, welfare, health, wealth and prosperity, salutation to you
O flame of the lamp, for the destruction of the thought of enmity.

Did wordpress upgrade destroy all your unicode posts ?

I upgraded wordpress software for this blog to version 2.5.2. After that none of the posts that had devanagari (unicode) text looked okay. After comparing the configuration files, I discovered that the troubling variable is DB_CHARSET. The default config setting is 'utf8'. But if you have been updating the software versions, your database table is probably in 'latin-1' charset, though wordpress has been saving unicode data to the tables. Once you remove the DB_CHARSET setting (or setting it to latin-1 or ''), things return to normal.

The setting is in the file wp-config.php in the wordpress install directory.
The value before change:
define('DB_CHARSET', 'utf8');

The value after change:
//define('DB_CHARSET', 'utf8');
define('DB_CHARSET', '');

So maybe I should try to recreate the tables with correct charset defined in mysql some day ?

Google jumps into custom hosted application bandwagon!

Google has launched appengine which provides developers with a platform SDK (python based!) and hosting with access to own Google BigTable database! This competes with Amazon.com's SQS , S3 (storage) and EC2 (hosting) services which are used by many startups... The applications will get google's massively scalable infrastructure, failover. Apps would also be able to easily use google's user authentication, analytics and other google API's.

The applications gallery points to some cool goodies... The applications would get a subdomain under appspot.com. So it is possible to run a search on google to find the existing applications.

Here is a python shell web app. You can see the loaded modules, enter and run some small programs...

Both companies are trying to entice developers from hot startups into using their infrastructure, so just in case they start getting bigger, it is easier to assimilate them! Let there be competition!

Book updates

Finished the following books:
Little Book that Beats the Market Great book on investing! Very easy to read and short too! Joel Greenblatt describes a "magic formula" to rank stocks (based on two criteria: Return on Assets and Earnings yield (reverse of P/E!), rank stocks with higher numbers for both. Add the two ranks and rerank based on sum of the two ranks). Then buy a basket of 20-30 stocks who are top ranked and hold them for 1 year. Sell them all after 1 year, re-apply the formula and buy new stocks with highest rankings. Rinse and Repeat. Based on backtesting with different ways, this portfolio has handily beaten the market averages. I wonder why backtesting was only done for past 13 years when comprehensive US market data is available for 75+ years.

The strategy seems sound and is well supported by theory. (High ROA companies means, good earnings on slim assets. High Earnings yield means they are currently cheap. Using the book's website you can very easily find the rankings and stocks that you need. The only problem I see with this strategy is implementation. Buying and selling 30 stocks every year (60 transactions) is not cheap (okay, I am an index fund person - 0.19% fund expenses). I could possibly use buyandhold.com or foliofn.com, but they are not cheap. Also the author might turn the website into a paysite (so you have to use something like moneycentral.com to screen your stocks. I will make a couple of mock portfolios to keep watching the strategy for sure.

The Tipping Point I guess I am not a Malcom Gladwell person! This book was on my to-read list for a long time and though I liked the basic premise of the book, somehow I was disappointed by the presentation. I had the exact same reaction after I finished Blink. Anyway...