Tuesday, September 29, 2009

Saturday, September 19, 2009

The Man from Planet X

I love having TCM. They actually show movies properly, and show a wide variety of things. Today I saw "The Man from Planet X." It is exactly as bad of a 1950s sci-fi movie as you'd expect.

My main complaint about it (ignoring factual inaccuracies and crap dialogue. Those are what I expect) is that they "kill" TMfPX twice. The first one is so wonderfully brutal that I can't imagine why they felt they needed to blow him and his ship up (that's lame death number two).

The good death has TMfPX fighting hand to hand with The American Cool Guy Leading Around the Polite but Inept Scotch Village. They struggle for a bit, with TACGLAtPbISV knocking the mind control ray gun out of TMfPX's hand early on. TACGLAtPbISV gets the upper hand, and turns the handle on TMfPX's "space-air" supply. This turns off the space air, and TACGLAtPbISV holds TMfPX down while he suffocates.


That's the best "don't invade our planet" ad ever. "Go ahead. Fucking invade us. We will find your first invaders, and sit on their chest and watch them suffocate. I dare you."

Friday, September 18, 2009

Saturday, September 12, 2009

I'm pretty sure

The "Fresh Ginger" content isn't strictly regulated by the USDA.
Sent from my Verizon Wireless BlackBerry

Thursday, September 10, 2009

Makefiles rule

I'm giving a talk tomorrow. My slides are mostly compiled from the pile of talks I gave at the beginning of the year at KITP and while going around applying for jobs. Therefore, my figures are all scattered around in a bunch of different directories. I thought it was dumb to copy them all (again) into the workdir for this talk. This led to the thought that I should symlink them. This led to the thought that it'd be cool if I could convince the Makefile for the talk to figure out which figures are needed for the slides, and do the linking itself. Two hours of playing around later (talk content...um...somewhat postponed, I guess) and I have this (with added commentary):

This bit defines the directories to search for figures in. I also set the target list by using dark shell magics to extract the list of figures used in the slides.tex file.
FIGURE_DIRECTORIES := ../2009_02_24-Job_place ../2009_01_27-KITP_talk
FIGURE_TARGETS := $(shell grep myfig slides.tex | grep -Ev '^%' | grep -v 'newcommand' | sed 's/.*myfig\[.*\]{\(.*\)/\1/; s%^./%%; s/}.*$$//;' | sort | uniq)
FIGURE_TARGETS += PPR_thesis.sty


This is the cool bit. We define the linky command that accepts two arguments, the file we care about, and the directory we're looking in now. If we detect that the file exists in that directory, then append the full path to our link sources list, and also add that file to the list of files to auto-clean later. Then, we remove that file from the list we're searching, since we don't need to look for that file in all the subsequent directories.

define linky
ifeq ($(shell [ -e $(2)/$(1) ] && echo exists),exists)
LINK_SOURCE += $(2)/$(1)
CLEAN_OBJS += $(1)
LINK_TARGETS := $(filter-out $(1),${LINK_TARGETS})

This is the loop where we run over the directories and targets, and execute "linky" for each.

$(foreach d,$(FIGURE_DIRECTORIES),\
$(foreach t,$(LINK_TARGETS),\
$(eval $(call linky,$(t),$(d)))))

Now, since the variables we care about have been defined now, we can define the commands to actually do the linking and cleaning.

links :
ln -sf ${LINK_SOURCE} .

clean :
rm -f ${CLEAN_OBJS}

The coolest bit about this is that it's totally general, so I can use this same bit of code in all my LaTeX Makefiles from now on.

PS: It looks like blogger hates the whitespace and line breaks and stuff. It's probably pretty clear what it needs, though.
PPS: No actual necromancy was used for this project.

Tuesday, September 8, 2009

Random cupcakes

With random plastic markers from three different movies. Way to go, grocery store.
Sent from my Verizon Wireless BlackBerry