Monday, April 27, 2015

Atom not found symbol index for...

Turn off the strip optimization (-s).

The credit should go to some Chinese tech websites. Although I dislike searching in Chinese, but I found sometimes when you get stuck in some technical issues and become helpless with discussions on stackoverflow etc, they could be your last resort. =)


Friday, April 17, 2015

MatlabMPI



MPI_func('eval_bmaps_mpi',[40],{'localhost'},randomDirName('/share/project/shapes/harry'),mymaps,imnames,category,mymaps,SBDopts.path);

put config to get SBDopts.path

Monday, April 13, 2015

A Line Never Processed

It took me two hours to find out a bug in my code. At this time, two hours could mean a real saboteur. It is not something classic, but still it's worth marking down.

So I wanted to read 1000 lines from a huge file at a time, and I did the following:

while (true)
{
count := 0;
while (infile>> xyz && count <1000)
{
        do something with xyz;
        count ++;
}

do something;
if (count < 1000)
      break;
}
}

The code runs smooth, however it takes a long time for me to find out some lines are missing from the output.

Eventually I found out it all occurs at 

while (infile>> xyz && count <1000)

which means if count == 1000 it will still read another line to xyz but stops at the condition count<1000, and that line will never be processed.

Looks silly, but it does caused me a lot of panic. 

Wednesday, April 8, 2015

Ubuntu Launcher Stays Behind

Open your terminal by pressing Ctrl + Alt + T and type this following to solve this problem:
unity&disown

Emacs Parenthesis Highlight and Indent Region

Parenthesis Highlight:

M-x show-paren-mode RET
Indent Region:
C-M-\ 

Caffe Compile Problem

#error -- unsupported GNU version! gcc 4.9 and up are not supported!


comment this line out:

CUSTOM_CXX := /gcc-4.9.2/bin/g++
You may need to remove "/gcc-4.9.2/lib64" from LIBRARY_DIRS too.
Change this back when it's time to compile "matcaffe".

You need to run source  ~/.bashrc everytime you update it

Tuesday, April 7, 2015

Matlab visualization

hold on;
plot(y,x,'o',color,marker,'markersize',msz);
clf;

drawBoundary([],regions,color,width);

[x,y]=find(ucm>.1);plot(y,x,'r.','markersize',1)

h=iimagesc(b);
set(h,'AlphaData',0.5);



clf;
id=125;
name=ds.imnames{id};
mat=load(fullfile(ds.spdirs.slic,[name,'_slic_k600_m15.mat']));
im=mat.im;
p=load(['/share/data/vision-greg/harry/aeroplane/',name,'_pos.mat']);
pos_res=p.pos_res;
pos_res=pos_res';
t=cell2mat(pos_res);
t1=t(:,1);
t2=t(:,2);
imshow(im);
hold on;
plot(t2+17,t1+17,'o','Color','magenta','Marker','x','MarkerSize',8);
ucm=ds.loadUCM(id);
ucm=ucm>0.1;
hold on;
h=imagesc(ucm);
set(h,'AlphaData',0.4);

clf;
im2=rgb2gray(im);
samples=GetSamplePointsUCM(im2,ucm);
t3=samples(:,1);
t4=samples(:,2);
imshow(im);
hold on;
plot(t4,t3,'o','Color','magenta','Marker','x','MarkerSize',8);

clf;
gt=ds.loadGT(id);
gt=gt.groundTruth{1}.Segmentation;
gt(gt==255)=0;
gt=gt>1;
imshow(im);
hold on;
h2=imagesc(gt);
set(h2,'AlphaData',0.4);

Sunday, April 5, 2015

SSHFS

sudo sshfs -o allow_other harryyang@sXXX.XXX:/share/ /mnt/share
fuse unmount: sudo umount

show using process fuser -mu /mnt/