导航

2013年8月10日

摘要: 上代码之前先讲个笑话:曾经有位面试官问:“你实现过 唉踢哦诶(音) 吗”? 我第一个想到的是各种OA系统,心想那玩意不多是Java实现的吗。。。过一会想明白了,瞬间石化。。。 1 #include 2 #include 3 4 int8_t Myitoa(int64_t In_i64SrcNum, uint8_t In_i8Radix, char *In_pcDst) 5 { 6 int8_t i8RetVal = 0; 7 //这里强转是为了2、8、16进制显示的时候不需要符号 8 uint64_t ui64SrcNum = (uint... 阅读全文

posted @ 2013-08-10 00:05 codeape 阅读(670) 评论(0) 推荐(0) 编辑

2013年8月1日

摘要: 因为左移操作不会导致符号位出现缺位,所以不考虑符号位,低位补0即可;右移操作会涉及到符号位出现缺位的问题,所以在有符号数的右移操作时要考虑符号位怎么补的问题。 左移操作(>)对于无符号数来讲为逻辑右移,对应汇编中的shr,对于有符号数来讲为算数右移,对应汇编中的sar。 对于VC编译器编出来的代码,移位操作的位数保存在cl寄存器。 当移动的位数大于或等于该数据类型位数时,CPU对移动的位数进行基于数据类型位数的取余运算,余数为实际移动的位数。比如uint32_t类型左移32位,实际移动0位,也就是数字保持不变;左移33位,则实际左移1位。 逻辑左移时,高位补0;逻辑右移时,低位补0... 阅读全文

posted @ 2013-08-01 00:04 codeape 阅读(2757) 评论(0) 推荐(0) 编辑

2013年1月6日

摘要: http://www.cplusplus.com/reference/cstdio/printf/%lld 在Windows下说什么也编译不过啊有木有!!!原来Windows下是这个鸟样的 %I64d我操操操! 阅读全文

posted @ 2013-01-06 11:41 codeape 阅读(749) 评论(0) 推荐(0) 编辑

2012年12月20日

摘要: [2012-12-20 10:53:31,601 pyinotify WARNING] Event queue overflowed.程序内部要做缓存啊,有木有。 阅读全文

posted @ 2012-12-20 13:02 codeape 阅读(346) 评论(4) 推荐(0) 编辑

摘要: time.clock()On Unix, return the current processor time as a floating point number expressed in seconds. The precision, and in fact the very definition of the meaning of “processor time”, depends on that of the C function of the same name, but in any case, this is the function to use for benchmarking 阅读全文

posted @ 2012-12-20 09:42 codeape 阅读(661) 评论(0) 推荐(0) 编辑

摘要: sqlite3.OperationalErrorsqlite3.connect(database[, timeout, detect_types, isolation_level, check_same_thread, factory, cached_statements])Opens a connection to the SQLite database file database. You can use ":memory:" to open a database connection to a database that resides in RAM instead 阅读全文

posted @ 2012-12-20 09:39 codeape 阅读(4276) 评论(0) 推荐(0) 编辑

2012年11月21日

摘要: Python 字典 遍历 删除 pop 阅读全文

posted @ 2012-11-21 13:07 codeape 阅读(10341) 评论(0) 推荐(0) 编辑

2012年10月25日

摘要: __stdcall是Pascal程序的缺省调用方式,通常用于Win32 API中,函数采用从右到左的压栈方式,自己在退出时清空栈。VC将函数编译后会在函数名前面加上下划线前缀,在函数名后加上"@"和参数的字节数。 int f(void *p) -->> _f@4(在外部汇编语言里可以用这个名字引用这个函数)。 C调用约定(即用__cdecl关键字说明)(The C default calling convention)按从右至左的顺序压参数入栈,由调用者把参数弹出栈。对于传送参数的内存栈是由调用者来维护的(正因为如此,实现可变参数 vararg的函数(如printf)只能使用该调用约定)。另外,在函数名修饰约定方面也有所不同。__cdecl是C和C++程序的缺省调用方式。每一个调用它的函数都包含清空栈的代码,所以产生的可执行文件大小会比调用__stdcall函数的大。函数采用从右到左的压栈方式。VC将函数编译后会在函数名前面加上下划线前缀。 阅读全文

posted @ 2012-10-25 20:23 codeape 阅读(439) 评论(0) 推荐(0) 编辑