Ben Chuanlong Du's Blog

It is never too late to learn.

String in SQL

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

Teradata

regexp_instr REGEXP_LIKE REGEXP_REPLACE REGEXP_SUBSTR

  1. trim trim specified pad characters or bytes from a character or byte string

  2. like %, _ like, case-insensitive You can also like any (pattern_1, pattern_2, ...) like all …

Primary Key vs Index in SQL

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

  1. index is for distribution data index does not have to be unique

  2. primary key must be unique and non null

  3. primary keys are automatically indexed

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.