<?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>Smiths R Us</title>
	<atom:link href="http://smithsrus.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://smithsrus.com</link>
	<description>Technology, home automation, usability, and whatever else amuses me.</description>
	<lastBuildDate>Fri, 27 Jan 2012 17:28:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>E-book Download Icons</title>
		<link>http://smithsrus.com/e-book-download-icons/</link>
		<comments>http://smithsrus.com/e-book-download-icons/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 17:00:17 +0000</pubDate>
		<dc:creator>Doug Smith</dc:creator>
				<category><![CDATA[E-book Production]]></category>
		<category><![CDATA[ePub]]></category>
		<category><![CDATA[Kindle]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://smithsrus.com/?p=209</guid>
		<description><![CDATA[I recently set up a web page for downloading an e-book that is available in multiple formats. I had already been using a small document icon to decorate PDF download links, and now I wanted matching icons for the mobi and EPUB format too. A Google search didn&#8217;t turn up what I was looking for [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_211" class="wp-caption alignright" style="width: 229px"><img class="size-full wp-image-211  " title="E-book icons example" src="http://smithsrus.com/wp-content/uploads/2012/01/e-book-icons-example1.jpg" alt="E-book icons example" width="219" height="105" /><p class="wp-caption-text">An example of the e-book icon set in use for a book available in PDF, EPUB, and Mobi formats.</p></div>
<p>I recently set up a web page for downloading an e-book that is available in multiple formats. I had already been using a small document icon to decorate PDF download links, and now I wanted matching icons for the mobi and EPUB format too.</p>
<p>A Google search didn&#8217;t turn up what I was looking for so I created my own based on the PDF icon from the <a href="http://p.yusukekamiyamane.com/">Fugue Icons set</a> by Yusuke Kamiyamane. He so kindly released his icons under a <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons attribution license</a> and now I&#8217;m doing the same with the extra two icons.<span id="more-209"></span></p>
<p><a href="http://smithsrus.com/wp-content/uploads/2012/01/e-book-icons.zip">Download the e-book icons</a> (including the original PDF icon)</p>
<h3>Displaying the Icons</h3>
<p>A few simple CSS rules are all it takes to automatically display the icons on the appropriate links across an entire website. Here is what I used to produce what you see in the example image above. It also works well for links within a block of text.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.pdf</span><span style="color: #00AA00;">,</span> a<span style="color: #00AA00;">&#91;</span>href $<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;.pdf&quot;</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">,</span> 
<span style="color: #6666ff;">.epub</span><span style="color: #00AA00;">,</span> a<span style="color: #00AA00;">&#91;</span>href $<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;.epub&quot;</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">,</span> 
<span style="color: #6666ff;">.mobi</span><span style="color: #00AA00;">,</span> a<span style="color: #00AA00;">&#91;</span>href $<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;.mobi&quot;</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">,</span> 
<span style="color: #6666ff;">.azw</span><span style="color: #00AA00;">,</span> a<span style="color: #00AA00;">&#91;</span>href $<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;.azw&quot;</span><span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">1px</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">min-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">16px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.pdf</span><span style="color: #00AA00;">,</span> a<span style="color: #00AA00;">&#91;</span>href $<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;.pdf&quot;</span><span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">icons/document-pdf.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">50%</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.epub</span><span style="color: #00AA00;">,</span> a<span style="color: #00AA00;">&#91;</span>href $<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;.epub&quot;</span><span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">icons/document-epub.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">50%</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.mobi</span><span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.azw</span><span style="color: #00AA00;">,</span> a<span style="color: #00AA00;">&#91;</span>href $<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;.mobi&quot;</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">,</span> a<span style="color: #00AA00;">&#91;</span>href $<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;.azw&quot;</span><span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">icons/document-mobi.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">50%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Any link ending in .pdf, .epub, .mobi, or .azw will automatically get the appropriate icon applied to the left of it. For example:</p>
<p><code>&lt;a href="/downloads/myfile.epub"&gt;Download my EPUB book&lt;/a&gt;</code></p>
<p>There may be times were an icon needs to be applied manually, for example if the download is wrapped in a zip file. In that case, just apply the appropriate class to the &lt;a&gt; tag. For example:</p>
<p><code>&lt;a class="epub" href="/downloads/myfile.zip"&gt;Download my EPUB book&lt;/a&gt;</code></p>
<h3>Making ePub and Kindle File Downloads Work</h3>
<p>By the way, I try to stay away from wrapping my e-book downloads in a zip file to make it easier for people with mobile devices to download the file directly on their device. For example, if someone tries to download a zip file on an iPad, it will only work if they have an app installed that knows how to unpack the zip and then offer the option to send that file to iBooks or some other app.</p>
<p>On the other hand, if the download is simply an EPUB file then it automatically opens in iBooks. It cuts down the number of steps, there is much less confusion, and there is certainly less tech support for me that way.</p>
<p>If you try directly linking to those files and it doesn&#8217;t work, it may be because your server doesn&#8217;t know about those file types. All it takes is a few lines in your .htaccess file to fix it.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">AddType application/epub+zip .epub
AddType application/x-mobipocket-ebook .mobi
AddType application/vnd.amazon.ebook .azw</pre></div></div>

<p>So now you have a set of e-book icons and tips on making them work. I hope you find them useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://smithsrus.com/e-book-download-icons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iOS 5 Safari Now Has Native HTML5 Date and Time Pickers</title>
		<link>http://smithsrus.com/ios-5-safari-now-has-native-html5-date-and-time-pickers/</link>
		<comments>http://smithsrus.com/ios-5-safari-now-has-native-html5-date-and-time-pickers/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 21:01:45 +0000</pubDate>
		<dc:creator>Doug Smith</dc:creator>
				<category><![CDATA[iOS]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://smithsrus.com/?p=201</guid>
		<description><![CDATA[This falls under the category of sometimes it&#8217;s the little mundane things that can get me excited… I&#8217;ve been wanting mobile Safari to have native date pickers ever since I started creating Web apps for iPhone. Every time I dealt with date fields I had to create pickers with javascript that were just not as [...]]]></description>
			<content:encoded><![CDATA[<p>This falls under the category of sometimes it&#8217;s the little mundane things that can get me excited…</p>
<p>I&#8217;ve been wanting mobile Safari to have native date pickers ever since I started creating Web apps for iPhone. Every time I dealt with date fields I had to create pickers with javascript that were just not as good as those for real iPhone apps. I had been checking to see if native pickers were included in each iOS release but forgot about checking iOS 5 until now.<span id="more-201"></span></p>
<p>Here are some samples.</p>

<a href='http://smithsrus.com/ios-5-safari-now-has-native-html5-date-and-time-pickers/img_0299/' title='iOS 5 Safari HTML5 native date picker'><img width="150" height="150" src="http://smithsrus.com/wp-content/uploads/2011/11/IMG_0299-150x150.png" class="attachment-thumbnail" alt="iOS 5 Safari HTML5 native date picker" title="iOS 5 Safari HTML5 native date picker" /></a>
<a href='http://smithsrus.com/ios-5-safari-now-has-native-html5-date-and-time-pickers/img_0302/' title='iOS 5 Safari HTML5 native date and time picker'><img width="150" height="150" src="http://smithsrus.com/wp-content/uploads/2011/11/IMG_0302-150x150.png" class="attachment-thumbnail" alt="iOS 5 Safari HTML5 native date and time picker" title="iOS 5 Safari HTML5 native date and time picker" /></a>
<a href='http://smithsrus.com/ios-5-safari-now-has-native-html5-date-and-time-pickers/img_0300/' title='iOS 5 Safari HTML5 native month picker'><img width="150" height="150" src="http://smithsrus.com/wp-content/uploads/2011/11/IMG_0300-150x150.png" class="attachment-thumbnail" alt="iOS 5 Safari HTML5 native month picker" title="iOS 5 Safari HTML5 native month picker" /></a>

]]></content:encoded>
			<wfw:commentRss>http://smithsrus.com/ios-5-safari-now-has-native-html5-date-and-time-pickers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting the Bad Behavior Extension to Work with MediaWiki 1.17</title>
		<link>http://smithsrus.com/getting-the-bad-behavior-extension-to-work-with-mediawiki-1-17/</link>
		<comments>http://smithsrus.com/getting-the-bad-behavior-extension-to-work-with-mediawiki-1-17/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 20:40:29 +0000</pubDate>
		<dc:creator>Doug Smith</dc:creator>
				<category><![CDATA[MediaWiki]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://smithsrus.com/?p=192</guid>
		<description><![CDATA[I recently updated my robotic lawn mower site running an old version of MediaWiki to the current (as of this writing) version 1.17.0. The wiki had been filled with a bunch of spam users so after cleaning that up I thought I would add in the trusty Bad Behavior extension to keep some of the [...]]]></description>
			<content:encoded><![CDATA[<p>I recently updated my <a href="http://robomowerwiki.com/">robotic lawn mower site</a> running an old version of <a href="http://www.mediawiki.org/wiki/MediaWiki">MediaWiki</a> to the current (as of this writing) version 1.17.0. The wiki had been filled with a bunch of spam users so after cleaning that up I thought I would add in the trusty Bad Behavior extension to keep some of the bad guys away. Long story short: it didn&#8217;t work and despite much Googling I couldn&#8217;t find a current solution.</p>
<p>So for my own future reference and to help anyone else dealing with this, here is how I made it go.<span id="more-192"></span></p>
<ol>
<li>Grab the latest development version of <a href="http://downloads.wordpress.org/plugin/bad-behavior.2.1.13.zip">Bad Behavior</a>. Development has been stuck at version 2.1.13 due to a lack of donations so consider donating to the project if this is important to you. I donated a while back but it&#8217;s probably time for another one.</li>
<li>Unpack the zip file and put the whole bad-behavior folder in your MediaWiki extensions directory.</li>
<li>This version of Bad Behavior looks for a <em>settings.ini</em> file in its main directory to override settings. If the file is not there you will get array errors. So even if you don&#8217;t need to override settings at least create an empty file with that name.</li>
<li>Bad Behavior requires a <em>DatabaseFunctions.php</em> file for some database compatibility functions. This outdated file is no longer included in MediaWiki 1.17.0. Download <a href="http://download.wikimedia.org/mediawiki/1.16/mediawiki-1.16.5.tar.gz">MediaWiki 1.16.5</a>, which is the last version to include that file. Grab the <em>DatabaseFunctions.php</em> from the <em>includes</em> directory and put it in your current MediaWiki install&#8217;s <em>includes</em> directory.</li>
<li>
<p>Now ignore the Bad Behavior instructions and put this in your MediaWiki <em>LocalSettings.php</em> file:</p>
<p><code>include_once( "$IP/includes/DatabaseFunctions.php" );<br />
include( "$IP/extensions/bad-behavior/bad-behavior-mediawiki.php" );</code></p>
</li>
</ol>
<p>That should do it.</p>
]]></content:encoded>
			<wfw:commentRss>http://smithsrus.com/getting-the-bad-behavior-extension-to-work-with-mediawiki-1-17/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Finding WordPress Custom Post Types and Taxonomies in Already in Use</title>
		<link>http://smithsrus.com/finding-wordpress-custom-post-types-and-taxonomies-already-in-use/</link>
		<comments>http://smithsrus.com/finding-wordpress-custom-post-types-and-taxonomies-already-in-use/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 03:25:57 +0000</pubDate>
		<dc:creator>Doug Smith</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://smithsrus.com/?p=189</guid>
		<description><![CDATA[I&#8217;ve recently been evaluating WordPress shopping cart plugins to choose the best one for a project I&#8217;m working on. One of things I wanted to know is what database tables, custom post type, and custom taxonomies each plugin adds. The reason is that I favor plugins that don&#8217;t add extra tables because it&#8217;s easier, faster, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently been evaluating WordPress shopping cart plugins to choose the best one for a project I&#8217;m working on. One of things I wanted to know is what database tables, custom post type, and custom taxonomies each plugin adds. The reason is that I favor plugins that don&#8217;t add extra tables because it&#8217;s easier, faster, and safer to use the well-tested functions already built into WordPress to customize the way I want the site to work.<span id="more-189"></span></p>
<p>Finding the extra database tables is easy enough with a command line or a few clicks in phpMyAdmin, but finding the post types and taxonomies built-into WordPress and added by other plugins or the theme was more challenging.</p>
<p>Sure, I could have coded something up, but there are several nice plugins for adding custom post types and taxonomies, which I assumed would also show everything existing. I was surprised to find that was not the case and ended up testing every such plugin I could find.</p>
<p>So, to save some time for anyone else on a similar quest, the only one that did the job well (and, of course, the last one I tested) was <a href="http://wordpress.org/extend/plugins/gd-taxonomies-tools/">GD Custom Posts And Taxonomies Tools</a>. The interface is nice and clear and shows built-in post types, custom post types, built-in taxonomies, and custom taxonomies each in separate tables. It shows the full name, slug, a count of the items in that type, along with a few other parameters. In addition, the main page for the plugin shows an overview with counts of each type of post and taxonomy. Perfect.</p>
<p style="text-align: center;"><a href="http://smithsrus.com/wp-content/uploads/2011/07/GDC-screenshot.png"><img class="aligncenter size-full wp-image-190" title="WordPress GD Custom Posts And Taxonomies Tools plugin taxonomy list screen shot" src="http://smithsrus.com/wp-content/uploads/2011/07/GDC-screenshot.png" alt="WordPress GD Custom Posts And Taxonomies Tools plugin taxonomy list screen shot" width="409" height="326" /></a></p>
<p style="text-align: left;">For those who are interested, here are the other plugins I tried and the features they had for this purpose.</p>
<ul>
<li>Custom Press 1.0 — none</li>
<li>Custom Content Types 1.0.2 — none</li>
<li>Custom Post Type UI 0.7 — Lists other added post types at the bottom of the screen. Does not show the built-in types. Does not show other taxonomies.</li>
<li>Simple Custom Post Types 3.1.2 — none</li>
<li>Ultimate Post Type Manager 1.6.8 — none</li>
<li>Ultimate Taxonomy Manager 1.1.10 — none</li>
<li>WP Post Type UI 0.5.2 — none</li>
<li>Custom Content Type Manager 0.9.3.2 — Shows built-in post and page types only.</li>
<li>WP Easy Post Types 1.0.1 — none</li>
<li>Content Types 1.6.5 — none</li>
<li>Convert Post Types 1.1 — Shows taxonomy names but not slugs.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://smithsrus.com/finding-wordpress-custom-post-types-and-taxonomies-already-in-use/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Illinois Pineapples</title>
		<link>http://smithsrus.com/illinois-pineapples/</link>
		<comments>http://smithsrus.com/illinois-pineapples/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 17:38:11 +0000</pubDate>
		<dc:creator>Doug Smith</dc:creator>
				<category><![CDATA[Funny]]></category>

		<guid isPermaLink="false">http://smithsrus.com/?p=177</guid>
		<description><![CDATA[Why do I find so much humor at our local grocery store? I think it&#8217;s because they make it too easy! I stopped by my local Highlander (Kroger) grocery store to pick up a few essential food items (that&#8217;s code for ice cream.) They&#8217;ve been pushing a locally grown message for a while now with [...]]]></description>
			<content:encoded><![CDATA[<p>Why do I find so much humor at our local grocery store? I think it&#8217;s because they make it too easy!</p>
<p>I stopped by my local Highlander (Kroger) grocery store to pick up a few essential food items (that&#8217;s code for ice cream.) They&#8217;ve been pushing a locally grown message for a while now with posters and signs around the store. We&#8217;re in Northern Illinois and the store has stretched local to mean things like Michigan blueberries and Kentucky cucumbers. It&#8217;s within a long day&#8217;s drive, I guess.<span id="more-177"></span></p>
<p>But  I was not prepared for what awaited me at the front of the store. There, in the featured stuff spot, was big stack of pineapples sporting the largest &#8220;Locally Grown&#8221; banner the store has displayed so far.</p>
<p><a href="http://smithsrus.com/wp-content/uploads/2010/07/IL-Pineapple.jpg"><img class="aligncenter size-full wp-image-178" title="Illinois Pineapple" src="http://smithsrus.com/wp-content/uploads/2010/07/IL-Pineapple.jpg" alt="Illinois Pineapple" width="500" height="500" /></a></p>
<p>My wife pointed it out to me and we both started laughing out loud. Remember, we live in Illinois, so this was that incredulous, uncontrollable  sort of laughter. I imagine we made quite a scene because I just had to take some photos and then go look at the box to see where all this lovely fruit was grown … Costa Rica.</p>
<p>It just kept getting funnier the more we thought about it. We were still laughing at the checkout so I thought I&#8217;d let the manager standing there in on our mirth.</p>
<p>Total stone face. She didn&#8217;t get the humor.</p>
<p>We did our best to hold it in until we reached the car then drove home to tell the kids.</p>
]]></content:encoded>
			<wfw:commentRss>http://smithsrus.com/illinois-pineapples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I Don&#8217;t Want a Verizon iPhone</title>
		<link>http://smithsrus.com/i-dont-want-a-verizon-iphone/</link>
		<comments>http://smithsrus.com/i-dont-want-a-verizon-iphone/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 16:58:20 +0000</pubDate>
		<dc:creator>Doug Smith</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[rumors]]></category>
		<category><![CDATA[Verizon]]></category>

		<guid isPermaLink="false">http://smithsrus.com/?p=175</guid>
		<description><![CDATA[Rumors of a Verizon iPhone have been circulating for years. Even though none have materialized, the news ticker on our TV today showed that the mainstream media has picked up the topic&#8230;again. This new surge of rumors seems no more likely than previous batches. I suspect they are fueled only by wishful thinking, which I [...]]]></description>
			<content:encoded><![CDATA[<p>Rumors of a Verizon iPhone have been circulating for years. Even though none have materialized, the news ticker on our TV today showed that the mainstream media has picked up the topic&#8230;again. This new surge of rumors seems no more likely than previous batches. I suspect they are fueled only by wishful thinking, which I can&#8217;t completely relate to.</p>
<p>I may be in the minority, but I don&#8217;t want a Verizon iPhone.<span id="more-175"></span></p>
<p>You see, I cheered when Apple chose AT&amp;T for the iPhone. I had been a Verizon customer and was happy to leave. Why? Let&#8217;s not forget some of these things:</p>
<ul>
<li>Verizon is the company that has <a href="http://www.eweek.com/c/a/Mobile-and-Wireless/Verizon-Wireless-Users-Sue-Over-Disabled-Bluetooth-Features/">removed Bluetooth features</a> from phones. <a href="http://www.askdavetaylor.com/why_doesnt_my_motorola_razr_have_obex_with_bluetooth.html">They disabled syncing and file transfer</a> so they could limit photo transfers to over the air where they could charge for each one.</li>
<li>Verizon also <a href="http://jkontherun.com/2009/07/17/verizon-please-stop-disabling-gps-in-smartphones-on-your-network/">blocked GPS features</a> so 3rd party software or Web apps couldn&#8217;t compete with their VZ Navigator and monthly fee. Although they were forced to enable GPS features through a<a href="http://www.cyberlawonline.com/cyberlawg/general-interest/suit-challenges-verizon-on-blackberry-gps.html"> class action lawsuit</a>, the important <a href="http://www.precentral.net/3rd-party-apps-cannot-access-agps-verizon-palm-pre-pixi-plus">aGPS data still remains locked</a> for all but VZ Navigator.</li>
<li>Verizon has <a href="http://www.urbanmusic2000.com/forum/general-music-news/22539-i-tried-using-ventones-but-verizon-blocks-ventone-ringtones-there-another-way-i-can-recieve-my-ringtones.html">blocked transferring ringtones</a> to your phone unless you purchased them through Verizon.</li>
<li>Verizon is the company famous for lousy customer service and quietly <a href="http://www.howtomobile.com/verizon-news/verizon-wireless-to-allow-users-to-change-plan-with-no-contract-extension/">renewing your contract</a> every time you make any little change to your service.</li>
<li>Verizon&#8217;s CEO is known for making <a href="http://www.engadget.com/2005/04/17/verizon-ceo-thinks-its-unreasonable-to-expect-your-cellphone/">boneheaded and customer-unfriendly statements</a>.</li>
<li>Verizon <a href="http://cybernetnews.com/verizon-admits-that-their-unlimited-data-plan-is-limited-to-5gb-per-month/">advertised unlimited data plans with no disclaimer</a> then canceled customer&#8217;s accounts without warning for using too much. They were eventually <a href="http://www.fiercebroadbandwireless.com/story/verizon-settles-lawsuit-over-unlimited-data-plans/2007-10-25">forced to add an asterisk and fine print</a> to their advertising.</li>
<li>Verizon has a habit of <a href="http://www.readwriteweb.com/archives/verizon_customers_-_just_say_no.php">selling personal customer data</a>.</li>
<li>Verizon has <a href="http://www.bulldogsandbroncos.com/2009/05/10/rip-off-artists-verizon-wireless/">charged customers usage minutes</a> for browsing Verizon&#8217;s own <em>Get it Now</em> store.</li>
</ul>
<p>Now I don&#8217;t know how many of these practices still stand today, but they were all in place when I got my iPhone. I always felt like I was fighting my service provider to do the things that seemed natural to do.</p>
<p>Apple changed the game with the iPhone by requiring these kinds of features to just work as part of the package. Photos, ringtones, Web surfing, GPS, music, movies, etc. all work and sync as you would expect. AT&amp;T was willing to play by the new rules and that has spurred the innovation we have today.</p>
<p>Sure, AT&amp;T has experienced growing pains with the influx of iPhone customers. Any network would.</p>
<p>Cell coverage really depends on where you happen to be. It sometimes flip flops between which carrier has the best signal in particular locations, but most of the time I notice all carriers having some of the same trouble spots.</p>
<p>We do have a few areas around here where Verizon coverage is marginally better. But my AT&amp;T coverage is good too and has improved immensely over the last couple years even though I&#8217;m not in a major city. We have 3G all over the area and I know AT&amp;T has added towers, replaced antennas, and tuned signal directions. I&#8217;ve also seen them change to lower frequencies in some areas to better penetrate through trees and buildings.</p>
<p>The bottom line is that my iPhone has changed the way I do things for the better and the Apple / AT&amp;T partnership has contributed to that experience. My shiny new iPhone 4 is scheduled to arrive tomorrow. It requires renewing my contract for a couple more years and I&#8217;m happy to do so.</p>
]]></content:encoded>
			<wfw:commentRss>http://smithsrus.com/i-dont-want-a-verizon-iphone/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Gravatar, AppleScript, and the OS X Address Book Revisited</title>
		<link>http://smithsrus.com/gravatar-applescript-and-the-os-x-address-book-revisited/</link>
		<comments>http://smithsrus.com/gravatar-applescript-and-the-os-x-address-book-revisited/#comments</comments>
		<pubDate>Tue, 11 May 2010 00:19:56 +0000</pubDate>
		<dc:creator>Doug Smith</dc:creator>
				<category><![CDATA[applescript]]></category>
		<category><![CDATA[Gravatar]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://smithsrus.com/?p=160</guid>
		<description><![CDATA[A while back I did a series of posts (part 1, part 2, part 3, and part 4) on using Gravatars in AppleScript to update pictures in your Mac Address Book. Those address pictures then sync to your iPhone, iPod Touch, or iPad. I&#8217;ve learned a few things since then, plus the Gravatar service has [...]]]></description>
			<content:encoded><![CDATA[<p>A while back I did a series of posts (<a href="http://smithsrus.com/gravatar-applescript-and-address-book-pictures/">part 1</a>, <a href="http://smithsrus.com/setting-an-address-book-picture-with-applescript/">part 2</a>, <a href="http://smithsrus.com/detecting-when-gravatar-has-no-image/">part 3</a>, and <a href="http://smithsrus.com/filling-mac-address-book-pictures-with-gravatars/">part 4</a>) on using Gravatars in AppleScript to update pictures in your Mac Address Book. Those address pictures then sync to your iPhone, iPod Touch, or iPad.</p>
<p>I&#8217;ve learned a few things since then, plus the Gravatar service has a new option that removes the need for a workaround I had to come up with. So it&#8217;s time for an update to my now obsolete posts.<span id="more-160"></span></p>
<h3>Reference Implementation One: Gravatar to an AppleScript Variable</h3>
<p>The most common use case of Gravatar in AppleScript is probably to grab someone&#8217;s Gravatar image based on an e-mail address then pass it into some other application. Many Mac applications pass image data internally as a TIFF. So here&#8217;s an example of looking up a Gravatar and storing the raw picture data in a variable.</p>
<p>Here&#8217;s the script: (<a href="applescript://com.apple.scripteditor?action=new&#038;script=--%20Download%20a%20Gravatar%20image%20for%20the%20given%20e-mail%20address%20and%20store%20in%20a%20variable%20as%20a%20TIFF%20image.%20Display%20error%20if%20a%20matching%20gravatar%20doesn%27t%20exist.%0D--%20Released%20under%20GPL.%0D--%20by%20Doug%20Smith%2C%20http%3A//smithsrus.com%0D%0D--%20The%20e-mail%20address%20to%20look%20up.%0Dset%20email%20to%20%22someone%40somewhere.com%22%0D%0D--%20Calculate%20an%20MD5%20for%20the%20e-mail%20address.%0Dset%20md5_email%20to%20do%20shell%20script%20%22md5%20-q%20-s%20%60echo%20%22%20%26%20email%20%26%20%22%20%7C%20tr%20%27%5B%3Aupper%3A%5D%27%20%27%5B%3Alower%3A%5D%27%60%22%0D%0D--%20Construct%20the%20Gravatar%20URL.%0Dset%20grav_url%20to%20quoted%20form%20of%20%28%22http%3A//gravatar.com/avatar/%22%20%26%20md5_email%20%26%20%22%3Fd%3D404%22%20as%20text%29%0D%0D--%20Get%20the%20Gravatar%20image%20with%20a%20timeout%20of%2010%20seconds.%0Dtry%0D%09set%20pict_data%20to%20do%20shell%20script%20%22curl%20-fsS%20%22%20%26%20grav_url%20%26%20%22%20-m%2010%22%20as%20TIFF%20picture%20without%20altering%20line%20endings%0D%09tell%20me%20to%20display%20dialog%20%22Yes%2C%20we%20have%20a%20matching%20Gravatar.%22%20buttons%20%7B%22Okay%22%7D%20default%20button%201%0Don%20error%0D%09tell%20me%20to%20display%20dialog%20%22Sorry%2C%20there%20was%20no%20matching%20Gravatar.%22%20buttons%20%7B%22Cancel%22%7D%20default%20button%201%0Dend%20try%0D">Open in Script Editor</a>)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">-- Download a Gravatar image for the given e-mail address and store in a variable as a TIFF image. Display error if a matching gravatar doesn't exist.</span>
<span style="color: #808080; font-style: italic;">-- Released under GPL.</span>
<span style="color: #808080; font-style: italic;">-- by Doug Smith, http://smithsrus.com</span>
&nbsp;
<span style="color: #808080; font-style: italic;">-- The e-mail address to look up.</span>
<span style="color: #ff0033; font-weight: bold;">set</span> email <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;someone@somewhere.com&quot;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">-- Calculate an MD5 for the e-mail address.</span>
<span style="color: #ff0033; font-weight: bold;">set</span> md5_email <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">do shell script</span> <span style="color: #009900;">&quot;md5 -q -s `echo &quot;</span> <span style="color: #000000;">&amp;</span> email <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; | tr '[:upper:]' '[:lower:]'`&quot;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">-- Construct the Gravatar URL.</span>
<span style="color: #ff0033; font-weight: bold;">set</span> grav_url <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">quoted form</span> <span style="color: #ff0033; font-weight: bold;">of</span> <span style="color: #000000;">&#40;</span><span style="color: #009900;">&quot;http://gravatar.com/avatar/&quot;</span> <span style="color: #000000;">&amp;</span> md5_email <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;?d=404&quot;</span> <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">text</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">-- Get the Gravatar image with a timeout of 10 seconds.</span>
<span style="color: #ff0033; font-weight: bold;">try</span>
	<span style="color: #ff0033; font-weight: bold;">set</span> pict_data <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">do shell script</span> <span style="color: #009900;">&quot;curl -fsS &quot;</span> <span style="color: #000000;">&amp;</span> grav_url <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; -m 10&quot;</span> <span style="color: #ff0033;">as</span> TIFF picture <span style="color: #ff0033; font-weight: bold;">without</span> altering line endings
	<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">me</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">display dialog</span> <span style="color: #009900;">&quot;Yes, we have a matching Gravatar.&quot;</span> <span style="color: #0066ff;">buttons</span> <span style="color: #000000;">&#123;</span><span style="color: #009900;">&quot;Okay&quot;</span><span style="color: #000000;">&#125;</span> default button <span style="color: #000000;">1</span>
<span style="color: #ff0033; font-weight: bold;">on</span> <span style="color: #ff0033; font-weight: bold;">error</span>
	<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">me</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">display dialog</span> <span style="color: #009900;">&quot;Sorry, there was no matching Gravatar.&quot;</span> <span style="color: #0066ff;">buttons</span> <span style="color: #000000;">&#123;</span><span style="color: #009900;">&quot;Cancel&quot;</span><span style="color: #000000;">&#125;</span> default button <span style="color: #000000;">1</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">try</span></pre></td></tr></table></div>

<p>As you can see, we end up calling some shell commands because Applescript doesn&#8217;t have all of the needed functionality. That&#8217;s no big deal because it only uses capabilities built into OS X and should work on any Mac.</p>
<h3>Reference Implementation Two: Gravatar to a File</h3>
<p>There may be some cases where it&#8217;s more useful to download the Gravatar image to a file for later use instead of loading it into a variable. With just a few modifications we can simply save the jpeg file as served up by Gravatar.</p>
<p>Here&#8217;s the script: (<a href="applescript://com.apple.scripteditor?action=new&#038;script=--%20Download%20a%20Gravatar%20image%20for%20the%20given%20e-mail%20address%20and%20store%20in%20a%20temporary%20file.%20Display%20error%20if%20a%20matching%20gravatar%20doesn%27t%20exist.%0D--%20Released%20under%20GPL.%0D--%20by%20Doug%20Smith%2C%20http%3A//smithsrus.com%0D%0D--%20The%20e-mail%20address%20to%20look%20up.%0Dset%20email%20to%20%22doug%40smithsrus.com%22%0D%0D--%20Calculate%20an%20MD5%20for%20the%20e-mail%20address.%0Dset%20md5_email%20to%20do%20shell%20script%20%22md5%20-q%20-s%20%60echo%20%22%20%26%20email%20%26%20%22%20%7C%20tr%20%27%5B%3Aupper%3A%5D%27%20%27%5B%3Alower%3A%5D%27%60%22%0D%0D--%20Construct%20the%20Gravatar%20URL.%0Dset%20grav_url%20to%20quoted%20form%20of%20%28%22http%3A//gravatar.com/avatar/%22%20%26%20md5_email%20%26%20%22%3Fd%3D404%22%20as%20text%29%0D%0D--%20Make%20a%20file%20name%20in%20which%20to%20temporarily%20save%20the%20Gravatar.%0Dset%20grav_file%20to%20%28path%20to%20temporary%20items%29%20%26%20%22gravatar%22%20%26%20md5_email%20%26%20%22.jpg%22%20as%20text%0Dset%20grav_POSIX_file%20to%20quoted%20form%20of%20POSIX%20path%20of%20grav_file%0D%0D--%20Download%20the%20Gravatar%20image%20to%20the%20temporary%20file%20with%20a%20timeout%20of%2010%20seconds.%0Dtry%0D%09do%20shell%20script%20%22curl%20-fsS%20%22%20%26%20grav_url%20%26%20%22%20-m%2010%20-o%20%22%20%26%20grav_POSIX_file%0D%09tell%20me%20to%20display%20dialog%20%22Yes%2C%20we%20have%20a%20matching%20Gravatar%20downloaded%20to%20%22%20%26%20grav_POSIX_file%20%26%20%22.%22%20buttons%20%7B%22Delete%20the%20File%22%7D%20default%20button%201%0D%09%0D%09tell%20application%20%22System%20Events%22%0D%09%09delete%20file%20grav_file%0D%09end%20tell%0Don%20error%0D%09tell%20me%20to%20display%20dialog%20%22Sorry%2C%20there%20was%20no%20matching%20Gravatar.%22%20buttons%20%7B%22Cancel%22%7D%20default%20button%201%0Dend%20try%0D%0D">Open in Script Editor</a>)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">-- Download a Gravatar image for the given e-mail address and store in a temporary file. Display error if a matching gravatar doesn't exist.</span>
<span style="color: #808080; font-style: italic;">-- Released under GPL.</span>
<span style="color: #808080; font-style: italic;">-- by Doug Smith, http://smithsrus.com</span>
&nbsp;
<span style="color: #808080; font-style: italic;">-- The e-mail address to look up.</span>
<span style="color: #ff0033; font-weight: bold;">set</span> email <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;someone@somewhere.com&quot;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">-- Calculate an MD5 for the e-mail address.</span>
<span style="color: #ff0033; font-weight: bold;">set</span> md5_email <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">do shell script</span> <span style="color: #009900;">&quot;md5 -q -s `echo &quot;</span> <span style="color: #000000;">&amp;</span> email <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; | tr '[:upper:]' '[:lower:]'`&quot;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">-- Construct the Gravatar URL.</span>
<span style="color: #ff0033; font-weight: bold;">set</span> grav_url <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">quoted form</span> <span style="color: #ff0033; font-weight: bold;">of</span> <span style="color: #000000;">&#40;</span><span style="color: #009900;">&quot;http://gravatar.com/avatar/&quot;</span> <span style="color: #000000;">&amp;</span> md5_email <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;?d=404&quot;</span> <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">text</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">-- Make a file name in which to temporarily save the Gravatar.</span>
<span style="color: #ff0033; font-weight: bold;">set</span> grav_file <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">path to</span> temporary <span style="color: #0066ff;">items</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;gravatar&quot;</span> <span style="color: #000000;">&amp;</span> md5_email <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;.jpg&quot;</span> <span style="color: #ff0033;">as</span> <span style="color: #0066ff;">text</span>
<span style="color: #ff0033; font-weight: bold;">set</span> grav_POSIX_file <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">quoted form</span> <span style="color: #ff0033; font-weight: bold;">of</span> <span style="color: #0066ff;">POSIX path</span> <span style="color: #ff0033; font-weight: bold;">of</span> grav_file
&nbsp;
<span style="color: #808080; font-style: italic;">-- Download the Gravatar image to the temporary file with a timeout of 10 seconds.</span>
<span style="color: #ff0033; font-weight: bold;">try</span>
	<span style="color: #0066ff;">do shell script</span> <span style="color: #009900;">&quot;curl -fsS &quot;</span> <span style="color: #000000;">&amp;</span> grav_url <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; -m 10 -o &quot;</span> <span style="color: #000000;">&amp;</span> grav_POSIX_file
	<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">me</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">display dialog</span> <span style="color: #009900;">&quot;Yes, we have a matching Gravatar downloaded to &quot;</span> <span style="color: #000000;">&amp;</span> grav_POSIX_file <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot;.&quot;</span> <span style="color: #0066ff;">buttons</span> <span style="color: #000000;">&#123;</span><span style="color: #009900;">&quot;Delete the File&quot;</span><span style="color: #000000;">&#125;</span> default button <span style="color: #000000;">1</span>
	<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;System Events&quot;</span>
		<span style="color: #0066ff;">delete</span> <span style="color: #0066ff;">file</span> grav_file
	<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
<span style="color: #ff0033; font-weight: bold;">on</span> <span style="color: #ff0033; font-weight: bold;">error</span>
	<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">me</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">display dialog</span> <span style="color: #009900;">&quot;Sorry, there was no matching Gravatar.&quot;</span> <span style="color: #0066ff;">buttons</span> <span style="color: #000000;">&#123;</span><span style="color: #009900;">&quot;Cancel&quot;</span><span style="color: #000000;">&#125;</span> default button <span style="color: #000000;">1</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">try</span></pre></td></tr></table></div>

<h3>Filling Address Book with Gravatars</h3>
<p>My goal for starting this whole project was to be able to populate my Mac Address Book with Gravatar pictures. Those then get automatically synced to my iPhone, which is really nice when receiving calls. A hat tip to <a href="http://momo.brauchtman.net/2009/03/missing-link-update-contact-image-in-macs-address-book-using-gravatar/">Moritz Haarmann for his Gravatar Address Book plugin</a>, which is what started me thinking about this in the first place. His plugin only works on one record at a time so I wanted to expand the concept to mass update selected records or the whole Address Book.</p>
<p>Rather than list the full script here, you can just <a href="http://smithsrus.com/dl/Gravatar-to-Address-Book-Pictures.zip">download the application</a>. You can open it in Script Editor if you want to see how it works. Be sure to back up your Address Book file, just in case. And if you experience errors or odd behavior, try quitting and relaunching Address Book, which often fixes little problems with it.</p>
<p>Be sure to let me know how you like it and if it works well for you. It would be interesting to know what percentage of addresses everyone is finding have Gravatars available now. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://smithsrus.com/gravatar-applescript-and-the-os-x-address-book-revisited/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Census form requires telling the future</title>
		<link>http://smithsrus.com/census-form-requires-telling-the-future/</link>
		<comments>http://smithsrus.com/census-form-requires-telling-the-future/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 18:40:10 +0000</pubDate>
		<dc:creator>Doug Smith</dc:creator>
				<category><![CDATA[Funny]]></category>

		<guid isPermaLink="false">http://smithsrus.com/?p=168</guid>
		<description><![CDATA[Our 2010 census form arrived in the mail today but it&#8217;s impossible to fill it out according to the instructions. Why, you ask? Well, today is March 16, 2010. The packet contains a letter dated March 15, 2010, which includes the following text in bold print: Please complete and mail back the enclosed census form [...]]]></description>
			<content:encoded><![CDATA[<p>Our 2010 census form arrived in the mail today but it&#8217;s impossible to fill it out according to the instructions. Why, you ask?</p>
<p>Well, today is March 16, 2010. The packet contains a letter dated March 15, 2010, which includes the following text in bold print: <em>Please complete and mail back the enclosed census form today.</em></p>
<p>Okay, I guess I better get to it.</p>
<p>Question 1: <em>How many people were living or staying in this house, apartment, or mobile home on April 1, 2010?</em></p>
<p>Hmmmm. There does not seem to be a blank to state that I don&#8217;t know how to tell the future. <img src='http://smithsrus.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://smithsrus.com/census-form-requires-telling-the-future/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Computer Repair Tools from the Kitchen</title>
		<link>http://smithsrus.com/computer-repair-tools-from-the-kitchen/</link>
		<comments>http://smithsrus.com/computer-repair-tools-from-the-kitchen/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 02:50:58 +0000</pubDate>
		<dc:creator>Doug Smith</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://smithsrus.com/?p=31</guid>
		<description><![CDATA[I was doing some repair work on a laptop computer today and realized I had not yet shared one of my most significant homemade tools for this kind of work. It&#8217;s simply an ice cube tray with each cube numbered in permanent marker. I put screws and other small parts in the tray as I [...]]]></description>
			<content:encoded><![CDATA[<p>I was doing some repair work on a laptop computer today and realized I had not yet shared one of my most significant homemade tools for this kind of work. It&#8217;s simply an ice cube tray with each cube numbered in permanent marker.</p>
<p><img src="http://smithsrus.com/wp-content/uploads/2010/03/ice-cube-tray-parts-holder.jpg" alt="Computer parts in an ice cube tray" title="Computer parts in an ice cube tray" width="480" height="288" class="aligncenter size-full wp-image-167" /></p>
<p>I put screws and other small parts in the tray as I disassemble each section of the computer. If I&#8217;m following a numbered repair guide I try to match the cube number to each step. Otherwise, I just fill the cubes in numerical order as it makes sense. Reassembly is a snap and there&#8217;s no losing or mixing up those tiny screws.</p>
<p>Oh, and while I&#8217;m snatching kitchen items to use as tools, cookie sheets make great parts trays for longer-term projects. The whole project can be shelved to get it out of the way and then easily resumed without parts getting misplaced. </p>
]]></content:encoded>
			<wfw:commentRss>http://smithsrus.com/computer-repair-tools-from-the-kitchen/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Loading WordPress&#8217; Thickbox Only When Needed</title>
		<link>http://smithsrus.com/loading-wordpress-thickbox-only-when-needed/</link>
		<comments>http://smithsrus.com/loading-wordpress-thickbox-only-when-needed/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 16:24:15 +0000</pubDate>
		<dc:creator>Doug Smith</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://smithsrus.com/?p=165</guid>
		<description><![CDATA[I like to use Thickbox on my site to display images and videos in overlay windows. In WordPress, it&#8217;s easy enough to use wp_enqueue_script( ) and wp_enqueue_style() to load the built-in version of Thickbox. It automatically takes care of including jQuery, putting the css in the header, and the javascript in the footer. But there&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>I like to use Thickbox on my site to display images and videos in overlay windows. In WordPress, it&#8217;s easy enough to use wp_enqueue_script( ) and wp_enqueue_style() to load the built-in version of Thickbox. It automatically takes care of including jQuery, putting the css in the header, and the javascript in the footer. </p>
<p>But there&#8217;s no need to have the bloat of Thickbox and jQuery loading on all pages when most of them don&#8217;t even use it. That&#8217;s why <a href="http://yoast.com/conditional-thickbox-loading/">Joost de Valk detailed a nice tip to only load thickbox when needed</a> by checking the page content for references to it. All it takes is a few lines of code in your functions.php file.</p>
<p>Unfortunately, you end up with some broken images because the built-in Thickbox defines their locations in thickbox.js as relative paths:<span id="more-165"></span></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> tb_pathToImage <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;../wp-includes/js/thickbox/loadingAnimation.gif&quot;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> tb_closeImage <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;../wp-includes/js/thickbox/tb-close.png&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Those paths get tacked onto the URL of whatever page you&#8217;re on, which results in an invalid URL and a couple 404 errors for each use. Now that&#8217;s not unique to Joost&#8217;s solution. It happens whenever Thickbox is loaded with wp_enqueue_script( ).</p>
<p>It can easily be fixed by adding a couple lines of javascript in the footer to redefine the image path variables. That&#8217;s as simple as a few more lines of code in your functions.php file. We&#8217;ll use Joost&#8217;s technique of only loading it when the page content requires it:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> thickbox_image_paths<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$post</span><span style="color: #339933;">;</span>
	wp_reset_query<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_singular<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_content</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'class=&quot;thickbox&quot;'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$thickbox_path</span> <span style="color: #339933;">=</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'siteurl'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/wp-includes/js/thickbox/'</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;script type=<span style="color: #000099; font-weight: bold;">\&quot;</span>text/javascript<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;	var tb_pathToImage = <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">${thickbox_path}</span>loadingAnimation.gif<span style="color: #000099; font-weight: bold;">\&quot;</span>;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;	var tb_closeImage = <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">${thickbox_path}</span>tb-close.png<span style="color: #000099; font-weight: bold;">\&quot;</span>;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/script&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_footer'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'thickbox_image_paths'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>My theme uses multiple loops so I had to add the wp_reset_query() to be able to examine the original content. Otherwise it would be looking at the last post in my recent posts box and not see that Thickbox was used in the current content.</p>
<p>There you have it. A nice technique from Joost and a simple addition to complement it.</p>
]]></content:encoded>
			<wfw:commentRss>http://smithsrus.com/loading-wordpress-thickbox-only-when-needed/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

