2006/11/26

Changing Mac OS X File Icons

I thought that, if you wanted to set the icon for a non-application file in OS X, you had to go through a convoluted process that involved copying the icon from another document. But it turns out you can just compose your icon with your favorite graphics tools, then copy and paste it into place.

For example, I wanted to change the icon on a QuickTime movie file. Here's what I had to do:


  1. Draw the icon graphics in OmniGraffle.

  2. Select the icon graphics.

  3. Edit->Copy (Command-C).

  4. Switch to the Finder.

  5. Select the QuickTime movie file.

  6. File->Get Info (Command-I).

  7. Select the document icon in the top left of the info window.


  8. Paste in the new imagery (Command-V).



Sweet!

2006/11/21

Lonely Planet finally discovers Kazakhstan

When we were preparing for Bobi's first adoption trip to Karaganda, we were surprised at the dearth of travel information for Kazakhstan. Even Lonely Planet seemed to know nothing of the world's ninth largest country.

Thanks in part to Sacha Cohen they're finally catching up.
Lonely Planet | On the Road.

2006/11/12

Midterms

Many of my friends are downright gleeful about the outcome of the mid-term elections. Some are registered Democrats who vote a straight party line (how can thinking people do that?), so of course they're happy. But even those of independent persuasion act as if they've steered our country onto a new course. I'm betting we've just jumped out of a Ford and into a Chevy, and have resumed driving down the same road.

Lemme try to persuade myself otherwise.

Good leaders can emerge from the two-party system. Harry Truman was a devoted Democrat who came to national politics by way of the Missouri political machine. Ironically, he was a student of world history who revered democracy. By most accounts he did good things for our country and for the world.

The two parties can effect change. In 1994 the Republicans took control of the House of Representatives. They had made a list of specific things they'd accomplish in the bargain. They delivered on one promise which most people could agree was good: they balanced the Federal budget.

(Granted, the budget didn't stay in balance long enough to make a dent in the national debt, and we're still going to be in a world of hurt when the baby boomers retire. But as a frustrated member of the Concord Coalition I was encouraged.)

It is still possible to choose representatives, not brands. From Doc Searls:

"Some of the best evidence of voter independence comes from the Lieberman election in Connecticut. Forget how you feel about the candidate. Look at what the voters did. They elected an independent candidate who had lost the primary of the party that 'won' the national race for seats in Congress. Something independent was happening there. It was bigger, and deeper, than partisanship. As Dave puts it, we've never had so much power."

Hm. Feeling a little better... Still, I'm going to set my expectations low. If this congress can weaken the Military Commissions Act of 2006 I'll call the midterms a success.

2006/11/10

Welcome to Mountain Standard Time

For her first 11 days in New Mexico little Aigerim had a really hard time getting to sleep. If somebody was awake and in the room with her she would squirm and play through the middle of the night, just as if it were mid-day. (Which, of course, it was, in Kazakhstan.) And if she were put in her crib? She would howl like a wounded beast. Didn't matter whether the lights were on or not. Of course she'd sleep soundly during the day.

This week we tried something different. I'd come over every morning at 8 to bring hot coffee to Mom and warm formula to Aigerim. Bobi would sneak in a quick shower while Aigerim topped off her belly. Throughout the day Bobi's mantra was, "Keep the baby awake," (except for one short nap).

It worked. Aigerim has slept through the night for four nights in a row. And she has been getting sleepy earlier and earlier. Last night she was lights-out by 8:30, which puts her almost on her Malutka schedule.

It helps enormously that she's bonding so well with Bobi. Before, unless she was totally exhausted, she would start crying the instant she touched the crib. Now she knows everything is okay. Mom is there for her, to sing lullabies and rock her to sleep, and again to greet her with hugs and kisses (and a bottle) in the morning.

The baby loves hanging out with us in the living room in the evenings, playing and grunting and making little babbling sounds. She gets so happy at our noises that she has to stand up, big tongue-lolling smile, and bounce vigorously for a few seconds. We know she's getting sleepy when her head suddenly plops down on the back of the couch, or on Mom or me. A few rounds of bouncing and plopping and she's ready to snooze.

It's pretty wonderful to see her happy again, just like the baby we met in Kazakhstan.

2006/11/09

Kazakhstan: Rules of the Road

Bobi and I live in Santa Fe, where many drivers seem to be either oblivious to their surroundings or just plain incompetent. But after a few weeks in Karaganda we realized how dull Santa Fe's driving is. Here are some rules of the road for Kazakhstan, as deduced from the back seat of an Audi.

Rules

Seat belts look stupid. Do not wear them.[1]

Horns are communications devices, not just blame throwers. A short "toot toot" means "I'm behind you / just to the left of you," or (when addressing a pedestrian) "I've just arrived to drive you somewhere". A short but full honk means "I don't care if there's oncoming traffic. Turn already." A long blast means "Thank you for stalling your vehicle on the road. Even though you cannot move, get out of my way!"

All vehicles have the right of way over pedestrians. Always.

A pedestrian within a cross-walk, if she or he will impede your motion, is a fair target for honking. If you can possibly squeeze through in front of the pedestrian, e.g. while turning right through a cross-walk, do so. Use short horn toots to further intimidate the pedestrian.

Almaty Amendment: If a pedestrian is within a cross-walk which has no dedicated traffic light, stomp on the accelerator and see if you can tap his or her kneecaps with your bumper.

If a pedestrian is walking away from you in an apartment courtyard, and if she or he veers within five feet of your intended lane of travel, honk at him or her.

Painted lane markers are for making the road pretty. Put the car any place that will give you the biggest advantage. If another driver might interfere with your plans, honk at him or her.

If you are at a red light but can see that the light may turn green within the next minute, start creeping into the intersection. If the light will turn green within the next 15 seconds, get a move on.[2]

Other Observations

Some cross-walks are displaced about 30 feet from the nearest intersection, and are equipped with their own traffic lights. This can be a blessing for pedestrians, as it means they need to expect danger from only two main directions.

There are lots of collisions on multi-lane freeways. We saw five or six accidents on the stretch of Gogol which runs past the Afghan war memorial. I'm not sure if they all involved left turns or not.

The preceding may imply that Karaganda roads are full of reckless drivers. But the situation is more complex. For example our driver, Vladimir, obeyed most of the rules noted above. But he also shifted gears much more smoothly than I ever will. And no matter how abrupt his initial braking needed to be in order to avoid a collision, he always modulated the brake pressure so that we came to a stop with no forward/backward bobbing of the head. In short, he was aggressive and good.



[1] Actually, I admire this "rule". Despite my exaggeration, seat belts are a personal choice in Kazakhstan.

I remember when seat belt laws were passed in Ohio, by then-governor Richard Celeste (D). He spoke at my university shortly afterwards and took questions from the audience. When asked why he had chipped away yet another personal freedom, the Governor explained that he had passed the weakest law possible. ("You can't be pulled over for not wearing a seatbelt, but you can be cited for not wearing one if you are pulled over for another reason.") And he explained that, if he had not passed some form of seat belt law, the Reagan administration would have denied highway funds to the state of Ohio.

[2] This is almost the exact opposite of the rule in Santa Fe. There, if the light has turned red any time within the past 15 seconds you should just keep going, la lala lala.

2006/11/08

Firefox 2.0 and display:inline-block

If you want to use <span> markup to define CSS-styled buttons with background gradients, and if you want to control the heights of those buttons, and if you are using Firefox 2.0, you have to jump through some non-standard hoops.

Firefox 2.0 doesn't support display:inline-block. If you have the Web Developer extension installed, it will report "Error in parsing value for property 'display'. Declaration dropped." And instead of getting a button with the right height for your background image, you'll get something silly looking, like this:



(I know, the colors look silly too. But that's not important right now.)

Yahoo! search turned up some background information, and a workaround for those who want to make links (<a href="...">) look like buttons:

NCZOnline - Pain with inline-block

Basically, you need to do this in your CSS:


.BtnClass {
display: inline-block; /* Firefox 2.0 ignores this */
display: -moz-inline-stack; /* Firefox picks this up */
}

The comments say that this bug has been logged in Bugzilla, and there's hope it will be fixed in Firefox 3.0.

Works for me with Firefox 2.0 and Safari 2.0.4, both on Mac OS X 10.4.8. Almost:



I'd like the span's text to be centered vertically on a background image.

Here's the cleanest solution so far. Suppose the background image is 24 pixels high and the font size is 14 pixels. Then, doing the vertical centering manually, the y offset is (24 - 14)/2 = 5px. So pad the top of the span by 5 pixels, and set its height to the total height minus the padding.

.BtnClass {
...
background-image: url(some_image.png); /* 24 pixels high */
font-size: 14px;
height: 19px;
padding-top: 5px;
}

In other words, add vertical padding to push the text down from the top of the span, then subtract that padding from the overall span height; apparently the final height of the span is height + padding-top + padding-bottom.

This works reasonably well for both Firefox and Safari.

2006/11/05

Fevers Help the Immune System

(Pardon the "duh" headline.)

Helpful fevers come in from the cold - health - 05 November 2006 - New Scientist

I found this article interesting mainly because I like to let my fevers run -- "bake out the infection". Works for me, but then I've never had a really high, convulsion-inducing fever.

Anyway, interesting tidbits from the article:

It has been found that fevers help the body’s immune system identify an infection and raise an army of white blood cells (lymphocytes) against it.

...[Researchers] artificially created a fever-like state in a group of mice... This had the effect of doubling the number of lymphocytes visiting lymph nodes...

Lymphocytes arriving at the nodes are screened for "killer efficiency" using fragments of potentially infectious material. Lymphocytes that respond to the fragments are found, are then selectively multiplied, and then swarm into the bloodstream to seek out and destroy the invader.


Apparently the extra heat of a fever activates high endothelial venule cells ("gatekeeper" cells, as the article calls them) in lymph nodes. They produce extra surface proteins that capture passing lymphocytes and draw them into the lymph nodes.

Evans says that although it fell out of fashion with the development of modern medicine, the idea of treating disease with heat has a long history: "Hippocrates used to heat patients with cancer," she says. And a century ago the physician William Coley discovered a cocktail of bacteria, dubbed "Coley's toxins", which appeared to combat cancer by producing a fever.

2006/11/04

Six Things Americans Should Know About Kazakhstan

From The Roberts Report on Central Asia and Kazakhstan comes a mini-lesson for geography class:


  1. Kazakhstan is a major oil producer and is assisted by U.S.-based companies in producing 1.5 million barrels of oil a day, with ambitions to raise this production to as much as 3.5 million barrels a day by 2015

  2. In its fifteen years of independence, Kazakhstan has not held one election that European observers could reasonably call “free and fair”

  3. Since 2000, Kazakhstan’s economy has grown at an average of 9% a year, and the U.S. trade volume with the country has doubled since 2004

  4. Kazakhstan continues to arrest opposition figures for political reasons, and two of its most vocal opposition politicians were found dead within the last twelve months under suspect circumstances

  5. Kazakhstan has a majority Muslim population with pro-western orientation, and its well-financed and sophisticated banking sector has the potential to be a critical foreign investor in such fragile states as Afghanistan, Kyrgyzstan, and Georgia

  6. The Kazakhstan government regularly violates the rights to free speech and assembly by strictly controlling its media sector and by continually harassing and curtailing the activities of opposition political parties.

2006/10/30

Why quarantine is preferred?

New strain of H5N1 bird flu emerges in China


...those vaccine-induced antibodies do not recognise the Fujian virus, although they do attack the virus strains that Fujian has now replaced.
This means the Fujian strain has a selective advantage in vaccinated birds. "This novel variant may have become dominant because it was not as easily affected as other strains by the current avian vaccine," says Guan. That may also be why H5N1 infection in Chinese poultry has surged, rather than decreased, despite increased poultry vaccination.

Worryingly, the antibodies being used to develop human vaccines for H5N1 ... do not recognise the Fujian strain. This means the current experimental pandemic vaccine would not work against any pandemic virus that emerged equipped with Fujian surface proteins.


In the face of mutating pathogens it's easy to see why monitoring and quarantine are favored weapons against epidemics.

Firefox Vs. Acrobat

Firefox Vs. Acrobat - macosx.com

I just switched to Firefox 2.0 as my default browser under Mac OS X. When a friend emailed a link to a PDF document, I clicked it as usual.

Out of the box Firefox, unlike Safari, cannot view PDFs inline. That's okay, I really just want it to open it in Preview.

Alas, that's not an option. Firefox gives me the choice of saving to disk or of opening with Adobe Acrobat.

Gah.

I searched through the files in my Firefox profile directory. There were no direct references to Acrobat.

According to macosx.com the fault lies outside of Firefox. The thread suggests using Finder Info to make Preview.app the default viewer for all PDF documents. The suggestion did not work for one of the thread participants, and it doesn't work for me, either. Preview.app is already set as my default for all PDF documents.

A find|grep through ~/Library/Preferences turned up one promising hit:
./com.apple.internetconfig.plist

Unfortunately that's a binary property list file and even property list editor can't display its content in a human-intelligible way.

Solution

I closed Firefox, moved ~/Library/Preferences/com.apple.internetconfig.plist out of the way, and followed my friend's link again. This time Firefox let me choose between saving to disk and opening with Preview.app.

Interestingly, Firefox did not create a new copy of the plist file for me.

Better Solution

A less radical solution also works: when Firefox asks how you want to handle the PDF, tell it to save to disk. Also select the checkbox labeled "Do this automatically for files of this type from now on."



After downloading, open Firefox Preferences, switch to the Content pane, and click the "Manage..." button at bottom right.



The list should now contain an entry for PDF. Select it, edit, and change to open with a different application than the default.

2006/10/27

2006/10/24

A Bit of Fry and Laurie

It's fun to track permutations of British actors through stage and screen. The casts of the "Harry Potter" series, "Gosford Park", "Love, Actually", "Tristram Shandy", and so on, are all interwoven. And now another pair for the mix: Stephen Fry and Hugh Laurie.

A few months ago Bobi and I watched "Tristram Shandy: A Cock and Bull Story". It was funny, non-linear, convoluted, recursive in a way that not many movies are. Shades of Douglas Adams.

Stephen Fry appeared in the film in a small role, that of Parson Yorick. He had a much more prominent role in the Special Features section of the DVD, wherein he visited the house in which Laurence Sterne wrote the book on which the movie was based, and discussed the author's life and bizarre afterlife with (I think) the caretaker of the house.

Wikipedia summarizes Sterne's unquiet quietus:

...Sterne's body was stolen shortly after it was interred and sold to the anatomists. [I thought they said "resurrectionists" in the DVD, but never mind.] It was recognised by somebody who knew him and discreetly reinterred. When the churchyard of St. George's was redeveloped in the 1960s, his skull was disinterred (in a manner befitting somebody who chose for himself the nickname of "Yorick"), partly identified by the fact that it was the only skull of the five in Sterne's grave that bore evidence of having been anatomised, and transferred to Coxwold Churchyard in 1969. The story of the reinterment of Sterne's skull in Coxwold is alluded to in Malcolm Bradbury's novel To The Hermitage.

Fry played Parson Yorick in the film. Sterne used the nickname "Yorick". Fry and host discuss this during the tour, linking the nickname to Sterne's humorous taunting of death, which swirled around him as he wrote the book. They note the irony that, in 1969, only the skull and femurs were retrieved: these constituents of the Jolly Roger were believed by some (the Knights Templar?) to be the minimum set of earthly remains necessary for resurrection.

But that's not what this post is about.

Stephen Fry looked familiar. IMDB showed that he'd done the Black Adder series, so maybe that's where I'd seen him before. He was also credited as the narrator of the British audiotape recordings of the Harry Potter series. So Fry extends the permutations of British actors beyond stage and screen to audio books.

I checked Netflix to see if he'd made any other movies that I recognized. No joy. But Netflix did carry a television sketch-comedy series, "A Bit of Fry and Laurie", from the late 1980s, featuring Stephen Fry and Hugh Laurie.

I've just rented it. It wasn't great. Most of the sketches consisted of two Britishmen standing or sitting, having long-winded conversations. They were almost, but not quite, as dull as this post.

Some bits did make me laugh out loud. For example Hugh Laurie's piano ballad, "Mystery," proved that a seated, long-winded monologue can be hilarious when accompanied by music.

My favorite sketch was introduced by Stephen Fry, playing the host for a public access education series. What would you call it, "University TV" or something like that. But, rather than introducing a segment on Elementary Bookkeeping, Mr. Fry pleasantly announced that he was presenting bloopers culled from the education series archives.

Yep, a blooper reel from public access television. From the early 1970s. Flash to Hugh Laurie in polyester and shaggy hair, screwing up a chalkboard presentation on the path traced by a point on a rolling wheel.

But that's not what this post is about.

Hugh Laurie looked familiar. IMDB showed that he'd done the Black Adder series...

Finally I recognized him from "House", a television drama. Laurie plays the gruff lead character, who speaks in a low, gravelly, American-accented voice. Not at all funny. Not at all British. Now that's a bit different.

What the hell is this post about?

2006/10/22

Democracy Inaction, continued

Via Dave Winer: Olbermann on The beginning of the end of America.

Does this sound overblown? Maybe it is. But it bugs me.

The USA I love would treat all of its prisoners according to the Geneva Conventions. It would not pass acts which make it possible to abuse its own citizens.

Abraham Lincoln suspended the writ of habeas corpus during the Civil War. To some, that's a good precedent for suspending it now. But the U.S. Constitution says it can be suspended only in special circumstances.

"The Privilege of the Writ of Habeas Corpus shall not be suspended, unless when in Cases of Rebellion or Invasion the public Safety may require it."

-- Article One, section nine, U.S. Constitution


These circumstances held when Lincoln made his suspension. It's not at all clear that they hold now.

The current suspension is supposed to apply to non-citizens. But as Olbermann notes, that does not prevent its suspension for citizens, "by mistake."

"Oops, sorry! Your unfavorable article made us think you were an enemy combatant. We arrested you and beat you up by mistake. Please don't make a fuss about it; we wouldn't want to make the same mistake again."

[2006/10/24: Okay, that's specious. Trying to obscure abuse of power through intimidation is pretty common, not some unique consequence of the Military Commissions Act of 2006.]

"You Have the Body"

"The writ of habeas corpus is the fundamental instrument for safeguarding individual freedom against arbitrary and lawless state action."

-- Harris v. Nelson, 394 U.S. 286, 290-91 (1969)




Habeas corpus makes it difficult to arrest people without cause. Here is one possible consequence of its suspension:

...'What was he arrested for?'... Most people, crazed by fear, asked this question just to give themselves a little hope; if others were arrested for some reason, then they wouldn't be arrested, because they hadn't done anything wrong...

This was why we had outlawed the question 'What was he arrested for?'

'What for?' Akhmatova would cry indignantly... 'What do you mean what for? It's time you understood that people are arrested for nothing!'

-- "Hope Against Hope" via "Gulag: A History"



That Could Never Happen Here

I don't believe our government could abuse this power for very long. It's hard to imagine that they could pull it off on a large scale. People would notice. Congress would investigate. Abusers would be punished.

But why give them the chance? They just might exceed our imaginations.

The U.S. has held citizens, without charge, for years at a time. It has prevented them from meeting with their lawyers. It has prevented them from hearing the evidence against them.

It has done these things only rarely. I would prefer that it never be allowed to do them at all.



Footnote

The story of Kurt Gödel's interview for U.S. citizenship used to be funnier.

...the judge continued, "Anyhow, it was under an evil dictatorship ... but fortunately, that's not possible in America." With the magic word dictatorship out of the bag, Gödel was not to be denied, crying out, "On the contrary, I know how that can happen. And I can prove it!"

2006/10/18

Google Earth tour of Karaganda

We've posted lots of blog entries and photos of places we visited on our trip to Karaganda. Wouldn't it be cool if you could take a virtual tour of the town and see where the pictures were taken?

Okay, probably not, unless you're a geek like Bobi and me. In which case you probably have Google Earth installed on your computer. In which case, here's a KMZ file to guide you around the town. Have fun!

Kazakhstan Trip.kmz (2006/10/18)

[2007/12/17 The file has moved -- Mitch]

Democracy Inaction

How do we curb the executive branch of our federal government? Or, at least, the Secret Service?

Seriously, how?

I just returned from Karaganda, Kazakhstan, once part of the gulag archipelago. Maybe that's why the Military Commissions Act of 2006 is unsettling. Ostensibly it applies to unlawful combatants, who (I think) have not been accorded protection by the Geneva Convention. However (I think) the act as approved could also be applied to any U.S. citizen.

It seems implausible that this sort of thing could lie in our future. But it's up to us to jealously guard against it.

There is hope that the Military Commissions Act will be challenged in the courts. I believe it should be challenged, if only to clarify the conditions under which it could be used to detain (and torture -- er, interrogate harshly) U.S. citizens.


Legal groups, such as the Center for Constitutional Rights, are already preparing to challenge the constitutionality of the law in court, as Democracy Now! noted in an interview with the Center’s president, Michael Ratner, and with Senator Patrick Leahy, who was very critical of the bill’s implication.

I wonder how my congressmen voted... GovTrack knows.
Here's the record for the House of Representatives, and for the Senate.

Representative Udall: nay
Senator Domenici: aye
Senator Bingaman: nay

Arlen Specter explained why he ultimately voted in favor.

Judiciary Committee Chairman Arlen Specter (R-Pa.) voted for the bill after telling reporters earlier that he would oppose it because it is "patently unconstitutional on its face." He cited its denial of the habeas corpus right to military detainees. In an interview last night, Specter said he decided to back the bill because it has several good items, "and the court will clean it up" by striking the habeas corpus provisions.

I hope he's right.

2006/10/13

Music and Movies from Kazakhstan

When Vladimir drove us around Karaganda he always had the radio on, tuned to the news or to Russkom Radio. Since returning to the states I've been trying to track down some of what we heard.

YouTube has been pretty helpful. I haven't actually found many of the songs I've sought, except for chart-topping crap like Romantika. (Funny: when this played in the car I thought it was an advertisement.) But YouTube has uncovered some interesting Kazakh music videos.

Some of the videos celebrate the country and its past. A few of these are quite moving, especially for someone whose girlfriend is adopting a Kazakh girl.

Musicola
The search has also turned up a Kazakh group named Musicola. Hidden among the dance music on their site is a song called Arman Zholdar (road of dreams?) which is full of unusual textures. In it Karina Abdulina, the singer of the group, uses her voice more as a musical instrument than as a carrier of lyrics.

The Nomad
Thanks to YouTube and IMDB I even found out about a movie which was playing in Karaganda while we were there, a romanticized tale of how the country came to be: The Nomad. It was produced by the Weinstein brothers and stars Jason Scott Lee. Small world...

2006/10/11

Saiga antelope

Saiga antelope - Saiga tatarica - ARKive

When we were in Karaganda Bobi and I visited the regional museum. Inside we found several interesting exhibits, on subjects ranging from the Karaganda Gulag[1] to the Golden Warrior [2] to -- well, we couldn't figure out what this thing was.



It looked kind of like a cross between a reindeer and a moose -- or maybe a reindeer and Zoidberg.

After a couple of days of sporadic googling we learned it was a steppe antelope.

[1] The web has some indirect references, e.g. Welcome to Ukraine:

Karaganda is the centre of Kazakhstan’s coal production, but in the soviet times it was the hub of Gulag concentration camps.


[2] See also Talgar Mountain Peak:
In 1969 - 1970 while the archaeological excavations in [Issyk] hill a grave of the so-called "Golden man" was found. It was a mummy of the young warrior. All his clothes was decorated with gold. Nowadays the image of the "Golden man" is one of the symbols of Kazakhstan.

Industrial Design

The Department of Style - TiVo Series3

Bobi has a Samsung VCR/DVD player, now several years old. She likes to watch TV with the lights off. So we sometimes have trouble changing channels, on account of we're holding the remote backwards. Which is why the above blog entry caught my eye.

I like the new remote. It has more texture on it, so it is easier to find the buttons without looking[...] There is asymmetry in the textures, which solves the problem with the old remote where you can pick the thing up backwards and rewind instead of commercial skip.

Thoughtful design is so impressive.

2006/10/08

OmniGraffle 4 and Subversion

Subversion doesn't like OmniGraffle documents: "invalid control character ... in path".

Fortunately many others have already encountered this problem and published a workaround. Here's a nice summary.

I use OmniGraffle, not OmniGraffle Pro. The workaround looks good from here.

Writing takes energy

So many notes on paper from the Kazakhstan trip... and no energy to transcribe them. It's a good thing nobody reads this stuff, else I might feel guilty.