Jan 29

I upgraded to Apple iLife 09. My main motivation was to get the new version of iPhoto, which adds support for face recognition and GPS integration.

When I fired up the new iPhoto, I discovered that the GPS data for my images in JPEG format had been read in correctly; but that all of my Canon raw CR2 files had been ignored, even though the photos of Hamburg mostly had GPS data.

I investigated whether iPhoto was scriptable. If I could add the GPS coordinates to the existing photos via AppleScript, I could take the GPS track logs and build an importer. Unfortunately, though, there’s no AppleScript interface to the GPS metadata, according to iPhoto’s AppleScript dictionary.

Experimenting further, I discovered that if I rooted around inside the iPhoto library (using right click and "Show contents"), copied the CR2 files out, and imported them into iPhoto again, that the GPS data would be processed correctly.

There was a snag, though. If I did that, I would lose all the names and descriptions I had entered in iPhoto. This was a solvable problem, though: iPhoto remembers the original filename, and has AppleScript properties that let you read and write the description/comment and name/title of any image.

The next small snag was that I don’t know AppleScript. I’ve tried to learn it, but I find it very annoying and syntaxy. I considered giving it another go, but I did a few quick Google searches and determined that AppleScript lacks hashes, arrays, and most other useful data structures that you might use to store and retrieve a set of captions for a large number of photographs indexed by filename.

Ruby to the rescue. When Apple created AppleScript, they did it by layering it on top of a lower level system called OSA or Open Scripting Architecture. This is a language-independent API, which means that you can glue any scripting language to it, and instantly be able to do anything in that language that you can do in AppleScript. There are a couple of projects which link OSA to Ruby; I picked RubyOSA , though a brief exploration of rb-appscript (a port of a Python bridge, spit ) suggests that it would have done the job too.

A quick sudo su and gem install ruby-osa , and I was ready to script iPhoto using Ruby. I built two scripts. The first, iphotodump.rb , dumps out all the titles and comments for the selected photos, storing them in data files using Ruby’s standard marshalling (persistence) mechanism. The second script, iphotorestore.rb , reverses the process: it reads in the data files, then scans through the selected images and restores the appropriate metadata by matching up the filenames of the original image files.

I ran iphotodump to dump out all the metadata for my Hamburg photos, deleted them from iPhoto, re-imported the CR2 files, then ran iphotorestore to restore the metadata. Problem solved.

I imagine there are other people out there with similar iPhoto-related metadata problems, so hopefully my scripts can point the way at solutions. With iPhoto glued to Ruby, there are all kinds of possibilities–for example, you have the power to do a full regular expression search and replace, with Perl-like regular expression power. I think I’m also going to write something to append the photo’s keywords to the description, so I can then go on a keyword deleting spree but still be able to find photos using search.

Jan 28

I had a mysterious charge show up on my credit card bill. The only identifying information was CP 1222 00334466.

By using Google and pondering for a while, I came to the conclusion that it was the World Market store on Brodie Lane, whose parent company is Cost Plus. The 1222 00334466 part is some kind of state-mandated identity number.

2009-12-27: ████ ██████ [who is apparently scared of people learning where he gets gas] wrote to me about this post, saying that he discovered it was the Philips gas station on South Lamar; so CP in that case would be Conoco Philips.

Both are Austin businesses I frequent on occasion, so perhaps the next person finding a mysterious charge on their card can provide a casting vote?

In either case, perhaps the business in question could set up their credit card billing to be more informative?

Jan 26

Last week I found myself in Cissi’s Wine Bar on South Congress.

If you know me, you might be thinking that I’m not really the wine bar type. It’s true, and I think it was the first time I’d ever been in one. However, they were having a special event which involved free desserts, and that is my vice. Belgian Ale Doughnuts are awesome, especially when dipped in caramel sauce.

I found myself thinking about the economy. The awkward fact is that while things are bad, and a lot of people are in financial difficulty, we are doing OK. So long as my job remains stable, we don’t really have any immediate problems. Sure, the 401(k) has taken quite a hit, but I’m not near retirement age, so I figure it’ll recover.

Obviously, I want to do my bit to keep everyone else afloat. I feel like I should patronize local businesses more, eat out more, buy stuff. But at the same time, I don’t really need any more stuff right now, I’m trying to keep my weight under control, and my fiscal conservatism makes me want to hoard cash in case the worst happens and I’m unemployed for months.

So I’m trying to find the middle ground. So far, that has meant acting as if the recession isn’t happening. If I can manage it for long enough, perhaps I’ll be ready for a career in politics ?

Jan 19

One of IBM’s better ideas is to encourage employees to take part in an active health management program. I just filled out the annual survey, putting in my most recent set of figures for blood pressure, cholesterol levels and so on.

Here’s the result:

I’m mildly surprised. I always feel like everyone else is exercising more diligently than me, is stronger than me, and so on. I wonder if my "peer group" is everyone my age, or just IBM software engineers?

Anyhow, with my back injury pretty much gone, I’m back on the treadmill–or rather, the elliptical. 30 minutes a day 4-6 times a week. I bribed myself with a doughnut yesterday, but that’s not going to be a regular thing, I just need something to get my enthusiasm started and get the momentum going.

Jan 19

I got bitten by a squirrel.

It wasn’t really her fault. She was hungry and nervous, and went for what looked like a tasty peanut, and discovered it was a finger. She stopped biting as soon as she realized, but because she was in a hurry she bit far enough to break the skin.

That’s the point at which a lot of people would be yelling "Oh my god! Rabies! Help!" However, I did the research before I started feeding squirrels, and basically nobody ever gets rabies from tree squirrels. As one state’s department of health page summarizes :

Tens of thousands of squirrels have been tested for rabies at the Department of Health Branch Laboratories. Only two were reported positive — a squirrel in 1913 and, the most recent, a flying squirrel collected from Pinellas County in 1961.

So I followed CDC recommendations: I washed the wounds thoroughly with soap and water, then I soaked them in a strong saline solution, then I applied iodine, and finally a touch of antibiotic ointment.

In addition, I followed the protocol generally advised for riskier mammals like racoons: I observed the squirrel in question for a period of 10 days. The ten days are up, and I’m glad to say she is still bright-eyed and bushy-tailed when she visits us each morning.

So, I’m reasonably confident I don’t have rabies. Nor have I developed any strange squirrel-like powers; I still need to use a nutcracker to open nuts.

Jan 16

Mike Murray donated $100,000 to the campaign to pass Proposition 8 in California .

How did he make that money? Why, he was Microsoft’s HR Director, in charge of their diversity training program .

Just because you do a job, doesn’t mean you learn anything from the experience, eh?

Jan 16

From the latest medical scare story on MSNBC :

A new study warns about improper use of Vicks VapoRub for children under a certain age.

[...]

Dr. Sherman says a safer alternative for infants is saline. For everyone else, he says, just stick to some chicken soup.

"As far as the common cold goes, there’s really no study showing anything that speeds it along," he said.

So has Dr Sherman totally missed the point about what Vicks VapoRub is supposed to do? Or is he seriously suggesting rubbing chicken soup under your nose?

Vicks VapoRub isn’t supposed to speed along your recovery from the cold. It’s just supposed to help you breathe while you recover. Duh.

Jan 15

As Bush departs the White House, even his own people are now willing to admit that we tortured people in Gitmo .

I was thinking about this the other day. One characteristic of the right wing is their intense loyalty to the cause (at least compared to the left). They’ll generally avoid publically criticizing their own, if it might let the side down. However, with Bush out of the White House, I expect we’ll see the first interesting memoirs pop up in bookstores soon.

Similarly, UK politicians now feel able to admit the obvious.

 


Jan 15

The Wall Street Journal offers an opinion piece from Michael Stokes Paulsen stating that the Minnesota election of Al Franken is unconstitutional, based on Bush vs Gore (2000).

I don’t have any strong opinion on whether Franken or Coleman should be declared winner, not having followed all of the shenanigans. However, there are two things that spring out from the article.

The first is that Paulsen ignores the fact that the Supreme Court said that "Our consideration is limited to the present circumstances…", and was not to be used as prededent. You’d think that a professor of law would know that minor detail of the highest profile legal case of the last 10 years, given that it was mentioned in most of the press coverage.

The second thing that struck me was the following quote:

The problem with the remedy was that it arguably violated the same principle that led the Court to invalidate the recount: the need to treat all votes equally. It had the practical effect of awarding the election to Bush (though subsequent media counts confirmed that Bush won anyway, under any uniform standard). This has led to enduring partisan criticism of the case, some fair and some unfair.

Note the comment I’ve highlighted. Wikipedia has a nice summary of the Florida recounts , and a quick perusal shows that what Paulsen states is the exact opposite of the truth. In the first media consortium recount, under every uniform statewide recount scenario Gore won Florida. The only way to get a Bush win is to have a non-uniform standard by only re-evaluating a limited number of ballots.

The second media review cited by Wikipedia, run by BDO Seidman, held that if you recount the votes by the strictest standard, Gore won. The third media review found that either Bush or Gore won, depending on whether you made an attempt to determine the meaning of apparent overvotes such as those caused by the poor ballot design. (If you did, and used a consistent standard, Gore won.)

So Paulsen’s throwaway comment assuring us that Bush won fair and square is the exact opposite of the truth. If the votes in Florida had all been counted according to a declared uniform standard, Gore would have won. The only reason Bush won is that a statewide uniform recount wasn’t performed. It’s important that we remember that.

(Still, what do you expect from a Murdoch rag?)

Jan 10

This is a copy of my comments to the Federal Trade Commission, who are asking for comments on DRM technologies for a Town Hall Meeting in March.

As you are doubtless aware, the Copyright Act of 1976 codifies the First-Sale Doctrine. This states that a purchaser of a copyright work has the legal right to sell or give away the copy, once it has been obtained–so long as no additional copies have been made.

One major issue I have with DRM technologies is that they deny the customer his legal right to resell the product on the second hand market. Also, in many cases purchased products may evaporate if the DRM provider goes out of business, yet still these products are described as being sold to the customer, with words like "buy", "purchase" and "on sale" being used.

Netflix will let me keep a movie indefinitely, but I can’t sell the disc, and they reserve the right to demand it back. Similarly, iTunes digital movies can be kept indefinitely, but I can’t sell the movie, and Apple can turn off my access to it, analogous to demanding the disc back. Netflix describe their service honestly, as rental. Apple describe their service as purchase, with the button saying "Buy now".

This seems to me to be confusing. Physical video stores like Blockbuster would not be allowed to say "Buy this movie for $3.89!" when the terms were actually rental with no due date for return, so I don’t understand why digital movie rentals are treated differently.

I have a simple proposal. It should be illegal to describe something as being "sold" or "for sale" unless the corresponding right of resale is available to the purchaser. Instead, a phrase such as "indefinite rental" should be used, as that’s what is really being offered.

In other words, when I "buy" a movie from the PS3 online store, I’m not really buying it, because I can’t resell it second hand when I’m done with it. So Sony should not be able to pretend I’m buying it; they should be legally required to describe the offering accurately, as an "indefinite rental".

I think this would go a long way towards making it clear to the average consumer that their DRM-protected purchased content comes with metaphorical strings attached, and that it might go away one day.