<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments for recurser</title>
	<atom:link href="http://recurser.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://recurser.com</link>
	<description></description>
	<pubDate>Sun, 07 Sep 2008 14:42:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>Comment on OS X zsh shell config by hentai adult game high</title>
		<link>http://recurser.com/articles/2007/07/25/os-x-zsh-shell-config/#comment-882</link>
		<dc:creator>hentai adult game high</dc:creator>
		<pubDate>Fri, 05 Sep 2008 07:24:44 +0000</pubDate>
		<guid isPermaLink="false">http://recurser.com/articles/2007/07/25/os-x-zsh-shell-config/#comment-882</guid>
		<description>hentai high game games adult hentai game high</description>
		<content:encoded><![CDATA[<p>hentai high game games adult hentai game high</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Subversion Server on CentOS by lesbian xx hentai girl</title>
		<link>http://recurser.com/articles/2008/03/27/subversion-server-on-centos/#comment-881</link>
		<dc:creator>lesbian xx hentai girl</dc:creator>
		<pubDate>Thu, 04 Sep 2008 23:15:38 +0000</pubDate>
		<guid isPermaLink="false">http://recurser.com/articles/2008/03/27/subversion-server-on-centos/#comment-881</guid>
		<description>hentai girl porn xx hentai xx girl hot</description>
		<content:encoded><![CDATA[<p>hentai girl porn xx hentai xx girl hot</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on jQuery SimpleColor Color-Picker by loanzo</title>
		<link>http://recurser.com/articles/2007/12/18/jquery-simplecolor-color-picker/#comment-880</link>
		<dc:creator>loanzo</dc:creator>
		<pubDate>Tue, 02 Sep 2008 21:18:02 +0000</pubDate>
		<guid isPermaLink="false">http://recurser.com/articles/2007/12/18/jquery-simplecolor-color-picker/#comment-880</guid>
		<description>wow )) 
its very interesting article. 
Nice post. 
realy gj 
 
thx :-)</description>
		<content:encoded><![CDATA[<p>wow )) <br />
its very interesting article. <br />
Nice post. <br />
realy gj </p>
<p>thx :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Find Prime Factors with Python by dude</title>
		<link>http://recurser.com/articles/2007/12/17/find-prime-factors-with-python/#comment-162</link>
		<dc:creator>dude</dc:creator>
		<pubDate>Sat, 26 Jul 2008 18:57:46 +0000</pubDate>
		<guid isPermaLink="false">http://recurser.com/articles/2007/12/17/find-prime-factors-with-python/#comment-162</guid>
		<description>fact: 2 is not a prime factor of all numbers.</description>
		<content:encoded><![CDATA[<p>fact: 2 is not a prime factor of all numbers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Appfuse &#8220;failed to lazily initialize a collection of role&#8221; by irgeek</title>
		<link>http://recurser.com/articles/2007/11/27/appfuse-failed-to-lazily-initialize-a-collection-of-role/#comment-160</link>
		<dc:creator>irgeek</dc:creator>
		<pubDate>Wed, 23 Jul 2008 01:16:06 +0000</pubDate>
		<guid isPermaLink="false">http://recurser.com/articles/2007/11/27/appfuse-failed-to-lazily-initialize-a-collection-of-role/#comment-160</guid>
		<description>thx! Exactly what I needed!</description>
		<content:encoded><![CDATA[<p>thx! Exactly what I needed!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Add Dreamweaver Extensions by mantosz</title>
		<link>http://recurser.com/articles/2007/06/04/add-dreamweaver-extensions/#comment-159</link>
		<dc:creator>mantosz</dc:creator>
		<pubDate>Sun, 20 Jul 2008 12:50:09 +0000</pubDate>
		<guid isPermaLink="false">http://recurser.com/articles/2007/06/04/add-dreamweaver-extensions/#comment-159</guid>
		<description>thank you! your article is so helpful.</description>
		<content:encoded><![CDATA[<p>thank you! your article is so helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Format XML with PHP by zaker</title>
		<link>http://recurser.com/articles/2007/04/05/format-xml-with-php/#comment-158</link>
		<dc:creator>zaker</dc:creator>
		<pubDate>Tue, 01 Jul 2008 08:34:16 +0000</pubDate>
		<guid isPermaLink="false">http://recurser.com/articles/2007/04/05/format-xml-with-php/#comment-158</guid>
		<description>*Custom padding*
1. Modify function declaration this way: function formatXmlString($xml, $padstr = " "); 

2. change $line declaration this way:
$line = str_repeat($padstr, $pad).$token;</description>
		<content:encoded><![CDATA[<p><strong>Custom padding</strong><br />
1. Modify function declaration this way: function formatXmlString($xml, $padstr = &#8221; &#8221;); </p>
<p>2. change $line declaration this way:<br />
$line = str_repeat($padstr, $pad).$token;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Format XML with PHP by Zapalenie Łojotokowe</title>
		<link>http://recurser.com/articles/2007/04/05/format-xml-with-php/#comment-157</link>
		<dc:creator>Zapalenie Łojotokowe</dc:creator>
		<pubDate>Fri, 27 Jun 2008 09:40:59 +0000</pubDate>
		<guid isPermaLink="false">http://recurser.com/articles/2007/04/05/format-xml-with-php/#comment-157</guid>
		<description>Seems my comment got cut off:

        // remove lines between an empty tag
        $xml = preg_replace("&#124;/ ] )(\s([^&#62;] ))?&#62;\n&#60;/\\1&#124;", "", $xml);</description>
		<content:encoded><![CDATA[<p>Seems my comment got cut off:</p>
<p>        // remove lines between an empty tag<br />
        $xml = preg_replace(&#8221;|/ ] )(\s([^>] ))?>\n</\\1|&#8221;, &#8220;&#8221;, $xml);</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Format XML with PHP by Zapalenie Łojotokowe</title>
		<link>http://recurser.com/articles/2007/04/05/format-xml-with-php/#comment-156</link>
		<dc:creator>Zapalenie Łojotokowe</dc:creator>
		<pubDate>Fri, 27 Jun 2008 09:39:55 +0000</pubDate>
		<guid isPermaLink="false">http://recurser.com/articles/2007/04/05/format-xml-with-php/#comment-156</guid>
		<description>Doesn't work for empty tags like  - you need to remove the newline between them afterwards:

// add marker linefeeds to aid the pretty-tokeniser (adds a linefeed between all tag-end boundaries)
        $xml = preg_replace('/(&#62;)(&#60;)(\/*)/', "$1\n$2$3", $xml);

        // remove lines between an empty tag
        $xml = preg_replace("&#124;/ ] )(\s([^&#62;] ))?&#62;\n&#60;/\\1&#124;", "", $xml);</description>
		<content:encoded><![CDATA[<p>Doesn&#8217;t work for empty tags like  &#8211; you need to remove the newline between them afterwards:</p>
<p>// add marker linefeeds to aid the pretty-tokeniser (adds a linefeed between all tag-end boundaries)<br />
        $xml = preg_replace(&#8217;/(>)(< )(\/*)/&#8217;, &#8221;$1\n$2$3&#8221;, $xml);</p>
<p>        // remove lines between an empty tag<br />
        $xml = preg_replace(&#8221;|/ ] )(\s([^>] ))?>\n</\\1|&#8221;, &#8220;&#8221;, $xml);</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Multiple DBs in CakePHP by Justin</title>
		<link>http://recurser.com/articles/2007/06/04/multiple-dbs-in-cakephp/#comment-155</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Wed, 25 Jun 2008 13:16:02 +0000</pubDate>
		<guid isPermaLink="false">http://recurser.com/articles/2007/06/04/multiple-dbs-in-cakephp/#comment-155</guid>
		<description>Ok what i finally came up with works perfect, I didn't need dynamic models names like you so It didn't need to be quiet as complex but here was my problem.  I've got a Master to many Slave topology.  The master is in the clients HQ the slaves are in the remote offices.  We set them up two applications one is very write intensive as it does a LOT of logging so it needs to write to the master - dB A well call it, the other application is a real-time web gui that can control the other application and being real-time and it reads the info for ALL the branches and HQ it's very read intensive, we'll call it dB B.  When the network goes down I then need to read and write to yet again another local dB C (a temp dB).  So here we go with what sounds to be a very complex problem (i spent days coming up with this) first of all Cake 1.1.19 bug: you have to define default in databases.php and if default goes down your application will break (so you should always run a dB on your application box with a dummy dB to appease Cake).  Ok so now to the code in my model I added a method based on model_php5.php

        function changeDataSource($newSource)
        {
                parent::setDataSource($newSource);
        }

then in my controller:

     $db = ConnectionManager::getInstance();
     $connected = $db-&#62;getDataSource('master');

     $connectionTest = $connected-&#62;isConnected();

     if($connectionTest == true)
     {
          $write_dB = 'master';
          $read_dB = 'slave';
     }else{
          $write_dB = $read_dB = 'scratch';
     }

     // CHANGE TO THE WRITE (MASTER) dB
     $this-&#62;Test-&#62;changeDataSource($write_dB);
     $temp = $this-&#62;Test-&#62;findAll();
     echo "This would be the database we are writing to: ";
     echo var_dump($temp);
     echo "";

     // CHANGE TO THE READ (SLAVE) dB
     $this-&#62;Test-&#62;changeDataSource($read_dB);
     $temp = $this-&#62;Test-&#62;findAll();
     echo "This would be the database we are reading from: ";
     echo var_dump($temp);

works beautiful is my primary write server goes down everything switches to my scratch dB and while everything is working good I have access to use both my write and read configs on will just by dynamically changing the datasource.  I know that would have solved your problem dave as yours needed much more dynamic complexity but mine solves most peoples multi-dB type questions (at least I think)</description>
		<content:encoded><![CDATA[<p>Ok what i finally came up with works perfect, I didn&#8217;t need dynamic models names like you so It didn&#8217;t need to be quiet as complex but here was my problem.  I&#8217;ve got a Master to many Slave topology.  The master is in the clients HQ the slaves are in the remote offices.  We set them up two applications one is very write intensive as it does a LOT of logging so it needs to write to the master &#8211; dB A well call it, the other application is a real-time web gui that can control the other application and being real-time and it reads the info for ALL the branches and HQ it&#8217;s very read intensive, we&#8217;ll call it dB B.  When the network goes down I then need to read and write to yet again another local dB C (a temp dB).  So here we go with what sounds to be a very complex problem (i spent days coming up with this) first of all Cake 1.1.19 bug: you have to define default in databases.php and if default goes down your application will break (so you should always run a dB on your application box with a dummy dB to appease Cake).  Ok so now to the code in my model I added a method based on model_php5.php</p>
<p>        function changeDataSource($newSource)<br />
        {<br />
                parent::setDataSource($newSource);<br />
        }</p>
<p>then in my controller:</p>
<p>     $db = ConnectionManager::getInstance();<br />
     $connected = $db->getDataSource(&#8216;master&#8217;);<br />
     $connectionTest = $connected->isConnected();<br />
     if($connectionTest == true)<br />
     {<br />
          $write_dB = &#8216;master&#8217;;<br />
          $read_dB = &#8216;slave&#8217;;<br />
     }else{<br />
          $write_dB = $read_dB = &#8216;scratch&#8217;;<br />
     }<br />
     // CHANGE TO THE WRITE (MASTER) dB<br />
     $this->Test->changeDataSource($write_dB);<br />
     $temp = $this->Test->findAll();<br />
     echo &#8220;This would be the database we are writing to: &#8221;;<br />
     echo var_dump($temp);<br />
     echo &#8220;&#8221;;<br />
     // CHANGE TO THE READ (SLAVE) dB<br />
     $this->Test->changeDataSource($read_dB);<br />
     $temp = $this->Test->findAll();<br />
     echo &#8220;This would be the database we are reading from: &#8221;;<br />
     echo var_dump($temp);</p>
<p>works beautiful is my primary write server goes down everything switches to my scratch dB and while everything is working good I have access to use both my write and read configs on will just by dynamically changing the datasource.  I know that would have solved your problem dave as yours needed much more dynamic complexity but mine solves most peoples multi-dB type questions (at least I think)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Multiple DBs in CakePHP by Justin</title>
		<link>http://recurser.com/articles/2007/06/04/multiple-dbs-in-cakephp/#comment-154</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Tue, 24 Jun 2008 12:34:54 +0000</pubDate>
		<guid isPermaLink="false">http://recurser.com/articles/2007/06/04/multiple-dbs-in-cakephp/#comment-154</guid>
		<description>For those of you who are looking for automatic dB failover putting this code in your models and following the names that you set up in databases.php will provide such.

class Test extends AppModel
{
        var $name = 'Test';

        function __construct()
        {
                $table = Inflector::tableize($this-&#62;name);
                $db = ConnectionManager::getInstance();
                $connected = $db-&#62;getDataSource('default');
                if($connected-&#62;isConnected() == true)
                {
                        $ds = 'default';
                }else{
                        $ds = 'test';
                }
                parent::__construct(false, $table, $ds);
        }

}</description>
		<content:encoded><![CDATA[<p>For those of you who are looking for automatic dB failover putting this code in your models and following the names that you set up in databases.php will provide such.</p>
<p>class Test extends AppModel<br />
{<br />
        var $name = &#8216;Test&#8217;;</p>
<p>        function <em>_construct()<br />
        {<br />
                $table = Inflector::tableize($this->name);<br />
                $db = ConnectionManager::getInstance();<br />
                $connected = $db->getDataSource(&#8216;default&#8217;);<br />
                if($connected->isConnected() == true)<br />
                {<br />
                        $ds = &#8216;default&#8217;;<br />
                }else{<br />
                        $ds = &#8216;test&#8217;;<br />
                }<br />
                parent::</em>_construct(false, $table, $ds);<br />
        }</p>
<p>}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Multiple DBs in CakePHP by Justin</title>
		<link>http://recurser.com/articles/2007/06/04/multiple-dbs-in-cakephp/#comment-153</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Mon, 23 Jun 2008 18:41:15 +0000</pubDate>
		<guid isPermaLink="false">http://recurser.com/articles/2007/06/04/multiple-dbs-in-cakephp/#comment-153</guid>
		<description>Yes you're on the right solution track with this one.  I'm trying to solve a very similar problem atm.  I've got two databases one is a failover and instead of the session based stuff that you have here I need it to check to see if the main one (off site) is up and if it's not then fail over to the backup (localhost).  I'm pretty sure your solution will solve my problem once I figure out exactly what your doing here.</description>
		<content:encoded><![CDATA[<p>Yes you&#8217;re on the right solution track with this one.  I&#8217;m trying to solve a very similar problem atm.  I&#8217;ve got two databases one is a failover and instead of the session based stuff that you have here I need it to check to see if the main one (off site) is up and if it&#8217;s not then fail over to the backup (localhost).  I&#8217;m pretty sure your solution will solve my problem once I figure out exactly what your doing here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Multibyte-safe CSV Parser by Daniel</title>
		<link>http://recurser.com/articles/2007/08/09/multibyte-safe-csv-parser/#comment-152</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Mon, 23 Jun 2008 10:12:14 +0000</pubDate>
		<guid isPermaLink="false">http://recurser.com/articles/2007/08/09/multibyte-safe-csv-parser/#comment-152</guid>
		<description>This line isn't correctly handled:
"lorem""lorem","""lorem""lorem""","lorem,lorem","""lorem,lorem""","""lorem"",""lorem"""

Output:

array(5) {
  [0]=&#62;
  'lorem"lorem'
  [1]=&#62;
  '""lorem"lorem","lorem'
  [2]=&#62;
  'lorem,""lorem'
  [3]=&#62;
  'lorem",""lorem"'
  [4]=&#62;
  '"lorem""'
}


It should be:

array(5) {
  [0]=&#62;
  'lorem"lorem'
  [1]=&#62;
  '"lorem"lorem"'
  [2]=&#62;
  'lorem,lorem'
  [3]=&#62;
  '"lorem,lorem"'
  [4]=&#62;
  '"lorem","lorem"'
}</description>
		<content:encoded><![CDATA[<p>This line isn&#8217;t correctly handled:<br />
&#8220;lorem&#8221;&#8220;lorem&#8221;,&#8221;&#8220;&#8221;lorem&#8221;&#8220;lorem&#8221;&#8220;&#8221;,&#8221;lorem,lorem&#8221;,&#8221;&#8220;&#8221;lorem,lorem&#8221;&#8220;&#8221;,&#8221;&#8220;&#8221;lorem&#8221;&#8221;,&#8221;&#8220;lorem&#8221;&#8220;&#8221;</p>
<p>Output:</p>
<p>array(5) {<br />
  [0]=><br />
  &#8216;lorem&#8221;lorem&#8217;<br />
  [1]=><br />
  &#8217;&#8221;&#8220;lorem&#8221;lorem&#8221;,&#8221;lorem&#8217;<br />
  [2]=><br />
  &#8216;lorem,&#8221;&#8220;lorem&#8217;<br />
  [3]=><br />
  &#8216;lorem&#8221;,&#8221;&#8220;lorem&#8221;&#8217;<br />
  [4]=><br />
  &#8217;&#8221;lorem&#8221;&#8221;&#8217;<br />
}</p>
<p>It should be:</p>
<p>array(5) {<br />
  [0]=><br />
  &#8216;lorem&#8221;lorem&#8217;<br />
  [1]=><br />
  &#8217;&#8221;lorem&#8221;lorem&#8221;&#8217;<br />
  [2]=><br />
  &#8216;lorem,lorem&#8217;<br />
  [3]=><br />
  &#8217;&#8221;lorem,lorem&#8221;&#8217;<br />
  [4]=><br />
  &#8217;&#8221;lorem&#8221;,&#8221;lorem&#8221;&#8217;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Get SVN Revision No. by dave</title>
		<link>http://recurser.com/articles/2006/09/27/get-svn-revision-no/#comment-151</link>
		<dc:creator>dave</dc:creator>
		<pubDate>Mon, 09 Jun 2008 01:54:04 +0000</pubDate>
		<guid isPermaLink="false">http://recurser.com/?p=13#comment-151</guid>
		<description>Hi Ammon, 

Yes that will give you the revision of the current checkout - I meant to write 'latest revision', which you need the network hit of svn log to find out.</description>
		<content:encoded><![CDATA[<p>Hi Ammon, </p>
<p>Yes that will give you the revision of the current checkout &#8211; I meant to write &#8216;latest revision&#8217;, which you need the network hit of svn log to find out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Default Values With Hibernate Annotations by Okada</title>
		<link>http://recurser.com/articles/2007/12/05/default-values-with-hibernate-annotations/#comment-150</link>
		<dc:creator>Okada</dc:creator>
		<pubDate>Fri, 30 May 2008 12:28:16 +0000</pubDate>
		<guid isPermaLink="false">http://recurser.com/articles/2007/12/05/default-values-with-hibernate-annotations/#comment-150</guid>
		<description>Cool

great tip</description>
		<content:encoded><![CDATA[<p>Cool</p>
<p>great tip</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.685 seconds -->
