June 16, 2009
Django dynamic forms and formsets
A couple of great posts which explain Django dynamic forms and advanced formset usage very clearly:
- James Bennett: So you want a dynamic form
- Malcolm Tredinnick: Advanced Formset usage in Django
Solvitas perambulum
A couple of great posts which explain Django dynamic forms and advanced formset usage very clearly:
I will be giving this talk on Friday 12th June, at Open Web Vancouver 2009.
I setup my Mercurial repository in the same way we used to do CVS, then SVN: A directory owned by a group, with the GUID bit, and all users who need to commit are in that group.
The steps are, create the group and add relevant users to it:
sudo groupadd topsecretgroup
sudo usermod -a -G topsecretgroup grahamChange the project directory to be owned by that group, and accessible by no-one else:
cd topsecretproject/
sudo chown graham:topsecretgroup -R .
sudo chmod g=u,o= -R . Set the GUID bit on all the directories, so that new files and directories are created owned by the group:
find . -type d | sudo xargs chmod g+sChange the umask for everyone, so that new files are created with read and write permissions for the group:
sudo vi /etc/profile
change 'umask 022' to 'umask 002' The last part, changing the umask, isn’t ideal. It works on Debian and Ubuntu, because every user has their own group. I would rather a more focused solution, just for that directory - suggestions welcome.
References:
Mercurial and permissions
Multiple Committers
Change Ubuntu global umask
Collaboration models
I will be speaking at Open Web Vancouver on Thursday, June 11, 2009 and Friday, June 12, 2009.
That’s in Vancouver, B.C., Canada. There’s a very interesting speaker lineup, and the whole conference is reasonably priced, so come along, learn, interact, and enjoy Vancouver in the summertime.
My talk will be entitled How and Why to Extend Firefox in Javascript (and Thunderbird, Komodo, and Songbird). I will post the slides here in June.
See you there!
When I was 16, I wrote a computer game, called Micro Zooides. It was called that partly because on Windows .EXE files all start with the two characters MZ, and partly because it was about small creatures. Micro-Zooides was going to be about humanity’s progress, it was going to be Civilization, which didn’t exist yet.
The game had a splash screen of a Far Side comic, then a short video of me tromping through the woods like a Neanderthal, which my Dad filmed and which I digitized with a very early video capture card.
In Borland’s Turbo C++ 3.0 I wrote a basic graphics engine to display the tiles of the world, and an event loop so I could move the main character around the world. I drew sprites for a proto-human (the micro zooid), dirt, rocks and sticks. He could walk around the world, and pick up and put down rocks or sticks.
Then I took a break to plan. I have a proto-human, rocks, and sticks. How do I get to civilization?
After a desktop and server upgrade, my subversion client stopped working. I am using Digest authentication, and it kept asking me for the username and password. Wireshark showed me that the SVN client wasn’t sending the Authentication header. To find out more, I turned on Subversion’s debug output. Here’s how you do it:
Edit /etc/subversion/servers
Add this line at the end: neon-debug-mask = 511
That showed me this error: auth: '/' is inside auth domain: 0.
This means that the path I was requesting (the root of the repo) was not considered inside the AuthDigestDomain I had set in Apache.
It turns out that at some point in the upgrade of Apache, Subversion, or a library, the AuthDigestDomain requires a scheme. I had
AuthDigestDomain svn.myserver.com
whereas it should of been
AuthDigestDomain http://svn.gkgk.org.
So now you know.
Update: There is now a user group for Foxden: http://groups.google.com/group/foxden-users
Foxden is a Firefox extension that allows you to tile all the web applications you use on one page. Imagine being able to see your email, your calendar, your bug tracker, feeds, twitter, whatever you use, on one page. Take a look at my setup:
As you can see, I have (counter clockwise from top left) my email, calendar, feed reader, todo list and a local text file for taking notes.
It’s free, should work wherever Firefox 3 works, and it could be yours right now.
Eddit is a bookmarklet for Reddit, which gives you more signal and less of the noise that makes you go Rrrr! Here’s how it improves reddit:
Read the rest of this entry »Most ActionScript / Flash applications have a main event loop, triggered by Event.ENTER_FRAME. This is where the animation moves along to the next frame, or the sprites of the game are re-drawn in their new places.
In the Flex framework, you are expected to call invalidateDisplayList on the framework to say you need an update, and actually do the update when the framework calls your updateDisplayList method. This is the invalidation / validation pattern.
I went searching in the Flex code to understand how this invalidation / validation step ties in with Flash’s event model. I ignored properties and sizing, and edited the code down to the bare essentials.
Here is what happens when you change the label of a button:
UPDATE March 19th: Added First Steps in Flex, and Learning Flex 3.
You’re an experienced server-side programmer, with a background in C/C++/Java/C# or Python, but no Flash experience. You want to learn Flex. Which book should you buy to learn Flex 3? I have speed-read the following, so that you don’t have to:
Los Angeles is under attack, by trigonometric functions! OMG! Trigo-what? If I wanted to do maths, I’d go to San Francisco!! You, like, totally gotta save L.A man. Enter your name, then move your tank.
Use the left and right arrow keys to rotate, the forward and back arrow keys to move.
The barrel of the tank is the little black line. That’s the front.
No, your tank can’t fire. Avoid the mathematical blobs. YEAH!
The longer you live, the more points you get. A score above 100 is, like, totally AWESOME! Good luck Bro.
Let me know in the comments how much you score.
When writing object-oriented Javascript, there are two occasions when you need to be careful that this is set correctly: In inner functions and in callbacks.
Number 3 is what you need to watch for. It is considered a bug in Javascript. Here is an illustration of the three cases:
Javascript is not an opinionated language. At it’s heart it is a hash map. You can layer pretty much any idiom you want on top of it. I’d like to make it look like Python, and it’s pretty easy to do. They both are dynamically typed, have functions as first class objects, and can treat most types as hash maps.

Let’s assume code for a whimsical Moose Observation Project, and translate it from Python to Javascript.
I have just launched Plebis.net. It’s a wall on the Internet you can write on, for all to see.
You can write anything you want. There’s no censor and nothing is recorded, so feel free to scream shout and wail. Tell the world how you feel. Get it off your chest. Go on, it’s good for you. Head over to Plebis.net, and say something!
At work we setup a Twiki, and Internet Explorer refused to send the NTLM authentication, instead it showed a login popup. The problem was that our Windows domain, say mycompany.com was different from the Twiki URL, which was othercompany.com.
The solution is to tell IE that othercompany.com is a trusted site. ‘Tools’ -> ‘Internet Options’ -> ‘Security’ -> ‘Local Intranet’ -> ‘Sites’ -> ‘Advanced’ and add it in there, this must start with http:// or https://
The problem and solution are explained here:
Apache::AuthCookieNTLM - NTLM (Windows domain) authentication with cookies
Note that this will be a problem not just with that Perl module, but with any cross-domain NTLM authentication. IE correctly refuses to give out your username as it doesn’t know it can trust the site.
Keithnote is a presentation generator. You provide information such as the title of your presentation, and it downloads relevant images from Flickr. These are stored locally so you can run your presentation whilst offline.
Keithnote is hosted at Google Code, here: Keithnote
A concise reference / cheat-sheet / crib-sheet to MySQL’s commands.
For many months now I have been making and receiving telephone calls from my computer. There are two advantages:
I am running Ubuntu Linux on a Thinkpad, but most of this should apply to Ekiga on all platforms, and the principles apply to all Softphones.
It’s hard for me to see why you’d bother having someone come all the way to an office just to sit in a cube and type.The new rule seems to be that if you’re going to spend the time and the money to see someone face to face, be in their face. Interact or stay home!
My thoughts entirely.
Original post: Seth Godin – The new standard for meetings and conferences
When I first got my own server (a virtual private server with Linode which I highly recommend), I ran every Internet service I needed on it, and several for my friends. Over time, I gradually started replacing what I had with online services - I stopped running my own e-mail server and started using GMail, I stopped running my own gallery and used Flickr. Now I really rely on those services, so I got to thinking what I would replace them with if one of them was no longer available, or appropriate. Here’s what I would use: