This post continues my previous post on nifty Nvim/Vim techniques.

I want to use a custom highlight group for yank highlighting. Initially I use the predefined highlight group IncSearch. I thought it a bit dim and want something brighter. So I defined the following highlight group:

As a Neovim user who writes frequently, I want to use Neovim to check my grammar before posting it in my blog. In this post, I will compare several plugins used for grammar checking. Under the hood, they all use the opensource tool languagetool.

When we are working on a real project, we may want to know from which commit a particular line is introduced.

Tqdm is a popular pakcage to show progress bar when executing a loop. Here are a few issues and tips when using tqdm.

Some commonly used Git commands related to branch operations.

LeaderF is Vim/Neovim plugin to fuzzy-search files, colorschemes, tags etc. quickly. It works across different platforms flawlessly. Here are some of its settings to address minor issues.

In Python, context manager is a great way to handle the closing of resources. It makes sure that resources are correctly closed after their use.

Sometimes, we may want to add surrounding color to text strokes in Python. Prior to version 6.2.0, we can not do this in Pillow. Fortunately, starting from version 6.2.0, pillow now supports text outlines natively in the ImageDraw.text() method.

In maskrcnn-benchmark, there is some config parameters about warmup in solver (WARMUP_FACTOR, WARMUP_ITERS, WARMUP_METHOD ). What is warmup, and how does it work?

MIUI 12 更新以后，新增了更加细致的权限管理和隐私保护功能。

Relationship between point and pixel size In digital typography, the size of text is commonly specified in points (pt). What is a point? A point is 1/72 of an inch (25.4 mm), i.e., 0.3528 mm (25.4/72). Therefor, point is a physical unit that has absolute value. Pixels are the smallest unit on screen to display images and graphics. It is not a physical unit. So there is no fixed relationship between point and pixel.

I am using pip installed via minconda. I installed it under ~/miniconda3 and then move the installation directory to ~/tools/miniconda3. After that, I changed the PATH accordingly. However, when I use pip, I am seeing the following error:

One of the ways to achieve parallelism is to use multi-processing, where we can execute tasks in different cores of the CPU to reduce the total processing time. Python provides the multiprocessing package to facilitate this.

This post summarizes some the questions I have when I learn to use multiprocessing in Python.

A list of Linux command for common operations.

I found a strange issue when I want to get the value of variable from Python script.

How to see request header and body? When making requests, we may want to see exactly what are being requested. With requests, it is easy do access the request header and request body: import requests url = "http://httpbin.org/post" payload = {"apple": 10, "pear": [20, 30], "img": "http://example.com/demo.jpg"} r = requests.post(url, json=payload) print(f"request headers: {r.request.headers}") print(f"request body: {r.request.body}") A sample output is: request headers: {'User-Agent': 'python-requests/2.19.1', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Length': '69', 'Content-Type': 'application/json'} request body: b'{"apple": 10, "pear": [20, 30], "img": "http://example.

In this post, I will share how PyTorch set the number of the threads to use for its operations.