Friday, November 9, 2007

hedgehog


\\\\\\\\\\\\\\\\\\\\\
\\=====================\\\\\.
\============================- \
\============================ \
\=========================== o \
\=========================== ` .
----\\\-------------------\\\---------'

Friday, October 12, 2007

blinkenlights

I made yet another blinky-light circuit

This one has 16 LEDs in a row. They all turn on in sequence, then they all turn off. Very simple.

It's a bit of a random design because of the parts I had at hand. In particular I didn't have any shift registers so I used 74574 8-bit D flip-flops.

The only part that I think was a little bit clever is the initialization circuit. When the device is powered up something has to feed the shift register zeros (or ones) for a while, until all 16 bits are cleared. This is just a comparator with an RC delay, but we want the capacitor to discharge quickly when the power is turned off. When the power is turned off, C2 discharges through D2 and the power supply load. Note that the delay could have been a lot quicker if I had tied the comparator output to the tri-state enable pins of the '574s rather than the input of the shift register. I think I was afraid that the LEDs and resistors in series wouldn't be good enough pull-downs for the inputs. Anyway, this design is vaguely robust against an LED becoming disconnected.

Wednesday, October 3, 2007

Insurance

I can think of two songs that contain the word "insurance":
  • "Desolation Row" by Bob Dylan
  • "Love At The Five & Dime" by Nanci Griffith
But there must be more...

Monday, August 13, 2007

In the name of homeland security?

My new DSL modem is being held hostage by the government. Or...something.
Update: apparently this just means the UPS driver couldn't deliver the package because of a locked gate. Odd.

Thursday, August 2, 2007

/* People celebrate: "We love our President!" */

I've noticed that often when I am tempted to make witty comments (== lame puns) in code it means that there's a better way of doing it. For example, today I wrote this:
parser = OptionParser(usage=usage)
parser.add_option('-d', '--delay', action='append', dest='delay',
help='Delay, in milliseconds, to configure link')
parser.add_option('-b', '--buffer', action='append', dest='buf',
help='Size of traffic-shaping buffer for link, -1 to leave unset')
parser.add_option('-s', '--speed', action='append', dest='speed',
help='Speed of link, -1 to leave unset')

...snip...

(options, args) = parser.parse_args(sys.argv)

...snip...

# we want empty lists, not Nones. The Nones, of course, being either the
# fifth or the seventh of the month in the Roman calendar.

if not options.delay:
options.delay = []
if not options.buf:
options.buf = []
if not options.speed:
options.speed = []

I had forgotten that the OptionParser lets you specify a default value for the options.

I don't know what you can infer from this. But it's interesting.

The title is the comment that precedes the function tcp_try_undo_recovery in net/ipv4/tcp_input.c in the linux kernel. It's actually more documentation than most of the functions in the linux TCP stack have. I never thought I'd actually want to see a Glen-style header again...

Friday, July 20, 2007

Silencing the Silent Spinner

The Silent Spinner is an exercise wheel that has a fancy ball bearing thingy that keeps it from sqeaking all night. (By the way, what's up with exercise wheels? Why do rodents voluntarily use a device that seems like something from the Spanish Inquisition? All night? In my room?)

After a year or so, though, my Silent Spinner (well, my mice's Silent Spinner, really) was starting to rattle. I figured the bearing was just cheaply made, but it turns out the problem was actually the way the two plastic pieces of the wheel snap together. I generally take them apart to clean and then snap them back together; turns out that a year of doing this has made them fit together rather loosely.

My solution was to stick a little piece of cardboard into one of the clips that holds the two halves together, like this:


I got the cardboard from one of the toilet paper tubes that I give them to play with, chew on, and browse the internet with. I'll have to change it when I clean the wheel, but at least my spinner is once again silent.

Oh shit! Crayons!

So, I'm going to try this whole blog crap thing again. Don't expect much but the occasional rant or blinky thing.

"Where's the Fish" was taken, and the first name I could think of was "weevil flashlight." This probably means I'm weird.