Archive for the 'Code' Category

Mar 02 2008

Keeping up with the Zenters

Published by Dave under 8aweek, Code, Django, Y Combinator

I just got around to reading the Newsweek article on YC. In it Paul is quoted referring to the Zenters “These guys have written 40,000 lines of code in three months!”

The Zenters were just a couple of guys with some work experience similar to Zack and I. But they must have had some serious skill since they were apparently kicking Google’s butt at the Powerpoint game, or at least were offering some pretty novel aspects, because they were acquired just 6 months after they started YC.

Lines of code is far from and end-all indicator of startup success. Especially when ignoring the little things like how much code was re-written/discarded, which languages/frameworks the code is in, comments, spacing between lines, the amazing roundness of the numbers 40,000 and 3 months, etc…. But there seemed to be a high correlation with the Zenters, and its something at least so I decided to see how we stack up.

If your files are all in one directory you can use a simple “cat * | wc -l”. We have a pretty big maze of directories however so I wrote this quick python script to walk the directory structure and find out for me. I wrote it so it’d be relatively easy for others to use. There are two variables at the top of the file where you can include directory names to ignore and characters in files that will exclude them from being counted. This way it won’t count the dirs with code we didn’t write, compiled files, svn repositories, images, copied files that emacs leaves behind, etc.

The results: 20,010 lines of code in the 53 days we’ve been working. Yes, I included the code in this script to break 20,000. Assuming we keep up our pace for the next 38 days (which might be unlikely due to demo day and investors) we’ll be at 34,511 lines for the 3 months. Crap! Just short!

Also, assuming we keep up that pace, I’ll be dead. A fact that Zack is disturbingly unconcerned about.

But kudos to the Zenters. You guys rock.

You can test yourselves to see if you can keep up with the Zenters. Download the script into the root dir of your source files. Open it up and edit the excluded_dirs and exclude_files_containing variables for your needs. Then run it: python line_cnt.py

3 responses so far

Feb 28 2008

Fast Django Deployment

Published by Dave under Code, Django

A few weeks ago we needed to set up a quick and simple server to Alpha launch 8aweek to our friends. I installed Django with Apache2 mod_python on a box in my friend’s dorm room at Stanford. We went to the Y Combinator dinner pumped to show everyone our hard work and get loads of feedback. Unfortunately, something or someone bumped the dorm room server and our plans for the big Alpha release were spoiled.

SlicehostWe decided that, even for our Alpha, we needed something a little more … reliable, but something not as expensive or time consuming as our planned deployment for launch. A fellow Django-using YCer recommended SliceHost. I checked them out and they’re fantastic. Its only $20 a month (3 month minimum) for a 256mb slice with your choice of several operating systems. The best part is, I just entered my credit card info, and 10 seconds later I was emailed an IP, and root password. We were back on track for Alpha!

UbuntuI love Ubuntu/Debian over any other distro because of the simplicity of the apt-get install. The popularity of Ubuntu also creates a ton of very specific documentation and support. To streamline the already easy Django setup I followed Jeff Baier’s step by step “Installing Django on an Ubuntu Linux Server.”

I had to change two things, as I was installing a deployment server and not a development one. Don’t include “MaxRequestsPerChild 1″ in your httpd.conf, and instead declare your server name at the top.

Servername yoururl.com

Next log into manage.slicehost.com and select DNS. Here you set up the slicehost Dynamic Name Server to point to your registered domain. Put the url of your site in there. Django Blog ImgIt will tell you to point your Domain Registrar to

ns1.slicehost.net.
ns2.slicehost.net.
ns3.slicehost.net.

This is a confusing part — you’re not done configuring the DNS after giving them your site domain. You have to log a few more “records”. To do so, follow the instructions here.

Now log into the domain registrar and follow their instructions on forwarding to those DNS servers.

The whole process, including writing this article, took me about two hours. Super simple, cheap, and a lot more stable than a computer in a dorm room.

2 responses so far