<?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>Josh Highland &#187; software</title>
	<atom:link href="http://joshhighland.com/blog/category/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://joshhighland.com/blog</link>
	<description>the living internet</description>
	<lastBuildDate>Tue, 24 Aug 2010 16:02:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Macbook Pro &#8211; Make an external monitor your primary display</title>
		<link>http://joshhighland.com/blog/2010/08/09/macbook-pro-make-an-external-monitor-your-primary-display/</link>
		<comments>http://joshhighland.com/blog/2010/08/09/macbook-pro-make-an-external-monitor-your-primary-display/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 03:00:09 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[external]]></category>
		<category><![CDATA[MacBook Pro]]></category>
		<category><![CDATA[monitor]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=6106</guid>
		<description><![CDATA[Recently, I got a mac laptop at work, which is sup[er sweet, but I wanted to hook it up to a real monitor, keyboard and mouse. All very easy things to do. The problem I had was that the laptop was acting as the primary monitor. Every application that I drug over to the secondary [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I got a mac laptop at work, which is sup[er sweet, but I wanted to hook it up to a real monitor, keyboard and mouse. All very easy things to do. The problem I had was that the laptop was acting as the primary monitor. Every application that I drug over to the secondary monitor worked great, but the application tool bar was still on the laptop.. annoying.</p>
<p>I did a quick Google search to see if there was a solution to the problem. There was, and it&#8217;s dead simple to put into action.</p>
<p>Connect the external monitor</p>
<ul>
<li>Start up the &#8220;System Preferences&#8221; app</li>
<li>Click on &#8220;Display Preferences&#8221;</li>
<li>Within Display Preferences, choose Arrangement. You should see two blue squares that represent each display, main and secondary. On the main display you’ll notice a bar along the top.</li>
<li>Click and drag this bar from the Main Display to the Secondary Display.</li>
<li>Close Display Preferences</li>
<li>That&#8217;s it!</li>
</ul>
<p><img class="alignnone size-full wp-image-6104" title="macDisplay1" src="http://joshhighland.com/blog/wp-content/uploads/2010/08/macDisplay1.jpg" alt="" width="500" height="372" /></p>
<p><img class="alignnone size-full wp-image-6107" title="macDisplay2" src="http://joshhighland.com/blog/wp-content/uploads/2010/08/macDisplay21.jpg" alt="" width="500" height="367" /></p>
<p><a href="http://joshhighland.com/blog/wp-content/uploads/2010/08/macOffice.jpg"><img class="alignnone size-full wp-image-6110" title="My Mac Office" src="http://joshhighland.com/blog/wp-content/uploads/2010/08/macOffice.jpg" alt="" width="467" height="349" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2010/08/09/macbook-pro-make-an-external-monitor-your-primary-display/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Here Is Why Web Developers Like Me Hate IE6</title>
		<link>http://joshhighland.com/blog/2010/07/30/here-is-why-web-developers-like-me-hate-ie6/</link>
		<comments>http://joshhighland.com/blog/2010/07/30/here-is-why-web-developers-like-me-hate-ie6/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 22:28:59 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[funny]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[depricated]]></category>
		<category><![CDATA[iE6]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=1684</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://joshhighland.com/blog/wp-content/uploads/2010/07/ie6css.jpg"><img class="alignleft size-full wp-image-1685" title="ie6css" src="http://joshhighland.com/blog/wp-content/uploads/2010/07/ie6css.jpg" alt="" width="580" height="1159" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2010/07/30/here-is-why-web-developers-like-me-hate-ie6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress asking for FTP username/password?</title>
		<link>http://joshhighland.com/blog/2010/06/07/wordpress-asking-for-ftp-usernamepassword/</link>
		<comments>http://joshhighland.com/blog/2010/06/07/wordpress-asking-for-ftp-usernamepassword/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 08:11:05 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[tutorials]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=1242</guid>
		<description><![CDATA[Are you annoyed with your wordpress install asking you for your FTP cradentials everytime you try to upgrade a plugin? I know I was.  Thankfully, there’s a simple solution which will save the FTP login (username/password/server) so WordPress stops asking you for them.  Here’s how you do it. Locate your WordPress root diectory and find [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://joshhighland.com/blog/wp-content/uploads/2010/06/wordpressFTP.gif"><img class="alignnone size-full wp-image-1249" title="wordpressFTP" src="http://joshhighland.com/blog/wp-content/uploads/2010/06/wordpressFTP.gif" alt="" width="573" height="305" /></a></p>
<p>Are you annoyed with your wordpress install asking you for your FTP cradentials everytime you try to upgrade a plugin? I know I was.  Thankfully, there’s a simple solution which will save the FTP login  (username/password/server) so WordPress stops asking you for them.   Here’s how you do it.</p>
<ol>
<li>Locate your WordPress root diectory and find the “wp-config.php” file.</li>
<li>Edit the file and insert this somewhere in the middle as it’s own block, we normally put it after the mysql username/password block.</li>
</ol>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">define(&quot;FTP_HOST&quot;, &quot;localhost&quot;);
define(&quot;FTP_USER&quot;, &quot;yourftpusername&quot;);
define(&quot;FTP_PASS&quot;, &quot;yourftppassword&quot;);</pre></div></div>

<p>Once you’ve made that edit, save the file and voila!  No more punching in your ftp username and password all the time.</p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2010/06/07/wordpress-asking-for-ftp-usernamepassword/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>timthumb.php returns a 404 Error in WordPress</title>
		<link>http://joshhighland.com/blog/2010/05/20/timthumb-php-returns-a-404-error-in-wordpress/</link>
		<comments>http://joshhighland.com/blog/2010/05/20/timthumb-php-returns-a-404-error-in-wordpress/#comments</comments>
		<pubDate>Fri, 21 May 2010 06:00:56 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[chmod]]></category>
		<category><![CDATA[linux. php]]></category>
		<category><![CDATA[permissions]]></category>
		<category><![CDATA[timthumb]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=1199</guid>
		<description><![CDATA[timthumb is a great little php script that helps create thumbnail images (http://code.google.com/p/timthumb). I&#8217;ve used it before, but recently I purchased a wordpress theme that used it, and it wasn&#8217;t working. I would get a 404 error when I tired to access the directly via a url like this: theDomain.com/wp-content/themes/theTheme/scripts/timthumb.php?src=/wp-content/uploads/2010/05/moose1.jpg&#38;h=207&#38;w=237&#38;zc=1&#38;q=80 After some digging around in [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://joshhighland.com/blog/wp-content/uploads/2010/05/create-wordpress-thumbnails-300x300.jpg"><img class="alignleft size-thumbnail wp-image-1200" title="timthumb 404 error in wordpress" src="http://joshhighland.com/blog/wp-content/uploads/2010/05/create-wordpress-thumbnails-300x300-150x150.jpg" alt="" width="150" height="150" /></a>timthumb is a great little php script that helps create thumbnail images (<a href="http://code.google.com/p/timthumb">http://code.google.com/p/timthumb</a>). I&#8217;ve used it before, but recently I purchased a wordpress theme that used it, and it wasn&#8217;t working.</p>
<p>I would get a 404 error when I tired to access the directly via a url like this:<br />
theDomain.com/wp-content/themes/theTheme/scripts/timthumb.php?src=/wp-content/uploads/2010/05/moose1.jpg&amp;h=207&amp;w=237&amp;zc=1&amp;q=80</p>
<p>After some digging around in log files on my server I realized the error</p>
<blockquote><p>SoftException in Application.cpp:610: Directory  “/home/usernamehere/public_html/wp-content” is writable by others</p></blockquote>
<p>My problem had to so with the directory permissions! &#8220;writable by others&#8221; means that the permission on the directory were set to &#8220;777&#8243;. I changed the permissions of the directory using chmod to 755, and everything started to work.</p>
<p>Lesson learned, if timthumb.php is not working at giving you 404 errors, check the permission of the directory that contains the php file.</p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2010/05/20/timthumb-php-returns-a-404-error-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server 2008: FIXED &#8220;Saving changes is not permitted&#8221;</title>
		<link>http://joshhighland.com/blog/2010/02/08/sql-server-2008-fixed-saving-changes-is-not-permitted/</link>
		<comments>http://joshhighland.com/blog/2010/02/08/sql-server-2008-fixed-saving-changes-is-not-permitted/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 21:00:28 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[MS SQL 2008]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=1076</guid>
		<description><![CDATA[Working in SQL Server 2008 I received this confusing error when editing the structure of a table: “Saving changes is not permitted. The changes that you have made require the following tables to be dropped and re-created. You have either made changes to a table that can&#8217;t be re-created or enabled the option Prevent saving [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-1079" title="Screen-shot-2010-02-03-at-12.16.11-AM" src="http://joshhighland.com/blog/wp-content/uploads/2010/02/Screen-shot-2010-02-03-at-12.16.11-AM1.png" alt="" width="381" height="87" /></p>
<p>Working in SQL Server 2008 I received this confusing error when editing the structure of a table:</p>
<blockquote><p>“Saving changes is not permitted. The changes that you have made require the following tables to be dropped and re-created. You have either made changes to a table that can&#8217;t be re-created or enabled the option Prevent saving changes that require the table to be re-created.”</p></blockquote>
<p><img class="alignnone size-full wp-image-1077" title="cantSaveTable" src="http://joshhighland.com/blog/wp-content/uploads/2010/02/cantSaveTable.jpg" alt="" width="479" height="394" /></p>
<p>I tried many things but I kept getting this error. After some trouble shooting I found the following information:</p>
<p>This error happens because “<strong>Saving Changes is not permitted</strong>” when using SQL Server 2008 Management Studio to modify the structure of a table especially when SQL Server needs to drop and recreate a table to save the structural changes. It is always advised to make a structural change for a table using TSQL. However, it is a convenient option for database developers to use SQL Server Management Studio make such changes  as the  <strong><em>Prevent Saving Changes That Require Table Re-creation</em> option is enabled by default</strong> in SQL Server 2008 Management Studio.</p>
<p>I can understand why this feature would be helpful to have but to have it enabled by default is just silly.</p>
<p>I found that you can disable this feature by:</p>
<ol>
<li>Open the Tools menu then click on Options</li>
<li>Open the &#8220;Designers&#8221; tree</li>
<li>Click on &#8220;Table and Database Designers&#8221;</li>
<li>Uncheck &#8220;Prevent saving changes that require table-creation&#8221;</li>
<li>Press &#8220;Ok&#8221;</li>
</ol>
<p><img class="alignnone size-full wp-image-1078" title="uncheck_saveTables" src="http://joshhighland.com/blog/wp-content/uploads/2010/02/uncheck_saveTables.jpg" alt="" width="653" height="390" /></p>
<p>Once I disabled the “<strong>Prevent saving changes that require the table re-creation” </strong>option,  I was ahead and save the changes I needed to make.</p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2010/02/08/sql-server-2008-fixed-saving-changes-is-not-permitted/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Remove Unwanted Firefox Auto-Suggest Entries</title>
		<link>http://joshhighland.com/blog/2010/02/06/remove-unwanted-firefox-auto-suggest-entries/</link>
		<comments>http://joshhighland.com/blog/2010/02/06/remove-unwanted-firefox-auto-suggest-entries/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 21:00:40 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[internet]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[autocomplete]]></category>
		<category><![CDATA[autosuggest]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=1057</guid>
		<description><![CDATA[Firefox 3 is awesome we all know that, but there are some things that that would just be nice to have. One of those things would be the ability to control what appears for the auto suggest when you type in the URL bar. Most of the time FireFox does a very good job of [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-1058 alignleft" title="firefox" src="http://joshhighland.com/blog/wp-content/uploads/2010/02/firefox.jpg" alt="" width="250" height="250" /></p>
<p>Firefox 3 is awesome we all know that, but there are some things that that would just be nice to have. One of those things would be the ability to control what appears for the auto suggest when you type in the URL bar.</p>
<p>Most of the time FireFox does a very good job of figuring out what you want to do, but when it goes bad, it goes really bad and gets annoying fast.</p>
<p>The other day I accidentally typed in &#8220;google.com/a&#8221;, and from that moment time on, everytime I wanted to go to &#8220;google.com&#8221;, it would auto complete to &#8220;google.com/a&#8221;, and i would end up going there. Very annoying.</p>
<p>I searched the Firefox menus but couldn&#8217;t find anything to help. I didn&#8217;t want to wipe out all of the auto complete entries, I find most of them helpful. I did some research and realized that you can remove these entries manually, but you have to do it in an unconventional way.</p>
<p><span style="text-decoration: underline;"><strong>How remove those unwanted auto suggest entries</strong></span></p>
<p><strong>1. The list appears as you type something.<br />
2. Select an entry by pointing you mouse at the item in the list, it will highlight.<br />
3. Press Shift + Delete from your keyboard to delete the entry.</strong></p>
<p><img title="Remove Firefox Auto-Suggest Entries" src="http://joshhighland.com/blog/wp-content/uploads/2010/02/Screen-shot-2010-02-05-at-6.53.45-PM.png" alt="" width="547" height="228" /></p>
<p>That&#8217;s all! You can remove entries from the address bar.  This trick works on any Firefox auto complete list, including text fields and other dropdown suggestions.</p>
<p>This also works on windows, mac and linux machines</p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2010/02/06/remove-unwanted-firefox-auto-suggest-entries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server 2008: FIXED &#8220;Data has changed since the Results pane was last retrieved&#8221;</title>
		<link>http://joshhighland.com/blog/2010/02/03/sql-server-2008-fixed-data-has-changed-since-the-results-pane-was-last-retrieved/</link>
		<comments>http://joshhighland.com/blog/2010/02/03/sql-server-2008-fixed-data-has-changed-since-the-results-pane-was-last-retrieved/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 18:30:27 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[ms sql]]></category>
		<category><![CDATA[ssms]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=1045</guid>
		<description><![CDATA[Today I was trying to edit the value in a table cell through the query browser in Microsoft SQL Server Management Itudio and I kept getting the following error: Data has changed since the Results pane was last retrieved. Do you want to save your changes now? (Optimistic Concurrency Control Error) Click Yes to commit [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-1049 aligncenter" title="Screen shot 2010-02-03 at 12.16.11 AM" src="http://joshhighland.com/blog/wp-content/uploads/2010/02/Screen-shot-2010-02-03-at-12.16.11-AM.png" alt="" width="381" height="87" /></p>
<p>Today I was trying to edit the value in a table cell through the query browser in Microsoft SQL Server Management Itudio and I kept getting the following error:</p>
<blockquote><p>Data has changed since the Results pane was last retrieved. Do you want to save your changes now?<br />
(Optimistic Concurrency Control Error)<br />
Click Yes to commit your changes to database anyway.<br />
Click No to discard your change and retrieve the current data for this row.<br />
Click Cancel to continue editing.</p></blockquote>
<p><a href="http://joshhighland.com/blog/wp-content/uploads/2010/02/occe.jpg"><img class="aligncenter size-full wp-image-1046" title="occe" src="http://joshhighland.com/blog/wp-content/uploads/2010/02/occe.jpg" alt="" width="604" height="268" /></a></p>
<p>I would click &#8220;Yes&#8221;, and get another error:</p>
<blockquote><p>No row was updated.<br />
The data in row X was not committed.<br />
Error Source: Microsoft.VisualStudio.DataTools.<br />
Error Message: The row value(s) updated or deleted either do not make the row unique or they alter multiple rows(N rows).<br />
Correct the errors and retry or press ESC to cancel the change(s).</p></blockquote>
<p>I was killing myself trying to figure out what was wrong. I was the only person working on the database, so the data wasnt being changed behind my back.</p>
<p>After an hour on goolge I came across a Microsoft tech article for MS SQL 2005, <a href="http://support.microsoft.com/kb/925719">http://support.microsoft.com/kb/925719</a></p>
<p>It stated the issue could occure from one of the following conditions:</p>
<ul>
<li>The table contains one or more columns of the text or ntext data type.</li>
<li>The value of one of these columns contains the following characters:</li>
<li>Percent sign (%)</li>
<li>Underscore (_)</li>
<li>Left bracket ([)</li>
<li><strong>The table does not contain a primary key.</strong></li>
</ul>
<p>I double checked the table I was working on and realized it didnt have a primary key. It must have gotten dropped in the data migration from MS SQL 2000 to MS SQL 2008. A simple right click, set primary key and my problem was fixed.</p>
<p><a href="http://joshhighland.com/blog/wp-content/uploads/2010/02/setPrimaryKey.jpg"><img class="aligncenter size-full wp-image-1047" title="setPrimaryKey" src="http://joshhighland.com/blog/wp-content/uploads/2010/02/setPrimaryKey.jpg" alt="" width="328" height="300" /></a></p>
<p>Verify the primary keys! It&#8217;s a simple fix to a head breaker of a problem. I hope someone finds this and it fixes their issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2010/02/03/sql-server-2008-fixed-data-has-changed-since-the-results-pane-was-last-retrieved/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>follow up to my iPad predictions</title>
		<link>http://joshhighland.com/blog/2010/01/28/follow-up-to-my-ipad-predictions/</link>
		<comments>http://joshhighland.com/blog/2010/01/28/follow-up-to-my-ipad-predictions/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 07:35:30 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=1021</guid>
		<description><![CDATA[So Apple has announced the iPad. This is a follow up to the predictions  I posted last week. Things I was right about: Apple will announce a tablet device new version of the iPhone OS, 3.2.2 iPad will run on the iPhone OS iPad will run iPhone applications The iPad will have a 10 inch [...]]]></description>
			<content:encoded><![CDATA[<p>So Apple has announced the iPad. This is a follow up to <a href="http://joshhighland.com/blog/2010/01/21/iphone-os-4-0-islate-predictions/">the predictions  I posted last week</a>.</p>
<p><a href="http://joshhighland.com/blog/2010/01/28/follow-up-to-my-ipad-predictions/"><em>Click here to view the embedded video.</em></a></p>
<p><strong>Things I was right about:</strong></p>
<ul>
<li>Apple will announce a tablet device</li>
<li>new version of the iPhone OS, 3.2.2</li>
<li>iPad will run on the iPhone OS</li>
<li>iPad will run iPhone applications</li>
<li>The iPad will have a 10 inch screen (9.7 inches is close enough)</li>
<li>16, 32, 64 gig versions</li>
<li>Verizon will not be involved</li>
</ul>
<p><strong>Things I was wrong about:</strong></p>
<ul>
<li>There will be a new iPhone</li>
<li>The new iPhone will have a new camera. The iPad doesnt have any cameras!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2010/01/28/follow-up-to-my-ipad-predictions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone OS 4.0 / iSlate Predictions</title>
		<link>http://joshhighland.com/blog/2010/01/21/iphone-os-4-0-islate-predictions/</link>
		<comments>http://joshhighland.com/blog/2010/01/21/iphone-os-4-0-islate-predictions/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 07:15:08 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[iPhone 4.0]]></category>
		<category><![CDATA[iSlate]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=1005</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://joshhighland.com/blog/2010/01/21/iphone-os-4-0-islate-predictions/"><em>Click here to view the embedded video.</em></a></p>
]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2010/01/21/iphone-os-4-0-islate-predictions/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Create WordPress Thumbnails Automatically</title>
		<link>http://joshhighland.com/blog/2009/09/29/create-wordpress-thumbnails-automatically/</link>
		<comments>http://joshhighland.com/blog/2009/09/29/create-wordpress-thumbnails-automatically/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 00:19:29 +0000</pubDate>
		<dc:creator>Josh Highland</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[automatically]]></category>
		<category><![CDATA[custom fields]]></category>
		<category><![CDATA[premium theme]]></category>
		<category><![CDATA[thumbnail]]></category>
		<category><![CDATA[timthumb]]></category>

		<guid isPermaLink="false">http://joshhighland.com/blog/?p=887</guid>
		<description><![CDATA[WordPress has the ability to allow post authors to assign custom fields to a post. This arbitrary extra information is known as meta-data. This meta-data can be used by theme authors to do some pretty cool things. The theme I am currently using allows for a custom field named &#8220;thumb&#8221;. If you create the &#8220;thumb&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-890" title="create wordpress thumbnails automatically" src="http://joshhighland.com/blog/wp-content/uploads/2009/09/create-wordpress-thumbnails-300x300.jpg" alt="create wordpress thumbnails automatically" width="300" height="300" />WordPress has the ability to allow post authors to assign custom fields to a post. This arbitrary extra information is known as meta-data. This meta-data can be used by theme authors to do some pretty cool things.</p>
<p>The <a href="http://www.studiopress.com/themes/church">theme</a> I am currently using allows for a custom field named &#8220;thumb&#8221;. If you create the &#8220;thumb&#8221; custom field in a post and pass in the path to an image, for example &#8220;wp-content/uploads/2008/12/wordpress_logo.png&#8221;, a thumb nail version of the image will appear next the posts title on the home page of my blog. Awesome stuff.</p>
<p>When I discovered this theme and the &#8220;thumb&#8221; custom field, I already had 225 posts in my blog. I didn&#8217;t want to go back and manually create all the custom fields for the existing posts, so I wrote a PHP script to do it for me.</p>
<p>The PHP script cycles through your existing posts and looks for the first image in the post, and creates the thumb field based on it&#8217;s location. The script is configurable, your theme may want a different custom field name, like &#8220;thumbnail&#8221; or &#8220;image&#8221;.</p>
<p>This code is provided as is. If you aren&#8217;t a developer, you should be messing with stuff like this. Be sure to <a href="http://wordpress.org/extend/plugins/wp-db-backup/">back up your wordpress database</a> before running this.</p>
<p><strong>Instruction:<br />
</strong></p>
<ul>
<li>download this code</li>
<li>configure the database connection info and custom field name</li>
<li>upload this code onto your server</li>
<li>point your browser to the file</li>
<li>watch the script do it&#8217;s magic</li>
<li>remove the file from your server</li>
<li><a href="https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&amp;content_ID=marketing_us/send_money" target="_blank">donate $2 to my paypal account</a> (joshhighland@gmail.com)</li>
</ul>
<p><strong>Note:</strong> This is a one time deal, when you create new posts you will need to add the &#8220;thumb&#8221; field and image path manually</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//your database configuration information</span>
<span style="color: #000088;">$username</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;YOUR_USER_NAME&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;YOUR_PASSWORD&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$database</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;DATABASE&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$databaseLocation</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;localhost&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//name of the Custom Field to use</span>
<span style="color: #000088;">$customFieldName</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;thumb&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/******************* END CONFIGURATION *****************************/</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//get the wordpress posts to work with</span>
<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM wp_posts&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$mysqli</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$query</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">//loop over all the posts</span>
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$result</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetch_object</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">//get all the info from the post that we need to work with</span>
		<span style="color: #000088;">$cur_post_id</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$cur_post_content</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_content</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//the pattern to find the html image tag</span>
		<span style="color: #000088;">$pattern</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/]+src[\\s=\'&quot;]'</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$pattern</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'+([^&quot;\'&gt;\\s]+)/is'</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//try to match the pattern against the post content</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$pattern</span><span style="color: #339933;">,</span><span style="color: #000088;">$cur_post_content</span><span style="color: #339933;">,</span><span style="color: #000088;">$match</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">//break up the image path</span>
			<span style="color: #000088;">$pieces</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;wp-content/&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$match</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">//make sure the file name isnt empty</span>
			<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$pieces</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				<span style="color: #666666; font-style: italic;">//build the file path</span>
				<span style="color: #000088;">$imagePath</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;wp-content/&quot;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$pieces[1]</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
				<span style="color: #666666; font-style: italic;">//insert the custom field for the post</span>
				<span style="color: #000088;">$insertQuery</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;INSERT INTO wp_postmeta (post_id, meta_key, meta_value) VALUES (<span style="color: #006699; font-weight: bold;">$cur_post_id</span>, '<span style="color: #006699; font-weight: bold;">$customFieldName</span>', '<span style="color: #006699; font-weight: bold;">$imagePath</span>')&quot;</span><span style="color: #339933;">;</span>
&nbsp;
				<span style="color: #000088;">$mysqli</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$insertQuery</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
				<span style="color: #666666; font-style: italic;">//debugging stuff</span>
&nbsp;
				<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$mysqli</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">errno</span><span style="color: #009900;">&#41;</span>
				<span style="color: #009900;">&#123;</span>
					<span style="color: #990000;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;failed: <span style="color: #009933; font-weight: bold;">%s</span> <span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mysqli</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">error</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
				<span style="color: #b1b100;">else</span>
				<span style="color: #009900;">&#123;</span>
					<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;..... inserting <span style="color: #006699; font-weight: bold;">$imagePath</span> <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: #990000;">flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;---completed---&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://joshhighland.com/blog/2009/09/29/create-wordpress-thumbnails-automatically/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
