Thank you Ack!
People may have noticed my absence from the Perl world lately. I have been writing my Ph.D. thesis (179 pages on Ultrafast Electron Microscopy with my Physics::UEMColumn Perl module featured) and defense.
Ack is a tool for searching code and text. It works much like the unix tool grep, although it is imbued with the power of Perl. To mark the release of Ack 2.0 though I wanted to mention a few one-liners that made my life easier in this stressful time.
My thesis is written in many LaTeX files and one can probably imagine that searching those files was needed regularly. The biggest is for finding non-ascii characters. As I add content from old publications or external programs, lots of non-ascii characters can often come along for the ride. LaTeX is a very old program, well pre-dating unicode, and it has a very different way of adding special characters with its own markup. In fact parts of the compiling toolchain croak with unicode characters. So I found myself using
ack '[^[:ascii:]]'
regularly. Also I had to keep a list of all the abbreviations that I had used in the paper, but of course you forget if you have them all. I used this little bash-ack conglomeration to find all sequences of two or more upper-case characters, which is how I write my abbreviations,
ack -ho '\p{Upper}{2,}' | sort | uniq
I’m sure I used many other little ackings here and there, but these were the two I could remember off-hand. Thanks to Andy and everyone who has contributed to ack!
Now go use it to make your life easier!
Visit the new site: beyondgrep.com
BTW, XeTeX uses UTF-8 source files (probably not relevant to your thesis :-).
Yes I am aware, but since I wasn’t using Xe(La)TeX I was keeping to the traditional. It is something I might investigate in the future, but its possible I’m too old a dog when it comes to this :-).
Actually the bigger problems were BibTeX, which IIRC doesn’t handle unicode, and the automatic citation exports from journal websites, which pretty much give you anything they feel like. So in this case Xe wouldn’t have helped.
Can we assume that it was a successful defense, given you’re mentioning it in public?
Not yet, my defense is on the 26th. I have completed my thesis and distributed it to my committee members at this point though. I am close to complete on my defense talk and I’m starting to look for the job that will follow.
FYI, you can optionally use
\P{ASCII}
instead of[^[:ascii:]]
and\p{Lu}
instead of\p{Upper}
. The ASCII one is clearly more readable and they’re both less characters to type for one-liners.Lu
andUpper
are both just abbreviations forUppercase_Letter
.Just packaged up makebeamerinfo for SprezzOS — appreciate the quality work! Congrats on the upcoming defense! I wonder if you know my buddy Nick Bronn up at UIUC, doing solid state? Tell him toast says hey.