Archive for August, 2007

Off-line marketing

Sunday, August 5th, 2007

I’ve decided to do some off-line marketing in addition to the online we’ve been doing. Anna is working on some Credit Card Flyers, we’re going to order 20,000 and then distribute them through members of the site and clubs.

My back-of-the-envelope calculation is that we need a response rate of about 4% to make this campaign profitable.

I’ve also been considering a classified advert in the News of the World, according to the ratecard this would be £141 plus VAT (although I don’t think I’ve ever paid the ratecard price) so I would need about 500 members for it to be worthwhile. The paper has a circulation of 3.7 million and about 9.1 million readers with 60% of the readers under 45 so to meet my target I’d need 0.005% or 1 in 20,000 readers signing-up.

Both of these options are almost certain to be better value than Pay Per Click, which based on my estimates just won’t make sense at all for us.

Calculating age in Python

Saturday, August 4th, 2007

Here’s the Python method I was using to calculate someone’s age from a date object:

def calculateAge(born):
    """Calculate the age of a user."""
    today = date.today()
    birthday = date(today.year, born.month, born.day)
    if birthday > today:
        return today.year - born.year - 1
    else:
        return today.year - born.year

If you’re into Python you might just like to see if you spot the bug in this code — I didn’t!

Anyway, today we had an active user on the site who was born on February 29 in a leap year. And of course, that is the bug in the code I was using. I fixed it by adding an exception handler:

try:
    birthday = date(today.year, born.month, born.day)
except ValueError:
    # Raised when person was born on 29 February and the current
    # year is not a leap year.
    birthday = date(today.year, born.month, born.day - 1)