Karp-Rabin algorithm

 

Description

Hashing provides a simple method to avoid a quadratic number of character comparisons in most practical situations. Instead of checking at each position of the text if the pattern occurs, it seems to be more efficient to check only if the contents of the window “looks like” the pa[......]

Read more

发表在 ALL | 留下评论

linux bridge config

brctl addbr me
brctl addif me eth0
brctl addif me eth1
ifconfig eth0 0 up
ifconfig eth1 0 up
ifconfig me x.x.x.x netmask 255.255.255.0 up
route add default gw x.x.255.254
发表在 ALL | 留下评论

py pyc pyo 关系

py是源程序
pyc是编译后的程序 在执行python源程序时,python会自动将源程序编译成为pyc文件
pyo是优化编译后的程序 python -O 源文件即可将源程序编译为pyo文件

发表在 ALL | 留下评论

Access、Hybrid和Trunk

 

 

来源:http://blog.csdn.net/tqyou85/article/details/4959695

Untag 就是普通的 ethernet 报文,普通 PC 机的网卡是可以识别这样的报文进行通讯。 Tag 报文结构的变化是在源 mac 地址和目的 mac 地址之后,加上了 4bytes 的 vlan 信息,也就是 vlan tag 头,一般来说这样的报文普通 PC 机的网卡是不能识别的。

带 802.1Q 的帧是在标准以太网帧上插入了 4 个字节的标识,其中包含:

1) 2 个字节的协议标示符( TPID ),当前置 0X8100 的固定值,表明该帧带[......]

Read more

发表在 ALL | 留下评论

Netlink 套接字

 

来源:http://blog.csdn.net/tqyou85/article/details/3939931

Netlink 用于在内核模块与在用户地址空间中的进程之间传递消息的。它包含了用于用户进程的基于标准套接字的接口和用于内核模块的一个内部核心 API。

Netlink 是一种特殊的 socket,它是 Linux 所特有的,类似于 BSD 中的AF_ROUTE 但又远比它的功能强大,目前在最新的 Linux 内核(2.6.14)中使用netlink 进行应用与内核通信的应用很多,包括:路由 daemon(NETLINK_ROUTE),1-wire 子系统(NETLINK[......]

Read more

发表在 ALL | 留下评论