For quite some time now, I've been putting all the readings (except books) for my various classes online, on my course websites (such as here or here). In the good cases, this just means downloading stuff from JSTOR or some equivalent, or linking directly to it, though I very often convert the PDFs I get that way to DjVu files, since (a) the DjVu files are often a lot smaller (like one tenth the size), and (b) I prefer to have files where two pages appear on a single page, so that when they are printed you don't waste so much paper.
I've developed a number of tools to make this easier to do. I'll blog about them later. (Some of them are already available here.) What I wanted to mention today is a really, really cool program I found last weekend, called "Scan Tailor". It's "free and open source" (GPLv3) and available for Linux, OSX, and Windoze.
I've found that the easiest way to scan stuff I need from books (e.g., Dummett's "Frege's Myth of the Third Realm", from Frege and Other Philosophers) is first to make a photocopy of the paper and then to scan that. (This is easiest with a sheet-fed scanner, such as the HP Scanjet 5590, which works fine with Linux.) You can simply make a PDF or DjVu from the result, but, if you just do that, it will usually look like crap. For one thing, you get big black marks along the sides and, often, down the middle (where the spine of the book is). And the pages can be hard to read on screen, since they are often not quite square. Even half a degree's rotation is easy to see, and very annoying.
So, in the past, I'd load the pages one by one into Gimp (an open source image editor) and fix them up. But this was time consuming, and hard to get right. That is where Scan Tailor comes to the rescue.
Here's how it works. You put all the page images into some directory, and then you open Scan Tailor and create a new "project", pointing the program at that directory. All the pages then get loaded up. You can then rotate them, if need be. But the really useful bit is that the program will then automatically (i) split the pages in half (which you need to do for the next step), (ii) deskew them (i.e., correct for rotation of the text), (iii) put a bounding box around the actual text (thus eliminating the black marks), (iv) put clean new margins around that text, (v) despeckle the images (remove stray black dots), and then (iv) output the resulting page images to a directory of your choosing, so you can assemble them into a PDF or a DjVu.
And at every one of those steps, you can intervene to make manual corrections, if need be. It totally, totally rocks.
Wednesday, January 30, 2013
The Grand Teaching Experiment
Over the last couple years, I've become very dissatisfied with the way I've always taught my non-logic classes, e.g., classes on philosophy of language. These tend to be fairly small classes, with enrolment in the range of 10-15, and the basic model has been this: I've lectured on Mondays and Wednesdays, and we have had discussion on Fridays, led by me.
But I've read several things recently suggesting that lecturing is not a very effective way to get students to learn things. So this semester, in my course on Theories of Truth (Phil 1890D), I'm trying something different. I propose to blog about it from time to time.
The first thing I'm doing is trying to make use of Brown's new online teaching framework, called "Canvas". It does quite a lot. For example, there is an integrated conferencing system that I may try to use later. And it has simpler stuff, like the ability to schedule assignments, which are then automatically entered into a "grade book". But the main thing I'm using is the discussion board. For each of the readings, I've set up a discussion thread, and I'm requiring everyone in the class to post to it prior to class.
Obviously, this is just taking the place of the "response papers" that lots of people use, anyway, but it has a few advantages.
The second thing I'm doing differently is I'm not lecturing. At all. I told the students this at the first meeting, and when I walked into the first "real" class, I had no lecture notes. I'm trying to run the entire class as discussion.
The days that would previously have been devoted to lecture are now devoted to discussion that is aimed at understanding the readings. The day that was previously devoted to discussion is now devoted to discussion aimed at evaluating and criticising the readings. We've had two of the former so far (on Austin's and Strawson's famous papers on truth), and I'm not sure yet how they are going. My strategy has been to identify topics from the papers that we should talk about. So, in the case of Strawson's paper, for example, these were: His criticisms of Austin's account of (i) statements, (ii) facts, and (iii) correspondence, and (iv) his own positive account of the use of "true". The first class seemed to go pretty well. The second one, a bit less so, and I ended up talking more. But that may simply have been because Strawson's paper is quite hard, and maybe that is a sign that I should do something else.
But I've read several things recently suggesting that lecturing is not a very effective way to get students to learn things. So this semester, in my course on Theories of Truth (Phil 1890D), I'm trying something different. I propose to blog about it from time to time.
The first thing I'm doing is trying to make use of Brown's new online teaching framework, called "Canvas". It does quite a lot. For example, there is an integrated conferencing system that I may try to use later. And it has simpler stuff, like the ability to schedule assignments, which are then automatically entered into a "grade book". But the main thing I'm using is the discussion board. For each of the readings, I've set up a discussion thread, and I'm requiring everyone in the class to post to it prior to class.
Obviously, this is just taking the place of the "response papers" that lots of people use, anyway, but it has a few advantages.
- It's easy for me to comment on people's responses simply by replying in the discussion thread. As a result, they can get feedback before we meet for class.
- The students' responses, and my comments, are visible to the other students, so there is some opportunity for them to learn from each other. So far, there has only been a little discussion among the students, but I'm hopeful that, as we get into the semester, and as we all adjust to this new system, there will be more. (I've set it up so they have to post before they can see what other people wrote, for the obvious sort of reason.)
- Since contributing to discussion is an "assignment", it is linked to the grade book, and I can enter grades (not much more than "did" or "didn't") very easily.
The second thing I'm doing differently is I'm not lecturing. At all. I told the students this at the first meeting, and when I walked into the first "real" class, I had no lecture notes. I'm trying to run the entire class as discussion.
The days that would previously have been devoted to lecture are now devoted to discussion that is aimed at understanding the readings. The day that was previously devoted to discussion is now devoted to discussion aimed at evaluating and criticising the readings. We've had two of the former so far (on Austin's and Strawson's famous papers on truth), and I'm not sure yet how they are going. My strategy has been to identify topics from the papers that we should talk about. So, in the case of Strawson's paper, for example, these were: His criticisms of Austin's account of (i) statements, (ii) facts, and (iii) correspondence, and (iv) his own positive account of the use of "true". The first class seemed to go pretty well. The second one, a bit less so, and I ended up talking more. But that may simply have been because Strawson's paper is quite hard, and maybe that is a sign that I should do something else.
Friday, November 30, 2012
Extracting WAVs from VOB Files
The Station to Station box set contains a DVD with hi-resolution digital rips of the album, including one in 96/24. Since I play all of my digital stuff through a Logitech Transporter, I needed to rip those files to the media server. Here's how I did it.
First, I used mplayer to rip the VOB files from the DVD. These files have trivial video in them, so that has to be removed. The command to do that is:
The audio codec here is the usual one for 24-bit audio, as you can see if look at a wav generated from a flac file. E.g.:
Note that this is independent of the sampling rate, so it works for 48/24 files, as well.
So now I had a bunch of 96/24 wavs, which I could convert to flac in the usual way.
First, I used mplayer to rip the VOB files from the DVD. These files have trivial video in them, so that has to be removed. The command to do that is:
ffmpeg -i <infile.vob> -acodec pcm_s24le <outfile.wav>The audio codec here is the usual one for 24-bit audio, as you can see if look at a wav generated from a flac file. E.g.:
# ffmpeg -i 01-statesboro_blues.wav
...
Input #0, wav, from '01-statesboro_blues.wav':
Duration: 00:04:19.94, bitrate: 4608 kb/s
Stream #0.0: Audio: pcm_s24le, 96000 Hz, 2 channels, s32, 4608 kb/s
At least one output file must be specified
Note that this is independent of the sampling rate, so it works for 48/24 files, as well.
So now I had a bunch of 96/24 wavs, which I could convert to flac in the usual way.
Monday, November 19, 2012
Perl Filters
A nice trick for easily writing Perl filters:
will do the substitution on each line of input and spit it back out. And:
will do the same, except it will change the given files and back them up to file1.bak, etc, as it does so.
perl -pe 's/a/b/g'will do the substitution on each line of input and spit it back out. And:
perl -i bak -pe 's/a/b/g' file1 file2....will do the same, except it will change the given files and back them up to file1.bak, etc, as it does so.
Thursday, July 19, 2012
How To Add to an LVM Drive
One of the great things about LVM is that you never run out of space. If it seems as if you are about to do so, you just add a new "physical volume" to your "volume group", add that to your "logical volume", and resize the file system. In effect, it's as if you have a partition that spans multiple drives.
It would of course be a good idea to back things up before you do this. But sometimes we don't have that option, do we?
I'll suppose our existing volume group is "vgroup", and our existing logical volume is "vvolume".
All of this of course needs to be done as root.
A little hint first: You can (and probably should) give the "-t" (test) option to each LVM command first, to make sure it's going to do what you want. Then I hit up arow (history) and delete the "-t" option, so I make sure I'm running that same command.
It would of course be a good idea to back things up before you do this. But sometimes we don't have that option, do we?
I'll suppose our existing volume group is "vgroup", and our existing logical volume is "vvolume".
All of this of course needs to be done as root.
A little hint first: You can (and probably should) give the "-t" (test) option to each LVM command first, to make sure it's going to do what you want. Then I hit up arow (history) and delete the "-t" option, so I make sure I'm running that same command.
- Add the new disk to the machine, and format whatever space we want on it (all of it, if we wish) as type 8e (Linux LVM). I'll assume this is now /dev/sde1.
- Create a physical volume:
# pvcreate /dev/sde1 - Add the physical volume to the volume group:
# vgextend vgroup /dev/sde1 - Check your work:
# vgdisplay vgroup
You should now see something like:VG Name vgroup
Note the free space we now have.
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 5
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 3.68 TiB
PE Size 4.00 MiB
Total PE 1192327
Alloc PE / Size 476931 / 1.82 TiB
Free PE / Size 476931 / 1.82 TiB
VG UUID JitzBk-zFH0-vhzm-XhYk-V5Xi-Nt7d-87K9En - Extend the logical volume:
# lvresize -l 100%VG /dev/vgroup/vvolume
The "-l 100%VG" says to resize to use all of the space in the volume group assigned to this logical volume. The argument can be given many ways. See "man lvcreate". - Check our work:
# lvdisplay - Now we are ready to resize the filesystem:
# e2fsck -f /dev/vgroup/vvolume
It made me do that first.
# resize2fs /dev/vgroup/vvolume
The LVM HowTo covers all of this.
Saturday, May 19, 2012
Using Remember the Milk with Thunderbird
I've been looking for a few days now for a good task list to use under KDE. The main requirement is that I want something that will be easily usable on many computers, and mobile devices, and without my having to worry a lot about sync'ing.
Google Tasks look great, but I don't want to have to use Google all the time, just to see and manage my tasks, and there doesn't appear to be a decent API for Tasks. So you can't sync them to Thunderbird or anything else.
KOrganizer looks nice, but I don't see any good sync options there, either.
So I stumbled across Remember the Milk, which is also a web-based task manager, but with lots of other support. There's an Android app, and there's also an iCal URL you can use to view tasks in other places. The only downside is that the iCal support is read-only.
But I found a way around that in Thunderbird. First, you just add the iCal service as a calendar. (Get that URL from Settings> Info, in Remember the Milk.) That'll at least let you see your tasks in Thunderbird.
Now, how to add tasks? Answer: Use RTM's google gadget in a tab in Thunderbird. First, you'll need to download the WAT extension for Thunderbird. Among other things, this will give you a box in the upper right corner where you can enter a URL, which will then be opened in a new tab. The URL to enter is:
Google Tasks look great, but I don't want to have to use Google all the time, just to see and manage my tasks, and there doesn't appear to be a decent API for Tasks. So you can't sync them to Thunderbird or anything else.
KOrganizer looks nice, but I don't see any good sync options there, either.
So I stumbled across Remember the Milk, which is also a web-based task manager, but with lots of other support. There's an Android app, and there's also an iCal URL you can use to view tasks in other places. The only downside is that the iCal support is read-only.
But I found a way around that in Thunderbird. First, you just add the iCal service as a calendar. (Get that URL from Settings> Info, in Remember the Milk.) That'll at least let you see your tasks in Thunderbird.
Now, how to add tasks? Answer: Use RTM's google gadget in a tab in Thunderbird. First, you'll need to download the WAT extension for Thunderbird. Among other things, this will give you a box in the upper right corner where you can enter a URL, which will then be opened in a new tab. The URL to enter is:
- http://www.rememberthemilk.com/services/modules/googleig/
Monday, August 15, 2011
Natbib's Same Name Problem
When working yesterday on my book on Frege's Grundgesetze, I suddenly realized that I had a problem with the bibliography. I have references to papers written by both Charles Parsons and Terence Parsons, one each from 1995. These were coming out in the citations as: (Parsons, 1995a) and (Parsons, 1995b). These are at least unambigious, but they are not what one would want. And, indeed, even if I hadn't had papers published the same year, I'd still be getting: (Parsons, 1965) and (Parsons, 1995), which still isn't what I'd want. What I'd want is: (Parsons, C., 1965) and (Parsons, T., 1995).
Googling turned up several complaints about this, which I would characterize as a bug in the LaTeX package natbib, that being what has traditionally been used with LaTeX for author-year references. Many people now are using biblatex, of course, and perhaps this bug has been resolved there. But I already have a custom bibliography style written for natbib, so I'm not sure I want to do the work to switch over to biblatex yet, anyway.
So, I got to work to solve the problem. My goal was to modify the standard plainnat.bst style so that it would give me the kinds of citation labels I want. It actually turned out not to be that difficult, given that I've worked before with the strange postfix stack language that is used to write BibTeX styles in developing my own bst file.
I've posted the results here:
The former is the modified bst file; the latter is a diff against plainnat.bst, so that you can see exactly what I've done. The changes should be fairly easy to port to other bst's---I hope so, since I still need to port them to my own bst---since they are pretty much confined to one part of the file.
There are limits to the approach. First, I deal only with authors and editors. Second, I deal only with single name cases. But I also provide ways to override the calculated labels, so that you can force a certain label if you need to do so. There are two new entry fields for this purpose:
Googling turned up several complaints about this, which I would characterize as a bug in the LaTeX package natbib, that being what has traditionally been used with LaTeX for author-year references. Many people now are using biblatex, of course, and perhaps this bug has been resolved there. But I already have a custom bibliography style written for natbib, so I'm not sure I want to do the work to switch over to biblatex yet, anyway.
So, I got to work to solve the problem. My goal was to modify the standard plainnat.bst style so that it would give me the kinds of citation labels I want. It actually turned out not to be that difficult, given that I've worked before with the strange postfix stack language that is used to write BibTeX styles in developing my own bst file.
I've posted the results here:
The former is the modified bst file; the latter is a diff against plainnat.bst, so that you can see exactly what I've done. The changes should be fairly easy to port to other bst's---I hope so, since I still need to port them to my own bst---since they are pretty much confined to one part of the file.
There are limits to the approach. First, I deal only with authors and editors. Second, I deal only with single name cases. But I also provide ways to override the calculated labels, so that you can force a certain label if you need to do so. There are two new entry fields for this purpose:
- dupelabel
Defines a label that will be used if a duplicate author is found, e.g.:
dupelabel = {Parsons, Ch.}
dupelabel = {Parsons, Ca.}
might be put in entries by Christopher Parsons and Carrie Parsons, respectively. - forcelabel
Defines the label we will use, period.
Subscribe to:
Posts (Atom)