Python

Shane Hathaway on July 30th, 2012

Long time no blog. I’d like to break the ice with a lighthearted Python code readability optimization discussion. I need a Python function that generates short, random, numeric codes of a specified length using a secure random number generator. The codes must not start with 0, but the output should be a string. This was [...]

Continue reading about Secure Random Code Generator

Shane Hathaway on March 16th, 2011

There has been a lot of discussion in the Pylons/Pyramid community about the concept of traversal.  Some people, when faced with traversal for the first time, get confused and want it removed from Pyramid.  They want Pyramid to support only routes, a different way of achieving a similar goal. Personally, I think traversal is simpler [...]

Continue reading about Pyramid and Traversal

Shane Hathaway on January 19th, 2011

… and I think I just wrote it. For years, I have wanted a Python TCP server framework with the following features. Multi-process: I want the framework to be able to use all available processors and cores with no GIL (global interpreter lock) contention.  This is important for CPU-bound applications. Multi-threaded: Each process should have [...]

Continue reading about The Holy Grail server framework

Shane Hathaway on December 21st, 2010

I’ve been working on a cool project for the past year.  I haven’t been able to share much about it, but now that it’s open to the public, I intend to talk about it and explore it in the open.  It’s built on Python, Repoze.BFG (to be replaced with Pyramid soon), PostgreSQL, Buildout, and a [...]

Continue reading about WingCash is Open!

Shane Hathaway on November 19th, 2010

This test compares the speed of various object serializers available for Python. I should have run it long ago. It opened my eyes a bit! import time import json import simplejson import marshal import pickle import cPickle import cerealizer def time_module(module): d = {} for k in range(100000): d[str(k)] = -k start = time.time() enc [...]

Continue reading about Python JSON Performance

Shane Hathaway on September 18th, 2009

I’ve been racking my brains to find something to present at PyCon 2010. I have been trying to find something good to present since PyCon 2003, when I last presented at PyCon.  (I talked about Ape, the Adaptable Persistence Engine for Zope.)  I really liked the experience of presenting and it led to a lot [...]

Continue reading about PyCon 2010: I Want to Present Something

Shane Hathaway on April 24th, 2009

I have been working on a project based on repoze.bfg. BFG is a system for building web software and it has deep Zope roots. (Incidentally, the BFG 9000 weapon in Doom and Quake is quite fun.  For stress relief, it’s better to play against the computer rather than people on the Internet because the computer [...]

Continue reading about Musings on BFG

Shane Hathaway on April 2nd, 2009

At the Zope sprint held during PyCon 2009, we had a multi-day discussion about the Zope publisher.  Some people were expecting a fight between Jim and me about the best way forward.  So what happened?  Read on!

Continue reading about Zope Publisher Decisions at PyCon 2009

Shane Hathaway on March 25th, 2009

I have been planning to compare mod_wsgi with paste.httpserver, which Zope 3 uses by default.  I guessed the improvement would be small since parsing HTTP isn’t exactly computationally intensive.  Today I finally had a good chance to perform the test on a new linode virtual host. The difference blew me away.  I couldn’t believe it [...]

Continue reading about The Fastest WSGI Server for Zope

Shane Hathaway on February 17th, 2009

I like to believe that I am a competent software developer in both Python and Java.  As a competent developer, I find that certain things are generally much easier than other things. For instance, I just spent a frustrating week working out how to install a Shibboleth identity provider, yet I never got it working [...]

Continue reading about Anecdotal Evidence