摘要: 仅仅是urllib2.unquote_plus解码是不够的,需要将特殊字符去掉 BOM: https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8 ASCII Characters: http://donsnotes.com/tech/charsets/ 阅读全文
posted @ 2018-08-06 12:09 bierxiaobia 阅读(2091) 评论(0) 推荐(0) 编辑
摘要: 数据太大压缩存储,可以使用zlib中的压缩函数,代码如下: 1 import ujson 2 import MySQLdb 3 import zlib 4 import base64 5 6 kwargs = { 7 'host': '0.0.0.0', 8 'port': 3307, 9 'db': 'test', 10 'user': 't... 阅读全文
posted @ 2018-07-06 18:19 bierxiaobia 阅读(458) 评论(0) 推荐(0) 编辑
摘要: 事务是数据库执行的一系列操作。 事务最主要的是ACID四个特性: 原子性-事务要么全部执行,要么全不执行 一致性-一个事务的执行不应该破坏数据库的完整性约束 隔离性-事务之间相互隔离,互不影响,这又涉及到了四个隔离等级 持久性:事务提交后需要将提交的事务持久化到磁盘,这样及时系统崩溃,提交的事务也不 阅读全文
posted @ 2017-03-19 11:39 bierxiaobia 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 说来惭愧,用了这么久linux会的命令也只有常用的那么几个。。 今天刚刚学到的一个很实用的split命令,原本就只是知道开发语言中有split方法用来切分字符串,linux命令行也提供了这样一个方法。 用法: 1)要将一个文件分割成包含指定行数的多个文件 split [ -l LineCount ] 阅读全文
posted @ 2017-02-23 20:03 bierxiaobia 阅读(115) 评论(0) 推荐(0) 编辑
摘要: md5sum命令用于创建linux文件的md5 常用格式 md5sum file_name > md5_save_file.md5 校验生成的md5可以用 md5sum -c md5_save_file.md5 md5_save_file.md5这个文件报名的格式为:62ada15c39019323 阅读全文
posted @ 2017-02-23 17:44 bierxiaobia 阅读(181) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/mchina/archive/2013/01/30/2880680.html 阅读全文
posted @ 2017-02-23 17:39 bierxiaobia 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 遍历file的方式 阅读全文
posted @ 2017-02-23 17:31 bierxiaobia 阅读(474) 评论(0) 推荐(0) 编辑
摘要: 一、shell变量自增a=1a=$(($a+1))a=$[$a+1]a=`expr $a + 1`let a++ let a+=1 ((a++)) echo $a 二、python脚本接收参数 from sys import argv argv[0] # 脚本名 first_arg = argv[1 阅读全文
posted @ 2017-02-23 16:31 bierxiaobia 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 系统linux > show global max_allowed_packet; >set global max_allowed_packet=1024*1024; 退出mysql,重启生效 注意配置限制,查看/etc/my.cnf 阅读全文
posted @ 2016-10-19 15:47 bierxiaobia 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 在不同的分支上merge是有点很危险的事情,尤其当两个分支内容差异较大的时候,而恰好,你想合并的就是几次commit而已,那么用cherry-pick吧。 将B分支的提交合并到A分支: git checkout B git log 粘贴想要合成的commitid git checkout A git 阅读全文
posted @ 2016-10-19 15:42 bierxiaobia 阅读(123) 评论(0) 推荐(0) 编辑