====== 程序/Python笔记 ====== * [[http://www.zeuux.com/blog/content/3030/| python类方法和静态方法]] * [[http://www.sharejs.com/codes/python/7577| PIL提示错误The _imagingft C module is not installed]] * [[http://www.marinamele.com/7-tips-to-time-python-scripts-and-control-memory-and-cpu-usage?utm_source=Python Weekly Newsletter&utm_campaign=2bbc6ad4bc-Python_Weekly_Issue_167_November_27_2014&utm_medium=email&utm_term=0_9e26887fc5-2bbc6ad4bc-312702461|七个测量Python脚本和CPU使用率的技巧]] * [[http://pymotw.com/2/mmap/|mmap文件使用方法]] * [[http://www.huyng.com/posts/python-performance-analysis/|Python性能分析]] * [[http://stackoverflow.com/questions/5597836/how-can-i-embedcreate-an-interactive-python-shell-in-my-python-program|如何在python程序内创建一个交互式Shell]] * [[http://late.am/post/2012/03/26/exploring-python-code-objects|Python Code Object]] * [[http://docs.python-guide.org/en/latest/|python-guide]] * [[http://stackoverflow.com/questions/3068139/how-can-i-sandbox-python-in-pure-python|python sandbox how to]] * [[https://github.com/iki/monkeypatch/blob/master/monkeypatch.py|MonkeyPatch How To]] * [[http://lucumr.pocoo.org/2011/1/22/forwards-compatible-python/|Python2 TO 3]] * [[https://stackoverflow.com/questions/1057431/how-to-load-all-modules-in-a-folder|如何自动load目录下的python模块]] ======= 编码 ======= * [[http://stackoverflow.com/questions/4004431/text-with-unicode-escape-sequences-to-unicode-in-python|处理`text with unicode escape`]] * [[https://stackoverflow.com/questions/57329655/how-to-create-public-rsa-key-using-modulus-and-exponent-for-sign-in-with-apple|How to create public RSA key using modulus and exponent for Sign In with Apple?]] * [[https://stackoverflow.com/questions/3302946/how-to-decode-base64-url-in-python| How to decode base64 url in python with broken padding]] ======= 加密 ======= * [[https://crypto.stackexchange.com/questions/25498/how-to-create-a-pem-file-for-storing-an-rsa-key|How would I encode RSA private key, given that I know the decimal representation of all of its components?]] * [[https://crypto.stackexchange.com/questions/25498/how-to-create-a-pem-file-for-storing-an-rsa-key| How to create a PEM file for storing an RSA key]] ====== TK/TCL ====== * [[http://stackoverflow.com/questions/12014210/python-tkinter-app-adding-a-right-click-context-menu|TK右键菜单]] * [[http://stackoverflow.com/questions/14863353/tkinter-listbox-item-binding|tk右键菜单(选中当前项目)]] ====== Pyramid ====== * [[http://czug.org/pyramid/parameter_configuration.rst|pyramid自定义配置设置]] * [[http://danilodellaquila.com/blog/pyramid-internationalization-howto|Pyramid国际化]] * [[http://stackoverflow.com/questions/13002255/multiple-paths-for-a-route-in-url-dispatch|Pyramid多URL匹配同一视图]] ====== Flask ====== * [[https://exploreflask.com/|ExploreFlask-FLask学习文档]] ====== Django ====== * [[https://code.djangoproject.com/ticket/22280|Django1.7+ 解决同一个model被注册两次的冲突问题]] * [[https://docs.djangoproject.com/en/1.8/topics/auth/default/#auth-web-requests|利用django自带的注册和登录view]] * [[http://www.obeythetestinggoat.com/using-the-built-in-views-and-forms-for-new-user-registration-in-django.html|django登录和注册]] ====== WSGI&&HTTP ====== * [[http://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/001386832689740b04430a98f614b6da89da2157ea3efe2000|一篇简单的WSGI科普文]] ====== SQLALChemy ====== * [[http://stackoverflow.com/questions/16947276/flask-sqlalchemy-iterate-column-values-on-a-single-row|优雅的获取一个orm对象的所有字段和值]] * [[http://docs.sqlalchemy.org/en/rel_0_9/core/reflection.html|映射数据库对象]] * [[http://stackoverflow.com/questions/1052148/group-by-count-function-in-sqlalchemy|SQLAlchemy 位运算]] * [[http://stackoverflow.com/questions/1052148/group-by-count-function-in-sqlalchemy|SQLAlchemy Groupby]] * [[http://stackoverflow.com/questions/11632513/sqlalchemy-introspect-column-type-with-inheritance|ORM获知某个字段的类型,用以进行类型自动转换]] * [[http://stackoverflow.com/questions/11596293/bitwise-operator-in-sqlalchemy|SQLAlchemy位操作符]] * [[http://stackoverflow.com/questions/20254795/filtering-time-range-in-datetime-field-in-sqlalchemy|按照时间范围查询SQLAlchemy]] * [[http://stackoverflow.com/questions/7892618/sqlalchemy-delete-subquery |SQLAlchemy调用.delete()出错解决办法]] * [[http://www.keakon.net/2012/12/03/SQLAlchemy%E4%BD%BF%E7%94%A8%E7%BB%8F%E9%AA%8C|SQLAlchemy事务,锁,读写锁]] * [[http://stackoverflow.com/questions/10210080/how-to-disable-sqlalchemy-caching|sql-alchemy-change-isolation-level-to-disable-query-cache 修改mysql-python的隔离级别来让数据能立即被另一个cilent读到 ]] ====== Python库安装 ====== * [[http://stackoverflow.com/questions/5178416/pip-install-lxml-error|lxml-dependencies]] * [[https://packaging.python.org/en/latest/distributing.html|构建Python Wheel ]] * [[https://pythonhosted.org/setuptools/setuptools.html|pypi发布python包]] * [[http://stackoverflow.com/questions/29849892/error-installing-any-module-using-pip-but-easy-install-works|python pip报socket error无法使用]] * [[http://stackoverflow.com/questions/17806485/execute-a-python-script-post-install-using-distutils-setuptools|Python的setup.py PostInstall脚本]] * [[https://www.mail-archive.com/qa@lists.wikimedia.org/msg01594.html|gir-review install meet "pkg_resources.DistributionNotFound: git-review"]] ====== PostgreSQL ====== * [[http://www.ruanyifeng.com/blog/2013/12/getting_started_with_postgresql.html|Pgsql入门]] * [[http://stackoverflow.com/questions/18664074/getting-error-peer-authentication-failed-for-user-postgres-when-trying-to-ge|使用用户名和密码登陆PG]] , 另外也要记住,PG内的默认用户过期时间可能导致无法登录的问题 * [[https://www.cybertec-postgresql.com/en/3-ways-to-detect-slow-queries-in-postgresql/| PostgreSQL 调优和慢查询观察方法]] * [[https://www.drupal.org/docs/7/guidelines-for-sql/logging-slow-sql-queries-server-side-in-postgresql| PG慢查询配置全家桶]] * [[https://www.cybertec-postgresql.com/en/count-made-fast/| PG里如何快速的使用Count功能]] ====== 风格/Best Practice ====== * [[http://docs.quantifiedcode.com/python-code-patterns/index.html|Python Anti-Patterns]] ====== Lua/OpenResty/Kong ====== * [[https://www.lijiaocn.com/%E9%97%AE%E9%A2%98/2018/09/29/kong-usage-problem-and-solution.html#mac%E7%BC%96%E8%AF%91kong%E7%9A%84%E4%BB%A3%E7%A0%81%E6%97%B6unknown-number-type-check-lua_number_-in-luaconfh|kong学习过程遇到的若干问题]] ====== 其他 ====== * [[http://www.linuxsir.org/bbs/thread343108.html|正则表达式排除指定字符串]] * [[http://docs.pylonsproject.org/docs/pyramid/en/latest/narr/urldispatch.html|解决pyramid无法排除指定关键字的问题]] * [[http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html| ffmpeg - 如何输出更好的GIF]] ====== 数据库 ====== * [[https://github.com/ept/hermitage| hermitage - differences of isolation-level between databases]] ===== MySQL ===== * [[http://segmentfault.com/blog/yexiaobai/1190000002432631?utm_source=weibo&utm_medium=shareLink&utm_campaign=socialShare|mysql数据库备份指南]] * [[https://zhaoyixing.coding.me/2018/01/10/mysql-update-safe-md/|mysql商品库存扣减问题总结]] * [[https://dev.mysql.com/doc/refman/5.7/en/innodb-online-ddl-operations.html| MySQL online DDL operations 防止锁表的在线操作指南]] ===== MongoDB ===== * [[http://blog.mongodb.org/post/65517193370/schema-design-for-time-series-data-in-mongodb|schema-design-for-time-series-data-in-mongodb 时序数据在MongoDB中的设计]] * [[http://stackoverflow.com/questions/4057196/how-do-you-query-this-in-mongo-is-not-null|MongoDB中的exist查询和field限制条件里的坑]] * [[http://www.cnblogs.com/cswuyg/p/4355948.html|MongoDB一些不常见的经验]] * [[http://snmaynard.com/2012/10/17/things-i-wish-i-knew-about-mongodb-a-year-ago/|things-i-wish-i-knew-about-mongodb-a-year-ago]] * [[https://docs.mongodb.org/manual/reference/command/count/]errors and problems in mongo count]====== Web%E5%AE%89%E5%85%A8 ====== * %E5%A6%82%E4%BD%95%E5%AE%89%E5%85%A8%E7%9A%84%E7%94%9F%E6%88%90%E5%AF%86%E7%A0%81[[http://security.stackexchange.com/questions/17421/how-to-store-salt|Errors in MongoCount]] * [[https://crackstation.net/hashing-security.htm|CreakStation]] ====== 性能 ====== * [[https://golang.org/pkg/runtime/pprof/| golang performance analysis how to]] * [[http://www.huyng.com/posts/python-performance-analysis/|A guide to python performance analysis]] * [[http://blog.sae.sina.com.cn/archives/4096|MySQL 临时表查询性能优化]] * [[https://developers.redhat.com/blog/2017/11/16/speed-python-using-rust/| speed python using rust]] ====== Low-Level ====== * [[http://www.cnblogs.com/gala/archive/2011/09/22/2184801.html|python struct - 和c交换数据]] * [[https://code.google.com/p/libhjw/wiki/notes_on_greenlet|greenlet实现原理]] * [[https://www.python.org/dev/peps/pep-3119/|使用元类制造新的类型 PEP 3119 -- Introducing Abstract Base Classes]] ====== 并发 ====== * [[http://stackoverflow.com/questions/323972/is-there-any-way-to-kill-a-thread-in-python|处理在python里退出线程]] * [[http://bbs.chinaunix.net/thread-1348355-1-1.html|退出多线程Python程序-Signal见shadow-catcher,setDaemo见这个网址]] * [[http://stackoverflow.com/questions/323972/is-there-any-way-to-kill-a-thread-in-python|一个可被杀死的线程实现]] * [[https://hg.python.org/cpython/rev/c82588ca3a79|Python MultiProcess Forking Bug in 2.x ]] ====== 测试 ====== * [[http://stackoverflow.com/questions/14305941/run-setup-only-once|只运行一次单元测试setUp]] ====== 分布式 ====== * [[http://blog.pythonisito.com/2013/04/mongodb-pubsub-with-capped-collections.html|用mongodb实现消息队列和订阅/推送]] * [[https://github.com/ray-project/ray| Ray - 让分布式执行更加容易的Python框架]] ====== Source Code/AST ====== * [[https://github.com/caioariede/pyintercept|pyintercept 字节码hack]] * [[http://www.dongwm.com/archives/ast-xiang-lisp[?]-yang-zi-ding-yi-dai-ma-xing-wei/|AST - 像lisp一样自定义代码行为]] ====== DevOPS ====== * [[https://github.com/collectd/collectd/issues/716|bug in collectd write_http plugin with python_plugin]] ====== 通信 ====== * [[http://www.douban.com/note/174791641/|非阻塞socket的坑]] * [[http://my.oschina.net/u/593721/blog/186983|close_wait and time_wait for tcp]] * [[http://www.vimer.cn/2009/12/close_wait%E7%8A%B6%E6%80%81%E7%9A%84%E4%BA%A7%E7%94%9F%E5%8E%9F%E5%9B%A0%E5%8F%8A%E8%A7%A3%E5%86%B3.html|socket编程中 避免产生close wait状态一直持续]] * [[https://stackoverflow.com/questions/2719017/how-to-set-timeout-on-pythons-socket-recv-method|tcp链接设置默认timeout(影响read跟connect的timeout)]] ====== Windows ====== * [[https://groups.google.com/forum/?utm_source=digest&utm_medium=email#!topic/python-cn/O59tDML0pKA|访问windows剪贴板和截屏按钮]] ====== 打包/发布 ====== * [[http://peterdowns.com/posts/first-time-with-pypi.html|发布到Pypi]] ====== 安全 ====== * [[http://stackoverflow.com/questions/7406102/create-sane-safe-filename-from-any-unsafe-string|create sane-safe-filename-from-any-unsafe-string]] ====== 内存泄漏 ====== * [[https://stackoverflow.com/questions/15350477/memory-leak-when-using-strings-128kb-in-python/15452610#15452610|memory leak when using strings 128kb in python]] ====== 区块链 ====== * [[http://adilmoujahid.com/posts/2018/03/intro-blockchain-bitcoin-python/?utm_source=wanqu.co&utm_campaign=Wanqu+Daily&utm_medium=website| Python做区块链tutorial]] ====== 打包 ====== * [[http://pyinstaller.readthedocs.io/en/stable/development/venv.html| pyenv with pyinstaller]] * [[https://hackernoon.com/the-one-stop-guide-to-easy-cross-platform-python-freezing-part-1-c53e66556a0a| the-one-stop-guide-to-easy-cross-platform-python-freezing]] ====== 消息队列 ====== * [[https://gitbook.cn/books/5ae1e77197c22f130e67ec4e/index.html| 详解kafka的架构和可靠性细节]] ====== 生产力工具 ====== * [[https://stackoverflow.com/questions/20308794/how-to-upgrade-to-virtualbox-guest-additions-on-vm-box| 用vagrant插件更新vagrant的vbox guest tools]] ====== Bitcoin/Blockchain ====== * [[https://bitcoin.stackexchange.com/questions/11139/how-is-the-network-hash-rate-calculated| Hashrate怎么算]] * [[https://zhuanlan.zhihu.com/p/32739785| 区块难度,Hashrate之间的关系和计算方法]] ===== 构建矿池和矿池攻击 ===== * [[https://bitcoin.stackexchange.com/questions/11562/cheating-on-pooled-mining|流行的矿池攻击和防范分析]] * [[https://bitcoin.stackexchange.com/questions/11562/cheating-on-pooled-mining| cheating on pooled mining]] * [[https://bitcoin.stackexchange.com/questions/1338/how-is-block-solution-withholding-a-threat-to-mining-pools|How is block-solution-withholding a threat to mining pools]] ===== 图形图像/OpenCV ===== * [[https://towardsdatascience.com/color-identification-in-images-machine-learning-application-b26e770c4c71| 使用Python实现按颜色搜索]] ===== 设计模式 ===== * [[https://refactoringguru.cn/design-patterns/|图解设计模式,非常清晰易懂的资料]]