Tuesday, September 2, 2014

merge columns of multiple files

paste <(cut -d ' ' -f1 file1) <(cut -f2-5 -d ' 'file2) -d ' '> file3

the command above merges the first column of file1 with columns 2,3, and 4 of file2 and dumps it to file3 with a white-space delimiter. columns are separated with white-spaces for file1 and file2.

qlogin to a specific compute node in a sun grid engine

qlogin -l h=<node_name>
e.g.,
qlogin -l h=compute-0-29.sge

Wednesday, June 25, 2014

sort in unix

be careful when you use "sort" in unix since it is kind of problematic with the numbers like "9.9591403640072E-4" even if you set "-n".

Friday, June 6, 2014

char * in unordered_map issue

do not use unordered_map<char*,int> map
instead use unordered_map<string, int> map since unordered_map is kind of problematic with pointers

Thursday, June 5, 2014

row and col operations in opencv

check out this link before these operations :)

http://docs.opencv.org/modules/core/doc/basic_structures.html#Mat%20Mat%3a%3arow%28int%20y%29%20const


mat.row(1) = mat.row(3) // this does not work!

mat.row(3).copyTo( mat.row(1)) // this works

Tuesday, April 8, 2014

retrieve a document from indri index

first run the command below;
./dumpindex/dumpindex <index_path> di docno <docuement_no>
this returns a document id and then run the command below;
./dumpindex/dumindex <index_path> dd <document_id>