Blog
Adaptation - adapters for .NET
I've started work on Adaptation, a small framework to implement adapter registries and object adaption in .NET. It's based (as far as C# allows) on the adapter functionality in Zope 3.
Layering
Developing software in service layers is generally a good idea, but only when the problem demands it.
Get back, Web 2.0!
Support for that browser stalwart, the Back button, seems to be declining in the current crop of Web 2.0 applications. Should we try to support the browser back button, or is a relic of Web 1.0? And who's that other dark figure in the corner?
Adaptation 1.0.0 released!
Adaptation 1.0.0 has been released. Adaptation provides Zope 3 style adapter registries and lookup for the .NET framework.
Forms - Automatic Form Generation for ASP.NET
I've started working on Forms, a package for ASP.NET to automatically generate forms based on an interface or class.
Don't Learn Python
Only joking. I just found a blog post which articulates a lot of the frustration I feel at the moment.
IOError: [Errno 6] Device not configured
A cryptic error message on Zope startup, but with a simple solution
Facebook Exposing User Profiles
Facebook is opening up its user lists to public search engines such as Google. But it's OK, you can opt out. You did know that you can opt out, didn't you?
TF42053: Build Machine and AllowedTeamServer
Problems encountered when reconfiguring a Team Build server to work from a different TFS instance.
Subversion: MKCOL 405 Method Not Allowed
Having fixed extensive breakage after an update to Apache 2.2, I was left with one final, strange error message to solve.
Django newforms file upload
Existing documentation about updating request.POST with request.FILES is now obsolete.
A Django image thumbnail filter
Django filters are a pretty cool idea. I needed to be able to generate image thumbnails. I found some existing code, and fixed it up to, well, work, and also behave better with custom upload_to locations.
Cookieless Django: Sessions and authentication without cookies
Django, by design, maintains its session state by storing a cookie on the client. This is a good design decision. Sometimes, however, you need to track sessions for clients that don't support cookies.
Programming with Passion
Software engineering shouldn't be 9 to 5 job. It should be a source of constant intellectual stimulation, in an environment of constant change. However, experience tells me that there are plenty of people for whom programming is the process by which a specification document is turned into a paycheck.
Fez Consulting web site live
The Fez Consulting web site has gone live - another dirt simple site built on Django.
TFS, Force Get, and Get Specific Version
When TFS tells you something, you want to think twice about whether you believe it.
GET and POST handling in Django views
Django view functions often feature an initial stanza near the start in order to handle POST data differently. You often end up with quite a lot of logic in one method. Here I describe a cleaner way, using a decorated view class to replace the single function.
Adapters in Django and the Revenge of Zope
Using Zope 3's component architecture can significantly reduce dependencies between applications within a Django project. Why stand on the shoulders of one giant, when you can stand on the shoulders of two?
'unicode' object has no attribute 'get_sql'
I keep getting this error, and it always takes a moment of head-scratching to figure out what's wrong. Here's what's wrong, to save you some hair.
Django ModelForm and newforms
Browsing the Django code after a recent svn up shows that newforms.form_for_instance and friends are deprecated and that you should use a ModelForm instead. This post gives a brief example of how to do this.
Mac OS X command and manual search path (PATH and MANPATH for man)
Mac OS X Leopard provides a simple way to manage your system-wide PATH and MANPATH for command and man pages.
Error compiling PostgreSQL 8.3 on Leopard: 'rl_completion_matches'
This is a brief note for those having trouble compiling the latest version of PostgreSQL on Leopard.
djangopeople.net, GeoDjango and PostGIS
Michael Trier's "This Week In Django" podcast is turning into something of a gem mine. I'm particularly taken with one website he mentioned, djangopeople.net. Plus, thoughts on GeoDjango and PostGIS, and the iPhone's Wi-Fi Locations technology.
ASP.NET AJAX and Unknown Web Method
The ASP.NET AJAX toolkit includes controls, such as the DynamicPopulateExtender, which invoke methods on the pages on which they are included to obtain data. This post looks at a common problem and its under-documentated solution.
Using output parameters with the Enterprise Library
Trying to get stored procedure output parameters working when you're using the Enterprise Library 3 can be frustrating. Here's a couple of tips to help you along.
Django Redirects (Updated)
This is a quick-n-dirty app to let you set up redirects on your Django site through the admin interface. (Updated to reflect my own oversight of django.contrib.redirects, which, er, does all this for you...)
Shared Development Databases
One of the big culture shocks moving to a .NET development team was the amount of shared development infrastructure - particularly on the database side. In this post, I share some of my experiences and suggest ways that you can work around some of the impositions of shared infrastructure.
Creating a Python 2.4, Plone and Zope Development Environment on Mac OS X Leopard
Compiling Python, Zope and Plone on Leopard isn't as easy as it is on Linux. Here's a walkthrough of the process, from a bare Leopard install right through to having a working Plone 3 development environment, using paster and buildout.
VMWare Fusion, Snapshots and Disk Space
Snapshotting your VMWare Fusion machine can start eating up disk space. This is not widely known.
Erlang Bus Error
I've become interested in CouchDB, written in Erlang. My copy of the 'Programming Erlang' book arrived today, so I tried to fire up the Erlang shell - only to be greeted with a Bus Error.
Django Unit Tests and Transactions
While these are more properly integration tests than unit tests, it can be handy to have Django roll back the database transaction after each test method runs.
A Django Development Environment with zc.buildout
This article will show you how to create a repeatable Django development environment from scratch using zc.buildout.
Blob support in the ZODB with ZEO
There's not a lot of documentation out there about ZODB blobs and how you configure a buildout with blob support in both ZEO and non-ZEO configurations for a pure Zope 3 application.
fez.djangoskel: Django projects and apps as eggs
I've made an initial release of fez.djangoskel, which provides simple paster templates for egg-based Django projects and applications.
Vista hanging on crcdisk.sys
Badly seated memory found with smoking gun (or, memtest86 is your friend).
Understanding imports and PYTHONPATH
An understanding of PYTHONPATH is key when developing new Python modules, or installing third-party packages and eggs. This article gives an overview of PYTHONPATH and the way Python imports modules.
BBC iPlayer "...temporarily unavailable. Please try again later"
I got the dreaded "(programme) is temporarily unavailable. Please try again later" while using the BBC iPlayer desktop AIR app. Fixing it was simple... once I found out how.
VMWare Fusion guests with a static IP
The article that I followed to get a static IP for VMWare fusion guests seems to have been removed, so in the name of preserving this knowledge I'm reproducing the salient parts here.
Installing GeoDjango with PostgreSQL and zc.buildout
The installation of the PostgreSQL requirements is somewhat daunting. I've spent a bit of time putting together a buildout.cfg to try to make this easier.
Firefox won't start after upgrading to Snow Leopard
My upgrade from Leopard to Snow Leopard went pretty smoothly - except for Firefox, which steadfastly refused to start. No error messages, nothing. Just a single dock bounce, and goodnight.
Python, Unicode and UnicodeDecodeError
In the years I've been developing in Python, Unicode seems to be the topic which causes the greatest amount of confusion amongst developers. Hopefully much of this confusion should go away in Python 3, for reasons I'll come to at the end; but until then, the UnicodeDecodeError is the bane of many developers' lives.
/etc/cron.daily scripts not running on Ubuntu
My Subversion backup cron job in /etc/cron.daily wasn't running. Finally I figured out why.
Migrating to Django Mingus
I've migrated my blog from a creaking Plone 2.5 to a fork of Django Mingus. This is the process I went through.
OSError while installing Django with buildout and djangorecipe
A corrupted Django tarball can cause mysterious errors from djangorecipe.
Changing a user's home directory on Mac OS X Snow Leopard
After a botched PostgreSQL upgrade, I managed to leave my postgresql user with a non-existent home directory. Here's how to fix this on Snow Leopard.
buildout vs pip, virtualenv and requirements files
The Python world is blessed with two mainstream choices for integrating Python packages into an application: buildout and pip. This post looks at the pros and cons of each, to try to help you pick which one is best for you.
Filtering Dropdown Lists in the Django Admin
It's not immediately obvious how to filter dropdown lists in the Django admin interface. This article will talk about how ForeignKeys can be filtered in Django ModelForms and then the Django admin.
Speeding up Django unit test runs with MySQL
Here are a couple of tips to speed up unit test runs on Mac OS X and Linux when running MySQL.
Introducing django-lazysignup
django-lazysignup is a package designed to allow users to interact with a site as if they were authenticated users, but without signing up. At any time, they can convert their temporary user account to a real user account. Read more about it below.
Mobile API Design - Thinking Beyond REST
This article explores the problems of optimising REST APIs for mobile device performance, and suggests a way of allowing clients to request alternate representations.
Deferred foreign keys with django-dfk
django-dfk allows deferred foreign keys to be declared on models, so that a concrete target can be set later.
