Speed up Python and Node.js builds on Travis CI
For Python and Node.js projects, you could totally cache both site-packages and node_modules directories in every Travis CI build.
For Python and Node.js projects, you could totally cache both site-packages and node_modules directories in every Travis CI build.
get_or_create() 拋出 IntegrityError 但是接著 get() 一次卻會是 DoesNotExist,以上的錯誤常常會發生在 MySQL 的 isolation level 是 REPEATABLE READ 的情況下。MySQL 默認採用 REPEATABLE READ(而 PostgreSQL 預設是 READ COMMITTED)。
A non-repeatable read occurs, when during the course of a transaction, a row is retrieved twice and the values within the row differ between reads.
Internationalization and localization for your Django project.
If you pass a mutable object into a method, the method gets a reference to that same object and you can mutate it to your heart's delight, but if you rebind the reference in the method, the outer scope will know nothing about it, and after you're done, the outer reference will still point at the original object.
If you pass an immutable object to a method, you still can't rebind the outer reference, and you can't even mutate the object.