matplotlib ---- python plotting library
转换 绘制结果成 np.ndarray
https://stackoverflow.com/questions/7821518/matplotlib-save-plot-to-numpy-array
字符串方式
- fig.canvas.tostring_rgb
np.fromstring
1 2 3 4 5 6 7 8 9 10 11 12 13 14import matplotlib.pyplot as plt import numpy as np # Make a random plot... fig = plt.figure() fig.add_subplot(111) # If we haven't already shown or saved the plot, then we need to # draw the figure first... fig.canvas.draw() # Now we can save it to a numpy array. data = np.fromstring(fig.canvas.tostring_rgb(), dtype=np.uint8, sep='') data = data.reshape(fig.canvas.get_width_height()[::-1] + (3,))
ByteIO 方式
- fig.savefig(byteioObj, format='png', dpi=180)
- byteioObj.seek(0)
- numpy.frombuffer(byteioObj)
cv2.cvtColor
Emacs Editing Commands
M-z zap-to-char
- 剪切到后面第一次出现给定的字符
M-c capitalize-word
- 给定单词,首字母大写
M-l downcase-word
注意
光标生效位置
- 单词的开头
完成操作后,光标位置
- 单词尾部
M-u upcase-word
C-x C-l downcase-region
- 全部转成小写
C-x C-u upcase-region
- 全部转成大写
M-s isearch prefix 搜索
M-s .
- isearch 光标下的 symbol(单词)
M-s _
- isearch symbol
M-s w isearch
- 搜索单词 word
M-s o search occured symbol
- 右侧弹出搜索结果
M-s h highlight prefix 高亮
M-s h .
- 高亮当前 symbol
M-s h u
- 取消高亮
M-h M-w eww search
M-r 在 top, middle, bottom 三个位置移动光标
- 类似 vim 命令 H, M, L
markdown ---- a simplified notes making markup language
教程
链接和图片
链接
| |
operators ---- python operator overloading Python 运算符重载
python 运算符 与 特殊函数对应关系
in —- $__contains__$
https://docs.python.org/3.6/reference/expressions.html#in
注意
对于 builtin.list 类型
- 内部比较的好像是引用
| |
lombok notes
@Getter and @Setter
https://projectlombok.org/features/GetterSetter
作用目标
- 类
- 字段
生成 gettter 名称
普通类型
- foo –> getFool()
boolean
- foo –> isFool()