会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Ryan
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
10
11
12
13
14
15
16
17
18
···
23
下一页
2014年11月2日
leetcode-pascal triangle I&&II
摘要: 对于第2个pascal triangle,通过观察可以发现,其实只需要2个额外的变量来记录,于是就设了个tmp数组。整体有点DP问题中的滚动数组的感觉。 1 #include 2 #include 3 using namespace std; 4 5 class Solution { 6 pu...
阅读全文
posted @ 2014-11-02 16:04 Ryan in C++
阅读(231)
评论(0)
推荐(0)
2014年11月1日
How To Capture Packets with TCPDUMP?
摘要: http://linux-circles.blogspot.com/2012/11/how-to-capture-packets-with-tcpdump.htmlSee the list of interfaces on which tcpdump can listen# /usr/sbin/tc...
阅读全文
posted @ 2014-11-01 22:01 Ryan in C++
阅读(410)
评论(0)
推荐(0)
2014年10月31日
leetcode-two sum
摘要: 之前是通过hash来做,O(n)。这次为了熟悉通用性的解法,通过双指针来做。时间复杂度为O(nlogn)(即sort的复杂度)。主要是关于sort的用法上不太熟,关于自定义sort规则。C++ Reference中给的示例代码如下: 1 // sort algorithm example 2 #in...
阅读全文
posted @ 2014-10-31 10:28 Ryan in C++
阅读(308)
评论(0)
推荐(0)
2014年10月30日
Linux统计某文件夹下文件、文件夹的个数
摘要: ls -l |grep "^d"|wc -l统计文件夹下文件的个数,包括子文件夹里的ls -lR|grep "^-"|wc -l如统计/home/han目录(包含子目录)下的所有js文件则:ls -lR /home/han|grep js|wc -l 或 ls -l "/home/han"|grep...
阅读全文
posted @ 2014-10-30 16:41 Ryan in C++
阅读(674)
评论(0)
推荐(0)
2014年10月29日
leetcode-Minimum Depth of Binary Tree
摘要: 1 class Solution { 2 public: 3 int minDepth(TreeNode *root) { 4 if (root == nullptr) return 0; 5 if (root->left != nullptr&&root-...
阅读全文
posted @ 2014-10-29 10:44 Ryan in C++
阅读(155)
评论(0)
推荐(0)
leetcode-Construct Binary Tree from Preorder and Inorder Traversal
摘要: recursive 1 #include 2 #include 3 using namespace std; 4 5 struct TreeNode { 6 int val; 7 TreeNode *left; 8 TreeNode *right; 9 ...
阅读全文
posted @ 2014-10-29 09:37 Ryan in C++
阅读(208)
评论(0)
推荐(0)
2014年10月27日
patch 修改有问题的
摘要: diff --git a/include/net/tcp.h b/include/net/tcp.h@@ -1013,8 +1048,13 @@ static inline u32 keepalive_time_elapsed(const struct tcp_sock *tp)该函数在2.6.32...
阅读全文
posted @ 2014-10-27 14:03 Ryan in C++
阅读(330)
评论(0)
推荐(0)
编译内核相关
摘要: 1.解压缩tar.gz:tar -zxvf archive_name.tar.gz2.解压缩tar.xz(1)首先使用xz解压 tar.xz文件: xz -d linux-3.8.4.tar.xz 这个操作会将linux-3.8.4.tar.xz文件解压成linux-3.8.4.tar,然后我们再对...
阅读全文
posted @ 2014-10-27 13:52 Ryan in C++
阅读(160)
评论(0)
推荐(0)
OpenSUSE 内核编译教程 (kernel 2.6.x)
摘要: http://cn.opensuse.org/OpenSUSE_%E5%86%85%E6%A0%B8%E7%BC%96%E8%AF%91%E6%95%99%E7%A8%8B_(kernel_2.6.x)Contents[hide]1声明2简述3基础知识3.1什么是内核3.2什么是补丁3.3为什么要重...
阅读全文
posted @ 2014-10-27 13:48 Ryan in C++
阅读(558)
评论(0)
推荐(0)
cc.out
摘要: 1 Server: 5, win: 20pkt, SRU: 256KB, link_buf: 32pkt, Seed: 1, 2 Block_trans: 1350200B, RTT: 100us, RTT_rand: 20us, SYN_del: 0-0us 3 4 0.99...
阅读全文
posted @ 2014-10-27 11:10 Ryan in C++
阅读(506)
评论(0)
推荐(0)
上一页
1
···
10
11
12
13
14
15
16
17
18
···
23
下一页
公告