中介者模式(Mediator Pattern) 定义:用来降低多个对象和类之间的通信复杂性。目的:用一个中介对象来封装一系列的对象交互,中介者使各对象不需要显式地相互引用,从而使其耦合松散,而且可以独立地改变它们之间的交互。场景:MVC框架中的控制器C就是模型M和识图V的中介者。 let media ...
分类:
编程语言 时间:
2020-04-03 19:54:58
阅读次数:
67
#include<iostream> #include<algorithm> #define fori for(i=0;i<n;i++) #define fori1 for(i=1;i<=n;i++) #define ll long long const ll mod = 1e9 + 7; cons ...
分类:
其他好文 时间:
2020-04-03 18:15:26
阅读次数:
58
```javascriptfunction trim() { let reg = /(^\s*)|(\s*$)/g let res = this.replace(reg, '') return res}String.prototype.trim = trim// 测试let str = ' hell... ...
分类:
其他好文 时间:
2020-04-03 18:10:49
阅读次数:
64
class DecimalEncoder(json.JSONEncoder): def default(self, o): if isinstance(o, decimal.Decimal): return float(o) super(DecimalEncoder, self).default(o ...
分类:
Web程序 时间:
2020-04-03 16:46:18
阅读次数:
71
1 import numpy as np 2 import matplotlib.pyplot as plt 5 import struct 6 i=0 7 #读取训练数据 8 file_list=['train-images.idx3-ubyte','train-labels.idx1-ubyte ...
分类:
编程语言 时间:
2020-04-03 16:41:24
阅读次数:
161
添加cookie绕过登陆 #!/usr/bin/env python # -*- coding: utf-8 -*- from selenium import webdriver import time import pickle class SkipLogin(object): def __ini ...
分类:
其他好文 时间:
2020-04-03 16:29:34
阅读次数:
79
在脚本的Run-time Settings中,可以设置在脚本运行过程中发生错误的处理方式。进入到Run-time Settings中,切换到Miscellaneous标签页,可以看到Error Handing的第一个设置项:Continue on error,如图1-30所示。勾选Continue ...
分类:
其他好文 时间:
2020-04-03 12:25:04
阅读次数:
92
一、作用 作用在方法传递的参数前,用于接收所传参数 例如:http://localhost:8081/selectStudentById?id=01 接收问号后面的参数值(允许多个参数) 二、注解内部的四个属性 1.name 指定传入的参数名称,其后面跟的参数名称一定要与前端传入的参数名称一致 2. ...
分类:
编程语言 时间:
2020-04-03 12:17:58
阅读次数:
112
"1052. 设计密码" 你现在需要设计一个密码 S,S 需要满足: S 的长度是 N; S 只包含小写英文字母; S 不包含子串 T; 例如:abc 和 abcde 是 abcde 的子串,abd 不是 abcde 的子串。 请问共有多少种不同的密码满足要求? 由于答案会非常大,请输出答案模 10 ...
分类:
其他好文 时间:
2020-04-03 12:08:10
阅读次数:
106
题目:输入一个整数数组,判断该数组是不是某二叉搜索树的后序遍历结果。如果是则返回 true,否则返回 false。假设输入的数组的任意两个数字都互不相同。 思路步骤: 1.确定根节点root;2.遍历序列(除去root结点),找到第一个大于root的位置,则该位置左边为左子树,右边为右子树;3.遍历 ...
分类:
其他好文 时间:
2020-04-03 12:07:23
阅读次数:
64