Chủ Nhật, 2 tháng 3, 2014

HOW-TO: set up Java environment on Ubuntu.

Hi all,
I am kind of big moving from Windows to Ubuntu including infrastructures, softwares, and even cultures. However, I still use both Windows and Linux. I cannot live isolated with surrounding Windows machine around me in labs even my laptop. Windows are simple and convenient for normal users, but Ubuntu is just great for developers.
I definitely love Eclipse. In this blog, we provide some guide to start Java life in Ubuntu. C/C++ life in Ubuntu are great and simple. I supposed that Java life is also simple across different OSs.
First, you need to install Java Development Kit (JDK) which includes Java Runtime Environments (JRE). Going to Oracle and download the newest jdk1.7 [1]. For example, I downloaded jdk1.7.0_51. Then I untar it.
tar xzf jdk-7u51-linux-x64.gz
 As a admin user, you can add or change these two lines in your /etc/profile to point to the installation and it will affect system-wide. OR as a normal user, you can export an environment variable in ~ /.profile. Where JAVA_HOME is the place you just untar your jdk, for instance, /home/tranlaman/Downloads/jdk1.7.0_51.
export JAVA_HOME=/home/tranlaman/Downloads/jdk1.7.0_51
export PATH=$PATH:$JAVA_HOME/bin
 Then, you log out and in again to see effect of the environment variables. After that, you download and install Eclipse from [2].
Further, if you want to install C/C++ plugin in Eclipse to develop C/C++ programs, you can follow this instruction. Go to Help/Install New Softwares, then add the C/C++ Development Toolkit (CDT) link in the box as http://download.eclipse.org/tools/cdt/releases/kepler.
You can replace kepler as the version of Eclipse. Then press Enter.

[1] http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
[2] https://www.eclipse.org/downloads/


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.