Ben Chuanlong Du's Blog

And let it direct your passion with reason.

Collections and Iterators in C++

Collections

  1. Prefer std::deque to std::vector when the size of the collection is unknow.

  2. Suppose set A and B are two set with the same type and set C is another set with the same value type but a different comparison function, then it is still valid to insert …

Graphics in LaTeX

  1. Generally PDF figures are preferred for LaTeX code.

  2. There are many useful commands in Linux for converting between different types of figures, e.g., convert, pdf2ps, etc. So it does not matter much which types of figures you produce. You can always convert them into other format when needed.

  3. The …

Abuse of Vector in R

R is a language that is friendly to vector operation, so vector is an important data structure in R. A single data (of basic types, e.g., numeric or character) is essentially a vector of length 1. A matrix or an array in R is essentially a vector. R make …