November 3, 2011 at 2:40 pm
· Filed under Uncategorized
By default, paredit in the Clojure slime-repl doesn’t properly handle literal vectors and maps. This little snippet of elisp seems to fix it.
(defun fix-paredit-repl ()
(interactive)
(local-set-key "{" 'paredit-open-curly)
(local-set-key "}" 'paredit-close-curly)
(modify-syntax-entry ?\{ "(}")
(modify-syntax-entry ?\} "){")
(modify-syntax-entry ?\[ "(]")
(modify-syntax-entry ?\] ")["))
Permalink
April 12, 2011 at 3:00 pm
· Filed under Uncategorized
Many academic conferences require that you submit PDF files with all fonts properly embedded. Making sure this happens for your LaTeX document using pdflatex is not difficult. However, some programs used to create figures don’t have an option to embed fonts, and when these figures are included in your LaTeX document, your final PDF ends up short a few fonts.
I’m sure there’s a more elegant way to solve this, but when I last faced it a few years ago, I hacked together an ugly shell script that converts the PDF to PS to EPS back to PDF again. I don’t recall why all these steps were necessary, but at the time this was the quickest thing I could find that worked:
#!/bin/bash
export GS_OPTIONS='-dEmbedAllFonts=true -dPDFSETTINGS=/printer'
cp $1 $1.old
pdftops $1 tmp.ps
ps2eps tmp.ps
epstopdf tmp.eps
mv tmp.pdf $1
rm tmp.ps tmp.eps
As you can see here, it successfully embeds the fonts in a pdf file, without increasing the file size too much. And each of the conversion steps should be lossless, so the final pdf looks exactly the same as the input:
jawolfe@[~/Projects/reports/11-ijcai/graphs]: pdffonts independent.pdf
name type emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
Helvetica Type 1 no no no 7 0
Symbol Type 1 no no no 8 0
jawolfe@[~/Projects/reports/11-ijcai/graphs]: ./fixfonts independent.pdf
... (ignore the error messages)
jawolfe@[~/Projects/reports/11-ijcai/graphs]: ls -l
total 72
-rwxr--r--@ 1 jawolfe admin 173 Apr 12 15:45 fixfonts*
-rw-r--r-- 1 jawolfe admin 9642 Apr 12 15:45 independent.pdf
-rw-r--r-- 1 jawolfe admin 4102 Apr 12 15:45 independent.pdf.old
jawolfe@[~/Projects/reports/11-ijcai/graphs]: pdffonts independent.pdf
name type emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
QHKFIS+Helvetica Type 1C yes yes no 8 0
ONFWFL+Symbol Type 1C yes yes no 10 0
Permalink
December 4, 2010 at 7:57 pm
· Filed under Uncategorized
I made a simple game timer to learn jQuery, and keep our house’s Settlers of Catan games moving. It runs great in a mobile browser, allows arbitrary numbers of players, and has a couple configurable timing settings. Both the source and a demo are online.
Permalink