摘要: 1. 外部样式表 2. 内部样式表 3. 内嵌样式(可在动态效果中同 JavaScript 一同使用) 阅读全文
posted @ 2018-04-16 11:59 Rocin 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 在CSS中,html中的标签元素大体被分为三种不同的类型:块状元素(block)、内联元素(又叫行内元素,inline)和内联块状元素(inline block)。 1. 常用的块状元素有: 2. 常用的内联元素有: 3.常用的内联块状元素有: 4. 块级元素(block)特点 (1)总是从新行开始 阅读全文
posted @ 2018-04-16 11:01 Rocin 阅读(1559) 评论(0) 推荐(0) 编辑
摘要: 第四部分第8章,对象引用、可变性和垃圾回收 1. 创建对象之后才会把变量分配给对象 变量是对象的标注,是对象的别名,是对象的引用,并不是对象存储的地方。 例子1. 证明赋值语句的右边先执行 2. 标识(id())、相等性(==)和别名 例子1. 两个变量指向同一个对象 例子2. chrles和lew 阅读全文
posted @ 2018-04-15 23:17 Rocin 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 第7章 函数装饰器和闭包 装饰器用于在源码中“标记”函数,动态地增强函数的行为。 了解装饰器前提是理解闭包。 闭包除了在装饰器中有用以外,还是回调式编程和函数式编程风格的基础。 1. 装饰器基础知识 1. 装饰器是callable对象,其参数是被装饰的函数。 2. 装饰器将被装饰的函数处理后返回,或 阅读全文
posted @ 2018-04-15 16:10 Rocin 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 使用一等函数实现设计模式 中文电子书P278 合理利用作为一等对象的函数,把模式中涉及的某些类的实例替换成简单的函数,从而简化代码。 1. 重构“策略”模式 1. 中文电子书P282 2. Python3.0 3.3中,声明抽象基类要使用metaclass=关键字:class Promotion(m 阅读全文
posted @ 2018-04-13 12:48 Rocin 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 参考: http://blog.jobbole.com/103290/ https://www.zhihu.com/question/19732473/answer/23434554 http://blog.huanghao.me/?p=95 1. 同步和异步关注的是 消息通信机制 。 2. 非阻塞 阅读全文
posted @ 2018-04-13 12:23 Rocin 阅读(381) 评论(0) 推荐(0) 编辑
摘要: 参考 1. https://docs.python.org/3/library/copy.html?highlight=copy%20copy copy.copy 2. https://en.wikipedia.org/wiki/Object_copying Shallow_copy Fluent 阅读全文
posted @ 2018-04-12 09:25 Rocin 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 参考 https://docs.python.org/3/library/functions.html?highlight=int int If x is not a number or if base is given, then x must be a string, bytes, or byt 阅读全文
posted @ 2018-04-11 16:47 Rocin 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 参考 https://stackoverflow.com/questions/9189810/css display inline vs inline block An inline block element is placed as an inline element (on the same 阅读全文
posted @ 2018-04-11 10:26 Rocin 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 一等函数 一等函数即将函数看作一等对象。一等对象满足一下条件: 1. 在运行时创建 2. 能赋值给变量或数据结构中的元素 3. 能作为参数传给函数 4. 能作为函数的返回结果 1. 一等函数 例子1. 证明function是对象,调用__doc__属性,用type()检查它的类型 python de 阅读全文
posted @ 2018-04-11 08:58 Rocin 阅读(178) 评论(0) 推荐(0) 编辑