接口(interface)定义了一个对象的行为规范,只定义规范不实现,由具体的对象来实现规范的细节。 接口 接口类型 在Go语言中接口(interface)是一种类型,一种抽象的类型。 interface是一组method的集合,是duck-type programming的一种体现。接口做的事情就 ...
分类:
编程语言 时间:
2019-12-06 22:02:28
阅读次数:
130
网络防火墙 iptables/netfilter网络防火墙: (1) 充当网关 (2) 使用filter表的FORWARD链 注意的问题: (1) 请求-响应报文均会经由FORWARD链,要注意规则的方向性 (2) 如果要启用conntrack机制,建议将双方向的状态为ESTABLISHED的报文直 ...
分类:
其他好文 时间:
2019-12-06 21:26:42
阅读次数:
124
vue中实现本地储存的方法:localStorage,在HTML5中,新加入了一个localStorage特性,这个特性主要是用来作为本地存储来使用的,解决了cookie存储空间不足的问题(cookie中每条cookie的存储空间为4k),localStorage中一般浏览器支持的是5M大小,这个在 ...
分类:
其他好文 时间:
2019-12-06 19:13:48
阅读次数:
79
描述 给定一个范围在 1 ≤ a[i] ≤ n ( n = 数组大小 ) 的 整型数组,数组中的元素一些出现了两次,另一些只出现一次。 找到所有在 [1, n] 范围之间没有出现在数组中的数字。 您能在不使用额外空间且时间复杂度为O(n)的情况下完成这个任务吗? 你可以假定返回的数组不算在额外空间内 ...
分类:
编程语言 时间:
2019-12-06 13:24:18
阅读次数:
61
https://codeforces.com/contest/1265 这场的2E是1C的不带checkpoints的版本。 B Beautiful Numbers 题意:给一个数组是一个[1,n]的permutation。对每个m∈[1,n]问[1,m]是否连续存在在这个数组中。 题解: 首先,[ ...
分类:
其他好文 时间:
2019-12-06 11:23:06
阅读次数:
95
设计模式学习08:享元模式 参考资料 https://www.jianshu.com/p/a2aa75939766 https://www.cnblogs.com/adamjwh/p/9070107.html 简介 Use sharing to support large numbers of fi ...
分类:
其他好文 时间:
2019-12-06 09:27:36
阅读次数:
85
链接: https://vjudge.net/problem/CodeForces 55D 题意: Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer numb ...
分类:
其他好文 时间:
2019-12-06 00:16:45
阅读次数:
85
数组是一种数据类型,数组可以存储很多项, 有序,集合 Array 求数组的和 和平均值案例 var numbers = [100,200,300]; var sum =0; var avg; for (var i = 0; i < numbers.length; i++) { sum += numb ...
分类:
编程语言 时间:
2019-12-04 18:30:57
阅读次数:
62
Motif discovery is in loose terms the problem of finding interesting patterns in sequences. motif: interest patterns/ subsequences in sequences. two w ...
分类:
其他好文 时间:
2019-12-04 01:27:26
阅读次数:
82
Given a sorted list of disjoint intervals, each interval intervals[i] = [a, b] represents the set of real numbers x such that a <= x < b. We remove th ...
分类:
其他好文 时间:
2019-12-03 01:34:33
阅读次数:
175