摘要:
1: #NS2_有线部分\homework03.tcl 2: 3: #Create a simulator object 4: set ns [new Simulator] 5: 6: #Define different colors for data flows 7: $ns color 1 Blue 8: $ns color 2 Red 9: 10: #Open the nam trace file 11: set nf [open szsh.nam w] 12: $ns namtrace-all $nf 13: 14: #Open the trace reco... 阅读全文
摘要:
1: #NS2_有线部分\homework02.tcl 2: 3: #Create a simulator object 4: set ns [new Simulator] 5: 6: #Define different colors for data flows 7: $ns color 1 Blue 8: $ns color 2 Red 9: 10: #Open the nam trace file 11: set nf [open szsh.nam w] 12: $ns namtrace-all $nf 13: 14: #Open the trace reco... 阅读全文
摘要:
1: #NS2_有线部分\homework01.tcl 2: 3: #创建两个结点,深圳到北京的TCP连接,图形将数据显示出来,计算吞吐率,画图分析 4: #tcp上层用ftp 5: #udp上层用cbr 6: #Create a simulator object 7: set ns [new Simulator] 8: 9: set nf [open SZ2BJ.nam w] 10: $ns namtrace-all $nf 11: 12: set nd [open SZ2BJ.tr w] 13: $ns namtrace-all $nd 14: 15: proc... 阅读全文
摘要:
1: #NS2_有线部分\ForGnuplot.plot 2: 3: #gnuplot> 4: #set xtics 0, 1, 10 5: set grid 6: set xrange [0:10] 7: set yrange [0:1000] 8: set key top left set key bottom right 9: set key box 10: set title "TCP Throughput" 11: set xlabel "Time(s)" 12: set ylabel "Throughput(kb)" 阅读全文
摘要:
1: #NS2_有线部分\Throughput.awk 2: 3: BEGIN { 4: #Initialize the variable 5: init = 0; 6: i = 0; 7: } 8: 9: { 10: #Event Abbreviation Type Value 11: #%g %d %d %s %d %s %d %d.%d %d.%d %d %d 12: #Normal Event 13: #r: Receive 14: #d: Drop 15: #e: Error 16: ... 阅读全文
摘要:
1: #NS2_有线部分\LossRate.awk 2: 3: BEGIN { 4: #Initialize the variable 5: Lost = 0; #the Sum of Lost packet 6: Send = 0; #the Sum of Send packet 7: } 8: 9: { 10: #Event Abbreviation Type Value 11: #%g %d %d %s %d %s %d %d.%d %d.%d %d %d 12: #Normal Event 13: #r... 阅读全文
摘要:
关键字:WinPcap 网卡 MAC地址作者:txw1958在WpdPack_4_1_2\WpdPack\Examples-remote\PacketDriver\GetMacAddress\目录下有获取MAC地址源文件GetMacAddress.c 1: /* 2: * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy) 3: * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California) 4: * All rights re... 阅读全文
摘要:
1: #NS2_有线部分\EndDelay.awk 2: 3: BEGIN { 4: #Initialize the variable 5: MaxID = 0; 6: i = 0; 7: } 8: 9: { 10: #Event Abbreviation Type Value 11: #%g %d %d %s %d %s %d %d.%d %d.%d %d %d 12: #Normal Event 13: #r: Receive 14: #d: Drop 15: #e: Error 16: ... 阅读全文
摘要:
关键字:IP地址 正则表达式作者:txw1958出处:http://www.cnblogs.com/txw1958/archive/2011/10/13/ip_address_regular_expression.html IP地址的长度为32位,分为4段,每段8位,用十进制数字表示,每段数字范围为 阅读全文
摘要:
1: echo %time% 2: 3: 4: rem ** ipc and mapping 5: c: 6: net use x: /del 7: net use y: /del 8: net use \\10.11.44.1\ipc$ /del 9: echo ============================================== 10: net ... 阅读全文
摘要:
第二十二章、 其它应用 1) Web服务 ##代码 s 000063.SZ ##开盘 o 26.60 ##最高 h 27.05 ##最低 g 26.52 ##最新 l1 26.66 ##涨跌 c1 -0.04 ##涨幅 p2 -0.15% ##总手 v 9190865 ##日期 d1 6/15/2011 ##时间 t1 3:00am #!/usr/bin/env python from time import ctime from urllib import urlopen import re ti... 阅读全文
摘要:
1: rem "D:\Microsoft Visual Studio 8\SDK\v2.0\Bin\sdkvars.bat" 2: D: 3: cd ..\..\..\..\..\..\..\..\..\..\..\..\ 4: cd "D:\Microsoft Visual Studio 8\SDK\v2.0\Bin" 5: 6: @Set Path=D:\Micros... 阅读全文
摘要:
第二十一章、 扩展Python /* D:\Python27\Lib\Extest-1.0\Extest2.c */ #include <stdio.h>#include <stdlib.h>#include <string.h> #include "Python.h" int fac(int n){ if (n < 2) return(1); return (n)*fac(n-1);} static PyObject *Extest_fac(PyObject *self, PyObject *args){ int num; if 阅读全文
摘要:
第二十章、 数据库编程 环境设置 1).安装MySQL-python http://www.lfd.uci.edu/~gohlke/pythonlibs/ MySQL-python-1.2.3.win32-py2.7.exe 1) 使用数据库接口 import MySQLdb cxn = MySQLdb.Connect(host = '127.0.0.1', user = 'root', passwd = 'root') cur = cxn.cursor() try: cur.execute("DROP DATABASE test610 阅读全文
摘要:
1: subst t: /d 2: subst t: D:\PublicViews\Automation_Framework\SQA_ATE_DEV 3: 4: rem ** update folders 5: t: 6: cd ..\..\..\..\..\..\..\..\..\..\..\..\ 7: 8: rmdir /s /q "t:\_updated_jimm... 阅读全文
摘要:
第十九章、 图形界面编程 import Tkintertop = Tkinter.Tk() hello = Tkinter.Label(top, text='Hello World!')hello.pack()quit = Tkinter.Button(top, text='QUIT',command=top.quit)quit.pack(fill=Tkinter.X, expand=1) Tkinter.mainloop() 阅读全文
摘要:
第十八章、 Web编程 import urllib2 LOGIN = 'jin'PASSWD = 'Welcome'URL = 'https://tlv-tools-qc:8443/qcbin/start_a.htm'def handler_version(url): from urlparse import urlparse as up hdlr = urllib2.HTTPBasicAuthHandler() hdlr.add_password('Archives', up(url)[1], LOGIN, PASSWD) op 阅读全文
摘要:
第十七章、 网络编程 1) FTP客户端 import ftplibimport osimport socket HOST = '127.0.0.1'DIRN = 'menus'FILE = 'hello.txt'USER = 'taojin'PASS = 'pass123' def main(): try: f = ftplib.FTP(HOST) f.login(user = USER, passwd = PASS) f.cwd(DIRN) f.retrbinary('RETR %s' % FI 阅读全文
摘要:
第十六章、 正则表达式 1) 匹配多个表达式 记号 re1|re2 说明 匹配正则表达式re1或re2 举例 foo|bar 匹配 foo, bar 记号 {N} 说明 匹配前面出现的正则表达式N 举例 [0-9]{3} 匹配 2) 匹配单个/多个/范围内字符 记号 . 说明 匹配任何字符(换行符除外) 举例 b.b 匹配 b和b中间有一个任意字符bab, bcb, bbb 举例 .. (匹配任何两个字符) 匹配 xx, ab 记号 […] 说明 匹配字符组里面出现的任意一个字符 举例 b[aeiou]t 匹配3字符串 bat,bit,but,bet 举例 [ab][23][xy] 匹配3字符 阅读全文
摘要:
第十五章、 结构布局 #!/usr/bin/env python #(1)起始行 "this is a module" #(2)模块文档 import sys #(3)模块导入 debug = True #(4)全局变量定义 class Fooclass(object): #(5)类定义 "Foo class" pass def test(): #(6)函数定义 "test function" foo = Fooclass() if... 阅读全文