摘要:
class Solution {public: int longestValidParentheses(string s) { vector stack; int maxlen = 0; int curlen = 0; int last ... 阅读全文
摘要:
看着看着发现了一个库:stevedore(http://stevedore.readthedocs.org/en/latest/managers.html),但是感觉文档做得不行啊,都没个tutorial 阅读全文
摘要:
看着代码又发现了一个奇怪的东西: @contextlib.contextmanager def __call__(self, incoming): result_wrapper = [] yield lambda: result_wrapper.append(... 阅读全文
摘要:
不得不说派森大法好!最近读代码发现了with这个好东西,通常可用于替换try,或者用在锁区域,出了这段代码锁自然释放这点跟java的synchronized关键词有点像,看个代码:_pool_create_sem = threading.Lock()def get_connection_pool(c... 阅读全文
摘要:
def declare_consumer(self, consumer_cls, topic, callback): """Create a Consumer using the class that was passed in and add it to our... 阅读全文
摘要:
参考页面:[1] :https://pip.pypa.io/en/latest/installing.html[2] : http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows/最方便的方法就是去下载:http... 阅读全文
摘要:
有时候我们会在一个已有网络(10.10.10.0/24)内组建一个实验网络(192.168.1.0/24),网络结构如上图所示。假设我们不能控制(修改)A网络内除D主机以外的系统配置,但可以完全控制网络B内的主机。此时Server D实际上要承担一个路由的角色(它有两张网卡分别在两个网络A,B内)所... 阅读全文
摘要:
class Solution {public: ListNode *reverseKGroup(ListNode *head, int k) { if (k next = rhead; } last = rtail; } ... 阅读全文
摘要:
Givenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n.For example,Givenn= 3, your program should return all 5 uni... 阅读全文
摘要:
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and ... 阅读全文