Archive for September 2008

From the TMZ website:

PETA has sent a letter to the co-founders of Ben & Jerry’s Ice Cream urging them to replace the cow’s milk they use in their products for, ahem, human breast milk.

PETA claims human breast milk would cause less suffering for dairy cows and would make a healthier choice for humans. For their part, Ben and Jerry’s say they applaud PETA’s novel approach — but believe a mother’s milk is best for her child only.

The collective intelligence of PETA continues to astound. First, let’s release lab animals who have no chance to survive in the wild. Then let’s not milk dairy cows, so they’ll burst an udder and die. Now let’s substitute breast milk for cow’s milk. “Excuse me, waitress? I need more cream in my coffee!”.

Just imagine the logistics… How many gallons of milk does America go through every day? How much does an average lactating woman produce, and how many are lactating at any one time? I think there’s a supply chain shortage here.

All this goes in the same vein as animal testing. I’m against NEEDLESS animal testing. 3000 rabbits do not need to die to test the latest shade of Maybelline lipstick. However, I’d really prefer they did try newly engineered drugs on animals or convicts before using me as a guinea pig.

I do have a solution for those anti-animal testing basket cases: Let’s just not let them use ANY products that are tested on animals. “Oh, you have cancer? Sorry, we killed some mice testing this stuff. You can’t have any. And you’ve got about 2 weeks to live, so you may want to wrap things up.”

[PETA letter, TMZ]

Some remarkable photos from hurricane Ike

The Boston Globe has a remarkable collection of photographs from hurricane Ike.

In its brief lifespan of only 13 days, Hurricane Ike wreaked great deal of havoc. Affecting several countries including Cuba, Haiti, and the United States, Ike is blamed for approximately 114 deaths (74 in Haiti alone), and damages that are still being tallied, with estimates topping $10 billion. Many shoreline communities of Galveston, Texas were wiped from the map by the winds, storm surge and the walls of debris pushed along by Ike – though Galveston was spared the level of disaster it suffered in 1900.

Two shuttles together for the last time

Both shuttles (Atlantis on Launch Pad A in the foreground, Endeavor on Launch Pad B in the background) are on the pads for the Hubble servicing mission slated for October 10, 2008. When the ISS is not available for rescue purposes, as it might not be for this mission, a second shuttle is made ready for a quick launch. Tom’s Astronomy Blog has some additional detail.

The last time such an image could be seen was July 2001, for the STS-104 and STS-105 missions. Unfortunately, we’re not like to see it a 3rd time, as the shuttle fleet is being retired in 2010.

[NASA, Tom's Astronomy Blog]

Sherman — 2 weeks later

It’s been two weeks since Sherman returned from Camp Diana, and he’s doing well. In the last 14 days, we’ve gone walking in the park 6 times. Using Google Earth, I plotted the path we walk, and it comes out right at 0.83 miles. We walk a minimum of 2 loops, and usually 3, which gives a nice 2.5 mile walk.

On our walks we practice “Let’s walk” (heeling), sits, and downs. Some days we’ve had a lot of distractions, with baseball games, tennis players, screaming kids and bicyclists. Those are not Sherman’s best days. He’ll do the sits and downs, but the walking can be another story. He’s either constantly running into my left knee, trying to see what’s on the other side of me, or trying to spin around to see what’s happening behind him. There’s gradual improvement, but with his low pack drive and higher prey drive, the distractions can prove to be a challenge.

Other days, he does darn near perfect. The day after I was getting frustrated with his progress (which I try not to let him sense), we went up there and he was near perfect. Sometimes he was getting a little far ahead on the walking (which means his neck is past my knee, which is where it should be), but some minor corrections brought him back. I was pretty proud of him! He did his sits pretty quickly, and the downs not quite as fast, but I didn’t have to step on the leash to pull him down.

Much of the problem is mine. Sherman is the first dog I’ve had that really required some firm corrections to get his attention. We use a prong collar for training, and I’m unwilling to put some of the force behind the correction that I should. Diana says two or three good corrections are worth fifty small corrections, and I don’t doubt that.

On a couple of our walks, we’ve met some fairly young kids. One time a couple 4 or 5 year olds came up to him, and were petting him and telling him how pretty he was. Sherman seemed to enjoy that, and I have no qualms about letting him meet people (just not other dogs). I do wonder where their parents were, as I sure wouldn’t want my kid to run up to a strange dog without me being, at the very least, aware of it, and preferably approving the kids action.

On another walk, a couple of two year olds (or something like that, I can’t tell kids ages worth a damn) with their grandparents met Sherman. I could tell the grandparents weren’t *quite* sure about it at first, but rapidly warmed up to Sherman as he sat to be petted. The little boy had no hesitation, but the little girl had to be convinced by her grandpa that it was OK.

For all of Sherman’s improvement, there’s still a couple problem areas we’re working on. When he gets wound up he likes to get grabby, and there’s an issue with the dish towels being stolen. We’ve purchased a Dogtra 280 NCP training collar. Sherman is fixing to discover the kitchen counter has developed magical powers that know when he’s up there and shouldn’t be.

Generally, I’ve always been adverse to the idea of shock collars (or “e-collars”, as the more P.C. term). Unfortunately, there are just some behaviors that it’s a more appropriate tool for. Actions that require a rapid response, where the window for correction is small are the primary type. And when he grabs your ankles, other than shouting “No!”, there’s not much in the way of correction you can do that doesn’t involve striking the dog. And that’s a MAJOR no-no.

Later today we’re going to try to get up to the park for some more training. Sherman isn’t feeling well today, apparently having ate something that didn’t agree with him. Since we know what he eats, we’re not sure what triggered this. We changed his food from puppy chow to adult chow a few days ago, so he shouldn’t be having a reaction to that this much later. He also managed to bang his hip while horsing around with Makeeta, and he’s limping a little bit as a result. I’ll let him rest a while longer, but walks are important for both of us. Can’t have that 50 pounds coming back!

Linux integer overflow signal handler example

I was chatting in #c on freenode.net the other night and someone was asking about detecting numeric overflows. Apparently they were interested in writing their own language as a learning exercise, and wanted some of the niceties that other languages offer, such as overflow detection.

After a quick bit of poking around, I found that GCC has the -ftrapv option, which will generate a trap on signed integer addition, subtraction, multiplication and division. Now that I knew a trap (or signal) could be generated, some code was needed to demonstrate it.

About 5 years ago I worked on a project that handled a bunch of signals. If a segment fault (SIGSEGV) was received, it would print a backtrace of the stack and display the processor registers. A bit of cutting and pasting and some minor updates, and it worked.

At that point, I figured I ought to make an example out of it, since there seems to be little in the way of readily available documentation for this sort of things. You can find tutorials on basic signal writing, but if you want to dump the stack or processor registers, you have to start digging through the source code of libc, glibc and gdb (which is pretty much how I figured out how to do this in the first place).

This example is available on my wiki, at http://www.tinymicros.com/wiki/Linux_Overflow_Signal_Handler_Example.

Comments and criticism are welcome.

An interesting house

Left side view

Right side view

Today the weather was just too nice to stay inside any longer, so we loaded up Moon and went for a drive. We wandered through a couple of the state parks, and on the way, passed this interesting house.

I don’t know that I’d want to live in it, but it’s… different. There’s an odd mix of housing around the Lake Lanier. You’ll see a two million dollar home sitting right next to a run-down trailer. Expensive houses that look like crap, and older homes that are beautifully maintained.

I really like the rock on this one, and the arch is interesting. It’s on a large lot, and has a nice wrought iron fence around. Visually, it’s one of the more striking homes in the area, compared to the usual nouveau-rich tacky overdone stucco house with 200 roof lines, and the obligatory Hummer H3 pickup truck in the garage.

If I get back by and find the address, I’m going to look up the value of the house in the GIS tax database. This lot doesn’t appear to have lake access, so it’s worth less than one that does. On the other hand, it’s a good sized parcel, and a large house.

Very interesting article on New Scientist on software that analyzes speech and facial expressions, and applying it to politicians.

Inspirational electioneering, straight talk and devious spin — new technology means it’s all getting easier to detect and dissect

http://technology.newscientist.com/channel/tech/mg19926746.200-software-spots-the-spin-in-political-speeches.html

A cute but bizarre Japanese music video

I have no idea who Nagi Noda is, but apparently she was famous, and has recently died. I also have no idea what the song is about, but the tune is catchy and the girl is cute. About 2:30 in, the unwilling dancing cats come in and it gets much odder. You really have to see it.

Boing Boing has a little bit more detail, and some additional links.

Dearden Supercharged Vincent Black Lightning

Dearden Supercharged Vincent Black Lightning

One of my favorite bluegrass songs is 1952 Vincent Black Lightning, performed by Del McCoury. The song was written by Richard Thompson, but Del’s rendition is the best, in my book. The lyrics intrigued me enough to do some research on the Vincents, which have an interesting history.

This article at Gizmag talks about the only known Dearden Supercharged Vincent Black Lightning to exist going up for auction. There’s also a good synopsis of the Vincent history.

Looking at this bike, I can’t imagine wanting to go 60 on one, much less 160+. But nonetheless, it’s a gorgeous piece of machinery with a fascinating history.

Installing Cygwin/X and WindowMaker

I’ve been using the Cygwin shell for a 8 or 10 years. On a couple of occasions I have attempted to install the Cygwin X server packages, and it always seem to be more difficult than it should be. After a while I’d get tired of messing with it, and go back to using the standard non-graphical Cygwin shell.

Unfortunately, cutting and pasting between the non-graphical shell and Windows applications is a major pain in the rear. Having to click the upper left corner, select ‘Mark’, highlight the text, hit Enter, then paste it somewhere was just too many awkward mouse clicks. I longed for the nice X or KDE windows environment, where left-clicking and highlighting the text copied it, and center-clicking the mouse pasted it. Simple, fast, reliable.

Another thing I missed having was all my SSH sessions in one place. I use SSH a lot, into 3 or 4 different systems each day, sometimes with multiple windows open to each. Generally I used Tectia’s free SSH client, which is getting a little long in the tooth. Terminal emulation seems a little iffy, particularly when it comes to using the ‘Home’ and ‘End’ keys on the command line to jump to one end or the other. Being able to use a modern ssh client under an xterm session would solve that issue. And I got tired of having all those Tectia icons on the task bar.

I don’t remember the exact circumstance, but something prompted me to look into installing X again. I fired up the ‘setup.exe’ from the Cygwin.com site, selected X11 and the WindowMaker window manager and let it install.

After it finished, I attempted to start X the way I’m familiar with on my Linux boxes: open a shell and type ‘startx’. Nothing good happened, so a little poking around was required. I found that ‘startxwin.sh’ in the ‘/usr/X11R6/bin’ directory would bring it up, but not running WindowMaker. Instead, I was getting the default, twm. twm is a little too basic for my tastes, and the visual appeal is non-existent. I imagine there are some that like it, but not me.

A little more poking around revealed that I need to replace the ‘exec twm &’ with ‘exec wmaker &’ in ‘startxwin.sh’, and comment out the ‘xterm’ line. This is definitely an improvement, but I found two things I don’t like.

The first is that Alt-Tab was still moving between Windows windows, and not WindowMaker windows. A lot of searching found that -keyhook needs to be added to the XWin.exe line in ‘startxwin.sh’. Now Alt-Tab switches between Windows windows until the Cygwin window is active, then Alt-Tab moves between WindowMaker windows. To switch to a different Windows application requires clicking on the task bar icon. I find this acceptable.

The second is that I had a Cygwin shell still open and present on the task bar, along with the Cygwin/X icon. Closing the Cygwin shell resulted in shutting down Cygwin/X, even through the process was detached. I expected this is because it follows a typical Unix-like programming model, where the Cygwin shell is the parent process, Cygwin/X is the child process, and killing the parent kills the child.

I happened to notice that in addition to ‘startxwin.sh’ there is also a ‘startxwin.bat’. I made the same changes to it as the ‘startxwin.sh’ file, then created a shortcut to the batch file on the desktop. I also changed the default batch file icon by right clicking the batch file, selecting ‘Change Icon’, and pointing it to ‘%SystemDrive%\Cygwin\usr\X11R6\bin\XWin.exe’. This results in the batch file having the XWin.exe icon, which is a nice black ‘X’ on a transparent background.

So now we’re all good to go: We can start X without having an extra icon on the task bar, WindowMaker is started, Alt-Tab moves between WindowMaker Windows, and I have what I consider to be much more proper copy’n'paste behavior.

Below is a screen shot of the X11 packages I have installed. You’ll want to make sure these packages are selected in the ‘setup.exe’ program. They’re all under the ‘X11′ menu, at the bottom of the list.

Selected X11 Packages

Selected X11 Packages

Below is the ‘/usr/X11R6/bin/startxwin.sh’ with all the comments removed (for brevity).


#!/bin/sh
export DISPLAY=127.0.0.1:0.0
export PATH=/usr/X11R6/bin:"$PATH"
export XAPPLRESDIR=/usr/X11R6/lib/X11/app-defaults
export XCMSDB=/usr/X11R6/lib/X11/Xcms.txt
export XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
export XNLSPATH=/usr/X11R6/lib/X11/locale

rm -rf /tmp/.X11-unix
XWin -keyhook -clipboard -silent-dup-error &
exec wmaker &
exit

And also the '/usr/X11R6/bin/startxwin.bat' file:


@echo off
SET DISPLAY=127.0.0.1:0.0
SET CYGWIN_ROOT=\cygwin
SET RUN=%CYGWIN_ROOT%\bin\run -p /usr/X11R6/bin
SET PATH=.;%CYGWIN_ROOT%\bin;%CYGWIN_ROOT%\usr\X11R6\bin;%PATH%
SET XAPPLRESDIR=/usr/X11R6/lib/X11/app-defaults
SET XCMSDB=/usr/X11R6/lib/X11/Xcms.txt
SET XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
SET XNLSPATH=/usr/X11R6/lib/X11/locale

if not exist %CYGWIN_ROOT%\tmp\.X11-unix\X0 goto CLEANUP-FINISH
attrib -s %CYGWIN_ROOT%\tmp\.X11-unix\X0
del %CYGWIN_ROOT%\tmp\.X11-unix\X0

:CLEANUP-FINISH
if exist %CYGWIN_ROOT%\tmp\.X11-unix rmdir %CYGWIN_ROOT%\tmp\.X11-unix

if "%OS%" == "Windows_NT" goto OS_NT
echo startxwin.bat - Starting on Windows 95/98/Me
goto STARTUP

:OS_NT
echo startxwin.bat - Starting on Windows NT/2000/XP/2003
:STARTUP

%RUN% XWin -keyhook -clipboard -silent-dup-error
%RUN% wmaker

Hopefully the time I wasted trying to get Cygwin/X tuned the way I wanted will save someone else a few minutes. Or if you stumble across this post, encourage you to try Cygwin/X.