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]