Author: Matt

  • Peculiar Puzzle – Missing GET Parameters

    over the last week I have been seeing an odd error usually just once or twice per day out of the 10,000+ requests per day that hit my django web app backend for the iPhone apps.

    It appears as though the GET parameters get dropped and I can’t explain why. Hoping someone out there has some suggestions.

    The code in my iPhone apps check in to get data from the webserver. This is new content for the app. For each request it needs to have a parameter to determine which app is requesting the data – since there are a few using the same server.

    The app code calls a statically defined url string like “http://appserver.com/app_data?app_id=aiuwbev”

    However, about one in every 10,000 requests that come though create an exception because that app_id is not present.

    The other bits seem to be on the mark. They don’t seem to be coming from a web browser manually.

    So the most likely culprit is either that some small number of users are doing something sneaky, or there is a bug somewhere.

    I’m curious if anyone has seen this issue before, or knows what might be causing it.

    Edit:
    Solved – the problem was due to the string encoding on iOS side of things. Needed to enforce a utf8 encoding for all urls.

  • Geolocation of Client with Django

    My first thoughts yesterday when I started trying to add a lookup for a user’s country based on IP address was that this was going to be tricky. I figured I would have to create some models, fill them with data fixtures and do some manual queries against the database.

    Turns out it was fairly trivial to do.

    Django comes with some handy modules for doing it all for you. It just requires installing a C library from MaxMind and downloading their free Country data file.

    To install the GeoIP MaxMind C Lib on Mac I used homebrew

    brew install geoip

    on the server I had to do the same thing on Linux:

    sudo yum install geoip

    Then I downloaded the free country data file from MaxMind and put it in my django project’s ‘geo’ directory:

    $ curl -O http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
    $ gunzip GeoIP.dat.gz 
    $ mv GeoIP.dat /geo/

    To finish the setup I needed to add a line to the settings.py file:

    import os
    PROJECT_ROOT = os.path.dirname(__file__)
    GEOIP_PATH = os.path.join(PROJECT_ROOT, 'geo')
    

    Getting the country of a connecting user was then rather simple.

    from django.contrib.gis.utils import GeoIP
    g = GeoIP()
    country = g.country_code(request.META['REMOTE_ADDR'])
    

    For the complete documentation on GeoIP check out the official documentation.

  • Cross Promotion Analytics

    Earlier this week I was on a webinar.

    I wasn’t expecting to get much out of it. But figured there might be one or two nuggets in there to help out with my iPhone business.

    Turns out I had a eye opening experience and got several ideas for how to take my business to the next level.

    I never slept that night.

    This weekend I’m getting heavy into development of my server infrastructure to help scale up my ability to cross promote all my apps vastly more than I do right now.

    It all comes down to dynamically generating the links to other apps and automating choice of them depending on historical performance of click throughs.  Once the entire system is finished I will be able to correlate performance on several key indicators and generate pages that should be optimal.

    The math involved will be interesting to figure out.  The stats collected will provide me with a lot of information about the performance of my apps.  It’s going to be fun to figure out how to get a good dashboard to measure the status of my user engagement in realtime.

    Super psyched to get some new apps out with these new features.

     

  • Setting up a Mac for Django Development

    I usually use Linux for doing python and django development.   However last night my Linux PC choked up yet again due to bad video drivers and I was forced to do a hard reboot.

    That was the final straw that made me switch over to using my Mac for most of my development work going forward.

    I keep my current projects in Dropbox so that they are always up to date across all the computers I use day to day.  So there was nothing to do to get those files migrated over to the Mac.

    My python and django development environment is pretty light weight. I use:

    • virtualenv
    • vim
    • textmate
    • terminal with zsh
    • mercurial

    I don’t do django stuff in an IDE.  I find them a bit too heavy for coding.  Instead I opt for using either Vim or TextMate.  Very simple, text editing with little clutter or UI to get in the way.

    I use the standard Mac Terminal app but I’ve changed the standard bash shell over to zsh using Oh My zsh. Which can be installed with this one line:

    curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
    

    Virtualenv is a necessity.  It keeps all the projects I work on isolated so that I can set versions for all the libraries and come back to a project a year later and still have it work immediately.  Setting up virtualenv and virtualenvwrapper on the Mac was fairly easy:

    $ sudo easy_install pip
    $ sudo pip install virtualenv virtualenvwrapper
    $ mkdir ~/.virtualenvs
    $ echo "export WORKON_HOME=$HOME/.virtualenvs" >> ~/.zshrc
    $ echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.zshrc
    

    Restart the terminal after that. Now ‘workon’ and ‘mkvirtualenv’ will be available for working on and creating virtualenv python environments.

    Mercurial is what I use to version control all my projects. I just find it makes more sense than git and the command line is much simpler and cleaner.

    That’s pretty much it.

  • Creating Platforms

    Creating a really great piece of software is a lot of work.  Yet no matter how great it is it will not appeal to everyone.  Take a look at the hugely successful Tiny Tower game for iPhone.  The game mechanics are solid but the 8 bit graphics may turn some people away.

    One of the key benefits to the Freemium model is that players can pay as much or as little as they like.  I believe that same sort of flexibility needs to work it’s way into game play.

    Take a look at Angry Birds.  It was not the first game of it’s type available but it managed to be the most successful because of the delicate balance between being too easy and too difficult.  It always feels like you finish the level just as you are on the edge of giving up.  It’s not so hard that you give up, and it’s not so easy that you get bored.  That balance is what makes the game fun.  Rovio must have either been very lucky or done a lot of fine tuning to get the game play just right.

    Platforms allow me as a developer to work on the hard stuff (software) once and have it appeal to the most number of people possible.  Thinking from the start about making my software a platform means that I try to make it easy to swap out graphics or make them updatable from the web.  It also encourages me to design things in a way that makes it easy to adjust game dynamics easily.

    I’ve done a number of apps now that sit far down in the rankings.  Not because they’re bad but because they appeal to only a small niche of people.  These apps will never hit mass market appeal and will probably never make more than $2/day.  The only way to make a livable income from such apps is to develop a platform flexible enough to allow me to spin off a bunch of variants with very little extra work.

     

  • Importance of Marketing

    There are a number of vital components to any business. You need great people – which is a result of a solid HR process, you need great leadership, a solid vision, and a great product or service. But I believe that perhaps the most important component is the marketing.

    A business can have an excellent product but without the communication to connect that product to someone who wants or needs it the business will never be successful. For that reason I believe every entrepreneur needs to have first hand experience and an understanding of how the marketing and advertising works in their business. Marketing is what brings money into the business to pay the bills and salaries.

    There are a lot of specialized skills and unique experiences necessary to be good at marketing. However, once you become an expert at marketing you’ll never look back. There are two distinct approaches to marketing:

    • Branding
    • Direct-Response

    Unless your company has limitless money to spend on advertising as is the case with companies like Coke, Apple, or Budweiser then Direct response advertising is really the only thing you should concern yourself on.

    Direct-response is a measured, scientific approach to advertising where you have the ability to tell if an advertising campaign works. You can test variations of the message, over different media, at different times of the year and see the effects of those changes. It becomes easy to know if money spent on advertising results in sales and profit.

    For this reason many advertising platforms would actually prefer you didn’t use direct response marketing.

    In Yahoos hey day they made a boat load of money from banner ads. They would fly some sales guy to New York to meet with some of the biggest advertising firms and tell them how much more eyeballs would see their ad on yahoo.com compared to a billboard sign on the highway. They would sell millions of dollars in ad spaces to big companies with deep pockets to run branding campaigns. And because it wasn’t easy to measure the impact of those ads in terms of new sales Yahoo could continue to suck money out of them. Yahoo didn’t want the advertisers to be able to figure out that the value of those eyeballs was much less that what the companies were paying for. This eventually led to a small collapse in the online advertising space as many companies eventually figured out that they were not getting results.

    The Yellow Pages have been having a similar problem. For anyone who has ever tried to place a direct-response type ad in the yellow pages can tell you, they try very hard to convince you that it’s not a good idea. There’s a good reason for that. If advertisers could measure the performance of a yellow pages ad then they would probably find out that they’re overspending on it and cancel.

    There is a quote from Galileo, who said ‘Count what is countable, measure what is measurable. What is not measurable, make measurable‘. I believe that all aspects of business success revolve around measuring and counting the impact of what you do – including marketing.

    I have personally read countless marketing books. They are often the most insightful and inspiring books I read. Here’s a short reading list of my favorites which I think ALL entrepreneurs NEED to read:

    • Tested Advertising Methods – This is probably the penultimate book by John Caples which is referenced by nearly every marketer. It will convince you of the importance of the testing of advertising methods and is a great place to start.
    • My Life in Advertising and Scientific Advertising – This is another classic book by Claude Hopkins which belongs on the shelf of every marketing professional, entrepreneur or CEO.
    • Influence: The Psychology of Persuasion – This is the seminal book about the psychological triggers that make people want to buy. There are seven and each will make a dramatic impact on the effectiveness of your marketing.

    The importance of marketing to the success of your business cannot be understated. It will mean the difference between your product or service making money or failing miserably. Selling everything from iPhone games to houses benefit from good marketing. Give yourself a great head start by picking up the three books I mentioned above and continue to be a student of marketing throughout your business career.

  • One Week into Sauerkraut Diet

    It has been 7 days since I picked up 2L of sauerkraut at Costco and thought the results so far have been interesting enough to make a post about.

    I have a morning ritual. Every morning I weigh myself – after using the washroom, before eating or getting dressed for consistency. Since January I have been tracking this daily in a spreadsheet and charting it.

    Over the last week I have recorded the most consistant and dramatic weight-loss since I started tracking. Losing 6.5lbs. in 7 days and taking me to my lowest weight in about 1 year.

    To be clear though. the sauerkraut is really just the hook to make it seem interesting. The reality is that I’m keeping my daily carb intake below 25g (which is really hard to do) in order to get myself into ketosis where my calories are sourced from body fat rather than food.

    What have I been eating then?

    Breakfast: about 2/3 cup of sauerkraut

    Morning: 2 cups of coffee

    Lunch: 65g of Salted Peanuts (anything other than plain/salted/bbq peanuts has too many carbs)

    Supper: Meat + salad (very little dressing) or lower carb vegetables. ( no potato, beans, rice etc )

    If I’m feeling a bit hungry I’ll have few more peanuts, and if my carbs have been particularly low for the day I’ll allow myself one small indulgence (glass of red wine, beer, handful of chips). Note that it’s not about restricting calories or starving myself. I have been having larger portions of meat for supper and as much salad vegetables as I can eat. If I was more organized I would add a salad to lunch, but the supermarket is too far from the office and peanuts are just about the only thing at the corner store with less than 10g of carbs.

    This kind of diet is obviously not sustainable, but it is perfectly healthy for short 1-2 week duration and actually something that we’re fairly well adapted to do.

  • Programmer vs Entreprenur

    I went to school to learn how to program.  In fact I went to one of the best Computer Science schools in Canada – University of Waterloo.  While there I took all of the hardest courses I could fit into my schedule including 2 of the “big three” – Graphics and Real-time Operating Systems – which lead to many (MANY) nights in the lab that I never got home until 5am.

    I love writing software and I love reading about it.  In fact I estimate I do about 3 to 4 hours of reading every day!

    Over the last few years I have tempered my reading about computer related topics with learning entrepreneurship skills.  Things like sales, marketing, accounting, financing, leadership, and networking.  This evolution has changed me.  It opened me up to a lot of new ideas and points of view.

    There are a lot of entrepreneur skills that make a lot of sense for software development.

    Great sales people split test and measure the results of any particular approach they take.  They change headlines, colors, fonts, layouts, images etc to try and gather data about what works best.  They never stop testing new things.  Gathering these types of statistics overtime will improve the sales process and make drastically more money for the business.

    I have not seen many (if any) applications that are taking this type of approach to optimize.  Imagine how much better software could be if  there were easy ways to gather and visualize how it’s usage changes between versions as a result of UI changes or how real-world performance changes with a new algorithm or data structure.

    Entrepreneurs biggest problem is that they have lots of ideas but it’s hard to finish. It’s tough to get though the resistance to actually ship something before another idea comes up to provide an escape to avoid the fear of failure.  Solutions to dealing with this natural tendency is to not self sensor, be stupidly ignorant and stick to the core idea, and anticipate the resistance by pushing through with more focus as the deadline looms.

    These are things that I think programmers should embrace.  The first version of a program should be written as quickly as possible, with little thought put into performance or maintenance.  Anticipate that as you get to the later stages of writing a program the parts remaining will get harder and harder to get through (because you’ve skipped the hard stuff along the way).  When you get to the last few bits of a project the only thing remaining is usually the stuff you hate doing – UI code or graphics or tedious clean up.  Expect it.  Focus.  Do the work.

    Good entrepreneurs know that their opinion on their own ideas is fairly useless. Not until the product is available on the market where customers can prove it’s value by opening their wallet is anything for certain. Until the idea is proven in the market place it’s value is a guess.

    Likewise until a program is in the hands of users, programmers are just guessing at how it will be used, by whom, and with what level of knowledge. Therefore just get it out there and measure these sort of things after the fact. Don’t make too many guesses about a product before letting people use it. And recognize that until people use it your are just guessing.

    Most of the entrepreneurs I have met exude a tolerance for taking risks – for going after the big ideas. Have that same boldness for your own software development work and you’ll accomplish great things.

  • Schrödinger’s Programmer

    Schrödinger’s Programmer is a thought experiment. A real-life paradox which comes as a result of the Copenhagen interpretation of quantum mechanics. The thought experiment presents a programmer that may or may not have written software.

    You have a closed office. In this office is a computer (with internet access) and a software programmer. She is tasked with writing a piece of software that can be written in an hour. However there is an equal chance that she will instead find and read something interesting on reddit.com and accomplish nothing in an hour.

    After an hour has elapsed one would say that the software is finished if meanwhile she did work. The psi-function of the entire system would express this by having in it the both project completed and nothing done state mixed or smeared out in equal parts.

    It is typical of these cases that an indeterminacy originally restricted to whether or not something of interest is on reddit.com becomes transformed into macroscopic indeterminacy, which can then be resolved by direct observation by opening the office door. That prevents us from so naively accepting as valid a “blurred model” for representing reality. In itself, it would not embody anything unclear or contradictory. There is a difference between a shaky or out-of-focus photograph and a snapshot of clouds and fog banks.

  • Entrepreneurship Skills and Phases

    Within the last week I have nailed down the final set of features and bug fixes for Automatic Blog Machine. It’s now in a stage where the development is finished and I can start focusing on the sales and marketing push and finally release it out to people like you who may be interested in using it.

    There are a few different phases to go through in the creation of a business like this. Through my past failed experiences at entrepreneurship I have found that there’s a number of steps that require different skills which can create problems for a one man show like mine.

    To be successful you need (at a minimum):

    1. idea generation
    2. development and testing of the idea into an actual product or service
    3. financial and legal organization
    4. sales and marketing ideas and execution
    5. customer support

    The vast majority of people don’t have interest in doing all of these wildly different tasks.  They all require different skill sets and different motivations.   All of these steps can be broken down further revealing more mundane day to day details which can bog down even the most determined entrepreneur.

    The job of the entrepreneur is to learn which of these pieces they have the desire and motivation to see through themselves and which are better handled by paying someone else to do it for them.  Unfortunately sometimes the way to learn these things is to try and fail.

    I have on several occasions tried to get a business idea off the ground.  As the idea generator and the software developer I usually find myself stalling at the software testing phase.  It’s so boring.  Going though a product writing test code and manually checking interfaces takes time and effort which is often the downfall of the entire enterprise.

    Your mileage may vary, but for this latest project I was able to get through the testing phase with the extra external motivation I received by attending a conference and meeting people that were actually interested in buying the final product.  That gave me the confidence to get though it.

    For the financial and business organization stuff I decided to hire an accountant.  This may have been more beneficial than I expected.  Besides having someone else deal with the paperwork and keeping me from having to dig though reams of material to figure out what the best business structure to use, how to allocate shares and file and register everything with the government.  There were a number of side benefits to having someone else do the work:

    1. Makes it feel more legitimate – I have registered businesses myself, but when you do that it somehow feels less real.  You just hand in a few forms pay the fees and declare yourself President.  Having an accountant witness you declare yourself President somehow feels less like a scam.
    2. Provides external motivation – I told the accountant what I expect to be making and when I expect to launch.  I know he’ll see the numbers when tax time rolls around so there’s pressure to actually see it through and start generating some revenue.  Going back to the accountant with $0 in revenue to declare would be a huge embarrassment.
    3. If I had to figure out how to do everything it would have taken months of dragging my feet figuring out what forms go to whom and in what order.  The accountant got through everything in about 3 days.
    4. I now have an expert on my team to ask questions about how best to organize things.  He can quickly tell me how to organize my finances, and when is a good time to register holding companies, trusts, and how to issue additional shares.

    Dealing now with the mental switch going into sales and marketing is tough.  The technical aspects of software development suits my personality but switching then to the creative aspects of creating a marketing plan, recording videos, and being persuasive requires a completely different set of skills.

    Not many of the projects I have started made it to this stage.  Most die off much earlier.  But the few things that I have successfully managed to get a marketing plan for and get the product available for sale has taught me a few lessons.

    Getting something for sale is THE major turning point.  I have met quite a few people trying to make money online and very few of them actually get to the point where they have something for sale.  The few that do have something for sale are in a much better position – they can test different marketing strategies, split test offers, find and partner with others and run customer surveys.  Once you have something for sale there’s lots you can do to grow the business.

    For any business you simply can’t make money if you have nothing to sell.  Selling other peoples things can be done profitably but in my experience it’s difficult to compete against the army of people trying to do the same thing.

    Finally, customer support will land on you whether or not you are prepared for it once you have sold something.  There are two methods for customer support.  The classical approach is to have people answer customer questions and concerns either through a call center or some other  support center.  The Google approach is to move most of the support to the community through the use of wiki’s and forums – customers can help themselves and help other customers directly.

    These five categories of skills are the major distinct skills required in a small online business.  I’m sure that as I continue to learn and hit new stages of business growth new lessons will be learned and skills acquired.