Tuesday, December 6, 2016

Abortion: An Allegory

Angelina Rosario went into Our Lady of Mercy Hospital in Santa Cristina, California, last week for a minor procedure to help with her dysmennorhea and walked out pregnant. The hospital is still trying to figure out exactly what happened. There was also another woman, Rosaria Angelino, there that day. Ms Angelino had been undergoing fertility treatment and was scheduled to have several embryos implanted in her uterus. Somehow, their charts got mixed up as they were taken into adjoining operating rooms. (There was a small earthquake about that time, and there is some evidence that the charts were knocked off the women’s gurneys.) The error was not discovered until the two women woke up in recovery. Ms Angelino was surprised to find that she had gotten an ablasion, but not nearly as shocked as Ms Rosario was to discover that she was pregnant.

Thursday, December 1, 2016

"Why Are There Lesbians?" Asks Circuit Court Judge Richard Posner

Absolutely fantastic, and really quite funny, article over at Outward about arguments yesterday at the 7th Circuit Court of Appeals concerning what may turn out to be a landmark LGBTQ discrimination case.

Wednesday, November 9, 2016

Working Class Voters and the 2016 Election

The day after....

Today in my introductory logic class, we were supposed to start talking about formal deduction: one of the most important, and confusing, topics in the course. When 10am rolled around, there were a lot of missing people. And those who were there mostly looked half-asleep, and many of them looked as if they were about to cry, or scream, or something else. I canceled the class, and several students thanked me.

Thursday, October 20, 2016

How To Be a Man in the Age of Trump

A man behaving as Trump does would be a pariah in any culture that did not actively and persistently enable men like him.
It sounds like an interesting article, but it turns out to be much more interesting than you might expect. It's written by a transman, who has a special perspective on what it is to be a man.

Sunday, September 11, 2016

New Paper: Comments on Imogen Dickie's "Fixing Reference"

The main focus of my comments is the role played in Dickie's view by the idea that "the mind has a need to represent things outside itself". But there are also some remarks about her (very interesting) suggestion that descriptive names can sometimes fail to refer to the object that satisfies the associated description.

You can find the paper here.

Friday, August 5, 2016

Make New Files in Some Directory Be Accessible to a Group

My wife Nancy has finally let me move her over to Linux, so now we can easily share access a lot of files on our server, such as photos. But I want her not just to be able to read those files, but also to be able to write them. But, on the other hand, I don't want to make them world-writable. I just want them to be Nancy-writable.

Obviously, the solution is to create a group rghnlw of which we are both members, make that group own the files, and make them group-writable. That's easy enough for existing files. But what about new files? I'd like those also to be owned by the group and to be group-writable.

Making the new files be owned by the group is easy: All we need to do here is make the directory in which these files live setgid, and to make the group in question own that directory (and also any subdirectories). So let's say I've put our common files into /home/common/. Then the first step is:
# chgrp -R rghnlw
# chmod -R g+s /home/common

Now any new files created in /home/common/ will have group rghnlw.

Unfortunately, however, those files will not be group-writable---not if my umask, and Nancy's, are the typical 022. Changing that would be an option, but it would make all files that either of us create group-writable, which is not what I want.

The solution is to use access control lists. There are good discussions of how to use these for this purpose here and here, but I'll summarize as well.

First, we need to enable access control lists for whatever filesystem we are using. In this case, /home/ is mounted on its own partition, the line in /etc/fstab looking like:
/dev/hda3      /home      ext3    defaults        1 2

We need to change this to:

/dev/hda3       /home      ext3    defaults,acl        1 2
And then to activate the new setting, we need to remount:
# mount -o remount /home
# tune2fs -l /dev/hda3
The latter should now show acl as active.
Second, we need to establish the access controls.
# setfacl -d -m group:rghnlw:rw /home/common/
# setfacl -m
group:rghnlw:rw /home/common/
The former makes rghnlw the default group, with read and write permissions; the latter applies this to existing files.

Converting "Stitched" Pages from PDFs

More and more great books (including philosophy) are going out of copyright and so are appearing on public archives, like Project Gutenberg and archive.org. Unfortunately, though, many of these PDFs are constructed in a somewhat odd way, with each page consisting of several separate images that get "stitched" together. So if you try to extract the pages to run them through OCR, say, it ends up looking like you ran the pages through a shredder.

Fortunately, as I noted in an earlier post, we can use ImageMagick to fix this up. I'm having to do this often enough now that I've written a small script to automate the process. Here it is:
#!/usr/bin/perl
my @splits = @ARGV;
my $start = shift @splits;
my $stop = shift @splits;
sub normalize {
        my $in = shift;
        if ($in < 100) { $in = "0$in"; }
        if ($in < 10) { $in = "0$in"; }
        return $in;
}
my $newpage = 1;
while (1) {
        my @files;
        for (my $i = $start; $i < $stop; $i++) {
                push @files, "*" . normalize($i) . ".pbm";
        }
        my $cmd = "convert " . join(" ", @files) . " -append outpage" . normalize($newpage) . ".tiff";
        print "$cmd\n\n";
        system($cmd);
        my $lasttime = scalar @splits;
        last if $lasttime == 0;
        $start = $stop;
        $stop = shift @splits;
        $newpage++;
}

The script can also be downloaded here.

There are two ways to invoke the program.

stitch_pages -n INIT STEP PAGES

In this case, INIT gives the number of the first image (this will usually be 0 or 1); STEP tells how many images are used to construct each page; and PAGES tells how many pages we are constructing.

Obviously, this assumes that there are the same number of partial images for each page. If that is not true, you can use the other form and specify the "splits" manually.

stitch_pages -s SPLIT1 SPLIT2 ... SPLITn

In this case, we will stitch together the partial images SPLIT1 - (SPLIT2 - 1), etc. The last split given should thus be one greater than the last image available.