<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/1.5.2" -->
<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/"
>

<channel>
	<title>RobertBolton.com</title>
	<link>http://www.robertbolton.com</link>
	<description>A lot to do about nothing</description>
	<pubDate>Wed, 07 Jul 2010 23:41:00 +0000</pubDate>
	<generator>http://wordpress.org/?v=1.5.2</generator>
	<language>en</language>

		<item>
		<title>Mocking Objects with Final Methods in PHPUnit</title>
		<link>http://www.robertbolton.com/mocking-objects-with-final-methods-in-phpunit</link>
		<comments>http://www.robertbolton.com/mocking-objects-with-final-methods-in-phpunit#comments</comments>
		<pubDate>Wed, 07 Jul 2010 23:32:02 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Zend Framework</category>
		<guid>http://www.robertbolton.com/mocking-objects-with-final-methods-in-phpunit</guid>
		<description><![CDATA[	Having some issues with a mock in PHPUnit - the method on the mocked object was being called and the code run (bootstrap method on Zend_Application_Bootstrap_BootstrapAbstract). After some head scratching, I realized it was a final method, so PHPUnit can&#8217;t override it, and thus, the code is executed.  I extended Zend_Application_Bootstrap_BootstrapAbstract and overwrote the [...]]]></description>
			<content:encoded><![CDATA[	<p>Having some issues with a mock in PHPUnit - the method on the mocked object was being called and the code run (bootstrap method on Zend_Application_Bootstrap_BootstrapAbstract). After some head scratching, I realized it was a final method, so PHPUnit can&#8217;t override it, and thus, the code is executed.  I extended Zend_Application_Bootstrap_BootstrapAbstract and overwrote the code that was cuasing problems (::bootstrap is final, but it calls ::_bootstrap, which you can override). </p>
	<p>I &#8216;ve been meaning to play around with <a href="http://blog.astrumfutura.com/archives/392-The-Mockery-An-Independent-Mock-Object-and-Stub-Framework-for-PHP5.html">Mockery</a>, but until then, I&#8217;ve come up with some ways to deal with Mocks in PHPUnit (I personally don&#8217;t think the implementation is too bad, but I&#8217;m not a die hard tester&#8230;). One of the issues I commonly run into is needing to return mocked objects from a mocked method. This is easy if the method is only called once, but what about if the same method is called a couple of times, and you need to return different mocks (e.g. ::bootstrap($name) will return different objects based on the $name parameter)?</p>
	<p>I&#8217;ve used a closure with a callbackValue to get around this:</p>
	<div id="phpizer_div_1" class="code">
<code><span style="color: #000000"><br />
<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$mapper&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getMock</span><span style="color: #007700">(</span><span style="color: #DD0000">&#8216;Bolton_MapperInterface&#8217;</span><span style="color: #007700">);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$relatedMapper&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getMock</span><span style="color: #007700">(</span><span style="color: #DD0000">&#8216;Bolton_MapperInterface&#8217;</span><span style="color: #007700">);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$callback&nbsp;</span><span style="color: #007700">=&nbsp;function(</span><span style="color: #0000BB">$property</span><span style="color: #007700">)&nbsp;&nbsp;use(</span><span style="color: #0000BB">$mapper</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$relatedMapper</span><span style="color: #007700">)&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">$property&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #DD0000">&#8216;model&#8217;</span><span style="color: #007700">)&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">$mapper</span><span style="color: #007700">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;if&nbsp;(</span><span style="color: #0000BB">$property&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #DD0000">&#8216;childModel&#8217;</span><span style="color: #007700">)&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">$relatedMapper</span><span style="color: #007700">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;new&nbsp;</span><span style="color: #0000BB">Exception</span><span style="color: #007700">(</span><span style="color: #0000BB">sprintf</span><span style="color: #007700">(</span><span style="color: #DD0000">&#8216;Mapper&nbsp;factory&nbsp;mock&nbsp;passed&nbsp;an&nbsp;unexpected&nbsp;parameter&nbsp;(%s)&#8217;</span><span style="color: #007700">,</span><span style="color: #0000BB">$property</span><span style="color: #007700">));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};</p>
	<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_mapperFactory</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">expects</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">any</span><span style="color: #007700">())-&gt;</span><span style="color: #0000BB">method</span><span style="color: #007700">(</span><span style="color: #DD0000">&#8216;factory&#8217;</span><span style="color: #007700">)-&gt;</span><span style="color: #0000BB">will</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">returnCallback</span><span style="color: #007700">(</span><span style="color: #0000BB">$callback</span><span style="color: #007700">));<br />
<br /></span><span style="color: #0000BB">?&gt;<br /></span><br />
</span><br />
</code></div>
	<p>What about needing to return a different value based on the number of times the method has been called? I&#8217;ll use a callback function, but then have a static variable in the callback function that keeps track of how many times it has been called. In the test setUp() method, I will reset the static variable, so the function can be used across a number of different tests.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.robertbolton.com/mocking-objects-with-final-methods-in-phpunit/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>Google Webmaster Tools DNS verification with Slicehost</title>
		<link>http://www.robertbolton.com/google-webmaster-tools-dns-verification-with-slicehost</link>
		<comments>http://www.robertbolton.com/google-webmaster-tools-dns-verification-with-slicehost#comments</comments>
		<pubDate>Wed, 05 May 2010 22:16:44 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Google Analytics</category>
		<guid>http://www.robertbolton.com/google-webmaster-tools-dns-verification-with-slicehost</guid>
		<description><![CDATA[	Google added a new way to verify your site in their Webmaster Tools: through a DNS TXT entry. It took me a  couple of tries to figure out how to properly enter it through Slicehost&#8217;s DNS GUI:

Type: TXT
	Name: Enter the FQD name domain that you put in Google Webmaster Tools  I.e. for this [...]]]></description>
			<content:encoded><![CDATA[	<p>Google added a new way to verify your site in their Webmaster Tools: through a DNS TXT entry. It took me a  couple of tries to figure out how to properly enter it through Slicehost&#8217;s DNS GUI:
<ol>
<li>Type: TXT</li>
	<li>Name: Enter the <strike>FQD name</strike> domain that you put in Google Webmaster Tools  I.e. for this site, I would use www.robertbolton.com or robertbolton.com, depending on what I entered into Webmaster Tools.
</li>
	<li>Data: Enter the value provided by Google (i.e. google-site-verification: waRANDbRgWxXfEBMKhl8c1v8fL1kcVvRtPFU-OmN9I1)
</li>
</ol>
	<p>To see if it worked, you can use the command line &#8220;host -t txt robertbolton.com&#8221; and a result should come back. Or just cross your fingers and click the verify button in Google&#8230;
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.robertbolton.com/google-webmaster-tools-dns-verification-with-slicehost/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>Save Nvidia display settings Ubuntu 9.10</title>
		<link>http://www.robertbolton.com/save-nvidia-display-settings-ubuntu-910</link>
		<comments>http://www.robertbolton.com/save-nvidia-display-settings-ubuntu-910#comments</comments>
		<pubDate>Fri, 08 Jan 2010 18:13:13 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Uncategorized</category>
	<category>Ubuntu</category>
		<guid>http://www.robertbolton.com/save-nvidia-display-settings-ubuntu-910</guid>
		<description><![CDATA[	I received a new monitor for xmas and wanted to set up dual display (twinview) for Ubuntu 9.10. I already had the proprietary Nvidia drivers install, and it was very easy to get the dual monitors up and running. However, I always got this error when trying to save the configuration: Can&#8217;t parse /etc/X11/xorg.conf. And [...]]]></description>
			<content:encoded><![CDATA[	<p>I received a new monitor for xmas and wanted to set up dual display (twinview) for Ubuntu 9.10. I already had the proprietary Nvidia drivers install, and it was very easy to get the dual monitors up and running. However, I always got this error when trying to save the configuration: Can&#8217;t parse /etc/X11/xorg.conf. And upon restarting, only one screen would show and I would have to set it up again.</p>
	<p>Even when I launched Nvidia with sudo (<i>sudo nvidia-settings</i>), I still got this error on the command line:</p>
	<blockquote><p>VALIDATION ERROR:  Data incomplete in file /etc/X11/xorg.conf.<br />
Undefined Device &#8220;(null)&#8221; referenced by Screen &#8220;Default Screen&#8221;.</p></blockquote>
	<p>I moved <i>/etc/X11/xorg.conf</i> to a new filename, ran <i>sudo nvidia-settings</i> and was able to save as new xorg.conf file and now I have both monitors on start up. Also looks like you can simply <a href="http://awesomelinux.blogspot.com/2009/11/ubuntu-910-karmic-nvidia-settings-parse.html">edit the existing xorg.conf file</a> and you will be able to save your settings.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.robertbolton.com/save-nvidia-display-settings-ubuntu-910/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>Sound Doesn&#8217;t Work Kubuntu 9.10 with PulseAudio</title>
		<link>http://www.robertbolton.com/sound-doesnt-work-kubuntu-910-with-pulseaudio</link>
		<comments>http://www.robertbolton.com/sound-doesnt-work-kubuntu-910-with-pulseaudio#comments</comments>
		<pubDate>Sat, 19 Dec 2009 02:04:57 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Uncategorized</category>
	<category>Ubuntu</category>
		<guid>http://www.robertbolton.com/sound-doesnt-work-kubuntu-910-with-pulseaudio</guid>
		<description><![CDATA[	It seems like every time I upgrade Kubuntu, my sound doesn&#8217;t work anymore. I guess &#8220;doesn&#8217;t work&#8221; isn&#8217;t the right term. It seems that the output is muted. If I type pavucontrol into the command line and then go to output devices on the volume control window that pops up,  the Internal Audio Analog [...]]]></description>
			<content:encoded><![CDATA[	<p>It seems like every time I upgrade Kubuntu, my sound doesn&#8217;t work anymore. I guess &#8220;doesn&#8217;t work&#8221; isn&#8217;t the right term. It seems that the output is muted. If I type pavucontrol into the command line and then go to output devices on the volume control window that pops up,  the Internal Audio Analog Stereo is muted. I don&#8217;t know why the pulse audio volume control is defaulting to that setting every time I upgrade, but I fiddled around with my sound settings a couple of years ago when I was having issues and that&#8217;s likely the culprit. I think I need to do a fresh install one of these days&#8230;.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.robertbolton.com/sound-doesnt-work-kubuntu-910-with-pulseaudio/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>Zend_Auth and more than one record matches the supplied identity</title>
		<link>http://www.robertbolton.com/zend_auth-and-more-than-one-record-matches-the-supplied-identity</link>
		<comments>http://www.robertbolton.com/zend_auth-and-more-than-one-record-matches-the-supplied-identity#comments</comments>
		<pubDate>Sun, 13 Dec 2009 21:34:37 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Zend Framework</category>
		<guid>http://www.robertbolton.com/zend_auth-and-more-than-one-record-matches-the-supplied-identity</guid>
		<description><![CDATA[	The Zend_Auth Db adapter will fail if you have more than one record returned, which makes sense. However, when I have coded something like this in the past, I would check how many records were returned with a matching username and password. Zend_Auth looks at how many records are returned for the username field regardless [...]]]></description>
			<content:encoded><![CDATA[	<p>The Zend_Auth Db adapter will fail if you have more than one record returned, which makes sense. However, when I have coded something like this in the past, I would check how many records were returned with a matching username and password. Zend_Auth looks at how many records are returned for the username field regardless of whether the password matches, so you need to have a unique username field. I was trying to use a person&#8217;s last name and password to authenticate, but obviously people had the same last name, so it was failling.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.robertbolton.com/zend_auth-and-more-than-one-record-matches-the-supplied-identity/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>Setting up a new Site with Zend Framework Application/Tool</title>
		<link>http://www.robertbolton.com/setting-up-a-new-site-with-zend-framework-applicationtool</link>
		<comments>http://www.robertbolton.com/setting-up-a-new-site-with-zend-framework-applicationtool#comments</comments>
		<pubDate>Wed, 02 Dec 2009 04:59:33 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Zend Framework</category>
		<guid>http://www.robertbolton.com/setting-up-a-new-site-with-zend-framework-applicationtool</guid>
		<description><![CDATA[	It&#8217;s been awhile since I had to set up a new site with Zend Framework, and I took the chance to play around with Zend_Tool_Project. Following the QuickStart guide, I had a site up and running in no time. But it did take me a little while to figure out how to get my modules [...]]]></description>
			<content:encoded><![CDATA[	<p>It&#8217;s been awhile since I had to set up a new site with Zend Framework, and I took the chance to play around with Zend_Tool_Project. Following the <a href="http://framework.zend.com/docs/quickstart">QuickStart guide</a>, I had a site up and running in no time. But it did take me a little while to figure out how to get my modules and custom library working with the site. </p>
	<h3>Modules</h3>
To get modules enabled, you first need to create a module with Zend_Tool_Project, or you can manually create a modules directory and add the module folder there. If I wanted to add a module called <i>cms</i>, I would create application/modules/cms or use the command line <i>zf create module cms</i>.</p>
	<p>Then, In application.ini, you need to add the following two lines:<br />
resources.modules[] =<br />
resources.frontController.moduleDirectory = APPLICATION_PATH &#8220;/modules&#8221;</p>
	<p>Finally, in order to load models and views, you need to add a Bootstrap.php file in the root of the modules - i.e. application/modules/cms/Bootstrap.php. In the module Bootstrap.php, place the following:<br />
<div id="phpizer_div_1" class="code">
<code><span style="color: #000000"><br />
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">Cms_Bootstrap&nbsp;</span><span style="color: #007700">extends&nbsp;</span><span style="color: #0000BB">Zend_Application_Module_Bootstrap<br />
</span><span style="color: #007700">{<br />
}<br />
<br /></span><span style="color: #0000BB">?&gt;<br /></span><br />
</span><br />
</code></div>
	<p>You should be all set with modules now. Models you create within the module will use the naming convention of <i>Cms_Model_Foo</i> and controllers will be <i>Cms_IndexController</i> (when using Zend_Tool_Project and issuing <i>zf create controller index index-action-included=1 cms</i>, it names the controller class <i>IndexController</i> instead of <i>Cms_IndexController</i>?)</p>
	<h3>Autoloading Custom Library</h3>
	<p>The last thing I needed was to autoload my personal library which uses the naming convention <i>Bolton_</i>. My custom library resides in the same folder as the Zend library and is within my include path set in php.ini. In application.ini, you need to add the following line:
<pre>autoloaderNamespaces[] = \"Bolton_\"</pre>
]]></content:encoded>
			<wfw:commentRSS>http://www.robertbolton.com/setting-up-a-new-site-with-zend-framework-applicationtool/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>Zend_Service_Technorati and Connection Errors</title>
		<link>http://www.robertbolton.com/zend_service_technorati-and-connection-errors</link>
		<comments>http://www.robertbolton.com/zend_service_technorati-and-connection-errors#comments</comments>
		<pubDate>Wed, 04 Nov 2009 03:33:45 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Zend Framework</category>
		<guid>http://www.robertbolton.com/zend_service_technorati-and-connection-errors</guid>
		<description><![CDATA[	I had a site that uses Technorati&#8217;s API via Zend Framework- i.e. Zend_Service_Technorati. I noticed I am getting TCP connection errors via an exception (Message: Unable to Connect to tcp://api.technorati.com:80. Error #111: Connection refused), and upon going to Technorati&#8217;s site to look at the API, I  found out the new API is under works [...]]]></description>
			<content:encoded><![CDATA[	<p>I had a site that uses Technorati&#8217;s API via Zend Framework- i.e. Zend_Service_Technorati. I noticed I am getting TCP connection errors via an exception (Message: Unable to Connect to tcp://api.technorati.com:80. Error #111: Connection refused), and upon going to Technorati&#8217;s site to look at the <a href="http://technorati.com/developers">API</a>, I  found out the new API is under works and the old API is available until October 25th, 2009.  It is November 3rd, the old API apparently doesn&#8217;t work and the new API isn&#8217;t released. Really? Am I missing something here? TCP connection failing tells me they are rejecting completely rejecting the TCP connection, which leads me to believe they have shut off the API. Searching on <a href="http://twitter.com/#search?q=technorati%20api">Twitter</a> confirms this, although having an existing key doesn&#8217;t seem to matter&#8230;
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.robertbolton.com/zend_service_technorati-and-connection-errors/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>PHPUnit and Mock Object Exactly Method</title>
		<link>http://www.robertbolton.com/phpunit-and-mock-object-exactly-method</link>
		<comments>http://www.robertbolton.com/phpunit-and-mock-object-exactly-method#comments</comments>
		<pubDate>Sun, 01 Nov 2009 17:49:19 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>PHP</category>
		<guid>http://www.robertbolton.com/phpunit-and-mock-object-exactly-method</guid>
		<description><![CDATA[	

&#60;?php$mapper-&#62;expects($this-&#62;exactly(&#8216;2&#8242;))-&#62;method(&#8216;delete&#8217;);
$mapper-&#62;expects($this-&#62;exactly(2))-&#62;method(&#8216;delete&#8217;);
?&#62;


	The two above lines of code don&#8217;t behave the same. When passing in 2 as a string instead of a number, PHPUnit declares it a failure:

Em_Model_Collection_MapperTest::testDeleteCollectionWithJoinTable
Expectation failed for method name is equal to  when invoked 2 time(s).
Method was expected to be called 2 times, actually called 2 times.

]]></description>
			<content:encoded><![CDATA[	<div id="phpizer_div_1" class="code">
<code><span style="color: #000000"><br />
<span style="color: #0000BB">&lt;?php<br />$mapper</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">expects</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">exactly</span><span style="color: #007700">(</span><span style="color: #DD0000">&#8216;2&#8242;</span><span style="color: #007700">))-&gt;</span><span style="color: #0000BB">method</span><span style="color: #007700">(</span><span style="color: #DD0000">&#8216;delete&#8217;</span><span style="color: #007700">);<br />
</span><span style="color: #0000BB">$mapper</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">expects</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">exactly</span><span style="color: #007700">(</span><span style="color: #0000BB">2</span><span style="color: #007700">))-&gt;</span><span style="color: #0000BB">method</span><span style="color: #007700">(</span><span style="color: #DD0000">&#8216;delete&#8217;</span><span style="color: #007700">);<br />
<br /></span><span style="color: #0000BB">?&gt;<br /></span><br />
</span><br />
</code></div>
	<p>The two above lines of code don&#8217;t behave the same. When passing in 2 as a string instead of a number, PHPUnit declares it a failure:
<pre>
Em_Model_Collection_MapperTest::testDeleteCollectionWithJoinTable
Expectation failed for method name is equal to <string :delete> when invoked 2 time(s).
Method was expected to be called 2 times, actually called 2 times.
</string></pre>
]]></content:encoded>
			<wfw:commentRSS>http://www.robertbolton.com/phpunit-and-mock-object-exactly-method/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>MooTools, form send function and b.lastIndexOf is not a function error</title>
		<link>http://www.robertbolton.com/mootools-form-send-function-and-blastindexof-is-not-a-function-error</link>
		<comments>http://www.robertbolton.com/mootools-form-send-function-and-blastindexof-is-not-a-function-error#comments</comments>
		<pubDate>Thu, 15 Oct 2009 22:07:50 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Uncategorized</category>
	<category>JavaScript</category>
		<guid>http://www.robertbolton.com/mootools-form-send-function-and-blastindexof-is-not-a-function-error</guid>
		<description><![CDATA[	I am new to MooTools and was using MooTools 1.2.3 to submit a form via Ajax - pretty standard stuff. When trying to put in callbacks for onSuccess,onRequest, etc&#8230; I kept getting JavaScript errors (b.lastIndexOf is not a function).  Looks like you need to use set() function first, then call send(). MooTools must have [...]]]></description>
			<content:encoded><![CDATA[	<p>I am new to MooTools and was using MooTools 1.2.3 to submit a form via Ajax - pretty standard stuff. When trying to put in callbacks for onSuccess,onRequest, etc&#8230; I kept getting JavaScript errors (b.lastIndexOf is not a function).  Looks like you need to use set() function first, then call send(). MooTools must have been updated, because there are a lot of examples on the intraweb that do not do this, but work in my browser. To add to my confustion, you can call send() on the form without set first as long as you don&#8217;t pass an object with callbacks as a parameter in send().<br />
<b>This works</b>
<pre>            window.addEvent('domready', function() {
                $('myForm').addEvent('submit',function(event) {
                    event.preventDefault();
                    this.send();
                })
            });
</pre>
	<p><b>This does not work</b>
<pre>
            window.addEvent('domready', function() {
                $('myForm').addEvent('submit',function(event) {
                    event.preventDefault();
                    this.send({onComplete:function(){alert('this');}});
                })
            });
</pre>
	<p><b>This works with callbacks</b>
<pre>
            window.addEvent('domready', function() {
                $('myForm').addEvent('submit',function(event) {
                    event.preventDefault();
                    this.set('send',{onComplete:function(){
                            alert('this');
                        }
                    }).send();
                })
            });
</pre>
	<p>Anyways, after a day of playing with MooTools, I have say I am impressed. Not sure why, but I think this is my favorite framework. I can&#8217;t say I have much experience with JS frameworks, and my JavaScript is pretty bad these days, but I am impressed with MooTools so far.</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.robertbolton.com/mootools-form-send-function-and-blastindexof-is-not-a-function-error/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>symlink with FTP</title>
		<link>http://www.robertbolton.com/symlink-with-ftp</link>
		<comments>http://www.robertbolton.com/symlink-with-ftp#comments</comments>
		<pubDate>Tue, 29 Sep 2009 00:16:20 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>PHP</category>
	<category>Linux</category>
		<guid>http://www.robertbolton.com/symlink-with-ftp</guid>
		<description><![CDATA[	Apparently you can&#8217;t use FTP for symlinks? It&#8217;s been so long since I have mucked around with FTP, that I didn&#8217;t realize you could not create symlinks. I have an old site I still maintain and had to move it to a new hosting provider and the new provider did not give SSH access (well [...]]]></description>
			<content:encoded><![CDATA[	<p>Apparently you can&#8217;t use FTP for symlinks? It&#8217;s been so long since I have mucked around with FTP, that I didn&#8217;t realize you could not create symlinks. I have an old site I still maintain and had to move it to a new hosting provider and the new provider did not give SSH access (well at least without charging for it). PHP to the rescue:<br />
<div id="phpizer_div_1" class="code">
<code><span style="color: #000000"><br />
<span style="color: #0000BB">&lt;?php<br />symlink</span><span style="color: #007700">(</span><span style="color: #DD0000">&#8216;../gallery&#8217;</span><span style="color: #007700">,</span><span style="color: #DD0000">&#8216;gallery&#8217;</span><span style="color: #007700">);<br />
<br /></span><span style="color: #0000BB">?&gt;<br /></span><br />
</span><br />
</code></div>
	<p>Use the <a href="http://us2.php.net/symlink">symlink command in PHP</a>. Obviously you need to have the proper permissions, and since PHP may be running as a different user, your mileage may very. But it worked for me&#8230;
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.robertbolton.com/symlink-with-ftp/feed/</wfw:commentRSS>
	</item>
	</channel>
</rss>
