www.flickr.com

Friday, December 15, 2006

Tinkering with iLike

I've decided to give iLike a whirl. So far, it seems alright. However, I'm not convinced that it's as interesting as MOG or the Filter, but, the real time reporting it adds into iTunes is cool.

You can visit my iLike profile if you like. And, if you're using iLike, add me as a friend.

Wednesday, December 06, 2006

ps2pdf tip: How to Get Around the "broken" ps2pdf Arguments

I through hours with a ps2pdf problem. Thank God someone on the PostScript news group managed to help me out. Here's the story for posterity's sake.

I'm currently working on a LaTeX document with some photos in it. As I'm using the PowerDot class, which is incompatible with pdflatex, I need to convert all my images to EPS and use ps2pdf to get my final PDF document. On the first attempt, I used the command

ps2pdf file.ps file.pdf

and it worked, except that my photos came out all muddy, a result of over compression. So, I added the option to turn off compression,

ps2pdf -dEncodeColorImages=false file.ps file.pdf

and end up with the wonderfully obtuse error message

Error: /undefinedfilename in (false)
Operand stack:

Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push
Dictionary stack:
--dict:1122/1686(ro)(G)-- --dict:0/20(G)-- --dict:70/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
MiKTeX GPL Ghostscript 8.54: Unrecoverable error, exit code 1

Ick.

It turns out that ps2pdf on Windows is a batch file, and batch files do not accept = in an argument. I had no idea that this was the case, but so it is. The solution, which is annoyingly absent in the documentation, is to replace = with #. Thus, the command on windows should be,

ps2pdf -dEncodeColorImages#false file.ps file.pdf

Like that, it works. And, I get my beautiful uncompressed photos in my document.

Monday, December 04, 2006

Emacs Tip: No Tabs Whatsoever

I my last post, I tried to describe how to get rid of tabs in Python mode, and managed to not get it quite right. The previous command, python-guess-indent, really only turns off the indent guessing, but doesn't actually remove the tabs. It just happens that tabs are only used for every other indentation level. I had only tested the first level and missed that the tabs are still inserted later in.

So, to get rid of all tabs all the time, add the line (setq-default indent-tabs-mode nil) to your .emacs file. This turns off the replacement of spaces with tabs globally. Hooray! tabs are gone.

Friday, December 01, 2006

Emacs Tip: Troublesome Tabs in Python Mode

The Python mode in Emacs 22 (using python.el, not the python-mode.el from XEmacs) has a nice feature of deducing the spacing style based on the spacing and tabs that already exist in the file. Most of the time, it works really well, but, it does make getting rid of large tabs difficult. So, if you're having problems getting rid of tabs, simply toggle the indent guessing mode with the command python-guess-indent and just use the default Python mode settings for indentation.