<?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>Jeremy Massel&#039;s Blog</title>
	<atom:link href="http://masseltech.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://masseltech.com</link>
	<description>Because sometimes I have good ideas too</description>
	<lastBuildDate>Sat, 25 Feb 2012 02:02:39 +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>Developing in SproutCore with Mountain Lion</title>
		<link>http://masseltech.com/2012/02/developing-in-sproutcore-with-mountain-lion/</link>
		<comments>http://masseltech.com/2012/02/developing-in-sproutcore-with-mountain-lion/#comments</comments>
		<pubDate>Sat, 25 Feb 2012 00:24:07 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[SproutCore]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=263</guid>
		<description><![CDATA[So Apple released Mountain Lion, and everybody who cares on the interwebs knows that there is a shift with Xcode. (thanks MacRumors!) It&#8217;s now just an app like everything else. Cool. BUT, this hoses other stuff in a pretty awesome way. Including my ability to run SproutCore Server locally. I&#8217;m sure ideally I&#8217;d have two [...]]]></description>
			<content:encoded><![CDATA[<p>So Apple released Mountain Lion, and everybody who cares on the interwebs knows that there is a shift with Xcode. (thanks MacRumors!) It&#8217;s now just an app like everything else. Cool.</p>
<p>BUT, this hoses other stuff in a pretty awesome way. Including my ability to run SproutCore Server locally. I&#8217;m sure ideally I&#8217;d have two dev machines, one dedicated to Mountain Lion, but sadly that&#8217;s not economically feasible.</p>
<p>Thus: my workaround to get sc-server working and not display a &#8220;No Matching Target&#8221; error.  Its not pretty, and it may even be a terrible idea. But it worked for me. YMMV, don&#8217;t sue me if this wrecks your life.</p>
<ol>
<li>install sproutcore from the website</li>
<li>install xcode, and make sure you download the command line tools from developer.apple.com while you&#8217;re at it.</li>
<li>link /Developer to the xcode internal /Developer folder. I used:<br />
sudo ln -s /Applications/Xcode.app/Contents/Developer /Developer</li>
<li>cc is being looked for, but isn&#8217;t in that folder. I just linked it to gcc, because I was too lazy to find it. I cd&#8217;d into /Developer/usr/bin/ and did:<br />
sudo ln gcc cc</li>
<li>cd into your project and run sc-server. Should work!</li>
<li><strong>EDIT: make sure you install a Java Runtime if you plan to run sc-build. Otherwise your first one will fail</strong></li>
</ol>
<p>&nbsp;</p>
<p>This is pretty hacky, and I&#8217;m quite certain there&#8217;s a better way to do it that will leave things less broken for the future. But hopefully it saves SOMEONE a headache. Or maybe just me, once Apple releases Beta 2 and it wipes out my hard drive again. C&#8217;est la vie.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2012/02/developing-in-sproutcore-with-mountain-lion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drop-in jQuery placeholder fix</title>
		<link>http://masseltech.com/2011/02/drop-in-jquery-placeholder-fix/</link>
		<comments>http://masseltech.com/2011/02/drop-in-jquery-placeholder-fix/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 21:19:01 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=237</guid>
		<description><![CDATA[If you want to enable the &#8220;placeholder&#8221; attribute of input boxes in browsers that don&#8217;t support it, simply download this file, and include it anywhere on your page. It will copy the native functionality, and disable itself in browsers that already support the attribute. This file will require a reasonably new version of jQuery to [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to enable the &#8220;placeholder&#8221; attribute of input boxes in browsers that don&#8217;t support it, simply download this file, and include it anywhere on your page. It will copy the native functionality, and disable itself in browsers that already support the attribute.</p>
<p>This file will require a reasonably new version of jQuery to run correctly (and yes, it works in no-conflict mode).</p>
<p><a href="https://github.com/jkmassel/jQuery-Placeholder-Shim">jQuery.placeholder.1.0.1.min</a></p>
<p>Comments, questions? Feel free to comment.</p>
<p><strong>NOTE: This project has been moved into github</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2011/02/drop-in-jquery-placeholder-fix/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Required Reading for Creating and Deploying a WCF REST Service on IIS7</title>
		<link>http://masseltech.com/2010/11/required-reading-for-creating-and-deploying-a-wcf-rest-service-on-iis7/</link>
		<comments>http://masseltech.com/2010/11/required-reading-for-creating-and-deploying-a-wcf-rest-service-on-iis7/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 22:03:51 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[useful]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=230</guid>
		<description><![CDATA[Deploying a REST service with Windows Communication Foundation (WCF) is great, because it&#8217;s very powerful, but it can also be enormously frustrating. First of all, start by reading the whitepaper. http://msdn.microsoft.com/en-us/library/dd203052.aspx This will give you a great overview on how to construct your methods, and how to label them in order to have them exposed [...]]]></description>
			<content:encoded><![CDATA[<p>Deploying a REST service with Windows Communication Foundation (WCF) is great, because it&#8217;s very powerful, but it can also be enormously frustrating.</p>
<p>First of all, start by reading the whitepaper.<br />
<a href="http://msdn.microsoft.com/en-us/library/dd203052.aspx">http://msdn.microsoft.com/en-us/library/dd203052.aspx</a></p>
<p>This will give you a great overview on how to construct your methods, and how to label them in order to have them exposed correctly by REST.</p>
<p>Next, you need to create your web.config file. Use webhttpbinding for REST.</p>
<p>Lastly, deployment: </p>
<p><a href="http://blog.armgasys.com/?p=80">How to use https for WCF services in IIS7</a></p>
<p>
<a href="http://blogs.msdn.com/b/endpoint/archive/2008/08/22/rest-in-wcf-part-ix-controlling-the-uri.aspx">How to rewrite your URLs to get rid of the lame .svc extension</a></p>
<p>I am posting a small demo project, hopefully it&#8217;s useful to someone. Simply implement the API interface as you see fit, and the rest basically does itself. You&#8217;ll notice the web.config includes a SOAP binding for legacy Microsoft clients to use if they wish. </p>
<p> Link: <a href='http://masseltech.com/wp-content/uploads/2010/11/API_Template.zip'>API_Template</a></p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2010/11/required-reading-for-creating-and-deploying-a-wcf-rest-service-on-iis7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cinema Display Warping</title>
		<link>http://masseltech.com/2010/11/cinema-display-warping/</link>
		<comments>http://masseltech.com/2010/11/cinema-display-warping/#comments</comments>
		<pubDate>Mon, 08 Nov 2010 22:03:32 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=217</guid>
		<description><![CDATA[Ahh! My beautiful cinema display (just over a year old) is warping at the edge. I just noticed it this morning, I&#8217;m not sure how long it&#8217;s been like that, but once you see it, it really cannot be un-seen :( Anyone else know of this happening? A google search turned up only one post [...]]]></description>
			<content:encoded><![CDATA[<p>Ahh! My beautiful cinema display (just over a year old) is warping at the edge. I just noticed it this morning, I&#8217;m not sure how long it&#8217;s been like that, but once you see it, it really cannot be un-seen :(</p>
<p>Anyone else know of this happening? A google search turned up only one post </p>
<p> <a href="http://www.cartoonbarry.com/2010/10/my_apple_cinema_display_is_ben.html">http://www.cartoonbarry.com/2010/10/my_apple_cinema_display_is_ben.html</a>. </p>
<p>Hopefully I&#8217;m not the only one, but I guess I&#8217;ll hope it&#8217;s covered by applecare. I really love Apple&#8217;s products, but they seem to be having some issues with displays. I just got my laptop back after the heat caused the adhesive in the display to stop working, and it started to separate.<br />
<br />
pics to follow:</p>

<a href='http://masseltech.com/2010/11/cinema-display-warping/dsc_0273/' title='DSC_0273'><img width="150" height="150" src="http://masseltech.com/wp-content/uploads/2010/11/DSC_0273-150x150.jpg" class="attachment-thumbnail" alt="DSC_0273" title="DSC_0273" /></a>
<a href='http://masseltech.com/2010/11/cinema-display-warping/dsc_0274/' title='DSC_0274'><img width="150" height="150" src="http://masseltech.com/wp-content/uploads/2010/11/DSC_0274-150x150.jpg" class="attachment-thumbnail" alt="DSC_0274" title="DSC_0274" /></a>
<a href='http://masseltech.com/2010/11/cinema-display-warping/dsc_0275/' title='DSC_0275'><img width="150" height="150" src="http://masseltech.com/wp-content/uploads/2010/11/DSC_0275-150x150.jpg" class="attachment-thumbnail" alt="DSC_0275" title="DSC_0275" /></a>
<a href='http://masseltech.com/2010/11/cinema-display-warping/dsc_0276/' title='DSC_0276'><img width="150" height="150" src="http://masseltech.com/wp-content/uploads/2010/11/DSC_0276-150x150.jpg" class="attachment-thumbnail" alt="DSC_0276" title="DSC_0276" /></a>

]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2010/11/cinema-display-warping/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Select DataSet and number of total rows with one stored procedure</title>
		<link>http://masseltech.com/2010/08/select-dataset-and-number-of-total-rows-with-one-stored-procedure/</link>
		<comments>http://masseltech.com/2010/08/select-dataset-and-number-of-total-rows-with-one-stored-procedure/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 17:16:18 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[iPhone programming]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[useful]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=213</guid>
		<description><![CDATA[when you want to write a search using .net and MSSQL, it&#8217;s a pain. This is because you&#8217;re forced to select every row in the table and then only display a small subset of it. This works okay for tables that have a few hundred rows, as query caching can make this faster. But what [...]]]></description>
			<content:encoded><![CDATA[<p>when you want to write a search using .net and MSSQL, it&#8217;s a pain. This is because you&#8217;re forced to select every row in the table and then only display a small subset of it. This works okay for tables that have a few hundred rows, as query caching can make this faster. But what happens when you&#8217;re searching a table with half a million rows? </p>
<p>Unless you&#8217;re a complete masochist, you&#8217;re doing to want to split this into a more manageable data set, otherwise you&#8217;re gonna eat all the memory on your server. But this means that you can no longer use the DataSet.Tables[0].Rows.Count property to figure out how many rows you have. You can write a second stored procedure that&#8217;ll count the rows. But who wants to clog up their database with tons of stored procedures for no reason? Let&#8217;s consolidate it into one.</p>
<p>So what does this look like?</p>
<p>First: the stored procedure.</p>
<p>We&#8217;ll use output parameters to pass the row count back to our code</p>
<p><code><br />
create procedure [dbo].[Search]<br />
@searchText varchar(512), @recordsToReturn INT, @pageNumber INT, @numberofrows INT OUTPUT<br />
AS</p>
<p>-- get the page we want to view<br />
select * from<br />
(<br />
     select *,  ROW_NUMBER() OVER (ORDER BY creation_timestamp DESC) AS row from [table] where [table].columnName like '%' + @searchText + '%'<br />
)<br />
AS results WHERE row between (@pageNumber - 1) * @recordsToReturn + 1 and @pageNumber*@recordsToReturn;</p>
<p>-- get the total number of rows, not just the subset we want<br />
set @numberofrows = (select count(*)  from [table] where [table].columnName like '%' + @searchText + '%')</p>
<p>END</p>
<p></code></p>
<p>Now the C# (this&#8217;ll work in VB too, but feel free to convert it yourself)</p>
<p><code><br />
      SqlConnection conn = new SqlConnection();<br />
      conn.ConnectionString = ".....your connection string here.....";<br />
      conn.Open();</p>
<p>      DataSet returnData = new DataSet();</p>
<p>      SqlDataAdapter da = new SqlDataAdapter( "SearchMessages", conn);<br />
      da.SelectCommand.CommandType = CommandType.StoredProcedure;</p>
<p>      da.SelectCommand.Parameters.Add("@searchText", SqlDbType.VarChar).Value = "bob";<br />
      da.SelectCommand.Parameters.Add("@recordsToReturn", SqlDbType.Int).Value = 10;<br />
      da.SelectCommand.Parameters.Add("@pageNumber", SqlDbType.Int).Value = 1;</p>
<p>      //number of rows<br />
      SqlParameter outputParameter = new SqlParameter("@numberofrows", SqlDbType.Int, 2);<br />
      outputParameter.Direction = ParameterDirection.Output;  </p>
<p>      da.SelectCommand.Parameters.Add(outputParameter);</p>
<p>      da.Fill(returnData, "theData");</p>
<p>      int numberOfRowsInDataSet = (int)outputParameter.Value;</p>
<p>      da.Dispose();<br />
      conn.Close();<br />
</code></p>
<p>Best of luck! As always, leave a message in the comments if you have questions</p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2010/08/select-dataset-and-number-of-total-rows-with-one-stored-procedure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Duplicate Function</title>
		<link>http://masseltech.com/2010/07/mysql-duplicate-function/</link>
		<comments>http://masseltech.com/2010/07/mysql-duplicate-function/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 17:13:13 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[mySQL]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[mySql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[useful]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=208</guid>
		<description><![CDATA[Sometimes you want the ability to duplicate (clone) entities in mySQL. But duplicating their children can be a huge pain! Here&#8217;s how: /* parent table */ insert into [parent table] select 0, [field1, field2, field3] from [tablename] where [parent table primary key] = [parent table object ID] /* child table */ insert into [child table] [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you want the ability to duplicate (clone) entities in mySQL. But duplicating their children can be a huge pain! Here&#8217;s how:</p>
<p><code></p>
<p>/* parent table */<br />
insert into [parent table]<br />
select 0, [field1, field2, field3] from [tablename] where [parent table primary key] = [parent table object ID]</p>
<p>/* child table */<br />
insert into [child table]<br />
select 0, [field1, field2, field3], (select max([parent table primary key]) from [parent table]) from [child table] where [parent table primary key] = [parent table object ID]</p>
<p></code></p>
<p><strong>important note! </strong> make sure that you don&#8217;t select the primary key of the table. instead, select 0, and the auto_increment function will automatically figure out the correct primary key</p>
<p>As always, if you have questions, post em in the comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2010/07/mysql-duplicate-function/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress Multi Page Posts</title>
		<link>http://masseltech.com/2010/06/wordpress-multi-page-posts/</link>
		<comments>http://masseltech.com/2010/06/wordpress-multi-page-posts/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 16:57:51 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[useful]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=195</guid>
		<description><![CDATA[Use &#60;!--nextpage--&#62; to allow muti-page posts in WordPress]]></description>
			<content:encoded><![CDATA[<p>So, multi paged posts in WordPress. That would be a handy feature, right? </p>
<p>Well it turns out it&#8217;s been around since at least 2007. Just found out about it today though. &#8220;How do I use it?&#8221; you ask?</p>
<p>Simply put </p>
<p><code><br />
&lt;!--nextpage--&gt;<br />
</code></p>
<p>into your post. This tag acts as a page break. Done!</p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2010/06/wordpress-multi-page-posts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Batch Delete Performance SQL Server</title>
		<link>http://masseltech.com/2010/06/batch-delete-performance-sql-server/</link>
		<comments>http://masseltech.com/2010/06/batch-delete-performance-sql-server/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 17:38:32 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=187</guid>
		<description><![CDATA[Deleting old records from a table with > 3 000 00 rows. What&#8217;s the best way to do this? It seems the fastest way to do this is simply to: delete from [table] where creation_timestamp < dateadd (mm, -6, getdate()) (deleting anything older than 6 months) It took 3 hours (10916 seconds to be exact) [...]]]></description>
			<content:encoded><![CDATA[<p>Deleting old records from a table with > 3 000 00 rows. What&#8217;s the best way to do this? </p>
<p>It seems the fastest way to do this is simply to:<br />
<code><br />
delete from [table] where creation_timestamp < dateadd (mm, -6, getdate())<br />
</code><br />
(deleting anything older than 6 months)</p>
<p>It took 3 hours (10916 seconds to be exact) to delete 1.6 million (1,619,433) records this way. (148.35 / second).</p>
<p>We needed to do a second batch the next day, but wanted to split it into batches to try to get better performance.</p>
<p>Running: </p>
<p><code><br />
delete from [table] where pk_id in(<br />
select pk_id from (<br />
SELECT ROW_NUMBER() OVER (ORDER BY creation_timestamp desc) AS RowNumber, pk_id<br />
FROM [table]<br />
where creation_timestamp < '2009-12-16 13:52:08.673') _objectsToDelete<br />
WHERE RowNumber between 1 and 100000)<br />
</code></p>
<p>takes 12 minutes. (732 seconds) (136.61 / second).</p>
<p>Strangely, using the TOP command with a subquery takes the longest:</p>
<p><code><br />
delete from [table] where pk_id in (select TOP 100000 pk_id from [table] where creation_timestamp < '2009-12-16 13:52:08.673')<br />
</code></p>
<p>15 minutes (904 seconds) (110.61 / second)</p>
<p>Have a better way? Let me know in the comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2010/06/batch-delete-performance-sql-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>No lol&#8217;ing allowed</title>
		<link>http://masseltech.com/2010/05/no-loling-allowed/</link>
		<comments>http://masseltech.com/2010/05/no-loling-allowed/#comments</comments>
		<pubDate>Tue, 11 May 2010 20:37:57 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=180</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://masseltech.com/wp-content/uploads/2010/05/dont-lol.png"><img src="http://masseltech.com/wp-content/uploads/2010/05/dont-lol-300x187.png" alt="" title="don&#039;t lol" width="300" height="187" class="alignleft size-medium wp-image-181" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2010/05/no-loling-allowed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Xcode Fix Recent Projects Empty</title>
		<link>http://masseltech.com/2010/04/xcode-fix-recent-projects-empty/</link>
		<comments>http://masseltech.com/2010/04/xcode-fix-recent-projects-empty/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 23:30:57 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Objective C]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[iPhone programming]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[useful]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=177</guid>
		<description><![CDATA[Terminal Command: defaults write com.apple.Xcode NSRecentDocumentsLimit -int 10 Relaunch Xcode. Done.]]></description>
			<content:encoded><![CDATA[<p>Terminal Command:<br />
<code>defaults write com.apple.Xcode NSRecentDocumentsLimit -int 10</code></p>
<p>Relaunch Xcode. Done.</p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2010/04/xcode-fix-recent-projects-empty/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New Favourite Terminal Command</title>
		<link>http://masseltech.com/2010/03/new-favourite-terminal-command/</link>
		<comments>http://masseltech.com/2010/03/new-favourite-terminal-command/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 23:43:30 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[useful]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=171</guid>
		<description><![CDATA[Best command ever: sudo !! Tells the terminal to run the last command again, but to throw sudo in front of it. obligatory XKCD link: http://xkcd.com/149/]]></description>
			<content:encoded><![CDATA[<p>Best command ever: </p>
<p><code> sudo !! </code></p>
<p></p>
<p>Tells the terminal to run the last command again, but to throw sudo in front of it. </p>
<p>
obligatory XKCD link:<br />
<a href="http://xkcd.com/149/"><img alt="Sandwich" src="http://imgs.xkcd.com/comics/sandwich.png" title="Make me a sandwich" class="alignleft" width="360" height="299" /></a></p>
<p>http://xkcd.com/149/</p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2010/03/new-favourite-terminal-command/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pure PHP Pagination</title>
		<link>http://masseltech.com/2010/03/pure-php-pagination/</link>
		<comments>http://masseltech.com/2010/03/pure-php-pagination/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 04:37:45 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[useful]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=162</guid>
		<description><![CDATA[So, for a while I&#8217;ve been looking for a ridiculously simple way to paginate data stored in a table. And while I love PHP, it just doesn&#8217;t come with some of the free things I take for granted in .Net Today, while working on a pretty simple plugin, I wanted to add this functionality, and [...]]]></description>
			<content:encoded><![CDATA[<p>So, for a while I&#8217;ve been looking for a ridiculously simple way to paginate data stored in a table. And while I love PHP, it just doesn&#8217;t come with some of the free things I take for granted in .Net </p>
<p>Today, while working on a pretty simple plugin, I wanted to add this functionality, and I didn&#8217;t want to waste a bunch of time. I was given a link to this great script: <a href="http://www.warkensoft.com/2009/12/paginated-navigation-bar/">http://www.warkensoft.com/2009/12/paginated-navigation-bar/</a></p>
<p>It took me about a minute to implement the functionality. I then spent another 5 minutes doing CSS and that was it. Done. I&#8217;m not usually one for link sharing, but this made my life much easier. Hopefully it can make yours easier too. </p>
<p>The solution is pure PHP, no javascript required. Some day, I may try to expand upon this to include javascripty goodness, because that&#8217;s pretty much the only thing that could make it better</p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2010/03/pure-php-pagination/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.Net 301 Redirect</title>
		<link>http://masseltech.com/2010/03/asp-net-301-redirect/</link>
		<comments>http://masseltech.com/2010/03/asp-net-301-redirect/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 22:17:26 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[useful]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=157</guid>
		<description><![CDATA[&#60;script runat=&#34;server&#34;&#62; private void Page_Load(object sender, System.EventArgs e) { Response.Status = &#34;301 Moved Permanently&#34;; Response.AddHeader(&#34;Location&#34;,&#34;http://www.new-url.com&#34;); } &#60;/script&#62;]]></description>
			<content:encoded><![CDATA[<p><code><br />
&lt;script runat=&quot;server&quot;&gt;<br />
private void Page_Load(object sender, System.EventArgs e)<br />
{<br />
Response.Status = &quot;301 Moved Permanently&quot;;<br />
Response.AddHeader(&quot;Location&quot;,&quot;http://www.new-url.com&quot;);<br />
}<br />
&lt;/script&gt;<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2010/03/asp-net-301-redirect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysql command doesn&#8217;t work in OS X snow leopard</title>
		<link>http://masseltech.com/2010/01/mysql-command-doesnt-work-in-os-x-snow-leopard/</link>
		<comments>http://masseltech.com/2010/01/mysql-command-doesnt-work-in-os-x-snow-leopard/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 20:09:01 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mySql]]></category>
		<category><![CDATA[problems]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=155</guid>
		<description><![CDATA[So you install mySql on your mac, and it&#8217;s working great, but then you go into terminal to run a mysqldump or something, and it doesn&#8217;t work! you get a message something like: -bash: mysqldump: command not found so how do you fix this? well, copy and paste the following into your terminal window and [...]]]></description>
			<content:encoded><![CDATA[<p>So you install mySql on your mac, and it&#8217;s working great, but then you go into terminal to run a mysqldump or something, and it doesn&#8217;t work!</p>
<p>you get a message something like:<br />
<code><br />
-bash: mysqldump: command not found<br />
</code></p>
<p>so how do you fix this? well, copy and paste the following into your terminal window and press enter:<br />
<code><br />
echo export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH" >> ~/.profile</p>
<p>source ~/.profile<br />
</code></p>
<p>whoa, whoa, you say. what is this doing? It makes it so that when you type any command into the terminal, it does a check of these folders before giving you the &#8220;command not found&#8221; error. </p>
<p>If you want to undo it, you can always edit your .profile, or just delete it. </p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2010/01/mysql-command-doesnt-work-in-os-x-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>WordPress on Snow Leopard: Unable to Connect to Database</title>
		<link>http://masseltech.com/2010/01/wordpress-on-snow-leopard-unable-to-connect-to-database/</link>
		<comments>http://masseltech.com/2010/01/wordpress-on-snow-leopard-unable-to-connect-to-database/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 21:10:30 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[useful]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=134</guid>
		<description><![CDATA[If an &#8220;unable to connect to database&#8221; comes up while installing WordPress on a Snow Leopard machine, try adding :3306 to the end of the DB_HOST in wp-config.php Assuming everything else works, this should solve your problem!]]></description>
			<content:encoded><![CDATA[<p>If an &#8220;unable to connect to database&#8221; comes up while installing WordPress on a Snow Leopard machine, try adding :3306 to the end of the DB_HOST in wp-config.php</p>
<p>Assuming everything else works, this should solve your problem!</p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2010/01/wordpress-on-snow-leopard-unable-to-connect-to-database/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Run JavaScript function every n seconds</title>
		<link>http://masseltech.com/2010/01/run-javascript-function-every-n-seconds/</link>
		<comments>http://masseltech.com/2010/01/run-javascript-function-every-n-seconds/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 19:15:55 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[useful]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=132</guid>
		<description><![CDATA[//tell javascript to run a function in 1 second setTimeout ("myFunction()", 1000 ); function myFunction(){ //do stuff //once the function is finished, queue this function up to run again in 1 second setTimeout ( "myFunction()", 1000 ); }]]></description>
			<content:encoded><![CDATA[<p><code><br />
//tell javascript to run a function in 1 second<br />
setTimeout ("myFunction()", 1000 );</p>
<p>function myFunction(){<br />
        //do stuff</p>
<p>        //once the function is finished, queue this function up to run again in 1 second<br />
	setTimeout ( "myFunction()", 1000 );<br />
}</p>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2010/01/run-javascript-function-every-n-seconds/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New Car</title>
		<link>http://masseltech.com/2009/10/new-car/</link>
		<comments>http://masseltech.com/2009/10/new-car/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 18:08:40 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=126</guid>
		<description><![CDATA[Got a new 2010 Toyota Corolla! It is awesome.]]></description>
			<content:encoded><![CDATA[<p>Got a new 2010 Toyota Corolla! It is awesome.</p>

<a href='http://masseltech.com/2009/10/new-car/img_0267/' title='IMG_0267'><img width="150" height="150" src="http://masseltech.com/wp-content/uploads/2009/10/IMG_0267-150x150.jpg" class="attachment-thumbnail" alt="IMG_0267" title="IMG_0267" /></a>
<a href='http://masseltech.com/2009/10/new-car/img_0268/' title='IMG_0268'><img width="150" height="150" src="http://masseltech.com/wp-content/uploads/2009/10/IMG_0268-150x150.jpg" class="attachment-thumbnail" alt="IMG_0268" title="IMG_0268" /></a>
<a href='http://masseltech.com/2009/10/new-car/img_0269/' title='IMG_0269'><img width="150" height="150" src="http://masseltech.com/wp-content/uploads/2009/10/IMG_0269-150x150.jpg" class="attachment-thumbnail" alt="IMG_0269" title="IMG_0269" /></a>
<a href='http://masseltech.com/2009/10/new-car/img_0270/' title='IMG_0270'><img width="150" height="150" src="http://masseltech.com/wp-content/uploads/2009/10/IMG_0270-150x150.jpg" class="attachment-thumbnail" alt="IMG_0270" title="IMG_0270" /></a>

]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2009/10/new-car/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Get latitude and longitude of an address using google maps</title>
		<link>http://masseltech.com/2009/09/get-latitude-and-longitude-of-an-address-using-google-mapst/</link>
		<comments>http://masseltech.com/2009/09/get-latitude-and-longitude-of-an-address-using-google-mapst/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 04:33:51 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[useful]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=98</guid>
		<description><![CDATA[Google doesn&#8217;t make it easy to show you the latitude and longitude of an address you search in google maps, but there&#8217;s an easy way to get the info. go to google maps, type the address, and click search once you&#8217;ve found it, go to your address bar and clear what&#8217;s in it paste: javascript:void(prompt('',gApplication.getMap().getCenter())); [...]]]></description>
			<content:encoded><![CDATA[<p>Google doesn&#8217;t make it easy to show you the latitude and longitude of an address you search in google maps, but there&#8217;s an easy way to get the info.</p>
<ol>
<li>go to google maps, type the address, and click search</li>
<li>once you&#8217;ve found it, go to your address bar and clear what&#8217;s in it</li>
<li>paste: <code>javascript:void(prompt('',gApplication.getMap().getCenter()));</code> into the address bar</li>
<li>use the coordinates for whatever you wish!</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2009/09/get-latitude-and-longitude-of-an-address-using-google-mapst/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Humility</title>
		<link>http://masseltech.com/2009/08/humility/</link>
		<comments>http://masseltech.com/2009/08/humility/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 21:16:50 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=93</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://masseltech.com/wp-content/uploads/2009/08/Screen-shot-2009-08-18-at-3.15.51-PM.png"><img class="alignleft size-full wp-image-94" title="Screen shot 2009-08-18 at 3.15.51 PM" src="http://masseltech.com/wp-content/uploads/2009/08/Screen-shot-2009-08-18-at-3.15.51-PM.png" alt="Screen shot 2009-08-18 at 3.15.51 PM" width="473" height="141" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2009/08/humility/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>VirtualHostX and mod_rewrite</title>
		<link>http://masseltech.com/2009/08/virtualhostx-and-mod_rewrite/</link>
		<comments>http://masseltech.com/2009/08/virtualhostx-and-mod_rewrite/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 20:41:58 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[useful]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=91</guid>
		<description><![CDATA[To enable mod_rewrite manually, see: OS X server tips but if you are using VirtualHostX it changes your default config file. Add the following code to the Directives box: Options FollowSymLinks AllowOverride All AuthConfig Order deny,allow Deny from all if you&#8217;re using the new version of VirtualHostX, make sure that you select Directory from the [...]]]></description>
			<content:encoded><![CDATA[<p>To enable mod_rewrite manually, see: <a href="http://masseltech.com/2009/03/os-x-server-tips/">OS X server tips</a> but if you are using <a href="http://clickontyler.com/virtualhostx/">VirtualHostX</a> it changes your default config file. Add the following code to the Directives box:<br />
<code><br />
<Directory /><br />
    Options FollowSymLinks<br />
    AllowOverride All AuthConfig<br />
    Order deny,allow<br />
    Deny from all<br />
</Directory><br />
</code></p>
<p>if you&#8217;re using the new version of VirtualHostX, make sure that you select Directory from the dropdown, then use:<br />
<code><br />
<Directory /><br />
    Options FollowSymLinks<br />
    AllowOverride All AuthConfig<br />
</Directory><br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2009/08/virtualhostx-and-mod_rewrite/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Embedding Web Fonts: A cautionary tale</title>
		<link>http://masseltech.com/2009/07/embedding-web-fonts-a-cautionary-tale/</link>
		<comments>http://masseltech.com/2009/07/embedding-web-fonts-a-cautionary-tale/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 21:14:46 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=74</guid>
		<description><![CDATA[So for work, the designer says &#8220;Hey, can we use this font in the webpage&#8221; and like an idiot, I say &#8220;sure, why not?&#8221;. Well, FF and Safari don&#8217;t support .otf files (for whatever reason) So I download FontForge, open it in X11 (on my mac) and convert it to .ttf, which works great. Then [...]]]></description>
			<content:encoded><![CDATA[<p>So for work, the designer says &#8220;Hey, can we use this font in the webpage&#8221; and like an idiot, I say &#8220;sure, why not?&#8221;. Well, FF and Safari don&#8217;t support .otf files (for whatever reason) So I download FontForge, open it in X11 (on my mac) and convert it to .ttf, which works great.</p>
<p>Then I messed around in IE, trying to make it work, even downloading this tool:</p>
<p><a href="http://masseltech.com/wp-content/uploads/2009/07/Picture-31.png"><img class="alignnone size-thumbnail wp-image-76" title="Microsoft WEFT" src="http://masseltech.com/wp-content/uploads/2009/07/Picture-31-150x150.png" alt="Microsoft WEFT" width="150" height="150" /></a></p>
<p>Worst thing EVER. Don&#8217;t do this. Don&#8217;t get this. Don&#8217;t even look at this. You will feel violated if you use it.</p>
<p>So&#8230;how to embed an OTF font in a website (make sure you have a license to do so kids):</p>
<ol>
<li>Convert OTF file to .ttf (use fontForge)</li>
<li>Embed with @font-face</li>
<li>When adding the font to a style, in IE you <strong><em><span style="text-decoration: underline;">CAN NOT</span><span style="font-style: normal; font-weight: normal;"> call it by the name you gave it with the @font-face declaration. You have to call it by it&#8217;s name. So if the font&#8217;s name is myfontLTSTDBOLDITALICROMAN you have to do: body{ font-family: myfontLTSTDBOLDITALICROMAN; } Sucky? Very. Works? yes.</span></em></strong></li>
</ol>
<p>Have a nice day</p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2009/07/embedding-web-fonts-a-cautionary-tale/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress plugin DB access framework</title>
		<link>http://masseltech.com/2009/06/wordpress-plugin-db-access-framework/</link>
		<comments>http://masseltech.com/2009/06/wordpress-plugin-db-access-framework/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 20:23:12 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[useful]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=39</guid>
		<description><![CDATA[While designing a recent WordPress plug-in for TruthMedia that was designed to follow MVC, I had an awful lot of database work to do, and it needed to all be properly secured, which was a lot of work, and while making a rather large change to the way the database worked, I realized that writing [...]]]></description>
			<content:encoded><![CDATA[<p>While designing a recent WordPress plug-in for <a title="TruthMedia" href="http://www.truthmedia.com">TruthMedia</a> that was designed to follow MVC, I had an awful lot of database work to do, and it needed to all be properly secured, which was a lot of work, and while making a rather large change to the way the database worked, I realized that writing all the db code by hand was crazy inefficient.</p>
<p>So I wrote a class that you can extend with any model class of your own, and it will automatically have create, read, update, and delete functionality with no more work required. It also uses all of the WordPress security features to properly escape everything and prevent injection. Although, if you can crack it I&#8217;d love to hear from you!</p>
<p><a href="http://masseltech.com/wp-content/uploads/2009/06/wec_dbphp.zip">Click here to download!</a></p>
<p>This is how it works:</p>
<ol>
<li>Create a new class (ex. person)</li>
<li>Give that class instance variables (ID, FirstName, LastName, Address, PhoneNumber, PostalCode, HairColour&#8230;)</li>
<li>Make sure that you add accessor methods (getters and setters) for the ID (although it&#8217;s good practice to have them for all instance variables). Depending on your project, it may be a good idea to run stripslashes() on your string get functions so that they don&#8217;t show up with escaping. You may want to run WordPress&#8217; attribute_escape() on setters, however, again, depending on your set up this may be unnecessary.</li>
<li>Write your SQL code to create a table named (wordPress prefix)(plugin prefix)person (ex. wp_wec_person)</li>
<li>Make sure you call your primary Key personID **This is very important, without this, the system breaks down**</li>
<li>If you wish to store variables in this class, you can modify them to be private, and they won&#8217;t be written to the database</li>
</ol>
<p>In your class, extend the class name, so for example:</p>
<p><code>class person extends wec_db {</code></p>
<p><code>var $ID;</code></p>
<p><code>var $FirstName;</code></p>
<p><code>function __construct($id = null, $autoload = true){</code></p>
<p><code></p>
<p style="padding-left: 60px;">//If we are given an ID<br />
<span> if</span><span>(!</span><span>empty</span><span>(</span>$eventID<span>)){</span></p>
<p style="padding-left: 90px;"><span> $this</span><span>-&gt;</span>setID<span>(</span>$eventID<span>);</span></p>
<p style="padding-left: 90px;"><span><br />
if</span><span>(</span>$autoPopulate<span>){</span></p>
<p style="padding-left: 90px;">$this<span>-&gt;</span><span>read</span><span>();</span></p>
<p style="padding-left: 90px;">}</p>
<p style="padding-left: 30px;"><span> }</span></p>
<p>}</p>
<p>//getters and setters, and any other methods for this object</p>
<p></code></p>
<p><code>}</code></p>
<p><strong>Setup Note: </strong>to keep your plugin from stepping on the toes of others, make sure you change the prefix at the top of the class. Also, changing the name of the class to (plugin prefix)db (example:wec_db) will make sure that it doesn&#8217;t interfere with anyone else&#8217;s if they&#8217;re using this class!</p>
<p><strong>Usage: </strong></p>
<p><strong>Create / Add</strong></p>
<p style="padding-left: 30px;">$person = new person();</p>
<p style="padding-left: 30px;">$person-&gt;setFirstName(&#8216;Joe&#8217;);</p>
<p style="padding-left: 30px;">$person-&gt;setLastName(&#8216;Blow&#8217;);</p>
<p style="padding-left: 30px;">$person-&gt;add();</p>
<p><strong>Read</strong></p>
<p style="padding-left: 30px;">$person = new person($personID);</p>
<p><strong>Update</strong></p>
<p style="padding-left: 30px;">$person = new person($personID);</p>
<p>&#8211;or&#8211;</p>
<p style="padding-left: 30px;">$person = new person($personID, false);</p>
<p style="padding-left: 30px;">$person-&gt;setFirstName(&#8216;Jane&#8217;);</p>
<p style="padding-left: 30px;">$person-&gt;update();</p>
<p><strong>Delete</strong></p>
<p style="padding-left: 30px;">$person = new person($personID, false);</p>
<p style="padding-left: 30px;">$person-&gt;delete();</p>
<p>Post any questions in the comments! I&#8217;d love to hear from you!</p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2009/06/wordpress-plugin-db-access-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jealousy</title>
		<link>http://masseltech.com/2009/06/jealousy/</link>
		<comments>http://masseltech.com/2009/06/jealousy/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 21:42:53 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=36</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-37" title="picture-1" src="http://masseltech.com/wp-content/uploads/2009/06/picture-1.png" alt="picture-1" width="518" height="282" /></p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2009/06/jealousy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cause a field to be auto-focused when the page is done loading</title>
		<link>http://masseltech.com/2009/05/cause-a-field-to-be-auto-focused-when-the-page-is-done-loading/</link>
		<comments>http://masseltech.com/2009/05/cause-a-field-to-be-auto-focused-when-the-page-is-done-loading/#comments</comments>
		<pubDate>Wed, 06 May 2009 17:39:45 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[useful]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=31</guid>
		<description><![CDATA[So, wouldn&#8217;t it be user friendly, if when you went to a form page in a document, if the cursor was automagically positioned at the first field in the form? Why, yes it would. Try: Event.observe(window, 'load', function(){ try { $('eventName').focus(); } catch (e) {} }); after your &#60;/form&#62; tag. This requires the prototype javascript [...]]]></description>
			<content:encoded><![CDATA[<p>So, wouldn&#8217;t it be user friendly, if when you went to a form page in a document, if the cursor was automagically positioned at the first field in the form?</p>
<p>Why, yes it would. Try:</p>
<pre>

Event.observe(window, 'load', function(){
     try {
          $('eventName').focus();
     } 

     catch (e) {}
});
</pre>
<p><span>after your &lt;/form&gt; tag. </span> This requires the prototype javascript library</p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2009/05/cause-a-field-to-be-auto-focused-when-the-page-is-done-loading/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress inline field validation for plugins</title>
		<link>http://masseltech.com/2009/04/wordpress-inline-field-validation-for-plugins/</link>
		<comments>http://masseltech.com/2009/04/wordpress-inline-field-validation-for-plugins/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 01:17:36 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=29</guid>
		<description><![CDATA[On a recent plugin, I&#8217;ve been looking for a way to have powerful form field validation, while being really user-friendly. Using AJAX to do run a PHP server-side check from a form (to ensure that somebody can&#8217;t have duplicates) is the best way I&#8217;ve found. This is basically the same as what you&#8217;ll find on [...]]]></description>
			<content:encoded><![CDATA[<p>On a recent plugin, I&#8217;ve been looking for a way to have powerful form field validation, while being really user-friendly. Using AJAX to do run a PHP server-side check from a form (to ensure that somebody can&#8217;t have duplicates) is the best way I&#8217;ve found. This is basically the same as what you&#8217;ll find on the WordPress.org Codex, but shorter, and more specific for this application.</p>
<p>Code:</p>
<p>1. Add an action on the init() action to call the sack JS script (deals with AJAX in WP)</p>
<p><span><span> </span></span>wp_enqueue_script<span> </span><span>(</span><span> </span><span>&#8216;sack&#8217;</span><span> </span><span>);</span></p>
<p><span>2. Create an instance of the sack object, and create variables to pass into the PHP side.</span></p>
<p><span><span>function</span> doesCalendarExist<span>(</span>wpurl<span>,</span> <span>confirmationFieldName</span><span>,</span> calendarNameFieldID<span>,</span> submitButtonID<span>)</span> <span>{</span></p>
<p><span> </span><span>var</span> ajaxObject <span>=</span> <span>new</span> sack<span>(</span>wpurl <span>+</span> <span>&#8216;/wp-admin/admin-ajax.php&#8217;</span><span>);</span></p>
<p><span> </span></p>
<p><span> </span>ajaxObject<span>.</span>execute <span>=</span> <span>1</span><span>;</span></p>
<p><span> </span>ajaxObject<span>.</span>method <span>=</span> <span>&#8216;POST&#8217;</span><span>;</span></p>
<p><span><span> </span>ajaxObject</span><span>.</span><span>setVar</span><span>(</span><span> </span>&#8220;action&#8221;<span>,</span><span> </span>&#8220;doesCalendarExist&#8221;<span> </span><span>);</span></p>
<p><span> </span>ajaxObject<span>.</span>setVar<span>(</span> <span>&#8220;confirmationField&#8221;</span><span>,</span> confirmationFieldName<span>);</span></p>
<p><span> </span>ajaxObject<span>.</span>setVar<span>(</span> <span>&#8220;calendarName&#8221;</span><span>,</span> document<span>.</span>getElementById<span>(</span>calendarNameFieldID<span>).</span>value<span>);</span></p>
<p><span> </span>ajaxObject<span>.</span>setVar<span>(</span> <span>&#8220;submitButton&#8221;</span><span>,</span> submitButtonID<span>);</span></p>
<p><span> </span>ajaxObject<span>.</span>onError <span>=</span> <span>function</span><span>(){</span> alert<span>(</span><span>&#8216;Ajax error&#8217;</span><span>)};</span></p>
<p><span> </span></p>
<p><span> </span>ajaxObject<span>.</span>runAJAX<span>();</span></p>
<p><span> </span></p>
<p><span> </span></p>
<p><span><span> </span></span>return<span> </span><span>true</span><span>;</span><span><span> </span></span></p>
<p><span> </span></p>
<p>}</p>
<div>3. Create an input field that can call javascript functions to populate the data, and a span that will hold the error message</div>
<div>
<p><span>&lt;</span><span>input</span><span> </span><span>name</span><span>=</span><span>&#8220;calendarName&#8221;</span><span> </span><span>type</span><span>=</span><span>&#8220;text&#8221;</span><span> </span><span>id</span><span>=</span><span>&#8220;calendarName&#8221; </span><span> </span><span>onblur</span><span>=&#8221;doesCalendarExist</span><span>(</span>&#8216;<span>&lt;</span>?<span>ph</span>p <span>ech</span>o <span>bloginf</span>o(&#8216;<span>url</span>&#8216;); ?&gt;&#8217;<span>,</span><span> </span>&#8216;span1&#8242;<span>,</span><span> </span>&#8216;calendarName&#8217;<span>,</span><span> </span>&#8216;submitCalendarAdd&#8217;<span>);</span><span>&#8220;</span><span>/&gt;</span></p>
<p>&lt;<span>span</span><span> </span><span>id</span><span>=</span>&#8220;span1&#8243; class=&#8221;formError&#8221;&gt;&lt;/<span>span</span>&gt;<span><span> </span></span></p>
<p><span>4. Create a PHP function that will read the data passed from the ajaxObject. Die() statements will pass JavaScript back to the page. The dieString variable is super useful to be able to add lots of different DOM changes.</span></p>
<p><span><span>function</span><span> </span>wec_ajax_doesCalendarExist<span>(){</span></p>
<p><span> </span></p>
<p><span> </span></p>
<p><span><span> </span></span><span>$confirmationField</span><span> </span><span>=</span><span> </span><span>$_POST</span><span>[</span>'confirmationField'<span>];</span></p>
<p><span><span> </span></span><span>$calendarName</span><span> </span><span>=</span><span> </span><span>$_POST</span><span>[</span>'calendarName'<span>];</span></p>
<p><span><span> </span></span><span>$submitButton</span><span> </span><span>=</span><span> </span><span>$_POST</span><span>[</span>'submitButton'<span>];</span></p>
<p><span> </span></p>
<p><span> </span></p>
<p><span> </span></p>
<p><span><span> </span></span>$calendars<span> </span><span>=</span><span> </span>calendarDA<span>::</span>getAllcalendars<span>();</span></p>
<p><span><span> </span></span>$exists<span> </span><span>=</span><span> </span><span>false</span><span>;</span></p>
<p><span> </span></p>
<p><span> </span></p>
<p><span><span> </span></span><span>foreach</span><span>(</span>$calendars<span> </span><span>as</span><span> </span>$calendar<span>){</span></p>
<p><span><span> </span></span><span>if</span><span>(</span><span>strcasecmp</span><span>(</span>$calendar<span>[</span><span>'calendarName'</span><span>],</span><span> </span>$calendarName<span>)</span><span> </span><span>==</span><span> </span><span>0</span><span>){</span></p>
<p><span><span> </span></span>$exists<span> </span><span>=</span><span> </span><span>true</span><span>;</span></p>
<p><span> </span><span>}</span></p>
<p><span> </span><span>}</span></p>
<p><span> </span></p>
<p><span> </span></p>
<p><span><span> </span></span><span>if</span><span>(</span>$exists<span>){</span></p>
<p><span> </span></p>
<p><span><span> </span></span><span>$dieString</span><span> </span><span>=</span><span> </span>&#8220;document.getElementById(&#8216;&#8221;<span>.</span><span> </span><span>$confirmationField</span><span> </span><span>.</span>&#8220;&#8216;).innerHTML=&#8217;This calendar already exists!&#8217;;&#8221;<span>;</span></p>
<p><span><span> </span></span><span>$dieString</span><span> </span><span>.=</span><span> </span>&#8220;document.getElementById(&#8216;&#8221;<span>.</span><span> </span><span>$submitButton</span><span> </span><span>.</span>&#8220;&#8216;).disabled = true;&#8221;<span>;</span></p>
<p><span> </span></p>
<p><span><span> </span></span><span>die</span><span>(</span>$dieString<span>);</span></p>
<p><span> </span><span>}</span></p>
<p><span><span> </span></span>else<span>{</span></p>
<p><span> </span></p>
<p><span><span> </span></span><span>$dieString</span><span> </span><span>=</span><span> </span>&#8220;document.getElementById(&#8216;&#8221;<span>.</span><span> </span><span>$confirmationField</span><span> </span><span>.</span>&#8220;&#8216;).innerHTML=&#8221;;&#8221;<span>;</span></p>
<p><span><span> </span></span><span>$dieString</span><span> </span><span>.=</span><span> </span>&#8220;document.getElementById(&#8216;&#8221;<span>.</span><span> </span><span>$submitButton</span><span> </span><span>.</span>&#8220;&#8216;).disabled = false;&#8221;<span>;</span></p>
<p><span> </span></p>
<p><span><span> </span></span><span>die</span><span>(</span>$dieString<span>);</span></p>
<p><span> </span><span>}</span></p>
<p><span> </span><span>}</span></p>
<p><span>5. Add a WordPress Action to the init() that maps the sack action to the PHP function. you have to add &#8220;wp_ajax_&#8221; to the beginning of your action name from sack. the second argument is the name of your function that this action will call</span></p>
<p><span><span>add_action</span><span>(</span>&#8216;wp_ajax_doesCalendarExist&#8217;<span>,</span><span> </span>&#8216;wec_ajax_doesCalendarExist&#8217;<span> </span><span>);</span></p>
<p></span></p>
<p><span><br />
</span></p>
<p></span></p>
<p><span><br />
</span></div>
<p></span></p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2009/04/wordpress-inline-field-validation-for-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript example to do an auto-generated slug on a WordPress Plugin</title>
		<link>http://masseltech.com/2009/04/javascript_auto_generated_slug/</link>
		<comments>http://masseltech.com/2009/04/javascript_auto_generated_slug/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 00:46:48 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[internet]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=24</guid>
		<description><![CDATA[&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62; &#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&#62; &#60;head&#62; &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=UTF-8&#34; /&#62; &#60;title&#62;Untitled Document&#60;/title&#62; &#60;script type=&#34;text/javascript&#34;&#62; function duplicateField(field1, field2){ var theLength = document.getElementById(field1).value.length - 1; var theString = document.getElementById(field1).value; for(var i=0; i &#60; theString.length-1; i++){ if(theString.charAt(i) == &#34; &#34;){ theString = setCharAt(theString, i, &#34;_&#34;); } } document.getElementById(field2).style.color = &#34;#c9c9c9&#34;; document.getElementById(field2).value = [...]]]></description>
			<content:encoded><![CDATA[<p><code><br />
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;<br />
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;<br />
&lt;title&gt;Untitled Document&lt;/title&gt;<br />
&lt;script type=&quot;text/javascript&quot;&gt;<br />
function duplicateField(field1, field2){<br />
     var theLength = document.getElementById(field1).value.length - 1;<br />
     var theString = document.getElementById(field1).value;<br />
     for(var i=0; i &lt; theString.length-1; i++){<br />
if(theString.charAt(i) == &quot; &quot;){<br />
theString = setCharAt(theString, i, &quot;_&quot;);<br />
}<br />
}<br />
document.getElementById(field2).style.color = &quot;#c9c9c9&quot;;<br />
document.getElementById(field2).value = theString;<br />
}<br />
function setCharAt(str,index,chr) {<br />
if(index &gt; str.length-1) return str;<br />
return str.substr(0,index) + chr + str.substr(index+1);<br />
}<br />
function changeColorBack(fieldName){<br />
document.getElementById(fieldName).style.color = &quot;#000000&quot;;<br />
}<br />
&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;p&gt;<br />
&lt;input id=&quot;field1&quot; onkeyup=&quot;duplicateField('field1', 'field2');&quot; type=&quot;text&quot; /&gt;<br />
&lt;/p&gt;<br />
&lt;p&gt;&lt;br /&gt;<br />
&lt;input id=&quot;field2&quot; type=&quot;text&quot; onfocus=&quot;changeColorBack('field2');&quot; /&gt;&lt;br /&gt;<br />
&lt;/p&gt;<br />
&lt;p&gt;<br />
&lt;span id=&quot;span1&quot;&gt;&lt;/span&gt;<br />
&lt;input id=&quot;submitButton&quot; type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;<br />
&lt;/p&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2009/04/javascript_auto_generated_slug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using WP_Query in WordPress 2.7</title>
		<link>http://masseltech.com/2009/03/using-wp_query-in-wordpress-27/</link>
		<comments>http://masseltech.com/2009/03/using-wp_query-in-wordpress-27/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 03:47:44 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[useful]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=21</guid>
		<description><![CDATA[So I was trying for the last week or so to use three loops on a single page, to display categorized pages, and couldn&#8217;t figure out why it didn&#8217;t work. (I used the plugin page category plus to put pages in categories). Anyways, if you want pages to be shown in a categorical listing, use post_type=page [...]]]></description>
			<content:encoded><![CDATA[<p>So I was trying for the last week or so to use three loops on a single page, to display categorized pages, and couldn&#8217;t figure out why it didn&#8217;t work. (I used the plugin page category plus to put pages in categories).</p>
<p>Anyways, if you want pages to be shown in a categorical listing, use post_type=page in the query string. Otherwise it&#8217;ll only show posts by default, which didn&#8217;t happen in previous versions! Mine looked like this: <span>&lt;?</span><span>php</span><span> </span><span>$sportsQuery</span><span> </span><span>=</span><span> </span><span>new</span><span> </span><span>WP_Query</span><span>(</span>&#8216;category_name=Sports Pages&amp;post_type=page&#8217;<span>);</span><span> </span><span>?&gt;</span></p>
<p><span>//Loop goes here&#8230;</span></p>
<p>Hope this helps somebody. I know I&#8217;ll be coming back to it when I forget!</p>
<p>For more info see: <a href="http://codex.wordpress.org/Template_Tags/query_posts">http://codex.wordpress.org/Template_Tags/query_posts</a></p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2009/03/using-wp_query-in-wordpress-27/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to do multiple virtual hosts on OS X</title>
		<link>http://masseltech.com/2009/03/how-to-do-multiple-virtual-hosts-on-os-x/</link>
		<comments>http://masseltech.com/2009/03/how-to-do-multiple-virtual-hosts-on-os-x/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 03:19:47 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Hosting]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=16</guid>
		<description><![CDATA[Download and install VirtualHostX (don&#8217;t forget to back up your existing config!!) Download and install Gas Mask (manages multiple hosts files, dumb name though) If you want to do this with WordPress and you have a database locally and another one on a dev server somewhere, you can do the following code: if(eregi(&#8220;^mywebsitename.com$&#8221;, $_SERVER[HTTP_HOST])) { [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li>Download and install <a href="http://clickontyler.com/virtualhostx/">VirtualHostX</a> (don&#8217;t forget to back up your existing config!!)</li>
<li>Download and install <a style="text-decoration: none;" href="http://www.apple.com/downloads/macosx/development_tools/gasmask.html">Gas Mask</a> (manages multiple hosts files, dumb name though)</li>
<li>If you want to do this with WordPress and you have a database locally and another one on a dev server somewhere, you can do the following code:</li>
</ol>
<p><span>if</span><span>(</span><span>eregi</span><span>(</span>&#8220;^mywebsitename.com$&#8221;<span>,</span><span> </span><span>$_SERVER</span><span>[</span><span>HTTP_HOST</span><span>]))</span></p>
<p>{</p>
<p><span>define</span><span>(</span>&#8216;DB_NAME&#8217;<span>,</span><span> </span>&#8216;dbremotename&#8217;<span>);</span></p>
<p><span> </span></p>
<p><span><span> </span></span>/**<span> </span>MySQL<span> </span>database<span> </span>username<span> </span>*/</p>
<p><span><span> </span></span><span>define</span><span>(</span>&#8216;DB_USER&#8217;<span>,</span><span> </span>&#8216;dbremoteuser&#8217;<span>);</span></p>
<p><span> </span></p>
<p><span><span> </span></span>/**<span> </span>MySQL<span> </span>database<span> </span>password<span> </span>*/</p>
<p><span><span> </span></span><span>define</span><span>(</span>&#8216;DB_PASSWORD&#8217;<span>,</span><span> </span>&#8216;dbremotepassword&#8217;<span>);</span></p>
<p><span> </span></p>
<p><span><span> </span></span>/**<span> </span>MySQL<span> </span>hostname<span> </span>*/</p>
<p><span><span> </span></span><span>define</span><span>(</span>&#8216;DB_HOST&#8217;<span>,</span><span> </span>&#8216;dbremotehost&#8217;<span>);</span></p>
<p><span> </span></p>
<p><span><span> </span></span><span>define</span><span>(</span>&#8216;WP_SITEURL&#8217;<span>,</span><span> </span>&#8216;http://mywebsitename.com&#8217;<span>);</span></p>
<p><span><span> </span></span><span>define</span><span>(</span>&#8216;WP_HOME&#8217;<span>,</span><span> </span>&#8216;http://mywebsitename.com&#8217;<span>);</span></p>
<p><span>}</span></p>
<p><span>else{</span></p>
<p><span><span>define</span><span>(</span>&#8216;DB_NAME&#8217;<span>,</span><span> </span>&#8216;dbremotename&#8217;<span>);</span></span></p>
<p>/**<span> </span>MySQL<span> </span>database<span> </span>username<span> </span>*/</p>
<p><span>define</span><span>(</span>&#8216;DB_USER&#8217;<span>,</span><span> </span>&#8216;dblocaluser&#8217;<span>);</span></p>
<p>/**<span> </span>MySQL<span> </span>database<span> </span>password<span> </span>*/</p>
<p><span>define</span><span>(</span>&#8216;DB_PASSWORD&#8217;<span>,</span><span> </span>&#8216;dblocalpassword&#8217;<span>);</span></p>
<p>/**<span> </span>MySQL<span> </span>hostname<span> </span>*/</p>
<p><span>define</span><span>(</span>&#8216;DB_HOST&#8217;<span>,</span><span> </span>&#8216;dblocalhost&#8217;<span>);</span></p>
<p><span>define</span><span>(</span>&#8216;WP_SITEURL&#8217;<span>,</span><span> </span>&#8216;http://mywebsitename.com&#8217;<span>);</span></p>
<p><span>define</span><span>(</span>&#8216;WP_HOME&#8217;<span>,</span><span> </span>&#8216;http://mywebsitename.com&#8217;<span>);</span></p>
<p><span>}</span></p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2009/03/how-to-do-multiple-virtual-hosts-on-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HTML Special Characters</title>
		<link>http://masseltech.com/2009/03/10/</link>
		<comments>http://masseltech.com/2009/03/10/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 03:01:25 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[useful]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=10</guid>
		<description><![CDATA[Any good web designer knows certain characters have to be encoded in HTML. Here&#8217;s a list of pretty much every character and it&#8217;s encoding: http://webdesign.about.com/library/bl_htmlcodes.htm Bonus: Need to use some encoded characters in your PHP script? Use html_entity_decode() to turn them into regular text.]]></description>
			<content:encoded><![CDATA[<p>Any good web designer knows certain characters have to be encoded in HTML.</p>
<p>Here&#8217;s a list of pretty much every character and it&#8217;s encoding: <a href="http://webdesign.about.com/library/bl_htmlcodes.htm">http://webdesign.about.com/library/bl_htmlcodes.htm</a></p>
<p><strong>Bonus:</strong> Need to use some encoded characters in your PHP script? Use html_entity_decode() to turn them into regular text.</p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2009/03/10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OS X Server Tips</title>
		<link>http://masseltech.com/2009/03/os-x-server-tips/</link>
		<comments>http://masseltech.com/2009/03/os-x-server-tips/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 02:57:45 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Hosting]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=7</guid>
		<description><![CDATA[To enable PHP: nano /etc/apache2/httpd.conf uncomment LoadModule php5_module&#8230; To enable mod_rewrite In the primary site configuration, change AllowOverride to AllowOverride All AuthConfig Restart apache with sudo apachectl restart]]></description>
			<content:encoded><![CDATA[<p>To enable PHP:</p>
<ul>
<li>nano /etc/apache2/httpd.conf</li>
<li>uncomment LoadModule php5_module&#8230;</li>
</ul>
<p>To enable mod_rewrite</p>
<ul>
<li>In the primary site configuration, change AllowOverride to AllowOverride All AuthConfig</li>
<li>Restart apache with sudo apachectl restart</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2009/03/os-x-server-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recursive FTP</title>
		<link>http://masseltech.com/2009/02/recursive-ftp/</link>
		<comments>http://masseltech.com/2009/02/recursive-ftp/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 03:51:09 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[useful]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://masseltech.com/2009/02/recursive-ftp/</guid>
		<description><![CDATA[Fun thing I found today: how to copy a whole pile of files/folders over from one place to another using ftp. Especially useful on two remote computers in terminal when security isn&#8217;t a concern! wget -r ftp://username: password@domainname]]></description>
			<content:encoded><![CDATA[<p>Fun thing I found today: how to copy a whole pile of files/folders over from one place to another using ftp. Especially useful on two remote computers in terminal when security isn&#8217;t a concern!<br />
wget -r ftp://username: password@domainname</p>
]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/2009/02/recursive-ftp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Old iPhone</title>
		<link>http://masseltech.com/1988/06/old-iphone/</link>
		<comments>http://masseltech.com/1988/06/old-iphone/#comments</comments>
		<pubDate>Wed, 29 Jun 1988 21:19:33 +0000</pubDate>
		<dc:creator>jeremy.massel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://masseltech.com/?p=200</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[
<a href='http://masseltech.com/1988/06/old-iphone/photo-1/' title='photo 1'><img width="150" height="150" src="http://masseltech.com/wp-content/uploads/2010/06/photo-1-150x150.jpg" class="attachment-thumbnail" alt="photo 1" title="photo 1" /></a>
<a href='http://masseltech.com/1988/06/old-iphone/photo-2/' title='photo 2'><img width="150" height="150" src="http://masseltech.com/wp-content/uploads/2010/06/photo-2-150x150.jpg" class="attachment-thumbnail" alt="photo 2" title="photo 2" /></a>
<a href='http://masseltech.com/1988/06/old-iphone/photo-3/' title='photo 3'><img width="150" height="150" src="http://masseltech.com/wp-content/uploads/2010/06/photo-3-150x150.jpg" class="attachment-thumbnail" alt="photo 3" title="photo 3" /></a>

]]></content:encoded>
			<wfw:commentRss>http://masseltech.com/1988/06/old-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: masseltech.com @ 2012-05-18 17:29:47 -->
