<?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>Paul Butler &#187; PHP</title>
	<atom:link href="http://paulbutler.org/archives/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://paulbutler.org</link>
	<description></description>
	<lastBuildDate>Tue, 28 Feb 2012 14:45:26 +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>Proper Image Resizing for WordPress</title>
		<link>http://paulbutler.org/archives/proper-image-resizing-for-wordpress/</link>
		<comments>http://paulbutler.org/archives/proper-image-resizing-for-wordpress/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 16:14:01 +0000</pubDate>
		<dc:creator>Paul Butler</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.paulbutler.org/archives/proper-image-resizing-for-wordpress/</guid>
		<description><![CDATA[Update: Due to lack of time and interest (on my part), I am no longer maintaining JSSpamBlock or ImageScaler. WordPress has a cool WYSIWIG editor that lets you easily resize images by dragging the corner around. The problem is that &#8230; <a href="http://paulbutler.org/archives/proper-image-resizing-for-wordpress/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Update: Due to lack of time and interest (on my part), I am no longer maintaining JSSpamBlock or ImageScaler.</strong></p>
<p>WordPress has a cool WYSIWIG editor that lets you easily resize images by dragging the corner around. The problem is that WordPress does not actually resize the image, it just tells the browser to display it smaller. This means that the full sized image is being sent to the browser, which makes the page load slower and take up more bandwidth. Additionally, most browsers are bad at resizing images, so the images look worse than if they were properly resized.</p>
<p>To get around this, I wrote a WordPress plugin called ImageScaler. <strike>I am still waiting for it to be approved by WordPress for hosting, so I have hosted it myself for now.</strike> It requires GD (almost all web hosts with PHP will have GD). It should work with PHP 4, but it has only been tested on PHP 5.</p>
<p><em>[Example removed]</em></p>
<p><strong>Update</strong>: the plugin is now <a href="http://wordpress.org/extend/plugins/image-scaler/">hosted by WordPress</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://paulbutler.org/archives/proper-image-resizing-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Endless Google Search</title>
		<link>http://paulbutler.org/archives/endless-google-search/</link>
		<comments>http://paulbutler.org/archives/endless-google-search/#comments</comments>
		<pubDate>Wed, 06 Jun 2007 23:14:17 +0000</pubDate>
		<dc:creator>Paul Butler</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Apps]]></category>

		<guid isPermaLink="false">http://www.paulbutler.org/archives/endless-google-search/</guid>
		<description><![CDATA[April 2009 Update: Originally, I had an live example of this running. However, the Google API doesn&#8217;t seem to work any more (it was discontinued over two years ago). In any case, there are better examples online now. Try Live &#8230; <a href="http://paulbutler.org/archives/endless-google-search/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><em><strong>April 2009 Update</strong>: Originally, I had an live example of this running. However, the Google API doesn&#8217;t seem to work any more (it was discontinued over two years ago). In any case, there are better examples online now. Try <a href="http://search.live.com/images/results.aspx?q=halifax&#038;go=&#038;form=QBIR">Live Search Images</a> or <a href="http://www.terrill.ca/">Terrel Dent&#8217;s blog</a>. I would make the source available, but it was an weekend hack and there isn&#8217;t much to it.</em></p>
<p>I felt like coding today, so I put together a little hack from an idea I have had for a while. What I came up with is a web search (powered by Google), that loads new search results as you scroll the page down. <strike><em>Try it</em>, it&#8217;s actually pretty cool.</strike></p>
<p>Here is how it works:  there is a large div element at the bottom of the page just to take up space. When it comes onto the screen, an ajax request is made to the server to get the next 10 results from Google. The requests are made through Google&#8217;s SOAP api, which is no longer available, but I had an old API key so I was able to get it to work. I had all the client stuff working within an hour, but Google&#8217;s API took a while to figure out. Google uses SOAP, which is powerful but hard to code for compared to a simple GET API. It took me a couple of hours to get the server-side stuff working but it is still a hack, so don&#8217;t be surprised if you get an error or some unexpected behaviour.</p>
<p>It was designed for FireFox/Mozilla browsers. The only other browser I have tried it with is IE, which it does not work with. So <strong>if you are using Internet Explorer, you won&#8217;t see anything interesting</strong>.</p>
<p><strike><em>Try it here</em></strike></p>
]]></content:encoded>
			<wfw:commentRss>http://paulbutler.org/archives/endless-google-search/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A simple diff algorithm in PHP</title>
		<link>http://paulbutler.org/archives/a-simple-diff-algorithm-in-php/</link>
		<comments>http://paulbutler.org/archives/a-simple-diff-algorithm-in-php/#comments</comments>
		<pubDate>Tue, 15 May 2007 20:20:58 +0000</pubDate>
		<dc:creator>Paul Butler</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.paulbutler.org/archives/a-simple-diff-algorithm-in-php/</guid>
		<description><![CDATA[A diff algorithm in its most basic form takes two strings, and returns the changes needed to make the old string into the new one. They are useful in comparing different versions of a document or file, to see at &#8230; <a href="http://paulbutler.org/archives/a-simple-diff-algorithm-in-php/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A diff algorithm in its most basic form takes two strings, and returns the changes needed to make the old string into the new one. They are useful in comparing different versions of a document or file, to see at a glance what the differences are between the two. Wikipedia, for example, uses diffs to compare the changes between two revisions of the same article.</p>
<p>Solving the problem is not as simple as it seems, and the problem bothered me for about a year before I figured it out. I managed to write my algorithm in PHP, in 18 lines of code. It is not the most efficient way to do a diff, but it is probably the easiest to understand.</p>
<p>It works by finding the longest sequence of words common to both strings, and recursively finding the longest sequences of the remainders of the string until the substrings have no words in common. At this point it adds the remaining new words as an insertion and the remaining old words as a deletion.</p>
<p>You can download the source here: <a href="http://github.com/paulgb/simplediff/blob/5bfe1d2a8f967c7901ace50f04ac2d9308ed3169/simplediff.php">PHP SimpleDiff</a></p>
]]></content:encoded>
			<wfw:commentRss>http://paulbutler.org/archives/a-simple-diff-algorithm-in-php/feed/</wfw:commentRss>
		<slash:comments>51</slash:comments>
		</item>
	</channel>
</rss>

