Issue 364

原文: PyCoder’s Weekly - Issue #364 尝试 Python 3 用 asyncio 来并发 REAL PYTHON video Learn how to speed up your Python 3 programs using concurrency and the asyncio module in the standard library. See step-by-step how to leverage concurrency and parallelism in your own programs, all the way to building a complete HTTP downloader example app using asyncio and aiohttp. (是也乎: 叕一则, REAL PYTHON 的嗯哼, 难道, 周刊已经被收购了? ) Python 用于拍摄黑洞照片 MIKE DRISCOLL “Scientists have used a new algorithm to take a photo of a black hole. One of the most exciting parts about it to me is that they used a lot of Python libraries to do the magic.” (是也乎: 虽然 Python 慢, 但是, 想看到黑洞, 还是靠咱… ) Django: 保持逻辑模板(和视图) BLOT.IM Solid advice! Keep your Django templates and views clean by moving application logic into model methods and model managers. 如何不停机在 Django 中重建索引 REAL PYTHON In this step-by-step Python tutorial, you’ll get a solid understanding of the limitations of Django migrations by tackling a well known problem: creating an index in Django without downtime. (是也乎: ) 在 PyCharm的 PyCon Booth 上与 Python 内容创建者们见面 JETBRAINS.COM I’ll be there, the Real Python team will be there, and so will Mike Kennedy from Talk Python, Brian Okken from Test & Code, Matt Harrison, the PyBites team, Chris Medina, and Miguel Grinberg. Be sure to stop by and say hi :) Thanks JetBrains! list.sort() 嗯哼 sorted(list) FLORIAN DAHLITZ Taking a closer look at Python’s built-in list sorting methods with regards to memory consumption and time efficiency. Nice writeup! PyCon 2019 接近售磬 PYCON.BLOGSPOT.COM Get your ticket before it’s too late :) 讨论 Discussions ...

2019-04-17 · 4 min · 1671 words · ZoomQuiet

Elixir Weekly #144

原文: ElixirWeekly - Elixir Community Newsletter, one email every Thursday. Every Thursday: No frills, no click-through, no spam. 当周 不老药 This week in Elixir Phoenix 的 Params 模块 The Params modules pattern can be used in Phoenix to validate and massage a controller action’s params into data that can be passed to contexts. (是也乎: 所谓中间件模块 ) 使用 GenServer 进行夜间任务 Eric set up a nightly process that uses OTP primitives to run nightly tasks for his games. Nice! (是也乎: 只是为了游戏刷分? ) ExDoc v0.20 Wojtek wrote about keyboard shortcuts, autocompletion, full-text search, and other stuff in the latest version of ExDoc. Micro: 读取 elixir 中的 cmd pipes Regis wrote a blog post about reading pipes from the command line in Elixir CLI tools. 清理 Phoenix 控制器操作 Damon writes about a pattern he came across that helps when you need to pass a lot of variables to the view / template. (是也乎: 在 Elixir 中, 多少算大量? ) Elixir 协议,它们如何工作? erlang 的观点 Mariano gives “the erlang perspective” on protocols in Elixir. 📆🐍 社区 Even more from around the Elixir community ...

2019-04-11 · 1 min · 448 words · ZoomQuiet

Issue 363

原文: PyCoder’s Weekly - Issue #363 PEP 570 (仅位参数)已被接受 PYTHON.ORG This PEP introduces a new syntax, /, for specifying positional-only parameters in Python function definitions. Looks useful for getting tighter control over how a library API can be called (i.e. preventing positional params from being called as keyword arguments). This will also allow for some function call speed optimizations in the future. (是也乎: 严格参数传输,以便优化…反正就是越来越 C++ 呗… 老爹一退休就乱来. ) 惯用式 Pandas: 你可能不知道的技巧和特征 REAL PYTHON video In this series you’ll see how to use some lesser-used but idiomatic Pandas capabilities that lend your code better readability, versatility, and speed. (是也乎: 忘记的就是不重要的 不知道的就是不必要 当然世界并不是这样 ( ̄▽ ̄) ) 用 PyCharm 成为 Python 大狮 JETBRAINS sponsor PyCharm is the Python IDE for Professional Developers by JetBrains providing a complete set of tools for productive Python, Web and scientific development. Be more productive and save time while PyCharm takes care of the routine. (是也乎: 通过 IDE 变成 guru ? 喝多了… ) 本地 LRU 缓存 MOSHE ZADKA How to avoid shared global state when using the functools.lru_cache decorator from the standard library. Python 3.7 使用慢加载 INADA NAOKI CPython 3.7 has a new feature (-X importtime) for profiling import time and this article gives you a good overview on how to use this to reduce application startup time. AvantPy: 友好的追溯 ANDRÉ ROBERGE AvantPy provides friendlier Python tracebacks, translated into various languages, to help beginners learn programming. Right now the project is still in its early stages and the maintainer is looking for contributors. (是也乎: 早期…寻求志愿者… 只是, 这种追踪代码运行状态, 对于初学有什么帮助? ) 讨论 Discussions ...

2019-04-10 · 3 min · 1349 words · ZoomQuiet

Postgres Weekly : Issue 229

原文: Postgres Weekly Issue 299: April 3, 2019 Postgres 获得 ‘Generated Column’ 支持 Peter Eisentraut It’s always great to see Postgres gaining support for an SQL-standard feature and this commit begins with a simple example of how one type of generated column will work in the future. MySQL 5.7 introduced a similar feature and SQL Server calls them computed columns. 用 pg_dump / pg_restore 进行 Postgres 升级 Jobin Augustine, Vallarapu, et al. Last time they looked at using pg_dumpall, now it’s pg_dump and pg_restore’s turn under the spotlight. 在 PostgreSQL 数据库中监控的度量标准 InfluxData sponsor There are several key metrics you’ll want to keep track of when it comes to database performance, and they’re not all database-specific. (是也乎: 这种很搭的赞助商才对味儿 ) 2019 年 PostgreSQL 趋势报告 ScaleGrid A multi-cloud DBaaS provider surveyed users at last month’s PostgresConf and shares the results here. AWS comes in as the most popular cloud platform to host Postgres on and cost is the biggest reason to choose Postgres. 就等 PostgreSQL 12: REINDEX CONCURRENTLY Hubert depesz Lubaczewski In Postgres 12, the REINDEX command (which rebuilds an index from a table’s current data) gains an option to have it build the index in the background and switch it into play upon completion. 用 TimescaleDB 为 PostgreSQL 的 Azure 数据库就物联网和时间序列工作负载提供动力 Sunil Kamath (Microsoft) A new partnership with Timescale that introduces support for TimescaleDB (a Postgres extension that focuses on time-series support) on Azure for customers building IoT and time-series workloads. 如何将大规模并行 Postgres 数据库迁移进 Kubernetes Oz Basarir (Pivotal) Pgpool-II 4.1 中的语句级负载平衡 PgPool Migra: Like diff But For Postgres Schemas Robert Lechte Written in Python and can be used from your own Python scripts or the command line. (是也乎: 哈, Python 喜欢干的事儿… ) ActiveRecordExtended 1.0: Adds Additional Postgres Functionality to Ruby’s Active Record George Protacio-Karaszi Active Record, as commonly used in Ruby on Rails apps to interact with databases, is naturally database agnostic but Postgres has so many extra querying features it’s a shame not to be able to use them. This gem adds things like array and JSON querying, CTEs, and unions to the mix. repmgr 4.3 发布 2ndQuadrant A popular tool for replication and failover management that includes several usability improvements in this release. 社区/活动 🗓 Upcoming Postgres Events ...

2019-04-04 · 2 min · 616 words · ZoomQuiet