XHTML is dead, Long Live XHTML

The most important line from the [XHTML FAQ](http://www.w3.org/2009/06/xhtml-faq.html) published this week:

> Regarding the XML serialization of HTML, the HTML 5 specification includes a section on XML serialization,
> as well as a section on text/html serialization. W3C plans to continue work on both serializations in the
> HTML Working Group. Thus, we expect the next generation XML serialization of HTML to be defined in the HTML 5 specification.

Just like Spock said: “The needs of the many outweigh the needs of the few…” I think that’s the best ending for XHTML, and it will continue to survive as a serialization form of HTML.

续传下载 ADC Downloads

[Apple Developer Connection](http://connect.apple.com) 提供的下载,包括 [Mac Dev Center](http://developer.apple.com/mac) 和 [iPhone Dev Center](http://developer.apple.com/iphone) 的测试产品,都是需要经过浏览器认证的,这带来的一个问题是:要下载的东西往往是比较大的光盘镜像 (像 iPhone SDK, Mac OS X 的 developer seed, 从 1.x GB 到 6.x GB 不等),在网络状况不够好的情况下,总是会在传到一半的时候就失败了,这之后重新登录又要重新验证,而浏览器自身的下载功能一般很弱,总是无法成功续传,这就导致下载 ADC 上的产品无比痛苦。

前两天看了看浏览器的 Cookie 记录,发现主要是登录后有个 `ADCDownloadAuth` 字段起作用 (这是一个 quoted base64 编码后的二进制数据),只需要从浏览器 (建议用 Firefox, 因为 Safari 不允许直接复制) 中把这个字段的值复制出来,然后通过命令行也能很方便的下载和续传了,比如:

wget -c –no-cookies –header “Cookie: ADCDownloadAuth=GAgC9….” \
http://adcdownload.apple.com/…

或者用 Mac OS X 自带的 curl,原理也是一样的。

dump 混合光盘镜像中的 ISO 9660 分区

Leopard / Snow Leopard 光盘镜像是混合 (hybrid) 分区格式,也就是一个磁盘镜像中,既有 HFS+ 分区,也有 ISO 9660 分区 (Boot Camp 驱动就存放在这个分区上),在 Mac OS X 上只会挂载前者,在 Windows 下只会挂载后者。虽然可以在 Terminal 下手工挂载后者,但也不是很方便,这里记录一个脚本,方便直接把 ISO 9660 分区 dump 为 ISO 文件:

$ cat dump.sh
#!/usr/bin/env bash
DISK=`hdiutil attach -noverify $1 | awk ‘/Apple_partition_scheme/ { print $1 }’`
dd if=$DISK of=$2 bs=512 count=`hdiutil pmap $DISK | awk ‘/WINDOWSSUPPORT/ { print $6 }’`
hdiutil detach $DISK

使用方法:

$ ./dump.sh snowleopard_10a354_userdvd.dmg bc.iso

目前的照片 geotagging workflow

1. 打开 GPS Logger (我用的是 HOLUX M-241)
2. 等有信号之后,开始记录和拍照
3. 回来用 [HoudahGPS](http://www.houdah.com/houdahGPS), 通过蓝牙把轨迹数据导入为 gpx 格式文件
4. 用 Lightroom 把照片导入
5. 用 [GPSPhotoLinker](http://www.earlyinnovations.com/gpsphotolinker/) 载入轨迹 gpx 文件和导入的照片,批量写入地理信息
6. 在 Lightroom 中选 Metadata -> Read Metadata from Files 批量重新读取写入的地理信息

有没有更简化的方法?

Why I’m such a fan of Robert Heinlein

A human being should be able to change a diaper, plan an invasion,
butcher a hog, conn a ship, design a building, write a sonnet, balance
accounts, build a wall, set a bone, comfort the dying, take orders,
give orders, cooperate, act alone, solve equations, analyze a new
problem, pitch manure, program a computer, cook a tasty meal, fight
efficiently, die gallantly. Specialization is for insects.

— Robert A. Heinlein, Time Enough for Love