Warning: ob_start(): non-static method wpGoogleAnalytics::get_links() should not be called statically in /home/w01fe/w01fe.com/wordpress/wp-content/plugins/wp-google-analytics/wp-google-analytics.php on line 259
A Blog. » Uncategorized

Archive for Uncategorized

Firmware update for Vertex 4 fixed wake from sleep issues on 2011 MBP, Mountain Lion

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:



Fixing paredit in the clojure REPL

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 ()
  (local-set-key "{" 'paredit-open-curly)
  (local-set-key "}" 'paredit-close-curly)
  (modify-syntax-entry ?\{ "(}") 
  (modify-syntax-entry ?\} "){")
  (modify-syntax-entry ?\[ "(]")
  (modify-syntax-entry ?\] ")["))


Embedding fonts into an existing PDF file (via an ugly hack)

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:

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

Comments (1)

« Previous entries Next Page » Next Page »