摘要: 缓冲区溢出检测 阅读全文
posted @ 2021-04-25 22:29 AdjWang 阅读(439) 评论(0) 推荐(0) 编辑
摘要: Python 括号层数限制(SyntaxError: too many nested parentheses) 代码 n = 201 s = '(' * n + ')' * n print(eval(s)) 错误信息 Traceback (most recent call last): File " 阅读全文
posted @ 2021-01-12 18:07 AdjWang 阅读(938) 评论(0) 推荐(1) 编辑
摘要: 吞食鱼2(FeedingFrenzyTwo) 修改器 童年回忆系列。小时候特别喜欢玩这类游戏,软件不大,很慢的网速也不会下载太久,然后对配置要求不高,很破的电脑也可以玩得很开心。不过也有糟心的时候啊,大鱼太多,无数次死于挑战咬梭子鱼的尾巴……今年最后一天,就休闲一小会吧。 小时候看不懂是啥意思,现在 阅读全文
posted @ 2020-12-31 18:44 AdjWang 阅读(990) 评论(0) 推荐(3) 编辑
摘要: 问题 cygwin 里的 gdb 没法输入重定向 运行程序的时候用 ./my.exe <cin.txt 就好,但是 gdb 不行。 按照正常 gdb 流程: g++ ... gdb ./my.exe run < cin.txt 但是这个办法仅限 Unix ,在 cygwin的邮件列表 里找到了原因: 阅读全文
posted @ 2020-12-24 22:16 AdjWang 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 最近看到一篇写树莓派缺点的文章,感觉挺不错,就来翻译下(原文链接) [翻译] 树莓派的各种问题 February 2, 2019 | by nachoparker 树莓派价格低廉、应用丰富、扩展性强、社区活跃,所以广受欢迎。到处都是爱好者的作品和褒奖的声音,大多数人就没去关注它的弱点。直到某一天这些 阅读全文
posted @ 2020-11-11 15:29 AdjWang 阅读(1308) 评论(4) 推荐(1) 编辑
摘要: random.choices 函数 python 官方标准库 random 中,有个函数 random.choices(population, weights=None, *, cum_weights=None, k=1),比起常用的 random.choice(seq),这个函数可以指定概率权重和 阅读全文
posted @ 2020-10-31 22:34 AdjWang 阅读(1643) 评论(0) 推荐(0) 编辑
摘要: math.isclose() 函数 今天用到 math.isclose() 函数,发现这个函数有 2 个参数: rel_tol, abs_tol,首先查看官方文档: math.isclose(a, b, *, rel_tol=1e-09, abs_tol=0.0) Return True if th 阅读全文
posted @ 2020-08-23 01:49 AdjWang 阅读(1387) 评论(0) 推荐(1) 编辑
摘要: 失聪电扇 我也不知道它能转多快,反正开了不到一分钟,耳朵快聋了…… 阅读全文
posted @ 2020-06-21 16:04 AdjWang 阅读(134) 评论(1) 推荐(1) 编辑
摘要: 细说 PEP 468: Preserving Keyword Argument Order Python 3.6.0 版本对字典做了优化,新的字典速度更快,占用内存更少,非常神奇。从网上找了资料来看,大部分都指向了 "[Python Dev] More compact dictionaries wi 阅读全文
posted @ 2020-05-05 22:13 AdjWang 阅读(451) 评论(2) 推荐(2) 编辑
摘要: A Coroutines Coroutines are computer program components that generalize subroutines for non preemptive multitasking, by allowing execution to be suspe 阅读全文
posted @ 2020-04-25 01:17 AdjWang 阅读(163) 评论(0) 推荐(0) 编辑