New Year's programming resolutions

It’s that time of year. In no particular order, here’s a quick list of goals for Paul-as-developer in 2007.

  • Convert my remaining legacy PHP code (side projects and regular work both) to Django.
  • Write a useful PyObjC application.
  • Make some kind of contribution to Python itself, if possible.
  • Continue to add revision control and deployment automation to existing projects, as well as using it on new projects.
  • Continue to add unit tests to existing projects, as well as using them on new projects.
  • Learn a new language well enough to write a useful (small) application. Current candidates (all of which I’ve done at least enough reading on to have specific reasons for my interest, and some of which I’ve written toy programs in) are Haskell, Common Lisp, Io, Objective-C, and Ruby.

So, what about you? What are your coding goals for 2007?

dpaste.com update

My little pastebin site, dpaste.com, has been chugging along nicely since I announced it here about six weeks ago. Today I updated to the very latest Pygments codebase, which allowed me to add colorizers for Apache config files and bash scripts.

I’ve also started to add some Django-specific rules to the Python colorizer; it now recognizes Django model field types (model.CharField and the like). My thanks go to everyone who’s been using it, especially those who have given me feature suggestions and problem reports.

99-byte Python quicksort

Update: Browsing through my Python Cookbook this evening I discovered entry 5.11, “Showing off quicksort in Three Lines”, which includes some code very much like mine below. The entry does a good job of emphasizing that these bits of code are perhaps to be savored but not to be actually used. It also includes an insanely (impressively?) convoluted version that uses three lambdas in a single line and weighs in at 105 bytes. I thought this might be the best possible in Python 2.4 and earlier, but in fact a simpler version can be constructed using the old short-circuit logic trick, and at 94 bytes it’s even smaller than my original. Here it is: q=lambda s:len(s)and q([x for x in s[1:]if x<s[0]])+[s[0]]+q([x for x in s[1:]if x>=s[0]])or s

Enticed by the lovely Haskell quicksort example, and sullied by the code-crunching ways of Codegolf, I decided to see how small a Python quicksort function I could write. I stopped at 99 bytes.

Top 20 MySpace passwords

Bruce Schneier has an enjoyable article up on Wired News that describes what he learned analyzing some password data from a recent MySpace phishing attack. In it, he lists the top 20 most common passwords in his sample of 34,000:

password1, abc123, myspace1, password, blink182, qwerty1, fuckyou, 123abc, baseball1, football1, 123456, soccer, monkey1, liverpool1, princess1, jordan23, slipknot1, superman1, iloveyou1 and monkey.

Best quote from the article: “I don’t know what the deal is with monkeys.”

Photoshop CS3 beta

Update: It’s out. Download here. Also see PhotoshopUser.com’s review of new features.

In case you haven’t heard, Adobe’s releasing the beta of Photoshop CS3 in a few hours. It will be interesting to see how much of the Lightroom-style interface experimentation, if any, has made it in there.

This is especially big news for Intel Mac users, who have been stuck with Rosetta emulation for Photoshop.

Note that the other Creative Suite apps – remember them? – are not covered in this release, except for a “major upgrade” to Bridge. Also note that without a CS2 serial number, your download will only work for two days.