Chronological Summary

All Posts Ever

2013 Feb 25

OS-9 Keyboard Codes

This chart has been haunting my desk drawer for more than twenty years. I have kept it because of nostalgia — not from any real likelihood of needing it again — and should post it here online on the slender chance that it might someday be useful to someone else:…

2013 Feb 14

WSGI and truncated chunked response bodies

I may be almost through with WSGI. While it has certainly worked for a number of my close-to-the-wire HTTP projects over the years, I seem finally to have reached an edge case where — as a standard — it cannot guarantee that I even return a correct response to browsers!…

2013 Jan 12

iPython Notebook and Astronomy at CodeMash

Another CodeMash is over! Bacon has been eaten, the Kalahari water park has echoed with talks about languages both static and dynamic, and one of the world's most eclectic programming conferences has sent more than a thousand attendees away happy. You're missing @brandon_rhodes #codemash talk. twitter.com/benjaminws/sta…— Benjamin W. Smith (@benjaminws)…

2012 Aug 23

Map Projection and Radarmatic

Developers often use Twitter to point out exciting new libraries, or share mistakes that might also catch others. But sometimes we are less positive and simply use Twitter to complain, as I did on Tuesday when I noticed that different weather radars on Radarmatic were not consistent in how they…

2012 Jun 14

Throwaway Commits on Heroku

As Ian Bicking himself once observed, the process of deploying an application to Heroku can be quite costly when measured in commits. Your Git history can become littered with dozens of tiny changes as you adjust your application so that everything — your database, authenticated memcache, remote logs — finally…

2012 Jun 4

Updates to my free chapter on Screen Scraping

There are two updates that I need to share with readers of the “Screen Scraping” chapter of Foundations of Python Network Programming, the book I revised for Apress in 2010 — a rewrite of the original edition by John Goerzen that was published in 2004. The chapter is now available…

2012 May 7

Moving home directory version control out of your way

If you keep your home directory under version control, then you may know the sinking feeling that comes from sitting down at work after a late night, looking for that brilliant fix you made right before bed, and finding that your commit is nowhere to be found. What happened? Upon…

2012 Apr 13

Introspect Python logging with logging_tree

It is frustrating that Python's logging module cannot display the tangled tree of configured loggers that often result from combining your own application code with several libraries and frameworks. So I have released a new Python package named logging_tree, which I announced last month during the PyCon 2012 closing lightning…

2012 Apr 6

Adventure in Python 3

I have just released adventure 1.2 on the Python Package Index, an update of my Python 3 port of the original Colossal Cave Adventure game that I announced more than a year ago during the final round of PyCon 2011 lightning talks. Written in the late 1970s, “Adventure” was the…

2012 Apr 3

Semantic Linefeeds

I give some advice each year in my annual Sphinx tutorial at PyCon. A grateful student asked where I myself had learned the tip. I have done some archæology and finally have an answer. Let me share what I teach them about “semantic linefeeds,” then I will reveal its source…

2012 Mar 30

Counting, without counting, in Python

It often irks me that the normal Python pattern for running the body of a loop n times results in the allocation and destruction of n integer objects, even if the body of the loop does not need them. # Creates one million integers for i in range(1000000): print #…

2012 Mar 13

Walking to PyCon on your own two feet

Before arranging for a cab ride or airport shuttle, have you considered that your own body is designed for traveling long distances under load? Last Tuesday I simply walked the 5 miles (8 km) from the San Jose Airport to the PyCon 2012 venue. My route included a stream lined…

2012 Jan 15

JavaScript Breaks Math

Why do we Python programmers stay so annoyed with JavaScript's broken this keyword? After all, every programming language has rough edges. The problem with this even turns out to be easy to work around once you learn the knack. So why does it feel like JavaScript has committed a fresh…

2012 Jan 10

Why am I going to CodeMash?

By this time tomorrow I will doubtless be wearing swimming trunks — in northern Ohio — in winter — while listening to people rave about Java and C# and Ruby and wondering what I have gotten myself into. I will be at CodeMash, a conference that was started by developers…

2011 Sep 10

Concentric CSS

(My official Concentric CSS “style.css” is in a GitHub repository) Perhaps my mind is unusually visual, but I have no idea how people clearly picture the effects of their CSS rules when following the common advice to sort their properties alphabetically within each declaration block (as in the answers to…

2011 May 13

Adding Compass to your project

The Compass CSS authoring framework has become one of the standard tools that gets installed when I start working on a new web application. I always version-control not only the .scss Sass source files that I myself write, but also the .css CSS files that Compass compiles from them. That…

2011 May 4

Mounting WSGI Applications Under CherryPy

Today I got stuck between a rock and hard place — or, more specifically, stuck between the assumptions of Robert Brewer and those of Ian Bicking. In case you ever try mounting a WSGI application underneath a larger CherryPy application, here is the story. Simple WSGI grafting Robert Brewer's CherryPy…

2011 Feb 20

Visible Indentation in Python Publishing

It suddenly occurred to me that I managed to write an entire blog post about my new book last month without so much as mentioning that it represents a landmark, so far as I know, in Python publishing. What was my big idea? That in printed Python code, indentation should…

2011 Jan 26

Grin and search it

I want to admit how much I am enjoying the grin search tool that lets you use Python regular expressions in recursive searches across your filesystem, automatically ignoring directories like .hg and files with extensions like .pyc and .jpg. Over the years I had already built a stable full of…

2011 Jan 24

Foundations of Python Network Programming: A Last Hurrah For Python 2

My long labor is at last at an end: Apress has published my rewrite of John Goerzen's Foundations of Python Network Programming (2004) and I have released the example programs as both Python 2 and Python 3 code in a Bitbucket repository and also as a zipfile on the Apress…

2010 Oct 19

CherryPy and running out of file descriptors during development

Well, that was interesting! A fellow developer complained that, following my recent introduction of ØMQ into our project, he could only go through a few cycles of editing the source code, saving his changes, and watching CherryPy automatically restart before it would fail with: IOError: [Errno 24] Too many open…

2010 Jun 15

Changed rules for Picasa tag searches

Well, drat. Several images disappeared from the Our Fresh World green-building web site because Google changed their Picasa API recently — and I must not be subscribed to the proper mailing list or blog to have been warned ahead of time. Where are incompatible Google API tweaks announced? The site…

2010 Jun 10

Grok has book. Book good!

I little suspected the great chasm that lies between the simple act of agreeing to review a book, and the actual exercise of sitting down later to write the review. It feels quite pleasant, really, to jot off a positive reply to the publisher's polite question. One feels magnanimous for…

2010 Jun 9

Mounting Windows shares in Linux userspace

A current project has forced me into the clunky world of Windows, to verify that a Python program compiles and runs there just like it runs under Linux. Instead of trying to port my entire development environment to Windows — which includes two decades of customizations and a small empire…

2010 May 14

Python multiprocessing is different under Linux and Windows

One of the great recent advances in the Python Standard Library is the addition of the multiprocessing module, maintained by Jesse Noller who has also blogged and written about several other concurrency approaches for Python — Kamaelia, Circuits, and Stackless Python. I have wanted to try the multiprocessing module out…

2010 Mar 21

Sphinx + Mercurial = My favorite CMS

Though I write and maintain some of the content for our Python Atlanta web site, updates and additional content often come in from other users. For example, our Plone interest group — headed up by Christopher Johnson — has their own page on our web site. And the information about…

2010 Feb 25

Ubuntu Python: raise an exception, import 190 modules

Imagine my surprise, while writing my first PEP 302 compliant import hook this afternoon, to carefully watch sys.modules for the results of my import but see it suddenly grow by nearly two hundred modules! What on earth had I done wrong? Some quick experiments revealed that my only sin was…

2010 Feb 24

Opening tabs remotely in Google Chrome

Now that I use Google Chrome almost exclusively, I miss the fact that a running Firefox instance could be controlled from the command line so that Emacs could call for a new tab when I clicked on a URL. It would run a command something like this: firefox -remote 'openURL(http://example.com/,…

2010 Feb 1

Leaving Python Magazine

It was with regret that I tendered my resignation yesterday as the Editor-in-Chief of Python Magazine. While the publisher will keep producing the magazine by distributing PDFs on the web site, the transition to the new format has dragged on long enough — both for both myself and our customers…

2009 Oct 20

The September 2009 issue of Python Magazine

The September issue of Python Magazine appeared on the web late last week and only now, as a new week has started, am I finally sitting down to announce it! The articles range from technically heavy development topics to high-level thoughts about the whole Python community, with plenty in between.…

2009 Sep 30

Google Earth and Middle-earth

Importing a normal, rectangular map of Middle-earth as a Google Earth overlay is too narrow toward the north. I wanted to measure distances in Tolkien's Middle-earth. While a flat map distorts such measurements, it occured to me that Google Earth can correctly measure both lines and paths across the curved…

2009 Sep 21

Python at the 2009 Atlanta Linux Fest

My Python table at the Atlanta Linux Fest. You can also watch a short video of me demonstrating a depth-first search to some students who dropped by the table. (Thanks, Richard Davies, for the video!) Running the Python table at the Atlanta Linux Fest this past weekend was a really…

2009 Sep 10

GetPaid needs customizable forms

I would like some advice from Zope and Plone folks about how to create forms that are not only easy for other developers to specialize, but which allow several specializations to be composed together. While I have used zope.formlib and z3c.form before for simple tasks, I have not yet been…

2009 Sep 7

The August 2009 issue of Python Magazine

The August issue of Python Magazine is out, and the cover issue is one of the most exciting that I have had the privilege to publish. Following up on his popular talk at PyCon 2009, professor of computer science Dr. Bill Punch has written an article for us with his…

2009 Aug 18

Start all of your commands with a comma

Like many Unix users, I long ago created a ~/bin/ directory in my home directory and added it to my PATH so that I could supplement the wonderfully rich set of basic Unix commands with some conveniences and shell scripts of my own devising. The problem, of course, was the…

2009 Aug 15

The July 2009 issue of Python Magazine

I am home from a relaxing vacation to the Midwest, and while I was gone last week my excellent publishing team released the July issue Python Magazine to the world. I am particularly pleased that two of the feature articles in this issue come from important segments of the Python…

2009 Aug 1

Installing "lxml" for Python under your WebFaction account

Well, drat. Thanks to more than an hour of work today, I have a pretty list of a few dozen commands that make it easy for a WebFaction account holder to install the powerful lxml Python package for parsing HTML and XML under their hosting account. You can read Ian…

2009 Aug 1

The Road to WebFaction

I am very happy with my first weeks of hosting sites at WebFaction. They have taken so much responsibility off of my shoulders. They run nginx in front of my web applications on my behalf. I fill out a simple form, placing Pylons under / and Wordpress under /blog, and…

2009 Jul 20

Plone and IRC

Hypothesis — the vibrancy of a framework's IRC channel is proportional to the amount of time that the framework takes to start up each time you tweak your code or settings and need it reloaded. Further hypothesis — this relationship is non-linear. My guess is that frameworks which take, say,…

2009 Jul 15

The terrible magic of setuptools

I am providing a bit of assistance to the wonderful Natural Language Toolkit Project, who have implemented a wide array of language processing algorithms in Python atop a common set of very sleek — and cleanly Pythonic — data structures for representing natural language. If you are at all interested,…

2009 Jul 9

The June 2009 issue of Python Magazine

The new issue of Python Magazine is out, and it's a technically hefty issue that, while lacking the kind of human-interest “what Python did for me” stories that I often use to balance the articles about programming, does do a really good job of showing the diverse kinds of problems…

2009 Jun 27

The Python language and poetry

If programming languages were poets, which poet would the Python language be? Obviously, Python would be e. e. cummings — the poet for whom whitespace was most truly significant!…

2009 Jun 5

The May 2009 issue of Python Magazine

The May issue of Python Magazine is now online! Obviously things fell a bit behind schedule this month, as I am writing this five days into the month of June. But with all of the excitement surrounding the publisher's flagship annual conference last month — php|tek 2009 in Chicago —…

2009 May 2

The April issue of Python Magazine

It was back in the early 1990s, if memory serves me, that the Coca-Cola company — it may have been in one of their annual reports — decided to change their perspective. They declared that the soft drink market, of which they held more than 50%, was simply too small…

2009 Apr 22

pyron: Making Python package development DRY to the point of no return

I finally snapped last week. After years of writing verbose and repetitive setup.py files for my Python packages, I am unable to write another. Instead, I have started writing Pyron, a tool that gathers the same information by inspecting a Python package itself. Not only does this mean that I…

2009 Apr 7

Applying PDF watermarks upside down

Now that the excitement of PyCon 2009 is over, it is time for me to finish this brief series of blog posts on watermarking PDF files. In the first post I outlined how GraphicsMagick and Adobe Reader proved essential to the project for their ability to produce correct PDF files…

2009 Mar 28

My first issue of Python Magazine

My first issue of Python Magazine is out! After two months of being tutored in the arts of magazine publishing by retiring editor Doug Hellmann, March has been my first month in the Editor-in-Chief chair of Python Magazine. It is exciting to have my first issue come out while I…

2009 Mar 15

Adding margins to PDF watermarks

This is the second article in my series on adding “watermark” images to PDF files, which sit behind any text and graphics that were already on the page. Last week I outlined the first two lessons that I learned while developing this watermark process: first, always use Adobe Acrobat to…

2009 Mar 11

I finally understand nested comprehensions

This entire blog post can be summarized in the words of Guido himself that I have just discovered down at the bottom of PEP-202 (“List Comprehensions”): The form [... for x... for y...] nests, with the last index varying fastest, just like nested for loops. Have you ever seen a…

2009 Mar 10

GraphicsMagick saved the day

I had never heard of GraphicsMagick until yesterday, when I discovered that the venerable, if clunky, ImageMagick suite was ruining one of my customer's print jobs by producing invalid PDF files. This is actually the third major failure that this particular project has encountered because of flaws in standard open-source…

2009 Feb 25

Installing Python packages for Emacs with virtualenv

The only rough edge I have found amidst the otherwise exceptional advice on Ryan McGuire's Enigma Curry blog is that Ryan recommends installing Python packages with: $ sudo easy_install package_url This means that his Emacs configuration — which, very generously, he has started maintaining as a project on github so…

2009 Jan 1

New Year's meme: What are the oldest files in your home directory?

Celebrate the new year with a blog post discussing the oldest files that are still sitting somewhere beneath your home directory! The procedure is simple: Run the following script in your home directory. (You might want to use less to read the output.) Ignore files whose date does not reflect…

2008 Dec 14

Why triple-quotes make PyFlakes hang Emacs

I need to refine the aspersions which I cast against PyFlakes last night in my response to Chris McDonough, answering his bounty against the bug that Emacs would hang in Flyspell mode when he typed triple-quotes. My email, I admit, was not entirely fair to PyFlakes; but you must remember…

2008 Dec 13

PyEphem now available for Python 3.0!

Eager not to be left behind by the advance of history, I have released PyEphem tonight for Python 3.0! After updating its C-language routines earlier this week, as described in my previous post, and adjusting its Python syntax, I thought that my work was done — until I received a…

2008 Dec 9

Porting a C extension module to Python 3.0

With several packages already advertising Python 3.0 compatibility, it seemed high time to look into releasing my PyEphem astronomy package in an edition compatible with the new language. But I hesitated: how difficult is it really, and how many hours of work will it consume, to port a C-language extension…

2008 Dec 4

Comprehension consistency at last in Python 3.0!

A new era is begun: Python 3.0 has been released, bringing the bright and burning lights of reason, consistency, and symmetry to bear on my favorite language. Guido van Rossum, the creator of Python, has carefully guided this final attempt to remove the warts that have accumulated over the language's…

2008 Nov 5

Rise and Fall of the Two Waldos

I am experiencing my Flickr photostream in an entirely new way thanks to the tools they introduced this year for monitoring the traffic received by individual photographs. The old, static parts of my photostream suddenly look dynamic: I can see the rate at which each old photo is continuing to…

2008 Oct 25

The idea of a term paper

Displaying their usual talent for excerpt, the folks at Arts & Letters Daily directed my attention to a recent article in The Smart Set with this intriguing summary of its contents: Term paper mill. Need $100 by Friday to keep the lights on? No sweat, if you’re a writer. Plenty…

2008 Aug 19

Reading Code: A Computer Science Curriculum

I developed the following ideas about how to teach computer programming during a recent conversation with Daniel Rocco, a professor at the University of West Georgia, and Georgia Tech grad student Derek Richardson, and I wanted to expand on the ideas here on my blog. I have been heavily influenced…

2008 Aug 11

Aphorism

Entertainment wants only to satisfy its audience; but Art will teach us new desires. (Penned after pondering the talk that Dana Gioia gave at Oxbridge 2008)…

2008 Jun 14

PyEphem 3.7.2.4, now on Launchpad!

I have decided to give my PyEphem astronomy library for Python a public source code repository, an open forum for user questions, and a bug tracker where my users can see the progress of their bug reports out in the open rather than having them scattered across our email inboxes.…

2008 Jun 13

Wordle

What fun! An application has been placed on the Web named Wordle which, given some paragraphs of text as input, produces very striking images by drawing the most important words from your document so that they are largest. The basic idea is a long-standing one on the Web, as exemplified…

2008 Jun 5

My NOLA Plone Symposium talk, “the Zope 3 Component Architecture”

I have delivered my “Zope 3 Component Architecture” talk to the 2008 North American Plone Symposium meeting here in New Orleans. I want to thank the folks at Enfold Systems both for hosting the Symposium, inviting me to speak, and for generously making it possible for me to attend! Here…

2008 Apr 16

Name your home machines using Tomato

Update (February 2009): thanks to an email I have just received asking how the mechanism described below is better than just assigning host names in Tomato "normally", I have discovered that this whole post was rather pointless. There is already a way to assign host names in Tomato: click on…

2008 Feb 27

How To Produce A Linux Screencast

Learning how to create Linux screencasts has been the most frustrating technical challenge that I have tackled for a very long time. I should have been worried when a search for “Linux video editing” returned, as its top hit, a bare and completely unstyled web page from 2002 which concludes…

2008 Feb 23

Presentations on Buildout and KSS

After several frustrating weeks learning how to create, edit, and publish a screencast under Linux (about which I will write a separate post), I have now published screencasts of both presentations that I gave at the PyAtl meetup in January. I opened with a talk about the import statement, and…

2007 Dec 11

New PyEphem release: 3.7.2.2

On Sunday afternoon I released a new version of PyEphem, which is available from the Python Package Index as version 3.7.2.2! I want to thank the users who spurred its development — in particular, John Duchek of the Astronomical Society of Eastern Missouri encouraged me both to create the new…

2007 Nov 23

A database symbol for GraphViz

Download the source for my GraphViz database symbol featured in this article: DatabaseShape.ps I have started using the GraphViz application, which accepts a list of nodes and arrows, and figures out how to attractively arrange them in a diagram. For example, you can very nearly produce this output: by supplying…

2007 Nov 9

My November Grok Presentation

In this post, I provide the slides and examples from a recent talk that I gave to some fellow software developers at Georgia Tech. Many of them were not familiar with web frameworks, and I wanted to introduce them to two common concepts: the idea of “convention over configuration,” and…

2007 Nov 9

PyEphem available for Windows!

Over the years I have received many requests from frustrated Windows users, asking for a Windows-native version of my PyEphem astronomy library for Python. For most Windows users, an attempt to build the extension ends abruptly with the terrible and famous message: error: Python was built with version 7.1 of…

Let's Discuss the Matter Further Brandon Rhodes