by Brandon Rhodes • Home

All Posts Ever

2019 August 23 Animating Ptolemy’s Equant with Python, SVG, and CSS

[UPDATE: A full Solar System model is now available that you can view, animated using the techniques described in this post! See Ptolemy’s cosmos, to scale.] You will recall my previous blog post that tried to build the necessary scaffolding for me to finally…

2018 August 4 Animating Saturn with matplotlib, a subclass, and mock.patch()

em>Based on my lightning talk at PyOhio 2018 I hope that this comes across not as a complaint about matplotlib, but as a celebration of tools that a dynamic language like Python offers in situations where a library is seriously misbehaving and needs some crucial…

2018 June 16 Learning SymPy while eliminating trigonometry from rotations

I have played with Python’s SymPy symbolic math library before, but for the first time last week I used it to solve a real problem! In the process I had to confront three errors in my understanding of how SymPy works: I had somehow imagined that SymPy was…

2018 March 31 Computing a final Tiangong-1 pass with Python

Do you remember the thrilling re-entry scene at the end of the movie Gravity? The Chinese space station Tiangong-1 is orbiting at thousands of miles per hour when (spoiler) it dips fatally into the Earth's upper atmosphere. The drag buffets and tears at the…

2018 March 30 A New Driver for the Original Twiddler

The practical take-away from this post is that if you’re ever trying to debug serial communications with a device that — against all tradition — only transmits when the Data Terminal Ready line is clear (devices should normally do the opposite: transmit only…

2017 August 3 Fixing OpenConnect’s VPN Search Domains on Ubuntu

A quick technical note about VPN hostnames on Ubuntu Linux, since otherwise I will forget: If other users of your VPN can refer to hosts by an unqualified hostname, but an Ubuntu user like you receives a not found error for the same hostname, then try creating…

2016 June 9 PyCon Trivia Night, Third Edition

At PyCon 2016 it was my honor, for a third year in a row, to host a Trivia Dinner on the first evening of the conference! This year’s venue was the storied Crystal Ballroom, a music venue in Downtown Portland’s west end. To make sure that our event took…

2015 April 16 PyCon Trivia Night, Second Edition

As was the case during first year that the conference was in Montréal, I was invited for PyCon 2015 to lead an evening dinner trivia contest on the first full conference day. Wanting to help the audience celebrate all of the advances that are being made…

2014 April 29 The First-Ever PyCon Trivia Night

PyCon seems to find new ways of fostering community single every year. This year’s conference in Montréal featured the début of official Friday night dinners which I first learned about from a surprising email entitled Want to MC a trivia night at the PyCon…

2014 February 14 Learning Pandas through payroll taxes and paystubs

I will admit it: I only thought to pull out Pandas when my Python script was nearly complete, because running print on a Pandas data frame would save me the trouble of formatting 12 rows of data by hand. But as I added the import statement, it suddenly struck…

2013 November 13 Choosing your salary under a SEP, SIMPLE, and a Solo 401k

If you have elected S-corporation status for your small consultancy and maintain yourself as the only employee, then you have an interesting choice in front of you each year: at what level should you set your own salary? I used to think that the answer was…

2013 September 3 Untangling the Big Pharoah’s “Terrifying” Chart

An interesting diagram has been making the rounds on the Internet. Attributed to a Twitter personality named @TheBigPharaoh — whose tweets draw attention to the humanitarian and human rights situation in Egypt — it has been cited by no less an authority than…

2013 August 2 Example PyCon talk proposals

It was exactly one month ago that the PyCon site swung back into action for another exciting year. Talk submissions for Montréal 2014 are by now piling up quickly. You can now view the Call For Proposals announcement on our blog at http://t.co/kt7P2PinIY—…

2013 February 25 OS-9 Keyboard Codes

I designed and printed this chart long ago. It has now 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…

2013 February 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…

2013 January 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…

2012 August 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 constructive and simply use Twitter to complain, as I did on Tuesday when I noticed that different weather radars on…

2012 June 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…

2012 June 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…

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…

2012 April 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…

2012 April 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…

2012 April 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…

2012 March 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):…

2012 March 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…

2012 January 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…

2012 January 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…

2011 September 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…

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…

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.…

2011 February 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,…

2011 January 26 Grin and search it

Note that as of early 2013, I have switched to using ag, the fabulous Silver Searcher. While grin was fun, it was slower and does not support a per-project file like .agignore which is essential to keeping single-line minified JavaScript…

2011 January 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…

2010 October 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…

2010 June 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.…

2010 June 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…

2010 June 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…

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…

2010 March 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…

2010 February 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…

2010 February 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…

2010 February 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…

2009 October 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…

2009 September 30 Google Earth and Middle-earth

Update: I have written a script that completely automates the process of building and positioning the Middle-earth overlay described in this old blog post! Simply download the Python script inside this gist, run it, and open the resulting…

2009 September 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…

2009 September 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…

2009 September 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…

2009 August 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.…

2009 August 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…

2009 August 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…

2009 August 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…

2009 July 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…

2009 July 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…

2009 July 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…

2009 June 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! Date: 27 June 2009 Tags:computing, python If programming languages…

2009 June 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…

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%,…

2009 April 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…

2009 April 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…

2009 March 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…

2009 March 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,…

2009 March 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.…

2009 March 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…

2009 February 25 Installing Python packages for Emacs with virtualenv

Update — my entire Emacs configuration is now public, not just the little snippet that is shown in this old blog post. Simply visit my dot Emacs repository on GitHub at the following URL: https://github.com/brandon-rhodes/dot-emacs The only rough…

2009 January 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.)…

2008 December 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…

2008 December 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…

2008 December 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…

2008 December 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…

2008 November 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…

2008 October 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,…

2008 August 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…

2008 June 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…

2008 June 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…

2008 June 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…

2008 April 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…

2008 February 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…

2008 February 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…

2007 December 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…

2007 November 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…

2007 November 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…

2007 November 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…

2003 December 26 Transferring files from the UNIX PC

The Unix PC was a 1980s-era personal computer … I recently decided to copy the files off of my account on an old Unix PC before they are finally lost to a hardware failure. This turned out to be more involved than I expected, requiring an impromptu refresher course on its user interface and communications software. Here I present the results so that others who want to salvage data from these venerable personal computers can do so with the minimum of hassle. …

©2021