下面两段代码都在主线程中运行,我们在看别人代码时会发现有时会直接调用,有时会利用performSelector调用,今天看到有人在问这个问题,我便做一下总结,[delegateimageDownloader:selfdidFinishWithImage:image];[delegateperform...
分类:
其他好文 时间:
2014-05-02 19:28:14
阅读次数:
275
1. 自定义验证--成功提示
1) 添加选项
errorClass: "unchecked",
validClass: "checked",
errorElement: "span",
errorPlacement: function (error, element) {
if (element.parent().find("span[for=""" + element.attr("id...
分类:
Web程序 时间:
2014-05-02 18:38:21
阅读次数:
467
这道题,采用动态规划算法。from top to
down,把到每个节点的最小路径和都求出来。下面是AC代码: 1 /** 2 * Given a triangle, find the minimum path
sum from top to bottom. 3 * Each ...
分类:
其他好文 时间:
2014-05-02 12:19:23
阅读次数:
382
HTTP1.1请求头:消息头
Accept:text/html,image/*告诉服务器,客户机支持的数据类型Accept-Charset:ISO-8859-1告诉服务器,客户机采用的编码
Accept-EnCoding:gzip,compress告诉服务器,客户机支持的数据压缩格式Accept.....
分类:
其他好文 时间:
2014-05-02 08:46:58
阅读次数:
248
join函数利用字符将数组中的元素分割开.[root@localhost~]#find`perl-e‘@array=join("","@INC");print"@array";‘`-name*.pm|wc-l547这个例子是利用空格分开了要查找的路径,然后find可以查找所有的路径下匹配*.pm的文件,我一共查到了547个模块.
分类:
系统相关 时间:
2014-05-02 04:13:56
阅读次数:
311
- (void)viewDidLoad{ [super viewDidLoad]; // Do any
additional setup after loading the view, typically from a nib. [NSThread
sleepForTimeInte...
分类:
移动开发 时间:
2014-05-02 00:25:42
阅读次数:
441
ubuntu安装opencv(1)安装编译opencv的环境sudo apt-get -y
install build-essential cmake pkg-config(2)安装Image I/O库sudo apt-get -y install
libjpeg62-dev sudo apt-ge...
分类:
其他好文 时间:
2014-05-01 22:42:45
阅读次数:
451
You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
Follow up:
Could you do this in-place?
刚开始没有思路,但是自己举了几个简单的栗子才看出规律:需要一圈儿一圈儿的变换位置。有两层for循环:外...
分类:
其他好文 时间:
2014-05-01 18:33:34
阅读次数:
359
通过 HTML DOM,可访问 JavaScript HTML 文档的所有元素
1 修改HTML元素内容
document.write(Date()); //在输入流中直接写
document.getElementById(id).innerHTML=new HTML //改变已经有的元素内容
document.getElementById("image").src="landscap...
分类:
编程语言 时间:
2014-04-30 22:42:38
阅读次数:
353