Archives January 2012

Floristgate: How Petty Can You Get?

Cranston High School prayer mural
Quick recap for those who don’t visit the atheosphere much, or who have been living under a rock: Cranston High School West in Cranston, Rhode Island used to have a mural with a “School Prayer”. Jessica Ahlquist, a student at the school, tried to have it removed on the grounds of it being blatantly unconstitutional, and eventually had to sue. And she won.

Naturally, the good Christians of Rhode Island realized that religion is a private matter that shouldn’t be pushed in public schools, and accepted the ruling graciously. Ha ha! Just kidding! Actually, they inundated her with insults and threats of bodily violence.

To date, I’ve only seen two responses from Christians condemning their coreligionists’ behavior:


(Sorry, the Washington Post’s comment system doesn’t allow linking to individual comments.)

If there are more, I’d like to hear about them. But so far, the moderate Christian community is endorsing these bullies by its silence.


And then it gets pettier: Annie Laurie Gaylor of the Freedom From Religion Foundation wanted to send Ahlquist a dozen roses to thank her for her courage. She with her local florist, who then forwarded the order to a local florist in Rhode Island. Three florists in Cranston, RI, turned the order down. One included a
note saying “I will not deliver to this person”. (They eventually got a shop from Putnam, CT, to deliver the flowers from out of state.)

At first glance, this looks like plain old bigotry, no different from hanging a sign in a store window saying “whites only”. But NBC 10 in Providence reports

Raymond Santilli of Flowers by Santilli in Cranston said someone from the foundation told him the delivery person might need police protection and show identification to gain access to the home.

“We refused the order because we really don’t want to cross lines,” he said.

Santilli said he had personal feelings about the issue and because it’s his shop, he can choose to deliver or not to deliver flowers to whomever he wants.

If I send flowers there, somebody may get upset with us and retaliate against us,” he said.

(emphasis added.)

So either this florist is a bigot or a liar, which doesn’t speak well him and, to the extent that he represents the people of Rhode Island, doesn’t speak well for Rhode Islanders in general; or else he has justified concerns for his safety if he is seen to do business with (hushed tones) atheists, which doesn’t speak well for Rhode Islanders either.

And then there’s the Facebook page I Stand With The Cranston Florists (which I thought was publicly-visible this morning, but now appears to have reverted to the default Facebook visibility setting of “fuck you if you’re not in the Collective”), which appears to be the work of radio personality John DePetro, who has, from what I’ve seen, consistently taken the anti-constitution side of the argument.

But the thing is, this sort of thing isn’t rare. I wish I had a genuine moment of “Whoa! What the hell just happened?” surprise at the Christian reaction. But I didn’t. The most surprising thing here is that this happened in Rhode Island rather than a Bible belt state like Alabama. I wish I could believe the usual excuses that “these are just a few bad apples” or “they’re not True Scotsmen Christians™“. But we’ve seen this happen all too often whenever the majority is reminded that they’ve overstepped their bounds.

Update, Jan. 24: The Rhode Island Council of Churches has announced a press conference to call for tolerance and civility, to support Ahlquist’s right to challenge the banner, and condemn the insults and bullying aimed her way (via Hemant Mehta).

“Motion Capture” for Text-to-Speech?

I had a random thought over the weekend, and while I suspect it’s not original, I couldn’t find anyone working on it.

One big reason why text-to-speech (TTS) synthesis sucks so badly is that the result sounds flat. Yes, the synthesizer can try to infer cadence and tone from things like commas, paragraph breaks, exclamation points, and question marks, but the result still falls far short of what a human reader sounds like. In the end, the problem seems to be Turing-hard, since you need to understand the meaning of a piece of text in order to read it properly.

So would it be possible to record a human reading a piece of text, and extract just the intonation, cadence, and pacing of the text? Hollywood already uses motion capture, in which cameras record the movements of a human being, and makes a CGI creature move the same way (e.g., Gollum in The Lord of the Rings or Shrek). In fact, you can combine multiple people’s movements into one synthesized creature, say by using one person’s stride, another’s hand movements, and a third person’s facial expressions.

So why not apply the same principle to synthesized speech? For instance, you could have someone read a paragraph of text. We already have voice-recognition software, so it should be possible to analyze that recording and match it to individual words and phonemes in the text. That gives you timing, for things like the length of a comma or reading speed. The recording can then be analyzed for things like whether a given word was spoken more loudly, or at a higher pitch, than other surrounding words, and by how much. This can be converted to speech markup.

This means that you could synthesize Stephen Fry reading a book in Patrick Stewart’s voice.

Perhaps more to the point, if you poke around Project Gutenberg, you’ll see that there are two types of audio books: ones generated via TTS, and ones read by people. The recordings of humans are, of course, better, but they require that an actual person sit down and read the whole book from start to finish, which is time-consuming.

If it were possible to apply a human’s reading style to the synthesis of a known piece of text, then it would be possible for multiple people to share the job of recording an audio book. Allow volunteers to read one or two pages at a time, and synthesize a recording of those pages using the volunteer’s intonation and cadence, but using a standard voice.

I imagine that there would still be lots of problems with this — for instance, it might feel somewhat jarring when the book switches from one person’s reading style to another’s — but it should still be an improvement over what we have now. And there are probably lots of other problems that I can’t imagine.

But hey, it would still be an improvements. Is anyone out there working on this?

Stop the Press! I Want to Get Off

The New York Times asks, in all sincerity, whether it should be doing fact-checking.

As an Op-Ed columnist, Mr. Krugman clearly has the freedom to call out what he thinks is a lie. My question for readers is: should news reporters do the same?

If so, then perhaps the next time Mr. Romney says the president has a habit of apologizing for his country, the reporter should insert a paragraph saying, more or less:

“The president has never used the word ‘apologize’ in a speech about U.S. policy or history. Any assertion that he has apologized for U.S. actions rests on a misleading interpretation of the president’s words.”

Is this really what it’s come to? That one of the oldest, most respected newspapers in the country has to ask itself whether it should be calling bullshit when a politician says something that isn’t true.

I thought the job of newspapers was not just to report what’s going on, but also put it in some sort of context so that it makes sense (within the limits of the format, of course). And part of that is mentioning when a source is wrong. Especially when that source pants-on-fire wrong.

But apparently people at the Old Gray Lady think that “he said, she said” is the same thing as balance and objectivity. It’s not enough to know what a person said; we should also know whether the statement is true or not. Or at least whether it’s credible or not.

To quote one of the comments, “the opinions of cranks and shills disagree with those of experts, and should be portrayed that way.”

It’s sad that the Times even feels the need to ask this question.

Disk Hack

One of the things I enjoy about Unix system administration is the McGyver aspect of it: when something goes pear-shaped, and your preferred tools aren’t available because they’re on the disk that just died, or on the other side of the pile of smoking ashes that used to be a router, you have to figure out how to recover with what you’ve got left. It’s a bit like that scene in Apollo 13 when they realize that the space capsule has a round hole for the air filter, but only square filters, and the engineer dumps all the equipment the astronauts have available onto the table, and says “We’ve got to find a way to make this fit into the hole for this, using nothing but that“.

So anyway, my mom’s Mac recently died. And, naturally, there are no available backups. But I said I’d do what I could, and took the machine home.

I’m glad we wrote off the old machine as a total loss, since it was (the tense should give you an idea of what’s coming) an iMac, one of those compact everyting-in-the-monitor models that tries oh-so-hard to fit everything into as small a space as possible. Of course, this compactness means that there’s no room to do anything: the disk is behind the LCD display, and wedged in a tight slot between the graphics card and the DVD drive. And the whole thing is wrapped in — I kid you not — foil, most likely to help control airflow. So basically I wound up ripping things out with little or no grace or elegance. If it wasn’t totaled then, it certainly is now.

At any rate, that left me with a disk that, thankfully, turned out to be unharmed. The next question was how to hook it up. I was pretty sure it had an HFS or HFS+ filesystem, which meant that the obvious thing to do would be to put it in a Mac to read. But I don’t have a Mac that I could put a second internal drive in. I toyed briefly with the idea of finding an enclosure and whatever conversion hardware would be necessary to turn an internal SATA drive into an external USB drive, but figured that was too hard for a one-shot. Then I found that my Linux box has hfs and hfsplus filesystem kernel modules, so hey.

(Of course, I don’t know how stable the Linux HFS driver is, so I figured it’d be best to write-protect the disk. At which point I discovered that this model only has one hardware jumper slot, and it doesn’t write-protect the disk. Fuck you very much, Maxtor/Apple.)

The Linux HFS driver turned out to be good enough for reading, and I could mount the disk and read files, so yay. The next question was how to get the files from there to a laptop that I could bring over to my parents’. Ths is complicated by the fact that on HFS, a file isn’t just a stream of bytes, the way it is in Unix; it has two “forks”: the data fork contains the actual data of the file (e.g., a JPEG image), and the resource fork contains metadata about the file, such as its icon, the application that should open the file by default, and so on. I didn’t want to lose that if I could help it.

The way the Linux HFS driver deals with resource forks is to create virtual or transient or whatever you want to call them files: if you open myfile, you’ll get the data fork, which looks just like any file. But if it has a resource fork, you can also open myfile/rsrc and read the contents of that. This meant that in the worst case, I 1) copy over the data forks to a directory on the Mac, then 2) find which files have resource forks (something like

find /mnt -type f |
sh -c 'while read filename; do
    if [ -s "$filename/rsrc" ]; then
        echo "$filename";
    fi;
done'

and 3) somehow re-graft the resource forks onto the files on the Mac end. But that seemed like a lot of work.

Apple software is often distributed on .dmg (disk image) files, which are mounted as virtual disks. I figured that’d be the obvious way to package up the contents of the disk. So I dded the raw disk device (/dev/sdb rather than /dev/sdb2 which was the mounted partition, in order to get the entire disk, including partition map and such), but when I tried to mount that, it didn’t work, so presumably there’s more to a .dmg file than just the raw disk data. I tried a couple of variations on that theme, but without success.

(In passing, I also noticed that rsync supports “extended attributes” on both my Mac and my Linux box, so I tried using that to copy files (with resource forks) over, only to find that the two implementations use different options to say “turn on extended attributes”, so the client couldn’t start the remote server correctly.)

Eventually, I realized that dd could be used not just to read a disk image, but to write one. Yes, I said above that reading from the disk and writing to a file didn’t produce a usable disk image. But I also said that .dmg files are mounted like disks, and that implies that there has to be a device to mount.

So on the Mac, I created a disk image file with hdiutil create, then opened it with the Disk Utility. Forcing “Verify disk” made the Disk Utility mount the image on /dev/disk2s9, just before telling me that there was no usable filesystem on the disk image. That was fine; all I wanted was for it to create a /dev/disk* device that I could write to. Then I was able to

ssh linuxbox 'dd if=/dev/sdb bs=2M' | dd bs=2048k of=/dev/disk2

to transfer the raw contents of the disk to the “disk data” portion of the disk image.

To my slight surprise, this actually worked. Yes, I had to repair the disk image, but from the log messages, that appears to be because some of the superblock copies were missing (the disk is 120Gb, but I only created a 32Gb image).

The final problem should be that of getting the disk image from my locked-down(-ish) laptop to my mom’s new vanilla Mac, but I don’t think I’ll bother. It’ll be a lot easier, and better in the long run, to put the old disk image onto an external drive that can then double as a backup disk, so I don’t have to do this again.

Because while it can be fun to solve a puzzle and figure out how to fix something with suboptimal tools, there’s also wisdom in avoiding getting into such situations in the first place.