Tuesday, May 29, 2012

Googlesites: filecabinet = folder with files

From a tip here, creating a new page with the File Cabinet template is equivalent to creating a folder on the site with whatever files you upload. You can link to these files from other pages on the site.

Wednesday, May 23, 2012

Change document font (latex)

\usepackage{helvet} %Use Arial
\renewcommand{\familydefault}{\sfdefault}

Change page margins (latex)

\usepackage[top=.5in, bottom=.5in, left=.5in, right=.5in]{geometry}

Change section heading size (latex)

(http://www.latex-community.org/forum/viewtopic.php?f=4&t=3245)

\usepackage{titlesec}
\titleformat{\section}{\large\bfseries}{\thesection}{1em}{}

Sunday, May 20, 2012

Bolding author name in CV (latex)

If you use latex and bibtex to create your CV then you can use this trick to bold your name in the author list of the bibliography. There are several other methods shown here.:
  1. Use plain.bst, copy it over to the location where your cv tex file is. Rename it (eg. to cvplain.bst)
  2. Find the format.names function and change the line
    { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
    to
    { "\FormatName{" s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ * "}" * 't :=
  3. In your cv tex file add the following lines:
    \def\FormatName#1{%
    \def\myname{My Name}%
    \edef\name{#1}%
    \ifx\name\myname
    \textbf{#1}%
    \else
    #1%
    \fi
    }

Tuesday, May 15, 2012

ffmpeg on openSUSE

From the opensuse docs we see that ffmeg is found in the packman repository.

From the instructions here we can see how to use yast2 from the commandline to add the repo (I used ftp://ftp.uni-erlangen.de/pub/mirrors/packman/suse/openSUSE_12.1/) and then install the package.

Shooting yourself down

From this story on futility closet I came to know about Thomas W. Attridge's F11F 'Tiger' flight where, after firing off two volleys of 20mm cannon he put his aircraft into a supersonic dive and ran into the shells damaging his aircraft enough that he had to ditch it. The full story is here.

Monday, May 14, 2012

ffmpeg to create a movie from images

I've switched over to ffmpeg from mencoder. ffmpeg can be obtained from here for mac.

The ffmpeg documentation on creating video slideshows is great.

An example command line for such a use is:

ffmpeg -r 1/.5 -i "0%05d.jpg" -vcodec mjpeg -r 25 drop.avi


Important: if the numbering of your images doesn't start from 1 you should use the -start_number to indicate the first image (from here):
ffmpeg -start_number 2724  -r 1/.075 -i "DSC_%04d.jpg" -vcodec mjpeg -r 25 advair.avi

If there is a break in the file name numbering (eg. you have image01.jpg ... image05.jpg then image08.jpg) ffmpeg will stop at the break and finish the movie. You can use a short bash script to generate a copy of the files numbered as you want them.
ls *.JPG| awk 'BEGIN{ a=0 }{ printf "cp %s image_%04d.jpg\n", $0, a++ }' | bash

You should add options to ls to sort the files as you wish
Here, the first rate command (-r 1/.5) indicates how long each frame should take (here 0.5 of a second) and the second rate command (-r 25) indicates the movie frame rate.

Another example command to compile images into a movie is:
ffmpeg  -i test%06d.png -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an sudoku.mkv