Ben Chuanlong Du's Blog

And let it direct your passion with reason.

Common Mistakes in C++ Code and Ways to Debug

Debugging

  1. gdb is a excellent command tool for debugging C/C++ code.

Syntax Mistakes

  1. Missing "}". When this happens, you usually get lots of error message when you compile your code. And these error messages are often hard to understand and seems not related to your code.

  2. Missing template arguments. This …

Power Settings in Linux with GNOME Desktop

Full control of the power settings in Linux with Gnome Desktop can be done through dconf-editor at org->gnome->settings-daemon->plugins->power. The default way to determine low battery, critical low battery and to carray out critical low action is by counting left battery time. You can change the way …

Estimation of False Discovery Rate using Sequential Permutation Pvalues

I wrote a paper on sequential permutation test with Tim Bancroft and Dan Nettleton. The paper "T. Bancroft, C. Du and D. Nettleton (2012). Estimation of False Discovery Rate Using Sequential Permutation P­Values." has been accepted by Biometrics. To illustrate ideas in the paper and make sequential permutation test …

Dual Monitor for Linux Desktop

  1. Type xrandr or xrandr -q in terminal to dispaly information of all available output device. Then you can use the following commands to set dual display.
    xrandr --output VGA1 --auto 
    xrandr --output VGA1 --same-as LVDS1 --auto
    xrandr --output VGA1 --mode 1024x800
    xrandr --output VGA1 --off
    

where VGA1 and LVDS1 should …