Ben Chuanlong Du's Blog

And let it direct your passion with reason.

Working with Class in C++

Illustrative examples for the following discussions can be found here.

  1. It is suggested that you also provide a default constructor if you ever provide a user-defined constructor when writing a C++ class.

  2. If you want to allow deleting a derived class from a pointer of the base class, you have …

Define Operator in R

One thing I do not like R is that operations on String in R are not as convenient as in other programming langauges such as Java, Python and Ruby. In these 3 programming languages, you can simply use + to concatenate strings while in R you have to use the function …