2017年12月5日
摘要: 问题描述: Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight). For example, the 3 阅读全文
posted @ 2017-12-05 11:01 gtxvs 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 问题描述: Given a sorted array, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra sp 阅读全文
posted @ 2017-12-05 10:51 gtxvs 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 问题描述: Given a non-negative integer represented as a non-empty array of digits, plus one to the integer. You may assume the integer do not contain any 阅读全文
posted @ 2017-12-05 10:29 gtxvs 阅读(178) 评论(0) 推荐(0) 编辑
  2016年11月29日
摘要: 一开始想直接在上个程序改,自己构造IP包头,但后来发现不行,微软不让干了,所以后来选用libcap库来收发包 代码写的很乱.. 阅读全文
posted @ 2016-11-29 18:11 gtxvs 阅读(1272) 评论(0) 推荐(0) 编辑
  2016年11月11日
摘要: 简单的实现了一个ping程序,没有做icmp差错报文的检查。 支持自定义字节数,支持发包个数 阅读全文
posted @ 2016-11-11 10:32 gtxvs 阅读(642) 评论(0) 推荐(0) 编辑
  2016年11月10日
摘要: 程序只实现了获取时间戳,至于将时间戳转换成具体日期和时间,暂时没有好的办法。 阅读全文
posted @ 2016-11-10 14:32 gtxvs 阅读(4067) 评论(0) 推荐(0) 编辑
  2016年10月31日
摘要: 根据RFC1071文档的计算方法,编写代码实现IP首部校验和的计算 计算步骤: 1.首先将IP首部中校验和字段置0 2.将IP首部每16bit进行相加,如果有进位产生,则将进位加到最低位。 3.将计算的结果取反即可 阅读全文
posted @ 2016-10-31 18:06 gtxvs 阅读(2231) 评论(0) 推荐(0) 编辑