Logan Lewis



Welcome. My weblog is below. It's just as much for my own notes and thoughts as for anything else, so you'll likely find it boring. I post it online just in case someone finds some obscure fix or info useful.  Consider yourself warned. Some entries get archived under "tips and tricks". If you really want to know more about me, check out the links to the left.

Work and consumption
Several weeks ago on the bus I was reading one of the little signs near the ceiling. It said something like, "Working shouldn't cost you money". The sign was an advertisement for a subsidized program to cover bus fares for employees working in downtown Ann Arbor. Ordinarily, I didn't think much of the sign. This time, however, it reminded me of a point that Professor Miles Kimball likes to argue about people's preferences. That is, that consumption and labor are complements.

Practically speaking, this means as people work more, they also consume more. I suppose you could summarize this with that old saying: "work hard, play hard", which captures one of the implications of this idea. Examples of this abound. In my own life, the more I work the more I'm willing to pay to eat out. If I happen to have more time on my hands and less immediate income (like the summer before grad school), I'll do more cooking. Likewise, when people retire, it seems reasonable that people do more tasks themselves that they would have paid for when they were still working.

So in a sense, working probably will cost you money, even beyond the more direct costs of transportation and work supplies that might come with a job.
Nov 16, 2006

Prelink and md5sum
A little backstory: My laptop's hardware is starting to die; the remaining USB port is falling off, causing problems for any connected device and the interaction with the system. The symptoms here (when a mouse was installed) seem to include my keyboard functioning erratically. And either a hardware issue or what's widely known to be a poor video driver ("i810") or perhaps other software caused a brief (1/4 sec) blanking of my screen today.

To rule out the possibility that my computer was hacked (and that whatever software was installed was causing glitches), I ran some md5sum comparisons between binaries on my laptop and those on my desktop. Both run Fedora Core 4 with similar revisions of software (and I checked the RPM version of the files I was comparing to ensure I was comparing apples to apples).

The first one (perhaps it was bash) didn't match. Most of /bin didn't match. This really isn't the behavior of a rootkit; those only tend to replace the files they need to hide themselves. Still, I quickly rebooted with a CD of Knoppix and ran chkrootkit and did some manual searches.

Then I considered that my CDROM on my laptop has been less than reliable. I try to avoid using it whenever possible. I didn't remember at the time whether I tried to do a full install from CD, so my thought moved to read errors from the install. I did a hexdump of two versions of vi and did a diff to compare the results. The changes didn't seem random, but it didn't rule a media problem out.

This whole business concerned me because I was used to comparing md5sums on Debian systems. It turns out that Red Hat (and thus Fedora) have implemented a system called prelink, something with which I was only vaguely familiar before. Prelink modifies binaries in an attempt to speed them up (by, well, pre-linking them with the libraries they call). This changes their md5sum, but in my case, the filesize remained identical.

So the tip here is this: to compare md5sums between systems that use prelink, first run "/usr/sbin/prelink --undo" on the files.
Sep 22, 2006

Random update
My CDRW drive died on me. What's strange is that it was throwing errors without any disks in it:
hdc: status error: status=0x51 
{ DriveReady SeekComplete Error }
hdc: status error: error=0x04 { AbortedCommand }
ide: failed opcode was: unknown
hdc: ATAPI reset complete
I guess it got confused and kept trying to read a non-existant disk. I can't recall seeing behavior like this before. Ah well, this is the third motherboard that drive has been paired with, lasting about 5 years.
Aug 30, 2006

Blokus complete board (continued)
Searching for "complete blokus board" does not seem to bring up much; searching for "blokus solution", however, does. This guy's solution is much more elegant than mine, as his is symmetric, rather than my ad-hoc (and more time-consuming) method.
Aug 12, 2006

Jonathan Coulton
Jonathan Coulton releases a song a week on his website. His song Code Monkey became quite popular in some circles. Frankly, he's a master of catchy little tunes. I thought I'd highlight a few of his other songs I think are amusing:

Ikea is a song dedicated to the store. It only takes one visit to understand exactly what he's talking about.

The Presidents provides a short quip about each president of the United States. My favorite part is the end.
Aug 12, 2006

bd's Mongolian Barbeque
(27/Jul/2006)

200 S. Main Street
Ann Arbor, MI 48104
(734) 913-0999

website

This is the Ann Arbor edition of a regional chain of "Mongolian Barbeque" style restaurants. For the uninitiated -- I think I'm rather late to the game here -- it's basically a dinner buffet where you pick raw foods and flavors for the people around a big grill to cook up for you. I'm told the execution of this idea varies in ingredients and techniques.

Here, the prevailing philosophy seems to be "everything you can think of". Meats included New York strip, rib eye, lamb, chicken, and a variety of seafood. Add vegetables of all sorts, then choose a sauce. The sauces varied hugely from more Western flavors to classic (but undoubtedly Americanized) Eastern ones. I chose the classic Teriyaki. A variety of dried spices add to the mix. I added sesame seeds to my bowl, since they're excellent with stir fry.

My bowl was meat heavy, with the beef and lamb outflanking vegetables like potatoes and carrots. The result was delicious, certainly rivaling my now-bored experiences with hibachi-style restaurants. The pricing scheme is a lesson in diminishing marginal utility: one bowl was something around $13 and all-you-can-eat was only about a dollar more. This pricing scheme definitely favors big-meal eaters, a group in which I certainly do not belong.

That said, the restaurant had its drawbacks. First, there was definitely a funky smell emanating from the area around the raw food. We suspected the seafood, but I stayed clear of the chicken as well. The acoustics of the room also made for a fairly noisy atmosphere. This prompted us to seek dessert elsewhere. But, as Alton Brown might say, that's another review.
Aug 08, 2006

Power quality woes
My power quality woes continue this summer. I had the power quality department put a line analyzer on my line during some moderate weather. It showed enough of a problem that they determined there was insufficient capacity in our area, and a work order was put in for another transformer. Unfortunately, the problem was not severe enough at that time to warrant it being a high priority. Thus, I was told nothing would probably be fixed this summer.

Meanwhile, weather got hotter, and my power problems worsened. Each storm brings several small power outages or brownouts, and in total about 15 hours of outages in two weeks. Today though, I've had a constant undervoltage of around 104-107. This is low enough that any reasonable new load (like a monitor, or speakers, etc) will set off my UPS. It was low enough at some point this evening that my APC UPS went off constantly (though my seemingly less-sensitve one did not).

This is the sort of issue that customer service will send somebody out for. So I tried to call them, went through the whole menu, only to get one of those messages saying my call could not be completed and I should try calling again (or something to that effect). Tried a second time, same deal. I'm sure they're getting a lot of calls today with outages and power problems due to the heat.

The thing is, it seems my power problems have been exacerbated by this capacity problem. So many brownouts during thunderstorms and this undervoltage today would probably be improved if they added more capacity to this area. To that end, I called the power quality guy again. I'm really hoping he can escalate this issue for me, but we'll see.
Aug 02, 2006

Blokus complete board
Kristin recently received a board game called Blokus® from her sister for her birthday. The rules are simple. Each player starts with a set of pieces (reminiscent of Tetris® pieces, but with more variety), and you start in a corner. You may place pieces if they connect with a corner of one of your previously-played pieces, and they may not touch the sides of any of your pieces. The strategy involves blocking others and pushing out into the board. The first player to play all of his or her pieces wins. If no player manages that (common, at least in the games we've played), then when everyone exhausts their moves the player with the fewest points worth of pieces wins.

After playing a few games with Liz and Chris (Kristin's sister and her husband), Liz pondered whether all of the pieces could legally be played on the board. A few hours later, and with some help from Kristin, I have one complete solution. It's clear there are many, many possibilities; some can be obtained simply by interchanging two pieces in this solution. Still, if there were not many possibilities, it would have been unbelievably difficult given the number of pieces.

So here is a solution:
Blokus solution

Out of 400 squares, 356 are filled with 80 pieces. Theoretically, this board could be played out by four players, though obviously the first player to move would win.

It also seems like an intriguing computer programming problem to deduce all such solutions. The strategy space is huge, so some smart pruning would probably be required.
Jul 30, 2006

AT&T Yahoo! Privacy Policy Changes
Disclaimer: I am not a lawyer (IANAL).

AT&T was in the news these past few days regarding the changes they are making to their privacy policy. This privacy policy affects users of AT&T Yahoo! DSL and their television service. These include sources like the Wall Street Journal and Reuters (via NYTimes). The objection is about two changes:

1.) AT&T now requires the acceptance of the privacy policy as conditions for using the service. I find it surprising that this terminology wasn't there explicitly before, but it certainly seems implicit. I'll leave it to contract lawyers to figure out if this actually would have had any legal bearing on cases like the lawsuit by the EFF.

2.) AT&T claims ownership of your "Account Information". The exact language:
How we share your information[...]
Legal Obligations/Fraud. While your Account Information may be personal to you, these records constitute business records that are owned by AT&T. As such, AT&T may disclose such records to protect its legitimate business interests, safeguard others, or respond to legal process. Specifically, AT&T provides Account Information to collection agencies and/or credit bureaus. We may disclose your information in response to subpoenas, court orders, or other legal process, or to establish or exercise our legal rights or defend against legal claims. We may also use your information in order to investigate, prevent, or take action regarding illegal activities, suspected fraud, situations involving potential threats to the physical safety of any person, violations of Service Terms or the Acceptable Use Policy, or as otherwise required or permitted by law.
(bold mine).
A quick look on Google News makes it clear that the news stories aren't quite saying just what "Account Information" means. The above Reuters article, for example, refers to "customers' data". It turns out the privacy policy explicitly describes how it defines two important terms:
Account Information. Account Information consists of Contact Information, Billing/User Information and Equipment Information. Account Information does not include any Usage Information.
[...]
Usage Information. Means information about how you use the AT&T Yahoo! sites (e.g., IP address, the Web page from which you entered our site, pages you view, how much time you spend on each page, the links you click and other actions taken) when using your AT&T Yahoo! Services. Usage Information means information about viewing, game, recording, and other navigation choices that you and those in your household make when using Homezone or AT&T U-verse TV Services.
(bold mine)
So it would appear that AT&T is claiming ownership of "Account Information", which explicitly doesn't include "Usage Information". Not that I'm happy with the changes, but I think some people (and perhaps news sources as well) are mixing the two types of information.

With regard to the TV service, some people are complaining that AT&T is planning to track TV viewing habits, which is prohibited for cable and satellite providers by law. That is probably true. Here is the portion of the document regarding the use of "Usage Information":
Usage Information. AT&T uses Usage Information to personalize your Services, to recommend content, and to select advertisements or other promotions for you based upon your interests. Your AT&T U-verse TV equipment uses Usage Information to provide, tune and record content.
Still, they do not claim ownership of that content, and they are not explicitly giving themselves the right to provide that information to government organizations, for example. The "How we use your information section", which I partially quoted, lists fairly thoroughly the access to which they provide the various types of info to others. The section quoted above under Legal Obligations refers specifically to Account Information, though once does use "information" in lower case ("We may also use your information in order to[...]"). Legally, this may refer to only Account Information, or it may refer to any information (again, IANAL).

I suspect that if AT&T were served a valid subpoena or warrant for usage information that they still had logged, they would provide it (and be legally required to in any case). Since they aren't claiming ownership on the usage info, they don't appear to be allowed to transfer data in vast quantities without cause (broad though that may be).

In sum, I'm hoping that the EFF wins its lawsuit against AT&T and that transfer of personal info from telecom to government will only be legal with a court warrant or legal subpoena. Having renewed my contract with AT&T one day earlier than I heard about this privacy policy, I am not amused. I will be contacting them in the near future with my complaints and questions.

However, reviewing the terms of the only real choice I have (Comcast), I have to say that AT&T is still (marginally) better. For example, their terms of service (like many cable companies) prohibits any kind of server, and more than 5 computers sharing one connection. I understand that they do that because one person's usage affects the neighborhood, but it's still really onerous.
Jun 22, 2006

Kubuntu
Every time Kubuntu makes a new release, I eagerly give it a try. Each time, I end up back in my Fedora installation (at the moment, it's Fedora Core 4). Yet, there's so much to like about Kubuntu. The KDE-based version of Ubuntu, it's all built upon Debian. This means I get the speed, efficiency, and ease-of-use of the apt system (something sadly deprecated on Fedora, in favor of the slower, more clumsy yum system). Also, KDE is a bit of an afterthought in the official Red Hat community.

So I use packages kindly provided by kde-redhat. These work fairly well for the most part, but you still get a lack of overall polish. All of the official Fedora utilities are built for gtk, not qt, for example. I thought the same would be a problem with Kubuntu. Ubuntu, after all, is very GNOME-centric. To my surprise, I discovered a nice series of tools that seemed to use qt (I didn't look too closely, though).

Yet, every time I use a Debian-based system I can't help but notice that the fonts are generally inferior to the Fedora system. Most KDE applications these days look great, but with Kubuntu I still have a problem with kpdf. It just doesn't look as good, and I can't figure out why. I've filed a bug report. Here are two screenshots for comparison: under FC4, and under Kubuntu. A bunch of things seem to be ruled out by the fact that xpdf works great under kubuntu, but I use PDFs so much that I'm rather dependent on kpdf for its nice feature set.
Jun 03, 2006

England and Germany in the World Cup
The NYTimes has a story about fans of England going to Germany for the World Cup this month:
They also shout "Stand up if you won the war!" and "Two world wars and one World Cup!" at the German fans. The second is a reference to the last (and only) time England won the World Cup, in 1966.

Perhaps the British are jealous of Germany's general postwar success.

"German supporters would be within their rights to respond 'Twice as many hospital beds and three times as many World Cups,' " or, alternatively, "Higher G.D.P. per capita than you," Paul Hayward wrote some years ago in The Daily Telegraph, in an earlier incarnation of the same debate.
Those two just don't have much of a ring to them, I'm afraid.
Jun 02, 2006

Changing email address of GPG key
I had thought for some time that GPG public/private keys were tied permanently to the primary UID with which they were associated. Turns out that's not the case. That's good for me, since the email address I used back in 2002 is long gone.

All keys must have a minimum of one UID associated with them, but they can be managed with gpg --edit-key [one of the UIDs]. List the UIDs with list, then select one with uid [number]. revuid revokes the selected UID, and deluid deletes it. I happened to have 3 UIDs, all pointing to now defunct email addresses.

For reference, my public GPG key is available.
May 15, 2006

MSN PDF caching
I've noticed in my web server logs that I often get hits from people searching MSN for search terms without spaces. For example, I've gotten more than one hit from cia-theworldfactbook (I'm currently number 2, linking to my undergraduate thesis). I'll link to the actual site in the hope that anyone who comes here with that search term again gets where he/she presumably wants to go.

But why in the world isn't MSN caching the PDFs with spaces? It looks like Google doesn't have a cache of that PDF either, which seems odd. It's clear that it's not just my PDF to which MSN loses the spaces.
Apr 26, 2006

Econometrics
While studying for my econometrics final this week, I figured out a problem that had been bugging me for over a year with regard to my undergraduate thesis. I had a panel data set and tried to manually implement fixed effects (via dummy variables). Trouble was, I never seemed to have complete identification of the dummy variables, and I could not figure out why. The problem was that I had three variables that didn't vary with time - the size, distance, and status of the currency union. When you work out the algebra of fixed effects, you lose the ability to identify all of the parameters.

So I re-ran one of the regressions tonight (interacting each time-insensitive variable with a simple time trend), and lo and behold, the numbers are much more consistent with when I ran the model without fixed effects. The R-squared value is still outrageously high (0.9999, and that's all R reports for sig figs by default), so there are probably some serious remaining problems. Still, I was pleased to solve that mystery. A bit embarrassing, but I understand it's rather common to find various problems, especially econometric issues, with work done as an undergrad. Of course, pointing out problems with other empirical work is rather common in the literature itself.
Apr 03, 2006

Foreign Investment in the US
I read an interesting article from the New York Times about a possible chilling affect on foreign investment in the US. The Dubai ports issue really brought this debate about free trade and national security to the forefront.
Mar 10, 2006

Dual monitors and Kile
I've learned a few things while setting up dual monitors at home under Linux.
  • Mixing ATI and NVIDIA (one for each monitor) leads to serious problems with opengl (crashes X, rather than just having opengl apps work on one monitor). I'm not sure if there's a workaround for this or not.
  • ATI open source drivers on a Radeon 9100 PCI give visual artifacts in things like titlebars in KDE (they appear in screenshots as well).
  • ATI proprietary drivers have relatively lousy 2D performance (at least compared to my similarly-powered GF4MX). I don't think this difference can be explained by AGP vs. PCI. Which leads to:
  • NVIDIA Quadros with dual dvi can be had very reasonably on eBay.
  • Kile, my LaTeX editor of choice, works really nicely with dual monitors. A few simple changes and a build takes you to the correct part of the document, refreshing a window on the other monitor: Settings->Configure Kile->Build->Select a configuration: "Modern". Select "ForwardDVI" Select a configuration: "KDVI", and under "Advanced" select "Run outside of Kile". Finally, under QuickBuild, make sure the order is "Latex" "ForwardDVI". Then load up kdvi, Settings->Configure KDVI->DVI specials->Editor:Kile. The last option allows you to middle-click in a document and kile will move to the correct position in the document.
  • Finally, Stewart Calculus books make excellent monitor stands.
Feb 25, 2006

Mouse update
After spending a day or two with acceleration basically disabled on my new wireless mouse (the trials and tribulations of which were chronicled in this posting), I realized how useful acceleration really is. Thus, I'm back to using my old mouse with the new keyboard. I really hope to see the xorg people address this soon.
Feb 12, 2006

Comments, bread, and recipes
My site received a spam comment today. I found that rather impressive, considering I'm not on a major blog website and don't get a great deal of traffic.

Aside from the normal rounds of class and homework, I've been attempting to perfect a homemade sandwich bread. The work continues, I'll probably make another loaf tonight.

In more "exciting" news, I found an awesome KDE application to manage recipes. krecipes does just about everything I could want. It even imports a big ol' USDA database of ingredients so you can figure out nutritional information about your own recipes, automatically. It interfaces to an SQL backend of your choosing (SQLite, MySQL, or PostgreSQL). I see the potential for neat applications with my laptop and wireless networking.
Jan 21, 2006

Logitech Wireless Combo
Tonight was one of those Linux experiences where one realizes that Linux still has some work to do in the hardware compatibility department. I switched from an aging Logitech wireless keyboard and mouse to its updated version. The new version offered me a number of improvements. The biggest two were that the mouse is now optical and the keyboard is not worn and glossy (I am rather picky about how clean my keyboard feels). In addition, I like the USB interface (though PS/2 is also available, which I had not realized) and the new black coloring.

Initially, things seemed to work great. The keyboard has a different feel to it, but it's quieter and nicely responsive. The mouse, however, moved far too fast. No problem, I went to the KDE Control Panel and set the mouse acceleration to the lowest it allows - 1x. Still too fast. I figure that maybe I could change drivers or set the resolution of the mouse. Somewhere along the line I decided to try it on my Mac Mini, and sure enough, it was dramatically faster than the cheap Logitech wired USB mouse I have attached.

I believe this mouse, the Logitech Cordless MouseMan Optical, has a native resolution of 800dpi. This greatly exceeds most mice, so it makes sense that a small movement of this mouse might translate to a huge movement on the screen, unless this difference is taken into account. So I set about trying to figure out the best way to do that. Setting the resolution in xorg.conf? Sure, that works for some mice, but the mice must be PS/2, and it still only works for certain models. It doesn't appear to work for my mouse.

A little more Google searching (not a good sign for Linux usability) and remembering a similar case a while back, I realized that KDE's GUI is simply limited - you can really set the acceleration to less than 1x with the command "xset", and the KDE program that sets it can also take a decimal value for the acceleration in the config file (~/.kde/share/config/kcminputrc). So while I was happy that I didn't have to script up xset to load after logging in, I did vote for the relevant bug. I ended up setting the acceleration to 0.75, which seems reasonable. I'm playing with various acceleration threshold settings to get something that feels natural (right now 8 seems best). Comparing it to the Mac is proving difficult, since I think Mac OS X uses a much different-feeling algorithm for mouse acceleration. I should note that the discrete settings Mac OS X had for pointer acceleration yielded no decent results for this keyboard/mouse, so it's not as if it's a perfect system by any means.

As a side note, I also tried to get resolution changed on the mouse by some additional software, but I don't think the cordless mice can be configured as such. It appears that the KDE GUI also supports setting these options, but all options are grayed out because apparently Fedora doesn't set permissions of the USB devices appropriately.

I figured while I was spending this time trying to get my mouse working just so, I really ought to get those multimedia keys at the top working. After running into this resource, getting those keys to show up as the correct codes was straightforward. For my model (Y-RJ7) keyboard, my ~/.Xmodmap looks like the following:
keycode 162 = XF86AudioPlay
keycode 164 = XF86AudioStop
keycode 144 = XF86AudioPrev
keycode 153 = XF86AudioNext
keycode 174 = XF86AudioLowerVolume
keycode 176 = XF86AudioRaiseVolume
keycode 160 = XF86AudioMute
That only sets the multimedia keys, but I don't have use for the others at this point. It appears that kmix takes the volume events and applies them to overall system sound, and I used amarok's global shortcuts GUI to set the play/stop/back/forward buttons. My only complaint is that play does not function as pause as well; I'm not sure if there's a way to get Amarok to behave that way (perhaps a wishlist bug is in order).

After all this, I'm relatively pleased with the results. Still, it's way too much work. It would be great if xorg recognized more keyboards and set their multimedia keys correctly without user input (it had some of my buttons mapped, but most of them incorrect). KDE should be able to set pointer acceleration levels less than 1 through the GUI. Still, pretty much all mice I've used in practice work perfectly in Linux these days, now the trouble comes in enabling huge 8-button mice with high-end sensitivity.
Jan 03, 2006


Valid XHTML 1.0 Transitional

Valid CSS!

Does this site not look correct in your browser?   Please let me know.  I'm aware of some issues with older browsers like IE 5.  Looking for a new browser?  Check out Firefox

Copyright 2005-2008 Logan Lewis. Any trademarks are the property of their respective owners.