Chinaunix首页 | 论坛 | 博客
  • 博客访问: 353651
  • 博文数量: 60
  • 博客积分: 15
  • 博客等级: 民兵
  • 技术积分: 1138
  • 用 户 组: 普通用户
  • 注册时间: 2012-03-20 16:18
个人简介

最多140个字

文章分类

全部博文(60)

文章存档

2016年(1)

2015年(34)

2014年(25)

发布时间:2015-03-03 16:45:33

反转链表#includestruct ListNode{    int m_nKey;    struct ListNode* m_pNext;};void ReverseList(struct ListNode** pHead).........【阅读全文】

阅读(5825) | 评论(0) | 转发(3)

发布时间:2015-12-13 13:41:13

//sort函数源码:template <class _RandomAccessIter>inline void sort(_RandomAccessIter __first, _RandomAccessIter __last) { __STL_REQUIRES(_RandomAccessIter, _Mutable_RandomAccessIterator); __STL_REQUIRES(typename iterator_traits<_RandomAccessIter>::value_type, _LessThanCompa.........【阅读全文】

阅读(3543) | 评论(0) | 转发(0)

发布时间:2015-09-08 17:16:39

<br /><div id="codeText" class="codeText"><ol style="margin:0 1px 0 0;padding:5px 0pt;" start="1" class="dp-css none_number"><li><span style="color:#000000;"><span style="color:#0000CC;">/</span><span style="color:#0000CC;">/</span> Forward declaration of isBadVersion API<span style="color.........【阅读全文】

阅读(3019) | 评论(0) | 转发(0)

发布时间:2015-09-02 09:54:00

<br /><div id="codeText" class="codeText"><ol style="margin:0 1px 0 0;padding:5px 0pt;" start="1" class="dp-css none_number"><li><span style="color:#000000;"><span style="color:#0000CC;">*</span><br /></span></li><li>&nbsp;<span style="color:#0000CC;">*</span> Definition <span s.........【阅读全文】

阅读(3222) | 评论(0) | 转发(0)

发布时间:2015-09-02 09:43:00

<br /><div id="codeText" class="codeText"><ol style="margin:0 1px 0 0;padding:5px 0pt;" start="1" class="dp-css none_number"><li><span style="color:#000000;"><span style="color:#0000CC;">/</span><span style="color:#0000CC;">*</span><span style="color:#0000CC;">*</span><br /></span></li.........【阅读全文】

阅读(3282) | 评论(0) | 转发(0)

发布时间:2015-08-25 21:00:57

/* J. David......【阅读全文】

阅读(3717) | 评论(0) | 转发(0)

发布时间:2015-08-18 09:05:41

<br /><div id="codeText" class="codeText"><ol style="margin:0 1px 0 0;padding:5px 0pt;" start="1" class="dp-css none_number"><li><span style="color:#000000;">void addtwobits<span style="color:#0000CC;">(</span>char <span style="color:#0000CC;">*</span>sum<span style="color:#0000CC;">,</spa.........【阅读全文】

阅读(2969) | 评论(0) | 转发(0)

发布时间:2015-08-18 07:01:54

<br /><div id="codeText" class="codeText"><ol style="margin:0 1px 0 0;padding:5px 0pt;" start="1" class="dp-css none_number"><li><span style="color:#000000;">uint32_t reverseBits<span style="color:#0000CC;">(</span>uint32_t n<span style="color:#0000CC;">)</span> <span style="color:#0000CC;.........【阅读全文】

阅读(2893) | 评论(0) | 转发(0)

发布时间:2015-08-17 22:14:09


/**
......【阅读全文】

阅读(2933) | 评论(0) | 转发(0)

发布时间:2015-08-17 21:48:59


/**
......【阅读全文】

阅读(2974) | 评论(0) | 转发(0)

发布时间:2015-08-17 21:19:47

<br /><div id="codeText" class="codeText"><ol style="margin:0 1px 0 0;padding:5px 0pt;" start="1" class="dp-css none_number"><li><span style="color:#000000;"><span style="color:#0000CC;">/</span><span style="color:#0000CC;">*</span><span style="color:#0000CC;">*</span><br /></span></li.........【阅读全文】

阅读(2866) | 评论(0) | 转发(0)

发布时间:2015-08-17 17:47:45

<br /><div id="codeText" class="codeText"><ol style="margin:0 1px 0 0;padding:5px 0pt;" start="1" class="dp-css none_number"><li><span style="color:#000000;"><span style="color:#0000CC;">/</span><span style="color:#0000CC;">*</span><span style="color:#0000CC;">*</span><br /></span></li.........【阅读全文】

阅读(2763) | 评论(0) | 转发(0)

发布时间:2015-08-17 16:46:48

<br /><div id="codeText" class="codeText"><ol style="margin:0 1px 0 0;padding:5px 0pt;" start="1" class="dp-css none_number"><li><span style="color:#000000;"><span style="color:#0000CC;">/</span><span style="color:#0000CC;">*</span><span style="color:#0000CC;">*</span><br /></span></li.........【阅读全文】

阅读(2957) | 评论(0) | 转发(0)

发布时间:2015-08-15 10:53:08

<br /><div id="codeText" class="codeText"><ol style="margin:0 1px 0 0;padding:5px 0pt;" start="1" class="dp-css none_number"><li><span style="color:#000000;">#include<span style="color:#0000CC;">&lt;</span>stdio<span style="color:#0000CC;">.</span>h<span style="color:#0000CC;">&gt;</span>.........【阅读全文】

阅读(2868) | 评论(0) | 转发(0)

发布时间:2015-08-14 09:47:14

在网络编程中,下列情况socket可读:
    1,socket内核缓存区中字节数大于或等于其低水位标记SO_RCVLOWAT。
    2,socket通信的对方关闭连接。此时对该socket的读操作将返回0.
    3,监听socket上有新的连接请求。
    4,socket上有未处理的错误。......【阅读全文】

阅读(3389) | 评论(0) | 转发(0)

发布时间:2015-08-12 23:14:36

1,select系统调用的用途是:在一段指定的时间内,监听用户感兴趣的fds上的可读,可写和异常事件。<br /><div id="codeText" class="codeText"><ol style="margin:0 1px 0 0;padding:5px 0pt;" start="1" class="dp-css none_number"><li><span style="color:#000000;"><span style="color:#FF0000;">int</span> .........【阅读全文】

阅读(2928) | 评论(0) | 转发(0)

发布时间:2015-08-12 20:10:42

获取core dump的最大好处是,它能保存问题发生时的状态。<br />1,用ulimit命令可以查看当前的内核转储功能是否有效。<br /><div id="codeText" class="codeText"><ol style="margin:0 1px 0 0;padding:5px 0pt;" start="1" class="dp-css none_number"><li>qinchao@linux104:~$ ulimit -c</li><li>0.........【阅读全文】

阅读(2848) | 评论(0) | 转发(0)

发布时间:2015-08-12 16:32:47

/**
 * Definition for singly-linked list.......【阅读全文】

阅读(2312) | 评论(0) | 转发(0)

发布时间:2015-08-12 15:21:50

https://leetcode.com/problems/add-two-numbers/<br /><div id="codeText" class="codeText"><ol style="margin:0 1px 0 0;padding:5px 0pt;" start="1" class="dp-css none_number"><li><span style="color:#000000;"><span style="color:#0000CC;">/</span><span style="color:#0000CC;">*</span><span style=.........【阅读全文】

阅读(2495) | 评论(0) | 转发(0)

发布时间:2015-08-04 10:06:58

bisect :在提交历史中进行二分查找来尽快地确定哪一次提交引入了错误。例如你刚刚推送了一个代码发布版本到产品环境中,对代码为什么会表现成那样百思不得其解。你回到你的代码中,还好你可以重现那个问题,但是找不到在哪里。你可以对代码执行 bisect 来寻找。

首先你运行 git bisect start 启动,然后你用 git b.........【阅读全文】

阅读(2799) | 评论(0) | 转发(0)

发布时间:2015-08-04 10:01:43

&nbsp;&nbsp;&nbsp;&nbsp;如果你在追踪代码中的缺陷想知道这是什么时候为什么被引进来的,文件标注会是你的最佳工具。它会显示文件中对每一行进行修改的最近一次提交。因此,如果你发现自己代码中的一个方法存在缺陷,你可以用 git blame 来标注文件,查看那个方法的每一行分别是由谁在哪一天修改的(-L n1,n2用于指定输出第n1-n.........【阅读全文】

阅读(2542) | 评论(0) | 转发(0)

发布时间:2015-07-29 16:26:59


/**
......【阅读全文】

阅读(2518) | 评论(0) | 转发(0)

发布时间:2015-07-28 20:12:37

<p style="box-sizing:border-box;margin-top:0px;margin-bottom:10px;color:#333333;font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:14px;line-height:30px;white-space:normal;background-color:#FFFFFF;">Given a sorted array of integers, find the starting and ending position of a give.........【阅读全文】

阅读(1865) | 评论(0) | 转发(0)

发布时间:2015-07-11 13:01:40

https://leetcode.com/problems/word-frequency/<br /># Read from the file words.txt and output the word frequency list to stdout.<br />awk '{for(i=1;i&lt;=NF;i++){arr[$i]++}} END{for(w in arr){print w" "arr[w]}}' words.txt|sort -nrk 2<br />......【阅读全文】

阅读(2817) | 评论(0) | 转发(0)

发布时间:2015-06-26 21:14:30

<p style="margin-top:4px;margin-bottom:4px;padding-top:2px;padding-bottom:2px;font-family:Arial, Helvetica, sans-serif;font-size:12px;line-height:normal;white-space:normal;background-color:#FFFFFF;">//参考《Linux shell脚本攻略 第2版》</p><p style="margin-top:4px;margin-bottom:4px;padding-top:2px.........【阅读全文】

阅读(1775) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册