| UMD | CS Dept | daveho | blog |
|
Dave's BlogThis is updated when I feel like it. Entries24 March 2005. I have a job for next year: a one-year visiting position at Vassar College. Yay! 7 December 2004. Here is today's Bourne shell brain teaser: How do you pass the value of a variable containing the "*" character as an argument to a command without using quote characters?
If you answered #2, give yourself a round of applause! Here's a script that demonstrates the problem: #! /bin/sh arg1='The java.lang.* package' arg2='The java.lang.\* package' touch java.lang.Foo /bin/echo $arg1 /bin/echo $arg2 Here's an example of running it from the command line: [daveho@noir]$ sh bourneshellsucks.sh The java.lang.Foo package The java.lang.\* package 22 November 2004. Why Java generics are good: they allow you to write robust reusable code. Case in point: in 2000 I wrote a graph library as part of some network class loading research I was working on. That version of the library was a bit ugly: lots of casts were needed to recover the concrete class types representing edges and vertices from the generic algorithms that operated on them. Later on, I rewrote the library to use generics, as part of FindBugs. Each graph object (graph, vertex, and edge) is fully parameterized with the actual types of the other graph objects. This allows easy implementation of generic graph algorithms (which don't care about the concrete vertex and edge types) while still allowing callers to access those concrete types without casts. So, I can use the same graph implementation to represent
4 October 2004 I've been learning XSLT in order to transform the XML output produced by FindBugs into HTML. I bought a copy of Beginning XSLT by Jeni Tennison, which I've been fairly impressed with: most of the important concepts were explained in a very clear way, and there are lots of examples (possibly too many). One complaint I do have is that I'm not convinced that the HTML examples in the book were tested with any browser other than Internet Explorer. In any case, I was able to produce reasonably good HTML after only a couple days work. Well, actually, I cheated by adding new elements to the FindBugs XML output to make generating human-readable output easier. But good programmers should always cheat when they can. A peculiarity of XSLT is that it really wants to produce an XML tree as output. So, the easiest route to generating HTML is to produce XHTML, which is just HTML using XML syntax. I realize that XHTML has been around for a long time, but my web skills were learned circa 1995, and I'm slowly catching up now. Figuring out what incantations I needed to give to the XSLT program to produce something that my browser would recognize as XHTML was the most difficult part of the entire process. But eventually it sort of made sense. Here is a link to the FindBugs XML to HTML stylesheet. WRT job search: Lafayette College is hiring. I will be sending them an application. 3 October 2004 I have decoded the meaning of the spiciness classifications printed on jars of salsa. Here is what they mean:
28 September 2004 It's been a busy few months! I got married (hi Kate!), went to Bar Harbor and Acadia National Park for our honeymoon, submitted a variety of papers, wrote some gnarly Java servlet code, and otherwise have had lots to do. Now I'm starting my job search (since I'm going to graduate next year). My goal is to get a tenure-track faculty position in Computer Science at a liberal arts college. As of right now, I'm planning on applying at Moravian College and Hobart and William Smith Colleges. 8 July 2004 I am the moderator for a couple GNU Mailman mailing lists. The domain name of one of the subscribers changed: mail delivered to the old address still got there, but the MTA kept sending me email saying that the old domain is no longer valid, and to switch to using the new domain. Fine. I log into the mailman admin interface, go to "Membership Management" screen, find the user, and click on the offending email address. I get the screen where the user can change his or her own email address. Slight problem: this is a form intended for the user, not the administrator. I fill in the new email address, and click "Change My Address and Name". Well s**t, it tells me that the user needs to confirm the change within 3 days. [long sequence of profanities deleted] Sorry about that, had to get it off my chest. If anyone knows how to change an email address for someone subscribed to a mailman mailing list, please let me know. In other news:
20 June 2004 It's been a busy few weeks!
If you haven't heard of Wegmans, it's the nation's #2 (in quality) grocery store chain (according to Consumer Reports, a few years ago anyway). I worked at the Wegmans in Fayetteville, NY when I was in high school. It's changed quite a bit since then. Originally, it was just a really nice grocery store. Now, it's a shopping extravaganza that is hard to describe. If you live within an hour or two of one, you should go see what it's about. Trust me. 24 May 2004. Weirdest song transition playing OggVorbis files in random shuffle mode using xmms:
9 May 2004. The Bourne shell sucks. Here is the problem: I want to define a shell variable that contains some, but not all, of the parameters defined in the $@ variable, and then pass them verbatim to another command. Sounds easy, right?. Wrong. The problem is that if the shell parameters contain space characters, they will get separated into multiple arguments when passed to the second command. One potential solution would be to put double quotes around the value of the parameter, e.g.:
Unfortunately, this fails because the shell doesn't respect the embedded double quote characters when the expanded value of $args is tokenized. So, if $1 contained the single value then command would get passed two argumentsa b and"a Suck, suck, suck.b" What makes this problem especially irritating is that the Bourne shell treats the $@ variable specially, so that when it is expanded in double quotes, it logically treats its contents as though each argument were double quoted, preserving internal spaces. This option is not available to any other variable, though, and it is impossible to assign or modify $@. On an unrelated note: SCO are a bunch of litigious bastards. 6 April 2004. Yesterday I installed a new Linux distribution on my laptop: Debian Testing (Sarge). I started by booting the netinst image for the Beta3 Debian Installer and then running apt-get to fetch additional packages. In the past, I've shied away from Debian because the stable release is always so far behind the rest of the world in incorporating the latest versions of the kernel and other software. At the moment, Debian stable is still using a 2.2 kernel! This time around, I thought I'd give the testing distribution a try, since it is much more up to date. For example, it uses the 2.4.25 kernel. As noted in the previous blog entry, earlier 2.4 kernels have some trouble with PCI based Prism2 wireless cards. Overall, I'm extremely impressed with Debian. Installing packages using Apt is an absolute pleasure after years of fighting with RPMs and Redhat's up2date. The APT Howto was very helpful and easy to understand. For example: to install XFree86, I ran the command It really was that simple!apt-get install x-window-system One think I really like about Apt is that it allows me to get just the packages I need, when I need them. Ususally, when I install Linux, I have to spend ages going through lists of packages trying to figure out which ones I am going to need later. I really like the idea of pulling them in on demand. Overall, the install process was pretty smooth, but not very user friendly. Redhat's Anaconda is a much nicer interface, and I think people who aren't very familiar with Linux and Unix will have a hard time with the Debian installer. There were a few loose ends after the base system was installed. For example: the installer did not create /etc/hosts, so there is no host entry for "localhost" or for the machine name. In addition, the init scripts did not create a route for the loopback interface. This may be because I did not have the machine connected to a network when I ran the installer, but it's still annoying. Also, there is no entry for the cdrom drive in /etc/fstab. I added one by hand, but this is another snag that will cause problems for inexperienced users. Another post-install problem is that KDE simply does not work. The progress window simply hangs while initializing "system services". Although I normally use KDE as my desktop, I am really rather agnostic about UI stuff, so I decided to give Gnome a try. So far, I really like Gnome! It has made significant progress since the last time I used it (which was in summer of 2002). I especially like gnome-terminal, which is much better than KDE's konsole. One problem I did notice with Gnome is that the volume control applet thought that the path to the mixer was /dev/sound/mixer, while in reality it's /dev/mixer. A quick symlink from /dev/sound to /dev fixed the problem. What I found highly redeeming here was that the volume control applet graphically alerted me to the problem by displaying a useful error message as a tooltip when I moved the mouse over it. Knowing the cause of the problem is about 80% of fixing it. 4 April 2004. For a long time, the wireless card
in my IBM Thinkpad R32
laptop has been misbehaving in Linux.
The wireless card is a IBM High Rate Wireless LAN Mini-PCI Adapter
(part number 22P7711): the The symptoms of the problem are that occasionally, especially during large data transfers, the network would freeze, and the message02:07.0 Network controller: Harris Semiconductor Prism 2.5 Wavelan chipset (rev 01) would appear over and over again on the console.Error -110 writing Tx descriptor to BAP Anyway, long story short, the version of the orinoco driver included in the default Redhat 9 kernel is buggy. I upgraded the kernel to 2.4.25 (using the default Linus kernel on kernel.org), using the instructions on this web page. Configuring the kernel was, as always, a pain, but the build process went smoothly, and the new kernel appears to have solved the problem. In other news, there appears to be a serious Java performance anomaly in Redhat Enterprise Linux 3. I submitted a bug report to Redhat's bugzilla, so we'll see what happens. The problem is really pissing me off because it makes it impossible for me to do any Java work on my workstation at school. 11 Mar 2004. A few days ago I got back from SIGCSE 2004, which was a lot of fun. I highly recommend it to anyone interested in computer science education. My computer at school was recently upgraded from Redhat 9 to Redhat Enterprise Linux. So far, it seems pretty nice. However, everything is set up to use UTF8 as the default encoding, including terminal applications such as mutt. Unfortunately, I had been using rxvt as my terminal program, which doesn't understand that encoding. I started out by switching to konsole, the KDE terminal emulator. Initially, it seemed to work pretty well. It handles UTF8 easily, and has a nice configuration interface for setting colors, font, font size, etc. It also does font antialiasing, which it a big win. Unfortunately, konsole takes forever to load, and in general is just incredibly slow. Given the amount of time I spend creating and using terminal sessions, poor responsiveness is not acceptable. Eventually I stumbled across rxvt-unicode. In addition to having support for Unicode, it can use xft for antialiased fonts. Here's the invocation I use to start it: urxvt -bg black -fg gray -cr green -sb -sl 1000 -fn "xft:Luxi Mono:pixelsize=12" 15 Feb 2004. The Willem EPROM Programmer arrived, and it works! So far I have only tested it with 28C256 EEPROMs, but it was able to successfully write and verify them. I should have some 27C128 EPROMs (UV-erasable) arriving soon. They require a higher programming voltage (12.5V instead of 5V), and will be a somewhat better test of the programmer, but I expect it to work. A few notes about the Willem EPROM Software:
In general, the programming software is pretty easy to use. Once I got my parallel port configured correctly, I was able to erase, program, and verify EEPROMs in a matter of minutes. Some day I would like to write improved programming software that would work under Linux. Very minimal Willem EPROM Software for Linux does exist, and could serve as a starting point. 11 Feb 2004. I bought a Willem EPROM Programmer on Ebay for $53, which included the power supply and parallel cable. Now I'm just waiting for it to arrive :-) I have also bid on a lot of 27c128 EPROMs. My goal is to use Etherboot on a 3c509 ethernet card. The Willem programmer doesn't do GAL devices, but at about 1/4th the cost of a commercial programmer, I think it's a reasonable compromise. Note: the Etherboot project has a companion site, rom-o-matic.net, which automatically generates Etherboot images, based on your ethernet hardware and a host of other configuration options. This is one of the coolest web sites I have seen! 15 Jan 2004. Why are EPROM programmers so expensive? There are about a million different companies selling them, they all have a tiny share of the market, and the software generally sucks. Some vendors are still shipping software that runs under MS-DOS. Yes, DOS. What the fuck? The Willem EPROM Programmer is probably the closest thing to a cheap general purpose programmer out there, and the software doesn't look too horrible, but it doesn't program GALs, and it needs an adapter to do 80x51 family microcontrollers. Needhams seems to have some pretty nice programmers and good device support (including GALs), but they run about $200-$300 for the entry level models. I want an EPROM programmer for two reasons. First, I want to burn an EPROM for Etherboot so I can test GeekOS easily on real hardware without having to boot from a floppy. Second, I enjoy tinkering with microcontrollers, and a general purpose programmer would be a really useful thing to have. I have plans for a cheap 8051 development board that I would like to turn into a PCB some day. I suppose real engineers use JTAG and in-circuit programming. 5 Jan 2004. Here is how to write an OS kernel in 13 easy steps. Actually, some of these steps are not all that easy, but if you are persistent you will definitely learn a lot.
As part of work I'm doing on GeekOS, the only remaining steps I have to complete are filesystem, console I/O, and pipes. Once those are done, I'm hoping to get a respectable collection of user programs ported, and eventually get the system to the point where it is self hosting. 25 August 2003. I think the world would be a better place if everyone owned a Gang of Four album. First, it would throw the utter soullessness of the current music scene into sharp relief. Second, the need for relief from the relentness corruption of human values by government and industry has never been greater. What we think"Why Theory?", from Solid Gold 22 August 2003. My personal philosophy: Don't make things more complicated than they need to be.It works as well in real life as it does in programming. 20 August 2003. Dear SCO, I use Linux. Go ahead and sue me. My contact information can be found here. Signed, David Hovemeyer. 15 August 2003. Song lyric of the day: Got a call last month from an old friend"South Bend", Waco Brothers 2 August 2003. You're designing a GUI tooklit, and you're deciding how hard it should be to customize the text color used in the items in a tree widget. Should it be
29 July 2003. The correct place to listen to the album Republic by New Order is the state of New Jersey. If you must listen to it somewhere else, try to enter a New Jersey frame of mind first. Spooky! 10 July 2003. I was born to program. By this, I mean that I enjoy it a lot, am pretty good at it, and would like to get even better at it. Seeing poorly written code makes me upset---you get the idea. What I would like to know how programming skill fits in to human psychology. I don't do it to impress anyone other than myself, so it doesn't help me advance socially. (As a nerdy kid, I was sometimes ridiculed for my love of computers.) Lately I've been reading The Moral Animal by Robert Wright (a fascinating book, BTW) and it seems that most human behavior is driven, ultimately, by behaviors that in ancestral times would be most likely to progagate one's genes. Computer programming does not seem to fit any reasonable criteria for a behavior that is likely to lead to reproductive success. It is generally a solitary activity, and so does not tend to elevate social status. Maybe that's precisely the point, though. The tendency for hackers to be shy and withdrawn is well established. Perhaps programming is a means to excel at something when social advancement through more ordinary means isn't available. Lately, though, society in general has gotten a bit more receptive to the whole hacker culture. So, perhaps we're due for a new generation of more socially well-adjusted hackers. Anyway, who cares. I don't need any reason to enjoy what I do. 9 July 2003. It struck me today that 802.11 ("Wi-Fi") networking has created a social transformation that, in a subtle way, is almost as profound as the internet itself. Specifically, browsing the web is now a social activity, and at times, practically a team sport. In my house, everyone tends to congregate in the living room with their laptops. Sometimes it's to work, but just as often, it's to look for cool stuff on Ebay, be publically outraged by the latest politcal developments in the Post, research obscure facts, etc. This phenomenon has even managed to unseat the television and the Game Cube as the locus of social activity. 8 July 2003. I'm sure this has been said before, but slang is basically a means of social group identification, and therefore, exclusion. That's why I don't use slang. Well, actually, I do use obsolete slang for the entertainment value. Word! |