Posted on May 5, 2009 by kurniawano
Declaring the global constants can polute the names available and create conflicts as the project grow larger. One solution is to declare it using a namespace.
globalconst.h
namespace GlobalConst{
const double PI=3.14;
};
and in your file, simply use
GlobalConst::PI
UPDATE: I have corrected the code, thanks
Filed under: Uncategorized | Tagged: c++, programming | 1 Comment »
Posted on April 30, 2009 by kurniawano
I created a branch from another branch, and after I am ready to merge, I encounter this problem:
$ cd photon-branch; svn update
$ svn merge –reintegrate https://nanoes.svn.sourceforge.net/svnroot/nanoes/branches/photon-recursive/
svn: Cannot reintegrate from ‘https://nanoes.svn.sourceforge.net/svnroot/nanoes/branches/photon-recursive’ yet:
Some revisions have been merged under it that have not been merged into the reintegration target; merge them first, then retry.
It turns out to be [...]
Filed under: Uncategorized | Tagged: linux, programming, subversion | Leave a Comment »
Posted on February 18, 2009 by kurniawano
I downloaded it++ 4.0.6 and tried to compile using MKL library. To do that, I need first to set the environment path
export LDFLAGS=-L/opt/intel/Compiler/11.0/081/mkl/lib/32/
export CPPFLAGS=-I/opt/intel/Compiler/11.0/081/mkl/include
and then I run the configure with this option
./configure –prefix=$HOME/local F77=gfortran –with-blas=”-lmkl_intel -lmkl_sequential -lmkl_core -lpthread” –with-lapack=”-lmkl_lapack”
With this settings configure can detect my MKL library
UPDATE: though it can detect MKL, but it gives [...]
Filed under: Uncategorized | Tagged: c++, IT++, programming | Leave a Comment »
Posted on January 14, 2009 by kurniawano
For a detail instruction to install the plugin in Eclipse which enable Subversion, go to:
http://www-128.ibm.com/developerworks/opensource/library/os-ecl-subversion/
There are some differences with the version which I am using in Kubuntu. So I will list down again briefly.
1. Open Eclipse, click menu “Help->Software Updates->Find and Install”
2. click the option, “Search for new features to install”, and then “Next” button.
3. [...]
Filed under: Uncategorized | Tagged: programming | Leave a Comment »
Posted on January 14, 2009 by kurniawano
I am developing C/C++ codes in Linux, and luckily Eclipse has a plugin called CDT to be used for C/C++ language. To install Eclipse and CDT plugin in Kubuntu/Ubuntu, just type:
sudo apt-get install eclipse eclipse-cdt
Filed under: Uncategorized | Tagged: c/c++, kubuntu, linux, programming, ubuntu | Leave a Comment »
Posted on December 4, 2008 by kurniawano
I just found an interesting site to help you find the required mathematical libraries for computation.
http://gams.nist.gov/
Filed under: Uncategorized | Tagged: libraries, programming | 1 Comment »
Posted on September 24, 2008 by kurniawano
I am porting my Octave code to C++, somehow I always got zero for one expression that I calculate. After debugging, it turns out after I take abs(expression), the values always zero. Argh. I forgot, abs() in C++ is only for integer and long. I need to use fabs() for float or double. Now it [...]
Filed under: Uncategorized | Tagged: c++, octave, programming | Leave a Comment »
Posted on September 24, 2008 by kurniawano
After developing my code for quite sometime, now it is ready to release its 1.0 version.
svn export my-working-copy my-dest-folder
This copy action omit the “.svn” folder inside. So all the svn info is not copied. And then, just archive the folder as usual.
tar czvf yourpackage.tar.gz ./yourfolder
more info on svn export:
http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.export.html
Filed under: Uncategorized | Tagged: programming | Leave a Comment »