<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JohnPuPu &#187; program</title>
	<atom:link href="http://blog.johnpupu.tw/category/program/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.johnpupu.tw</link>
	<description>博觀而約取，厚積而薄發!!!</description>
	<lastBuildDate>Wed, 28 Jul 2010 18:02:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Zend Framework Widget</title>
		<link>http://blog.johnpupu.tw/2010/05/13/zend-framework-widget/</link>
		<comments>http://blog.johnpupu.tw/2010/05/13/zend-framework-widget/#comments</comments>
		<pubDate>Wed, 12 May 2010 18:02:35 +0000</pubDate>
		<dc:creator>johnpupu</dc:creator>
				<category><![CDATA[ZendFramework]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.johnpupu.tw/?p=499</guid>
		<description><![CDATA[主要是因為之前用Yii 的 Widget 用的挺開心的( 除了他會每次都進一次Cycle 外)
因為用ZF沒找到有這方面相關的資訊
所以自已動手刻&#8230;..
1. 在application 下建 Titan/Base 的資料夾 ( Titan 是我想把自已寫的東西盡可能的都收在這 )
2. vim Titan/Base/Widget.php

&#60; ?php
abstract class Titan_Base_Widget
{
    protected $_basePath;
    protected $_viewBasePath;
    protected $_viewScriptPath;
    public function __construct( $array = null )
    {
        [...]]]></description>
		<wfw:commentRss>http://blog.johnpupu.tw/2010/05/13/zend-framework-widget/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Yii 1.1 CActiveRecord 關連的部份修正</title>
		<link>http://blog.johnpupu.tw/2010/01/13/yii-1-1-cactiverecord-%e9%97%9c%e9%80%a3%e7%9a%84%e9%83%a8%e4%bb%bd%e4%bf%ae%e6%ad%a3/</link>
		<comments>http://blog.johnpupu.tw/2010/01/13/yii-1-1-cactiverecord-%e9%97%9c%e9%80%a3%e7%9a%84%e9%83%a8%e4%bb%bd%e4%bf%ae%e6%ad%a3/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 11:07:04 +0000</pubDate>
		<dc:creator>johnpupu</dc:creator>
				<category><![CDATA[program]]></category>

		<guid isPermaLink="false">http://blog.johnpupu.tw/?p=494</guid>
		<description><![CDATA[剛剛用Yii 的AR 寫的很開心,
下了這個

    $criteria=new CDbCriteria;
    $criteria-&#62;condition=&#039;products.id=:ID AND products_info.language_id=:languageID&#039;;
    $criteria-&#62;params=array(&#039;:ID&#039;=&#62;$_GET[&#039;id&#039;], &#039;:languageID&#039; =&#62; $this-&#62;_lang_id );
    $criteria-&#62;order = &#039;products_content.content_orders ASC&#039;;

    $model = Products::model()-&#62;with( &#039;products_info&#039;, &#039;products_content&#039; )-&#62;find( $criteria );

一直出現
CDbCommand 無法執行 SQL 陳述: SQLSTATE[42S22]: Column not found: 1054 Unknown column &#8216;products.id&#8217; in &#8216;where clause&#8217;
想說怪了&#8230;
再看了一下 sql [...]]]></description>
		<wfw:commentRss>http://blog.johnpupu.tw/2010/01/13/yii-1-1-cactiverecord-%e9%97%9c%e9%80%a3%e7%9a%84%e9%83%a8%e4%bb%bd%e4%bf%ae%e6%ad%a3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yii Csort With ActiveRecord</title>
		<link>http://blog.johnpupu.tw/2009/10/11/yii-csort/</link>
		<comments>http://blog.johnpupu.tw/2009/10/11/yii-csort/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 06:31:35 +0000</pubDate>
		<dc:creator>johnpupu</dc:creator>
				<category><![CDATA[program]]></category>
		<category><![CDATA[yii php]]></category>

		<guid isPermaLink="false">http://blog.johnpupu.tw/?p=443</guid>
		<description><![CDATA[controller 部份

$sort-&#62;attributes= array(
    &#039;product.id&#039;=&#62;&#039;productId&#039;,
    &#039;product.name&#039;=&#62;&#039;productName&#039;,
    &#039;category.name&#039;=&#62;&#039;categoryName&#039;,
    &#039;brand.name&#039; =&#62; &#039;brandName&#039;,
);

/*
$sort-&#62;attributes= array(
    &#039;model中的alias.欄位&#039;=&#62;&#039;網址顯示的Alias&#039;,
);
*/

view 部份

&#60; ?php echo $sort-&#62;link(&#039;product.id&#039;,&#039;編號&#039;); ?&#62;
//&#60; ?php echo $sort-&#62;link(&#039;table.name&#039;,&#039;網頁顯示的名稱&#039;); ?&#62;

model 部份
記得把 relations中的 alias 設好
如下

  /**
   * @return array relational rules.
   */
  public function relations()
 [...]]]></description>
		<wfw:commentRss>http://blog.johnpupu.tw/2009/10/11/yii-csort/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>system() &amp; exec()</title>
		<link>http://blog.johnpupu.tw/2009/06/10/system-exec/</link>
		<comments>http://blog.johnpupu.tw/2009/06/10/system-exec/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 02:33:48 +0000</pubDate>
		<dc:creator>johnpupu</dc:creator>
				<category><![CDATA[program]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.johnpupu.tw/?p=412</guid>
		<description><![CDATA[system()
 The system() call also tries to automatically flush the web server&#8217;s output buffer after each line of output if PHP is running as a server module.
exec()
 則不會flush
遇到的問題是
我的php 透過perl 去執行一些功能
然後perl 回傳 success or false 字串 在standard output 上
php再去get 這個字串
success 則print success
給 ajax 來判斷
結果 在前端的ajax 一直印出 successsuccess
的字眼
想說怎麼會印兩次&#8230;.
看了一下手冊才發現這個
之前就想說 php 幹麻沒事有兩個 執行CLI 的東西&#8230;&#8230;
仔細看了一下手冊才知道
筆記一下..
]]></description>
		<wfw:commentRss>http://blog.johnpupu.tw/2009/06/10/system-exec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YUI RTE setEditorHTML&#8230;.</title>
		<link>http://blog.johnpupu.tw/2008/11/27/yui-rte-seteditorhtml/</link>
		<comments>http://blog.johnpupu.tw/2008/11/27/yui-rte-seteditorhtml/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 08:22:39 +0000</pubDate>
		<dc:creator>johnpupu</dc:creator>
				<category><![CDATA[program]]></category>
		<category><![CDATA[yui rte]]></category>

		<guid isPermaLink="false">http://blog.johnpupu.tw/?p=343</guid>
		<description><![CDATA[
var myEditor = new YAHOO.widget.Editor(&#039;editor&#039;, config);
myEditor.on(&#039;editorContentLoaded&#039;, function() {
myEditor.setEditorHTML(&#039;This is my new content&#039;);
});
myEditor.render();

要 listening editorContentLoaded event 才行
沒在editorContentLoaded 裡下&#8230;&#8230;&#8230;&#8230;.
myEditor.setEditorHTML(&#8216;This is my new content&#8217;);
沒作用&#8230;&#8230;&#8230;
]]></description>
		<wfw:commentRss>http://blog.johnpupu.tw/2008/11/27/yui-rte-seteditorhtml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>some YUI RTE note..</title>
		<link>http://blog.johnpupu.tw/2008/11/24/some-yui-rte-note/</link>
		<comments>http://blog.johnpupu.tw/2008/11/24/some-yui-rte-note/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 09:15:57 +0000</pubDate>
		<dc:creator>johnpupu</dc:creator>
				<category><![CDATA[program]]></category>
		<category><![CDATA[yui rte]]></category>

		<guid isPermaLink="false">http://blog.johnpupu.tw/?p=335</guid>
		<description><![CDATA[在&#60;body&#62; 這個tag 似乎一定要設
class=&#8217;yui-skin-sam&#8217;
不然會有一些小問題
我之前是設在&#60;div class=&#8217;yui-skin-sam&#8217;&#62;&#60;textarea&#62;&#60;/textarea&#62;&#60;/div&#62;
這樣來解 ..不過&#8230;
用了一陣子才發現&#8230;.class=&#8217;yui-skin-sam&#8217;不是設在body 的話&#8230;.
add link 的這個func 會破版&#8230;&#8230;&#8230;&#8230;..css 會整個走掉&#8230;.
本來是沒有很想加 class 在body 的..
不過突然想到&#8230;.drupal 的 plugin 中也有yui rte
我就去看了一下他是怎麼解的..

&#60;script type=&#34;text/javascript&#34;&#62;
if (Drupal.jsEnabled) { $(document).ready(function() { $(&#039;body&#039;).addClass(&#039;yui-skin-sam&#039;); } ); };
&#60;/script&#62;

然後看了一下skin裡面的css 應該是不至於加了這個class 造成新版的走位，所以就照著幹了&#8230;
]]></description>
		<wfw:commentRss>http://blog.johnpupu.tw/2008/11/24/some-yui-rte-note/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YUI Rich Text Editor 小記</title>
		<link>http://blog.johnpupu.tw/2008/11/17/yui-rich-text-editor-%e5%b0%8f%e8%a8%98/</link>
		<comments>http://blog.johnpupu.tw/2008/11/17/yui-rich-text-editor-%e5%b0%8f%e8%a8%98/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 11:21:52 +0000</pubDate>
		<dc:creator>johnpupu</dc:creator>
				<category><![CDATA[program]]></category>
		<category><![CDATA[yui rte]]></category>

		<guid isPermaLink="false">http://blog.johnpupu.tw/?p=328</guid>
		<description><![CDATA[因為有打算用YUI RTE 來做default 的editor
不過因為有想要在textarea 裡面加入content 的須求
用document.post_form.post_text.value
會沒辦法在&#8221;所見即所得模式&#8221;下有反應
只能在原始碼模式下有作用
翻了一下文件
要用cmd_inserthtml來做
如下

myEditor = YAHOO.widget.EditorInfo.getEditorById(&#039;post_text&#039;);
myEditor.execCommand(&#039;inserthtml&#039;, document.post_form.post_text.value);

這樣應該就搞定了&#8230;
]]></description>
		<wfw:commentRss>http://blog.johnpupu.tw/2008/11/17/yui-rich-text-editor-%e5%b0%8f%e8%a8%98/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php preg_replace bug ??</title>
		<link>http://blog.johnpupu.tw/2008/11/12/php-preg_replace-bug/</link>
		<comments>http://blog.johnpupu.tw/2008/11/12/php-preg_replace-bug/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 05:25:02 +0000</pubDate>
		<dc:creator>johnpupu</dc:creator>
				<category><![CDATA[program]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.johnpupu.tw/?p=323</guid>
		<description><![CDATA[這個問題在在Zend Framework 中
Zend/Db/Statement.php
裡面
[cc lang="php" tab_size="2" lines="40"]
    protected function _stripQuoted($sql)
    {
        // get the character for delimited id quotes,
        // this is usually &#8221; but in MySQL is `
        [...]]]></description>
		<wfw:commentRss>http://blog.johnpupu.tw/2008/11/12/php-preg_replace-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework DB Load Balancing (Master/Slave Database)</title>
		<link>http://blog.johnpupu.tw/2008/08/28/zend-framework-db-load-balancing-masterslave-database/</link>
		<comments>http://blog.johnpupu.tw/2008/08/28/zend-framework-db-load-balancing-masterslave-database/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 05:47:41 +0000</pubDate>
		<dc:creator>johnpupu</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[mysql Zend_Framework php]]></category>

		<guid isPermaLink="false">http://blog.johnpupu.tw/?p=256</guid>
		<description><![CDATA[網路上找來找去&#8230;&#8230;
沒看到有人寫相關的解法&#8230;.
加上不想用mysql-proxy來解這部份&#8230;
所以打算從code 的部份下手
看到最後只能動Zend Framework 的code 了(還沒想到可以不動ZF 的code 而做到DB LB的方法)
我是先從function save 下手去找..
Zend/Table/Row/Abstract.php:    public function save()

public function save()
    {
        /**
         * If the _cleanData array is empty,
         * this is an INSERT [...]]]></description>
		<wfw:commentRss>http://blog.johnpupu.tw/2008/08/28/zend-framework-db-load-balancing-masterslave-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Universal Feed Generator 中文問題..</title>
		<link>http://blog.johnpupu.tw/2008/03/26/php-universal-feed-generator-%e4%b8%ad%e6%96%87%e5%95%8f%e9%a1%8c/</link>
		<comments>http://blog.johnpupu.tw/2008/03/26/php-universal-feed-generator-%e4%b8%ad%e6%96%87%e5%95%8f%e9%a1%8c/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 14:54:00 +0000</pubDate>
		<dc:creator>johnpupu</dc:creator>
				<category><![CDATA[program]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.johnpupu.tw/?p=201</guid>
		<description><![CDATA[之前忘了在那看到這個  PHP Universal Feed Generator 感覺還滿好用的&#8230;
結果就在這幾天要用的時後&#8230;
發現他中文在轉碼的時後有問題&#8230;
trace 一下他的code 發現是298 行的
htmlentities($tagContent);這個的問題
把他換成
htmlentities($tagContent, ENT_COMPAT, &#8216;utf-8&#8242;);
應該就可以了
另外看了一下他在header 的部份沒有宣告是UTF8
所以我也修改了一下&#8230;.
在84 行
header(&#8220;Content-type: text/xml&#8221;);
改一下
header(&#8220;Content-type: text/xml; charset=UTF-8&#8243;);
基本上這樣應該就可以了&#8230;
]]></description>
		<wfw:commentRss>http://blog.johnpupu.tw/2008/03/26/php-universal-feed-generator-%e4%b8%ad%e6%96%87%e5%95%8f%e9%a1%8c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
