All posts by amit

Eat That Frog

Eat That Frog!: 21 Great Ways to Stop Procrastinating and Get More Done in Less TimeEat That Frog!: 21 Great Ways to Stop Procrastinating and Get More Done in Less Time
is a book about getting more things done in the (limited) time that you have. This book is written by Brian Tracy who is a self-made millionaire. The basic premise of the book is that to be more productive, you have to find out that one task that you need to do which will make a difference (and not the task that you feel like doing) and take steps to do it right away with urgency. The book has a lot of good ideas to help you find your biggest frog and eat it!

Recommended for the perpetual procrastinators (yes, that means you!)

Here is a summary of 21 ways to stop procrastinating and getting more things done faster:

  1. Set the table: Decide exactly what to do. Write down goals and objectives.
  2. Plan every day in advance: Think on paper. Every minute spent in planning can save 5-10 minutes in execution.
  3. Apply 80/20 Rule to everything: 20% of activities account for 80% of results. Always concentrate efforts on those top 20%.
  4. Consider the consequences: Most important tasks and priorities are those with most serious consequences. Focus on them.
  5. Practice the ABCDE method continually: Prioritize tasks from A - most important to E - least important to make sure you always work on the most important task.
  6. Focus on key result areas: Identify and determine those results that you absolutely, positively have to get to do your job well, and work on them all day long.
  7. Obey the Law of Forced Efficiency: There is never enough time for everything, but there is always enough time to do the most important things. What are they ?
  8. Prepare thoroughly before you begin: PPPPP Proper prior preparation prevents poor performance.
  9. Do your homework: The more knowledgeable and skilled you become at your key tasks, the faster you start them and sooner you get them done.
  10. Leverage your special talents: Determine what it is that you are very good at doing and throw your whole heart into doing those things very well.
  11. Identify your key constraints: Determine the bottlenecks or choke points, internally or externally, that set the speed at which tou achieve your most important goals and focus on alleviating them.
  12. Take it one oil barrel at a time: You can accomplish biggest and most complicated jo if you just complete it one step at a time.
  13. Put the pressure on yourself: Imagine that you have to leave town for a month and work as if you had to get all your major tasks completed before you left.
  14. Maximize your personal powers: Identify the periods of highest mental and physical energy and structure the most important and demanding tasks around those times.
  15. Motivate yourself into action: Focus on the solution rather than the problem. Always be optimistic and constructive.
  16. Practice creative procrastination: Since you cannot do everything, learn to deliberately put off low value tasks, so that you have enough time to do the few things that really count.
  17. Do the most difficult task first: Begin each day to do the most difficult task, the one task that can make the freatest contrivution to yourself and your work, and resolve to stay at it until it is complete.
  18. Slice and dice the task: Break large, complex tasks down into smaller pieces.
  19. Create large chunks of time: Organize your days around large blocks of time where you can concentrate for extended periods on your most important tasks.
  20. Develop a sense of urgency: Make a habit of moving fast on your key tasks.
  21. Single handle every task: Set clear priorities, start immediately on your most important task, and them work without stopping until the job is 100 percent complete.

Library Lookup greasemonkey script for San Diego public library and San Diego County library

I promised here that I will polish my library lookup script and post it here, but haven't yet found any time to do that. I am posting it here so someone could work on it and make it better...

I have tried to look for the ISBN in both SDCL and SDPL, and it inserts the message and the link correctly. However in some of the cases, amazon inserts some more elements inside the same div container, so the links appear much later. (not immediately following the title). I have an idea of how to fix this and am going to fix this very soon...

Get the LibraryLookup Greasemonkey script from here.

(Usage: RIght click on the link and select "Install User Script" from the menu. OR open it in forefox, go to tools/Install this user script, click ok and now on you will see if any book that you are browsing on amazon.com is in SDCL or SDPL!)

Update: 11/30/05. The new bookburro extension for firefox supports SDPL and SDCL libraries by default, I will not have to update my miserly scripts now...

Django middleware

In the django project settings there is a key called MIDDLEWARE_CLASSES which is a tuple of strings implementing the middleware methods. Django base handler (TBD explain what this class does) reads this setting and initializes three of its own attributes: _request_middleware, _view_middleware and _response_middleware. It goes through the list of middleware classes instantiates each of them and adds the bound method process_request to the _request_middleware attribute, process_view method to view_middleware and process_reponse method to _response middleware.

If the middleware class method returns something (indicating that it has taken some action), the basehandler get_response method returns immediately. Otherwise it proceeds further.

There are 4 middleware classes built in:

  • AdminUserRequired middleware class implements the process_view method and silently returns if the user in the request is logged in and is a valid admin user. Otherwise it returns login page with appropriate error message.
  • CommonMiddleware implements process_view and process_response methods. process_view rejects forbidden user-agents and prepends URL with www and appends trailing slash if desired. process_response checks if there is a matching flat file present that can be sent for 404's and can also send email note to managers about broken links. process_response also manages ETags
  • CacheMiddleware implements process_request to check pages (not containing any query string) against cache. process_response adds pages to cache as needed.
  • XViewMiddleware (used internally for documentation) implements process_view and attaches 'X-View' header to internal HEAD requests.

Update: 10/14/2005. There are some updates to the middleware that ships with django and is now "officially" documented here.

django decorators

Django framework has used some design patterns. There is a directory called decorator which currently has two decorators: (decorator is just a method which dynamically adds additional functionality to original method depending on the situation)

  • funcA = login_required(funcA)
    This replaces the funcA with a function which checks if the user is logged in and calls original function if the user is indeed logged in and redirects the anonymous users to login page.
  • funcB=cache_page(funcB,cache_timeout,key_prefix)
    The original function is changed to look into the cached pages.

Getting to know the django web framework

I was just about to abandon python and join the ruby camp to be able to use the wonderful rails framework for web application development. (They do have very good documentation and impressive video demo which you should check out!) But then came the announcement of Django. I really like the python language and feel that I can understand someone else's python code, (though ruby looks equally fascinating). I read through the tutorials and checked out the svn repository and worked with the tutorials. This framework looks easy to use and seemingly makes your application portable enough to use any of the underlying database backends (postgresql, mysql, sqlite) and webservers (apache, lighthttpd, twistedweb etc). The initial few days after the announcement, there were very hectic updates on the code and documentation front (with support for sqlite backend , standalone server and new tutorial and documentation about generic views and form fields coming in a matter of a couple of days). This has now gradually slowed down.

I decided to write a sample application (rebate tracking) and immediately hit some issues. I am trying to make the user registration and login/logout part work, but am not following how that is hooked into the framework. The users added with admin interface do not get recognized by the authentication code. Tried IRC help, but haven't been able to get anyone who can help. I am studying the code right now. I am going to look closely into the decorator and middleware code now. I will write about my progress here.

Books: The Innovator’s Dilemma

The Innovator's DilemmaThe Innovator's Dilemma is a great book by Clayton M. Christensen. The central theme of the book is that unless specific measures are taken, disruptive innovation causes highly successful businesses to fail. This is not because they are badly managed or are technically incompetent, but because they get pressurized by their existing customers and investors to not commit the resources to the innovation. The markets for disruptive innovation are emerging, low margin, unpredictable and can not contribute substantially to the bottom line of large companies. It also becomes a conflict of values problem for the current cash-cow products and the new innovation. The solution is to form a completely new organization with new management and values and let it grow and gradually shift focus to the new organization.

The book also gives good examples of Computer systems manufactures - mainframe to minicomputers to personal desktop systems, Printer manufacturers - Dot-Matrix vs Laser vs inkjet, Departmental stores to Discount stores.

A very good read.

Update: (2005/06/27) [Here is a link to IT conversation talk with Clayton Christensen](http://www.itconversations.com/shows/detail135.html "IT Conversations")

Anonymity on Internet

On the internet nobody knows you are a dog
On the internet nobody knows you are a dog
Unfortunately it's only true in cartoons! Basically you are leaving a surprisingly easy trail of the websites you visit. Visit Test anonymity if you want to find what web servers can know about you. A determined person can find out about the websites you browsed, what you did on each of them etc.

There are some commercial services like anonymizer that insert a random proxy between you and the destination web server. There are also a number of HTTP/Socks proxies that you can use. But then all of your traffic is subject to monitoring by these people.

Freenet project takes anonymity to other extreme and you can access content that you may not access otherwise, and also provides anti sensorship / banning features. But it has always been very slow, prone to protocol changes. (i.e. sites working the previous day do not work the next day because of release of new protocol and peer software).

Tor project takes another approach for this. The endpoints are still the same, but all your packets are routed using random combinations of tor routers. The routing technology is called onion routing where the encryption is only between hops in the route and none of the intermediate hops know either the contents of the packet or the sender. There is a provision for hidden services(any TCP protocol), which are not accessible from regular internet, which comes close to achieving what freenet does. I have been using tor for some time now and noticing some things:
* The performance is improving a great deal (as more and more tor nodes are commissioned, it will yield better performance)
* You can get routed through completely different continent, so going to google might open their german page (because they send you german page if they detect your IP address is from germany)
* This service might be easily abused by spammers who will definitely want to route spam through tor, child pornographer who can host "hidden services", illegal content downloaders. (Though I believe many tor nodes block SMTP and peer-to-peer traffic). I guess there is a price to be paid for "really free speech"

Books: The Automatic Millionaire

The Automatic Millionaire : A Powerful One-Step Plan to Live and Finish RichThe Automatic Millionaire (by David Bach) is a little book telling a simple and automatic formula to become a millionaire. It talks about saving money (by sacrificing costly lattes, cigarrettes etc. if needed), effects of compounding (really dumbs down the argument).

Here is a brief sumary of the book:
* Save at least a few dollars a day. ($5 saved every day and invested will become $948,611 in 40 years)
* Learn to pay yourself first.
* Make everything automatic (by setting up automatic payroll deductions, setting up 401k etc.) Plan for saving from 5-20 % of pretax income in a pretax account (401k/403b/IRA/Roth IRA). Maximize employee matching dollars.
* Set up "rainy day" fund, automate the process. Set aside the money for at least 3 months (upto 6-12 months) of all living expenses. Invest it money market/ savings bond.
* Buy a home and plan on repaying it early by methods like biweekly payments, extra principal payments each month.
* Become debt free - pay off all loans, credit cards, automobiles.
* Automatic tithing - set up regular donations to charity.

Zeroconf for seamless networking…

I have HP's all in one device which is ethernet enabled. So all computers on the LAN can print to it/scan from it etc. The printer seems to use DHCP server to acquire the IP address and did not provide any name to the DHCP server. The windows version of software managed to detect the printer correctly and also everytime the address is changed. Then after the obligatory nmap port scan I discovered that it runs something called rendezvous protocol for autodiscovery. This is now standardized by IETF Zeroconf working group and is promoted by apple for seamless network configuration, autodiscovery etc. for SoHo users (and used by iPod, is built into MacOSX etc.) This also seems to be supported by HP, IBM.

There is ofcourse a competitive proposal called uPnP
(universal plug and pray play) which is endorsed by Microsoft.

Anyway, found some interesting links on zeroconf:
A very good article on O'Reilly network about zeroconf.

An interview with Stuart Cheshire (now with Apple) who authored zeroconf IETF RFC's.

An interesting thread on linux mailing list about adding this stuff to linux and politics behind such a thing!

Python and its implementation of zeroconf.

Amazon’s “Statistically Improbable Phrases”

Amazon.com has quitely introduced this concept of "Statistically Improbably Phrases" (SIP's). They scan the entire books (with the permission of publisher/authors) for users to be able to "search inside" the book. During this they do some analysis of some phrases that occur frequently in the book, which otherwise does not occur outside of that book. So for the book: WCDMA for UMTS : Radio Access for Third Generation Mobile Communications, they list the following SIP's:

mobile transmission power, time division scheduling, power control signalling, uplink transmission power, more multipath diversity, cell interference ratio, own cell interference, air interface load, power control headroom, allocated bit rates, physical layer procedures section, kbps real time data, cell change order, uplink loading, radio resource management algorithms, adjacent channel interference problems, soft handover base stations, enhanced access channel, outer loop power control, fast power control, uplink coverage, downlink orthogonal codes, macro diversity gain, admission control strategy, system information blocks

Now using these SIP's you can search other books having them. I think this is a very clever idea of word frequency analysis to artificially gain knowledge about keywords in the book. So by searching for the SIP "mobile transmission power" they generate the following books:

10 references in WCDMA for UMTS: Radio Access for Third Generation Mobile Communications, Revised Edition by Harri Holma (Editor), Antti Toskala (Editor)

7 references in WCDMA for UMTS, 2nd Edition by Harri Holma (Editor), Antti Toskala (Editor)

5 references in WCDMA: Towards IP Mobility and Mobile Internet by Tero Ojanpera (Editor), Ramjee Prasad (Editor)

1 reference in Adaptive Blind Signal and Image Processing by Andrzej Cichocki, Shun-ichi Amari

1 reference in Wireless Networks by P. Nicopolitidis, et al

BTW, here is what amazon.com says about SIP's

Update: (2005/05/05) There is an wired article on this topic: Judging a Book by Its Contents which talks about SIP's

Greasemonkey: Control your web!

Greasemonkey is a plugin for Firefox browser that lets you assign DHTML scripts to various domains. What's the big deal you ask ? This lets you correct some annoying problems some websites have or even add some nice features to your regular websites.

There are tons of user contributed scripts for doing fun things, like Adding waypoints to google maps., Remove ads from indiatimes.com etc.

The disadvantages of this are 1. this is firefox specific and 2. This works only on the computer that you installed the extension and scripts on. But hey! it's still way cool...

Update: 02/22/05
Here is a very nice application of this: Let's say you are browsing amazon.com for some books, how about checking out your local public library's catalogue for the same book and displaying that information right next to amazon book title ? This has been done by Jon Udel (but looks like he has taken down his script) and Bill Stilwell. I managed to tweak his script to search San Diego Public Library. Hurray! Contact me if you are interested. I will polish the script and put it here in a few days anyway...

Some more blog posts on greasemonkey:
http://taint.org/2005/03/16/201734a.html
http://javascript.weblogsinc.com/entry/1234000273026520/

**Update: 05/05/12**
Hmmm... [Dive into Greasemonkey](http://diveintogreasemonkey.org/ "Dive into Greasemonkey")

**Update: 05/18/05**
Wow this monkey is getting bigger and bigger.

[Here is](http://www.wired.com/news/technology/0,1282,67527,00.html "Firefox Users Monkey With the Web") a link to a recent wired article on greasemonkey.

wordpress themes

Interesting wordpress themes from www.alexking.org
:

Clasikue
Connections
Dark Maple
Elvgren
Fasttrack
Greenwood
Head (3 column layout)
Jakarta (Cool javascript hacks for align, smaller/bigger font etc.)
Neuron (Collapsible menus)
rdc*Theme
Red Train
Rin
Sharepoint Like

Currently reading…

Currently the following books are on my reading shelf:

  • How To Make Money In Stocks: A Winning System in Good Times or Bad, 3rd EditionHow To Make Money In Stocks: A Winning System in Good Times or Bad is written by William J. O'Neil, who is the founder of Investor's Business Daily. In addition to pitching IBD (which is good BTW), he outlines his method of picking the winning stocks to the acronym CAN-SLIM.
    C = Current Quarterly Earnings per Share. (The absoulute number not the growth percentage) The more the better. The earnings should be consistently increasing on log scale year-over-year and they should increase with the sales growth.

    Current quarterly earnings per share should be up a major percentage-at least 25% to 50% or more-over the same quarter the previous year. The best companies might show earnings up 100% to 500% or more!

    A=Annual Earnings Increases 25-50% or more growth rate. Check earning stability in past three years. Ignore P/E ratio.

    Concentrate on stocks with proven records of significant earnings growth in each of the last three years plus strong recent quarterly improvements.

    N=New Products/Management/Highs.

    Search for companies that have developed important new products/services, or benefited from new management or new industry conditions. Then buy their stcks when they are emerging from price consolidation patterns and are close to, or actually making, new price highs.

    S=Supply and Demand. Look for companies with less number of outstanding shares, enterpreneurial management rather than caretakers, no excessive stock splits, companies buying back shares in open market, low corporate debt/equity ratio.

    Any size capitalization stock can be bought under the CANSLIM method, but small-cap stocks will be substantially more volatile, both on upside and downside. From time to time, the market will shift its emphasis from small to large caps and vice versa. Companies buying back their stock in the open market and companies showing stock ownership by management are preferred.

    L=Leader or Laggard. Buy among top two or three stocks in a group. Use relative strength to seperate leaders (>80) from laggards.

    It seldom pays to invest in laggard stocks, even if they look tantalizing cheap. Look for, and confine your purchase to, market leaders.

    I=Institutional Sponsorship: Follow the leaders. Look for >10 quality institutional owners. (IBD sponsorship rating A). Avoid "overowned by institutions" stocks.

    Only buy stocks that have at least a few institutional sponsors with better-than-average recent performance records, and invest in stocks showing an increasing total number of institutional owners in recent quarters.

    M=Market Direction. Even good quality stocks will go down when overall market direction is downwards. Look for movement in S&P 500, DJIA, Nasdaq Composite indices. Don't be blinded by the myth surrounding "Long-Term Investing".

    The key to staying on top of the stock market is not predicting or knowing what the market is going to do, but knowing what the market has actually done recently and what it is currently doing.

  • Collapse: How Societies Choose to Fail or SucceedCollapse: How Societies Choose to Fail or Succeed
  • Using Your Brain--For a ChangeUsing Your Brain--For a Change

Rebate tracker use cases

  • Adding a new rebate:
    Step 1 Enter zip code for mailing address (zip+ext)
    Step 2 A list of rebates with same submission zip code is displayed
    Step 3
    Case 1 - Click on one of the links to prepopulate rebate form with entered information.
    (Display Submission address, Contact information, rebate validity, postmark date, expect check date)
    OR
    Case 2 - Enter new rebate and capture all information:
    (Product Name*), (Rebate amount*), (Rebate Description*), (Purchase valid from*), (Purchase valid until*), (Must postmark by*), (Expect check in*), (to ) weeks, (Submission address*), (City*), (State*), (Zip*), (Zipext), (Product Website), (Rebate Form URL), (Enquiry Phone), (Enquiry Email), (Inquiry Website)
    Display info as in Case 1.

    Step 4 Get (Purchase Location), (Purchase Date), (Purchase Price), (Date Mailed), (Postage), (Status: one of Mailed, Processing, Approved, Declined, Received, Void), (date Completed)
    Allow user to save/cancel data

  • Change Status of a rebate
    Currently active (status != Declined, Received, Void) rebates are displayed. One of them is selected, display the same data as in Step 4. and allow user to change and save data.
  • Periodic run
    Go through currently active rebates and email reminder for all rebates falling after (mail date + Expect check low)