Thom Nichols

Avatar

Technology is evolution outside the gene pool

Articles tagged with 'Python'

QuiRk: A Cross-Platform QR Scavenger Hunt Game

Just last weekend was the 7th Wooly Fair, an arts and culture festival in Providence, RI.  My wife was asked to perform, and I went with her to planning meetings to see how I could contribute to the fair.  Being an engineer, not an artist, I thought "maybe I can write an app for the fair!"  Thus, the Wooly Fair QR code game for Android was born:

       

Two ...

Mobile Style Sheet: the Latest Blog Improvement

As I've mentioned before, I've made a lot of improvements to the blog engine that powers this site.  My latest enhancement is a mobile style sheet so the site looks just as good on an Android or iPhone as it does on a PC. 

The content is identical to what is served to a non-mobile client.  There's no user-agent detection going on, just CSS overrides ...

Lightweight Data Types in Python

I've been working on a Python project where system resources are very limited; as a result, I'm concerned about object overhead.  Additionally, the nature of the code requires a lot of data types (e.g. objects that have no methods, just a lot of properties.)  Python's namedtuple class lends itself to this use case, but it's not quite as flexible as I'd like ...

Use Python's threading.Event for interruptable sleep

As I've mentioned before, python's lack of a Thread.interrupt() method makes writing lively concurrent programs sometimes difficult.  One of the most common scenarios is when you want to sleep() for a period of time.  Yes, sometimes polling is the answer.  There are times when you really want to say "wait for some period of time..."   Except what you almost always mean is "wait for some ...

Python Concurrency using a State Machine

I've been doing steadily heavier Python development, lately running into some concurrency programming problems.  I never thought I'd say this, but Python's concurrency APIs look java.util.concurrent look light-years ahead.  Some of Python's libraries seem designed after the Java equivalents (see threading.Thread and threading.Condition) but there's still definitely a gap. 

One notable omission is a Thread.interrupt() call.  Of course ...