CoolMind


If you cannot measure it, you cannot improve it.

Revisit compare in map and set

map and set are two common associative containers. By default, common data types can be directly used as the key and their comparing method is std:...

Python closure

Python closure usually makes code simpified and are used in functional programming style. It starts with a keyword lambda and the last statement is...

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 c...

Move subdirectory of a git repository and keep commit message

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 ...

Common functions implemented using STL

Introduction Count lines String trim Convert case Split and Join strings Filter Map Reduce Introduction STL provides a lot of u...

SuperTAB and YouCompleteMe compatibility

SuperTAB YouCompleteMe Problems SuperTAB SuperTAB Github YouCompleteMe YouCompleteMe Github Problems StackExchange SuperTAB and ...

Generate random numbers in C++

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 w...

setup.py in Python

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 upload...