John McCollum

Book Review: Django 1.1 Testing and Debugging

A wealth of tools are available to debug and test Django applications, but knowing when and how to use these resources can intimidate the new user. Django 1.1 Testing and Debugging, by Karen M. Tracey, aims to walk the user through the process of creating a web application from scratch, ensuring that the resulting code is bug-free and ready for production.In a way, Django makes it deceptively easy to write a dynamic web application. With a few lines of code, you can have an fully functional application up and running in a short space of time, and complex applications take less time than ever to develop. Inevitably, though, bugs will creep in to the development process, and the professional developer will want to make sure that their application is as bug-free as possible before launching.

The book opens with a simple question: “How do you know when code you have written is working as intended?” The answer, of course, is that you test it. But if you’re not a cowboy coder, you’ll want to leverage the full power of Django’s automated testing framework for best results. In the course of this book, the author develops a full web application, from start to finish, and describes how each section would be tested and debugged. Read More…

Posted in Django, Python at June 3rd, 2010. No Comments.

Special offers on Plone books

I’ve always meant to take a closer look at Plone. It has an excellent reputation for being a robust, scalable, secure CMS used by all sorts of organisations, large and small. The lack of cheap, shared hosting had put me off in the past, but that’s really no excuse for not checking out a great CMS (particularly with the rise of cheap virtual private servers.) Read More…

Posted in content management systems at May 28th, 2010. No Comments.

The easiest way to implement __iter__() for a python object

If you want to iterate over an object in Python, the simplest (and most Pythonic?) way is to use a generator. A nice simple example to demonstrate the utility and power of this technique:


class Foo(object):
    def __init__(self):
        self.mylist = [1,2,3,4,5]
    
    def __iter__(self):
        for i in self.mylist:
            yield i

You can then do:


>>> f = Foo()
>>> for i in f:
       print i
1
2
3
4
5

Concise, clear, and functional. :)

Posted in Python at May 27th, 2010. No Comments.

Installing drivers for HTC Desire

I recently treated myself to a shiny new HTC Desire – partly to learn more about Android development, and partly because, well, I wanted one.  :) It’s a great piece of kit, and I would wholeheartedly recommend it.

I wanted to debug apps on the handset rather than the simulator, but like many others, I had big problems installing drivers under Vista (32 bit). The solution, for me, was to install HTC Sync.

After a good hour of struggling, this installed in minutes and solved all of my problems. Hopefully this saves someone else some time!

Posted in Android at May 23rd, 2010. 4 Comments.

Stop talking about Web 2.0, start listening to your users

Lately I’ve been getting an awful lot of requests for ‘Web 2.0′ features. I’ve always hated the term for a number of reasons.

Web 2.0 was supposed to mark a paradigm shift in the way web sites operated. It promised interactivity and community in an age where sites were static. While we certainly see more of that these days, you also have to remember that these philosophies have been central to the web for many, many years. Amazon was founded in 1994 and Ebay in 1995, and both sites heavily featured user-generated content, even in the early days. In fact Tim Berners Lee described Web 2.0 as:

…people to people. But that was what the Web was supposed to be all along.

Certainly, there’s a look and feel associated with Web 2.0, largely dictated by emerging technologies and limitations of the day. Some of the most representative Web 2.0 technologies, Javascript (created in 1995) and AJAX (1999) have been around for over a decade now. In Interweb years, that’s an age! In fact, a lot of what was erroneously described as AJAX was simply good ol’ fashioned DHTML, re-packaged and re-branded for a new audience.

My biggest beef with Web 2.0 is that it’s frequently used as just another point on the checklist of requests, without any thought as to what such features actually are, or whether they’re appropriate for the site and audience. As in, “we need the site to be usable, accessible and Web 2.0″. As such, the term is completely meaningless! Much better to find out from your users what features they actually need, and go from there.

I’ve even been asked if I can “do” Web 2.0. I usually answer that any features are possible given the right budget. Whether or not you want to give them a label of Web 2.0 is up to you!

I guess the take home message for this article is exactly as the title of this article says: stop paying lip service to a marketing term, find out what your users really need, and implement it.

Posted in web development at April 17th, 2010. 1 Comment.
Twitter Reddit Flickr LinkedIn Stack Overflow Github Email Ne RSS