上一页 1 2 3 4 5 6 7 8 9 10 ··· 15 下一页
摘要: for item in msg: print "%X,"%ord(item) 阅读全文
posted @ 2013-07-10 13:16 李伯波 阅读(1436) 评论(0) 推荐(0) 编辑
摘要: http://blog.csdn.net/sunboy_2050/article/details/5130789使用 mysql> SHOW VARIABLES LIKE 'character%';查看 [client] default-character-set=utf8 [mysqld] de... 阅读全文
posted @ 2013-07-09 15:05 李伯波 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 参考:http://www.cnblogs.com/fxjwind/archive/2011/07/05/2098636.html http://amazingjxq.com/2012/01/09/python%E8%B0%83%E7%94%A8c%E5%87%BD%E6%95%B0/>>>cd /home/jxq/code/gcc -fPIC -shared bob_hash.c -o bob_hash.so然后在python里面用ctypes加载刚才的动态库。argtypes和restype分别对应函数的参数和返回值的类型。这样就可以直接调用了。 >>> 阅读全文
posted @ 2013-07-08 18:36 李伯波 阅读(332) 评论(0) 推荐(0) 编辑
摘要: 1、encode,decode:用来编码和 解码文件的,也可以对StringIO里的数据做编解码2、encodestring,decodestring:用来编码和解码字符串3、b64encode和b64decode:用来编码和解码字符串,并且有一个替换符号字符的功能 阅读全文
posted @ 2013-07-06 16:55 李伯波 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 一个简单的例子:from pyDes import *data = "Please encrypt my data"k = des("DESCRYPT", CBC, "\0\0\0\0\0\0\0\0", pad=None, padmode=PAD_PKCS5)d = k.encrypt(data)print "Encrypted: %r" % dprint "Decrypted: %r" % k.decrypt(d)assert k.decrypt(d, padmode=PAD_PKCS5) 阅读全文
posted @ 2013-07-06 16:44 李伯波 阅读(1196) 评论(0) 推荐(0) 编辑
摘要: #import "GTMBase64.h"- (void)testExample{ NSData *data = [@"HelloWorld" dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES]; NSString* encoded = [[NSString alloc] initWithData:[GTMBase64 encodeData:data] encoding:NSUTF8StringEncoding]; NSLog(@"encoded:%@", 阅读全文
posted @ 2013-07-06 11:54 李伯波 阅读(673) 评论(0) 推荐(0) 编辑
摘要: NSData *btsData = [in_str dataUsingEncoding:NSUTF8StringEncoding];Byte *byteData = (Byte*)malloc(len);memcpy(byteData, [btsData bytes], len);NSMutableData *bts2Data = [NSMutableDatadataWithLength:len];[bts2Data initWithBytes:byteData length:len]; 阅读全文
posted @ 2013-07-06 11:22 李伯波 阅读(4849) 评论(0) 推荐(0) 编辑
摘要: //NSString 转换为char * NSString *blankText = @"sevensoft is a mobile software outsourcing company"; char *ptr = [blankText cStringUsingEncoding:NSASCIIStringEncoding]; //char * 转换为 NSString char encode_buf[1024]; NSString *encrypted = [[NSString alloc] initWithCString:(const char*)encode_buf 阅读全文
posted @ 2013-07-05 10:55 李伯波 阅读(1808) 评论(0) 推荐(0) 编辑
摘要: 在iOS6下shouldAutorotateToInterfaceOrientation被弃用,现在iOS6下有三个新方法处理屏幕旋转:[plain] view plaincopy //是否支持屏幕旋转 -(BOOL)shouldAutorotate{ returnYES; } //支持的旋转方向 -(NSUInteger)supportedInterfaceOrientations{ returnUIInterfaceOrientationMaskAllButUpsideDown;//UIInterfaceOrientationMask... 阅读全文
posted @ 2013-07-03 15:29 李伯波 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 最简方法: apt-get install python-mysqldb源代码方法: 然后解压,打开README:里面有安装过程: $ tar xfz MySQL-python-1.2.1.tar.gz $ cd MySQL-python-1.2.1 $ # edit site.cfg if nec... 阅读全文
posted @ 2013-07-01 15:24 李伯波 阅读(718) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 15 下一页