蟒週刊-410-EOF不是字符

原文: PyCoder's Weekly - Issue #410html

PyCoder

  • 200304 Zoom.Quiet(大媽) 用時 42 分鐘 完成快譯
  • 200304 Zoom.Quiet(大媽) 用時 17 分鐘 完成格式轉抄.

「While it’s easy to immediately be productive with requests because of the simple API, the library also offers extensibility for advanced use cases. If you’re writing an API-heavy client or a web scraper you’ll probably need tolerance for network failures, helpful debugging traces and syntactic sugar.」git

Do you know how an application knows when a read operation reaches the end of a file? In this interesting read, explore what EOF (end-of-file) really is by writing your own version of the Linux cat command in ANSI C, Python, Go, and JavaScript.web

The double-checked locking pattern is useful when you need to restrict access to a certain resource to stop simultaneous process from working on it at the same time. Learn how to apply this pattern in Django using the ORM and database level locking features.segmentfault

What are Python bindings? Should you use ctypes, CFFI, or a different tool? In this step-by-step tutorial, you’ll get an overview of some of the options you can use to call C or C++ code from Python.數據結構

(是也乎:多線程

Bindings

雖然 Py 們好用又好寫,
可是, 真正比拼的仍是對 C/C++ 們的調用能力,
畢竟這個世界底層是 C 家族的.

)

PyPy has moved the center of their development off Bitbucket and to the new foss.heptapod.net/pypy

(是也乎:

由於 Bitbucket 涼了...
俺的倉庫也得遷移了...

foss.heptapod.net <- GitLab企業版, 無償使用環境...

)

「As of March 2, PyCon 2020 in Pittsburgh, PA is scheduled to happen.」

(是也乎:

技術大會也被疫情了

)

(是也乎:

Pittsburgh PyCon 的宣傳文案來了...

)

討論

Discussions

(是也乎:

被老爹點過名的品牌活動,
如今愈來愈會進行 SNS 營銷了.

)

(是也乎:

開始大討論了...

)

文章,教程和嗯哼

Articles, Tutorials and Talks

「I rewrote the cppyy CMake modules to be much more user friendly and to work using only Anaconda/PyPI packages, and to generate more feature-complete and customizable Python packages using CMake’s configure_file, while also supporting distribution of cppyy pythonization functions.」

(是也乎:

沈遊俠曰過:

每一個程序猿
總會去寫
本身反覆用一輩子的 makefile

實在是 CMake 這工具, 早已就解決了一切自動化編譯問題.

)

Polynomial regression is a core concept underlying machine learning. Learn how to build a polynomial regression model from scratch in Python by working you a real world example to predict salaries based on job position.

Learn how to implement a stack data structure in Python. You’ll see how to recognize when a stack is a good choice for data structures, how to decide which implementation is best for a program, and what extra considerations to make about stacks in a threading or multiprocessing environment.

(是也乎:

pop

打年糕? 這梗用的好.

)

Eric Snow has been working on solving multi-core Python via subinterpreters since 2015. In this article, core developer Victor Stinner discusses how state is passed between interpreters and summarizes his proposal for explicitly passing state to internal C function calls.

(是也乎:

多線程狀態, 這一直是玄學問題哪...
不過, 這也是 PL 重要的科題了...能夠養活不少博士了.

)

A Python programming environment called nbdev, which allows you to create complete python packages, including tests and a rich documentation system, all in Jupyter Notebooks.

(是也乎:

這的確是 IPython 獨立爲 Jupyter 的緣由,

smalltalk

不過想學 smalltalk 們代碼/運行時合體, 還有距離哪

)

Learn about some of the common problems you encounter when dealing with legacy codebases and how to overcome them in an efficient way that balances delivery with code quality.

(是也乎:

俗稱屎山.

)

Python’s enum.Enum does not provide ordering by default. See how ordering can be added to enums and why these orderings are useful in the first place.

(是也乎:

不管字典們內部數據結構多科學,
排序, 仍是平常最多見的期待.

)

Sometimes your code has to take different paths based on the external environment. Make sure that your coverage follows it smoothly.

(是也乎:

爽滑的進行外部目錄依賴變動..
仍是靠人的事先清醒的規劃哪...
)

Learn how to deploy TensorFlow models and consume predictions via gRPC.

(是也乎:

叕見 gPRC ... 因此, 俺一直說:

人生苦短 Python 當歌

)

Plenty of Python in there…

(是也乎:

從 MySQL 到 Apache Druid ,

叕一則技術棧演變故事...

)

(是也乎:

當年, 這但是 Perl 的領域..如今也都是 Py 的了

)

(是也乎:

自動化批量處置 pdf 的好物

)

(是也乎:

很是實用哪...畢竟, 中間有 numpy 在亂來...

)

(是也乎:

分享人, 差點兒覺得是 西貝 ...

)

好物

Interesting Projects, Tools and Libraries, Projects & Code

(是也乎:

想法很好...

惋惜, 用起來太複雜了點兒...

)

(是也乎:

叕一則針對圖形的 ML 框架,
可是, 不是小樣本的..

)

(是也乎:

叕一個 Py->C++ 轉換工具, 不知道靠譜卟

)

(是也乎:

output_6_1

神奇哪, 首次見到在 windows 平臺上完成的示例, 並且老實的將錯誤也記錄下來了:

# load some example data
import pandas as pd
import matplotlib.pyplot as plt
from pydataset import data
from funnelplot.core import funnel

# create a suitable axis
fig,ax = plt.subplots(figsize=(4,6))
ax.set_frame_on(False)

# funnel plot, using 0.5% -> 99.5% interval
funnel(df=data("Caschool"), x="testscr", group="county", percentage=99.5, error_mode="data")

C:\Users\John\Dropbox\devel\funnelplot\funnelplot\core.py:14: RuntimeWarning: invalid value encountered in true_divide
  return band / np.sqrt(group_size)
C:\Users\John\Dropbox\devel\funnelplot\funnelplot\core.py:14: RuntimeWarning: divide by zero encountered in true_divide
  return band / np.sqrt(group_size)

)

(是也乎:

雖然 UML 的理想沒實現, 可是, UML 圖元是真正深刻人心了...
PlantUML 是很是讚的圖形腳本工具, 可是, 畢竟語法很囧;

distributed_control

這樣的圖, DSL 爲:

@napkin.seq_diagram()
def distributed_control(c):
    user = c.object('User')
    order = c.object('Order')
    orderLine = c.object('OrderLine')
    product = c.object('Product')
    customer = c.object('Customer')

    with user:
        with order.calculatePrice():
            with orderLine.calculatePrice():
                product.getPrice('quantity:number')
                with customer.getDiscountedValue(order):
                    order.getBaseValue().ret('value')
                    c.ret('discountedValue')

嗯哼? 也沒好哪兒去哪...對比:

@startuml
participant User
participant Order
participant OrderLine
participant Product
participant Customer

User -> Order : calculatePrice()
activate Order
    Order -> OrderLine : calculatePrice()
activate OrderLine
    OrderLine -> Product : getPrice(quantity:number)
    OrderLine -> Customer : getDiscountedValue(Order)
activate Customer
    Customer -> Order : getBaseValue()
    
    activate Order
    Customer <-- Order: value
    deactivate Order

    OrderLine <-- Customer: discountedValue

deactivate Customer
deactivate OrderLine
deactivate Order
@enduml

)

📆🐍 活動/大會

Events, MeetUp 真的是全球線下活動組織中心

DAMA

❤️ Happy Pythonic ;-( 大媽私人無責任播報)

(是也乎:

2020.2.29 CSDN 繼續線上技術峯會,
大媽, 吐糟完畢:

拙見/ 什麼是自驅力?

現場錄音-> CSDN/遠程辦公大考/大媽主持/吐糟生肉版/fm.101.camp 蟒營™電臺 鉤陳各類值得探討

)

PS:


NN 3942

好文筆,感嘆號年度配額: 1/3


ZoomQuiet/大媽

就是四處 是也乎,( ̄▽ ̄) 的那個大媽:

私自嗯哼: ZoomQuiet (訂閱號: ZoomQuiet42)
公開課程: 蟒營 (訂閱號: Mainium)
全國大會: PyChina (訂閱號: PyChinaOrg)
本地社區: 
    GDG珠海 (訂閱號: GDG-ZhuHai)
    TFUG珠海 (訂閱號: ZH_TFUG)
歷史吐糟: Chaos42 (訂閱號 PythoniCamp)

蟒營™Python入門班 第6期 已開始報名:

  • 報名截止 2020.3.22
  • 正式開課 2020.3.29
  • 按時結束 2020.5.10

報名表

蟒營™式 原創課程服務:

伴你重享學習樂趣

蟒營™:Py入門班/圖譜

Powered by: Zoom.Quiet / 昧因科技®

本文由博客一文多發平臺 OpenWrite 發佈;
相關文章
相關標籤/搜索