自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 收藏
  • 关注

原创 时间计数器

timeit.Timer( '[item for sublist in l for item in sublist]', 'l=[[1, 2, 3], [4, 5, 6, 7, 8], [1, 2, 3, 4, 5, 6, 7]] * 10' ).timeit()

2019-03-15 15:21:12 1128

原创 graphQL--what's mutations,Update data with mutations

TheMutationcomponent is another important building block in an Apollo app. It’s a React component that provides a function to execute a GraphQL mutation. Additionally, it tracks the loading, complet...

2019-03-15 14:40:56 175

原创 将sqlalchemy result对象转换为dict对象

# method1for r in session.query(User).all(): row2dict = lambda r: {c.name: str(getattr(r, c.name)) for c in r.__table__.columns} print(row2dict(r))# method2def row2dict(row): d = {}...

2019-03-12 14:24:50 4158 1

转载 python's __new__ magic method and using in singleton pattern

------why I want to know python's magic method named __new__ , and what it will do in singleton pattern,because I found them in my company's job interview questions, but I don't know how to answe...

2019-03-12 10:39:01 125

转载 __getattribute__方法

流畅的python19.6节 处理属性的特殊方法 在用户自己定义的类中,下述特殊方法用于获取、设置、删除和列出属性。使用点号或内置的 getattr、hasattr 和 setattr 函数存取属性都会触发下述列表中相应的特殊方法。但是,直接通过实例的 __dict__ 属性读写属性不会触发这些特殊方法——如果需要,通常会使用这种方式跳过特殊方法。Python 文档“D...

2019-03-12 10:06:49 3381

转载 sqlalchemy orm case用法

See sqlalchemy.sql.expression.case function and more examples on the documentation page. But it would look like this (verbatim from the documentation linked to):case([(orderline.c.qty > 100, ite...

2019-02-18 14:07:27 3109

原创 sqlalchemy hybrid attribute

 The hybrid takes advantage of the ability of Python classes to have an attribute which has customizable behavior both at the class level as well as at the instance level

2018-12-03 10:12:01 158

原创 Punctuation标点符号

source:https://en.wikipedia.org/wiki/Punctuationfor writing systems,In written English, punctuation is vital to disambiguate the meaning of sentences.  Punctuation marks Punctuation ...

2018-09-11 11:25:05 494

原创 yaml文档多行换行

source: https://en.wikipedia.org/wiki/YAMLStrings do not require quotation. There are two ways to write multi-line strings, one preserving newlines (using the | character) and one that folds the ne...

2018-09-11 11:13:01 16435

原创 python decorator

Q1. what is decorator in pythonQ2.  how do decorated functions work in flask/python? (app.route)引申:  Metaprogramming is a programming technique in which computer programs have the ability to treat pr...

2018-06-29 17:01:09 132

原创 php 语言规范--side effects

php 语法学习,side effects含义

2018-06-27 11:42:01 293

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除