jQuery Deferred
- 授权协议: 未知
- 开发语言:
- 操作系统: 未知
- 软件首页: http://plugins.jquery.com/project/deferred
软件介绍
Simple and clean asynchronous/nonblocking processing system JSDeferred (is like MochiKit and with some extension) with jQuery supports.
jQuery supports: overwrite ajax functions get, post and getJSON to return Deferred object (no arguments change).
Collect some asynchronous resources by ajax.
parallel([
$.get("a.html").next(function (data) {
return data.match(/([^<]+)<\/title>/);
}),
$.get("b.txt" ).next(function (data) {
return data.match(/##\s*([^<]+)\s*##/);
}),
$.getJSON("c.json").next(function (data) {
return data.title;
})
]).next(function (values) {
print("Titles "+values.join(", "));
});
Divided loop for non stress browsing. When long time processing is required, it is bad that simply using only for loop because it stops browser appearance. Deferred resolves it with bare minimum of effort.
loop({begin: 1, end:100, step:10}, function (n, o) {
print(["Processing divided loop:n=", n].join(""));
for (var i = 0; i < o.step; i++) {
var j = n + i;
print(j);
}
});
Like tail call code. If you are habituated to functional programming, this syntax may be familiar to you.
next(function () {
function pow (x, n) {
function _pow (n, r) {
if (n == 0) return r;
return call(_pow, n - 1, x * r);
}
return call(_pow, n, 1);
}
return call(pow, 2, 10);
}).
next(function (r) {
log([r, "end"]);
});
算法竞赛入门经典
刘汝佳、陈锋 / 2012-10 / 52.80元
《算法竞赛入门经典:训练指南》是《算法竞赛入门经典》的重要补充,旨在补充原书中没有涉及或者讲解得不够详细的内容,从而构建一个较完整的知识体系,并且用大量有针对性的题目,让抽象复杂的算法和数学具体化、实用化。《算法竞赛入门经典:训练指南》共6章,分别为算法设计基础、数学基础、实用数据结构、几何问题、图论算法与模型和更多算法专题,全书通过近200道例题深入浅出地介绍了上述领域的各个知识点、经典思维方式......一起来看看 《算法竞赛入门经典》 这本书的介绍吧!
