Algorithms
Binary Tree Paths
思路: 递归
1 | /** |
1 | class Solution { |
看到一个一行搞定的答案:
1 | class Solution { |
Review
本周阅读英文文章 Building a Music Recommendation Engine with Probabilistic Matrix Factorization in PyTorch
Technique
使用joblib提供基于磁盘的简单缓存,并且支持非常大的numpy数组,首先安装joblib库:
1 | pip install joblib |
使用装饰器Memory.cache来存储函数结果:
1 | from joblib import Memory |
看一下save的目录结构:
1 | tree -h |
当在类中使用时,只需要:
1 | class Foo(object): |
Share
使用iperf3测试网络带宽
1 | git clone https://github.com/esnet/iperf.git |
iperf必须安装在链路的两端: 服务器端和客户端,在安装好之后启动服务端:
1 | iperf3 -s |
然后启动客户端连接服务器,生成吞吐量统计:
1 | iperf3 -c 192.168.1.2 |
还有很多好玩的选项,组合使用很强大。