Tuesday, November 27, 2012

Latex - compile

latex document_name
latex document_name
bibtex document_name
latex document_name
latex document_name
dvips -Ppdf -t letter -G0 document_name

ps2pdf14 -dPDFSETTINGS#/prepress -dEmbedAllFonts#true -dEncodeGrayImages#true -dAutoFilterGrayImages#false -dGrayImageFilter#/FlateEncode -dEncodeMonoImages#true -dAutoFilterMonoImages#false -dMonoImageFilter#/FlateEncode -dEncodeColorImages#true -dAutoFilterColorImages#false -dColorImageFilter#/FlateEncode document_name.ps document_name.pdf

rm document_name.ps

Monday, November 19, 2012

Copy list of movies - linux wget

#!/bin/bash

FILENAME="movies.txt"
echo $FILENAME
count=0
cat $FILENAME | while read LINE
do
       let count++
       echo $LINE
       wget $LINE
      
done

echo -e "\nTotal: $count movies copied"

Friday, November 16, 2012

Matlab save binary files

%write
tic
file = fopen('test.binm', 'w');
a = ones(200, 10);
a = cumsum(a);
fwrite(file, a', 'double');
fclose(file);
clear a;


for i=1:100
%append
    a = ones(1, 10)*i;
    file = fopen('test.binm', 'a');
    fwrite(file, a, 'double');
    fclose(file);
    clear a;
end

%read
file = fopen('test.binm', 'r');
a = fread(file,[10,300], 'double')';
fclose(file);

toc

Sunday, November 4, 2012

C++ , Matlab syntax

Armadillo is a C++ linear algebra library (matrix maths) aiming towards a good balance between speed and ease of use. The syntax is deliberately similar to Matlab. 

http://arma.sourceforge.net/