摘要:<?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为汉字十六进制的上界,我们遍历每一个汉字的十六进制对应得十进制码,然后再通
阅读全文
摘要: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&
阅读全文
摘要: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...
阅读全文
摘要:转自: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
阅读全文
摘要:不废话,上代码:/* * @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...
阅读全文
摘要:上代码#!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...
阅读全文