例子一 首先来看一段代码: 上面代码执行结果为: 结论1 我们知道,实例化Foo,得到obj对象,会执行Foo的__init__方法,也就是打印了第一句; 按照,程序从上至下执行,应该会打印“正在执行”才对,为什么会在它之前先打印了进入,在它之后打印了退出呢? 因为我们在定义Foo时,定义了__en ...
分类:
编程语言 时间:
2019-07-05 19:21:52
阅读次数:
104
__proto__ VS. prototype in JavaScript http://dmitrysoshnikov.com/ecmascript/javascript-the-core/#a-prototype-chain __proto__ is the actual object that ...
分类:
编程语言 时间:
2019-07-04 00:44:16
阅读次数:
149
1、getitem方法使用这个方法最大的印象就是调用对象的属性可以像字典取值一样使用中括号[‘key‘]使用中括号对对象中的属性进行取值、赋值或者删除时,会自动触发对应的__getitem__、__setitem__、__delitem__方法代码如下:classFoo(object):def__init__(self):self.name=‘jack‘def__getitem__
分类:
编程语言 时间:
2019-07-03 18:31:05
阅读次数:
167
1.docker build docker build 这个动作有一个context 上下文的概念 [root@fdfs-1 ~]# docker build -t weaveworks/scope:1.11.2 -t weaveworks/scope:latest -f /tmp/Dockerfi ...
分类:
其他好文 时间:
2019-07-03 14:00:21
阅读次数:
86
两台nginx服务器 nginx A: 192.168.1.48 nginx B: 192.168.1.56 一. 测试方法 在nginx A中配置不同的规则,然后请求nginx A: http://192.168.1.48/foo/api 观察nginx B收到的请求,具体操作是查看日志中的$re ...
分类:
其他好文 时间:
2019-07-03 13:34:32
阅读次数:
375
Pod 可以通过 Volume 或者环境变量的方式使用 Secret,今天先学习 Volume 方式。 Pod 的配置文件如下所示: ① 定义 volume foo,来源为 secret mysecret。 ② 将 foo mount 到容器路径 /etc/foo,可指定读写权限为 readOnly ...
分类:
其他好文 时间:
2019-07-02 14:47:39
阅读次数:
118
8.<div id="navlist"> <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false" /> --页面导航控件 <asp:Repeater ID="TopNavRepeat ...
分类:
Web程序 时间:
2019-07-01 20:14:44
阅读次数:
144
一、使用常见的三元操作符 二、使用and(&&)和or(||)运算符 三、省略大括号{} 参考:https://www.jb51.net/article/26534.htm 优化方法:https://blog.csdn.net/hangmine/article/details/78828821 ...
分类:
Web程序 时间:
2019-07-01 13:59:48
阅读次数:
173
? Table of Contents 1. 环境 2. 安装vue 3. 创建项目 4. 启动项目 5. 总线模式传递数据 5.1. 建立通道 5.2. 发送事件 5.3. 接收事件(多个同时收到) 6. HTTP 请求放在created中执行比较好 1 环境 win10 + node12.x + ...
分类:
其他好文 时间:
2019-07-01 10:32:55
阅读次数:
91