Ben Chuanlong Du's Blog

It is never too late to learn.

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 …

Change File Permission on Linux

R: 4 W: 2 X: 1

Make a directory readable to other people.

chmod 755 dir  

Make a file readable to other people.

chmod 644 file 

Make a directory and all its subcontents readable to other people.

# make the dir and its subcontents readable and executable
chmod 755 -R dir …

English Vocabulary

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

  1. beneficiary

  2. perfunctory

Alike

  1. bimonthly vs semimonthly

  2. every one vs everyone, every thing vs everything, etc.

  3. numeric vs numerical

Culture

chicken: white meant -> breast, dark meat -> leg

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 …

Statistics

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

  1. in real problems, the true value of (some quantity) are usually unknow/defined, even if we can collect data about it, e.g., Amazon goods, what is the true cost of …