11 2014 档案

摘要:静态方法(staticmethod)类方法(classmethod)静态方法和类方法都可以通过类名.方法名或者实例.方法访问。#-*- coding:utf8 -*- ... 阅读全文
posted @ 2014-11-27 17:10 小郭学路 阅读(204) 评论(0) 推荐(0) 编辑
摘要:1、规则要求https://www.python.org/dev/peps/pep-00082、工具https://github.com/jcrocholl/pep83、基本使用方法测试自己的代码:[guosong@etch171 mars171 guosong]# pep8 --first cou... 阅读全文
posted @ 2014-11-23 16:48 小郭学路 阅读(1560) 评论(0) 推荐(0) 编辑
摘要:最近查了下这个问题,并尝试复现了当时的死锁情况,下面是重现过程时间点事务A事务B事务CT0BeginBeginBeginT1update test.t1 set vflag=7, source=576792, fflag=1, mflag=7 where uid=2491598800 and vfl... 阅读全文
posted @ 2014-11-19 18:27 小郭学路 阅读(608) 评论(0) 推荐(0) 编辑
摘要:在python 下面一个包含中文字符串的列表(list)或字典,直接使用print会出现以下的结果:>>> adict={'a':'中文'} >>> print adict{'a': '\xe4\xb8\xad\xe6\x96\x87'} 在输出处理好的数据结构的时候很不方便,需要使用以下方法进行... 阅读全文
posted @ 2014-11-12 16:08 小郭学路 阅读(1237) 评论(0) 推荐(0) 编辑
摘要:MySQL的explain是各种执行计划选择的结果,如果想看整个执行计划以及对于多种索引方案之间是如何选择的?MySQL5.6中支持这个功能,optimizer_trace这个是mysql的参数,默认是关闭的mysql> set optimizer_trace="enabled=on";Query ... 阅读全文
posted @ 2014-11-03 12:37 小郭学路 阅读(5231) 评论(0) 推荐(0) 编辑