代码改变世界

how to debug thread cpu 100%

2014-11-17 22:40 by achuan_hu, 170 阅读, 0 推荐, 收藏, 编辑
摘要:when we write a program, cpu and memory usages are very important to indicate the stability of the program. Once the cpu usage reached 90%, there are ... 阅读全文

linux kernel with param

2014-11-08 22:12 by achuan_hu, 251 阅读, 0 推荐, 收藏, 编辑
摘要:Linux kernel support pass param to kernel, this params can be assigned at load time by insmod or modprobe. or later read from /etc/modprobe.conf file.... 阅读全文

The-ith-Element

2014-10-02 16:55 by achuan_hu, 233 阅读, 0 推荐, 收藏, 编辑
摘要:Brief: the-ith-element,given a array A with n element , return the i-th element of A. A(n,i)this problem can be solved using quick-sort idear, every t... 阅读全文

Quick-sort

2014-10-01 00:16 by achuan_hu, 144 阅读, 0 推荐, 收藏, 编辑
摘要:brief : the quick sort can divide into two steps, the first step is partition, the second step is conquer the subset.i) as the first step, array A[lef... 阅读全文

Combinations [leetcode]

2014-07-13 16:49 by achuan_hu, 217 阅读, 0 推荐, 收藏, 编辑
摘要:描述: Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution is:[ [2,4], [3,4], [2... 阅读全文

Populating Next Right Pointers in Each Node II

2014-07-13 16:10 by achuan_hu, 122 阅读, 0 推荐, 收藏, 编辑
摘要:题目地址:https://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/关键思路:讲节点的左右子节点链接起来,遍历节点的next节点,即可。class Solution {public: Tree... 阅读全文

文件属主获取

2014-03-07 11:05 by achuan_hu, 866 阅读, 0 推荐, 收藏, 编辑
摘要:win/linux中的文件属主获取方法,写了很多遍都记不住 - -, 还是记录一下,i)win中通过apiGetNamedSecurityInfo 获取到ower_sid, group_sid, 或者通过 getfilesecurity 获取到文件的file_sid, 通过GetSecurityDescriptorOwner/GetSecurityDescriptorGroup,获取到ower_sid, group_sid, 调用LookupAccountSid,获取ower/group 名。ii) win 中进程获取属主的方法,类似,通过,OpenProcessToken/GetTokenI 阅读全文

开博第一篇

2014-01-22 13:46 by achuan_hu, 132 阅读, 0 推荐, 收藏, 编辑
摘要:开博第一篇,算算日志,从毕业到现在工作1年半了,最近发现自己在处理些重复的问题,对之前碰到解决的问题没有做很好的总结,或者只是单纯解决问题,没有对相关进行深入了解,实在是可惜,所以在博客园开一个博客,希望自己在接下来的日子里头能够坚持下去,在这里记录些东西。 阅读全文