Syntext Python Coding Conventions
An example of a team's coding conventions document for Python
Beautiful Soup: We called him Tortoise because he taught us.
Python html parser
Second p0st - Phillip Pearson: 11:11am 2005-11-11
Lots o' ones in that date. Comment
Max Khesin: del.icio.us popularity is mine!
Hey, my SICP podcast made it to the http://del.icio.us/popular/ipod/ page! Thank you, my tagging minions. More video goodness to come, I promise!
Ned Batchelder: Finding Windows error messages
One of the difficult things about programming in Windows, and especially with COM, is that when you receive an error code, it can be difficult to find the message that goes with it. I was writing some new LDAP code today against Active Directory, and got this message: (more..)
Alvaro Lopez Ortega: It grants you three wishes
We have released Cherokee "It grants you three wishes" 0.4.29. It includes some really interesting changes over the previous versions. These are the most important: It adds a new configuration entry called "Request".
Ian Bicking: Best of the web app test frameworks?
What are the best web application test frameworks people have seen? Any language, though I'm thinking more about unit tests, not as much about through-HTTP acceptance testing. I'm curious mostly because I want to see other useful features for me to borrow. Right now the test framework in Paste is pretty simple, but IMHO in a good way. There's some other features I've seen that I'm unsure of. For instance, the ibofobi framework for Django uses Beautiful Soup for extracting response strings for testing.
Efectos Especiales: Red paperclip
This is a really great idea. But I've seen it somewhere before. Look at this Donald Duck story from 1947: The boys pull of the same trick again later in the story, going from a piece of pencil to a medallion, to a minah bird, to binoculars, until they end up with a cart with 500 pounds of cat food.
online.effbot.org - Fredrik Lundh: observationer
* Hurra! (Nä, vänta, jag bor väl inte i Saltsjöbaden. Och Sudoku är faktiskt skittråkigt...)
Ned Batchelder: CSS Hacks table
An awesome table of all of the known CSS Hacks, and which browsers see which. If you don't know what I'm talking about: CSS Hacks are the dirty underbelly of Cascading Style Sheets, where the differences in CSS implementation in the different browsers are worked around by exploiting differences in the parsers to have certain rules exposed only to certain browsers. Yuk!
Ned Batchelder: Structured wikis
Dan Bricklin has announced his next Software Garden product: WikiCalc. I haven't tried it, but it looks like a client-side wiki thing with embedded spreadsheet behaviour. I'm fascinated by the addition of structured to wikis. At work, I installed TWiki, which has a wide array of features for dealing with wiki pages in organized ways. It reminded me a little bit of Notes, the way documents carry structured information, and the system provides ways to add little bits of "code" to pages to build applications.
Peter Bengtsson: "Clever" date formatting accessibility
Last night I wrote a little function that tries to show dates cleverly by comparing the date with todays date, it formats the date differently. If the date is today is just says "Today 10:00" and for yesterday it says "Yesterday 10:00". If it's within a week it shows is like this "Thursday 10:00".
Ian Bicking: DRM Explained
It's useful for more technical people to consider how we can help explain ideas to the general populous. Often it's helpful to come up with a metaphor that people will be familiar with. With that in mind, here's how I would explain DRM: DRM (Digital Restrictions Management) is like the anti-shoplifting scanners in stores (the ones that beep if you try to take something out the door).
Ted Leung on the Air: Early morning spider web
Andrew Channels Dexter Pinion - Andy Todd: String manipulation in PL/SQL
I've had to put my managerial hat to one side for a while. There's some very broken code in our system and I find myself the only person with the skills and time to fix it. It's the most serious PL/SQL programming I've done in a while and I'm beginning to remember why.
Cheese Shop: funkload 1.3.1
«Functional and load web tester.»
Cheese Shop: P(x) 0.2
«An applet programming language»
Cheese Shop: interval 1.0.0
«Python interval and interval set implementation»
Cheese Shop: PyZenity 0.1
«An easy to use frontend to Zenity.»
Cheese Shop: pygraphviz 0.2
«A python interface to graphviz»
Jp Calderone: How To Create A Mantissa Server
«So a guy comes up to me and wants to know what the absolute minimum effort to get a Mantissa server running is.»
Carlos de la Guardia: Zope 3 Project Starter
«I recently posted a comment about the need for a Zope 3 structure generator that allows new users to quickly set up a working project instead of having to create a number of files and directories by hand. Well, Duncan McGreggor has just announced z3 Project Starter , which is a Python script that automatically generates a Zope 3 project structure. Good work, Duncan! Now hoping for the other part of my wish: could something like this be part of the official Zope 3 distribution?»
James Tauber: Relational Python: Basic class for relations
«A relation is basically a set of dictionaries (called tuples) where each dictionary has identical keys (called attributes). While, as you'll see in the next couple of posts in this series, my display routine and the initial relational operators work on iterations over plain Python dictionaries, I found it useful to implement a relation, at least in these preliminary stages, using a different internal structure (something Date is clear in his book he has no problem with).»
Max Khesin: SICP feed fixed
A few people noticed that I managed to mislabel the files in the recent posting of iPod-compatible version of Structure and Interpretation of Computer Programs. This reminds me of high school math: I was quite good at all the steps, but invariably managed to screw up a minus sign somewhere... Sigh.I took care of this last night.
Max Khesin: Acronymizer in Python (and why does sort have to suck?)
When I am not wearing a cape and protecting the Universe from super-villans I mostly code a Windoze GUI for backoffice processing at a (albeit a very cool) financial company.A lot of our GUI is just a specific view of the database. We have some functionality where the user has to type in a column name. As DATABASE_COLUMN_NAMES_ARE_WAY_TOO_LONG_AND_UGLY I hardcoded 2-letter acronyms for some of them.Today the question came up whether this approach will scale to tables with a lot of columns.I immediately thought that 22^2 is quite enough possibilities, but then you have to take into account that acronyms have to actually sound a bit like the original, at the very least be composed of two letters of the original in ascending order.I figured that writing a script to do this would be faster than theorizing, so here is the result:http://fluidobjects.com/static/acronyms.py.
Django Weblog: Authentication docs
We've added docs on Django's authentication system -- users, groups, permissions and messages. It includes information on how to require user-login for a particular page, or pages, of your Django-powered site. This has been a frequently requested piece of documentation, so we're happy to have made it available. Of course, just like our code, we're always trying to make our documentation better. So, if you have questions, find errors or want to contribute tips/advice that you think were left out, just post a comment to the bottom of the document.
Nuxeo: Object event dispatching in Zope
Here are some explanations about what happens in Zope 3.2 (and Zope 2.9 when using Five) when an event notification is sent by some code, up to a specific subscriber. It focuses more specifically on object events, which go through some additional hoops. All this is complex because there are many simple components that are linked together. Let's start with some framework code that sends an event after an object has been added (similar to what zope.app.container.contained actually does): event = ObjectAddedEvent(ob, container, name) zope.event.notify(event) In zope.event we have the definition for this function: subscribers =  # registered subscribers def notify(event): for subscriber in subscribers: subscriber(event) During initialization, zope.app.event.dispatching has registered a subscriber: def dispatch(*event): # Iterating over subscribers assures they get executed. for ignored in zope.component.subscribers(event, None): pass zope.event.subscribers.append(dispatch) The function zope.component.subscribers will then call all matching subscribers. During initialization, zope/app/event/configure.zcml has registered a subscriber for zope.app.event.interfaces.IObjectEvent with the handler zope.app.event.objectevent.objectEventNotify: <subscriber for="zope.app.event.interfaces.IObjectEvent" handler="zope.app.event.objectevent.objectEventNotify" /> This handler does: def objectEventNotify(event): adapters = zope.component.subscribers((event.object, event), None) for adapter in adapters: pass # Getting them does the work. This means that the event will be redispatched, but this time a subscriber can match using multi-adaptation on both the object and the event interfaces, which gives much more flexibility and filtering possibilities. During initialization, zope/app/container/configure.zcml has registered a multi-subscriber: <subscriber for="zope.app.location.interfaces.ILocation zope.app.container.interfaces.IObjectMovedEvent" handler="zope.app.container.contained.dispatchToSublocations" /> Note that IContained, a base interface for most content objects, derives from ILocation, so this subscriber will match most content objects.