### The economics of writing books people want

I just saw this article on priceonomics about profits from books(via HN). It hits some facts right on the nail, gets others wrong, and finally misses the main point. Let me quote here the best parts (with comments) and give you my interpretation of what print-on-demand and ebooks will bring about.

With publishing houses only offering a royalty rate of between 6-15%.

Let’s say more like 2%–5% because this is from the *profits*, not a percentage of the sale price.

Email marketing was critical.

You got that right!

Self-publishing is arguably a wonderful innovation. It is historically unprecedented, providing the means for millions of people around the world to bypass the elitism of the publishing establishment […] In terms of access to a worldwide marketplace, it is fantastically democratic. In terms of access to financial success, it is far from it.

The OP misunderestimates the power of a democratic marketplace. There is a process of natural selection for book products. It used to act on a time scale of years and decades in the old days, but with the ease that information spreads now, I predict increased competition on the marketplace and unprecedented advances in book quality. As authors start to earn money from writing books, better books will be written. Also, the higher margins of self-publishing (think 50%) make solo authors and mini-publishers much more competitive that the old dinosaurs.

It is my hope that if books become better, more youth will escape their brain being crushed like a jujube by fast-moving pixels activities and learn to think bigger thoughts—hopefully constructive ones. Could an increase in interest in books bring about a new golden age of reason?

That would definitely be nice; enough with the consumerism, warring, and financial schemes. Let’s have another renaissance or something…

Sometime in mid-December I set out to create problem sets for the book. My friend Nizar Kezzo offered to help me write the exercises for Chapter 2 and Chapter 4 and I made a plan to modernize the calculus questions a bit and quickly write a few more questions and be done in a couple of weeks.

That was four months ago! Clearly, I was optimistic (read unrealistic) about my productivity. Nizar did his part right on schedule, but it took me forever to write nice questions for the other chapters and to proofread everything. After all, if the book is no bullshit, the problem sets must also be no bullshit. I’m quite happy with the results!

noBS problem sets: letter format or 2up format.

Please, if you find any typos or mistakes in the problem sets, drop me a line so I can fix them before v4.1 goes to print.

### Tools

In addition to work on the problem sets, I also made some updates to the main text. I also developed some scripts to use in combination with latexdiff to filter only pages with changes. This automation saved me a lot of time as I didn’t have to page through 400pp of text, but only see the subset of the pages that had changes in them.

If you would like to see the changes made to the book from v4.0 to v4.1 beta, check out noBSdiff_v4.0_v4.1beta.pdf.

### Future

Today I handed over the problems to my editor and once she has taken a look at them, I’ll merge the problems into the book and release v4.1. The coming months will be focussed on the business side. I know I keep saying that, but now I think the book is solid and complete so I will be much more confident when dealing with distributors and bookstores. Let’s scale this!

### Ghetto CRM

Say you want to extract the names and emails from all the messages under given tag in your gmail. In my case, it’s the 60 readers who took part in the “free PDF if you buy the print version” offer. I’d like to send them an update.

I started clicking around in gmail and compiling the list, but Gmail’s UI is NOT designed for this, you can’t select-text the email field because a popup shows up, and yada yada…. If you’re reading this, you probably got to this post because you have the same problem so I don’t need to explain.

Yes this is horribly repetitive, and yes it can be automated using python:

import imaplib
import email
import getpass

m = imaplib.IMAP4_SSL('imap.gmail.com', 993)

# see IMAP client
# m
# see tags (i.e. mailboxes) using
# m.list()

# select the desired tag
typ, data = m.search(None, 'ALL')

# build a list of people from (both FROM and TO headers)
people = []
for i in range(1, len(data[0].split(' '))+1 ):
typ, msg_data = m.fetch(str(i), '(RFC822)')
for response_part in msg_data:
if isinstance(response_part, tuple):
msg = email.message_from_string(response_part[1])
d1 = { "name":name1, "email":addr1 }
d2 = { "name":name2, "email":addr2 }
people.extend([d1,d2])
# uncomment below to see wat-a-gwaan-on
#for header in [ 'subject', 'to', 'from' ]:
#print "-"*70

# lots of people, duplicate entries
len(people)

# filter uniq
# awesome trick by gnibbler
# via http://stackoverflow.com/questions/11092511/python-list-of-unique-dictionaries
people =  {d['email']:d for d in people}.values()     # uniq by email

# just uniques
len(people)

# print as comma separated values for import into mailing list