上一页 1 2 3 4 5 6 ··· 27 下一页
摘要: 方法 1. HTTP/2用":authority"头部代替"Host"头部。 2. Chrome F12里面,HTTP/1.1有"view source",而HTTP/2是binary,没有"view source"。 3. Chrome F12 Network里面设置"Protocol"。 4. 阅读全文
posted @ 2019-12-10 14:45 Rocin 阅读(2911) 评论(0) 推荐(0) 编辑
摘要: 环境 Deepin Linux 15.11 Django 2.2 pymysql0.9.3 原因 因为用pymysql替换了默认的mysqlclient,Django官方推荐的数据库API driver是mysqlclient。 https://docs.djangoproject.com/en/2 阅读全文
posted @ 2019-10-28 18:22 Rocin 阅读(3451) 评论(0) 推荐(0) 编辑
摘要: docker镜像存储位置 例如我的driver是overlay2,则docker镜像的实际存储在/var/lib/docker/overlay2文件夹里面。 ls和du的不同 显示文件的大小或文件夹的 的大小。所以在 时,元数据存储在一个block里面,一个block的大小(4.0K),而不显示里面 阅读全文
posted @ 2019-10-09 23:42 Rocin 阅读(4548) 评论(0) 推荐(0) 编辑
摘要: 1. reversed() 2. range(len(a) 1, 1, 1) 3. range(len(a)) + ~操作符 ~按位取反运算符:对数据的每个二进制位取反,即把1变为0,把0变为1 。~x 类似于 x 1 4. slice 5. length i 1 阅读全文
posted @ 2019-10-04 00:16 Rocin 阅读(9073) 评论(0) 推荐(0) 编辑
摘要: 安装步骤 切换至root 安装依赖库 下载源码包并且解压 编译安装 可能出现的问题 问题1 nginx找不到命令 1.1 如果用的是bash: 1.2 如果用的是zsh 问题2 加上sudo后,nginx找不到命令 2.1 解决办法1 2.2 解决办法2 查看nginx进程 阅读全文
posted @ 2019-09-26 18:55 Rocin 阅读(404) 评论(0) 推荐(0) 编辑
摘要: 总结 和threading.local()类似。Python3.7新增。 thread.local(): 不同线程,同一个变量保存不同的值。 contextvars: 不同上下文,同一个变量保存不同的值。例如:同一线程,不同的协程或者异步并发的任务(例如asyncio)的情况下同一个变量有不同的值。 阅读全文
posted @ 2019-09-05 12:20 Rocin 阅读(601) 评论(0) 推荐(0) 编辑
摘要: 方法1 pymongo。使用$convert, MongoDB版本 >= 4,速度快。 # 假设{'age': '47'}, 转换后为{'age': 47} import time import pymongo start_time = time.time() handler = pymongo.M 阅读全文
posted @ 2019-08-31 22:54 Rocin 阅读(4104) 评论(0) 推荐(0) 编辑
摘要: 起因经过 今天翻 "collections.abc" 的文档时,我知道list的实例在逻辑上(因为duck typing 鸭子类型)是Container和不能hash的(因为list可变),就试下面的代码是否能行: 我就产生疑惑,问题1来了:list是继承于object, 而collections. 阅读全文
posted @ 2019-08-22 14:47 Rocin 阅读(1792) 评论(0) 推荐(0) 编辑
摘要: 例如正则表达式a(?:b),匹配后没有包含'b'的分组 例如正则表达式:a(b),匹配后有包含'b'的分组 参考 https://stackoverflow.com/a/10804846/5955399 https://docs.python.org/3/library/re.html regula 阅读全文
posted @ 2019-08-20 13:25 Rocin 阅读(1286) 评论(0) 推荐(0) 编辑
摘要: all() any() filter() map() pow() zip() bit_length() bisect.bisect_left() itertools.chain() itertools.from_iterable() itertools.combinations() itertool 阅读全文
posted @ 2019-08-19 00:11 Rocin 阅读(325) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 27 下一页