Posted on May 17, 2009 by kurniawano
After I upgraded to Kubuntu Jaunty, I experienced a random hangs or crash, I can move my mouse, but nothing respond if I click. It seems to be the problem of the intel driver. I followed the instruction given here, and adding UXA in xorg.conf helps to solve my problem:
http://ubuntuforums.org/showthread.php?p=7293212#post7293212
Filed under: Uncategorized | Tagged: kubuntu, linux, ubuntu | Leave a Comment »
Posted on May 6, 2009 by kurniawano
I got this error when I compile a class:
undefined reference to `vtable for Device’
it turns out that GCC requires every virtual function to be defined, so I need to add an inline {} just to satisfy this.
virtual void setGridSpc(double a){};
instead of
virtual void setGridSpc(double a);
Filed under: Uncategorized | Tagged: c++ | 2 Comments »
Posted on May 6, 2009 by kurniawano
Some Ground rules:
1. Keep class data members private.
2. About global name space:
- Avoid data with external linkage at file scope: put all global variables in a structure, class, namespace, etc. This is to avoid name collison.
- Avoid free functions at file scope in .h files, avoid free functions with external linkage in .c files.
- Avoid [...]
Filed under: Uncategorized | Tagged: c++ | Leave a Comment »
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 »