摘要: 第一种是使用arping工具: 1 #!/usr/bin/env python 2 import subprocess 3 import sys 4 import re 5 6 def arping(ipaddress = "192.168.1.1"): 7 p = subprocess.Popen("/usr/sbin/arping -c 2 %s" % ipaddress, shell = True, 8 stdout = subprocess.PIPE) 9 out = p.stdout.read()10 ... 阅读全文
posted @ 2014-02-26 16:30 sangoly 阅读(1980) 评论(0) 推荐(0) 编辑
摘要: 间接寻址(indirect addressing)是公式化描述和链表描述的组合。采用这种方法,可以保留公式化描述方法的许多优点,在单位时间内访问每个元素,可采用二叉搜索方法在对数时间内对一个有序表进行搜索等等。与此同时,也可以获得链表描述方法的重要特色---在诸如插入和删除操作期间不必对元素进行实际的移动。因些,大多数间接寻址链表操作的时间复杂度都有元素的总数无关。 说到底,间接寻址只是一个每链只有一个节点的邻接矩阵。实现起来简单方便,兼具顺序表与链表的优点。 本次程序采用仍使用C++语言实现,为保证通用性使用模板机制。 程序结构: 1、IndirectAddr.h ... 阅读全文
posted @ 2014-02-26 13:35 sangoly 阅读(1057) 评论(0) 推荐(0) 编辑
摘要: Not all conditional expressions can be compiled using conditional moves. Most significantly, the abstract code we have shown evaluates both then-expr and else-expr regardless of the test outcome. If one of those two expressions could possibly generate an error condition or a side effect, this coul.. 阅读全文
posted @ 2014-02-26 11:45 sangoly 阅读(428) 评论(0) 推荐(0) 编辑