Welcome back!
Uncle Bob Martin was at NDC2009, and Rune Grothaug just posted the videos. You can also watch them as streams from the NDC2009 site.
Downloads from Rune’s server to Australia are pretty slow, so I’ve put Uncle Bob’s videos on S3 as an experiment. Please ONLY download them via BitTorrent:
I’m glad I stumbled across Patrick Altman’s tweet about a “default bug in Django“. I’d never have guessed you can pass a callable to a field’s default= argument, otherwise. That’s quite a powerful idiom, and I think I’ll use it a lot.
To balance the karma, I’d like to post a quick reminder to everyone else that expressions in default arguments are calculated when the function is defined, not when it’s called. In Patrick’s code, for example, all objects created in the same running session got the same timestamp. Try this in the Python interactive prompt:
>>>import time
>>> def report(when=time.time()):
... print when
...
>>> report()
1210294387.19
>>> time.sleep(5)
>>> report()
1210294387.19
Until the interpreter quits, you’ll always get the same timestamp. The correct way to go about this is to default to None or some other sentinel, then replace it inside the function:
>>> def report(when=None):
... if when is None:
... when = time.time()
... print when
...
>>> report()
1210294762.29
>>> time.sleep(5)
>>> report()
1210294772.23
Now that you know about that blunder, you should be able to figure out what’s going on with this second classic blunder when using default arguments in Python:
>>> def spam(eggs=[]):
... eggs.append("spam")
... return eggs
...
>>> spam()
['spam']
>>> spam()
['spam', 'spam']
>>> spam()
['spam', 'spam', 'spam']
>>> spam()
['spam', 'spam', 'spam', 'spam']
by garth on January 19, 2008
I’m seeing a lot of this disturbing little error message: “The wireless network appears to have been compromised and will be disabled for about a minute.”

A poke around the Internet doesn’t show much other than other people complaining about the same problem. Some find the only way to solve the problem is to disable WPA. I’m not so sure that’s a smart idea. I hope there’s a fix for this in 10.5.2.
[If you're getting this on what you think is a Django-only feed, it's because the community feed administrators haven't yet updated their subscription to point to my Django posts only. Sorry about that.]
by garth on October 24, 2007
Zephyr, this morning:
Zephyr big boy. Daddy big boy. Mummy big girl. Willow big chicken pox.
by garth on October 3, 2007
by garth on September 4, 2007
Yep. Quadruple-barrelled.
I always wondered what'd happen if one double-barrelled person married another double-barrelled person. Reg Drax here seems to be Exhibit A.
Our kids are double-barrelled. To save them from Reg' fate, we carefuly chose their middle names so they could ditch the two surnames entirely if necessary.
Thanks, Merlin!