TPM Related Codes and Notes