上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 27 下一页
摘要: 1.Python中的lambda函数只允许单个表达式,没有流程控制、迭代、异常处理等。 2.lambda表达式中的变量是运行时绑定的 3.想让某个匿名函数在定义时就捕获到值,可以将那个参数值定义成默认参数 阅读全文
posted @ 2018-08-15 08:00 Rocin 阅读(101) 评论(0) 推荐(0) 编辑
摘要: What is it? Splash is a javascript rendering service. It’s a lightweight web browser with an HTTP API http://splash.readthedocs.io/en/stable/ 用途 爬虫方面可 阅读全文
posted @ 2018-08-14 19:53 Rocin 阅读(371) 评论(0) 推荐(0) 编辑
摘要: 动态规划 ≈ 分治法 + memo def memo(func): cache = {} def wrap( args): if args not in cache: cache[args] = func( args) return cache[args] return wrap @memo 注释掉 阅读全文
posted @ 2018-08-14 11:16 Rocin 阅读(164) 评论(0) 推荐(0) 编辑
摘要: ![](https://images2018.cnblogs.com/blog/1310818/201808/1310818-20180806102347205-1996141356.jpg) 阅读全文
posted @ 2018-08-06 10:24 Rocin 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Why 在deepin linux上安装Java很头疼。。 How 于是有了sdk man! https://sdkman.io/ 阅读全文
posted @ 2018-08-03 00:40 Rocin 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 例如在读文件里面的文本时,每一行默认后面有\n或者有\r,所以strip用于去除首尾空格或者回车符。 阅读全文
posted @ 2018-08-02 19:14 Rocin 阅读(5308) 评论(0) 推荐(0) 编辑
摘要: 1. 意志力实际上是“我要做”, “我不要”, “我想要“协同,让我们变得更好。 2. 与意志力有关的区域是前额皮质。灰质越多,意志力越强。 3. 意志力训练:冥想。在脑海中默念”呼“和”吸“,把注意力集中在呼吸上。当走神时,重新集中注意力。至少5分钟。 4. 降低消费者的信息处理能力,就是分散他们 阅读全文
posted @ 2018-07-29 09:43 Rocin 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 生成器本质 生成器是一个可迭代对象,自动实现了迭代器协议。 怎样生成生成器? 两种方法 1. 函数里return改为yield 2. 利用生成器表达式,将列表表达式的[]改为()即可 好处 节省内存 题外话 参考: https://www.cnblogs.com/allen2333/p/937385 阅读全文
posted @ 2018-07-26 20:30 Rocin 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 参考 1. https://foofish.net/how for works in python.html for循环可以迭代一个可迭代(iterable)的对象 原理 1. 生成这个可迭代对象(实现了\__iter__方法的就叫可迭代对象)的迭代器(iter(xx))。 2. 用迭代器协议(实现 阅读全文
posted @ 2018-07-26 19:33 Rocin 阅读(840) 评论(0) 推荐(0) 编辑
摘要: 后台运行(终端能操纵) 只需要在后面加& 查看正在运行的jobs 放到前台运行(终端不能操作) fg % 一个终端一个context。一个终端就是一个父进程,里面的jobs是子进程。所以当一个终端运行jobs时,在另外一个终端输入jobs显示无。 阅读全文
posted @ 2018-07-25 10:09 Rocin 阅读(626) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 27 下一页