04 2013 档案

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 阅读(394) 评论(0) 推荐(0)

使用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 阅读(539) 评论(0) 推荐(0)

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 阅读(210) 评论(0) 推荐(0)

【转】在 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 阅读(197) 评论(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 阅读(186) 评论(0) 推荐(0)

冒泡排序-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 阅读(156) 评论(0) 推荐(0)

导航