我们经常看到各种被双下划线环绕的方法,如__init__,它们就是魔术方法.
魔术方法是python语言预定好的"协议",不同魔术方法在不同场景下,会被隐式调用.我们通过重载这些方法,从而操控各种行为.
class A(object):
def __str__(self):
return "I am A,2333"
def __len__(self):
...
分类:
编程语言 时间:
2014-10-17 15:30:54
阅读次数:
494
题目链接 :http://acm.bnu.edu.cn/v3/problem_show.php?pid=40517这又是很不错的一道题目。题意是给一个n*n(n 2 #include 3 #include 4 5 using namespace std; 6 #define lson a, ...
分类:
其他好文 时间:
2014-10-17 01:08:53
阅读次数:
287
五:数据的接收和发送 1、 发送过程: 应用发送数据时调用接口 rtp_session_send_with_ts 完成。参数为会话句柄,数据缓冲区地址,数据长度以及应用当前的时间戳。在该接口中,会先调用 rtp_session_create_packet 接口,根据缓冲区地址及数据长度,构造一个新的...
分类:
其他好文 时间:
2014-10-16 21:19:13
阅读次数:
750
php.ini有个配置项,magic_quotes_gpc,值为on时就会自动在SQL敏感字符前面加“\”注释(比如单引号‘)你可以在php.ini中设成off禁用,或者在php中判断一下if(!get_magic_quotes_gpc()){//处理字符串,自动添加“\”$_POST[‘message‘]=addslashes($_POST[‘message‘]);}else{//..
分类:
Web程序 时间:
2014-10-14 21:41:50
阅读次数:
191
#include #include #include#includeusing namespace std;double num[1000000];void init_arrary(){ for (int i = 1; i > n >> m){ double sum=0,res;...
分类:
其他好文 时间:
2014-10-12 13:20:07
阅读次数:
145
译者注:本文原文Revealing the Magic of JavaScript,原标题“揭秘JavaScript魔法”,本文深入浅出,揭示了几个前沿框架如jQuery、angularJs、EmberJs和React的几个核心功能点的实现技巧,无论是对前端菜鸟还是老鸟,相信都会有一定的启迪。鄙人精...
分类:
其他好文 时间:
2014-10-11 22:15:56
阅读次数:
422
dpdk.orgWhat it isIntel® DPDK is a set of libraries and drivers for fast packet processing on x86 platforms. It runs mostly in Linux userland.This pro...
分类:
其他好文 时间:
2014-10-11 14:08:05
阅读次数:
266
winpcap和libpcap winpcap windows packet capture WinPcap is the industry-standard tool for link-layer network access in Windows environments: it allows applications to capture and transmit network ...
IMAGE_DOS_HEADER STRUCT{+0h WORD e_magic // Magic DOS signature MZ(4Dh 5Ah) DOS可执行文件标记+2h WORD e_cblp // Bytes on last page of file+4h WORD e_cp ...
分类:
其他好文 时间:
2014-10-09 20:18:47
阅读次数:
201
通信信息包是发送至MySQL服务器的单个SQL语句,或发送至客户端的单一行。当MySQL客户端或mysqld服务器收到大于max_allowed_packet字节的信息包时,将发出“信息包过大”错误,并关闭连接。对于某些客户端,如果通信信息包过大,在执行查询期间,可能会遇到“丢失与MySQL服务器的...
分类:
其他好文 时间:
2014-10-08 15:20:45
阅读次数:
138