February 2008

Twisted AMP chat example

I wrote a simple little PyGTK chat program a couple of months ago, to learn the Twisted AMP protocol.

Someone just asked about bidirectional AMP on the Twisted mailing list, which reminded me that I should publicize this example a bit.

It's in a Mercurial repository (browseable over the web if you don't want to bother with Mercurial) at
http://ripton.net/hg/ampchat

Programming
Python

Comments (1)

Permalink

Cups stuck in landscape? Try gtklp

My printer (Lexmark Optra 312L, hanging off a Gentoo box's parallel port) had been stuck in landscape mode for a while. I couldn't find anyplace in the cups web GUI to fix this. Someone on the Gentoo forums recommend backing up then nuking /etc/cups, uninstalling then reinstalling cups, and reconfiguring the printer. That didn't work either.

Then I found gtklp. It's a little gtk app with the Tabbed Dialog From Hell interface. One of the 9 tabs is labeled Output. The Output tab has a portrait / landscape selector. Switched to portrait, hit save, and now the printer is back in portrait mode.

Linux

Comments (0)

Permalink

Don't buy an aluminum mountain bike with a non-replaceable derailleur hanger

Last October, I crashed on the derailleur side of my (old, low-end) mountain bike, landing on the rear derailleur. This bent the (replaceable) derailleur. It also bent the (aluminum, non-replaceable) derailleur hanger. Which means the frame was almost totaled. (Not quite, because it's still usable as a singlespeed.)

Don't make this mistake. Mountain bikes crash. Derailleurs and hangers bend. It's expected to have to replace a derailleur and a hanger if this happens. It's not okay to have to replace the whole frame. If you're shopping for a mountain bike, either pick a steel one (because bent steel can be safely bent back), or pick an aluminum one with a replaceable derailleur hanger.

(My replacement bike is a 1996 Specialized Ground Control A1 Aim. Most of the bike is aluminum, but the rear triangle is steel. So it pretty much nails this one requirement.)

Bicycles

Comments (0)

Permalink

"+" is valid in an email address, dammit

Dreamhost supports email addresses of the form base+whatever@domain.com

The mail goes to the same address as base@domain.com, but you can filter on the +whatever

It astounds me how many web pages refuse to accept an email address with a + in it as valid. It's valid. Really. I get the mail.

Parsing whether something is a valid email address is hard. (See the O'Reilly Mastering Regular Expressions book for a serious attempt.) If you're not willing to go to those lengths, Don't Try. You'll just make people with unusual-looking but valid email addresses mad.

If you really need the address to be valid, then send mail to it, and make the user do something to prove he received the mail.

If you don't, then trust the user. He knows more about his email address than you do.

Programming
Rant

Comments (0)

Permalink