ITeye博客

icbm的博客

icbm · 共 31 篇文章

Python的装饰器(decorator)

# coding=utf-8 """装饰器: """ def deco(func): """无参数装饰器,接受一个函数,返回一个新的函数。 """ def f(*args, **kwargs): print "----", func.__name__ result = func(*args, **kwargs) print "++++", func.__name__ f.__name__ = func.__name__ return result return f def deco_params(msg): """有参数装饰器,接受一个函数,返回一个无参数装饰器。 """ def f(fun…

2014-03-25 17:41 · python · 评论(0)

git的常用的config选项

git中可以设置的选项颜色值: red green blue yellow magenta cyan black white git中状态行可以设置的选项: color.status.added/updated color.status.changed color.status.untracked |diff.tool|指定git difftool时,使用的 |difftool. .cmd|difftool使用的 命令行 |difftool. .path|difftool使用的 命令的路径 |difftool.prompt|difftool命令使用时,是否需要确认 git log.decor…

2014-03-17 10:44 · git · 评论(0)

MySQL 5.6中innodb的可传输表空间(transportable tablespace)

目标端: alter table t discard tablesapce; 源端: flush tables t for export; 复制 t.ibd, t.cfg到目标端。 源端: unlock tables; 目标端: alter table t import tablespace; 参考地址: 14.2.5.5 Copying Tablespaces to Another Server (Transportable Tablespaces) http://dev.mysql.com/doc/refman/5.6/en/tablespace-copying.html

2014-03-03 18:01 · 评论(0)

MySQL5.6:快速预热Buffer_Pool缓冲池

数据库的buffer pool中的数据重启后,会丢失。因此,再次启动后,需要重新通过应用对数据库的访问,逐渐加载到buffer pool中。这个过程称为数据库预热。如果库较大,该过程花费时间较长,期间应用的性能也受到影响。 MySQL 5.6中,可以将buffer pool的内容(文件页的索引)dump到文件中,然后快速load到buffer pool中。避免了数据库的预热过程,提高了应用访问的性能。 mysql> show variables like 'innodb_buffer%'; +-------------------------------------+------------…

2014-03-03 17:54 · mysql · 评论(0)

用alter table添加索引与create index区别

1、alter table一次可以添加多个索引,create index一次只能创建一个。创建多个索引时,alter table只对表扫描一次,效率较高。 2、alter table可以不指定索引名,此时将使用索引列的第一列的列名;create index必须指定索引名。 因此,alter table添加索引更灵活。

2014-03-03 17:12 · mysql · 评论(0)

MySQL 5.6的密码验证插件

运行时加载validate_password插件: mysql> select * from information_schema.plugins where plugin_name='validate_password'; Empty set (0.05 sec) mysql> show variables like 'validate_password%'; Empty set (0.00 sec) 安装validate_plugin插件: mysql> install plugin validate_password soname 'validate_password.dll'; Qu…

2014-03-03 15:36 · mysql · 评论(0)

MySQL变量:local_infile

local_infile服务器变量指示能否使用load data local infile命令。该变量默认为ON。 该变量为OFF时,禁用客户端的load data local infile命令。 mysql> show create table test.t\G *************************** 1. row *************************** Table: t Create Table: CREATE TABLE `t` ( `id` int(11) DEFAULT NULL, `name` varchar(100) DEFAULT NULL )…

2014-02-28 11:31 · mysql · 评论(0)

git的clone

从A代码库clone出来的B代码库,不能直接从A代码库push到B代码库。因为不可以push到B代码库已经checkout的(当前)分支上。 可以从B代码库pull、fetch A代码库的更新。 可以创建bare代码库,可以直接push到bare代码库中。 直接创建bare代码库: git init --bare 克隆创建bare代码库: git clone --bare git clone --mirror

2014-02-25 18:06 · git · 评论(0)

Python中module和package

模块(module) 包(package) 模块的创建 创建一个可被重用的Python脚本文件,即创建了一个模块。模块名即为脚本的(无后缀)文件名。可用import 导入模块。 模块的属性 name 对于导入的模块,与模块名相同。对于直接执行的模块,为" main "。可以用来区分模块是导入,还是直接执行的。 直接执行模块 if __name__ == "__main__": import sys print (sys.argv[0]) 模块中可以包含变量、类、函数等定义,也可以包含语句。 模块中的语句在模块被导入时,执行一次。多次导入同一个模块时,这些语句不会重复执行。 模块有自己的命名空…

2014-02-25 17:57 · python · 评论(0)

Oracle Linux 5.5安装Python 2.73, cx_Oracle 5.12

1、安装Python 2.7.6 tar -xzvf Python-2.7.6.tar.gz -C /tmp cd /tmp/Python-2.7.6 ./configure -enable-shared make make install 2、安装cx_Oracle 5.1.2 tar -xzvf cx_Oracle-5.1.2.tar.gz -C /tmp cd /tmp/cx_Oracle-5.1.2 export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2 export LD_LIBRARY_PATH=$OR…

2014-01-31 20:35 · linux · oracle · python · 评论(0)

GitEye字体设置

Windows -> Preferences General -> Appearance -> Colors and Font 2013/06/13 17:46 787,737 MySQL for Beginners (Introduction to MySQL).pdf 2013/06/13 17:43 4,404,289 MySQL for Developers Ed 1 (Student Guide - Volume 1).pdf 2013/06/13 17:46 5,201,401 MySQL for Developers Ed 1 (Student Guide - Volume 2…

2014-01-16 16:01 · git · 评论(0)

mysqlbinlog

mysqlbinlog 会解析日志,并生成BINLOG语句,可以用于重新执行。 既可以解析binary log,也可以解析relay log。因为relay log与binary log格式相同。 一、从远端服务器获取binlog 需要以下参数: --read-from-remote-server(等价于--read-from-remote-master=BINLOG-DUMP-NON-GTIDS) 以下参数为连接参数,用法与mysql客户端相同 --host --user --password --port --protocol --socket 二、显示选项 --verbose,-v 将…

2013-12-23 16:54 · mysql · 评论(0)

mysqlfabric

MySQL Fabric: Presentations http://www.slideshare.net/mkindahl/mysql-sharding-tools-and-best-practices-for-horizontal-scaling http://www.slideshare.net/nixnutz/mysql-57-fabric-high-availability-and-sharding MySQL Fabric: Blogs http://mysqlmusings.blogspot.com/2013/09/brief-introduction-to-mysql-fab…

2013-12-15 23:00 · mysql · 评论(0)

B-TREE

用crtdbg定位内存泄露错误 http://blog.sina.com.cn/s/blog_6ce6d0bf01016w33.html 定位内存泄露 http://blog.sina.com.cn/s/blog_6ce6d0bf01016vm1.html B树的C实现 http://blog.csdn.net/v_july_v/article/details/6735293 从B树、B+树、B*树谈到R 树 http://blog.csdn.net/v_JULY_v/article/details/6530142 B+树(C++实现) http://blog.csdn.net/liu106…

2013-12-02 19:27 · vs2010 · vs · 评论(0)

多粒度锁机制

Introduction to Transaction Locks in InnoDB Storage Engine https://blogs.oracle.com/mysqlinnodb/entry/introduction_to_transaction_locks_in Multiple granularity locking http://en.wikipedia.org/wiki/Multiple_granularity_locking Oracle多粒度锁机制 http://blog.csdn.net/xuxiaofei77/article/details/5569736 Ora…

2013-11-28 22:42 · mysql · oracle · 评论(0)