今天是大年初一,虽然一个多礼拜没洗澡了,但身上的水痘好多了,趁着有大块的空闲时间,来写写年终总结。
OrderedDict和dict区别
Some differences from dict still remain:
- The regular dict was designed to be very good at mapping operations. Tracking insertion order was secondary.
- The OrderedDict was designed to be good at reordering operations. Space efficiency, iteration speed, and the performance of update operations were secondary.
- The OrderedDict algorithm can handle frequent reordering operations better than dict. As shown in the recipes below, this makes it suitable for implementing various kinds of LRU caches.
- The equality operation for OrderedDict checks for matching order.
collections模块
一.Counter计数
1.查询某元素出现次数、查询出现此次最多的n个元素
1 | from collections import Counter |
Python基础常用技巧
2021年终总结与来年规划
姗姗来迟的年终总结,因为年末的跳槽,因为自己的懒惰,因为各种琐事,没有一个合适的时机静下心来和自己对话,所以一直拖到现在
想想2021年,似乎除了年末的换工作,并没有什么谈得上的大事,生活真的就像似水流年一样,不经意间就过去了,只能又去微信和豆瓣上翻翻,才恍然大悟”哦,原来是那个时候的事请哦”
Mac M1 安装 NVM
1.下载安装nvm
1 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash |
2.在.zshrc中配置环境变量
1 | export NVM_DIR="$HOME/.nvm" |
Hexo 相关问题汇总
1.TypeError [ERR_INVALID_ARG_TYPE]: The “mode” argument must be integer. Received an instance of Object
解决:hexo 不支持最新 node14+,降低node版本到12
[email protected]: Permission denied (publickey).fatal: Could not read from remote repository.
解决:将.ssh目录下的id_rsa.pub加到Github ssh key中
命令:将公钥复制到剪贴板:pbcopy < ~/.ssh/id_rsa.pub