import abc class All_file(metaclass=abc.ABCMeta): @abc.abstractmethod def read(self): pass @abc.abstractmethod def write(self): pass class Disk(All_fi... ...
分类:
其他好文 时间:
2016-12-22 10:55:55
阅读次数:
166
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmet ...
分类:
其他好文 时间:
2016-12-22 07:15:18
阅读次数:
200
javascript函数:1.禁止鼠标右键菜单代码块functionstop(){
returnfalse;
}
document.oncontextmenu=stop;//禁用鼠标右键
document.ondragstart=stop;//禁止拖动
document.onselectstart=stop;//禁止选择2.判断打开的页面是否存在父页面if(window.top==window.self&&wi..
分类:
编程语言 时间:
2016-12-22 00:40:31
阅读次数:
254
javascript函数:1.禁止鼠标右键菜单代码块functionstop(){
returnfalse;
}
document.oncontextmenu=stop;//禁用鼠标右键
document.ondragstart=stop;//禁止拖动
document.onselectstart=stop;//禁止选择2.判断打开的页面是否存在父页面if(window.top==window.self&&wi..
分类:
编程语言 时间:
2016-12-22 00:40:09
阅读次数:
290
Must-Read Books and Other References Books on C/C++: The C Programming Language by Brian W. Kernighan and Dennis M. Ritchie. Prentice Hall, 1988. The ...
分类:
其他好文 时间:
2016-12-21 21:22:49
阅读次数:
215
面向对象三大特性 一、封装 封装,顾名思义就是将内容封装到某个地方,以后再去调用被封装在某处的内容。 所以,在使用面向对象的封装特性时,需要: 将内容封装到某处 从某处调用被封装的内容 将内容封装到某处 从某处调用被封装的内容 第一步:将内容封装到某处 self 是一个形式参数,当执行 obj1 = ...
分类:
编程语言 时间:
2016-12-21 18:42:03
阅读次数:
214
环境:Ubuntu, Python 2.7 基础知识 这个程序涉及到的知识点有几个,在这里列出来,不详细讲,有疑问的直接百度会有一堆的。 1.urllib2 模块的 request 对像来设置 HTTP 请求,包括抓取的 url,和伪装浏览器的代理。然后就是 urlopen 和 read 方法,都很 ...
分类:
其他好文 时间:
2016-12-21 18:37:42
阅读次数:
237
1. 在block外面这样:__weak MyController *weakSelf = self 或者 __weak __typeof(self) weakSelf = self;是为了防止强引用导致循环引用2.执行block方法体的时候也可以转换为强引用之后再使用MyController* s ...
分类:
移动开发 时间:
2016-12-21 09:36:30
阅读次数:
250
#1.初始化实例化属性。#可接受任意关键字参数,并把他们都作为属性赋值给实例。使用**kw,除了可以直接使用self.name = 'xxx'设置一个属性外,还可以通过setattr(self, 'name', 'xxx')设置属性。class Person(object): def __init_ ...
分类:
编程语言 时间:
2016-12-20 20:33:34
阅读次数:
194
MessageBox(Application.Handle, 'text', 'caption', MB_TOPMOST + MB_ICONINFORMATION);)或者MessageBox(Self.Handle, 'text', 'caption', MB_TOPMOST + MB_ICONI ...
分类:
其他好文 时间:
2016-12-20 20:23:29
阅读次数:
184