Wednesday, February 11, 2009

Firefox broken by update to Kubuntu 8.04

I received an update for firefox today on my main office machine (running Kubuntu 8.04), and firefox is now completely broken.  All it does now is exit immediately with a 0 exit code.

I have temporarily switched to Opera, which seems quite nice.

Tuesday, January 20, 2009

Reset your windows password

I forgot my windows password recently. Fortunately, if you can boot from a CD, the following Linux-based utility will allow you to easily reset passwords:
http://home.eunet.no/pnordahl/ntpasswd/
W00t.

Friday, January 2, 2009

More finds from Pandora

Pandora continues to be an amazing way to discover new music. Two recent finds worth mentioning:

1. The Changes. I'm not quite sure how to classify them. Maybe if you threw Fine Young Cannibals, A-ha, The Smiths, and Wham into a blender, adding a dash of Joe Jackson, you'd end up with something like The Changes. I received their album Today Is Tonight for X-mas, and it's excellent. Plenty of big obvious hooks, with a lot of substance underneath. Sort of like the Killers, but better.

2. Guided By Voices. I received their album Earthquake Glue for X-mas, purely so that I would have a copy of the song The Best of Jill Hives, which would easily be on my list of the best songs ever. I'm actually a bit obsessed by this song at the moment---I think it might be perfect. I'm not quite sure where the rest of the songs on the album fall, but there's certainly some good stuff there.

Static fields and methods are unnecessary

Happy new Year! Right now I'm in Hilton Head, South Carolina on the last day of a family vacation. (Ah, vacation.)

I've been thinking quite a bit lately about how to design a very simple dynamic object-oriented language along the lines of Ruby. Every value should be an instance of an object, etc.

One ugliness that I wanted to avoid was the need for static fields and methods. However, for things like the standard input and output streams, you don't want to have to create new instances of these objects every time they are needed.

Today it occurred to me that all you really need is a language mechanism to define "singleton classes". A singleton class defines a single instance at runtime. Singleton classes are a convenient place to stash things like standard input and output streams.

Example:
module System::IO {
field in;
field out;
field err;

method init() {
self.in = new System::InputStream(:stdin);
self.out = new System::OutputStream(:stdout);
self.err = new System::OutputStream(:stderr);
}
}
Here, the keyword "module" means singleton class.

Now, consider some code where this singleton class (System::IO) is used:
import System::IO;

IO.out.print("Hello, world\n");
The import directive lets the compiler know that in this translation unit, the identifier "IO" will refer to the instance of the singleton class "System::IO". As long as some runtime magic can produce a reference to the instance of a singleton class, all field and method accesses are done through ordinary object references. No static fields or methods needed.

Wednesday, October 22, 2008

Engineers vs. Computer Scientists

I've been thinking lately about how people in other fields, such as engineering, view programming and computing in general. This morning I think I figured it out:
Engineers write programs to solve problems. Computer scientists write programs to create problems.
Neatly summarizes the situation, don't you think?

Friday, October 17, 2008

Picture of the day


This is a screenshot of a "Robot Lawnmower Simulation" that I assigned as a project in a CS2 course I'm teaching.

Here's the link:
http://faculty.ycp.edu/~dhovemey/fall2008/cs201/assign/assign4.html

Sunday, October 5, 2008

max7219 is working

This past week I was able to get the AVR to talk to a max7219 multiplexed LED driver. One thing that took a while to figure out is that to bring the max7219 out of shutdown mode, you write a 1 to the shutdown register, not a 0. Fortunately, putting the chip in test mode (all LEDs lit) works even in shutdown mode, so I was at least able to verify that the chip worked and it was receiving data. After getting it out of shutdown mode, progress was rapid. (In the process of debugging, I also discovered that the max7219 works best when its ground pins are connected to ground :-)

One nice feature of the max7219 is that it supports undecoded output, meaning that you're not limited to decimal, hex, or code-B when using 7-segment displays. Some weird people out there have come up with 7 segment text fonts, which (surprisingly) aren't totally unreadable.

Aside from adding some buttons for user input, pretty much all of the technical details of my top-secret AVR project have been ironed out. (I still have to finish writing the code, but that should be the easy part.)

One interesting wrinkle is that the max7219 doesn't precisely support SPI, but a protocol very much like it. So, I actually have two SPI busses, one for the ds1305, and one for the max7219. (I should have ordered the max7221, which is fully SPI-compatible.) No big deal, since the atmega48/88/168 chips have a lot of I/O pins. (I'm currently using the '48, since it's cheapest.)