How to copy a file really slowly using Python

August 8, 2013 Leave a comment

Just realized that the poor performance I was seeing when downloading a file from Rackspace Cloudfiles to a local drive was due to shutil.copyfileobj without specifying a buffer size.  As I found out, the default buffer is 16k (just in case you’re running on a 640k server), increasing it to 1MB sped up the process from 17.8 seconds to 0.8 seconds, with 5MB down to 0.3 seconds (for files averaging about 3-4MB).

So remember: always supply a buffer size, and the 60x speed increase can be yours too!

Advertisements
Categories: Programming, Python

Mortality

July 16, 2013 Leave a comment

I just received an email from the Google Inactive Account Manager, reminding me of what will happen if I don’t log into my Google account for two months.  Because I’ll be dead.  Or something else.  But I can’t think of anything else.

Categories: Uncategorized

iNarcolepsy is contagious

July 31, 2012 Leave a comment

Just found out the hard way that putting a running MacBook on top of a closed, sleeping one will put the running MacBook to sleep as well

Categories: Fun Stuff

Article on Madison Digital Image Database 3

July 20, 2012 2 comments

This article appeared in  VRA Bulletin Summer 2012, Volume 37, Number 2.

Madison Digital Image Database 3

Andreas Knab, Lead Software Developer, Center for Instructional Technology and
Kevin Hegg, Assistant Director, Center for Instructional Technology, James Madison University Read more…

Categories: Uncategorized

Why Developers Keep Making Bad Technology Choices

July 19, 2012 Leave a comment
Categories: Programming

Sessions on new programming languages

July 18, 2012 Leave a comment

Over the past couple of days I attended several OSCON sessions on new (to me) programming languages:

  • CoffeeScript is a scripting language that compiles into JavaScript.  It looks very clean and uses whitespace/indentation just like Python does, which is great.
  • Erlang was not completely new to me, but I had not understood the overall architecture of the Erlang environment and its similarities to an operating systen.
  • Clojure, a Lisp dialect, seems the least practical for day-to-day use, but is also the most different and interesting to me.

Simple Sudoku solver in Python

July 6, 2012 Leave a comment

Since a new “hardest” Sudoku puzzle was just announced, I finally wrote my own Sudoku solver in Python.  I based it on some ideas from Peter Norvig’s Sudoku solver, but ended up writing everything from scratch.  The code is available on github.

Categories: Fun Stuff, Programming, Python