Ben Chuanlong Du's Blog

And let it direct your passion with reason.

Debug Python Project in Visual Studio Code

Ways to Open a Command Palette

  1. Use Menu Menu -> View -> Command Palette....
  2. Use the shortcut Shift + Command + P (on macOS).

Command Palette

You can search for commands in the Command Palette, which makes things very convenient.

Run Tests or a Python File

  1. Open the Command Palette.
  2. Search for Python: Run in the …

Collections and Iterators in C++

Collections

  1. Prefer std::deque to std::vector when the size of the collection is unknow.

  2. Suppose set A and B are two set with the same type and set C is another set with the same value type but a different comparison function, then it is still valid to insert …

Python Logging

General Tips

  1. logging is a Python module for logging coming with the standard library while loguru is a popular 3rd-party logging library. Unless you do not want your Python package/script to depend on 3rd-party libraries, loguru is preferred to logging for multiple reasons.

    • loguru is easy and fun to …