1 #include 2 #include 3 using namespace std; 4 int cmp ( const void *a , const void *b ) 5 { 6 return *(int *)b - *(int *)a; 7 } 8 int main() 9...
分类:
其他好文 时间:
2015-06-11 12:23:07
阅读次数:
109
Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If found in the array return its index...
分类:
其他好文 时间:
2015-06-11 11:08:14
阅读次数:
98
Reverse a linked list from position m to n. Do it in-place and in one-pass.For example:
Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->5->NULL.Note:
Given m, n satisfy the following co...
分类:
其他好文 时间:
2015-06-11 09:33:31
阅读次数:
141
LD_PRELOAD提供了平民化的注入方式固然方便,同时也有不便:注入库出错后调试比较困难。我琢磨了几天找到了可行的调试方法,当然未必是最有效的办法。抛出陋文,希望引来美玉~
首先,写一段代码作为普通的动态库,公开接口,供人调用,如下:
//true.c
int fake(const char* s1,const char* s2)
{
return 0;
}
gcc -g3...
分类:
其他好文 时间:
2015-06-11 09:32:44
阅读次数:
426
function GetRandomNum(Min,Max){var Range = Max - Min;var Rand = Math.random();return(Min + Math.round(Rand * Range));}var num = GetRandomNum(15,25);
分类:
其他好文 时间:
2015-06-11 00:03:26
阅读次数:
149
#include #include using namespace std; int main(int argc, _TCHAR* argv[]){ FILE* pfile = fopen("D:\\origin.txt", "rb"); if (!pfile) return f...
分类:
其他好文 时间:
2015-06-10 23:58:50
阅读次数:
160
RT,随手写的 1 /** 2 * 判断字符串中是否包含指定字符串 3 * @var source 源字符串 4 * @var target 要判断的是否包含的字符串 5 * @return bool 6 */ 7 function hasstring($source,$target){ ...
分类:
Web程序 时间:
2015-06-10 23:57:50
阅读次数:
155
我们都知道viewDidLoad是在视图加载时调用,但是具体是何时调用,看下面代码就清楚了 UIViewController.m的部分代码 -?(BOOL)isViewLoaded
{
????return?(_view?!=?nil);
}
-?(UIView?*)view
{
????...
分类:
其他好文 时间:
2015-06-10 22:45:55
阅读次数:
197
ModelValidator与ModelValidatorProvider ModelValidator public abstract class ModelValidator { public virtual bool IsRequired { get { return false; } } p...
分类:
其他好文 时间:
2015-06-10 22:29:26
阅读次数:
256
Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the linked l...
分类:
其他好文 时间:
2015-06-10 21:07:28
阅读次数:
174