
Python contextlib
There are some resources we need to release when we finish our job. It is easy for us to forget those operations. Python has a keyword with which can be used to help solve this problem. After we go...

There are some resources we need to release when we finish our job. It is easy for us to forget those operations. Python has a keyword with which can be used to help solve this problem. After we go...

How to extract a subdirectory of a git repository and keep its commit message? If we directly move everything and add them again, we will lose all the history we had. Introduction Generate th...

Introduction Count lines String trim Convert case Split and Join strings Filter Map Reduce Introduction STL provides a lot of useful utilities. They can be used to implement intere...

SuperTAB YouCompleteMe Problems SuperTAB SuperTAB Github YouCompleteMe YouCompleteMe Github Problems StackExchange SuperTAB and YouCompleteMe are both awesome plugins for Vim. S...

Some times we need a random number for sort or as the input of our program. Previously we can use rand() to generate. Since c++ 11, we have a new way to do so. The old way The new way The o...

When we create a python package, we will distribute it. There are a couple of ways to achieve this purpose: by source code by whl by uploading it to pypi The last two methods require us t...

Introduction Common operator Relation Bit operations Elements and attributes Other Examples Introduction Python’s operator module provides us a lot of useful functions. We can write ...

Introduction A simple example Common interfaces Open & close Write data Position Control output formats number related Length and alignment ...

Introduction A simple example Common interfaces Open & close Status related Read data Position related Un-read data Tricks References Introdu...

Introduction open io module io.StringIO/io.BytesIO io.open An interesting example Summary Reference Introduction Most of the time, we will interact with files o...