Thứ Sáu, 28 tháng 2, 2014

HOW-TO: build OpenCV 2.0 on Ubuntu 64 bits 12.04 LT

Hi all,
Sometimes, you want to build an old version of OpenCV on Ubuntu 64 bits. It seems not to be easy as I think. I met this error. That was suck.

../include/opencv/cxoperations.hpp:1916:15: error: ‘ptrdiff_t’ does not name a type
../include/opencv/cxoperations.hpp:2465:31: error: ‘ptrdiff_t’ does not name a type
The reason is that library might lack of a header file [1]. Just add "#include <cstddef>" to corresponding headers file that generates errors including cxoperations.hpp. And hope it will solve your problem.

HOW-TO: know what I have passion on

Hi,
It is not a tech blog as usual. Instead, I write about how life could be complicated and what I think. Life is not as simple as it seems to be.

Thứ Năm, 2 tháng 1, 2014

PATH: all you need to know

Hi all,
Previously, I write a blog about LD_LIBRARY_PATH [1]. Continuing this series, I write this blog about another important environment variable in Linux which is PATH.
PATH is the environment that contains paths to executable files. For example, /home/tranlaman/bin, /usr/local/sbin, /usr/local/bin/, /usr/sbin, or /bin.
Otherwise, LD_LIBRARY_PATH contains dynamic library for other programs.

MATLAB options file in Linux 64

Happy new year 2014,
I am writing this blog to notice you a trick to change option files in Matlab in Linux, which is very useful. When you want to use MEX to compile a C/Fortran source in MEX interface, you need to modify option files mexopts.sh in Linux because the default file contains errors in Linux. Why is it important so? The answer is that options files control which compiler to use, the compiler and link command options, and the runtime libraries to link against.
Then, where the file locate in Linux? The default file mexopts.sh locates in /home/tranlaman/.matlab/R2012a. But there is another default root file lie in /home/tranlaman/MATLAB/R2012a/bin which overrides the file in /home/tranlaman/.matlab/R2012a. So, modifying the mexopts.sh in /home/tranlaman/MATLAB/R2012a/bin would change everything.
Finally, how do we modify this file? The answer is to change some compiling and linking flag such as CC, CFLAGS, CLIBS, LD, LDFLAGS. Please refer to [1] as a complete flag for custom building MEX files.
Wish everyone has a good year.

Thứ Sáu, 20 tháng 12, 2013

HOW-TO: Making an icon licking in Ubuntu

Hi all,
After a while of using Ubuntu, I feel that everything is fine and cool. It is still something missing in Windows. They are icons. This tutorial guides you how to make an icon licking in Ubuntu. I prefer to style of learning by doing, so let start with an example.
Let save the following code in a file named matlab.desktop, and move it to /usr/share/applications. It is a system folders, and you should know that we need to use sudo.
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Icon=/usr/share/icons/matlab_logo.gif
Name=MATLAB R2012a
Comment=Start MATLAB - The Language of Technical Computing
Exec=matlab -desktop
Categories=Development;

All you need to do is to replace a command to start your application, in this case, it is MATLAB R2012a. It should be noticed that excutable command here is that matlab. We need to create alias for matlab.
 cd /usr/local/bin/ 
 sudo ln -s /usr/local/MATLAB/R2012a/bin/matlab matlab
This trick will allow you to start Matlab from any folder, as you were trying to do. Further, you should replace icon with your logo. That's all. Then, you find an icon of Matlab in /usr/share/applications. Now you can search Matlab in Launcher Utility and send this icon to Desktop to have a licking icon such that in Windows.

I know that I need to create some icons for some applications I like since a long  time ago. But I rely on the reason that I am busy so I did not care about it. Now I change. Let work with a style, live with a style and more,  research also with a style. I am gonna figure out what style I am.
Thanks,

Chủ Nhật, 24 tháng 11, 2013

Wordle - a new toy

Hi,
After a long time, I did not write anything on my blog. I am quite busy with the modules in uni and other stuff in Computer Vision and Machine Learning. When surfing around for some papers and dissertation, I found a new toy for undergrads, grads student or some geeks. When you finished writing something such as reports, papers and theses, you want to visualize your work just in some words according to their prominence in the writing. Wordle is your toy. Wordle will visualize most frequent  words, "cloud words", that appear in the provided text.
http://www.wordle.net/
The following is the wordle of one of my final review paper.

Chủ Nhật, 14 tháng 7, 2013

LINUX: Awesome error

Today, I met an awesome error when running a shell script file in Ubuntu.
tranlaman@tranlaman-VirtualBox:~/Desktop/workspace/partapp-r2$ ./run_partapp.sh bash: ./run_partapp.sh: /bin/sh^M: bad interpreter: No such file or directory
 The following link can fix the problem excellently:
http://www.gizmola.com/blog/archives/87-linux-shell-scripting-bad-interpreter-no-such-file-or-directory.html

Reason: Because the code was developed in Mac or somewhere, then I run it in Ubuntu. The file format is different.