都是些简单的东西,所以直接上代码了。/** * Created by huangjacky on 14-10-3. */function Node(element, left, right) { this.element = element; this.level = 0; thi...
分类:
编程语言 时间:
2014-10-03 22:21:25
阅读次数:
313
1 var http=require("http");2 var server=http.createServer();3 server.on("request",function(req,res){5 console.log(req.url);6 res.end();7 }...
分类:
其他好文 时间:
2014-10-03 15:26:34
阅读次数:
190
Given a binary tree, determine if it is height-balanced.
For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never diffe...
分类:
其他好文 时间:
2014-10-03 13:39:24
阅读次数:
205
zookeeper一般用于distributed locking,并不适合用于distributed storage,因为zookeeper的每个node,也叫做znode的存储容量限制是1M。
zookeeper里的角色主要有client,leader和learner,其中learner也包括observer和follower。
client为请求的发起方,follower为...
分类:
其他好文 时间:
2014-10-03 12:25:44
阅读次数:
357
题意:有n个人每人有一个力气值Si,美丽值Bi,满足Bi>Bj&&Si>Sj 或者 Bi 2 #include 3 #include 4 #include 5 #include 6 #define N 100005 7 using namespace std; 8 9 struct node{10....
分类:
其他好文 时间:
2014-10-03 11:36:44
阅读次数:
266
PTVS开发团队又开发出一款可以在VS里编写Node.js应用程序的插件——NTVS(Node.js Tools for Visual Studio),开发者可以在VS里轻松开发Node.js应用。 NTVS是一款开源工具,遵循Apache开源许可,由微软和社区维护。适用于Node.js 0.10....
分类:
Web程序 时间:
2014-10-02 23:39:03
阅读次数:
247
首先,如果需要打印日志,不需要用log4j这些东西,直接用System.out.println即可,这些输出到stdout的日志信息可以在jobtracker站点最终找到。其次,如果在main函数启动的时候用System.out.println打印的日志,直接在控制台就可以看到。再其次,jobtracker站点很重要。http://your_name_node:50030/jobtracker.j...
分类:
其他好文 时间:
2014-10-02 20:12:33
阅读次数:
213
Follow up for problem "Populating Next Right Pointers in Each Node".
What if the given tree could be any binary tree? Would your previous solution still work?
Note:
You may only use constant ...
分类:
其他好文 时间:
2014-10-02 14:18:33
阅读次数:
267