美国普罗米修斯--奥本海默传

最近一个月读了 Kai bird 和 Martin J. Sherwin 的《American prometheus》,这本书是著名物理学家奥本海默的传记,详细讲述了奥本海默的一生。为了写这本书,作者花了 25 年的时间,做了很多采访,查看了很多 FBI 关于奥本海默的资料。这本书是关于奥本海默的权威著作,2005 甫一问世, 2006 年就获得了普利策奖(传记类)

LeaderF settings

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.

Note on font size

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.

pip bad interpreter issue

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:

Using Multiprocessing in Python

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.

Note on Using requests package

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.