the attachment below is the sources of my blog programed by myself on March last year. 
the attachment below is the sources of my blog programed by myself on March last year. 
i found a most fun South Park character creator this morning, if any you created, please send your screenshot to me and i'll upload to comments 
South Park Studio Url: http://www.sp-studio.de/

I am Bun Wong 
The knowledge share discussion is to be held on this Friday, my subject is about the IPC (Inter-Process Communication) on the Unix environment. In the ecbattle project we programed using Internet Socket to communicate between PHP script and the taskserver compiled by c++, exactly, it's easier, but that's not efficient enough i think 
Doesn't matter whom you are with
Doesn't matter where you are going
Don't you know I'm still waiting here for you and pray for you
In the sunny days, sun will light your day
In the windy days, wind will lead your way
I have to say you're my treasure moments never gonna walk away
In the rainy days, rains will share my tears
In the stormy days, storms will steal my pain
Just go your way and leave things all behind spread your wings and fly away
I'm pretending you're mine I'm wishing you'll be fine
奥运年很热闹,互联网行业也如奥运般踩踏着远航的甲板,“互联网的下一个蓝海是什么?” 每一个跃跃欲试的创业者们都在问。过去的一年里,网游依然是行业关注和互联网利润的焦点,但是随着人们的需求改变,大量的人群已经开始喜欢轻量级的网游- -网页游戏(webgame)。
PHP 自带的对 Xml 的操作模块有 DOM,SimpleXML,XMLReader,因此 Zend Framework 也没有这个必要重复做一个轮子,可以理解。但是每次读取 XML 都要重新进行解析,而同一次访问中内调用多次(可能在不同的脚本内,MVC 开发模式下,我还不能很好地避免到多个模块内调用同一个模块的可能性
)的话,系统都会重新进行读取与解析,这样无疑浪费了系统资源。所以在我的项目里,写了一下这么一个 Xml 类,里面定义了一个静态的变量,用来保证已载入的 Xml 数据不会被重复载入,并且用了 Zend_Cache 作为缓冲机制。
<?php
/**
* Hihuadu_Xml
*
* @author Bun Wong (hdwong@gmail.com)
* @link http://www.hihuadu.com
* @version 1.0.1
* @copyright Bun Wong
*/
class Hihuadu_Xml
{
protected static $_persistentData = array();
protected $_data;
/**
* Returns a string or an associative and possibly multidimensional array from
* a SimpleXMLElement.
*
* @param SimpleXMLElement $xmlObject
* @return array|string
*/
protected function _toArray($xmlObject)
{
$data = array();
if (count($xmlObject->children())) {
foreach ($xmlObject->children() as $key => $value) {
if ($value->children()) {
$value = $this->_toArray($value);
} else {
$value = (string) $value;
}
if (array_key_exists($key, $data)) {
if (!is_array($data[$key]) || !array_key_exists(0, $data[$key])) {
$data[$key] = array($data[$key]);
}
$data[$key][] = $value;
} else {
$data[$key] = $value;
}
}
} elseif (!isset($xmlObject['extends'])) {
// object has no children and doesn't use the extends attribute: it's a string
$data = (string) $xmlObject;
}
return $data;
}
/**
* 构造函数
*
* @param string $filename XML文件名
* @param string $section 部分标识
* @param Zend_Cache_Core $cache 缓存对象
*/
public function __construct($filename, $section = null, $cache = null)
{
$filenameHash = md5(realpath($filename));
if (array_key_exists($filenameHash, self::$_persistentData)) {
$this->_data = self::$_persistentData[$filenameHash];
} else {
if (null === $cache || !$this->_data = $cache->load($filenameHash)) {
if (empty($filename)) {
throw new Zend_Exception('Xml filename is not set');
}
if ($xmlObject = simplexml_load_file($filename)) {
$this->_data = $this->_toArray($xmlObject);
unset($xmlObject);
if (null !== $cache) {
$cache->save($this->_data, $filenameHash);
}
self::$_persistentData[$filenameHash] = $this->_data;
} else {
throw new Zend_Exception('Load xml error');
}
} else {
self::$_persistentData[$filenameHash] = $this->_data;
}
}
if (null === $section) {
} else if (!isset($this->_data[$section])) {
$this->_data = $this->_data[$section];
} else {
throw new Zend_Exception("Section '{$section}' cannot be found");
}
}
/**
* 获取数据数组
*
* @return array 数据数组
*/
public function getData()
{
return $this->_data;
}
/**
* 判断是否已定义
*
* @param string $tagName 标签名称
* @return boolean 是否已定义
*/
public function __isset($tagName)
{
return isset($this->_data[$tagName]);
}
/**
* 获取标签内容
*
* @param string $tagName 标签名称
* @return mixed 标签内容 (不存为在 null)
*/
public function __get($tagName)
{
if (isset($this->_data[$tagName])) {
return $this->_data[$tagName];
} else {
return null;
}
}
}
?>对四川汶川大地震遇难同胞深切哀悼
Ubuntu8.04 的字体设置方法有别与以往的,/etc/fonts/fonts.conf 已经被拆分为 /etc/fonts/font.d 内的数个文件,以下是本机上面设置华文黑体的方法。



昨天是唯一一个不想碰电脑的晚上(可想而知有多累)
。
最新评论
11 周 5 天 前
11 周 5 天 前
11 周 6 天 前
11 周 6 天 前
11 周 6 天 前
11 周 6 天 前
11 周 6 天 前
11 周 6 天 前
11 周 6 天 前
11 周 6 天 前