Embedding fonts in PDF’s – LaTeX whoes on Windows and Cygwin – Mac to the Rescue!

Of some reason Miktex 2.9 on my Windows installation refuses to embedd fonts eventhough the pdftexDownloadBase14 is set to true in the config file.

An easy fix for this is to print your document through PDF Creatorwhich will politely embed the fonts in the file it outputs! Thanks for that PDF Creator!!

Update: Unfortunately it seems that nowadays (I didn’t have this problem before) PDFCreator changes the layout of the page sightly (moving the text around on the paper) which causes the conference publishing system to reject the PDF.

The absolute simplest way seems to be to open the document in Preview on the Mac and save a copy, Preview will embed all fonts and not change the layout.

So to summarize, the way I got the PDF through the conference publishing machinery is to generate the document on windog$ with the following command:

pdflatex document.tex && bibtex document.aux

And run that command roughly four times, before LaTeX and friends has reached some kind of fix point. Now you have a document.pdf in the folder. To get the fonts embedded copy the document to a Mac, open it in Preview and save a copy, now you finally have a version with fonts embedded.

Emacsibilia

From the (X)Emacs Manual:

There are commands for placing point and the mark around a textual object such as a word, list, paragraph or page.

M-@
Set mark after end of next word (mark-word). This command and the following one do not move point.
C-M-@
Set mark after end of next Lisp expression (mark-sexp).
M-h
Put region around current paragraph (mark-paragraph).
C-M-h
Put region around current Lisp defun (mark-defun).
C-x h
Put region around entire buffer (mark-whole-buffer).
C-x C-p
Put region around current page (mark-page).

M-@ (mark-word) puts the mark at the end of the next word, while C-M-@ (mark-sexp) puts it at the end of the next Lisp expression. These characters sometimes save you some typing.

My comments:

Repeated M-@ extends the region forwards.

M-x describe-bindings
Lists all keybindings

Tags:

Creating PDF vector graphics on Windows using almost only free tools

When writing papers you want your graphics to be in vector format to maintain a high quality of the images. Unfortunately there are not too many good tools within a resonable budget to create vector graphics on Windows so this is how I do it…

It is a bit roundabout, but here goes…

Download and install PDFCreator.

Download Briss: Briss. Place it wherever. Briss is used for cropping PDF’s if you don’t need to crop, you don’t need Briss.

Both are excellent free tools.

Create your graphics in Microsoft Powerpoint, which is actually pretty good a that as these things goes.
Print your slide using PDFCreator as your printer. PDFCreator is polite enough to embedd the fonts in the PDF, this is a good thing.

Update: Microsoft Powerpoint 2011 (and above I assume) now has “Save as..” PDF, this may also work, in this case PDFCreator is not nessecary any more.

Often I need to crop away white edges. Start Briss and load the file, mark the region you want to keep and Crop.

Now the pdf is ready to be imported in Latex for your authoring pleasure!

Extracting/Exporting a copy of a file from GIT

Sometimes I just want to get a copy of a file from GIT here’s how I do it:

git cat-file blob HEAD~25:src/experiment/BasicStacking.java

Can be combined with a redirect to a file

git cat-file blob HEAD~25:src/experiment/BasicStacking.java > BS.java

Good guide to SSH

Since I so seldom setup ssh I always forget the details, here is a good guide:
Setup SSH keys

An addition to this is that you may have to do ssh-add on the client to get it working.

Perl UTF 8 å ä ö and html

A common thing I do is to scrape a Web page, run it through some Perl magic and marvel over the result. A frequent reason of contention in this process is the issue of getting å’s ä’s and ö’s correctly handled by Perl and various terminals, here’s a write up of a simple example.

The webpage is UTF-8 encoded, I save it to disk using “Save as…” in my browser. The resulting file on disk is UTF-8 encoded.

In this example the file is reasonably small so I use File::Slurp to get the full file in a scalar…


my $text = read_file( <filename> ) ; # Slurp the file
utf8::decode($text); # Decode the file from UTF-8

I can now match with å ä and ö in my Perl code like this:


my ($address) = ($text =~ m{title="Visa alla bilder för ([^"]+)"}sm);

Later when I have finished my text processing and want to print the result in my terminal, Cygwin in this case I do:


my $output = "";

$output .= "Adress: " . $house->{address} . "\n" if defined($house->{address});
$output .= "Område: " . $house->{area} . "\n" if defined($house->{area});

...

utf8::encode($output); # Encode the text as UTF-8 which is correctly displayed by Cygwin
print $output;

Note: You should not “use utf8;” in this Perl script, “use utf8;” should only be used if your Perl script is written in UTF-8!

Tags:

Mining of Massive Datasets

Found a little gem called “Mining of Massive Datasets” from Jeffrey D. Ullman of “Dragon Book” fame.
The PDF version of the book is downloadable from.

http://infolab.stanford.edu/~ullman/mmds.html

I find it to be a very good read!

Some Comments on the Turtle Beach PX5 wireless headphones

Background:

I wanted a set of wireless headphones for work which where Bluetooth capable (to connect to my iPhone) to listen to music when working in an open landscape, which I find distracting when people are talking all around.

The Good:

The mic. allows for handling calls without having to switch headsets.

Quite light with a nice build feel to them eventhough they are a bit “plastic”.

Good Bluetooth performance, no problems connecting/reconnecting to the iPhone.

The not soo good:

The builtin equalizer presets does not apply when listening to music over Bluetooth.

No Audio/Video Remote Control Profile (AVRCP), which means you have to fiddle with the phone to change tracks, pause/play and not through controls on the headset.

Audio leakage, I find that they leak fairly much risking to disturb your landscape neighbours.

Sometimes there are some initial audio drop-outs which seem to be Bluetooth connection “stabilizing”, but after a few seconds it is up and running and there are no further problems.

No re-chargable batteries.

Summary:

The PX5 is clearly marketed as “Gamer Headsets”, for which I think alot of my issues are non-issues. In retrospect the PX5 was not perfectly suited for my use-case.

Tags:

Swedish House Mafia in MSG

Seems to have been a blast when SHM played at MSG!

http://remix-nation.com/review-swedish-house-mafia-madison-square-garden-121611/

How to Geek- Windows sortcuts

http://www.howtogeek.com/tag/windows-vista/