Skip to main content

Posts

How DOS 1.0 cost me an hour of scratching my head

A couple months ago, I migrated my text rpg Carnage Blender to a new server, with Ubuntu 6.06 on the new box. For an unknown reason, ftstrpnm on the new box wouldn't generate the pngs I used in my captchas. It was easier to just check in the images from the old machine into the my svn repository than debug this, so I did. The downside was that my working copy on my Windows laptop stopped being able to update from the repository. It would get to "words/con.png," and error out. Google, for once, didn't turn up anything useful. Today I got motivated. I tried all kinds of ways to get this to work. A new checkout had the same problem on Windows, but on Linux worked fine. The svn command line client for windows didn't work any better than Tortoise -- instead of "Error: Can't open file '...words\.svn\text-base\con.png.svn-base': Access is denied", it barfed con.png to stdout, and died. This was a clue, but I didn't realize that until...

It's time for python development to open up a little

I found out from Brett Cannon's blog that an abstract base clase (ABC) PEP has been accepted. I don't like this PEP. It's a very big (and more important, inelegant) change to Python's style. But my real complaint is that as big as this change is, and as much as I try to stay current with Python (subscribing to 30+ blogs) I didn't have a chance to get involved in the discussion until after the PEP was already approved. Python is big enough now that there should be some mechanism for feedback from the community before the priesthood of python-dev writes something in stone. Currently, if you want to know about PEPs before they are approved, you have to subscribe to both python-dev and python-3000 (which isn't linked from either the mailing lists page or the dev page , btw). I really don't care about the vast majority of these lists' traffic but PEPs, at least some of them, are important. If the python-dev summaries ever got updated this might be...

Best Python book for beginners

It's really surprisingly difficult for someone who has been programming for a long time to write about programming at a level appropriate for real beginners. The first time I taught a class full of beginners at Neumont, I tried to take things as slow as possible. Then I spent the next week covering the material from the first day even slower. So when the UGIC asked me to recommend a book to get for the participants in the Introduction to Python, I looked at all the ones I could find, but they all either assumed too much existing knowledge or covered material that would just confuse a beginner. Often both. But then Michael Bernstein pointed me to Python for Dummies . If you're looking to teach beginners, or you're a beginner yourself, Python for Dummies is by far the best option. There's a few sections that are strikingly inappropriate for a book at its level (new-style classes!?) but it's still much, much better than any of the other books on the market in ...

Introduction to Python slides

Here are the slides from my introduction to python at the UGIC conference today. This presentation was meant for people with little to no programming experience. So I deliberately kept it pretty basic, and in fact in 90 minutes we only covered up to about slide 20 in the pdf. I also added an exercise before moving on to slide 10. ("Read 3 integers into a list, and print the sum.") There were 17? people there (which was the room's capacity), so it was very nice to have Kevin Bell also answering questions individually during the exercises.

Mercurial presentation slides

Thursday I presented on distributed source control and Mercurial to the utah python ug. Here are my slides. Then on Friday, Mozilla announced that they're moving from CVS to Mercurial , joining OpenSolaris and Xen and others on hg. It's exciting to see what is still a small and elegant tool gain traction like this, even though in some ways hg (and dscm in general really) is still in the early adopter stage.

Mozy code deathmatch

My employer, the creator of Mozy, is running a programming contest this Saturday. 9 languages are allowed. The first 2 rounds are online; the finals are in American Fork (Utah), but if you make it that far you're guaranteed to win some money. (We did this last year too; this year the prize money is doubled to $20k. Not to mention how we are super-experienced contest organizers now!)

One thing I don't hate about Python

Sure, some things about Python bug me. But that's not what this is about. I wanted to react to Jacob Kaplan-Moss's gripes instead of promulgating my own. Specifically, his problem with Python's interfaces, or lack thereof. I think I can keep this brief: interfaces are a hack that Java uses because Gosling et al thought multiple inheritance was too confusing and/or dangerous. (I believe I've read something recently where Gosling said that this was one decision he might do differently if he were re-designing Java now with the benefit of hindsight, but I can't find the source. Anyone remember seeing that?) Python has MI. It doesn't need interfaces. I'm a little baffled that someone on the django core team would cite this as a problem with Python. Jacob's precise objection is, I shouldn’t need to care care about the difference between something that pretends to be a list and something that really is a list. That's just it! You don't...

Introduction to Python at UGIC conference

I'll be giving a (very!) introductory Python workshop at the Utah Geographic Information Council conference in April. After my 90 minutes, Kevin Bell -- also of the utah python user group -- will present on specific GIS applications. (Apparently Python is particularly big in GIS these days because one of the big vendors, ERSI, takes Python pretty seriously .)

PyCon SQLAlchemy tutorial slides

My SQLAlchemy tutorial went pretty well for the most part. It was a fast pace but most people kept up pretty well. If I did it again I would add more of an intro to ORM in general for people who had never used one, but over half the attendees had used SO or django's or tried SA already. I would also paste more code from my slides into the samples download to save people typing during the exercises (I had some, but I would do more next time). I think most people liked it; the main exception was one fellow who was in way way over his head and visibly pissed about it. (I used a list comprehension at one point and he had no idea what it was.) The slides are here. (The .py files referred to in the slides have also been moved to the jellis/ subdirectory.)

Spyce at PyCon

I'll be representing Spyce as a late addition to the Web Frameworks panel. I'm also planning a lightning talk on Ajax in Spyce 2.2 (which will be released as soon as I finish getting the docs in shape) and an open-space Introduction to Spyce. See you there!

SQLAlchemy slides

I presented on SQLAlchemy at the Utah python user group last Thursday; slides are linked here . In retrospect, for a shorter presentation like this I should probably spend more time talking about the ORM features, and less about the SQL layer. Although the SQL layer is useful on its own, and essential for doing advanced mapping, I don't think it has the sex appeal that the ORM has. (Although I do think the first part, about why ORMs should allow you to take advantage of your database's strengths rather than being limited to a MySQL 3 feature set, was useful.)

Komodo 4 released; new free version

ActiveState has released Komodo IDE 4 . Perhaps more interesting, if you're not already a Komodo user, is the release of Komodo Edit , which is very similar to the old Komodo IDE Personal edition, only instead of costing around $30, Komodo Edit is free. The mental difference between "free" and "$30" is much more than the relatively small amount of money; it will be interesting to see what happens in the IDE space now. After a brief evaluation I would say Edit is perhaps the strongest contender for "best free python IDE." The only serious alternative is PyDev, which on its Eclipse foundation provides features like svn integration that Edit doesn't. PyDev also includes a debugger, another feature ActiveState would like to see you upgrade to the full IDE for. But Komodo is stronger in other areas such as call tips and, well, not being based on Eclipse. I also think its code completion is better, although this impression is preliminary. It...

Caution: upgrading to new version of blogger may increase spam

I was pretty happy with the old version of blogger, but I upgraded today so I can use the new API against my own blog. So far I have 4 spam comments (captcha is still on) versus about that number for the entire life of my blog under the old blogger. Bleh. Could just be a coincidence. I hope so. (Update Feb 26: A month later, I've had just one more spam comment. So it probably really was just coincidence.)

Abstract of "Advanced PostgreSQL, part 1"

In December, Fujitsu made available a video of Gavin Sherry speaking on Advanced PostgreSQL . (Where's part 2, guys?) Here's some of the topics Gavin addresses, and the approximate point at which they can be found in the video. [start] wal_buffers: "at least 64"; when it's ok to turn fsync off [not very often]; how hard disk rpm limits write-based transaction rate, even with WAL 00:12: wal_sync_method = fdatasync is worth checking out on Linux 00:13: FSM [free space map], MVCC, and vacuum; how to determine appropriate FSM size; why this is important to avoid VACUUM FULL 00:22: vaccum_cost_delay 00:26: background writer 00:30: history of buffer replacement strategies 00:37: scenarios where bgwriter is not useful 00:41: how random_page_cost affects planner's use of indexes 00:47: effective_cache_size 00:49: logging; how to configure syslog to not hose your performance 00:52: linux file system configuration 00:58: solaris fs...