Saturday, September 24, 2005 

Two weeks ago, I completed a year as a contractor at Microsoft. After the permatemps lawsuits, no contractor may work more than 12 months at Microsoft without taking a 100-day break. (Contractors are free to work elsewhere, of course, during the break.)

Emma quit her job at washington Mutual the same week in order to set up her own business. It will be months before she starts making money, so it seemed prudent for me to find a full-time job.

Last week, I interviewed with Amazon. This week, I interviewed with the group at Microsoft that I just left, Atlas DMT, and Google.

Microsoft and Atlas both made very attractive offers. This afternoon, I accepted the position of Senior Software Engineer at Atlas.

I had a very good year at Microsoft in Windows Emerging Markets. I did some really interesting work on an as-yet unannounced product (some day I hope to be able to talk about what I did) and I worked on a first-class team. I have two longtime friends on the team, Muhsin and Delf, and the three of us became very close to my officemate, Dipankar. Dipankar's contract ends next week; he received two offers of fulltime jobs from Microsoft this week, and he's accepted the position on the codec team.

While I very much liked the team and the product, I'm not nearly so keen on Microsoft the company. Between full-time employment and contracts, I've spent almost 10 out of the last 13 years at Microsoft, and that's more than enough. (It seems mildly ironic to be writing this on the day of the annual Microsoft Company Meeting, celebrating Microsoft's 30th anniversary.)

Atlas is a technology company, specializing in web advertising. I'm joining a team that's working on advertising in video-on-demand. I was very impressed by the team when I interviewed there on Wednesday, and they liked me too. They were a sharp bunch of guys who conducted a well-balanced series of interview that was both testing and welcoming.

The team has been using Scrum for a while and they've migrated towards XP, which they speak highly of. I've wanted to get first-hand experience in Agile development for years. They're also using C# and .NET. After 15 years of C and C++, I'm ready for managed code. They seem to be very committed to work/life balance. Not least, they're in the International District of downtown Seattle, 3 miles from my house. Every job I've had in my 13 years of living here has required me to commute across Lake Washington.

posted on Saturday, September 24, 2005 7:13:21 AM (Pacific Daylight Time, UTC-07:00) 
#    Comments [1]
Friday, September 23, 2005 

Last weekend, we made good progress on the basement. On Saturday, Dale and Ernest helped us out, doing some demolition in the basement, and bringing loads to Goodwill and to the dump in their truck.

On Sunday, Jill and Delf helped us clean the remaining stuff out of the basement. Louise excavated a hole outside the window that we're going to enlarge. Deb, currently hors de combat with a pinched nerve, dropped by to provide moral support, as did Frank and Lyndol. Delf spent nearly twelve hours with us that day, and thanks to his experience in construction, he and I built framing around the furnace.

Peter and Lucinda have provided some cash to help cover our costs, and Deb has promised to give us some furniture as soon as we're ready to take it.

Tomorrow and Sunday, we'll have more work parties, which should largely complete the basement. We need to finish the framing, tack up some panels around the walls, add some new ceiling tiles, and do something about the ten-foot wide entry into the basement bedroom. We also need to prime and paint both the basement and the spare bedroom.

On Monday, the concrete cutters will be enlarging the basement window, so that area of the basement needs to be sealed off to stop dust blowing everywhere. We've arranged for someone to measure the opening on Monday afternoon, so that a new window can be installed ASAP. We bought carpet a week ago, and it will be installed early next week.

We still do not yet have Katrina evacuees lined up to stay with us. We have not been able to reach Roy, though we did hear early this week that nobody had seen him in the preceding week. Perhaps he's gone to New Orleans? We heard from the same source that he had mentioned Emma's offer to him, so we know he hasn't forgotten. Meanwhile, we've posted offers on several websites, such as Rainbow Relief.

Hurricane Rita is sure to swell the numbers of homeless. The best thing we can do is to finish up the basement as soon as possible, so that we're ready to take people in.

We extend our profound thanks to everyone who's helped out. (I think I've mentioned everyone. I apologize if I've left anyone out.)

posted on Saturday, September 24, 2005 6:18:57 AM (Pacific Daylight Time, UTC-07:00) 
#    Comments [0]
Wednesday, September 14, 2005 

I learned a really clever trick at our workparty on Sunday.

We were using a dolly that we had borrowed from our neighbor Mary to haul a heavy credenza up from the basement. One of the tires was flat, which made the exercise even more difficult.

I got out my bicycle floor pump and started pumping, but it was a waste of time. The tire was tubeless and without any air, so it just slipped loosely around the rim. After a few minutes of futility, Dale remembered something he had seen years before at a gas station.

He got a bowl of soapy water and a sponge, and coated the metal rim and both rims of the tire with soapy water. This created a film which held the air in. Once there was a little air inside the tire, it started inflating when I pumped and the rim of the tire pushed against the metal rim, creating an airtight seal. After that, it was only a minute's work to bring the tire up to the recommended 30psi.

posted on Wednesday, September 14, 2005 8:17:18 AM (Pacific Daylight Time, UTC-07:00) 
#    Comments [0]

Shifting boxes

We've made some progress on getting our house ready to take in some Hurricane Katrina evacuees.

On Labor Day, Emma and I thoroughly cleaned out the garage in the alley, then put everything back much more efficiently, so that we would have somewhere to store all of the stuff that was in our basement.

On Thursday, Emma made contact with Roy, a doorman at her chiropractor's and a native of New Orleans. Roy and his other family members in the Seattle area are looking to bring up about 20 of their extended family. Roy was very keen to learn that we were offering space. Unfortunately, Emma forgot to get contact information from Roy, although she left her card with him, and we have not been able to reach him since, despite leaving messages at his workplace. He was supposed to call her on Monday, but didn't. We'll try to reach him again tomorrow. If we don't hear from him soon, we'll look elsewhere.

On Sunday, half a dozen of our friends came over and did a ton of work in clearing out our basement. Literally on the order of a ton of shelving, boxes, and other impedimentia was moved out of our basement, through the back yard, and into the garage. We thank Delf, Dale, Ernest, Mary, Ariana, and Ray for their hours of help, and Lyndol and Frank who dropped by with a batch of cookies.

Earlier today, our friend Barb came by and spent a few hours helping us empty out the spare bedroom. That room is just about ready to go. Incidentally, Barb told me the other day that Alaska Airlines are currently offering one-way fares from Dallas to Seattle for as little as $89, so that's a likely avenue for bringing people up from the Gulf Coast.

We hope to see several of our friends back on Saturday and Sunday for more work parties.

Scaling back

We've thought through what we hope to achieve and what we can reasonably achieve, and we're scaling our plans back. It's better to set a more modest goal and do it well, than to set an ambitious goal and flounder badly.

We still intend to offer the spare bedroom, which is fairly comfortable, for up to a year. But we're going to be doing much less with the basement.

We arranged for a few contractors come in and make bids on what it would cost to convert the large room in the basement into two bedrooms. This includes cutting two egress windows (as fire escapes), leveling the floor, repaneling the walls, framing a dividing wall, fixing the drop ceiling, adding doors, and so on. The cheapest bid was $18,000!

Instead, we now plan to make much more modest changes to the basement: cut egress holes, install cheap windows, cover the unleveled floor with carpet, repair the damaged paneling on the wall, drape some cloths for privacy in the doorways, and get some beds from somewhere.

We intend to make the basement available just for a few months. It won't be as comfortable as we had originally hoped, but it will be an improvement on sleeping on a cot in the middle of the Astrodome.

I had other concerns too, apart from the upfront cost of renovating half of the basement. Even if we did most of the work ourselves, with help from friends, how timely would we be? It's several weeks of part-time work and realistically, we can't hope to get a large amount of volunteer work to see a full project through. In the long term moreover, creating two nice bedrooms is a waste of effort, as we have very different plans for the basement.

I also have concerns about taking on half-a-dozen people for up to a year. Going from a childless couple in sole occupancy of our house to an eight-person household completely changes the dynamic. I don't want to feel like a stranger in my own home. Having two extra people for a year with a few more for a few months is more emotionally manageable.

The ongoing cost of running the household is also a concern. My contract at Microsoft ended last week, but I've got four interviews lined up, so I expect to be back at work shortly. However, Emma just quit her job to start her own business, so we're going to be losing money on that for quite a while.

In short, I want to do right by the evacuees, but I also have to do right by us.

posted on Wednesday, September 14, 2005 7:54:37 AM (Pacific Daylight Time, UTC-07:00) 
#    Comments [0]
Tuesday, September 13, 2005 

I mentioned recently that I would be walking in this year's AIDS Walk. And so I did.

After months of dry, sunny weather in Seattle, I have grown unaccustomed to rain. It was an unpleasant morning and an unpleasant shock. The skies opened and I stood in an endless line waiting to register. I raised $1180, which entitled me to huddle in the VIP tent, as the rain continued. The rain finally let up about halfway along the route, as we debouched onto Broadway.

Thanks to my fellow Team BiNet Seattle fundraisers, Emily and Meghan, who raised a few hundred more between them. Double thanks to Emily for giving me a ride home afterwards.

posted on Wednesday, September 14, 2005 6:51:15 AM (Pacific Daylight Time, UTC-07:00) 
#    Comments [0]
Monday, September 12, 2005 

My good friend Frank Maloney turned 60 the other day. A few months ago, he invited Emma and me to join him and his partner, Lyndol, at The Herbfarm. The Herbfarm is one of the very best restaurants in the Seattle area. Certainly one of the most expensive.

Lyn-and-Frank.jpg

Frank brought us to The Herbfarm, but not at his own expense. One of Frank's college roommates was Ron Zimmerman, the owner of The Herbfarm, and Ron had invited Frank to bring Lyndol and two guests over for his 60th birthday. Ron semi-seriously credits Frank with introducing him to good wine, when Frank was a sommelier in the Seventies.

Frank-and-Ron.jpg

We had a marvelous time. This was our first visit. It won't be our last, but dinner runs nearly $200 per person, so we'll never be regulars.

The Herbfarm is in the Sammamish River valley, right next to the Red Hook Brewery, near Woodinville. The building looks like a traditional farmhouse, though I'm sure it was recently built. Inside, it's both cosy and elegant, with some eccentric touches in the dining room.

Dinner is an all-evening experience with a nine-course dinner. We arrived not long after six, and left just after midnight. On arrival, we toured the premises, finding Ron in his alarmingly well-stocked wine cellar.

At six-thirty, Carrie Van Dyck, Ron's wife, brought the forty or so guests on a tour of the herb garden, describing the herbs that were to be featured in that evening's menu. She told us how to grow each herb, passing out fresh samples of herbs, including lemon thyme, lemon geranium, lemon basil, and anise hyssop. We also saw the truffling pigs and the ducks they keep in one corner of the garden.

Borage.jpg

We sat down at seven, starting out with small servings of crab soup, mussels, and baby corn. I detest fish -- I cannot stand the smell or the taste -- so I passed the soup and mussels on to Emma and Frank, who were more than happy to have my share.

After we had finished the first course, Ron brought out his chef, Jerry Traunfeld, and they launched into a long description of both that night's menu and upcoming menus, paying particular attention to the wines. They concluded by introducing the dozen or so staff. I've never seen such a full-blown introduction to dinner, but they had a lot to talk about, and it lived up to the promise.

The next course was smoked black cod, which I passed on to Frank, but not before nibbling on a corner of it. Every couple of years, I give in to my companions and try a piece of some highly recommended fish dish. As always, it did nothing for me, but everyone else liked theirs. I comforted myself with the two different Chardonnays that were served with the cod. My life would be simpler if I weren't so averse to fish.

After that point, all the food was to my liking. There followed a goat cheese ravioli with figs, which was succeeded by a grilled squab. We washed that down with apple-shiso ice.

I love lamb, and I greatly enjoyed the loin of lamb. The cheese that followed was a fine blend of sharp and nutty.

I was starting to flag at this point, from all the wine and food, but I gamely took on the desserts: a small cone of ice cream and a peach cobbler.

The final two courses were coffee and small treats with madeira. I couldn't face the latter, but we boxed them up, and I just ate a couple now.

Throughout the evening, Ron was a gracious and thoughtful host, paying particular attention to our table.

Many years ago, Frank published a small volume of poetry called How to Eat a Slug.

How-to-eat-a-Slug.jpg

Imagine our delight when Ron produced a chocolate slug.

Frank had been very sick earlier in the summer and we had wondered for a while if he would be well enough to go. His health is still not good, but he was well enough to thoroughly enjoy a truly memorable evening.

Here's to many more birthdays, Frank!

posted on Monday, September 12, 2005 7:29:35 AM (Pacific Daylight Time, UTC-07:00) 
#    Comments [0]
Monday, September 05, 2005 

A few hours ago, Emma sent this email out to our friends:

After long thought and a lot of heart searching, George & I have decided to take in a family from Louisiana. We are now starting to look for someone who can help us make arrangements to get people here. Meanwhile, we need anyone who wants to volunteer to help us clean out our basement and fix it up to house people. We have a guest room on our first floor, but we also need to rearrange the entire house to allow us to add 4-6 people to our lives for up to the next year.

At the very least, we need anyone who can donate money to help with travel costs for the family we get, to buy supplies to make our basement livable, to donate beds/bunk beds and other bedroom furniture (tho' this can wait on when we know the make up of the family we get), etc. Whatever family we get is going to became part of our family. We don't want them to feel like refugees being tolerated in our home in make-shift conditions, we want them to feel like FAMILY and that our home is their HOME.

If any of you have contact with a poor family that needs a new start, please let us know. We'll be looking for a way to get a family here.

Blessings, Emma Bartholomew & George Reilly

This was Emma's idea. I've always known that she had a big heart. I'm particularly proud of her this time.

She later sent this out:

Thanks for everyone's responses so far. George & I have contacted various groups about providing housing and are waiting to hear back. Meanwhile, we've come to the conclusion that we need to get some professionals in here to bring our basement up-to-code for housing a family. Does anyone know of a reputable contractor/firm that we could hire to do the work? With a good, fast firm, we can add two to three bedrooms with escape windows to our basement, while upgrading the basement bathroom to be able to handle the additional use.

Thanks for any suggestions.

Emma & George

It's going to be a busy few days around here. We have a lot of crap that we need to shift around.

posted on Monday, September 05, 2005 7:24:58 AM (Pacific Daylight Time, UTC-07:00) 
#    Comments [0]

I just sent the following letter to Jim McDermott, Patty Murray, and Maria Cantwell. An abbreviated version went to the Seattle Times.

In August 2001, George W. Bush ignored a warning that Osama Bin Laden would attack the US. Thousands died.

In March 2003, Bush started an unnecessary war against Iraq. Tens of thousands died.

In August 2005, Bush ignored warnings that a major hurricane would strike New Orleans, and stayed on vacation. He played guitar in Arizona while New Orleans drowned. Uncounted thousands died.

Not until Wednesday did he return to Washington. Even now, he has yet to show leadership. Photo ops are not leadership. Platitudes are not leadership.

For four years, the Bush administration has played the terror card, warning us again and again that terrorists would strike our cities. Billions have been spent on homeland defense. Where did the money go? Where were the contingency plans? Why was FEMA's response so outrageously incompetent? Why are thousands of people still trapped in New Orleans? Why are thousands dead?

The small-government conservatives in their zeal to drown government in the bathtub have drowned New Orleans instead.

Bush gutted FEMA, replacing the competent Witt with two cronies, Allbaugh and Brown.

Bush repeatedly gutted the budget for the levees, to pay for his unconscionable tax cuts.

Bush gutted the National Guard, sending them off to die in Iraq.

Bush ignores global warming, while the hurricanes grow fiercer every year.

Bush could not avert Hurricane Katrina. No one could. But he is responsible for the inadequate preparation, and for the wretchedly inept followup.

It is time for George Bush's accountability moment. The president's job is serve and protect the American people. He has failed to do either. It is time for him to go.

Impeach him!

posted on Monday, September 05, 2005 7:17:59 AM (Pacific Daylight Time, UTC-07:00) 
#    Comments [1]
Friday, August 26, 2005 

On Saturday 10th September 2005, over 8,000 people will participate in the Northwest AIDS Foundation Walk. I will be one of them, as I have been every year since 1992.

To sponsor me, please visit my Donation Page.

I had originally signed up to march with Team Microsoft. Then we in BiNet Seattle decided to form a team. Please join Team BiNet Seattle: we'd love to have you.

It's been more than 20 years since AIDS was first recognized. AIDS is still wreaking devastation in Africa and Asia, and affecting many in the U.S. Although the new protease inhibitors are helping many people in the West, the AIDS epidemic is far from over. For one thing, the new drugs are not a cure. When they work well, they enable people with AIDS to lead an active life and live much longer than before. But one-third of people with access to medical treatment do not respond to that treatment. The new drugs are horrendously expensive (about $15,000 per year), so they're out of reach of 95% of the people living with AIDS around the world. (Recently, the large pharmaceutical companies have come to some agreements to make their drugs available at much cheaper rates in the Third World, but millions of people still have no access to the drugs.) Furthermore, somewhere between 550 and 1,100 Washingtonians are infected every year, one-quarter of them under the age of 22. More than 85% of the people diagnosed with AIDS in Washington State since 1995 are still alive---a marked improvement on the situation before the protease inhibitors became available. All of this means that there's a continuing need for money to help fight the epidemic.

In addition to funding the Lifelong AIDS Alliance's own services, the money raised will be distributed to other AIDS organizations throughout Washington State. The Lifelong AIDS Alliance (formerly the Northwest AIDS Foundation and the Chicken Soup Brigade) provides a variety of services to HIV+ people and people living with AIDS in Washington: Food, housing, rent subsidies, in-home care, groceries, educational material, and much more. See http://www.lifelongaidsalliance.org for more details.

If you'd like to walk yourself, please visit http://www.aidswalk2005.org. If you work for a company, such as Microsoft, that matches charitable contributions, be sure to list your company name.

I thank you, Lifelong AIDS Alliance thanks you, and the people your donation will help thank you.

posted on Friday, August 26, 2005 7:52:28 AM (Pacific Daylight Time, UTC-07:00) 
#    Comments [0]
Thursday, August 11, 2005 

I'm a command-line dinosaur. Vim (Vi IMproved) is my favorite text editor. And I write quite a few little batch files.

Here are a few useful tricks that work with cmd.exe on Windows XP.

Timestamped filename

Sometimes I want to create a file whose name includes the current date and time. By combining the magic %DATE% and %TIME% environment variables, with for /f and a little bit of string substitution, I can create that filename.

REM
REM "Tue 06/14/2005" -> "06/14/2005"
REM
for /f "tokens=2" %%i in ("%DATE%") do set MDY=%%i
REM
REM "06/14/2005" -> "2005-06-14"
REM
for /f "delims=/ tokens=1,2,3" %%i in ("%MDY%") do set YMD=%%k-%%i-%%j

REM "16:44:39.72" -> "1644"
REM
for /f "delims=: tokens=1,2" %%i in ("%TIME%") do set HM=%%i%%j
REM
REM " 237" -> "0237" (%TIME% < 10:00:00.00 contains a leading space)
set HM=%HM: =0%

xcopy /yf %1 %YMD%_%HM%.bak

See for /? and set /? to explain everything that the comments don't.

Timing Operations

Sometimes it's useful to time operations.

@setlocal
@if (%_echo%)==() set _echo=off
@echo %_echo%

call :time T1
set T2=%T1%
set Iter=0
@echo T1 = %T1%

:repeat
CostlyOperation.exe

call :time T2
set /A DeltaT=%T2% - %T1%
set /A Iter=%Iter% + 1
set /A Avg=%DeltaT% / %Iter%
@echo DeltaT = %DeltaT%, Avg = %Avg%, Iter = %Iter%, T2 = %T2%
goto :repeat


:time
set TT=%TIME%
for /f "delims=: tokens=1" %%i in ("%TT%") do set hrs=%%i
for /f "delims=: tokens=2" %%i in ("%TT%") do set min=1%%i
for /f "delims=: tokens=3" %%i in ("%TT%") do set sec=1%%i
for /f "delims=. tokens=1" %%i in ("%sec%") do set sec=%%i
set /A %1=3600 * %hrs% + 60 * (%min%-100) + (%sec%-100)
goto :EOF

The :time subroutine calculates the number of seconds that have elapsed today. The business with 100 is to handle the case that min or sec is 08 or 09, which Cmd's expression evaluator considers to be malformed octal.

set /? explains set /A arithmetic. call /? explains subroutine syntax and goto :EOF.

Extending this code so that it works past midnight is left as the proverbial exercise for the reader.

posted on Thursday, August 11, 2005 7:26:57 AM (Pacific Daylight Time, UTC-07:00) 
#    Comments [0]
Tuesday, July 19, 2005 

I'm taking a beginner's drawing class at North Seattle Community College. Today, we started on perspective. We began by watching a 45-minute video by David Hockney, where he contrasts three paintings: a Canaletto painting of Venice, and two Chinese scrolls painted 70 years apart.

The Canaletto is a classic two-point linear perspective painting. Both of the Chinese scrolls show trips by the emperor along the Grand Canal. The first one, by Wang Hui, is 27 inches high and 72 feet wide! It uses multiple perspective to show scenes, in a manner that is strange to my Western eyes. Hockney demonstrates how effective it is. For example, he shows a corner where two streets meet at right angles. On the "up" street, the viewer is on the left, looking right, at the left side of the houses; on the street coming from the left, we see the right side of the houses. I've made it sound like a mess but it works. The scroll is a marvel of teeming humanity in tiny detail. Most of the figures are scarcely larger than Hockney's fingernail.

He contrasts it unfavorably with a scroll painted of a similar trip by the emperor's grandson, after Western missionaries had imported their notions of perspective. The second scroll is flat and lifeless, though the perspective is more "correct" to our eyes.

Worth seeing if you can find a copy.

posted on Wednesday, July 20, 2005 5:47:56 AM (Pacific Daylight Time, UTC-07:00) 
#    Comments [1]
Monday, July 18, 2005 

On Saturday, I bought Harry Potter and the Half-Blood Prince at CostCo. On leaving, the checker told me that I had bought the 887th copy at that store. This was 1pm, three hours after opening, so they were selling at the rate of five per minute.

I started reading it last night. After two chapters, when I had seen far too many references to earlier books that I didn't recall, I decided that it was time to re-read the earlier books. I'm a fast reader, but I don't retain material very well.

In the first chapter of the first book, I came across an ironically prophetic statement, made by Professor McGonagall as she and Professor Dumbledore are leaving Baby Moses, er, Harry on the Dursleys's doorstep:

He'll be famous -- a legend -- I wouldn't be surprised if today was known as Harry Potter day in the future -- there will be books written about Harry -- every child in our world will know his name!

This of course was written when J.K. Rowling was an unknown, when the thought of her being a millionaire, much less a billionaire, was unthinkable.

posted on Tuesday, July 19, 2005 6:18:53 AM (Pacific Daylight Time, UTC-07:00) 
#    Comments [0]

I've been a fan of both Bernard Cornwell and Patrick O'Brian for a number of years. Both are known for their historic fiction set in the Napoleonic Wars.

Cornwell has written 20 books about Richard Sharpe, a rough and ready British Army officer, up from the ranks. Cornwell excels at writing battle scenes, capturing the smells and sounds, the noise and confusion, the blood and the gore. Some of them were turned into a TV miniseries in the mid-1990s, with Sean Bean as Sharpe.

O'Brian wrote 20 novels about Captain Jack Aubrey and Dr. Stephen Maturin of the Royal Navy. The Russell Crowe movie Master and Commander was based on a couple of the books.

I recently finished the latest Sharpe book, Sharpe's Escape. Near the end, there's an advertising section, which says

and The Economist proclaimed Bernard Cornwell, "The direct heir to Patrick O'Brian."

Nonsense! They're both fine writers, in their own ways, but O'Brian is a much better novelist than Cornwell.

The Sharpe books are fun, but formulaic. Sharpe makes an enemy, usually an officer on his own side or the other side; Sharpe is bloody-minded and stubborn; Sharpe fights battles; Sharpe gets laid; the enemy (usually) gets his comeuppance. Thomas of Hookton (The Grail Quest series) is just Sharpe with a longbow instead of a rifle. Cornwell is capable of more ambitious work, such as the Arthur books, but most of his writing is simple adventure fiction.

There's plenty of adventure in the Aubrey-Maturin novels too, but O'Brian is a much keener, more philosophical observer, who brings depth to his characters. Patrick O'Brian's naval mastery does a better job of elaborating on this than I can.

posted on Tuesday, July 19, 2005 6:04:54 AM (Pacific Daylight Time, UTC-07:00) 
#    Comments [0]
Thursday, June 16, 2005 

For the last three years, I've been involved with The Wild Geese Players of Seattle, an amateur group that does readings of Irish literature, particularly the works of James Joyce and W.B. Yeats. Our big event every year is Bloomsday, June 16th, commemorating Joyce's Ulysses, which takes place on June 16th, 1904. It's a tale of a Jewish everyman, Leopold Bloom, wandering through Dublin one day, and of the young writer (and Joyce's alter ego), Stephen Dedalus. We're working our way through the book, reading a chapter or two each year. In this, our eighth year, we'll be reading Chapter 11, "Sirens" at the Brechemin Auditorium in the School of Music at the University of Washington, on Thursday 16th and Saturday 18th. Congressman Jim McDermott will be reading the part of Bloom on the Saturday.

Last year and this year, I have been the assistant dramaturge, helping to turn chapters into a script to be read by 15-20 readers. In previous years, the director made a photocopy of the book, wrote attributions ("Narrator 1", "Bloom", "Stephen", etc) on the paper, then photocopied that text and handed it out to the readers. Since the script was a moving target, everyone ended up with a set of scruffy, tatty, inconsistently hand-annotated sheets. It was a mess.

I knew there had to be a better way. Now, we've adapted the etext of the 1922 Paris Edition, prepared by Project Gutenberg, which saves a lot of typing. The script is marked up in XML and styled with XSLT to produce an HTML page. After a rehearsal or two, when it's apparent that the script isn't quite right, it's an easy matter to make a few changes, render fresh HTML, and print new scripts.

The XSLT required is fairly straightforward. About the only mildly interesting thing is defining one template in terms of another; e.g., I want all the speakers to share the same styling, so I defined a parameterized speaker template:

    <xsl:template name="speaker">
<xsl:param name="name" />
<div class="speaker">
<span class="speaker"><xsl:value-of select="$name"/>: </span>
<xsl:apply-templates />
</div>
</xsl:template>

which is called thus:

    <xsl:template match="bloom">
<xsl:call-template name="speaker">
<xsl:with-param name="name">Bloom</xsl:with-param>
</xsl:call-template>
</xsl:template>

The real challenge in preparing the script is dramaturgical. Ulysses is a notoriously difficult and dense text, woven through with Bloom's stream-of-consciousness interior monologue. Each chapter is written in a different style. Sirens, for example, has musical themes running through it, and we'll be accompanied by a piano player this year.

What would you do with this?

Bloom heard a jing, a little sound. He's off. Light sob of breath Bloom sighed on the silent bluehued flowers. Jingling. He's gone. Jingle. Hear.

Here's what we came up with:

N1: Bloom heard a jing, a little sound.
Bloom: He's off.
N1: Light sob of breath Bloom sighed on the silent bluehued flowers. Jingling.
Bloom: He's gone.
N1: Jingle.
Bloom: Hear.

Or with this paragraph?

--Yes, Mr Bloom said, teasing the curling catgut line. It certainly is. Few lines will do. My present. All that Italian florid music is. Who is this wrote? Know the name you know better. Take out sheet notepaper, envelope: unconcerned. It's so characteristic.

We chose this:

Bloom (Aloud): Yes.
N1: Mr Bloom said, teasing the curling catgut line.
Bloom (Aloud): It certainly is.
Bloom: Few lines will do. My present.
Bloom (Aloud): All that Italian florid music is.
Bloom: Who is this wrote? Know the name you know better. Take out sheet notepaper, envelope: unconcerned.
Bloom (Aloud): It's so characteristic.

We ended up with three narrators in this chapter: N1 deals with Bloom, primarily; N2 is mostly for Miss Douce and Miss Kennedy, the siren barmaids; and N3 handles the other characters.

Lest I scare you off, much of the chapter is quite clear and often very funny, even for people who are unfamiliar with the book.

The James Joyce Portal is a good starting point for matters Joycean.

posted on Thursday, June 16, 2005 7:54:52 AM (Pacific Daylight Time, UTC-07:00) 
#    Comments [0]
Thursday, June 02, 2005 

Printf Tricks

It may be old-fashioned, but I still find printf (and sprintf and _vsnprintf) incredibly useful, both for printing debug output and for generating formatted strings.

Here are a few lesser-known formats that I use again and again. See MSDN for the full reference.

%04x - 4-digit hex number with leading zeroes

A quick review of some of the basics.

%x prints an int in hexadecimal.

%4x prints a hex int, right-justified to 4 places. If it's less than 4 digits, it's preceded by spaces. If it's more than 4 digits, you get the full number.

%04x prints a hex int, right-justified to 4 places. If it's less than 4 digits, it's preceded by zeroes. If it's more than 4 digits, you get the full number, but no leading zeroes.

Similarly, %d prints a signed int in decimal, and %u prints an unsigned int in decimal.

Not so similarly, %c prints a character and %s prints a string. For wide (Unicode) strings, prefix with l (ell, or w): %lc and %ls.

Note: For the Unicode variants, such as wprintf and friends, %c and %s print wide strings. To force a narrow string, no matter which variant, use the %h size prefix, and to force a wide string, use the %l size prefix; e.g., %hs and %lc.

%p - pointer

The wrong way to print a pointer is to use %x. The right way is to use %p. It's portable to Win64, as well as to all other operating systems.

Everyone should know this one, but many don't.

%I64d, %I64u, %I64x - 64-bit integers

To print 64-bit numbers (__int64), use the I64 size prefix.

%Iu, %Id, %Ix - ULONG_PTR

ULONG_PTR, LONG_PTR, and DWORD_PTR are numeric types that are as wide as a pointer. In other words, they map to ULONG, LONG, and DWORD respectively on Win32, and ULONGLONG, LONGLONG, and ULONGLONG on Win64.

The I size prefix (capital-i, not lowercase-L) is what you need to print *LONG_PTR on Win32 and Win64.

%*d - runtime width specifier

If you want to calculate the width of a field at runtime, you can use %*. This says the next argument is the width, followed by whatever type you want to print.

For example, the following can be used to print a tree:

 void Tree::Print(Node* pNode, int level)
{
if (NULL != pNode)
{
Print(pNode->Left, level+1);
printf("%*d%s\n", 2 * level, pNode->Key);
Print(pNode->Right, level+1);
}
}

%.*s - print a substring

With a variable precision, you can print a substring, or print a non-NUL-terminated string, if you know its length. printf("%.*s\n", sublen, str) prints the first sublen characters of str.

[2005/7/19: fixed a typo in previous sentence (%.s -> %.*s). A little elaboration on the syntax: . in a printf format specification is followed by the precision. For strings, the precision specificies how many characters will be printed. A precision of * indicates that the precision is the next argument on the stack. If the precision is zero, then nothing is printed. If a string has a precision specification, its length is ignored.]

%.0d - print nothing for zero

I've occasionally found it useful to suppress output when a number is zero, and %.0d is the way to do it. (If you attempt to print a non-zero number with this zero-precision specifier, it will be printed.) Similarly, %.0s swallows a string.

%#x - print a leading 0x

If you want printf to automatically generate 0x before hex numbers, use %#x instead of %x.

Other tricks

See the documentation for other useful tricks.

Security

Never use an inputted string as the format argument: printf(str). Instead, use printf("%s", str). The former is a stack smasher waiting to happen.

%n is dangerous and disabled by default in VS2005.

Don't use sprintf. Use the counted version, _snprintf or _vsnprintf instead. Better still, use the StrSafe.h functions, StringCchPrintf and StringCchVPrintf, to guarantee that your strings are NUL-terminated.

[Update: 2008/01/25: See also Printf %n.]

posted on Thursday, June 02, 2005 7:44:26 AM (Pacific Daylight Time, UTC-07:00) 
#    Comments [0]
Sunday, May 15, 2005 

I've set up a new personal blog at www.georgevreilly.com/blog. I'll be posting non-technical stuff there and I'll be cross-posting on technical matters to Weblogs @ ASP.net. Here's how I ended up running dasBlog on the new blog.

In the spring of last year, I attempted to install both .Text and dasBlog on my XP Pro laptop. I failed, signally, to get either one working. The details have mercifully faded with time, leaving me only with a residue of frustration.

I've been meaning to put some photos of mine up on the web for a while. A week ago, I went to download nGallery, as I remembered hearing good things about it in the past. I learned that nGallery is now part of Community Server (as is .Text). After navigating through the somewhat confusing portal, I downloaded a copy of Community Server 1.0.

Then I spent several frustrating hours trying to get it running on my laptop. Community Server requires a SQL Server back-end, but you can also use MSDE, the standalone Microsoft SQL Desktop Engine, which comes without a GUI. I downloaded MSDE and the SQL Web Data Administrator, as well as MSDE Query. I can spell "SQL", but that's about where my knowledge of SQL stops. I tried to follow the instructions to create the database tables. I did manage to create the master table, but I could not figure out how to set the various permissions that the instructions demanded. I googled extensively and looked through the archived forums at CommunityServer.org and SqlJunkies.com, to no avail.

Really! If I can't figure this stuff out, most people are never going to get Community Server running on their own systems. Don't get me wrong. Community Server/.Text is a good blogging system, if you can surmount the barriers to entry. I'm a competent, skilled developer, but I've never needed to learn SQL, and I wasn't motivated enough to dig further.

(I've since realized that my hosting package at iHostSites includes MySql, but not SQL Server, so this would have been all for naught. I think. Double aargh!)

I gave up on Community Server in frustration, and decided to fall back to nGallery. I got nGallery installed and running easily enough. Alas, it was flaky and it was all too easy to get ASP.net throwing unhandled exceptions back at me. I spend too much of my life troubleshooting other people's bugs, and I wasn't prepared to invest any more time on this avenue.

At this point, I googled for "web album software" and came up with JAlbum. I'm much happier with JAlbum. It worked flawlessly as soon as I ran it and it's versatile. Photos will start appearing on my personal website, www.GeorgeVReilly.com, soon.

Yesterday, I decided to give dasBlog another try. That was altogether more successful. I did not manage to get it running on my laptop, but I did get it running on a XP Pro desktop system, as well as on my public website. I did have a little difficulty getting it to run on my desktop system, but that went away as soon as I ran aspnet_regiis -i to reset ASP.net.

I'm not sure why it doesn't run on my laptop, but the enormous amount of stuff that I've installed on this system surely plays a role. Indeed that may have been the reason why nGallery puked on my laptop. Someday, I'm going to have to flatten the system and reinstall only the important stuff.

Net results:

Album software: JAlbum 1, nGallery 0.

Blogging software: dasBlog 1, Community Server 0.

posted on Monday, May 16, 2005 4:44:39 AM (Pacific Daylight Time, UTC-07:00) 
#    Comments [0]
Saturday, May 14, 2005 

This is my third blog. I've had a technical blog at Weblogs @ ASP.NET for the last year, and a defunct blog at EraBlog for another year.

I've been meaning to set up a blog at my personal website for a while, one that allows me to post about anything that I feel like. Posting about non-technical matters is discouraged at Weblogs.asp.net.

So here it is. (Assuming I've set it up correctly) I will be cross-posting technical posts to weblogs.asp.net. Other posts will appear here exclusively.

posted on Sunday, May 15, 2005 6:04:32 AM (Pacific Daylight Time, UTC-07:00) 
#    Comments [0]
Friday, June 25, 2004 

http://weblogs.asp.net/images/aspnetblog-title.png

(Originally posted to Home at EraBlog on Fri, 25 Jun 2004 20:47:24 GMT)

After several months of not blogging, I've decided to resume. EraBlog was nice while it lasted, but Mike Amundsen hasn't been paying attention to it for a while. I was always frustrated at the lack of configurability, and I hated the hard-coded limit of three posts showing up on the front page.

I've moved to http://weblogs.asp.net/george_v_reilly/.

Update: See next post. I've long since moved to GeorgeVReilly.com/blog.

posted on Friday, June 25, 2004 9:28:39 AM (Pacific Daylight Time, UTC-07:00) 
#    Comments [0]
Wednesday, February 11, 2004 

http://www.tedkennedy.com/page/file/1c51c6fd0c43cefa9c_f9bmv2z3d.gif/FMA2.gif

(Originally posted to Queer at EraBlog on Wed, 11 Feb 2004 23:48:38 GMT)

George W. Bush, after months of hinting that he would support the Federal Marriage Amendment, has endorsed it. He's desparately trying to change the subject from whether he was AWOL from the National Guard in Alabama.

The Human Rights Campaign is urging everyone to oppose this. They provide a sample letter to send to your representatives, but I threw it away and wrote my own (below), which has been sent to my representatives, via the HRC Action Center.

The Bush Administration pisses me off on so many levels. I'm particularly infuriated about Bush's support for the Federal Marriage Amendment. After hinting that he'd support it for the last few months, he's now trying to change the subject from the charges that he was AWOL from the Air National Guard.

The FMA is a rabble-rousing exercise cooked up by the likes to Donald Wildmon to invigorate the religious right. Once again, the know-nothing bible thumpers are demonizing gay people. I'm sick of it.

Specious arguments about the sanctity of marriage fall flat when you consider that 50% of marriages end in divorce and Britney Spear's frivolous prank has more legal standing than a gay couple that have been together for decades.

The federal government has no business interfering in marriage. That's the states' prerogative.

Several commentators have argued that not only would the FMA forbid gay marriage, it would also void any civil unions legislation that some states may pass.

We should be following the example of most Western European nations and decoupling the civil and religious aspects of marriage. The state and only the state can marry you. A religious wedding has no legal significance. I don't expect this to happen in the US anytime soon. So much for the Separation of Church and State.

I fully expect you to vigorously oppose the FMA.

I would very much like for you to support gay marriage, or at least civil unions.

My representatives are Rep. Jim McDermott, Sen. Patty Murray, and Sen. Maria Cantwell, Jim McDermott is very liberal and needs no urging to oppose it; Cantwell and Murray are fairly liberal, but it does no harm to stiffen their spines. Or for me to vent.

posted on Wednesday, February 11, 2004 10:26:15 AM (Pacific Standard Time, UTC-08:00) 
#    Comments [0]

http://www.thethinkingblue.com/iamthinkingblue/STUPID.gif

(Originally posted to Politics at EraBlog on Wed, 11 Feb 2004 06:08:52 GMT)

From my email. Origin obscure.

Things you have to believe to be a Republican today:

  1. Being a drug addict is a moral failing and a crime, unless you're a conservative radio host. Then it's an illness and you need our prayers for your recovery.

  2. The United States should get out of the United Nations, and our highest national priority is enforcing U.N. resolutions against Iraq.

  3. "Standing Tall for America" means firing your workers and moving their jobs to India.

  4. A woman can't be trusted with decisions about her own body, but multi-national corporations can make decisions affecting all mankind without regulation.

  5. Jesus loves you, and shares your hatred of homosexuals and Hillary Clinton.

  6. The best way to improve military morale is to praise the troops in speeches while slashing veterans' benefits and combat pay.

  7. Group sex and drug use are degenerate sins unless you someday run for governor of California as a Republican.

  8. If condoms are kept out of schools, adolescents won't have sex.

  9. A good way to fight terrorism is to belittle our long-time allies then demand their cooperation and money.

  10. HMOs and insurance companies have the interest of the public at heart. Providing health care to all Iraqis is sound policy. Providing health care to all Americans is socialism.

  11. Global warming and tobacco's link to cancer are junk science, but creationism should be taught in schools.

  12. Saddam was a good guy when Reagan armed him, a bad guy when Bush's daddy made war on him, a good guy when Cheney did business with him, and a bad guy when Bush needed a "we can't find Bin Laden" diversion.

  13. The public has a right to know about Hillary's cattle trades, but George W. Bush's driving record is none of our business.

  14. You support states' rights, which means Attorney General John Ashcroft can tell states what local voter initiatives they have a right to adopt.

  15. Government should relax regulation of Big Business and Big Money but crack down on individuals who use marijuana to relieve the pain of illness.

  16. What Bill Clinton did in the 1960s is of vital national interest, but what G.W. Bush did in the '80s is irrelevant.

  17. Trade with Cuba is wrong because the country is communist, but trade with China and Vietnam is vital to a spirit of international harmony.

posted on Wednesday, February 11, 2004 10:24:57 AM (Pacific Standard Time, UTC-08:00) 
#    Comments [0]
Tuesday, December 02, 2003 

http://www.amnestyusa.org/success/i/sharipov.jpg

(Originally posted to Politics at EraBlog on Tue, 02 Dec 2003 08:32:12 GMT)

I sign a lot of petitions. Here's one that I wrote a custom letter for.

First, the background.

From: "John - THE LIST" <john@gayadvocacy.com> Sent: Monday, December 01, 2003 6:24 PM Subject: THE LIST: Action Alert - Free Ruslan Sharipov THE LIST - Special Alert for Gay Torture Victim

Washington, DC December 1, 2003

Ruslan Sharipov, a journalist in Uzbekistan, is being imprisoned and tortured because he's gay. His government captors have threatened to rape him with a bottle and inject him with AIDS. But there is talk that the government may soon amnesty a few political prisoners. Let's make sure he is one of them by emailing the 3 key US officials below, demanding they tell the Uzbek government to free Ruslan Sharipov.

I've managed to get the direct email addresses for these rather high-ranking US officials. Let's take advantage of our luck. And if you're not American, no matter - it's still good for them to hear that people around the world are watching America's actions on this important case:

You can read more about Ruslan's case at the Human Rights Watch Web site. BACKGROUND

Earlier this year, openly-gay journalist Ruslan Sharipov was given a five-year prison term by the Uzbek government simply because he is an openly-gay advocate for human rights in his Stalinist homeland. In the six months he's already been in prison, the 25-year-old Ruslan has been physically and mentally tortured, and forced to write his own suicide note. WHY YOUR EMAILS MATTER

This month, December 2003, the Uzbek government, under intense international pressure from groups like Human Rights Watch and Amnesty International, is reportedly considering freeing some of its 7,000 to 10,000 political prisoners. We need to make sure that Ruslan is among those freed.

I have it on good authority that senior US officials do not believe the American people care about Ruslan's imprisonment and torture. They think we don't care that the Bush Administration is giving Uzbekistan $500 million a year in aid, much of it going towards training the very state security apparatus that tortures gays and lesbians and other political prisoners. And they think we don't care that earlier this year two political prisoners were boiled alive, and that our tax money helps all of this happen. IT'S TIME TO TELL THE US GOVERNMENT WE DO CARE.

President Bush tells us he's fighting for freedom and democracy in Iraq, then supports a brutal dictator next door. President Bush needs to start practicing what he preaches. He should tell the government of Uzbekistan to free gay journalist Ruslan Sharipov. Again, those email addresses are: - grossmanM2@state.gov - AppletonDE@state.gov - cranerlx@state.gov

  • grossmanM2@state.gov

  • AppletonDE@state.gov

  • cranerlx@state.gov

Thanks so much, and please share this email alert with all of your friends and colleagues. I truly believe that if we all get involved now, this is one we can win in no time. (I'm doing this update as a text-only version so you can easily forward it by email to your friends and colleagues.)

JOHN ARAVOSIS Editor, THE LIST and HateCrime.org Washington, DC

PS For more information on Ruslan's case, visit Human Rights Watch Web site.

Here's the letter that I sent.

From: George V. Reilly To: grossmanM2@state.gov ; AppletonDE@state.gov ; cranerlx@state.gov Sent: Tuesday, December 02, 2003 12:03 AM Subject: Free Ruslan Sharipov

The Bush Administration has taken to arguing that the US invaded Iraq to save the Iraqi people from the brutality and torture of Saddam Hussein's regime, and to bring democracy. It's unquestionably good that the torturers of Iraq are gone.

But the Administration has also given $500 million to Uzbekistan, where political prisoners have been boiled alive. Have we learned nothing from the past? Saddam was once our puppet, as were many other dictators in Latin America, Africa, and elsewhere. The CIA helped overthrow Mossadegh's democratically elected government in Iran in 1953, to our lasting cost. Supporting brutal dictators may help our strategic position in the short term, but it makes us look like hypocrites. Can we not do better than this?

I am particularly concerned about the plight of Ruslan Sharipov, the gay journalist and human rights advocate who has been imprisoned in Uzbekistan on trumped-up charges. I ask you to call upon the Uzbek government to free Sharipov and other political prisoners.

/George V. Reilly

Seattle, WA

May it do some good.

Update: Ruslan was released and granted asylum in the U.S..

posted on Tuesday, December 02, 2003 10:23:32 AM (Pacific Standard Time, UTC-08:00) 
#    Comments [0]