John Resig writes about how much money he made writing his book Pro JavaScript Techniques (which, as of this writing, boasts a five-star rating on Amazon.com): after collecting a $7500 advance, which applied against future profits, it took him a year’s worth of sales for him to make an additional $246.30 in profit.
He also writes about other things he learned in the process. I’m reminded of what Jeff “Coding Horror” Atwood wrote in a Twitter message — that for all but the hottest of tech topics (in which you are an undisputed master), rather than write a programming book, your money-out-to-work-in ratio might be better if you write about your topic in an ad-supported blog.