主要参考 java4python “Learn Java: Programiz” app 上的小课. Just a quick review.
C++ 初步: 简化版
Shell 脚本简要
主要参考
- Shotts, W. (2019). The Linux command line
学习目标: 能写简单脚本, 能看懂长一些的脚本. Shell 脚本不是开发语言, 难以 debug, 不适合写太长.
If you are writing a script that is more than 100 lines long, or that uses non-straightforward control flow logic, you should rewrite it in a more structured language now. Bear in mind that scripts grow. Rewrite your script early to avoid a more time-consuming rewrite at a later date. (Google Shell Style Guide)
Python 装饰器杂录
装饰器基础, 以及常用装饰器略了, 比如 staticmethod
, classmethod
, property
, functools.lru_cache
.
Python 的 web 相关库杂录
Triton Inference Server 简要
NVIDIA 的 Triton Inference Server.
把模型文件 (支持主流格式) 放在 model repo, 由 inference server 调度, 根据模型配置的推理引擎 (ONNX, TensorRT 等) 输出结果.
下面以在 CPU 上部署 ONNX 模型为例.
狮子与基督徒问题, 以及其他追及问题
狮子与基督徒问题 一头狮子和一个基督徒在古罗马圆形竞技场中以相同的最大速度移动. 狮子能在有限时间内抓到基督徒吗? (为什么牵扯到基督徒可以参考 这里.)
上个世纪 30 年代德裔英国数学家 Richard Rado 提出了上述问题, 称为狮子与人问题 (Lion and Man problem). 把这个问题当做数学问题, 作以下假设:
- 不考虑体力等现实因素
- 狮子和基督徒各为一个点 (没有体积)
- 竞技场为闭圆盘 (后面会改变这个假设)
CRF 复习
回顾经典, 仔细写一下.
原论文
- Lafferty, J., McCallum, A., & Pereira, F. C. (2001). Conditional random fields: Probabilistic models for segmenting and labeling sequence data.
条件随机场 (conditional random field, CRF) 是一种判别式无向概率图模型, 在机器学习中最常见的应用是序列标注.
Docker 简要: 部署 Python 应用简例
Introduction
Why did Docker decide to go with a whale for their logo? Apparently to express its product’s values of expedition, automation, encapsulation and simplification. As they explain “the whale is carrying a stack of containers on its way to deliver those to you”.
下面改编自 官方教程. 总得来说, Dockerfile 类似脚本, 记录了构建镜像 (文件) 的指令. 运行着的镜像称为容器 (类似进程). 而 docker-compose.yml 记录了运行镜像的参数配置 (类似用 shell 脚本记录命令行).
租房 checklist
先看微信小程序「暖房直租」上的避坑指南, 下文是一些自己补充的 checklist.
想象一些关键生活场景, 比如洗漱, 工作, 睡觉, 做饭, 锻炼, 购物等, 然后制定 checklist.