Sample codes and tricks to many different problems