Converting This Blog to Django

websites - Comments - Posted on February, 21 at 10:35 am

One of the programming projects I decided to work on was learning how to build websites using Python and Django. So I’m in the process of using this blog as a guinea pig to get everything figured out.

The work is coming along nicely.

I managed to get a good workflow figured out that allows me to develop the website on my local computer, test it there, then deploy it to a test server and set everything up in an automated way. When everything is ready to go live all I will have to do is repoint the domain name to the production server. Everything should just work.

The one major difference when moving from this Wordpress install to something I write myself is that wordpress gives me a lot of stuff for free and I have to program or install and configure components for a django website.

The test website includes a major overhaul of the website theme. I’m going for a very minimal look.

Check out the progress at test.halotis.com

What I need to still do is:

  1. Write a script to convert all my posts to the new database
  2. Add XML-RPC so I can post with my desktop tools

Olympics are Crazy

Vancouver - Comments - Posted on February, 20 at 12:02 pm

The city of Vancouver has gone insane! Just trying to get home from work is an ordeal. Even with Robson street closed to vehicles the whole thing is effectively a giant sidewalk and it’s so packed with people that it takes 50% longer for me to walk home.

I have never seen anything like it.

All the venues, all the events, all the concerts have a minimum wait of 30 minutes to get in (if you’re lucky). Most of the good places – the Irish house, German house, Northern House, Atlantic house have seen lines more than 3 hours long.

The nightly fireworks, constant music and cheering are overwhelming.

Vancouver has transformed overnight from a laid back bunch of early to bed, granola crunchers to a city that never sleeps like New York.

The absolutely amazing weather we have been having makes me wonder if it will change the perceptions of canadian winters for visitors. I wonder how many tourists will come here, fall in love with the city, and decide to move here. If that does happen will it be enough to hold real estate prices at their astronomical levels? Only time will tell.

Cambie Bridge is a Parking Log

Uncategorized - Comments - Posted on February, 12 at 5:39 pm

Just walked home from work. Opening day of the Olympics and the city is an absolute mad house.

Robson street is closed to cars, and jammed packed with several hundred thousand people.

The Cambie bridge is closed to make room for all the busses.

Cambie Openning day

Work computer Upgrade

computers - Comments - Posted on February, 9 at 8:22 pm

Today I got a nice upgrade to my computer at the office. A 64GB SSD drive to replace my spinning disk hard drive.

The difference was amazing.

Boot time on the computer (Windows XP) went from almost 6 minutes down to 57 seconds. Applications start up instantly. The speed of compiling all my java code improved by a factor of 5!

If you’re looking for a reasonably priced upgrade to your computer that will make it scream consider putting an SSD in as your main drive.

I think they should roll these out to everyone at the office. From a productivity stand point this is going to make a huge difference. Hopefully I’ll be able to keep my train of thought and not get side tracked when applications take 15 seconds to start, or load files.

Snowshoeing at Cypress In The Rain

Uncategorized - Comments - Posted on February, 7 at 4:32 pm

I’m just catching up on some pictures that were on my camera. These pictures were from a day at Cypress on January 8th.

The trails were in pretty bad condition. Most of the water crossings were down to waking on crates over flowing rivers. There were lots of roots showing. At the top of the mountain things were only slightly better. Snowshoeing in the rain and fog.

Motorcycle Project

Uncategorized - Comments - Posted on February, 7 at 4:25 pm

Heather was at training today for her volunteering at Canada Hockey House during the Olympics. So I spent the morning working on a little project for my motorcycle.

For the longer trips that I want to do over the summer I got a nice duffel bag that is bigger than the hard case on my bike. It should allow us to pack more camping equipment and food.

I went to Home Depot this morning to get some tools to build a platform on the bike that would hold the softer bag. A couple hours later and I finished my little project.

It still needs some tie down hooks to easily attach bungee cords. Other than that It’s ready to go.

Vancouver 2010 Pre-Olympic Photos

Vancouver - Comments - Posted on February, 6 at 10:26 am

Lots of things are quickly going up now for the olympics which will be starting less than a week from today. Here are a couple of the photos that I’ve taken of Downtown Vancouver as it gets everything ready.

The transformation has been quite amazing to watch.

We’re going for a long walk around today so there should be some more pictures to share tomorrow.

Struggling With Java Webapps

Uncategorized - Comments - Posted on February, 4 at 9:44 pm

Another technical post. The next few will be about Vancouver and the olympics.

Java is an interesting beast. The language itself it a hold over from C++ but with a ton of extra cruft to know about. You have the benefit of not really having to worry about memory management (most of the time) but there’s a ton of complexity involved in getting anything working. I have been programming Java for 5 years and I still get lost anytime I read through the documentation of anything more advance than basic Java.

Every now and then I try to get a web application server up and running with some demo applications. And every time it is a complete failure. Simply finding an open-source webapplication, importing the project into Eclipse and then deploying to a server never seems to work. Even using something like Maven which should download all the required libraries hasn’t worked for me.

There is an endless – ENDLESS number of acronyms that mean nothing. For example EJB, Enterprise Java Beans, is so general that it means nothing and reading through the documentation is just like reading more of the same. It’s impossible to figure out.

Last night I spent an hour to try out a Python Blog application. Downloading the source code, setting up the environment and running the development server took less than ten lines at the command prompt. It was up and running with sample data, a full backend for admin, support for twitter, proxies, bookmarks, image manipulation, robot files and more.

I can’t tell you how many days of effort I have wasted to figure out deploying to Java web servers.

Java actually pisses me off.

Programming

computers - Comments - Posted on January, 31 at 6:23 pm

Sorry if this post is overly technical.

I haven’t had a chance to find a useful project to code up yet, but I took some time yesterday to start getting my head wrapped around the development and deployment processes. In particular I’m looking at getting web applications deployed to cloud computing services like Amazon’s EC2 service.

If you’re not familiar with cloud computing is fairly simple. Basically you can request a computer be started for you somewhere in a remote server farm and then be billed by the minute for usage. The nice thing that this allows you do to is to dynamically scale the number of computers you have available for you to use. So for instance, for a one time test you can just start a machine, log on, run some code, collect the results, shut down the machine and discard it. The whole process may only cost you a few pennies to do. Where as purchasing a fresh machine from Dell could take weeks to be delivered, days to set up, space in the server room, and cost several thousand dollars.

At work right now we have quite a large server room (considering the size of the business). Many of the machines however sit idle for much of the day. So many of the CPU cycles get wasted away. I think that scaling the servers horizontally with distributed algorithms would allow us to avoid having to purchase new $30,000 machines every 18 months and instead we could just add a few more blades to the virtual farm.

Anyway back to my project.

What I have been looking at is a number of different solutions for:

1. Organizing code for multiple projects
2. version control of the code
3. managing the required 3rd party library code
4. testing any applications that I write – local and remote testing
5. deploying to a fresh bare computer
6. debugging web applications

The tools that I want to use are:

1. Server side development with Python and Django framework
2. Try out some of the latest HTML5 and CSS3 functionality
3. Client side scripting with Javascript and jQuery
4. Linux servers on Amazon EC2
5. Back to basics – programming with a text editor and command line again

What I have found is that there are a number of clever tools available to manage this kind of project.

1. Virtualenv is a python project that allows you to quickly separate environments for different projects. This allows you to install required libraries, have environment variables set, and versions of the language quickly changed with a single command line call. This allows me to manage 10 projects where one may require version 1.3 of library x while the other requires version 1.4 of library x. It allows me to manage projects that are targeting different versions of python without installing them globally on my computer.
2. distribute and pip are very handy tools for finding and install libraries I need. Using public online repositories I can simply use a command line like `pip install Django` and it will automatically find, download and install it. If there happens to be any compilation steps it will do that for me. The really nice thing about this is that when built into the deploy script I can take a totally bare computer with nothing installed and have it automatically download and install everything I need. If I had to setup 100 identical machines it becomes trivial to do.
3. Fabric is the tool that does this deployment scripting. It connects to the deploy target machine using SSH and will do whatever I need to get it up and running. That could include installing libraries, copying files, installing libraries, setting up apache web servers, installing and configuring databases and running tests.
4. Firebug is probably the coolest tool for debugging the client side of web applications I have ever seen. It allows you to pull up any webpage and dynamically edit the CSS, HTML and Javascript and see the results live right in Firefox. I used it quickly the other day to tweak the theme to my blog.
5. Git/Mercurial I’m kind of torn about which route to take on this. Git seems far more popular and is referenced everywhere I look, but I have already started using Mercurial and really enjoy it. These tools allow me to easily version control my code without having to set up svn servers etc. distributed source code management (DSCM) is the future.
6. Textmate is more than a simple text editor. While I still like using VIM, textmate is already setup and ready to go with lots of nice shortcuts for programming. (I’m actually writing this blog post from textmate)

Yesterday I took some time to find some programming info on iTunes U. If you have never heard of it, it’s basically a category of podcasts where universities have recorded classes and published the videos/audios. You can find decent course material for just about any subject from some of the top universities in the world. Between the content in iTunes and what I could find on YouTube there’s enough how to guides out there to learn how to do everything.

Now I just need a few sample projects to run through to totally wrap my brain around all these tools. Learn by doing, practice and repeat.

Trying to find a programming project

Uncategorized - Comments - Posted on January, 28 at 9:44 pm

I’ve decided that I need to start getting a bit more experience as a web developer from the programming side of things. That means I need to get a few more websites under my belt. Things that might not be as simple as making a few simple changes to a wordpress template.

I need to think of a simple web application to build using Python and Django. If you have any ideas let me know.

The last few years of working in a Windows development environment has made me soft. It’s actually really hard to do cool things on Windows.

… I can rant about how much I hate Windows another time though.

The skills that I need to start building are :

  • PHP