12 2011 档案

摘要:#author=lx#date=2011-12-27import osimport sysclass node: "store the information of a node in bnt" def __init__( self, nodename=None, cptnum=2, pnum=0, cnum=0, parename=None, childname=None ): self.node_name = nodename self.cpt_num = cptnum s... 阅读全文
posted @ 2011-12-27 19:47 lxgeek 阅读(618) 评论(0) 推荐(0) 编辑
摘要:#! /bin/bashLX=100for i in 1 2 3do c=$(echo "scale=2;$i/$LX"|bc) echo -n "0$c ";doneecho; 阅读全文
posted @ 2011-12-22 17:31 lxgeek 阅读(511) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h>#include <stdlib.h>typedef unsigned char *byte_pointer;void show_bytes( byte_pointer start, int len ){ int i; for ( i = 0; i < len; i++ ) { printf( "%.2x", start[i] ); } printf( "\n" );}void show_int( int x ){ show_bytes( (by... 阅读全文
posted @ 2011-12-21 17:01 lxgeek 阅读(545) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2011-12-15 19:18 lxgeek 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2011-12-15 16:44 lxgeek 阅读(1265) 评论(0) 推荐(0) 编辑
摘要:开始不知道怎么弄,后来看看应该是对select()函数的最后一个参数进行设置才对,改成可以命令行中输入 -w time_out的情况。不知道对不对哦。源码在这里:https://github.com/lxlenovostar/m_ping 阅读全文
posted @ 2011-12-13 19:16 lxgeek 阅读(385) 评论(0) 推荐(0) 编辑
摘要:今天实现了控制发包频率,这个很简单,就是修改了源码中alarm()的时间,可以从命令行中读取相应的时间。代码在此:https://github.com/lxlenovostar/m_ping 阅读全文
posted @ 2011-12-12 21:23 lxgeek 阅读(788) 评论(0) 推荐(0) 编辑
摘要:#include <stdlib.h>#include <stdio.h>intmain( int argc, char** argv ){ int i = 0; for ( ; i < argc; i++ ) { printf( "argv[%d] is %s\n", i, argv[i] ); } int arg_c = argc; char** arg_v = argv; arg_c--, arg_v++; while (arg_c > 0 && ... 阅读全文
posted @ 2011-12-12 21:18 lxgeek 阅读(245) 评论(0) 推荐(0) 编辑
摘要:呵呵,接着完善 https://github.com/lxlenovostar/py_ping 阅读全文
posted @ 2011-12-09 19:43 lxgeek 阅读(152) 评论(0) 推荐(0) 编辑