Friday, August 26, 2011

Extract a clip from a video with mencoder

mencoder -ss 00:38:46 -endpos 00:05:40 -oac copy -ovc copy movie.avi -o excerpt.avi

00:38:46 is the start position and 00:05:40 is the duration

Thursday, August 11, 2011

Latex: Pushing floats to the end of a document

The endfloat package is kind of fancy but the problem I faced with it is that I was renumbering figures in the middle of the document and the latex referencing algorithms were handling it fine, but when the figures appeared at the end of the document their numbering was screwed up.

There is an easy way, however, to push the figures to the end of the document as I wanted. From some hints here about how LaTeX decides whether there is enough space on a page to put in a figure


\renewcommand{\textfraction}{1.0}
\renewcommand{\floatpagefraction}{0.9}


in the preamble does the trick, by fooling LaTeX into deciding there is NEVER enough space to put figures on a page until it is all out of text and has to just dump the figures as best as it can, one to a page.

Tuesday, August 9, 2011

Latex + Unicode = XeTeX

Never bothered to figure out what this xetex thing was. Turns out it can handle unicode. For texmaker just replace pdflatex command with xelatex and use a unicode aware font (e.g. \usepackage{helvet}) and things should work

Sunday, August 7, 2011

Updating Eclipse

From here

Help->Install New Software->Add site-> http://download.eclipse.org/releases/indigo (or whatever release you are going to)

Help->Check for updates

And eclipse should update itself with no fuss.

Monday, August 1, 2011

migrating existing svn repo to git (and use with eclipse)

  1. Install git
  2. sudo gem install svn2git --source http://gemcutter.org (here)
  3. svnserve -d (start readonly svnserver on local machine)
  4. mkdir new directory and cd into it
  5. svn2git svn://localhost/path/to/local/svn/repo
  6. Install EGit and restart.
  7. (Eclipse) new pydev project ->  browse to existing folder
  8. Set up git locally (here)
  9. set up to use git
  10. team -> remote -> push -> (url from your project page)
Notes:
  1. git svn clone file: did not work because of a file format problem (Expected FS format '2'; found format '4' at /usr/local/git/libexec/git-core/git-svn line 1535)