May 2008
6 posts
BeautifulStoneSoup: Getting XML tag properties
BeautifulSoup is pretty easy to use, but I find the documentation confusing at times — some of the simpler applications aren’t covered in sufficient detail, or at all. One of these is a clear example regarding the fetching of XML tag attributes, a pretty common task. Getting a tag attribute is covered in the documentation here:
The attributes of Tags
Tag and NavigableString objects...
Super simple Drupal clean URLs with lighttpd.
Agaskar.com runs lighttpd to squeeze the most it can out of a tiny 64M VPS (which, believe it or not, Drupal 6.x can run on — I usually have about 2-4M free at any given time, and probably could’ve had a bit more had I chosen a 32-bit architecture instead of a 64-bit one!) I’ve been meaning to turn on clean urls on agaskar.com for awhile, but everything I’d read about...
Another reason to love django: the regroup...
If you’ve ever done any CMS work, you’ll know that you’ll often want to group a list of database records together by date or another properties. Django makes this easy with the regroup template tag. Read on to find out how it works.
For instance, you might want to have something like the following:
<div class="week"><h2>This Week</h2>
<div...
admin page memory issue / WSOD with free tag...
If you’re using free tagging, you will eventually WSOD (White Screen Of Death) your admin content manage page. I say eventually, because one of our projects has 64M of mem allocated to each PHP thread (a non-trivial amount, imho — if you’re wondering, it’s set that high to permit large uploads) and it’s WSOD-ing on 32K tags. Now, 32 thousand tags might seem high in...
Upgrade from Drupal 5.x to Drupal 6.x: The easy...
I just completed an upgrade (of this site) from Drupal 5.x to the latest version of 6, and I’m happy to report that it’s pretty seamless, IF, you have shell access on your machine. I’m using lighttpd, but you shouldn’t experience any issues doing this upgrade with Apache. The key here is to leave your old install in place and create a new database and directory in which...
Handy vim tip: 'pipe' files into vim tabs.
Every once in awhile I’ll use absolute paths in files on the test server in order to remove all doubt that the path is correct. Of course, when it comes time to deploy, all of these need to be fixed. Now, you can go the long way around, which is to do a grep, then open vim, save/exit (or shell), grep again, until you’ve fixed all the instances. Naturally, there’s a MUCH quicker...