2014年10月23日

摘要: 1.!!2.^old^new3.cd -4.查看本机出口ip,curl ifconfig.me5.lsof -i 查看本机网络服务活动状态6.wget --random-wait -r -p -e robots=off -U mozilla http://www.baidu.com7. 阅读全文
posted @ 2014-10-23 22:03 realmeh 阅读(112) 评论(0) 推荐(0) 编辑

2014年6月22日

摘要: 1. 常见攻击:flood: ICMP/IGMP, udp,tcp, syn ,push+ack,ack, rst, ssl7层: dns query, dns nxdomain query,dns 反射(edns超过512字节限制), ntp 反射(mon list), snmp反射,http c... 阅读全文
posted @ 2014-06-22 23:30 realmeh 阅读(282) 评论(0) 推荐(0) 编辑

2014年4月26日

摘要: chaper1.速度包括延迟和带宽延迟:传播延迟,传输延迟,处理延迟,排队延迟排队延迟:当今本地路由器缓冲区很大,导致tcp拥塞预防机制失效,CODEL主动队列管理算法,linux 内核3.5,解决该问题。传播延迟:当前光纤传播的信息的速度约为20万公里每秒,主要是由一个介质折射率。"最后一公里问题... 阅读全文
posted @ 2014-04-26 16:48 realmeh 阅读(291) 评论(0) 推荐(0) 编辑

2014年2月26日

摘要: 01/*02* C/C++中一次遍历将string转float (带小数点)03* Written by Jesse04*/0506#include 0708doublestr2float(char*str)09{10inti=0;11intintpart,floatpart,digit;12int... 阅读全文
posted @ 2014-02-26 09:27 realmeh 阅读(1219) 评论(0) 推荐(0) 编辑
摘要: 06#include 07#include 0809voidrevert(char*str)10{11intfront,rear;1213rear=strlen(str)-1;14for(front=0;front<rear;front++,rear--)15{16str[front]=str[front]^str[rear];17str[rear]=str[front]^str[rear];18str[front]=str[front]^str[rear];19}20}2122intmain(void)23{24charstr[]="hello, world!";2 阅读全文
posted @ 2014-02-26 09:25 realmeh 阅读(354) 评论(0) 推荐(0) 编辑

2014年2月25日

摘要: int my_atoi(const char *str){ int value = 0; int flag = 1; //判断符号 while (*str == ' ') //跳过字符串前面的空格 { str++; } if (*str == '-') //第一个字符若是‘-’,说明可能是负数 { flag = 0; str++; } else if (*str == '+') //第一个字符若是‘+’,说明可能是正数 { flag = 1; str++; }//第一个字符若不是‘+’‘-’也不是数字字符,直接返回0 else if (*str 阅读全文
posted @ 2014-02-25 18:10 realmeh 阅读(310) 评论(0) 推荐(0) 编辑
摘要: /*链表反转的算法,其实很简单*/list*listreverse(list*pHead){list*pList=pHead;list*paPre=NULL;list*paNext=NULL;do{paNext=pList->pNext;pList->pNext=paPre;paPre=pList;pList=paNext;}while(pList!=NULL);returnpaPre;} 阅读全文
posted @ 2014-02-25 15:52 realmeh 阅读(105) 评论(0) 推荐(0) 编辑

2014年1月29日

摘要: 深度优先搜索算法(Depth First Search),是搜索算法的一种。是沿着树的深度遍历树的节点,尽可能深的搜索树的分支。当节点v的所有边都己被探寻过,搜索将回溯到发现节点v的那条边的起始节点。这一过程一直进行到已发现从源节点可达的所有节点为止。如果还存在未被发现的节点,则选择其中一个作为源节点并重复以上过程,整个进程反复进行直到所有节点都被访问为止。如右图所示的二叉树:A 是第一个访问的,然后顺序是 B、D,然后是 E。接着再是 C、F、G。那么,怎么样才能来保证这个访问的顺序呢?分析一下,在遍历了根结点后,就开始遍历左子树,最后才是右子树。因此可以借助堆栈的数据结构,由于堆栈是后进先 阅读全文
posted @ 2014-01-29 12:15 realmeh 阅读(318) 评论(0) 推荐(0) 编辑

2014年1月2日

摘要: 1.非递归方式#include "stdafx.h"#include using namespace std;struct ListNode{int m_nValue;ListNode *m_pNext;};//合并两个有序链表,非递归方法ListNode *MergeTwoList(ListNode *pListOneHead, ListNode *pListTwoHead){if (pListOneHead == NULL){return pListTwoHead;}if (pListTwoHead == NULL){return pListOneHead;}ListN 阅读全文
posted @ 2014-01-02 18:59 realmeh 阅读(278) 评论(0) 推荐(0) 编辑

导航