Ben Chuanlong Du's Blog

It is never too late to learn.

Auto Increment in SQL

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

http://plsql4all.blogspot.com/2014/08/auto-increment-column-in-teradata.html http://stackoverflow.com/questions/21982004/how-to-generate-automatic-number-in-teradata-sql https://forums.teradata.com/forum/enterprise/auto-increment-column

  1. Be careful with batch insert if there is an auto …

Easy-Made Mistake with C++ Iterator

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

the wrong way

for(auto it=l.cbegin(); it!=l.cend(); ++it){
    for(auto jt=++it; jt!=l.cend(); ++jt){
        cout << *it << " <-> " << *jt << endl;
    }
}

it is increased again in the inner …

Immutable String vs Mutable String

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

advantage of immutable string:

trivially thread safe
    more secure
        more memory efficient in most use cases.
            cheap substrings (tokenizing and slicing)

however, if one has to create many small string, e …

Enumeration in Java

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. You can associate values with enumeration elements.

Variables in Java

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. There are 3 different types of variables in Java: instance variables, local variables and argument variables. An instance variables will be initialized to default values if it is not initialized manually …

Convert Math Formula and Table To LaTeX

R

  1. xtable{xtable}

    • Good for converting table to LaTeX code.
  2. latex{Hmisc}

    • Convert R objects (not just tables) to LaTeX code.

Excel

MATLAB

Mathematica

  1. Type in the formula in Mathematica.

  2. Selected the formula.

  3. Right click on selection, and then select "Copy as" -> "LaTeX".

  4. You can also convert formulas to other …