self-confidence,the source of all the power

导航

2011年4月29日 #

a few python special functions:__getitem__

摘要: 1、__getitem__原文文档:For instance, if a class defines a method named__getitem__(), andxis an instance of this class, thenx[i]is roughly equivalent tox.__getitem__(i)for old-style classes andtype(x).__getitem__(x,i)for new-style classes. Except where mentioned, attempts to execute an operation raise an 阅读全文

posted @ 2011-04-29 10:24 漩涡鸣人 阅读(1957) 评论(0) 推荐(0) 编辑

2011年4月26日 #

python sys.argv usage

摘要: 1、这个例子是简明python教程上的,明白它之后你就明白sys.argv[]了。view plaincopy to clipboardprint?importsysdefreadfile(filename):#从文件中读出文件内容'''''Printafiletothestandardoutput.'''f=file(filename)whileTrue:line=f.readline()iflen(line)==0:breakprintline,#noticecomma分别输出每行内容f.close()#Scriptstart 阅读全文

posted @ 2011-04-26 17:39 漩涡鸣人 阅读(1579) 评论(0) 推荐(0) 编辑

python glob model

摘要: 说明:1、glob是python自己带的一个文件操作相关模块,用它可以查找符合自己目的的文件,就类似于Windows下的文件搜索,支持通配符操作,*,?,[]这三个通配符,*代表0个或多个字符,?代表一个字符,[]匹配指定范围内的字符,如[0-9]匹配数字。 它的主要方法就是glob,该方法返回所有匹配的文件路径列表,该方法需要一个参数用来指定匹配的路径字符串(本字符串可以为绝对路径也可以为相对路径),其返回的文件名只包括当前目录里的文件名,不包括子文件夹里的文件。比如:glob.glob(r'c:\*.txt')我这里就是获得C盘下的所有txt文件glob.glob(r 阅读全文

posted @ 2011-04-26 17:18 漩涡鸣人 阅读(13437) 评论(0) 推荐(0) 编辑

2011年4月25日 #

网络性能指标的几个定义

摘要: 延时 网络延时 网络延时指一个数据包从用户的计算机发送到网站服务器,然后再立即从网站服务器返回用户计算机的来回时间。通常使用网络管理工具PING(Packet Internet Grope)来测量网络延时。 由于互联网络的复杂性、网络流量的动态变化和网络路由的动态选择,网络延时随时都在不停的变化称为抖动)。网络延时和网络延时的抖动越小,那么网络的质量就越好。 在互联网上,典型的网络延时为几十到几百毫秒。影响网络延时的主要因素是路由的跳数(因为每次路由转发都需要时间,因此路由跳数越多,网络延时越大)和网络的流量(网络流量越大,交换机和路由器排队的时间就越长,网络延时也就越大)。交换机延时(Lat 阅读全文

posted @ 2011-04-25 16:54 漩涡鸣人 阅读(3113) 评论(0) 推荐(0) 编辑

2011年4月22日 #

python 类继承的使用

摘要: #!/usr/bin/python# Filename: inherit.pyclass SchoolMember:'''Represents any school member.'''def __init__(self, name, age):self.name = nameself.age = ageprint'(Initialized SchoolMember: %s)'% self.namedef tell(self):'''Tell my details.'''print& 阅读全文

posted @ 2011-04-22 14:35 漩涡鸣人 阅读(2166) 评论(0) 推荐(0) 编辑

2011年2月22日 #

NS3的两个例子

摘要: /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ //Emacs模式行,GPL boilerplate#include "ns3/core-module.h" //#include "ns3/simulator-module.h"#include "ns3/node-module.h"#include "ns3/helper-module.h"// Default Network Topology//// 10.1 阅读全文

posted @ 2011-02-22 16:11 漩涡鸣人 阅读(4307) 评论(0) 推荐(0) 编辑

2011年2月21日 #

NS3中文教程5:Tweaking NS3

摘要: 5 Tweaking NS3 (NS3调整?) http://www.nsnam.org/docs/release/tutorial/tutorial_16.html#Conceptual-Overview 翻译: 杨飞422467574@qq.com校稿: Xiaochuan Shenxcs105@zepler.net编辑: ProbibidoAmor banana.0420@yahoo.com.cn5.1 日志模块的使用在运行first.cc脚本时,我们已经简单的了解了日志模块。现在,我们将更深入的了解日志子系统是为哪些用户案例设计的。5.1.1 日志概述很多大型系统支持某种的消息日志功能 阅读全文

posted @ 2011-02-21 10:35 漩涡鸣人 阅读(5065) 评论(0) 推荐(0) 编辑

2011年2月16日 #

python源模块,扩展

摘要: 转的别人的:Python具有强大的扩展能力,我列出了50个很棒的Python模块,包含几乎所有的需要:比如Databases,GUIs,Images, Sound, OS interaction, Web,以及其他。推荐收藏。 Graphical interface wxPython http://wxpython.org Graphical interface pyGtk http://www.pygtk.org/ Graphical interface pyQT http://www.riverbankcomputing.co.uk/pyqt/ Graphical interface Pm 阅读全文

posted @ 2011-02-16 10:59 漩涡鸣人 阅读(576) 评论(0) 推荐(0) 编辑

2011年2月12日 #

NS3中文:4 概念描述

摘要: 4 概念概述(Conceptual Overview) http://www.nsnam.org/docs/release/tutorial/tutorial_16.html#Conceptual-Overview 翻译: 陈杰 刘小洋piyajee@163.com (百思论坛)校稿: Xiaochuan Shenxcs105@zepler.net编辑: ProbibidoAmor banana.0420@yahoo.com.cn4.1 关键的抽象概念(Key Abstractions) 在本节中,我们将回顾一些常用的网络术语,以及它们在ns-3的特定含义。4.1.1 节点在因特网术语中,任何 阅读全文

posted @ 2011-02-12 10:09 漩涡鸣人 阅读(3064) 评论(0) 推荐(1) 编辑

NS-3笔录

摘要: 一、简介1. 什么是NS-3?NS是一个离散事件驱动网络模拟器。官方定义:(from http://www.nsnam.org/)ns-3 is a discrete-event network simulator for Internet systems, targeted primarily for research and educational use. ns-3 is free software, licensed under the GNU GPLv2 license, and is publicly available for research, development, and 阅读全文

posted @ 2011-02-12 10:01 漩涡鸣人 阅读(2472) 评论(0) 推荐(1) 编辑