<?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>Joseph Scott</title>
	<atom:link href="http://josephscott.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://josephscott.org</link>
	<description></description>
	<lastBuildDate>Tue, 09 Mar 2010 06:15:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<atom:link rel='hub' href='http://josephscott.org/?pushpress=hub'/>
<cloud domain='josephscott.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>Silverlight Only at Utah Code Camp</title>
		<link>http://josephscott.org/archives/2010/03/silverlight-only-at-utah-code-camp/</link>
		<comments>http://josephscott.org/archives/2010/03/silverlight-only-at-utah-code-camp/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 06:12:34 +0000</pubDate>
		<dc:creator>Joseph Scott</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[silverlight]]></category>
		<category><![CDATA[utahcodecamp]]></category>

		<guid isPermaLink="false">http://josephscott.org/?p=1993</guid>
		<description><![CDATA[I got an email announcing an upcoming Utah Code Camp, scheduled for the last Saturday of this month.  So I headed over to utahcodecamp.com and got this:

A giant black screen with small icon at the top center that said &#8216;Install Microsoft Silverlight&#8217;.  Obviously I don&#8217;t have Silverlight installed and don&#8217;t really have an [...]


Related posts:<ol><li><a href='http://josephscott.org/archives/2008/10/josephscott-org/' rel='bookmark' title='Permanent Link: JosephScott.org'>JosephScott.org</a></li>
<li><a href='http://josephscott.org/archives/2009/10/utah-open-source-conference-2009/' rel='bookmark' title='Permanent Link: Utah Open Source Conference 2009'>Utah Open Source Conference 2009</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I got an email announcing an upcoming Utah Code Camp, scheduled for the last Saturday of this month.  So I headed over to utahcodecamp.com and got this:</p>
<p><img alt="" src="http://farm3.static.flickr.com/2723/4419352242_e23c02159a_o.png" title="Silverlight Only" class="aligncenter" width="269" height="75"></p>
<p>A giant black screen with small icon at the top center that said &#8216;Install Microsoft Silverlight&#8217;.  Obviously I don&#8217;t have Silverlight installed and don&#8217;t really have an interest in installing it any time soon.  Not one part of the site worked unless Silverlight was installed.</p>
<p>Through out the 1990s and early 2000s I worked hard to convince every designer who had discovered Flash, that no, they really don&#8217;t want to start creating every site in all Flash.  It is disappointing to see this trend starting over again with Silverlight.</p>


<p>Related posts:<ol><li><a href='http://josephscott.org/archives/2008/10/josephscott-org/' rel='bookmark' title='Permanent Link: JosephScott.org'>JosephScott.org</a></li>
<li><a href='http://josephscott.org/archives/2009/10/utah-open-source-conference-2009/' rel='bookmark' title='Permanent Link: Utah Open Source Conference 2009'>Utah Open Source Conference 2009</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://josephscott.org/archives/2010/03/silverlight-only-at-utah-code-camp/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>mod_ping, Maybe I Should Have Called It PubSubHubbub</title>
		<link>http://josephscott.org/archives/2010/03/mod_ping-maybe-i-should-have-called-it-pubsubhubbub/</link>
		<comments>http://josephscott.org/archives/2010/03/mod_ping-maybe-i-should-have-called-it-pubsubhubbub/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 06:03:01 +0000</pubDate>
		<dc:creator>Joseph Scott</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[pubsubhubbub]]></category>

		<guid isPermaLink="false">http://josephscott.org/?p=1979</guid>
		<description><![CDATA[ReadWriteWeb has an article about Google potentially using PuSH to get updates into the search index.  I knew this idea sounded familiar so I went hunting through some of my old posts and found &#8211; Apache Module Idea mod_ping from 2004.
Back then I had thought a lot about searching blog feeds.  There were [...]


Related posts:<ol><li><a href='http://josephscott.org/archives/2010/03/pushpress-a-pubsubhubbub-plugin-for-wordpress/' rel='bookmark' title='Permanent Link: PuSHPress: A PubSubHubbub Plugin For WordPress'>PuSHPress: A PubSubHubbub Plugin For WordPress</a></li>
<li><a href='http://josephscott.org/archives/2009/03/searching-for-search-engine-on-google/' rel='bookmark' title='Permanent Link: Searching For &#8216;Search Engine&#8217; On Google'>Searching For &#8216;Search Engine&#8217; On Google</a></li>
<li><a href='http://josephscott.org/archives/2009/09/rsscloud-for-wordpress/' rel='bookmark' title='Permanent Link: RSSCloud For WordPress'>RSSCloud For WordPress</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>ReadWriteWeb has an article about <a href="http://www.readwriteweb.com/archives/google_developing_real_time_index.php">Google potentially using PuSH</a> to get updates into the search index.  I knew this idea sounded familiar so I went hunting through some of my old posts and found &#8211; <a href="http://joseph.randomnetworks.com/archives/2004/08/24/apache-module-idea-mod_ping/">Apache Module Idea mod_ping</a> from 2004.</p>
<p>Back then I had thought a lot about searching blog feeds.  There were some services that offered blog feed searching but they were all pretty bad.  I wrote a review of the situation at the time in <a href="http://joseph.randomnetworks.com/archives/2004/08/24/why-hasnt-anyone-figured-out-how-to-do-feed-searches/">Why Hasn’t Anyone Figured Out How To Do Feed Searches?</a>.  Keep in mind that <a href="http://joseph.randomnetworks.com/archives/2005/09/14/google-blog-search/">Google&#8217;s blog search feature</a> wouldn&#8217;t be announced for another year.</p>
<p>It seemed odd to me that blog feed search would be so bad given how strongly the blogging software community had embraced the idea of pinging updates.  This led me to the idea of some sort of <a href="http://joseph.randomnetworks.com/archives/2004/08/24/apache-module-idea-mod_ping/">mod_ping for Apache</a> that would do similar pings for any type of website updates, it didn&#8217;t have to be limited to just blogs.  Obviously I never took this idea any where (besides writing that post) and to be honest I hadn&#8217;t really revisited the idea much since.  Search engines took a different route for update frequency, with features like <a href="http://www.google.com/press/pressrel/sitemapsorg.html">sitemaps</a> in 2006.</p>
<p>Fast forward to 2010 and we&#8217;ve got discussion of Google potentially using PubSubHubbub (PuSH) to subscribe to updates from every single web site out there.  This brings up an interesting question though.  Since PuSH focuses on feed formats (RSS &#038; Atom) for pings, what format will pings from sites that don&#8217;t have feeds look like?  Will the ping just contain the entire HTML output of the updated page?  What about a <a href="http://en.wikipedia.org/wiki/Diff">diff</a> (unified format of course!) between the new HTML and the previous HTML for a given page?</p>
<p>Folks like <a href="http://www.onebigfluke.com/">Brett Slatkin</a> have been thinking about this sort of thing on a deeper level than I ever did, so I&#8217;m curious to see where this goes.</p>


<p>Related posts:<ol><li><a href='http://josephscott.org/archives/2010/03/pushpress-a-pubsubhubbub-plugin-for-wordpress/' rel='bookmark' title='Permanent Link: PuSHPress: A PubSubHubbub Plugin For WordPress'>PuSHPress: A PubSubHubbub Plugin For WordPress</a></li>
<li><a href='http://josephscott.org/archives/2009/03/searching-for-search-engine-on-google/' rel='bookmark' title='Permanent Link: Searching For &#8216;Search Engine&#8217; On Google'>Searching For &#8216;Search Engine&#8217; On Google</a></li>
<li><a href='http://josephscott.org/archives/2009/09/rsscloud-for-wordpress/' rel='bookmark' title='Permanent Link: RSSCloud For WordPress'>RSSCloud For WordPress</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://josephscott.org/archives/2010/03/mod_ping-maybe-i-should-have-called-it-pubsubhubbub/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>PuSHPress: A PubSubHubbub Plugin For WordPress</title>
		<link>http://josephscott.org/archives/2010/03/pushpress-a-pubsubhubbub-plugin-for-wordpress/</link>
		<comments>http://josephscott.org/archives/2010/03/pushpress-a-pubsubhubbub-plugin-for-wordpress/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 16:49:50 +0000</pubDate>
		<dc:creator>Joseph Scott</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[pubsubhubbub]]></category>
		<category><![CDATA[pushpress]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://josephscott.org/?p=1963</guid>
		<description><![CDATA[PubSubHubbub, or PuSH, is now supported on all WordPress.com blogs.  For those running sites using the WordPress.org software the PuSHPress plugin is available to do the same thing.  The big difference in this plugin compared to the other PuSH WordPress plugins is that it includes a PuSH hub built in.
A little bit of [...]


Related posts:<ol><li><a href='http://josephscott.org/archives/2009/09/rsscloud-for-wordpress/' rel='bookmark' title='Permanent Link: RSSCloud For WordPress'>RSSCloud For WordPress</a></li>
<li><a href='http://josephscott.org/archives/2009/10/rsscloud-wordpress-plugin-update-0-4-1/' rel='bookmark' title='Permanent Link: rssCloud WordPress Plugin Update &#8211; 0.4.1'>rssCloud WordPress Plugin Update &#8211; 0.4.1</a></li>
<li><a href='http://josephscott.org/archives/2010/03/mod_ping-maybe-i-should-have-called-it-pubsubhubbub/' rel='bookmark' title='Permanent Link: mod_ping, Maybe I Should Have Called It PubSubHubbub'>mod_ping, Maybe I Should Have Called It PubSubHubbub</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/pubsubhubbub/">PubSubHubbub</a>, or <a href="http://en.blog.wordpress.com/2010/03/03/rub-a-dub-dub-in-the-pubsubhubbub/">PuSH, is now supported on all WordPress.com blogs</a>.  For those running sites using the WordPress.org software the <a href="http://wordpress.org/extend/plugins/pushpress/">PuSHPress plugin</a> is available to do the same thing.  The big difference in this plugin compared to the other PuSH WordPress plugins is that it includes a PuSH hub built in.</p>
<h3>A little bit of PubSubHubbub background</h3>
<p>Like <a href="http://josephscott.org/archives/2009/09/rsscloud-for-wordpress/">rssCloud</a>, PuSH adds a line to your feed to let clients know where they can send PuSH subscription requests.  In the RSS2 feed this looks like:</p>
<pre class="brush: xml;">
&lt;atom:link rel=&quot;hub&quot; href=&quot;http://josephscott.org/?pushpress=hub&quot;&gt;
</pre>
<p>and in Atom looks like:</p>
<pre class="brush: xml;">
&lt;link rel=&quot;hub&quot; href=&quot;http://josephscott.org/?pushpress=hub&quot;&gt;
</pre>
<p>The href attribute contains the URL that subscribers can send requests to.  Details on <a href="http://pubsubhubbub.googlecode.com/svn/trunk/pubsubhubbub-core-0.3.html#subscribing">what that request looks like</a> are in the <a href="http://pubsubhubbub.googlecode.com/svn/trunk/pubsubhubbub-core-0.3.html">PubSubHubbub Spec</a>.  The short version, it&#8217;s a simple HTTP POST call with some specific field names.  </p>
<p>Here&#8217;s an example PHP subscription request asking that updates to http://example.com/feed/ be sent to http://example.com/push/ via the hub at http://example.com/?pushpress=hub</p>
<pre class="brush: php;">
$curl = curl_init( );

curl_setopt( $curl, CURLOPT_URL, 'http://example.com/?pushpress=hub' );
curl_setopt( $curl, CURLOPT_POSTFIELDS, 'hub.callback=http://example.com/push/&amp;hub.mode=subscribe&amp;hub.secret=not-telling-you&amp;hub.verify=sync&amp;hub.topic=http://example.com/feed/&amp;hub.verify_token=133t-$7r1n9' );
curl_setopt( $curl, CURLOPT_VERBOSE, 1 );
curl_setopt( $curl, CURLOPT_POST, 1 );

curl_exec( $curl );
print_r( curl_getinfo( $curl ) );
curl_close( $curl );
</pre>
<p>The hub at example.com will then send new content (in feed format) right after it&#8217;s published to URL provided in hub.callback.</p>
<h3>Why the PuSHPress plugin?</h3>
<p>I love that there are large, open PuSH hubs available for anyone to use.  There&#8217;s a list at <a href="http://code.google.com/p/pubsubhubbub/wiki/Hubs">http://code.google.com/p/pubsubhubbub/wiki/Hubs</a>.  In PuSH since most of the hard work (figuring out what&#8217;s new in a feed and sending that out to subscribers) is done via the hub this is very handy and really great for testing.</p>
<p>I also think there&#8217;s a role for a readily available simple hub that anyone can put up and use, in this case built on top of WordPress.  And by leveraging WordPress the hub part can be greatly simplified.  The real bonus for users is choice, they can relay the updates through 3rd party hubs, or use the built in hub in PuSHPress.</p>
<p>It&#8217;s worth noting that PuSHPress has a WordPress filter on the array of hubs; pushpress_hubs.  This allows other plugins to easily add to or replace the hubs mentioned in the feeds by PuSHPress.</p>
<p>To help keep things simple and limit potential abuse the PuSHPress plugin will only allow subscriptions for the RSS2 and Atom feeds of the WordPress blog that it is installed on.</p>
<p>My thanks to <a href="http://www.onebigfluke.com/">Brett Slatkin</a> for helping test PuSHPress.  His tests revealed a few bugs that were quickly addressed.</p>
<h3>How fast?</h3>
<p>When talking about these realtime-ish update features this question often comes up.  Fair enough, I&#8217;d want to know too :-)</p>
<p>The PuSHPress plugin schedules pings to go out right away via the <a href="http://codex.wordpress.org/Function_Reference/wp_schedule_single_event">wp_schedule_single_event</a> function in WordPress.  I suspect for most people this will be quite fast.  If your server is under tremendous load and really slow, then this will be really slow too, just like the rest of the server ;-)</p>
<p>On WordPress.com the details are a bit different.  Instead of scheduling pings to be sent out with wp_schedule_single_event it adds them to our asynchronous jobs system ( more info available at <a href="http://code.trac.wordpress.org/">http://code.trac.wordpress.org/</a> ).  The jobs system is setup to do exactly these kinds of tasks really, really fast.  Don&#8217;t be surprised if the ping shows up before you get a chance to finish the first Mississippi.</p>
<h3>The future</h3>
<p>So where is all this going?  Who knows, but it is fun to watch!  :-)</p>
<h3>Further reading</h3>
<p>If you have an interest in this area there are plenty of resources:</p>
<ul>
<li><a href="http://code.google.com/p/pubsubhubbub/">PubSubHubbub project site</a></li>
<li><a href="http://groups.google.com/group/pubsubhubbub">Google Group</a></li>
<li><a href="http://pubsubhubbub.googlecode.com/svn/trunk/pubsubhubbub-core-0.3.html">Spec</a></li>
</ul>
<p>The spec is a quick read and to the point, worth reading.</p>
<p>And there you have it, a little more in-depth discussion of PuSHPress.</p>


<p>Related posts:<ol><li><a href='http://josephscott.org/archives/2009/09/rsscloud-for-wordpress/' rel='bookmark' title='Permanent Link: RSSCloud For WordPress'>RSSCloud For WordPress</a></li>
<li><a href='http://josephscott.org/archives/2009/10/rsscloud-wordpress-plugin-update-0-4-1/' rel='bookmark' title='Permanent Link: rssCloud WordPress Plugin Update &#8211; 0.4.1'>rssCloud WordPress Plugin Update &#8211; 0.4.1</a></li>
<li><a href='http://josephscott.org/archives/2010/03/mod_ping-maybe-i-should-have-called-it-pubsubhubbub/' rel='bookmark' title='Permanent Link: mod_ping, Maybe I Should Have Called It PubSubHubbub'>mod_ping, Maybe I Should Have Called It PubSubHubbub</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://josephscott.org/archives/2010/03/pushpress-a-pubsubhubbub-plugin-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>40</slash:comments>
		</item>
		<item>
		<title>133t Google H4&#215;0r</title>
		<link>http://josephscott.org/archives/2010/03/133t-google-h4x0r/</link>
		<comments>http://josephscott.org/archives/2010/03/133t-google-h4x0r/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 04:41:22 +0000</pubDate>
		<dc:creator>Joseph Scott</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://josephscott.org/?p=1967</guid>
		<description><![CDATA[Wandered across the 133t Google translation today.  Wait for the rest of the page to fade in for the full effect.


Related posts:Google Translate Bookmarklet
Google SEO
Searching For &#8216;Search Engine&#8217; On Google



Related posts:<ol><li><a href='http://josephscott.org/archives/2009/01/google-translate-bookmarklet/' rel='bookmark' title='Permanent Link: Google Translate Bookmarklet'>Google Translate Bookmarklet</a></li>
<li><a href='http://josephscott.org/archives/2009/12/google-seo/' rel='bookmark' title='Permanent Link: Google SEO'>Google SEO</a></li>
<li><a href='http://josephscott.org/archives/2009/03/searching-for-search-engine-on-google/' rel='bookmark' title='Permanent Link: Searching For &#8216;Search Engine&#8217; On Google'>Searching For &#8216;Search Engine&#8217; On Google</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Wandered across the <a href="http://www.google.com/intl/xx-hacker/">133t Google translation</a> today.  Wait for the rest of the page to fade in for the full effect.</p>


<p>Related posts:<ol><li><a href='http://josephscott.org/archives/2009/01/google-translate-bookmarklet/' rel='bookmark' title='Permanent Link: Google Translate Bookmarklet'>Google Translate Bookmarklet</a></li>
<li><a href='http://josephscott.org/archives/2009/12/google-seo/' rel='bookmark' title='Permanent Link: Google SEO'>Google SEO</a></li>
<li><a href='http://josephscott.org/archives/2009/03/searching-for-search-engine-on-google/' rel='bookmark' title='Permanent Link: Searching For &#8216;Search Engine&#8217; On Google'>Searching For &#8216;Search Engine&#8217; On Google</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://josephscott.org/archives/2010/03/133t-google-h4x0r/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thinking Clearly About Performance</title>
		<link>http://josephscott.org/archives/2010/02/thinking-clearly-about-performance/</link>
		<comments>http://josephscott.org/archives/2010/02/thinking-clearly-about-performance/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 19:05:16 +0000</pubDate>
		<dc:creator>Joseph Scott</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[cary-millsap]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://josephscott.org/?p=1947</guid>
		<description><![CDATA[Cary Millsap has a great paper out &#8211; Thinking Clearly About Performance.  It has reminded me how critical details can be in measuring performance, throughput, response time, efficiency, skew and load.
The beauty of this paper isn&#8217;t that it has some magical new technique, quite the opposite actually.  The methods talked about are solid, [...]


Related posts:<ol><li><a href='http://josephscott.org/archives/2010/02/recommended-reading-steve-souders-high-performance-web-sites/' rel='bookmark' title='Permanent Link: Recommended Reading: Steve Souders, High Performance Web Sites'>Recommended Reading: Steve Souders, High Performance Web Sites</a></li>
<li><a href='http://josephscott.org/archives/2010/02/database-indexes-on-domain-names/' rel='bookmark' title='Permanent Link: Database Indexes on Domain Names'>Database Indexes on Domain Names</a></li>
<li><a href='http://josephscott.org/archives/2009/08/ignite-salt-lake-3/' rel='bookmark' title='Permanent Link: Ignite Salt Lake 3'>Ignite Salt Lake 3</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://carymillsap.blogspot.com/">Cary Millsap</a> has a great paper out &#8211; <a href="http://method-r.com/downloads/doc_details/44-thinking-clearly-about-performance">Thinking Clearly About Performance</a>.  It has reminded me how critical details can be in measuring performance, throughput, response time, efficiency, skew and load.</p>
<p>The beauty of this paper isn&#8217;t that it has some magical new technique, quite the opposite actually.  The methods talked about are solid, fundamental approaches that can be used to methodically figure out what&#8217;s going in your system.</p>
<p>It&#8217;s only 13 pages long and is a pleasant, brisk read.  I recommend it for anyone doing software development, database administration, or system administration.</p>


<p>Related posts:<ol><li><a href='http://josephscott.org/archives/2010/02/recommended-reading-steve-souders-high-performance-web-sites/' rel='bookmark' title='Permanent Link: Recommended Reading: Steve Souders, High Performance Web Sites'>Recommended Reading: Steve Souders, High Performance Web Sites</a></li>
<li><a href='http://josephscott.org/archives/2010/02/database-indexes-on-domain-names/' rel='bookmark' title='Permanent Link: Database Indexes on Domain Names'>Database Indexes on Domain Names</a></li>
<li><a href='http://josephscott.org/archives/2009/08/ignite-salt-lake-3/' rel='bookmark' title='Permanent Link: Ignite Salt Lake 3'>Ignite Salt Lake 3</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://josephscott.org/archives/2010/02/thinking-clearly-about-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Database Indexes on Domain Names</title>
		<link>http://josephscott.org/archives/2010/02/database-indexes-on-domain-names/</link>
		<comments>http://josephscott.org/archives/2010/02/database-indexes-on-domain-names/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 04:20:43 +0000</pubDate>
		<dc:creator>Joseph Scott</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://josephscott.org/?p=1935</guid>
		<description><![CDATA[As part of a separate conversation Matt suggested something I had not given much thought to before.  Say you have a database column that is used to store domain names.  Something as simple as `domain` varchar(255) NOT NULL.  
Of course you&#8217;ll want to search all of that data.  Perhaps you want [...]


Related posts:<ol><li><a href='http://josephscott.org/archives/2010/01/php-helpers-debug_log/' rel='bookmark' title='Permanent Link: PHP Helpers: debug_log'>PHP Helpers: debug_log</a></li>
<li><a href='http://josephscott.org/archives/2009/03/spaghetti-os-from-amazon/' rel='bookmark' title='Permanent Link: Spaghetti Os From Amazon'>Spaghetti Os From Amazon</a></li>
<li><a href='http://josephscott.org/archives/2009/02/installing-wordpress-as-a-subversion-checkout-or-external-in-a-subdirectory/' rel='bookmark' title='Permanent Link: Installing WordPress As A Subversion Checkout ( Or External ) In A Subdirectory'>Installing WordPress As A Subversion Checkout ( Or External ) In A Subdirectory</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>As part of a separate conversation <a href="http://ma.tt/">Matt</a> suggested something I had not given much thought to before.  Say you have a database column that is used to store domain names.  Something as simple as <code>`domain` varchar(255) NOT NULL</code>.  </p>
<p>Of course you&#8217;ll want to search all of that data.  Perhaps you want to lookup all of the sub-domains for example.com.  That query might look like </p>
<pre class="brush: sql;">
SELECT * FROM table_name WHERE domain LIKE '%.example.com'
</pre>
<p>Having a wildcard ( % ) at the front of a LIKE comparison generally results in poor performance.  Depending on the database you may find that either it can&#8217;t make use of an index on that column, or it must do a full index scan in order to find the right entry.  To make better use of an index the wildcard should be at the end of the string, which we could do if we reverse the domain name ordering:</p>
<pre class="brush: sql;">
SELECT * FROM table_name WHERE domain LIKE 'com.example.%'
</pre>
<p>So that&#8217;s what we do.  This of course brings up the question of how to correctly reverse the domain name parts.  In PHP this can be done with a combination of <a href="http://us.php.net/explode/">explode()</a>, <a href="http://us.php.net/array_reverse">array_reverse()</a>, and <a href="http://us.php.net/implode">implode()</a>:</p>
<pre class="brush: php;">
$domain = 'joseph.example.com';
$reverse_domain = implode( '.', array_reverse( explode( '.', $domain ) ) );
</pre>
<p>That turns <code>joseph.example.com</code> into <code>com.example.joseph</code>.  The reversed domain name gets stored in the database and that allows us to use the more efficient database query.</p>


<p>Related posts:<ol><li><a href='http://josephscott.org/archives/2010/01/php-helpers-debug_log/' rel='bookmark' title='Permanent Link: PHP Helpers: debug_log'>PHP Helpers: debug_log</a></li>
<li><a href='http://josephscott.org/archives/2009/03/spaghetti-os-from-amazon/' rel='bookmark' title='Permanent Link: Spaghetti Os From Amazon'>Spaghetti Os From Amazon</a></li>
<li><a href='http://josephscott.org/archives/2009/02/installing-wordpress-as-a-subversion-checkout-or-external-in-a-subdirectory/' rel='bookmark' title='Permanent Link: Installing WordPress As A Subversion Checkout ( Or External ) In A Subdirectory'>Installing WordPress As A Subversion Checkout ( Or External ) In A Subdirectory</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://josephscott.org/archives/2010/02/database-indexes-on-domain-names/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>PHP Helpers: make_slug</title>
		<link>http://josephscott.org/archives/2010/02/php-helpers-make_slug/</link>
		<comments>http://josephscott.org/archives/2010/02/php-helpers-make_slug/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 00:19:16 +0000</pubDate>
		<dc:creator>Joseph Scott</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[make_slug]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php-helpers]]></category>

		<guid isPermaLink="false">http://josephscott.org/?p=1918</guid>
		<description><![CDATA[New function, make_slug -

if ( !function_exists( 'make_slug' ) ) {
    function make_slug( $str ) {
        $url_str = strtolower( trim( $str ) );

        $url_str = preg_replace( '/[\s_]+/', '-', $url_str );
        $url_str = [...]


Related posts:<ol><li><a href='http://josephscott.org/archives/2010/02/php-helpers-redirect_url/' rel='bookmark' title='Permanent Link: PHP Helpers: redirect_url'>PHP Helpers: redirect_url</a></li>
<li><a href='http://josephscott.org/archives/2010/01/php-helpers-debug_log/' rel='bookmark' title='Permanent Link: PHP Helpers: debug_log'>PHP Helpers: debug_log</a></li>
<li><a href='http://josephscott.org/archives/2008/11/makeitlink-detecting-urls-in-text-and-making-them-links/' rel='bookmark' title='Permanent Link: MakeItLink &#8211; Detecting URLs In Text And Making Them Links'>MakeItLink &#8211; Detecting URLs In Text And Making Them Links</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>New function, make_slug -</p>
<pre class="brush: php;">
if ( !function_exists( 'make_slug' ) ) {
    function make_slug( $str ) {
        $url_str = strtolower( trim( $str ) );

        $url_str = preg_replace( '/[\s_]+/', '-', $url_str );
        $url_str = preg_replace( '/-{2,}/', '-', $url_str );
        $url_str = preg_replace( '/[^a-z0-9-]/', '', $url_str );

        return $url_str;
    }
}
</pre>
<p>This takes a string and returns a slug that is more URL friendly.  For example &#8220;<code>Do    This_Today -- Please</code>&#8221; would become &#8220;<code>do-this-today-please</code>&#8220;.</p>
<p>The approach is pretty simple:</p>
<ul>
<li>lower case everything (line 3)</li>
<li>replace space and underscore with dash (line 5)</li>
<li>replace two or more dashes with a single dash (line 6)</li>
<li>remove any other characters that aren&#8217;t a-z, 0-9 or a dash (line 7)</li>
</ul>


<p>Related posts:<ol><li><a href='http://josephscott.org/archives/2010/02/php-helpers-redirect_url/' rel='bookmark' title='Permanent Link: PHP Helpers: redirect_url'>PHP Helpers: redirect_url</a></li>
<li><a href='http://josephscott.org/archives/2010/01/php-helpers-debug_log/' rel='bookmark' title='Permanent Link: PHP Helpers: debug_log'>PHP Helpers: debug_log</a></li>
<li><a href='http://josephscott.org/archives/2008/11/makeitlink-detecting-urls-in-text-and-making-them-links/' rel='bookmark' title='Permanent Link: MakeItLink &#8211; Detecting URLs In Text And Making Them Links'>MakeItLink &#8211; Detecting URLs In Text And Making Them Links</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://josephscott.org/archives/2010/02/php-helpers-make_slug/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Recommended Reading: Steve Souders, High Performance Web Sites</title>
		<link>http://josephscott.org/archives/2010/02/recommended-reading-steve-souders-high-performance-web-sites/</link>
		<comments>http://josephscott.org/archives/2010/02/recommended-reading-steve-souders-high-performance-web-sites/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 19:12:49 +0000</pubDate>
		<dc:creator>Joseph Scott</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[recommended-reading]]></category>
		<category><![CDATA[steve-souders]]></category>

		<guid isPermaLink="false">http://josephscott.org/?p=1903</guid>
		<description><![CDATA[Although I link to various sites when something interesting comes up, I haven&#8217;t done a good job of recommending people and blogs to follow.  Time to fix that.
Kicking off my recommended reading list is the High Performance Web Sites blog by Steve Souders.  I&#8217;ll make this very simple, if you do web development [...]


Related posts:<ol><li><a href='http://josephscott.org/archives/2010/02/thinking-clearly-about-performance/' rel='bookmark' title='Permanent Link: Thinking Clearly About Performance'>Thinking Clearly About Performance</a></li>
<li><a href='http://josephscott.org/archives/2010/01/php-count-performance/' rel='bookmark' title='Permanent Link: PHP Count Performance'>PHP Count Performance</a></li>
<li><a href='http://josephscott.org/archives/2009/08/xmlhttprequest-xhr-uses-multiple-packets-for-http-post/' rel='bookmark' title='Permanent Link: XMLHttpRequest (XHR) Uses Multiple Packets for HTTP POST?'>XMLHttpRequest (XHR) Uses Multiple Packets for HTTP POST?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Although I link to various sites when something interesting comes up, I haven&#8217;t done a good job of recommending people and blogs to follow.  Time to fix that.</p>
<p>Kicking off my recommended reading list is the <a href="http://www.stevesouders.com/blog/">High Performance Web Sites</a> blog by <a href="http://stevesouders.com/">Steve Souders</a>.  I&#8217;ll make this very simple, if you do web development at all this blog is <b>REQUIRED</b> reading.  When it comes to front end web performance Steve has literally written the book on the subject (<a href="http://oreilly.com/catalog/9780596529307/">High Performance Web Sites</a>), twice (<a href="http://oreilly.com/catalog/9780596522315/">Even Faster Web Sites</a>).</p>
<p>I was at his <a href="http://2009.sf.wordcamp.org/speakers/#steve">WordCamp SF 2009 session</a> where he made changes to a test site during the session and showed how each change improved the page load time.  If you aren&#8217;t able to make it to an event where Steve is speaking several of his session videos are online, like this <a href="http://code.google.com/events/io/2009/sessions/EvenFasterWebsites.html">2009 Google I/O session &#8211; Even Faster Websites</a>.  It&#8217;s worth the time to see what his research has turned up on how browsers work.</p>


<p>Related posts:<ol><li><a href='http://josephscott.org/archives/2010/02/thinking-clearly-about-performance/' rel='bookmark' title='Permanent Link: Thinking Clearly About Performance'>Thinking Clearly About Performance</a></li>
<li><a href='http://josephscott.org/archives/2010/01/php-count-performance/' rel='bookmark' title='Permanent Link: PHP Count Performance'>PHP Count Performance</a></li>
<li><a href='http://josephscott.org/archives/2009/08/xmlhttprequest-xhr-uses-multiple-packets-for-http-post/' rel='bookmark' title='Permanent Link: XMLHttpRequest (XHR) Uses Multiple Packets for HTTP POST?'>XMLHttpRequest (XHR) Uses Multiple Packets for HTTP POST?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://josephscott.org/archives/2010/02/recommended-reading-steve-souders-high-performance-web-sites/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PHP Helpers: redirect_url</title>
		<link>http://josephscott.org/archives/2010/02/php-helpers-redirect_url/</link>
		<comments>http://josephscott.org/archives/2010/02/php-helpers-redirect_url/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 23:55:35 +0000</pubDate>
		<dc:creator>Joseph Scott</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php-helpers]]></category>
		<category><![CDATA[redirect_url]]></category>

		<guid isPermaLink="false">http://josephscott.org/?p=1898</guid>
		<description><![CDATA[New function: redirect_url

if ( !function_exists( 'redirect_url' ) ) {
    function redirect_url( $url, $status = 302 ) {
        header( &#34;Location: {$url}&#34;, TRUE, $status );
        exit;
    }
}

A special case wrapper around the header function to do URL [...]


Related posts:<ol><li><a href='http://josephscott.org/archives/2010/01/php-helpers-esc_html/' rel='bookmark' title='Permanent Link: PHP Helpers: esc_html'>PHP Helpers: esc_html</a></li>
<li><a href='http://josephscott.org/archives/2010/01/php-helpers-debug_log/' rel='bookmark' title='Permanent Link: PHP Helpers: debug_log'>PHP Helpers: debug_log</a></li>
<li><a href='http://josephscott.org/archives/2010/02/php-helpers-html_print_r/' rel='bookmark' title='Permanent Link: PHP Helpers: html_print_r'>PHP Helpers: html_print_r</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>New function: redirect_url</p>
<pre class="brush: php;">
if ( !function_exists( 'redirect_url' ) ) {
    function redirect_url( $url, $status = 302 ) {
        header( &quot;Location: {$url}&quot;, TRUE, $status );
        exit;
    }
}
</pre>
<p>A special case wrapper around the <a href="http://us.php.net/manual/en/function.header.php">header</a> function to do URL redirection.  I specifically added the exit call inside the function so that redirect happens immediately.  That way I don&#8217;t have a chance to forget about it later on :-)</p>


<p>Related posts:<ol><li><a href='http://josephscott.org/archives/2010/01/php-helpers-esc_html/' rel='bookmark' title='Permanent Link: PHP Helpers: esc_html'>PHP Helpers: esc_html</a></li>
<li><a href='http://josephscott.org/archives/2010/01/php-helpers-debug_log/' rel='bookmark' title='Permanent Link: PHP Helpers: debug_log'>PHP Helpers: debug_log</a></li>
<li><a href='http://josephscott.org/archives/2010/02/php-helpers-html_print_r/' rel='bookmark' title='Permanent Link: PHP Helpers: html_print_r'>PHP Helpers: html_print_r</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://josephscott.org/archives/2010/02/php-helpers-redirect_url/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone OS Feature Request &#8211; Longer &#8216;Fetch New Data&#8217; Intervals</title>
		<link>http://josephscott.org/archives/2010/02/iphone-os-feature-request-longer-fetch-new-data-intervals/</link>
		<comments>http://josephscott.org/archives/2010/02/iphone-os-feature-request-longer-fetch-new-data-intervals/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 19:30:11 +0000</pubDate>
		<dc:creator>Joseph Scott</dc:creator>
				<category><![CDATA[Posts]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://josephscott.org/?p=1876</guid>
		<description><![CDATA[I&#8217;ve setup my iPhone to sync my calendar and contacts with my Google account.  The sync process itself works fine, my complaint is with the &#8216;Fetch New Data&#8217; options.
I don&#8217;t use push for this, I&#8217;m happy to get more battery life at the expense of not having immediate updates.  That leaves me with [...]


Related posts:<ol><li><a href='http://josephscott.org/archives/2008/10/whats-missing-from-google-contacts/' rel='bookmark' title='Permanent Link: What&#8217;s Missing From Google Contacts'>What&#8217;s Missing From Google Contacts</a></li>
<li><a href='http://josephscott.org/archives/2009/08/web-hooks-in-gmail-would-be-great/' rel='bookmark' title='Permanent Link: Web Hooks in Gmail Would Be Great'>Web Hooks in Gmail Would Be Great</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve setup my iPhone to sync my calendar and contacts with my Google account.  The sync process itself works fine, my complaint is with the &#8216;Fetch New Data&#8217; options.</p>
<p>I don&#8217;t use push for this, I&#8217;m happy to get more battery life at the expense of not having immediate updates.  That leaves me with these interval  options:</p>
<ul>
<li>Every 15 Minutes</li>
<li>Every 30 Minutes</li>
<li>Hourly</li>
<li>Manually</li>
</ul>
<p>I really don&#8217;t need hourly updates for my calendar and contacts, so I&#8217;m left with &#8216;Manually&#8217;.  What I&#8217;d really like is longer intervals to select from, more in the range of 8, 12 and 24 hours.  Syncing in the background a few times day would be plenty for me.</p>


<p>Related posts:<ol><li><a href='http://josephscott.org/archives/2008/10/whats-missing-from-google-contacts/' rel='bookmark' title='Permanent Link: What&#8217;s Missing From Google Contacts'>What&#8217;s Missing From Google Contacts</a></li>
<li><a href='http://josephscott.org/archives/2009/08/web-hooks-in-gmail-would-be-great/' rel='bookmark' title='Permanent Link: Web Hooks in Gmail Would Be Great'>Web Hooks in Gmail Would Be Great</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://josephscott.org/archives/2010/02/iphone-os-feature-request-longer-fetch-new-data-intervals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>