Tim Hatch

Weblog | Photos | Projects | Panoramas | About

12 Days CPI 29 Nov, 2006

Twelve Days of Christmas Price Index

Via Cecilia's Blog on PHD Comics

Live to Code 26 Nov, 2006

Spotted in the New Yahoo! Photos source code:

  Live to Code, Code to Live...
  -The Skids 

Debian Router Scheme, Part 1 24 Nov, 2006

At home I have three computers in my room, connected over gigabit to each other, with the rest of the house consisting of four more computers, plus two laptops over wireless. This currently goes through a Netgear WGR614 but it requires periodic resets (once a month or so).

I had a plan (more of a scheme) to put together a computer in an aluminum tool case, which was originally going to be an Athlon XP 1800+ (Tbred-B) but it burned up when I bumped it wrong (sad face). The current configuration is:

  • Arandis: Dual Athlon XP 2100+ (3495 bogomips x2), Realtek 8169 gigabit
  • Harvey: Athlon 64 3000+ (4023 bogomips), Realtek 8169 gigabit (in addition to an nVidia CK8S onboard)
  • Aeryn Sun: Powerbook 1GHz with onboard gigabit
  • Kianna: Celeron 566 (Cognac board, 1118 bogomips), Realtek 8139

Most of these hardware choices were made for easy Linux compatibility, but Kianna was purchased for The Scheme with a 128MB stick of ram for $16 shipped on eBay. It’s only got three PCI slots, but onboard video, audio, and two ports of USB 1.1. Looking around for extra obsoleted parts, I found a 256MB stick of ram, a 4-port pci nic which is a Realtek 8139, a Uniden PCW200 (802.11b) which works with the Orinoco driver, a 400w power supply, 80gb hard drive, iMac DV USB keyboard, and a 24x cd burner.

One word of warning for the Cognac board, the onboard video freaks out the Debian installer for some reason, and a 2MB Trident card I had around freaks out after running for an hour or so, and defaults the foreground color to blue. Once installed though, I plan to run headless so this isn’t an issue. The first major problem I had is that this board is designed to slide into a case that has power button fingers that contact little solder pads. After shorting these once with a paperclip, I very quickly found the “turn on after power failure” option in BIOS and am able to just reconnect power to turn it on.

What I want to end up with is the single NIC to the outside world, the 4-port and wireless to the internal network (bridged), and various services running on the box, to include knockd, name-based reverse proxy for web, class-based queueing (which is why it needs to replace the WGR614), and dns caching + dhcp (both conveniently provided by dnsmasq).

The base Debian install without much else is taking up about 400MiB on the drive, which I’ve partitioned such that large data will be kept on /home so I won’t run out of space on / (that has happened more times than I care to admit). I’ll probably bring up an instance of http-replicator and squid so that’s on a box that’s always on. The wireless as a client is supported out of the box on Debian, and for an open network was able to DHCP without any additional intervention from me. We’ll see how it works once I start adding the routing and encryption.

Just for reference, here are the results of lspci on the respective cards:

  • Airlink brand gigabit adapter: Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10)
  • Uniden PCW200: Intersil Corporation Prism 2.5 Wavelan chipset (rev 01)
  • 4-Port NIC: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10), same as the other single-port 8139-based boards I have around.

Normalizing Likert Scale 22 Nov, 2006

For one interesting project I had recently, I needed to find a way to normalize scores produced by several different people. Some people (like me) would use the whole scale, while others might give all 7's with just a couple of 6's. With enough data, though, I discovered a quick way to make it work (and I don't know the name of this technique, as I'm sure it's been done before).

An example will perhaps make it clearer. Suppose that Alice is evaluating several people, including Bob. (Yes, the same Alice and Bob from cryptographic examples. Does that matter? No.) Alice rates 9 other people a 7 on a given question, yet Bob gets a 6 from her. That 6 is important, since it's the only one that deviated from "the pack." My first attempt at this used just the difference from the mean, in # of standard deviations. This was easy to compute but kept the entire spectrum weighted evenly. I finally settled on using sqrt(# of sd away from mean) to weight values a bit closer to 1.0. Bob's relative score, in this case, would be ((6.0 - avg([7, 7, 7, 7, 7, 7, 7, 7, 7, 6]) / SD([7, 7, 7, 7, 7, 7, 7, 7, 7, 6])) ** 0.5. The mean in this case would be 6.90 and the SD 0.316. Thus his difference (-.90) is 2.85 SD units, which when passed through the sqrt, is 1.68. This would be the relative score as assigned by Alice.

Others might rate Bob on the same question, but their individual relative scores would depend on what they gave other people on the same question.

Doing this in PHP took a lot of rethinking to use a bit of constructive laziness and precalculate all the means and standard deviations of each evaluator-question pair, since they would be needed many more times. Without this optimization, fetching every time from the database became such a burden that the script would time out before doing anything useful.

Tilly Comes to Denton (again) 22 Nov, 2006

Tilly and the Wall dropped by Denton again to end their tour last week, and were awesome as usual. I am not known for writing about live music here, and this should be considered an exception.

I first found out about Tilly about a year ago while browsing someone's iTunes share on the UNT wireless network. One of the Apple users pointed out that someone's share had some interesting local music on it including Toad the Wet Sproket, whose music I still have not found time to listen to. I did, however, listen to a couple of songs by Tilly around April 2006, off the EP (I guess it's an EP) Woo!. I was hooked, and found out that they were on tour, and visiting Denton in July-ish. I told Camo, who was similarly enthralled with their unique sound and got to see them first in Washington, DC where she was staying. She left a note with the band, who carried it with them all the way to the tour here, some weeks later. I actually didn't find out that Jamie did tap percussion till the week before the show, and I'm glad that point hasn't become so kitschy that everybody knows it as some random weird thing before even hearing the music.

When Tilly came to Denton in July-ish, they kept track of the note and announced it to everyone, which was really sweet of them! The previous stop on the tour (which I remember as being Houston, though I didn't write it down) were so mean as to swipe all their shakers, so the band only had confetti eggs when they came.

Camo and I decided to remedy this, and got them a set of proper maracas, painted them up with the Woo! hearts among other things. The EP is long since out of print but one reviewer had it on his website which was still in the Internet Archive, thank goodness.

We met lots of neat people waiting in line for the Nov 11 concert, many of whom had been to the previous show. One group directly behind us even made up barbies like the members of the band!

Derek twisted his ankle really badly right before the show, but played on through with short interruptions to grab more ice from the bar. He's a real trooper, and all the fans were nice enough to pretend that everyone had left and it was encore time, then let them go... but Derek stayed on his case and signed autographs till way past when I would have if my ankle was hurting.

Farewell Mr. Chopsticks 21 Nov, 2006

Mr. Chopsticks is gone.

Man Highlighting With Enscript 16 Nov, 2006

I’ve been fixing a bunch of outstanding things that bugged me in Trac this week, and one of those is missing mime-types on several of the files in the source tree. For example, there are some manpages. I had no idea what mime-type these were supposed to have, so (about three days later) I found out that manpage source is intended to be processed with troff and that nroff is apparently a newer alternative. Most of the interesting-looking commands in manpage source are in some sort of macro package. I thought I’d set the proper mime-type and see if enscript would properly highlight them, and… it won’t. Its dialect called nroff is definitely not the one that manpages, emacs, and vim call nroff format. I had meant to take a class on parser generation at UNT, but it didn’t fit my schedule and thus I never learned all about NFA’s, DFA’s, and how to use unix text processing tools “the right way.”

Left on my own, one further day later, I’ve hacked around with states and enscript enough to make a passable parser which works for what I need it to. It’s kind of a quick hack, and doesn’t do any parsing of complex arguments that nroff.el mentions might exist, but it works for the random manpages that I threw at it. Feel free to send me improvements!

See my manpage.st for states. Place into $PREFIX/share/enscript/hl/ and to test run something like echo "<pre>" > test.html; enscript --color -h -q --language=html -p - -Emanpage /usr/share/man/man1/chmod.1 >> test.html; open test.html on the Mac.