Compressing Large PDFs

Here is a nifty Automator action that I created today to automatically compress large PDFs that I encounter every now and then from journals. These are not scanned images that JSTOR produces, which are understandably large. They are articles typically less than 10 pages, with a few images. They have no business exceeding 1MB, never mind 7MB(!) which I downloaded once. After compression they are often around 700KB. You can compress using Acrobat Pro, but this is free and much faster. Here is the commandline using Ghostscript:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

This uses the "printer" setting, which downsamples at 300DPI. Ebook is 150DPI. There is also prepress which I haven't used but I'm guessing 600DPI? Hard disk space is cheap these days but there are a couple of practical reasons to do this: sharing with others, and screen rendering speed. In particular Preview slows to a crawl at times.

After getting tired enough of deleting and renaming the files by hand, I created a Leopard Automator action for this. Now I can just select the file, and it will convert and replace the original.

Power of Analogies

I have no idea whether the attribution of causation holds any water, but it's certainly a well-crafted piece of rhetoric.

“I told Boyden: ‘Imagine you just fired up the government printing presses and dumped an endless stream of money into the system. You’d have no way of controlling the money supply,’ ” Mr. Dudek said. “He understood totally and intuitively the importance of maintaining the cap, the key ingredient in our acid rain policy.” A month later, the Bush White House sent Congress a cap-and-trade plan...

They also seem to me to be particularly useful in situations involving repugnant transactions. Perhaps an example of cognitive appraisal?

HTML Text Justification and Hyphenation

One thing easy to do (but not easy to do well) in word processing software is to use hyphenation when justifying text. Up until now there have been really no way to do so on the web. I recently heard that both IE6, Safari, and recently Firefox 3, all began to support soft hyphenation. Basically you put the reference code—­—in the area where one might want to insert a hyphen. Now I don't understood why this should be something that is done on the language side (i.e., html) rather than browser side. I mean, you are not asked in either Word or Latex to put some random marker of where you might possibly hyphenate. Nevertheless, I don't ask for much and this is better than nothing, and the difference can be quite stark, especially when working with narrow blocks of text. Read More...

Automate Proxy Logon with Applescript

I download journal articles from home pretty often, which requires me to go through the library’s proxy server, a web authentication process that takes me through 3 pages to input a username and a password. Eventually my utility for future laziness trumped my utility for current laziness, so I wrote an applescript to automate the input process. This is my first try with applescript, and so far it’s been very easy and powerful.

In case I get berated by the librarians for having a potential security hole, I used the Mac’s keychains to manage the username and password. So now you can input the password once instantaneously rather than wait, input, wait again, input again, wait yet again, click...., you get the point.

Alarm Clock

I have received a couple of emails about the above very cool looking alarm clock (original link), including one from someone in Romania wanting to import it. Unfortunately it is a different, and clearly more artistically gifted, Ming Hsu who designed it. So please contact me if you know that Ming Hsu, since he might be missing out on a fair chunk of cash money from this confusion.

X11 Forwarding in Matlab on Mac OS X

If you’re like me and want to use Matlab remotely on a Mac server, but can’t get graphics to display, the problem is you need to disable the java virtual machine that Matlab uses for the GUI. Invoke matlab from the command line with ``matlab - nojvm -nosplash”. You will of course need all the environment variables set correctly. It never occurred to me that java was the culprit. I found it from the Apple discussion list, but it’s not all that easy to find.