摘要:
Metaclasses https://www.python.org/dev/peps/pep-3115/ 元类的诞生是来自于大量有趣的用例, 要求在类创建的过程中,就可以参与到类的定制逻辑中去。 The primary reason for changing the way metaclasses
阅读全文
posted @ 2021-10-10 23:50
lightsong
阅读(124)
推荐(0)
摘要:
https://docs.djangoproject.com/en/3.2/misc/design-philosophies/#cache-design-philosophy Loose coupling 低耦合 高内聚-低耦合是其设计目标。 不同的层不需要知道其它层, 除非是绝对必要。 例如: 模
阅读全文
posted @ 2021-10-01 22:49
lightsong
阅读(108)
推荐(0)
摘要:
Architecture 实现前后端分离架构: 网页静态资源, 由nginx直接响应。 DJANGO脚本资源的请求, 由uWSGI服务器处理。 https://decovar.dev/blog/2019/11/03/nginx-uwsgi-python-scripts/#nginx-server-c
阅读全文
posted @ 2021-09-26 00:42
lightsong
阅读(165)
推荐(0)
摘要:
master-worker模式 https://blog.csdn.net/u012845099/article/details/78463324 Master-Worker模式是常用的并行模式之一,它的核心思想是,系统有两个进程协作工作:Master进程,负责接收和分配任务;Worker进程,负责
阅读全文
posted @ 2021-09-24 11:23
lightsong
阅读(522)
推荐(0)
摘要:
Supervisor 是一个CS架构的软件系统, 支持用户监控和控制大量的进程, 具有跨系统性, 在所有的类UNIX系统上。 不是对系统驻守进程管理器的代替, 它的目的是用用控制一个项目或者用户相关的进程。 此进程在系统初始化时候启动。 http://supervisord.org/index.ht
阅读全文
posted @ 2021-09-22 16:23
lightsong
阅读(152)
推荐(0)
摘要:
Buffon's Needle https://mste.illinois.edu/activity/buffon/ 介绍 + 模拟 Buffon's Needle is one of the oldest problems in the field of geometrical probabili
阅读全文
posted @ 2021-08-12 00:47
lightsong
阅读(350)
推荐(0)
摘要:
dest https://docs.python.org/3/library/argparse.html#dest dest用于指定解析后将参数值,存储到参数表中的参数名称, 简称存储参数名。 dest本身是add_argument参数之一 The name of this attribute is
阅读全文
posted @ 2021-08-09 22:04
lightsong
阅读(153)
推荐(0)
摘要:
Integration with FastAPI and APScheduler https://www.cnblogs.com/lightsong/p/15054120.html 上篇博文,介绍了如何给 API Server添加 APScheduler, 以便之后后台的定时任务。 但是这里有一个问
阅读全文
posted @ 2021-08-08 00:23
lightsong
阅读(686)
推荐(0)
摘要:
Getting Started With Async Features in Python https://realpython.com/python-async-features/#:~:text=%20Using%20Python%20Async%20Features%20in%20Practi
阅读全文
posted @ 2021-08-07 21:58
lightsong
阅读(116)
推荐(0)
摘要:
Background 大部分的框架,要么只支持 restful API, 要么只支持CLI。 例如: fastapi 或者 django_rest_framework 支持rest API click 支持将函数装饰为 CLI 特殊情况,需要两种都要支持。即一份代码, 同时支持两种接口。 hug就是
阅读全文
posted @ 2021-08-03 23:56
lightsong
阅读(215)
推荐(0)
摘要:
supplychain on blockchain 每个公司都有自己的供应链, 过程中产生的交易数据, 如果存在其中参与方的一方服务器中, 并不能像银行的一样, 能够给各方产生一个信任的效果,因为任何一方都会担心数据的拥有这改变数据。 区块链天生具有不可篡改, 去中心化的特性, 可以解决供应链中各个
阅读全文
posted @ 2021-08-03 17:59
lightsong
阅读(111)
推荐(0)
摘要:
xstate https://xstate.js.org/docs/ https://github.com/statelyai/xstate 为现代的web提供有限状态机功能。 JavaScript and TypeScript finite state machines (opens new wi
阅读全文
posted @ 2021-08-02 23:09
lightsong
阅读(516)
推荐(0)
摘要:
PI https://www.mathsisfun.com/numbers/pi.html Draw a circle with a diameter (all the way across the circle) of 1 Then the circumference (all the way a
阅读全文
posted @ 2021-08-01 22:14
lightsong
阅读(1501)
推荐(0)
摘要:
Gunicorn https://docs.gunicorn.org/en/latest/index.html https://github.com/benoitc/gunicorn Gunicorn ‘Green Unicorn’ is a Python WSGI HTTP Server for
阅读全文
posted @ 2021-07-25 00:26
lightsong
阅读(322)
推荐(0)
摘要:
AIOHTTP https://docs.aiohttp.org/en/stable/ 异步HTTP客户端和服务器,为asyncio 设计。 因为 作为客户端的 requests 支持同步请求模式, 一个请求完成后,才能执行下一个请求。 Asynchronous HTTP Client/Server
阅读全文
posted @ 2021-07-24 17:45
lightsong
阅读(264)
推荐(0)
摘要:
API Server with Scheduler 一般API服务器,仅仅提供API接口, 执行单次业务逻辑的执行。 如果在API服务器后台,执行定时执行功能, 让后台承担业务逻辑的定时执行功能, 添加APScheduler库。 FastAPI https://fastapi.tiangolo.co
阅读全文
posted @ 2021-07-23 22:55
lightsong
阅读(1399)
推荐(0)
摘要:
APScheduler https://github.com/agronholm/apscheduler 高级的python sheduler Advanced Python Scheduler (APScheduler) is a Python library that lets you sche
阅读全文
posted @ 2021-07-21 17:04
lightsong
阅读(190)
推荐(0)
摘要:
prefect https://github.com/PrefectHQ/prefect https://docs.prefect.io/ Prefect We've rebuilt data engineering for the data science era. Prefect is a ne
阅读全文
posted @ 2021-07-20 16:51
lightsong
阅读(215)
推荐(0)
摘要:
FastAPI https://fastapi.tiangolo.com/#performance FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.6+ based
阅读全文
posted @ 2021-07-16 14:55
lightsong
阅读(240)
推荐(0)
摘要:
REST API https://airflow.apache.org/docs/apache-airflow/stable/stable-rest-api-ref.html#section/Overview 为了利于管理, 支持了REST API。 To facilitate management
阅读全文
posted @ 2021-07-09 16:50
lightsong
阅读(1544)
推荐(0)
摘要:
API https://docs.python.org/3/library/datetime.html#datetime.datetime.now now接口获取本地时间, tz不带表示当地时区, 带上可以指定特定时区。 utcnow获取世界协调时间 classmethod datetime.now
阅读全文
posted @ 2021-07-08 15:26
lightsong
阅读(212)
推荐(0)
摘要:
setTimeout https://docs.python.org/3.6/library/sched.html The sched module defines a class which implements a general purpose event scheduler: class s
阅读全文
posted @ 2021-07-08 14:15
lightsong
阅读(137)
推荐(0)
摘要:
SQLite Database https://airflow.apache.org/docs/apache-airflow/stable/howto/set-up-database.html#setting-up-a-sqlite-database 用于开发环境,有一些限制,只支持 序列执行器,
阅读全文
posted @ 2021-07-05 15:04
lightsong
阅读(311)
推荐(0)
摘要:
HeidiSQL https://github.com/HeidiSQL/HeidiSQL HeidiSQL is a graphical interface for managing MariaDB or MySQL servers, Microsoft SQL databases, Postgr
阅读全文
posted @ 2021-07-05 12:19
lightsong
阅读(300)
推荐(0)
摘要:
ethers.js https://docs.ethers.io/v5/ 一个完备的,紧致的JS库,可以和以太坊区块链和其生态进行交互。 What is Ethers? The ethers.js library aims to be a complete and compact library f
阅读全文
posted @ 2021-06-17 11:33
lightsong
阅读(593)
推荐(0)
摘要:
Solidity https://docs.soliditylang.org/en/latest/index.html 实现智能合约的语言, 面向对象。 智能合约是运行在以太坊平台上的程序, 管理账户的行为和以太状态。 是一种花括号语言,类似 C++ PYTHON JAVASCRIPT. 静态类型,
阅读全文
posted @ 2021-06-17 10:23
lightsong
阅读(511)
推荐(0)
摘要:
Rimble https://rimble.consensys.design/ Rimble is an open-source library of React components and guides to help you make dApps everyone can use. 去中心化应
阅读全文
posted @ 2021-06-16 16:56
lightsong
阅读(199)
推荐(0)
摘要:
https://zhuanlan.zhihu.com/p/37782868 芒种 是二十四节气中的第九个节气,每年的6月5日左右,意思是:有芒的麦子快收,有芒的稻子可种。 这个节气的“忙”可谓名副其实。到了这个时节,夏季也将转入景色最美好的一段时期。 https://baike.baidu.com/
阅读全文
posted @ 2021-06-07 15:02
lightsong
阅读(225)
推荐(0)
摘要:
blockchain https://ethereum.org/zh/developers/docs/intro-to-ethereum/ 分布式 数据库, 不可篡改 A blockchain is best described as a public database that is update
阅读全文
posted @ 2021-06-04 16:25
lightsong
阅读(384)
推荐(0)
摘要:
背景 对Jenkins服务器实现脚本化的管理, 例如 触发 Job 等。 Jenkins REST API https://www.jenkins.io/doc/book/using/remote-access-api/ REST API Many objects of Jenkins provid
阅读全文
posted @ 2021-05-26 17:57
lightsong
阅读(357)
推荐(0)
摘要:
Managing static files (e.g. images, JavaScript, CSS) https://docs.djangoproject.com/en/3.2/howto/static-files/ STATIC_URL 定义 网页内部使用依赖的资源的 URL前缀, 例如所有静
阅读全文
posted @ 2021-05-25 13:05
lightsong
阅读(832)
推荐(0)
摘要:
An AI to play the Rock Paper Scissors game https://github.com/SouravJohar/rock-paper-scissors 此项目给出了一个使用OpenCV + CNN 做手势识别,和机器人随机对战的界面游戏。 https://yout
阅读全文
posted @ 2021-05-18 16:21
lightsong
阅读(192)
推荐(0)
摘要:
引子 运行一个react程序,报类似如下的错误。 使用如下搜索链接, https://www.bing.com/search?q=unexpected+token+catch&FORM=R5FD1 官网有类似问题 https://github.com/facebook/jest/issues/101
阅读全文
posted @ 2021-05-18 10:29
lightsong
阅读(455)
推荐(0)
摘要:
Reinforcement learning https://en.wikipedia.org/wiki/Reinforcement_learning Reinforcement learning (RL) is an area of machine learning concerned with
阅读全文
posted @ 2021-05-17 00:33
lightsong
阅读(210)
推荐(0)
摘要:
Neural Network SMS Text Classifier https://www.freecodecamp.org/learn/machine-learning-with-python/machine-learning-with-python-projects/neural-networ
阅读全文
posted @ 2021-05-12 12:18
lightsong
阅读(494)
推荐(0)
摘要:
Classify structured data using Keras Preprocessing Layers 对于既有数值特征,又有类别特征的输入情况,使用 keras的预处理层进行转换。 https://colab.research.google.com/github/tensorflow/
阅读全文
posted @ 2021-05-10 11:11
lightsong
阅读(201)
推荐(0)
摘要:
Linear Regression Health Costs Calculator https://www.freecodecamp.org/learn/machine-learning-with-python/machine-learning-with-python-projects/linear
阅读全文
posted @ 2021-05-09 23:27
lightsong
阅读(246)
推荐(0)
摘要:
Book Recommendation Engine using KNN https://www.freecodecamp.org/learn/machine-learning-with-python/machine-learning-with-python-projects/book-recomm
阅读全文
posted @ 2021-05-08 23:21
lightsong
阅读(186)
推荐(0)
摘要:
Cat and Dog Image Classifier https://www.freecodecamp.org/learn/machine-learning-with-python/machine-learning-with-python-projects/cat-and-dog-image-c
阅读全文
posted @ 2021-05-07 13:02
lightsong
阅读(212)
推荐(0)
摘要:
poetry -- pipenv加强版本 https://python-poetry.org/ I built Poetry because I wanted a single tool to manage my Python projects from start to finish. I wan
阅读全文
posted @ 2021-05-04 10:03
lightsong
阅读(497)
推荐(0)