October 18, 2012 at 9:22 am
· Filed under Uncategorized
After installing 10.8.2 and a new Vertex 4 SSD into my mid-2011 MBP, my machine would come up from sleep but only be half-responsive, and I’d ultimately have to force power it off. Turns out the issue was the drive not coming back up after sleep, and following the instructions here to update the firmware twice (without data loss) seems to have fixed it:
http://www.ocztechnology.com/ssd_tools/OCZ_Vertex_4_and_Agility_4/
Permalink
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