<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feed.feedsky.com/styles/temp01.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" version="2.0"><channel><atom:link href="http://feed.feedsky.com/ooso" type="application/rss+xml" ref="self"></atom:link><fs:self_link href="http://feed.feedsky.com/ooso" type="application/rss+xml"></fs:self_link><lastBuildDate>Thu, 08 May 2008 14:49:03 GMT</lastBuildDate><title>某人的栖息地</title><description>Linux + Apache + Mysql + Php + Flash</description><link>http://www.ooso.net</link><atom:link href="http://www.ooso.net/index.php/feed/" rel="self" type="application/rss+xml"></atom:link><language>en</language><pubDate>Thu, 08 May 2008 15:02:23 GMT</pubDate><dc:date>2008-05-08T15:02:23Z</dc:date><dc:language>en</dc:language><item><title>关于PEAR的DB和MDB2方法对比</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72393528/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/396/feed</wfw:commentRss><description>在从前的php4时代，我很喜欢使用pear的DB库，使用非常方便。但是现在pear官方站已经建议我们采用MDB2来代替它，虽然MDB2的前身可能有一些DB的影子，但是使用方法还是有一些不同，这些天一边使用，一边做些笔记。


MDB2
DB


queryAll
getAll


queryRow
getRow


queryCol
getCol


queryOne
getOne


其它方法貌似一致。</description><category>PHP</category><category>db</category><category>PEAR</category><pubDate>Thu, 08 May 2008 22:49:03 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/396#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/396</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/396</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72393528/5088797</fs:itemid></item><item><title>memcache的几个旁支</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72209354/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/395/feed</wfw:commentRss><description>最近留意了一下，memcache出现了几个旁支项目，很有一点意思，也许在日后的项目中可以用的上。
memcached-tag
给memcache增加了tag功能，新增的命令如下：

tag_add &amp;#60;tag&amp;#62; &amp;#60;key&amp;#62;
tag_delete &amp;#60;tag&amp;#62;

Memcached is a high-performance, distributed memory object caching system.
We add &amp;#8220;Tag Function&amp;#8221; for memcached. Propose is remove several keys with the same tag in one operation. This function will help the API programmers (such as php) do the delete operation easily, and reduce the network load. We use hash and splay tree, [...]</description><category>memcache</category><category>PHP</category><pubDate>Thu, 08 May 2008 14:23:30 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/395#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/395</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/395</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72209354/5088797</fs:itemid></item><item><title>如何避免使用php的require_once</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162217/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/394/feed</wfw:commentRss><description>我们知道，在php中使用require_once/include_once虽然方便，但是代价昂贵，据测试数据来看,require_once比require慢3-4倍，所以在php开发中，我们应该尽量使用require/include。
列一下俺常用的避免require/include的方法。
使用__autoload
php5可以使用__autoload来避免require，用的好的话，代码里头甚至看不到几个require，实在是安逸啊。测试结果表明，使用__autoload之后的new Foo; 比 require_once 'foo.php'; new Foo; 大概要快3倍左右。
使用defined检测是否载入过
在代码开头使用defined检测是否定义过对应的常量，如果有的话，直接return。
PLAIN TEXT
PHP:




&amp;#60;?php


if&amp;#40;!defined&amp;#40;'_MYCLASS_'&amp;#41;&amp;#41; 


&amp;#160; &amp;#160; return;


&amp;#160;


define&amp;#40;'_MYCLASS_', 1&amp;#41;;


class MyClass &amp;#123; ... &amp;#125;


?&amp;#62; 






测试了一下，defined的性能也不是太好...
require前检查
用class_exists或者function_exists检查一下，确认没有载入过再出手，至少比require_once能快上3倍。php4也可以用上。
PLAIN TEXT
CODE:




class_exists&amp;#40;'myClass'&amp;#41; or require&amp;#40;'/path/to/myClass.class.php'&amp;#41;;</description><category>PHP</category><pubDate>Thu, 08 May 2008 12:10:23 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/394#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/394</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/394</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162217/5088797</fs:itemid></item><item><title>使用PDO的一些备忘</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162218/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/393/feed</wfw:commentRss><description>之前在论坛上灌水的时候，也曾经看到别人提到过PDO的一些生僻用法。但是当时觉得短期内不会用上，所以不是太在意。等到要用的时候，满世界也找不到出处。
这使我下定决心，做点PDO的小笔记，慢慢补。
设定PDO的fetchMode
初始化pdo的时候，就设定好PDO的fetchMode，应该能省点事，比如我最喜欢的fetchMode是FETCH_OBJ。
PLAIN TEXT
PHP:




$dbh-&amp;#62;setAttribute&amp;#40;PDO::ATTR_DEFAULT_FETCH_MODE, PDO:FETCH_OBJ&amp;#41;; 






其中PDO::ATTR_DEFAULT_FETCH_MODE是php 5.2.0之后才新增的常量
还可以在实例化PDO对象的时候就完成这个设定：
PLAIN TEXT
PHP:




$dbh = new PDO&amp;#40;&quot;mysql:dbname=dbname&quot;, &quot;user&quot;, &quot;password&quot;, 


&amp;#160; &amp;#160; array&amp;#40;PDO::ATTR_DEFAULT_FETCH_MODE =&amp;#62; PDO:FETCH_OBJ&amp;#41;&amp;#41;;</description><category>PHP</category><category>pdo</category><pubDate>Tue, 06 May 2008 10:19:00 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/393#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/393</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/393</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162218/5088797</fs:itemid></item><item><title>wordpress plugin - search engine related posts</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162219/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/392/feed</wfw:commentRss><description>Table of content

Description
Usage
Download
History
Link

Description
中文说明
当用户从google搜索到你的博客上，这个wordpress 插件会根据用户搜索的关键词显示你的博客上更多的相关内容。目前也只对google生效，下一个版本将对baidu生效。
这个插件完全使用javascript加上google的api完成，不需要占用服务器端的资源，环保且安全。
English version
When someone is referred from a search engine like Google, the plugin show your blog content matched the terms they search for.
Usage
中文说明:

解压
在wordpress模板中添加一个id为search_content的html标签，比如
PLAIN TEXT
CODE:




&amp;#60;div id=&quot;search_content&quot; style=&quot;display:none;&quot;&amp;#62;


&amp;#60;h1&amp;#62;相关搜索结果&amp;#60;/h1&amp;#62;


&amp;#60;/div&amp;#62; 






复制search_related_posts.php到wp-contents/plugin目录，并激活插件.
done! 现在你可以试着从google搜索上先搜到自己的博客，然后点击进去看看插件的效果。

English version:

unzip it
Put &amp;#60;div style=&quot;display:none&quot; id=&quot;search_content&quot;&amp;#62;&amp;#60;/div&amp;#62; at the place in your template where you want the list of related posts
Copy search_related_posts.php to direcotry wp-contents/plugin and [...]</description><category>JAVASCRIPT</category><category>WORDPRESS</category><category>plugin</category><category>GOOGLE</category><pubDate>Fri, 02 May 2008 13:42:00 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/392#comments</comments><guid isPermaLink="false">http://www.ooso.net/?p=392</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/392</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162219/5088797</fs:itemid></item><item><title>深切怀念php的short_tag</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162220/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/391/feed</wfw:commentRss><description>最近两年干的php所有活儿，都是在php的short_tag关闭的情况下完成的。我也不爱使用那些乱七八糟的template engine，没意义，所以代码里面会有很多php的标签，看着有点晕，这时候会怀念当年php的short_tag，简单是美，短小精悍...应该也是美的吧？
贴个形式对比：
现在使用的
PLAIN TEXT
PHP:




I have &amp;#60;?php echo $foo?&amp;#62; foo. 






从前的好日子
PLAIN TEXT
PHP:




I have &amp;#60;?=$foo?&amp;#62; foo. 






可以少写9个字节，要是代码按字节算钱，boss应该可以省下一小笔。</description><category>PHP</category><pubDate>Thu, 01 May 2008 21:22:47 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/391#comments</comments><guid isPermaLink="false">http://www.ooso.net/?p=391</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/391</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162220/5088797</fs:itemid></item><item><title>AIR入门者推荐阅读 — AIR for JavaScript Developers</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162221/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/390/feed</wfw:commentRss><description>O'reilly的电子书 AIR for JavaScript 更新了。可以在这里免费下载。
这本书按照 创造共用方式授权，这意味着你不仅仅可以合法的免费下载，还可以按照自己的意愿做些修改。我翻看了一些章节，这本书对于AIR的html + js开发者来说，是一本很好的入门教程。这次更新的内容还包括AIR的安全模型介绍。</description><category>JAVASCRIPT</category><category>air</category><pubDate>Sat, 26 Apr 2008 11:36:24 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/390#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/390</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/390</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162221/5088797</fs:itemid></item><item><title>PDO_MYSQL的一些预定义常量</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162222/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/389/feed</wfw:commentRss><description>PDO_MYSQL是PHP Data Objects (PDO) interface的一个mysql扩展。仔细看看php手册上面，其实还是有些有趣的参数可供使用，例如：
PDO::MYSQL_ATTR_INIT_COMMAND  (integer)
Command to execute when connecting to the MySQL server. Will automatically be re-executed when reconnecting.
当我使用PDO_MYSQL连上mysql以后，可以利用这个参数自动执行一些QUERY。最常见的使用场合是连接mysql使用utf-8字符集:
PLAIN TEXT
CODE:




$db = new PDO&amp;#40;&quot;mysql:dbname=dbname&quot;, &quot;user&quot;, &quot;password&quot;, 


&amp;#160; &amp;#160; array&amp;#40;PDO::MYSQL_ATTR_INIT_COMMAND =&amp;#62; &quot;SET NAMES 'utf8'&quot;&amp;#41;&amp;#41;; 






以上代码会在连上mysql之后马上执行sql:
PLAIN TEXT
CODE:




set names 'utf8';</description><category>utf-8</category><category>PHP</category><category>pdo</category><category>MYSQL</category><pubDate>Wed, 09 Apr 2008 08:38:12 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/389#comments</comments><guid isPermaLink="false">http://www.ooso.net/?p=389</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/389</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162222/5088797</fs:itemid></item><item><title>如何去除雅虎通9.0 beta自带的广告</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162223/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/388/feed</wfw:commentRss><description>不请自来的广告总是不招人待见的，在安装了雅虎通9.0 beta之后，越发对这东东最下方的广告感到厌恶，所以我想方设法找一些能去掉广告的办法。虽然说总是能搜到一些去除广告的patch，但是莫名其妙的来自某个山寨的patch可能比不请自来的广告更加危险，所以我还是希望能手动解决这个问题。
For Windows XP用户

确定你的雅虎通安装目录所在的磁盘是ntfs格式
确保雅虎通不在运行状态

编辑C:\Program Files\Yahoo!\Messenger\Cache\下的urls.xml，删除其中的广告行（Messenger Ad和Idle Messenger Ad），保存并关闭。
右键点击urls.xml，查看属性，设置为只读
选择安全-&gt;高级(若文件夹属性窗口中没有发现“安全”选项卡时，你只要在资源管理器窗口中，选择“工具→文件夹选项”命令，在弹出的窗口中选择“查看”选项卡，然后将“高级设置”列表中的“使用简单文件共享”复选框的勾选标记去掉即可。)
去除所有用户的全部权限，保证urls.xml是只读的
启动雅虎通，这个时候应该没有广告了

For Windows Vista x32用户
未经测试，但是觉得很有趣，围死它用户可以试试。
删除C:\Program Files\Yahoo!\Messenger\Cache目录下的urls.xml文件，然后创建一个名为urls.xml的空目录，重新启动雅虎通就没有广告了。</description><category>ntfs</category><category>COMMON</category><category>yahoo</category><pubDate>Sun, 06 Apr 2008 08:55:48 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/388#comments</comments><guid isPermaLink="false">http://www.ooso.net/?p=388</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/388</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162223/5088797</fs:itemid></item><item><title>如何把磁盘fat32转ntfs格式</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162224/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/387/feed</wfw:commentRss><description>首先我认为磁盘fat32转ntfs格式这不是一个需要什么高深技术的问题，因为解决方案很早就存在，随便搜索一下都能找到一大把无比正确的解决办法，例如：
在命令提示符下键入convert [driver] /fs:ntfs即可
其中driver是想转换的盘符convert [driver] /fs:ntfs之间有空格
Win 2000/XP 自带了将FAT或FAT32分区转换成NTFS分区的一个小程序—Convert.exe，它不但转换速度快、简单易用，而且原来该分区上的数据还可以继续保存下来
在win运行窗口，输入“Convert C: /fs:ntfs”；如果要转换D盘，只要将“C:”改成相应的“D:”即可。转换完成后，它会向你报告你所转换的磁盘分区情况。
注意事项:
1、建议先执行磁盘扫描、磁盘碎片整理程序。
2、如果你要转换的FAT或FAT32分区上面有文件正被系统使用，那么在转换时，转换程序将会询问你是否卸下要转换的卷（即分区），这时最好选择“否”，最后它就会询问你是否在下一次计算机启动时转换分区，选择“是”并重新启动机器即可完成转换。
但是今天在家里的老本本(Evo N610c)上，遇到了史无前例的挫折。俺企图把c盘的fat32转成ntfs，相当的失败，每次都是转换了一半自动关机，重新开机又会自动进入转换状态，如此循环，直至俺崩溃为止。也许我该换个更人性化的工具来实现这一阶段性目标。</description><category>ntfs</category><category>COMMON</category><pubDate>Sat, 05 Apr 2008 17:25:29 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/387#comments</comments><guid isPermaLink="false">http://www.ooso.net/?p=387</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/387</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162224/5088797</fs:itemid></item><item><title>在wordpress.org上提交了inline-js</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162225/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/386/feed</wfw:commentRss><description>前几天在wordpress.org的plugin list里提交了inline-js，这是我写的第一个wordpress插件，估计实用价值和使用者都不是太多:)但是我想如果有更多的使用者对这个plugin提一些意见的话，可能会更加完善，很希望能看到这个插件能持续发展，如果我能挤出更多的时间来维护的话。</description><category>JAVASCRIPT</category><category>WORDPRESS</category><category>plugin</category><pubDate>Fri, 04 Apr 2008 09:35:45 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/386#comments</comments><guid isPermaLink="false">http://www.ooso.net/?p=386</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/386</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162225/5088797</fs:itemid></item><item><title>推荐一个16进制编辑器</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162226/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/385/feed</wfw:commentRss><description>因为机器上的非免费软件已经被清理出局了，所以我在寻找一个ultraedit的替代品，这个编辑器能直接编辑16进制文件(比如xxx.exe)。
搜索的结果是： HxD - Freeware Hex Editor and Disk Editor，大小只有747k，免安装，很小巧的绿色软件。 
HxD is a carefully designed and fast hex editor including raw disk editing, modifying foreign RAM and handling files of any size. Its clear interface offers searching/replacing, exporting, checksums/digests, insertion of byte patterns, a file shredder, concatenation or splitting of files, statistics and more.
再贴一点feature list
  [...]</description><category>免费软件</category><category>COMMON</category><pubDate>Thu, 03 Apr 2008 18:47:24 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/385#comments</comments><guid isPermaLink="false">http://www.ooso.net/?p=385</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/385</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162226/5088797</fs:itemid></item><item><title>用php5的simplexml解析各种feed</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162227/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/384/feed</wfw:commentRss><description>最近使用simplexml来解析各种feed源，碰到了一些小问题。
用simplexml处理atom数据
很多博客使用atom来输出数据，但是atom使用了名称空间(namespace)，所以现在请求被命名的元素和本地名称时必须指定名称空间统一资源标识符（URI），还有一点就是simplexml的xpath方法无法直接query这个xml tree。
从 PHP 5.1 版开始，SimpleXML 可以直接对带名称空间的文档使用 XPath 查询。和通常一样，XPath 位置路径必须使用名称空间前缀，即使搜索的文档使用默认名称空间也仍然如此。registerXPathNamespace() 函数把前缀和后续查询中使用的名称空间 URL 联系在一起。
下面是使用xpath查询atom文档title元素的例子：
PLAIN TEXT
CODE:




$atom =&amp;#160; simplexml_load_file&amp;#40;'http://www.ooso.net/index.php/feed/atom'&amp;#41;;


$atom-&amp;#62;registerXPathNamespace&amp;#40;'atom', 'http://www.w3.org/2005/Atom'&amp;#41;;


$titles = $atom-&amp;#62;xpath&amp;#40;'//atom:title'&amp;#41;;


foreach &amp;#40;$titles as $title&amp;#41; 


&amp;#160; echo &quot;&amp;#60;h2&amp;#62;&quot; . $title . &quot;&amp;#60;/h2&amp;#62;&quot;; 






用simplexml处理rss数据
wordpress可以输出rss2的数据源，这里面也有一些不同的namespace，比如dc。一个使用simplexml解析rss2的例子：

PLAIN TEXT
PHP:




$ns = array &amp;#40;


&amp;#160; &amp;#160; &amp;#160; &amp;#160; 'content' =&amp;#62; 'http://purl.org/rss/1.0/modules/content/',


&amp;#160; &amp;#160; &amp;#160; &amp;#160; 'wfw' =&amp;#62; 'http://wellformedweb.org/CommentAPI/',


&amp;#160; &amp;#160; &amp;#160; &amp;#160; 'dc' =&amp;#62; 'http://purl.org/dc/elements/1.1/'


&amp;#41;;


&amp;#160;


$articles = array&amp;#40;&amp;#41;;


&amp;#160;


// step 1: [...]</description><category>PHP</category><category>rss</category><category>php5</category><category>simplexml</category><category>atom</category><pubDate>Tue, 01 Apr 2008 15:41:13 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/384#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/384</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/384</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162227/5088797</fs:itemid></item><item><title>Adobe AIR教程for HTML/JAVASCRIPT开发者</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162228/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/354/feed</wfw:commentRss><description>最近不是太有空，加上泡网络时间太长，对新鲜事物的敏感度有所下降。因此当Adobe出了个AIR，我还是兴趣缺缺，没功夫去试用。
但是兴趣这玩意可能也有些生理周期，前几天突然来了神把这个AIR好好端详一番，却发觉网上暂时没有适合我这种初级新手看的AIR教程，鼓捣了几天，仍然是毫无进展，我甚至连个hello world之类的简单air package都打不出来。也许小时候特意去踩过狗屎，因此现在我又走上狗屎运，在即将放弃的前一刻找到了一篇比较细致的AIR教程，记录下来，好记性不如烂键盘。
俺目前的情况是，没有安装Dreamweaver，Flash之类的软件，只用一些免费软件，所以我只打算写html/javascript之类的代码，flash方面的暂时不涉及，另外adobe提供的dreamweaver air sdk也是用不上，可谓一穷二白。
第一步 -- 安装Adobe AIR和Adobe AIR SDK
如果你还没装，可以去网站上下载Adobe AIR Runtime和Adobe AIR SDK.
装完Adobe AIR SDK以后，为了方便，你还需要把它的bin目录添加到系统的path变量下，这样你可以直接运行它的打包和debug工具。

第二步 -- 创建一些目录
接下来创建一些目录来放置代码，比如：
/appname/
/appname/source/
/appname/source/icons/
/appname/build/

第三步 -- 创建一个Application Descriptor
AIR需要一个Application Descriptor来描述它的内容和属性，这是一个XML格式的文件。
它的文件名是application.xml，放置在/appname/source/目录。
PLAIN TEXT
XML:




&amp;#60;application xmlns=&quot;http://ns.adobe.com/air/application/1.0&quot;&amp;#62;


&amp;#160; &amp;#60;id&amp;#62;com.example.appname &amp;#60;/id&amp;#62;


&amp;#160; &amp;#60;version&amp;#62;1.0 &amp;#60;/version&amp;#62;


&amp;#160; &amp;#60;filename&amp;#62;AppName &amp;#60;/filename&amp;#62;


&amp;#160; &amp;#60;initialWindow&amp;#62;


&amp;#160; &amp;#160; &amp;#60;content&amp;#62;index.html &amp;#60;/content&amp;#62;


&amp;#160; &amp;#160; &amp;#60;visible&amp;#62;true &amp;#60;/visible&amp;#62;


&amp;#160; &amp;#160; &amp;#60;width&amp;#62;600&amp;#60;/width&amp;#62;


&amp;#160; &amp;#160; &amp;#60;height&amp;#62;600&amp;#60;/height&amp;#62;


&amp;#160; &amp;#60;/initialWindow&amp;#62;


&amp;#160; &amp;#60;icon&amp;#62;


&amp;#160; &amp;#160; &amp;#60;image16x16&amp;#62;icons/appname-16.png&amp;#60;/image16x16&amp;#62;


&amp;#160; &amp;#160; &amp;#60;image32x32&amp;#62;icons/appname-32.png&amp;#60;/image32x32&amp;#62;


&amp;#160; &amp;#160; &amp;#60;image48x48&amp;#62;icons/appname-48.png&amp;#60;/image48x48&amp;#62;


&amp;#160; &amp;#160; &amp;#60;image128x128&amp;#62;icons/appname-128.png&amp;#60;/image128x128&amp;#62;


&amp;#160; &amp;#60;/icon&amp;#62;


&amp;#60;/application&amp;#62; 






这个xml文件很有些复杂，也很有一些历史，最可恶的是AIR beta1到后来的beta2乃至最后的1.0，从来就没统一过，变了又变，所以我在网上找到的一些教程都失效了，只能针对早期的beta版使用。
关于它的详细内容，可以参考模板，在adobe sdk安装目录下的templates/descriptor-template.xml.
第四步 [...]</description><category>dreamweaver</category><category>JAVASCRIPT</category><category>air</category><category>adobe</category><category>html</category><pubDate>Mon, 24 Mar 2008 08:52:15 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/354#comments</comments><guid isPermaLink="false">http://www.ooso.net/?p=354</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/354</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162228/5088797</fs:itemid></item><item><title>JQUERY和YUI混用出现的问题</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162229/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/347/feed</wfw:commentRss><description>有道是一山不容二虎，其实我本不该把JQUERY和YUI夹杂在一块使用，虽然它们各有长短，结合使用的确能够相得益彰，但是暗地里还存着什么矛盾和冲突，这就不是随便刷新一下网页能够看出来的。
列一下最近碰到的问题，备忘。
混用时，YUI的Event在ie6下表现异常
下面代码中，没能在window.onload事件中弹出一个alert弹出窗口。
PLAIN TEXT
CODE:




&amp;#60;script&amp;#62;


YAHOO.util.Event.on&amp;#40;window, 'load', function&amp;#40;&amp;#41; &amp;#123;alert&amp;#40;'hello'&amp;#41;;&amp;#125;&amp;#41;;


&amp;#60;/script&amp;#62; 






猜想是jQuery重写了window.onload事件引起冲突，解决办法，使用jQuery的event。
PLAIN TEXT
CODE:




&amp;#60;script&amp;#62;


jQuery.event.add&amp;#40;window, &quot;load&quot;, function&amp;#40;&amp;#41; &amp;#123;alert&amp;#40;'hello'&amp;#41;;&amp;#125;&amp;#41;;


&amp;#60;/script&amp;#62;</description><category>JAVASCRIPT</category><category>yui</category><category>jquery</category><pubDate>Sat, 22 Mar 2008 11:06:30 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/347#comments</comments><guid isPermaLink="false">http://www.ooso.net/?p=347</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/347</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162229/5088797</fs:itemid></item><item><title>升级到wordpress 2.5 RC1</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162230/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/371/feed</wfw:commentRss><description>迫不及待的升级到了wordpress 2.5 RC1。升级过程还算顺利，就是上传的时候多花了点时间。wordpress 2.5最大的改变就是后台部分，由深蓝白底变成了浅蓝白底，导航和写文章的页面修改很成功，用起来颇为顺手，这也是我升级的最大动力之一。
插件方面，兼容性良好，总体来说，这是一次成功的升级，胜利的升级。</description><category>WORDPRESS</category><pubDate>Thu, 20 Mar 2008 08:44:41 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/371#comments</comments><guid isPermaLink="false">http://www.ooso.net/?p=371</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/371</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162230/5088797</fs:itemid></item><item><title>inline-js 0.4 —— wordpress plugin</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162231/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/379/feed</wfw:commentRss><description>Inline-js plugin minor update. It now work fine with exec-php plugin.
Download
Inline-js 0.4
详细信息
inline-js wordpress plugin</description><category>JAVASCRIPT</category><category>WORDPRESS</category><category>plugin</category><pubDate>Tue, 11 Mar 2008 00:30:25 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/379#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/379</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/379</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162231/5088797</fs:itemid></item><item><title>firebug现在已经可以支持firefox 3</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162232/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/383/feed</wfw:commentRss><description>最新的firebug 1.1 beta，可以在firefox 3 beta下运行。现在即便为了尝鲜升级到firefox 3，也可以享受firebug的便利。
firebug 1.1 beta下载</description><category>插件</category><category>FIREFOX</category><category>firebug</category><pubDate>Fri, 29 Feb 2008 08:59:56 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/383#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/383</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/383</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162232/5088797</fs:itemid></item><item><title>bom头的影响</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162233/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/378/feed</wfw:commentRss><description>前阵子有同事写了一段代码，在setcookie的时候出现下面错误。
Cannot modify header information - headers already sent by ....
这个错误非常之常见，如果在setcookie之前输出了任何文本内容，便会有上述错误提示。由于页面头部require了若干文件，一行行排查是很麻烦的事情，因此，我在页面顶部加上：
PLAIN TEXT
PHP:




ob_start&amp;#40;&amp;#41;; 






在setcookie之前加上代码：
PLAIN TEXT
PHP:




ob_get_clean&amp;#40;&amp;#41;; 






这是为了获取setcookie之前页面输出的内容。页面运行后，显示输出了一个空字符串，也就是说，setcookie之前没有任何输出。
继而用vim打开了源文件，发觉vim有打开bomb选项，怀疑因此给代码添加了隐藏的字符串，关闭之：
set nobomb
问题解决。
BOM是什么意思?
BOM是“Byte Order Mark”的缩写，用于标记文件的编码。并不是所有的文本编辑工具都能识别BOM标记</description><category>utf-8</category><category>VIM</category><category>PHP</category><pubDate>Thu, 28 Feb 2008 20:16:30 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/378#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/378</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/378</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162233/5088797</fs:itemid></item><item><title>YUI 2.5.0发布</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162234/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/382/feed</wfw:commentRss><description>YUI 2.5.0发布。
2月20日，YUI Team发布了YUI的最新版本2.5.0。增加了6个全新的组件：Layout Manager, Uploader(结合Flash和Javascript的多文件上传引擎), Resize Utility, ImageCropper, Cookie Utility和ProfilerViewer Control。同时这一版还提升了DataTable Control的功能和Slider Control增加了双滑块功能。
这个版本中的Uploader以及ImageCropper应该是相当有用的控件

Uploader采用javascript和flash，不仅支持多文件上传，更可以直观的查看上传进度，以前虽然有类似的代码，但是组件化的代码显然通用性和可用性更好。
ImageCroper可用于制作图片切片，基于YUI的Dragdrop和Resize

与YUI 2.5.0相关的链接

http://developer.yahoo.com/yui
yuiblog.cn</description><category>JAVASCRIPT</category><category>yui</category><category>yahoo</category><pubDate>Thu, 21 Feb 2008 15:02:46 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/382#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/382</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/382</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162234/5088797</fs:itemid></item><item><title>用来看新浪新闻的greasemonkey脚本</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162235/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/302/feed</wfw:commentRss><description>刚从灾区长沙回到北京，那段时间虽然是隔三岔五的停电停水，俺还没忘趁着来电爬到新浪上面看看近期新闻，也好对最近的形势有些了解。闲着无聊写了个greasemonkey脚本，把新浪的新闻页右边那块没营养的内容统统隐藏掉。
放出来给需要的同学下载。
安装这个脚本的步骤

首先你必须是使用firefox浏览器
安装greasemonkey插件
下载俺的NewsSina greasemonkey脚本，如果你已经安装好greasemonkey，点击前面的链接应该会弹出一个安装窗口
去新浪的新闻页上看看，右边的内容还有吗？</description><category>JAVASCRIPT</category><category>插件</category><category>FIREFOX</category><category>greasemonkey</category><category>新浪</category><pubDate>Mon, 18 Feb 2008 21:23:36 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/302#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/302</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/302</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162235/5088797</fs:itemid></item><item><title>CachegrindVisualizer</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162236/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/338/feed</wfw:commentRss><description>CachegrindVisualizer是一个xdebug的profile文件查看客户端,采用Adobe的AIR制作,很让人惊讶,因为目前我看到的采用AIR制作的软件少的可怜.
与CachegrindVisualizer具有类似功能的软件还有wincachegrind,相比之下,wincachegrind的功能更为强大,使用上也更方便.但是即便如此,我还是乐见CachegrindVisualizer发展的更好.
CachegrindVisualizer支持的操作系统
Windows 2000 SP4, Windows XP SP2, Windows Vista Home and Ultimate Edition, Mac OS 10.4.7 and above (Intel and PowerPC), Mac OS X Leopard.
运行时的抓图

相关连接

AIR RUNTIME下载
xdebug</description><category>FLASH</category><category>PHP</category><category>air</category><category>xdebug</category><pubDate>Mon, 28 Jan 2008 12:35:50 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/338#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/338</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/338</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162236/5088797</fs:itemid></item><item><title>使用firebug的补充</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162237/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/381/feed</wfw:commentRss><description>这里是最近使用firebug的一个补充记录，以后也会不断更新。
列出一个object的所有内容
在console上使用命令
PLAIN TEXT
CODE:




console.dir&amp;#40;obj&amp;#41; 






可以查看一个object所包含的方法，属性	
firebug提供的console对象有哪些方法
用dir方法看一下console本身即可
PLAIN TEXT
CODE:




console.dir&amp;#40;console&amp;#41;</description><category>FIREFOX</category><category>firebug</category><pubDate>Fri, 25 Jan 2008 18:14:56 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/381#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/381</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/381</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162237/5088797</fs:itemid></item><item><title>用vim来写wordpress</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162238/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/278/feed</wfw:commentRss><description>用vim习惯了之后，用别的编辑器写长一点的文本都没法适应，写wordpress更是如此。为此我郁闷了很长一段时间，直到前不久找到了一个新的宝贝 ---- vimpress。这个东东可不是什么新的软件，它只不过是vim的一个plugin罢了。
只要装好vimpress，你就可以用它来列出或者发布blog。
目前这个插件有如下功能

获得文章列表
写新文章
编辑文章
现场保存 (yeah, no kidding)
支持分类
支持标签

vim命令清单

 “:BlogList”
      列出blog里的文章

“:BlogNew”
      写新文章
“:BlogOpen id”
      打开一篇现有的文章进行编辑
“:BlogSend”
      保存并发布文章

安装过程

将解压之后plugin和syntax目录复制到vimfiles目录下
修改plugin下的blog.vim进行配置，需要配置username,password以及xmlrpc.php的url
如果需要支持tag,可以设置enable_tags=1。
如果需要支持UTW tags,需要另外下载一个vim插件utw-rpc-autotag

vimpress的主页
BTW:现在这篇blog就是我使用vimpress完成的:)</description><category>WORDPRESS</category><category>VIM</category><category>plugin</category><pubDate>Mon, 21 Jan 2008 09:00:27 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/278#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/278</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/278</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162238/5088797</fs:itemid></item><item><title>YUI中国本地版</title><link>http://item.feedsky.com/~feedsky/ooso/~6980883/72162239/5088797/1/item.html</link><wfw:commentRss>http://www.ooso.net/index.php/archives/370/feed</wfw:commentRss><description>去年yahoo提供了公开的yui主机，这样即便自己没有server也可以直接使用yui的便利。但是由于主机在国外，访问速度不是很理想。现在终于有了本地版的yui hosting，访问速度有大的飞跃。
2008年1月14日雅虎中国正式发布本地版的YUI 2.4.1，今后将与YUI保持同步更新。这对国内的YUI使用者来说绝对是一个好消息，本地版的YUI采用了本地CDN部署，对于国内用户来说访问速度更快(图一)，比较访问国际YUI主机的速度(图二)快了至少5倍以上。
使用firebug查看载入速度

原文：YUI Blog China</description><category>JAVASCRIPT</category><category>yui</category><category>yahoo</category><pubDate>Sun, 20 Jan 2008 16:31:02 +0800</pubDate><author>volcano</author><comments>http://www.ooso.net/index.php/archives/370#comments</comments><guid isPermaLink="false">http://www.ooso.net/index.php/archives/370</guid><dc:creator>volcano</dc:creator><fs:srclink>http://www.ooso.net/index.php/archives/370</fs:srclink><fs:srcfeed>http://www.ooso.net/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/ooso/~6980883/72162239/5088797</fs:itemid></item></channel></rss>