摘要: // A O(n^2) time and O(1) space program to find the longest palindromic substring#include // A utility function to print a substring str[low..high]voi... 阅读全文
posted @ 2015-05-21 23:44 Justin.cn 阅读(119) 评论(0) 推荐(0) 编辑
摘要: shdata.h#include #include #include #include #include #include #include using std::mutex;struct Person { char name[256]; int age; Person(const... 阅读全文
posted @ 2015-05-19 21:10 Justin.cn 阅读(486) 评论(0) 推荐(0) 编辑
摘要: close: int close(int fd) 并非马上关闭fd对应的socket连接,而是对其文件描述符的引用计数减1,只有当fd的引用计数为0时,才关闭连接,对应fork复制的socket描述符,无论时父进程还是子进程都需要调用close才能正确关闭连接。shutdown: int shutd... 阅读全文
posted @ 2015-05-05 15:54 Justin.cn 阅读(527) 评论(0) 推荐(0) 编辑
摘要: Total Accepted: 16020 Total Submissions: 103330Given a list of non negative integers, arrange them such that they form the largest number.For example,... 阅读全文
posted @ 2015-04-12 22:58 Justin.cn 阅读(642) 评论(0) 推荐(0) 编辑
摘要: C++实现的avl平衡树 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 9 class AvlNode 10 { 11 public : 12 ... 阅读全文
posted @ 2015-03-30 23:15 Justin.cn 阅读(187) 评论(0) 推荐(0) 编辑
摘要: An agent has a value that can be retrieved directly with deref,However an Actor encapsulates state but provides no direct means to access it.An Actor ... 阅读全文
posted @ 2015-03-27 15:54 Justin.cn 阅读(262) 评论(0) 推荐(0) 编辑
摘要: Concept Header Summary Threads Standard, low-level, type-safe; Futures Via async function, hides threading; Locks Standard, low-level locking pr... 阅读全文
posted @ 2015-03-18 21:30 Justin.cn 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 1 import os 2 import sys 3 4 def find_file(root_dir, type): 5 dirs_pool = [root_dir] 6 dest_pool = [] 7 8 def scan_dir(directory): 9 ... 阅读全文
posted @ 2015-03-11 20:45 Justin.cn 阅读(340) 评论(0) 推荐(0) 编辑
摘要: #!/bin/shpkill nickeleink_enable_autoupdaterm -rf /debian/tmp/* /debian/tmp/.* 2>/dev/nullmount -t proc proc /debian/procmount -o bind /dev /debian/de... 阅读全文
posted @ 2015-03-11 20:25 Justin.cn 阅读(278) 评论(0) 推荐(0) 编辑
摘要: step 1: 安装ghostscript (debian 环境, 其他环境自行google)sudo apt-get install ghostscriptstep 2: 用Vim生成ps文件vim -me -e -c ":hardcopy >%.ps" -c ":q" sqlite2.csqli... 阅读全文
posted @ 2015-03-10 14:16 Justin.cn 阅读(380) 评论(0) 推荐(0) 编辑