代码改变世界

阅读排行榜

文件属主获取

2014-03-07 11:05 by achuan_hu, 901 阅读, 收藏,
摘要: 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 阅读全文

linux kernel with param

2014-11-08 22:12 by achuan_hu, 259 阅读, 收藏,
摘要: 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, 246 阅读, 收藏,
摘要: 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... 阅读全文

Combinations [leetcode]

2014-07-13 16:49 by achuan_hu, 226 阅读, 收藏,
摘要: 描述: 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... 阅读全文

how to debug thread cpu 100%

2014-11-17 22:40 by achuan_hu, 188 阅读, 收藏,
摘要: 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 ... 阅读全文