<?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"
	>

<channel>
	<title>PJ Hile</title>
	<atom:link href="http://pjhile.com/feed" rel="self" type="application/rss+xml" />
	<link>http://pjhile.com</link>
	<description>Don't worry, I'm from the Internet.</description>
	<pubDate>Wed, 30 Jul 2008 20:45:13 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Ignoring CakePHP&#8217;s tmp/ directory with Subversion</title>
		<link>http://pjhile.com/ignoring-cakephps-tmp-directory-with-subversion</link>
		<comments>http://pjhile.com/ignoring-cakephps-tmp-directory-with-subversion#comments</comments>
		<pubDate>Wed, 30 Jul 2008 20:39:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[CakePHP]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://pjhile.com/?p=30</guid>
		<description><![CDATA[I&#8217;ve noticed on many occasions that I&#8217;ll start a project with a Subversion repo and immediately add/commit all the files included with Cake&#8217;s nightly build including the tmp/ directory.  If you&#8217;ve ever done this, you&#8217;ll know it&#8217;s kind of a pain always having those cache/log files showing up when you commit.  So, for my benefit, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-20" title="CakePHP" src="http://pjhile.com/wp-content/uploads/2008/03/cakephp.gif" alt="" width="185" height="174" style="float: right;" />I&#8217;ve noticed on many occasions that I&#8217;ll start a project with a Subversion repo and immediately add/commit all the files included with Cake&#8217;s <a href="http://www.cakephp.org/downloads/index/nightly/" target="_blank">nightly build</a> including the tmp/ directory.  If you&#8217;ve ever done this, you&#8217;ll know it&#8217;s kind of a pain always having those cache/log files showing up when you commit.  So, for my benefit, I&#8217;m posting these few lines of code in order for me to refer to later.</p>
<p>From the app/ directory:<br />
<code><br />
svn export tmp tmpBAK<br />
svn rm --force tmp<br />
svn ci -m 'Removing directory "tmp".'<br />
mv tmpBAK tmp<br />
svn propset svn:ignore 'tmp' .<br />
svn ci -m 'Ignoring "tmp" directory.'<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://pjhile.com/ignoring-cakephps-tmp-directory-with-subversion/feed</wfw:commentRss>
		</item>
		<item>
		<title>Changing the CakePHP Auth component password hash</title>
		<link>http://pjhile.com/changing-the-cakephp-auth-component-password-hash</link>
		<comments>http://pjhile.com/changing-the-cakephp-auth-component-password-hash#comments</comments>
		<pubDate>Thu, 29 May 2008 14:34:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://pjhile.com/changing-the-cakephp-auth-component-password-hash</guid>
		<description><![CDATA[In moving some legecy sites over to CakePHP, I&#8217;ve come across some situations where I need to the Auth component to &#8216;hash&#8217; the password differently.  For example, just a straight md5() of the password.
To accomplish this, you need to empty your Security.salt variable in /app/config/core.php (Not positive what all this will affect):
Configure::write('Security.salt', '');
and change [...]]]></description>
			<content:encoded><![CDATA[<p>In moving some legecy sites over to CakePHP, I&#8217;ve come across some situations where I need to the Auth component to &#8216;hash&#8217; the password differently.  For example, just a straight md5() of the password.</p>
<p>To accomplish this, you need to empty your Security.salt variable in /app/config/core.php (Not positive what all this will affect):</p>
<p><code>Configure::write('Security.salt', '');</code></p>
<p>and change the hash method of the Security class (I did this in app_controller.php):</p>
<p><code>function beforeFilter(){<br />
&nbsp; &nbsp;Security::setHash('md5');<br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://pjhile.com/changing-the-cakephp-auth-component-password-hash/feed</wfw:commentRss>
		</item>
		<item>
		<title>Twitter client for Ubuntu</title>
		<link>http://pjhile.com/twitter-client-for-ubuntu</link>
		<comments>http://pjhile.com/twitter-client-for-ubuntu#comments</comments>
		<pubDate>Fri, 23 May 2008 03:42:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Twitter]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://pjhile.com/twitter-client-for-ubuntu</guid>
		<description><![CDATA[Twhirl is an Adobe Air based Twitter client, and one of my favorites for use on my Dell Latitude D630 running Ubuntu Hardy Heron.  For instructions on how to install Air, click here. Then, download/install Twhirl from here.  Total install time is 5-10 minutes.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://pjhile.com/?attachment_id=27" rel="attachment wp-att-27" title="Twhirl"><img src="http://pjhile.com/wp-content/uploads/2008/05/twhirl.thumbnail.gif" title="Twhirl" alt="Twhirl" style="padding: 0pt 20px 20px 0pt" align="left" /></a>Twhirl is an Adobe Air based Twitter client, and one of my favorites for use on my Dell Latitude D630 running Ubuntu Hardy Heron.  For instructions on how to install Air, <a href="http://www.sizlopedia.com/2008/04/06/how-to-install-adobe-air-on-ubuntu/" target="_blank">click here</a>. Then, download/install Twhirl from <a href="http://www.twhirl.org/" target="_blank">here</a>.  Total install time is 5-10 minutes.</p>
]]></content:encoded>
			<wfw:commentRss>http://pjhile.com/twitter-client-for-ubuntu/feed</wfw:commentRss>
		</item>
		<item>
		<title>Bluetooth on Dell D630 - Ubuntu 8.04 Hardy Heron</title>
		<link>http://pjhile.com/bluetooth-on-dell-d630-ubuntu-804-hardy-heron</link>
		<comments>http://pjhile.com/bluetooth-on-dell-d630-ubuntu-804-hardy-heron#comments</comments>
		<pubDate>Wed, 07 May 2008 03:23:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Dell]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://pjhile.com/bluetooth-on-dell-d630-ubuntu-804-hardy-heron</guid>
		<description><![CDATA[It took a little bit of work for me to get my Dell bluetooth mouse and keyboard working with my new work laptop (Dell D630), but in the end it was pretty easy.
First, make sure gnome-bluetooth and bluez-gnome are installed in Synaptic.  Then, in a terminal type &#8220;sudo hidd &#8211;search&#8221; and click the little bluetooth [...]]]></description>
			<content:encoded><![CDATA[<p><img style="padding: 0pt 20px 10px 0pt; float: left" src="http://pjhile.com/wp-content/uploads/2008/05/dellubuntu.jpg" alt="Dell Ubuntu" />It took a little bit of work for me to get my Dell bluetooth mouse and keyboard working with my new work laptop (Dell D630), but in the end it was pretty easy.</p>
<p>First, make sure gnome-bluetooth and bluez-gnome are installed in Synaptic.  Then, in a terminal type &#8220;sudo hidd &#8211;search&#8221; and click the little bluetooth button on the underside of the mouse/keyboard.</p>
]]></content:encoded>
			<wfw:commentRss>http://pjhile.com/bluetooth-on-dell-d630-ubuntu-804-hardy-heron/feed</wfw:commentRss>
		</item>
		<item>
		<title>Putting a Google Map on your site with PHP: Part 1</title>
		<link>http://pjhile.com/putting-a-google-map-on-your-site-with-php-part-1</link>
		<comments>http://pjhile.com/putting-a-google-map-on-your-site-with-php-part-1#comments</comments>
		<pubDate>Mon, 24 Mar 2008 14:09:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Google]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://pjhile.com/putting-a-google-map-on-your-site-with-php-part-1</guid>
		<description><![CDATA[The first step in getting a Google map on your site is to get the latitude and longitude coordinates of all the points you want to show.  I get my coordinates using geocoding in the Google Maps API.  In order to use the Google Maps API, you must sign up for a free [...]]]></description>
			<content:encoded><![CDATA[<p><img style="padding: 0pt 0pt 10px 5px" title="Google Map" src="http://pjhile.com/wp-content/uploads/2008/03/google_map.png" alt="Google Map" align="right" />The first step in getting a Google map on your site is to get the latitude and longitude coordinates of all the points you want to show.  I get my coordinates using <a href="http://googlemapsapi.blogspot.com/2006/06/geocoding-at-last.html" target="_blank">geocoding</a> in the Google Maps API.  In order to use the Google Maps API, you must sign up for a free key <a href="http://code.google.com/apis/maps/signup.html" target="_blank">here</a>.</p>
<p>Once you have your key, it&#8217;s as simple as:<br />
<code style="font-size: smaller"><br />
// Desired address<br />
$address = "http://maps.google.com/maps/geo?q="<br />
.urlencode($data['address'])<br />
.&#8221;,+&#8221;.urlencode($data['city'])<br />
.&#8221;,+&#8221;.urlencode($data['state'])<br />
.&#8221;,+&#8221;.urlencode($data['zip'])<br />
.&#8221;&amp;output=xml&amp;key=&#8221;.$_SESSION['GOOGLE_KEY'];</code><br />
<code style="font-size: smaller"><br />
// Retrieve the URL contents<br />
$page = file_get_contents($address);</code><br />
<code style="font-size: smaller"><br />
// Parse the returned XML file<br />
$xml = new SimpleXMLElement($page);</code><br />
<code style="font-size: smaller"><br />
// Parse the coordinate string<br />
list($longitude, $latitude, $altitude) = explode(",", $xml-&gt;Response-&gt;Placemark-&gt;Point-&gt;coordinates);</code></p>
<p>We now have $longitude/$latitude, which we will need for rendering our map.</p>
<p>Notes:</p>
<ul>
<li>I used to get the coordinates inside of my map generation, but sometimes the map would finish rendering before all the coordinates had been downloaded, so I suggest you get all your coordinates before you render your map.</li>
<li>My example makes use of SimpleXMLElement() which I believe is a PHP5 and above only function.  If you use PHP4 or below, you will have to parse the xml some other way.</li>
<li>You don&#8217;t need the altitude for map generation, but they give it to us anyway.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://pjhile.com/putting-a-google-map-on-your-site-with-php-part-1/feed</wfw:commentRss>
		</item>
		<item>
		<title>Javascript strings over multiple lines from PHP</title>
		<link>http://pjhile.com/javascript-strings-over-multiple-lines-from-a-php-variable</link>
		<comments>http://pjhile.com/javascript-strings-over-multiple-lines-from-a-php-variable#comments</comments>
		<pubDate>Thu, 13 Mar 2008 13:04:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://pjhile.com/javascript-strings-over-multiple-lines-from-a-php-variable</guid>
		<description><![CDATA[I had a problem where I was defining javascript variables from php variables, and the php variables had multiple lines.
So, a function like this:
function SomeFunction() {
var variable = "&#60;?php echo $variable; ?&#62;";
}

was creating this:
function SomeFunction() {
var variable = "The first row.
The second row.
The third row
";
}

The fix was to replace all the &#8216;\n&#8217; with &#8216;\\n&#8217;, so [...]]]></description>
			<content:encoded><![CDATA[<p>I had a problem where I was defining javascript variables from php variables, and the php variables had multiple lines.</p>
<p>So, a function like this:<code><br />
function SomeFunction() {<br />
var variable = "&lt;?php echo $variable; ?&gt;";<br />
}<br />
</code></p>
<p>was creating this:<code><br />
function SomeFunction() {<br />
var variable = "The first row.<br />
The second row.<br />
The third row<br />
";<br />
}<br />
</code><br />
The fix was to replace all the &#8216;\n&#8217; with &#8216;\\n&#8217;, so the literal string &#8216;\n&#8217; is output instead of an actual line break.</p>
<p>Like so:<code><br />
var variable = "&lt;?php echo str_replace('\n', '\\n', $variable); ?&gt;<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://pjhile.com/javascript-strings-over-multiple-lines-from-a-php-variable/feed</wfw:commentRss>
		</item>
		<item>
		<title>Send more data with CakePHP&#8217;s observeField()</title>
		<link>http://pjhile.com/sending-all-form-data-with-cakephps-observefield</link>
		<comments>http://pjhile.com/sending-all-form-data-with-cakephps-observefield#comments</comments>
		<pubDate>Mon, 10 Mar 2008 16:13:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://pjhile.com/sending-all-form-data-with-cakephps-observefield</guid>
		<description><![CDATA[I just ran into a situation today that required me to have access to more than one form field when doing an ajax request within my CakePHP application.  Basically, when someone is typing an address, I want to check Google&#8217;s Geocode API for a latitude and longitude coordinate.
The important part is the &#8216;with&#8217; option:
'with'=&#62;'Form.serializeElements($("CommunityForm").getElements())'
My [...]]]></description>
			<content:encoded><![CDATA[<p><a title="CakePHP" href="http://pjhile.com/wp-content/uploads/2008/03/cakephp.gif"><img title="CakePHP" src="http://pjhile.com/wp-content/uploads/2008/03/cakephp.gif" alt="CakePHP" align="right" /></a>I just ran into a situation today that required me to have access to more than one form field when doing an ajax request within my CakePHP application.  Basically, when someone is typing an address, I want to check <a href="http://googlemapsapi.blogspot.com/2006/06/geocoding-at-last.html" target="_blank">Google&#8217;s Geocode API</a> for a latitude and longitude coordinate.</p>
<p>The important part is the &#8216;with&#8217; option:<br />
<code style="font-size: smaller">'with'=&gt;'Form.serializeElements($("CommunityForm").getElements())'</code></p>
<p>My example:<code style="font-size: smaller"><br />
echo $ajax-&gt;observeField('CommunityAddress', array('with'=&gt;'Form.serializeElements( $("CommunityForm").getElements() )','url'=&gt;'geocode','update'=&gt;'geocode'"));<br />
</code></p>
<ul>
<li>The data being passed can be accessed in $this-&gt;params</li>
<li>This solution requires the <a href="http://www.prototypejs.org/" target="_blank">Prototype</a> javascript library.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://pjhile.com/sending-all-form-data-with-cakephps-observefield/feed</wfw:commentRss>
		</item>
		<item>
		<title>Command line script to recursively delete .svn folders from a directory</title>
		<link>http://pjhile.com/command-line-script-to-recursively-delete-svn-folders-from-a-directory</link>
		<comments>http://pjhile.com/command-line-script-to-recursively-delete-svn-folders-from-a-directory#comments</comments>
		<pubDate>Thu, 17 Jan 2008 19:15:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://pjhile.com/command-line-script-to-recursively-delete-svn-folders-from-a-directory</guid>
		<description><![CDATA[find ./ -name ".svn" &#124; xargs rm -Rf
source: http://www.rickhurst.co.uk/category/linux/
]]></description>
			<content:encoded><![CDATA[<p><code>find ./ -name ".svn" | xargs rm -Rf</code></p>
<p>source: http://www.rickhurst.co.uk/category/linux/</p>
]]></content:encoded>
			<wfw:commentRss>http://pjhile.com/command-line-script-to-recursively-delete-svn-folders-from-a-directory/feed</wfw:commentRss>
		</item>
		<item>
		<title>MySQL to MSSQL with PHPMyAdmin</title>
		<link>http://pjhile.com/mysql-to-mssql-with-phpmyadmin</link>
		<comments>http://pjhile.com/mysql-to-mssql-with-phpmyadmin#comments</comments>
		<pubDate>Mon, 19 Nov 2007 19:46:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://pjhile.com/mysql-to-mssql-with-phpmyadmin</guid>
		<description><![CDATA[A client has forced me to migrate a MySQL database to MSSQL.  Using PHPMyAdmin here is a list of things I had to do in order to get the data over:

 &#8216;SQL compatibility mode&#8217; to &#8216;MSSQL&#8217;
Uncheck &#8216;Add AUTO_INCREMENT value&#8217;, &#8216;Enclose table and field names with backquotes&#8217;, &#8216;Complete inserts&#8217;, &#8216;Extended inserts&#8217;
Remove all occurrances of &#8216;unsigned&#8217;
Replace [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://pjhile.com/wp-content/uploads/2007/11/tux-lamp.jpg" title="Tux / LAMP"><img src="http://pjhile.com/wp-content/uploads/2007/11/tux-lamp.thumbnail.jpg" title="Tux / LAMP" alt="Tux / LAMP" align="right" border="0" hspace="10" vspace="5" /></a>A client has forced me to migrate a MySQL database to MSSQL.  Using PHPMyAdmin here is a list of things I had to do in order to get the data over:</p>
<ol>
<li> &#8216;SQL compatibility mode&#8217; to &#8216;MSSQL&#8217;</li>
<li>Uncheck &#8216;Add AUTO_INCREMENT value&#8217;, &#8216;Enclose table and field names with backquotes&#8217;, &#8216;Complete inserts&#8217;, &#8216;Extended inserts&#8217;</li>
<li>Remove all occurrances of &#8216;unsigned&#8217;</li>
<li>Replace &#8216;id int(10)&#8217; with &#8216;id int(10) IDENTITY (1,1) PRIMARY KEY CLUSTERED</li>
<li>Replace all ticks (`) with quotes (&#8221;)</li>
<li>Remove all PRIMARY KEY lines</li>
<li>Remove all KEY lines</li>
<li>Remove all ENUM data types</li>
<li>Remove lengths from all int types (int,smallint,tinyint)</li>
<li>Replace date with datetime</li>
<li>Replace tinytext with text</li>
<li>Remove all &#8216;\r\n&#8217;</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://pjhile.com/mysql-to-mssql-with-phpmyadmin/feed</wfw:commentRss>
		</item>
		<item>
		<title>Scriptaculous blind effect with CakePHP</title>
		<link>http://pjhile.com/scriptaculous-blind-effect-with-cakephp</link>
		<comments>http://pjhile.com/scriptaculous-blind-effect-with-cakephp#comments</comments>
		<pubDate>Fri, 12 Oct 2007 04:06:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://pjhile.com/scriptaculous-blind-effect-with-cakephp</guid>
		<description><![CDATA[
The Scriptaculous effects are easy to implement in CakePHP.  I looked around for a simple example and didn&#8217;t find one, so here you go!

&#60;?php echo $html-&#62;link('Dinner Menu','#',array('onclick'=&#62;'Effect.toggle("dinnerMenu", "blind", {duration: 0.2}); return false;')); ?&#62;
&#60;dl id=&#8221;dinnerMenu&#8221; style=&#8221;display:none;&#8221;&#62;
&#60;?php foreach ($event['Meal'] as $meal): ?&#62;
&#60;dt&#62;&#60;?php echo $meal['name']; ?&#62;&#60;/dt&#62;
&#60;dd&#62;&#60;?php echo $meal['description']?&#62;&#60;/dd&#62;
&#60;?php endforeach; ?&#62;
&#60;/dl&#62;






Make sure to download the appropriate libraries to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://pjhile.com/wp-content/uploads/2007/10/scriptaculous-web20-javascript.gif" title="Scriptaculous"><img src="http://pjhile.com/wp-content/uploads/2007/10/scriptaculous-web20-javascript.thumbnail.gif" title="Scriptaculous" alt="Scriptaculous" style="padding: 0pt 20px 5px 0pt" align="left" /></a><br />
The <a href="http://script.aculo.us/">Scriptaculous</a> effects are easy to implement in CakePHP.  I looked around for a simple example and didn&#8217;t find one, so here you go!<br />
<code><br />
&lt;?php echo $html-&gt;link('Dinner Menu','#',array('onclick'=&gt;'Effect.toggle("dinnerMenu", "blind", {duration: 0.2}); return false;')); ?&gt;</code></p>
<p>&lt;dl id=&#8221;dinnerMenu&#8221; style=&#8221;display:none;&#8221;&gt;<br />
&lt;?php foreach ($event['Meal'] as $meal): ?&gt;<br />
&lt;dt&gt;&lt;?php echo $meal['name']; ?&gt;&lt;/dt&gt;<br />
&lt;dd&gt;&lt;?php echo $meal['description']?&gt;&lt;/dd&gt;<br />
&lt;?php endforeach; ?&gt;<br />
&lt;/dl&gt;</p>
<dl id="dinnerMenu" style="display: none">
<dt>
</dt>
<dd>
</dd>
</dl>
<p>Make sure to download the appropriate libraries to your /app/webroot/js/ directory and reference them in your layout file.</p>
<p><code>&lt;?php<br />
if(isset($javascript)):<br />
echo $javascript-&gt;link('prototype.js');<br />
echo $javascript-&gt;link('scriptaculous.js?load=effects');<br />
endif;<br />
?&gt;<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://pjhile.com/scriptaculous-blind-effect-with-cakephp/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
