上一页 1 2 3 4 5 6 7 8 ··· 10 下一页

2013年5月12日

mysql主从配置

摘要: 转自:http://www.blogjava.net/dongbule/archive/2010/08/22/329602.htmlMysql的主从复制至少是需要两个Mysql的服务,当然Mysql的服务是可以分布在不同的服务器上,也可以在一台服务器上启动多个服务。(1)首先确保主从服务器上的Mysql版本相同(2)在主服务器上,设置一个从数据库的账户,使用REPLICATION SLAVE赋予权限,如:mysql> GRANT REPLICATION SLAVE ON *.* TO 'slave001'@'192.168.0.99' IDENTIFIED 阅读全文

posted @ 2013-05-12 19:54 mtima 阅读(137) 评论(0) 推荐(0) 编辑

2013年5月11日

Cannot load D:/phpenv/php/php548/php5apache2_2.dll错误解决

摘要: 缺少vc2008运行库. 阅读全文

posted @ 2013-05-11 12:43 mtima 阅读(204) 评论(0) 推荐(0) 编辑

2013年5月5日

二分搜索

摘要: 1 from math import ceil, floor 2 3 def b_search(source, target): 4 max = len(source) 5 mid = max/2 6 if target>source[int(mid)]: 7 mid = ceil(mid) 8 else: 9 mid = floor(mid)10 target_sub = mid;11 12 if source[mid]>target:13 target_sub = b_search(sour... 阅读全文

posted @ 2013-05-05 16:34 mtima 阅读(138) 评论(0) 推荐(0) 编辑

2013年4月30日

php得到所有的汉字

摘要: <?phpheader('Content-Type: text/html;charset=utf8');//输出所有汉字$start = hexdec('4e00');$end = hexdec('9fa5');for($i=$start; $i<$end; $i++) { print_r(json_decode('["\u'.dechex($i).'"]'));}总结: 4e00为汉字十六进制的下界,9fa5为汉字十六进制的上界,我们遍历每一个汉字的十六进制对应得十进制码,然后再通 阅读全文

posted @ 2013-04-30 15:01 mtima 阅读(374) 评论(0) 推荐(0) 编辑

2013年4月29日

使用xml.dom.minidom创建xml

摘要: from xml.dom.minidom import Documentdoc = Document()persons = doc.createElement('persons')#根节点doc.appendChild(persons)#将根节点添加到xml对象person1 = doc.createElement('person')#创建person节点person1Name = doc.createElement('name')#创建姓名节点person1NameText = doc.createTextNode('zhangsan& 阅读全文

posted @ 2013-04-29 21:16 mtima 阅读(522) 评论(0) 推荐(0) 编辑

2013年4月14日

wxpython基础框架

摘要: import osimport wxclass MyFrame(wx.Frame): def __init__(self, parent, id=wx.ID_ANY, title="", pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE, name="MyFrame"): super(MyFrame, self).__init__(parent, id, title, pos, size, style, name) self.pan... 阅读全文

posted @ 2013-04-14 10:00 mtima 阅读(194) 评论(0) 推荐(0) 编辑

2013年4月9日

【转】在 Windows 下为 PHP 5.4 安装 PEAR、PHPUnit 及 phpDoc2

摘要: 转自:http://lodar.net/tag/phpdocumentor/#viewSource1.安装PEAR官方网站:http://pear.php.net/PHP 5.4 的 Windows 包中没有自带 PEAR,下载 http://pear.php.net/go-pear.phar 到PHP目录,并运行:php go-pear.phar安装完成后PHP目录下会产生一个名为 pear.bat 的批处理文件,并且会在系统中添加以下环境变量(用户变量,假定PHP安装在C:\php):PHP_PEAR_BIN_DIR=C:\phpPHP_PEAR_DATA_DIR=C:\php\dataP 阅读全文

posted @ 2013-04-09 22:22 mtima 阅读(178) 评论(0) 推荐(0) 编辑

php新特性 traits 简单方法复用

摘要: 不废话,上代码:/* * @purpose php 5.4 traits test */trait Foo { public $name, $age, $height; public function aaa() { echo 'aaa' . $this->name; }}trait bar { public function getAge() { echo $this->age; }}class test { use Foo, bar; public function __construct($name, $age, $h... 阅读全文

posted @ 2013-04-09 22:05 mtima 阅读(177) 评论(0) 推荐(0) 编辑

2013年4月2日

冒泡排序-python实现

摘要: 上代码#!c:/python33/pythondef bubble_sort(arr): flag = True for i in range(len(arr)-1): if not flag: break flag = False for j in range(i, len(arr)): if (arr[i]>arr[j]): arr[i], arr[j] = arr[j], arr[i] flag = True return arr;a... 阅读全文

posted @ 2013-04-02 18:04 mtima 阅读(143) 评论(0) 推荐(0) 编辑

2013年3月30日

函数当作参数传递

摘要: <!doctype html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title></head><body><script type='text/javascript'> function callSomeFunction(someFunction, someArgument) { return someFunction(someArgument) 阅读全文

posted @ 2013-03-30 21:12 mtima 阅读(144) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 ··· 10 下一页

导航