Monday, May 26, 2008

Thursday, May 22, 2008

encoding xvid in linux from a sequence of images

xvid: you must specify one or a valid combination of 'bitrate', 'pass',
'quantizer' settings

solution:
mencoder mf://*.png -ovc xvid -xvidencopts pass=1 -of avi -o
./tmp/filename.avi

or
mencoder mf://*.png -ovc xvid -xvidencopts bitrate=1600 -of avi -o
./tmp/deneme2.avi

Debian package manager manual (APT)

http://www.debian.org/doc/manuals/apt-howto/

convert multiple images from command line in linux (ubuntu)

sudo apt-get install imagemagick

convert '*.jpg' -resize 120x120 thumbnail%03d.png

more on the topic:
http://www.imagemagick.org/script/command-line-processing.php

Matlab Tips and Tricks

http://www.ee.columbia.edu/~marios/matlab/matlab_tricks.html

Pass arguments to python script

import sys

print sys.argv

Monday, May 19, 2008

Pause python

little hacky but works:

raw_input()


Thursday, May 15, 2008

Python debugger

import pdb

#this is a break point
pdb.pm()

Open text file in python

file = open("sample.txt")

while 1:
line = file.readline()
if not line:
break
pass # do something

Flush python print buffer

sys.stdout.flush()

Found here!

What this blog is

Sometimes we hit dead ends. We figure out the solution and move on. After a while we forget the fix but more often then not we find ourselves looking for the exact same solution. This blog is my notepad for these hacks. It is a blog instead of a text file because it is cool to share.