<?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>Blog</title>
	<atom:link href="http://blog.builtbyprime.com/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.builtbyprime.com</link>
	<description>Prime Studios</description>
	<lastBuildDate>Tue, 20 Dec 2011 00:02:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>301 Redirect for Expression Engine 2</title>
		<link>http://blog.builtbyprime.com/php/301-redirect-for-expression-engine-2</link>
		<comments>http://blog.builtbyprime.com/php/301-redirect-for-expression-engine-2#comments</comments>
		<pubDate>Wed, 09 Nov 2011 07:21:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.builtbyprime.com/?p=1812</guid>
		<description><![CDATA[A great plugin was written for Expression Engine 1.x by Nick Cernis called Redirect301, but it was lacking support for Expression Engine 2.x- so I coded the plugin starting from Nick&#8217;s base to support it, and made a couple small &#8230; <a href="http://blog.builtbyprime.com/php/301-redirect-for-expression-engine-2">Read more...</a>]]></description>
			<content:encoded><![CDATA[<p>A great plugin was written for Expression Engine 1.x by <a href="http://nickcernis.com/">Nick Cernis</a> called <a href="http://devot-ee.com/add-ons/redirect301">Redirect301</a>, but it was lacking support for Expression Engine 2.x- so I coded the plugin starting from Nick&#8217;s base to support it, and made a couple small changes along the way.</p>
<p>The most noticeable change is that you no longer include the <em>external</em> term inside the plugin. If your URL does not start with &#8220;http://&#8221; or &#8220;https://&#8221; the EE site&#8217;s URL is prepended to the given URL so redirects are not relative. This was how I wanted it in my particular site, because the URL is coming from a user input, which may be relative, or to an external site. The other change is that you can leave the URL empty, and the plugin will not do anything; this was for the case that it was an optional field in one of your channels.</p>
<pre class="brush: php; title: ;">
&lt;?php

$plugin_info = array(
  'pi_name' =&gt; 'Redirect 301',
  'pi_version' =&gt;'1.2',
  'pi_author' =&gt;'Nick Cernis, Matt Gaidica',
  'pi_author_url' =&gt; 'http://nickcernis.com/',
  'pi_description' =&gt; 'EE2 - Redirects to another page or site using the 301 header.',
  'pi_usage' =&gt; Redirect301::usage()
  );

class Redirect301
{

 	function Redirect301()
	{
		$this-&gt;EE =&amp; get_instance();
	    $url = $this-&gt;EE-&gt;TMPL-&gt;fetch_param('url');
	    $url =  trim(html_entity_decode($url));

	    if(!empty($url))
	    {
	    	$permanent = $this-&gt;EE-&gt;TMPL-&gt;fetch_param('permanent');
	    	$external = FALSE;
		    if(strpos($url, 'http://') === 0 || strpos($url, 'https://') === 0)
		    	$external = TRUE;

	    	// Get the site's base URL
			if (!$external)
			{
				$site_url = '';
				$site = ( ! $this-&gt;EE-&gt;TMPL-&gt;fetch_param('site')) ? '1' :  $this-&gt;EE-&gt;TMPL-&gt;fetch_param('site');
				if (is_numeric($site))
					$this-&gt;EE-&gt;db-&gt;select('site_system_preferences')-&gt;from('exp_sites')-&gt;where('site_id', $site);
				else
					$this-&gt;EE-&gt;db-&gt;select('site_system_preferences')-&gt;from('exp_sites')-&gt;where('site_name', $site);

				$query = $this-&gt;EE-&gt;db-&gt;get();

				if ($query-&gt;num_rows() &gt; 0)
				{
					$row = $query-&gt;row_array();
					$prefs = unserialize(base64_decode($row['site_system_preferences']));
					$site_url = $prefs['site_url'].$prefs['site_index'];
				}
			}

		    switch ($permanent)
		    {
			    case &quot;no&quot;:
					if ($external)
						Header( &quot;Location:&quot;.$url );
					else
						Header( &quot;Location:&quot;.$site_url.$url );
					exit();
				default:
		        	Header( &quot;HTTP/1.1 301 Moved Permanently&quot; );
					if ($external)
						Header( &quot;Location:&quot;.$url );
					else
						Header( &quot;Location:&quot;.$site_url.$url );
					exit();
		    }
	    }
	}

	// usage instructions
	function usage()
	{
		ob_start();
?&gt;
-------------------
HOW TO USE
-------------------
Redirect to the specified channel and template using the SEO-friendly 301 header:
{exp:redirect301 url=&quot;channel/template&quot;}

If your URL does not start with &quot;http://&quot; or &quot;https://&quot; the site's URL is prepended so redirects are not relative.

Redirect without the 301 header:
{exp:redirect301 url=&quot;channel/template&quot; permanent=&quot;no&quot;}

If you're using the Multiple Site Manager, simply specify the name or ID of your site, like this:
{exp:redirect301 url=&quot;channel/template&quot; site=&quot;site_short_name_or_id&quot;}

-----------------------------------------
SAMPLE REDIRECT TEMPLATE
-----------------------------------------
The redirect301 plugin can be used to create a short link to long post names. Here's how:

1) Create a template group called &quot;go&quot;
2) Edit the index file to include the following code:

{exp:channel:entries  limit=&quot;1&quot; entry_id=&quot;{segment_2}&quot; disable=&quot;member_data|trackbacks|pagination&quot;}
{exp:redirect301 url=&quot;{channel}/{url_title}&quot;}
{/exp:channel:entries}

This will take a URL such as http://yoursite.com/go/33/ and issue a 301 redirect to the full URL,
such as http://yoursite.com/articles/you-look-nice-today/

------------------------------
OPTIONAL ADDITIONS
------------------------------
To create a link within your posts that readers can share, simply append the post ID to the
short URL address, like this:

{exp:channel:entries}
&lt;a href=&quot;{site_url}go/{entry_id}/&quot;&gt;Short link to this page&lt;/a&gt;
{/exp:channel:entries}

Optionally, you can add the following code between your &lt;head&gt; tags to help spiders determine that
the content is the same. This is good practice but isn't required for the redirect to work.

{exp:channel:entries}
&lt;link rev=&quot;canonical&quot; rel=&quot;alternate shorter&quot; href=&quot;{site_url}go/{entry_id}&quot; /&gt;
{exp:channel:entries} 

&lt;?php
		$buffer = ob_get_contents();
		ob_end_clean();

		return $buffer;
	}
}
?&gt;
</pre>
<p>I left the documentation essentially the same. I use this plugin as an option in conjunction with the <a href="http://buildwithstructure.com/">Structure add-on</a> in Expression Engine 2. I setup a channel called &#8220;Redirect&#8221;, and assigned it as a &#8220;Page&#8221; inside of Structure; I also assigned it to a template I will share below.</p>
<p><img src="http://blog.builtbyprime.com/wp-content/uploads/Screen-shot-2011-11-09-at-2.13.19-AM.png" alt="" title="Screen shot 2011-11-09 at 2.13.19 AM" width="650" height="335" class="alignleft size-full wp-image-1813" /></p>
<p>There is a custom field called &#8220;redirect_url&#8221; for this channel, and here is the template it uses to actually make the redirect.</p>
<pre class="brush: php; title: ;">
{exp:channel:entries channel=&quot;redirect&quot; status=&quot;not closed&quot; limit=&quot;1&quot; disable=&quot;member_data|trackbacks|pagination&quot;}
	{if no_results}
		{redirect=&quot;site/index&quot;}
	{/if}

	{exp:redirect301 url=&quot;{redirect_url}&quot;}
{/exp:channel:entries}
</pre>
<p>I invested time into this because I wanted to remain using the Structure add-on as it is, but have the ability to do simple redirecting. This need is pretty common in my experience, and the .htaccess file is not one I want to client accessing. Also, if I can avoid turning on PHP in the template and junking it up with intermixed EE tags, I prefer it that way. Good luck with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.builtbyprime.com/php/301-redirect-for-expression-engine-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Quick Weather API with PHP</title>
		<link>http://blog.builtbyprime.com/php/a-quick-weather-api-with-php</link>
		<comments>http://blog.builtbyprime.com/php/a-quick-weather-api-with-php#comments</comments>
		<pubDate>Fri, 26 Aug 2011 16:45:07 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.builtbyprime.com/?p=1800</guid>
		<description><![CDATA[I wanted to add a small weather status to the top of a web application, just to remind me what was going on in that city. This is some really simple code, based off of WunderGround&#8217;s API, using a city &#8230; <a href="http://blog.builtbyprime.com/php/a-quick-weather-api-with-php">Read more...</a>]]></description>
			<content:encoded><![CDATA[<p>I wanted to add a small weather status to the top of a web application, just to remind me what was going on in that city. This is some really simple code, based off of <a href="http://wiki.wunderground.com/index.php/API_-_XML">WunderGround&#8217;s API</a>, using a city airport&#8217;s conditions. Not going into much detail on this, or offering a completely robust solution, but here is the code I have in place.</p>
<p><img src="http://blog.builtbyprime.com/wp-content/uploads/california_app.png" alt="" title="california_app" width="650" height="117" class="alignleft size-full wp-image-1804" /></p>
<pre class="brush: php; title: ;">
  $url = 'http://api.wunderground.com/auto/wui/geo/WXCurrentObXML/index.xml?query=KSFO';
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_TIMEOUT, 10);
  $data = curl_exec($ch);
  curl_close($ch);

  $xml = simplexml_load_string($data);

  $weather = $xml-&gt;weather;
  $temp = $xml-&gt;temp_f;
  $icon = $xml-&gt;icons-&gt;icon_set[9]-&gt;icon_url;
</pre>
<p>From this, you can set the three parsed variables into your html, and you are all set.</p>
<pre class="brush: xml; title: ;">
&lt;img src=&quot;&lt;?= $icon ?&gt;&quot;/&gt;
&lt;h3 style=&quot;margin-bottom:30px;&quot;&gt;It's currently &lt;?= $temp ?&gt;&amp;deg; and &lt;?= $weather ?&gt; in California.&lt;/h3&gt;
</pre>
<p>I am finding the call to take about 0.20s, which is acceptable to keep it all in PHP right now. Hope this helps in your quest.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.builtbyprime.com/php/a-quick-weather-api-with-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why I love the Nexus S (vs. iPhone 4)</title>
		<link>http://blog.builtbyprime.com/web/why-i-love-the-nexus-s-vs-iphone-4</link>
		<comments>http://blog.builtbyprime.com/web/why-i-love-the-nexus-s-vs-iphone-4#comments</comments>
		<pubDate>Sat, 07 May 2011 19:31:44 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://blog.builtbyprime.com/?p=1721</guid>
		<description><![CDATA[Google&#8217;s Nexus S (mfg. by Samsung) will officially come out for Sprint on May 8, and I was lucky to get mine a couple days early- all I can say so far, after coming from an iPhone, is that I &#8230; <a href="http://blog.builtbyprime.com/web/why-i-love-the-nexus-s-vs-iphone-4">Read more...</a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.flickr.com/photos/primestudios/5697097434/in/photostream"><img class="aligncenter" style="margin-bottom: 25px;" title="Nexus S and Apple iPhone" src="http://farm4.static.flickr.com/3595/5697097434_8e4e955240_z.jpg" alt="" width="640" height="450" /></a></p>
<p><a href="http://www.google.com/nexus/#/tech-specs">Google&#8217;s Nexus S</a> (mfg. by Samsung) will officially come out for Sprint on May 8, and I was lucky to get mine a couple days early- all I can say so far, after coming from an iPhone, is that I love this device. We decided that our shop had to diversify a bit, and because NFC was right up my electrical-engineering-alley, I hopped on the line with Sprint. My predispositions about Android were bad, we always made fun of our friends with Android-based phones because they were buggy and sluggish compared to the iPhone. However, these got broken with the Nexus S; I think the mixture of Google&#8217;s oversight, the 1GHz &#8220;Hummingbird&#8221; processor, and the latest release of Android (2.3) coined &#8220;Gingerbread&#8221; makes this snappy, and lets the features of Android shine.</p>
<p><span style="color:#ccc"><em>*Photographed with the case on, available from Sprint stores.</em></span></p>
<h3>From iPhone to Nexus S</h3>
<p><a href="http://www.flickr.com/photos/primestudios/5697096142/in/photostream"><img class="alignright" style="padding-bottom: 10px; padding-left: 15px; float: right;" title="Nexus S Settings" src="http://farm6.static.flickr.com/5185/5697096142_b924ca279a_m.jpg" alt="" width="216" height="211" /></a>I don&#8217;t think its fair to group the Nexus S into the same category as all Android devices, because it is right on par with the <a href="http://www.apple.com/iphone/specs.html">iPhone 4&#8242;s</a> touch sensitivity and reactiveness, which I don&#8217;t think can be said about any other little green robot devices right now. There is one thing that sums up my thoughts about these two devices after making the switch: <strong>All the standards and design rules on the iPhone make it very clean and organized, but also make it stale and less efficient for many tasks</strong>.</p>
<p>First of all, on the Nexus S you have 4 hardware &#8220;action&#8221; buttons instead of one, and I think this feature is really under-rated for how powerful it is. Putting all the inner-workings of Android and iOS aside, here are what these buttons open up:</p>
<ul>
<li>With the back button you have the control to &#8220;go back&#8221; to what you were doing last, which in most cases removes the need for a top or bottom bar in the browser and apps.</li>
<li>You can click the options button for more choices of what to do next, or application-specific settings.</li>
<li>The search button provides access to in-app searches (useful in contacts, Gmail, etc.)</li>
<li>The home button acts essentially the same as the home button on the iPhone.</li>
</ul>
<p>Not only do these features let you do things quicker on the Nexus S, but it also increases the screen real-estate in a many cases. The screen is already larger than the iPhones (4&#8243; vs. 3.5&#8243;), but the first thing I noticed when reading some CNN Mobile was that the story covered my whole screen (no bottom bar), which made it a much cleaner and immersive experience.</p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/primestudios/5696518905/in/photostream"><img class="aligncenter" style="margin-top: 25px;" title="Nexus S CNN Mobile" src="http://farm3.static.flickr.com/2555/5696518905_0be13c9f9f_z.jpg" alt="" width="640" height="444" /></a></p>
<h3>I Don&#8217;t Launch an App for Weather</h3>
<p>Another major feature I was a bit unsure about was this whole modular home screen thing; Windows has a pretty lack-luster integration of &#8220;widgets&#8221;, and I think thats why I was scared. However, after having this feature, it makes you realize how far behind Apple&#8217;s grid system is. Things that are important to me from my mobile: Twitter, Facebook, Weather, Calendar, and all my other apps. With the Android widgets I have the ability to make those my priorities, and instead of having to launch an app to browse tweets, or to see if I have meetings today, it is just a swipe away. You just can&#8217;t make certain things a &#8220;priority&#8221; in a square grid model- if Facebook is all I care about, then it can take up half my screen right when I turn on the phone, which is a powerful time saver.</p>
<h3>NFC and Hotspots.. Baby</h3>
<p><a href="http://www.flickr.com/photos/primestudios/5697097054/in/photostream/"><img class="alignleft" style="float:left;margin-bottom: 15px; margin-right: 15px;" title="Nexus S NFC Tags" src="http://farm4.static.flickr.com/3132/5697097054_7e899ded11.jpg" alt="" width="400" height="293" /></a>The entire controversy of &#8220;will NFC be big&#8221; has been put to rest in my book, <strong>NFC will change the mobile environment</strong>. I say this because we currently look at QR codes and SMS (text messaging) as a viable and useful way to trade information, and they are horribly time consuming and painful. If you haven&#8217;t experienced it yet, wait until you do the same thing by just passing your phone near another NFC device; its like &#8220;damn, that was easy&#8221;. I mean, imagine if every time you had to use your credit card you couldn&#8217;t swipe it, and you had to type in each number- thats the difference of NFC versus the current methods.</p>
<p>The Nexus S has a special &#8220;Tags&#8221; app which can read NFC tags that can contain text, web links, contact info, and much more. The Tags app also stores the tag information and allows you to bookmark your favorite tags. The last feature of the Tags app is pretty revolutionary, it allows you to turn your phone into an NFC tag, and transmit your choice of information. Say goodbye to apps like <a href="http://bu.mp">Bump</a>, with the Nexus S you can share everything a normal NFC tag can share, and even switch between an &#8220;active&#8221; tag, and ones you have created in the past. Last neat note, the biggest NFC tag manufacturer, NXP <a href="http://www.flickr.com/photos/primestudios/5697096656/in/photostream"><img class="alignright" style="padding-bottom: 10px; padding-left: 15px; padding-top:15px; float: right;" title="Nexus S Settings" src="http://farm3.static.flickr.com/2256/5697096656_f1e00a1b48_m.jpg" alt="" /></a> Semiconductors, has an app that allows you to read, write, and lock NFC tags, which makes this a &#8220;lab tool&#8221; for mobile dev&#8217;s like ourselves. Read what we have to say about <a href="http://blog.builtbyprime.com/business/high-tech-mobile-marketing-nfc-near-field-communication">NFC and mobile marketing</a>.</p>
<p>NFC is by far the coolest wireless feature on the Nexus S, but the other one to make mention of is the WiFi hotspots and tethering. I am actually typing this article from my phones wireless network, and it is using Sprint&#8217;s 3G network for all the data transfer (4G where available). I called Sprint and had them turn on the $30/mo feature, which they said I can cancel tomorrow and only pay for the day I used it ($1)- but so far, even at 3G speeds, it rocks. And yes, up to 4 of your friends can use the WiFi network too (Apple is reluctant to allow this). There is always the option to do USB tethering which may save some battery power.</p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/primestudios/5697095464/in/photostream"><img class="aligncenter" style="margin-top: 25px;" title="Nexus S" src="http://farm4.static.flickr.com/3330/5697095464_d6e0861f73_z.jpg" alt="" width="640" /></a></p>
<h3>Apps: Better or Worse</h3>
<p>I don&#8217;t think it is a secret that the iPhone paired with iOS makes the worlds most stable mobile device, but again, you run into the whole grid-based app layout, and top and bottom bar navigation. iPhone apps always &#8220;feel&#8221; like iPhone apps, however Android app&#8217;s seem to take on their own personality, which I have found to be great in most cases. The app&#8217;s have been pleasantly stable, nicely designed, and it is refreshing to have the entire screen to work with. This said, the worst thing about Android is the &#8220;App Market&#8221;- it looks like a third grader&#8217;s concept with an even worse implementation. This is where the Apple devices will beat the Nexus S and any Android devices, because they have a larger and more respected app community. However, both platforms have good apps, and both have crappy ones too, and in general all the major players like Facebook, Twitter, etc. have teams devoted to both.</p>
<h3>The Final Words</h3>
<p>I expect that I will run into some issues with the Nexus S, probably related to Android and particular bugs within third party apps, but as of right now, and as the title says, I love this phone. Here are just a few other side notes that I didn&#8217;t detail:</p>
<ul>
<li>The iPhone 4&#8242;s camera is a little better, but as a photographer, I want to get my photos right in the camera, so setting things like white balance, exposure, and having the option for black and white is great.</li>
<li>The web browser on the Nexus S still needs some work. The JavaScript handling falls short compared to the iPhone&#8217;s, which is becoming a huge component to the mobile web.</li>
<li>The power management widget is another example of how with one swipe and one tap I can turn off WiFi or Bluetooth, whereas the Apple method is pretty arduous.</li>
</ul>
<p>I am extremely happy that my Apple iOS shell was broken, it is kind of like seeing a forest through the trees- there are a lot of ways to make things happen on mobile, and Apple doesn&#8217;t have all the best ones right now. Will the iPhone 5 have better notifications, include NFC, and let me browse Twitter from my home screen? I hope so, because I love Apple, and want all the mobile companies to make things more usable and intuitive for everyone.</p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/primestudios/5696519351/in/photostream"><img class="aligncenter" style="margin-top: 25px;" title="Nexus S" src="http://farm3.static.flickr.com/2081/5696519351_e9bb7a1063_z.jpg" alt="" width="640" height="466" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.builtbyprime.com/web/why-i-love-the-nexus-s-vs-iphone-4/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>High Tech Mobile Marketing – NFC (Near Field Communication)</title>
		<link>http://blog.builtbyprime.com/business/high-tech-mobile-marketing-nfc-near-field-communication</link>
		<comments>http://blog.builtbyprime.com/business/high-tech-mobile-marketing-nfc-near-field-communication#comments</comments>
		<pubDate>Tue, 03 May 2011 15:29:22 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Business]]></category>

		<guid isPermaLink="false">http://blog.builtbyprime.com/?p=1631</guid>
		<description><![CDATA[What is NFC? For those who aren’t familiar with NFC (Near Field Communication), it is a growing wireless technology used for sharing data. NFC uses re-programmable tags that require no batteries or power source, they are simply powered by induction &#8230; <a href="http://blog.builtbyprime.com/business/high-tech-mobile-marketing-nfc-near-field-communication">Read more...</a>]]></description>
			<content:encoded><![CDATA[<h3>What is NFC?</h3>
<p><img class="size-medium wp-image-1665 alignright" style="float: right; padding-left: 20px; padding-bottom: 20px;" title="mobile-NFC-tags-examples" src="http://blog.builtbyprime.com/wp-content/uploads/mobile-NFC-tags-examples-300x229.jpg" alt="" width="300" height="229" />For those who aren’t familiar with NFC (Near Field Communication), it is a growing wireless technology used for sharing data. NFC uses re-programmable tags that require no batteries or power source, they are simply powered by <a href="http://en.wikipedia.org/wiki/Electromagnetic_induction">induction</a> when an NFC-enabled device gets near them. NFC tags are durable, they can be used behind glass or other non-metallic materials, and don’t require any ambient light or use of a camera to detect them.</p>
<p>Several cellular companies have already released phones with NFC capabilities. Google has produced the <a href="http://www.google.com/nexus/#">Google Nexus S</a>, a smartphone manufactured by Samsung. Samsung has also come out with the Star, Aliva, Player One, and Tocco Lite. Nokia in particular has made a commitment to incorporating NFC into all of their smart phones starting in 2011 (<a href="http://nokia-news.com/leading-mobile-operators-announce-their-commitment-to-nfc-technology/">Leading Mobile Operators announce their commitment to NFC Technology</a>), and has already released a compatible Nokia C7 model. Even though the technology hasn’t become a popular demand in phones, many companies believe that it will take off if people see its potential. Google has announced that it is abandoning QR codes and investing on NFC technology (<a href="http://www.ibtimes.com/articles/129307/20110331/google-qr-codes-nfc-google-places.htm">Google Kills QR Codes in Favor of NFC</a>).</p>
<h3>Day or Night, and Weather Resistant</h3>
<p>The idea is that instead of using a QR reader to scan a barcode, it would be quicker and easier if you could simply wave your phone next to a NFC tag to acquire information. This would allow people to get the same information without having to worry about it being too dark to scan a QR code and worrying about the weather, as NFC tags are weather resistant. The NFC-enabled cell phones also use a type of messaging system with the tags so that webpages can be prompted to open right as an NFC tag is in range.</p>
<h3>NFC Marketing and Applications</h3>
<p><img class="alignleft" style="padding-right: 20px; padding-bottom: 20px;float:left;" title="Google Nexus S with NFC" src="http://www.realgeek.com/press/files/2010/12/Google-Nexus-S-Price-India_thumb-11.jpg" alt="" width="210" height="175" />This technology holds potential for some very cool applications in the future. NFC tags could be used for tourists by applying them at “points of interest,” to create a virtual tour guide. Businesses could use a NFC tags to quickly direct someone with a smart phone to their website, or a specific marketing campaign. Imagine using these in a parking garage, you would be able to scan the NFC tag when you arrived, and when you were done it could use a mobile website to help lead you back to your car. The possibilities with NFC are truly endless, and 2011 will be there year we will either see these tags flourish, or left behind for something superior.</p>
<p>We believe the tipping point for NFC will be the support from Apple, and rumors continue to swirl that point to the iPhone 5 as being an NFC-enabled device. To see a list of the current phones that support NFC, visit <a href="http://www.nearfieldcommunicationsworld.com/nfc-phones-list/">A definitive list of NFC phones</a>.</p>
<p><strong>Also see:</strong></p>
<p><a href="http://blog.builtbyprime.com/business/high-tech-mobile-marketing-short-url%E2%80%99s">High Tech Mobile Marketing &#8211; Short URL&#8217;s</a></p>
<p><a href="http://blog.builtbyprime.com/business/high-tech-mobile-marketing-qr-codes">High Tech Mobile Marketing &#8211; QR Codes</a></p>
<p><br/></p>
<hr />
<span style="font-style: italic; color: #444;">Written by Joshua Bez, edited by Matt Gaidica</span><br />
Josh is an intern for Prime from Walled Lake Western High School. Josh has worked on many projects relating to mobile marketing, mobile websites, and has assisted in more advanced color theory and programming topics during his internship.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.builtbyprime.com/business/high-tech-mobile-marketing-nfc-near-field-communication/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>High Tech Mobile Marketing – QR Codes</title>
		<link>http://blog.builtbyprime.com/business/high-tech-mobile-marketing-qr-codes</link>
		<comments>http://blog.builtbyprime.com/business/high-tech-mobile-marketing-qr-codes#comments</comments>
		<pubDate>Mon, 02 May 2011 10:43:52 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Business]]></category>

		<guid isPermaLink="false">http://blog.builtbyprime.com/?p=1590</guid>
		<description><![CDATA[QR Code, 2D Barcode, Square Thing-a-ma-jig A QR (Quick Response) code is essentially a barcode used to encode information; commonly used for URL or prize codes. Popular uses for QR codes involve mobile phones that have a QR reader application &#8230; <a href="http://blog.builtbyprime.com/business/high-tech-mobile-marketing-qr-codes">Read more...</a>]]></description>
			<content:encoded><![CDATA[<h3>QR Code, 2D Barcode, Square Thing-a-ma-jig</h3>
<p>A QR (Quick Response) code is essentially a barcode used to encode information; commonly used for URL or prize codes. Popular uses for QR codes involve mobile phones that have a QR reader application that use the phone&#8217;s camera. They are two dimensional and similar to a standard barcode, yet they can hold more information and can be specially formed to launch a website on a mobile device.</p>
<p><img style="display:block;margin-left:auto;margin-right:auto;" src="http://blog.builtbyprime.com/wp-content/uploads/builtbyprime-qr-code.png" alt="" title="builtbyprime-qr-code" width="270" height="270" class="aligncenter size-full wp-image-1690" /></p>
<h3>Accepted in Asia, Coming to America</h3>
<p>At this point, QR codes are being integrated into many applications around us. However, Asia, and Japan in particular, who are often on the cutting edge of cell phone technology, currently offer many cell phones with a QR scanner pre-installed, whereas phones from the U.S. phones require an app. More over, Japan has already heavily integrated itself with with QR codes to the point that people use it in everyday life (<a href="http://blog.campaignasia.com/rohitdadwal/qr-codes-%E2%80%93-from-japan-to-the-us/">QR Codes – From Japan to the US</a>).</p>
<h3>QR Code Uses</h3>
<p><img style="float:right;margin-bottom:20px;margin-left:20px;" src="http://blog.builtbyprime.com/wp-content/uploads/pepsi-qr-1-150x150.jpg" alt="" title="pepsi-qr-1" width="150" height="150" class="alignleft size-thumbnail wp-image-1696" />Companies are often using QR codes as redemption codes; for example “scan this QR code to get a free song” was something I encountered on a Taco Bell drink. Other than that, QR codes can be a simple way to bring a potential costumer or user to a specific web link. They have been used by companies for treasure hunts, on business business cards, and put on objects for people to access blogs, portfolios, Facebook pages, and even tutorial videos.</p>
<p><strong>Also see:</strong></p>
<p><a href="http://blog.builtbyprime.com/business/high-tech-mobile-marketing-nfc-near-field-communication">High Tech Mobile Marketing &#8211; NFC (Near Field Communication)</a></p>
<p><a href="http://blog.builtbyprime.com/business/high-tech-mobile-marketing-short-url%E2%80%99s">High Tech Mobile Marketing &#8211; Short URL&#8217;s</a></p>
<p><br/></p>
<hr />
<span style="font-style: italic; color: #444;">Written by Joshua Bez, edited by Matt Gaidica</span><br />
Josh is an intern for Prime from Walled Lake Western High School. Josh has worked on many projects relating to mobile marketing, mobile websites, and has assisted in more advanced color theory and programming topics during his internship.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.builtbyprime.com/business/high-tech-mobile-marketing-qr-codes/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>High Tech Mobile Marketing – Short URL’s</title>
		<link>http://blog.builtbyprime.com/business/high-tech-mobile-marketing-short-url%e2%80%99s</link>
		<comments>http://blog.builtbyprime.com/business/high-tech-mobile-marketing-short-url%e2%80%99s#comments</comments>
		<pubDate>Mon, 02 May 2011 09:23:31 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Business]]></category>

		<guid isPermaLink="false">http://blog.builtbyprime.com/?p=1597</guid>
		<description><![CDATA[At some point you may have encountered bit.ly or tinyurl.com link, but weren’t sure as to what it was. Bit.ly and tinyurl.com are just a few of many free URL shortening services. URL shorteners will take a URL of any &#8230; <a href="http://blog.builtbyprime.com/business/high-tech-mobile-marketing-short-url%e2%80%99s">Read more...</a>]]></description>
			<content:encoded><![CDATA[<p>At some point you may have encountered <a href="http://bit.ly/">bit.ly</a> or <a href="http://tinyurl.com/">tinyurl.com</a> link, but weren’t sure as to what it was. Bit.ly and tinyurl.com are just a few of many free URL shortening services. URL shorteners will take a URL of any length and turn it into a short redirected link; perfect for overcoming the 140 character limit on twitter! Let’s check it out. </p>
<h3>An Example</h3>
<p>For example, we can shorten http://builtbyprime.com with the bit.ly service. I will go to bit.ly, enter in builtbyprime.com, and click “Shorten”. The shortened link, <a href="http://bit.ly/hNAMMd">http://bit.ly/hNAMMd</a>, pops up, and thats it! If you try clicking the link, you’ll be redirected to our website.</p>
<p><a href="http://blog.builtbyprime.com/wp-content/uploads/bitly-with-url2.jpg"><img src="http://blog.builtbyprime.com/wp-content/uploads/bitly-with-url2.jpg" alt="A new URL is formed which redirects to builtbyprime.com" title="bit.ly and builtbyprime" width="650" class="aligncenter size-full wp-image-1603" /></a></p>
<p>You can now send that link to anyone and it will work for them too. No matter how big a URL you use on bit.ly, it will always end up as http://bit.ly/_____ with six random digits at the end.</p>
<h3>Why to use Short URL&#8217;s for Mobile Marketing</h3>
<p>This service has proved itself very useful, particularly for phones. Entering in a long URL both time consuming and often results in errors. A URL shortener makes entering in URLs much more easier and convenient. Also, many URL shorteners offer simple analytics, so you can see how many people have visited the link.</p>
<h3>Words of Caution</h3>
<p>There are however a couple downsides to this type of service. If the URL shortener website you used were to suddenly shut down, all of the links it created would instantly stop working. Because the original URL is completely masked by the URL shortener, it can be easily abused to mask spam websites, virus websites, spyware websites, and many other websites that you didn’t want to get to. It is advisable that you only click shortened links given to you by trustworthy websites or people, and use a reliable service.</p>
<p><strong>Also see:</strong></p>
<p><a href="http://blog.builtbyprime.com/business/high-tech-mobile-marketing-nfc-near-field-communication">High Tech Mobile Marketing &#8211; NFC (Near Field Communication)</a></p>
<p><a href="http://blog.builtbyprime.com/business/high-tech-mobile-marketing-qr-codes">High Tech Mobile Marketing &#8211; QR Codes</a></p>
<p><br/></p>
<hr />
<span style="font-style: italic; color: #444;">Written by Joshua Bez, edited by Matt Gaidica</span><br />
Josh is an intern for Prime from Walled Lake Western High School. Josh has worked on many projects relating to mobile marketing, mobile websites, and has assisted in more advanced color theory and programming topics during his internship.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.builtbyprime.com/business/high-tech-mobile-marketing-short-url%e2%80%99s/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clearing CodeIgniter Form Validation Rules</title>
		<link>http://blog.builtbyprime.com/php/clearing-codeigniter-form-validation-rules</link>
		<comments>http://blog.builtbyprime.com/php/clearing-codeigniter-form-validation-rules#comments</comments>
		<pubDate>Tue, 22 Mar 2011 19:05:36 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.builtbyprime.com/?p=1568</guid>
		<description><![CDATA[We recently had a case where we created a huge form that had separate sections that we needed to validate, we call them &#8220;modules&#8221;. Our goal was to send all the form data to a single save function, and then &#8230; <a href="http://blog.builtbyprime.com/php/clearing-codeigniter-form-validation-rules">Read more...</a>]]></description>
			<content:encoded><![CDATA[<p>We recently had a case where we created a huge form that had separate sections that we needed to validate, we call them &#8220;modules&#8221;. Our goal was to send all the form data to a single save function, and then that function could call each form validation function for the included modules. We ran into a small problem with Code Igniter running multiple form validation functions; more specifically, if the first form validation function gave an error, that error would not be cleared in the second form validation function and so on. This meant that all our validation scripts would &#8220;carry over&#8221; their errors, which is no good.</p>
<p>Our fix was to clear all the variables used in the <a href="http://codeigniter.com/user_guide/libraries/form_validation.html">Code Igniter Form Validation Class</a>, which basically sends it back to an empty state. Here is an example:</p>
<pre class="brush: php; title: ;">
&lt;?php
  //we POST to this function from our form
  function save() {
    $modules = array(
      'patient_info',
      'patient_history'
    );

    $this-&gt;load-&gt;library('form_validation');
    $errors = array();
    foreach($modules as $module) {
      $function = 'save_'.$module;
      $errors = $this-&gt;$function();
      //reset form validation class
      $this-&gt;form_validation-&gt;_field_data = array();
  	  $this-&gt;form_validation-&gt;_config_rules = array();
  	  $this-&gt;form_validation-&gt;_error_array = array();
  	  $this-&gt;form_validation-&gt;_error_messages = array();
  	  $this-&gt;form_validation-&gt;error_string = '';
    }
    //do checks on $error array, return or echo accordingly
  }

  function save_patient_info() {
    $this-&gt;form_validation-&gt;set_rules('first_name','First Name','required|xss_clean|max_length[300]');
    $this-&gt;form_validation-&gt;set_rules('email','Email Address','required|xss_clean|max_length[300]|valid_email');
    if ($this-&gt;form_validation-&gt;run() != FALSE) {
      //do work
      return TRUE;
    } else {
      return validation_errors();
    }
  }

  function save_patient_history() {
    $this-&gt;form_validation-&gt;set_rules('last_visit_date','Last Visit Date','required');
    $this-&gt;form_validation-&gt;set_rules('tetanus_shot','Tetanu Shot in past 5 years','required');
    if ($this-&gt;form_validation-&gt;run() != FALSE) {
      //do work
      return TRUE;
    } else {
      return validation_errors();
    }
  }
?&gt;
</pre>
<p>Remember that your global $_POST variable will remain set throughout the entirety of the all the function calls, so each function will validate against it, as it should.  This saves you from having to making a massive validation function, which may break if a particular module wasn&#8217;t included on the form. This was an easy way we found, if you have a better one, we would love to hear about it!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.builtbyprime.com/php/clearing-codeigniter-form-validation-rules/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A GUIDE to Simple Code Igniter Models</title>
		<link>http://blog.builtbyprime.com/php/a-guide-to-generic-code-igniter-models</link>
		<comments>http://blog.builtbyprime.com/php/a-guide-to-generic-code-igniter-models#comments</comments>
		<pubDate>Thu, 17 Feb 2011 00:09:36 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.primestudiosllc.com/?p=1364</guid>
		<description><![CDATA[After a lot database code, you realize that the majority of your methods take on the same structure. For a while now, I have started all of our Code Igniter models with five generic methods to interact with the database, &#8230; <a href="http://blog.builtbyprime.com/php/a-guide-to-generic-code-igniter-models">Read more...</a>]]></description>
			<content:encoded><![CDATA[<p>After a lot database code, you realize that the majority of your methods take on the same structure. For a while now, I have started all of our <a href="http://codeigniter.com/">Code Igniter</a> models with five generic methods to interact with the database, and they usually cover a good amount of any basic application&#8217;s needs. I am going to flip the CRUD acronym on end and use my own: GUIDE- standing for Get, Update, Insert, Delete, and Explicit.</p>
<h3>5 Methods, 5 Lines</h3>
<p>Let&#8217;s start with the core of what we are talking about, and the five lines of code (methods) that spell out GUIDE.</p>
<pre class="brush: php; title: ;">
 function get($a,$b=array(),$c=0){$d=$this-&gt;db-&gt;get_where($a,$b);$e=$d-&gt;result_array();if($c)return $e[0];return $e;}

function update($a,$b=array(),$c){$this-&gt;db-&gt;update($a,$c,$b);return $this-&gt;db-&gt;affected_rows();}

function insert($a,$b){$this-&gt;db-&gt;insert($a,$b);return $this-&gt;db-&gt;insert_id();}

function delete($a,$b=array()){$this-&gt;db-&gt;delete($a,$b);return $this-&gt;db-&gt;affected_rows();}

function explicit($a){$b=$this-&gt;db-&gt;query($a);if(is_object($b))return $b-&gt;result_array();return $b;}
</pre>
<p>You notice we minified those methods, because if we are happy with them time after time, why should they take up pixel real-estate on our screens? Let&#8217;s start with the GET method, and examine it un-minified:</p>
<pre class="brush: php; title: ;">
function get($table,$where=array(),$single=FALSE) {
  $q = $this-&gt;db-&gt;get_where($table,$where);
  $result = $q-&gt;result_array();
  if($single) {
    return $result[0];
  }
  return $result;
}
</pre>
<p>The real only explanation is the <strong>$single</strong> option in the function. Suppose you know you will only be getting one result back, maybe you specify a user ID in the <strong>$where</strong> array (see examples below). If this option is evaluated as true, the returned data array will be a single dimension. Essentially, if you are going to run the result data through a loop, you want a multidimensional array; if you the result as a simple array, use the single option.</p>
<p>The next three methods, Insert, Update, and Delete, just provide direct access to Code Igniters already-established active record tools, with return values that might be helpful in our application. You can refer to their use on the <a target="_blank" href="http://codeigniter.com/user_guide/database/active_record.html">Code Igniter Active Record Class</a> page.</p>
<pre class="brush: php; title: ;">
function insert($table,$data) {
  $this-&gt;db-&gt;insert($table,$data);
  return $this-&gt;db-&gt;insert_id();
}

function update($table,$where=array(),$data) {
  $this-&gt;db-&gt;update($table,$data,$where);
  return $this-&gt;db-&gt;affected_rows();
}

function delete($table,$where=array()) {
  $this-&gt;db-&gt;delete($table,$where);
  return $this-&gt;db-&gt;affected_rows();
}
</pre>
<p>The final method is named Explicit, and is for explicit queries. The only added logic is detection of an object on the query result. If the result is an object, the function returns a result array, and otherwise, it returns the raw query result (likely a boolean-compatible value).</p>
<pre class="brush: php; title: ;">
function explicit($query) {
  $q = $this-&gt;db-&gt;query($query);
  if(is_object($q)) {
    return $q-&gt;result_array();
  } else {
    return $q;
  }
}
</pre>
<h3>Basic Usage</h3>
<p>If you are not that familiar with Code Igniter, remember that it uses a fairly strict MVC architecture when it comes to the separation of controllers and models. Because of this you will want to place these methods inside a file in your model&#8217;s folder, perhaps &#8220;fav_model.php&#8221;. From your controller, you would call these methods like this:</p>
<pre class="brush: php; title: ;">
//get all users in the users table
$users = $this-&gt;fav_model-&gt;get('users');

//get the user with an ID=5 from the users table, return a single array
$user = $this-&gt;fav_model-&gt;get('users',array('id'=&gt;5),TRUE);

//update the users table with new data for user with ID=5
$data = array(
  'middle_name'=&gt;'Henry',
  'birthday'=&gt;'946684800'
);
$affected_rows = $this-&gt;fav_model-&gt;update('users',array('id'=&gt;5),$data);

//insert new user into the users table
$data = array(
  'first_name'=&gt;'Matt',
  'last_name'=&gt;'Gaidica',
  'password'=&gt;md5('abc123')
  'created'=&gt;time()
);
$id = $this-&gt;fav_model-&gt;insert('users',$data);

//delete user ID=5 from table users
$affected_rows = $this-&gt;fav_model-&gt;delete('users',array('id'=&gt;5));

//get all the information about user with ID=5 from users table
$data = $this-&gt;fav_model-&gt;explicit('SELECT * FROM users WHERE id=5');
</pre>
<h3>Limitations and Bewares</h3>
<p>There are some instances where these methods will not work, and where they might be outright dangerous to use. Here is a short list of just some instances that come to mind:</p>
<ul>
<li><strong>Your table names might change.</strong> If you use the table name as a variable in your model, and then change the table name inside the database, you will have to redo all those calls in your controllers. The alternative is to create a new method in your model for every table you are manipulating, so if it changes, you only rewrite the table name once.</li>
<li><strong>You want to sort the data, or get really specific.</strong> Unless you are using the Explicit method, there is no ordering beyond the default database behavior, and no limits or offsets to the data returned. Well-planned queries are important when dealing with large data sets, or highly-efficient applications.</li>
<li><strong>You want readable model methods.</strong> Creating one-fits-all code is sometimes counter-productive, and while the end result may work, it is hard for other developers (or on-lookers) to understand. A scaleable application is written so it makes sense to you and your team, even a year after writing it.</li>
</ul>
<h3>Thats All Folks</h3>
<p>This is an easy breezy way to start out your model, and when things get more complicated, you can expand on the methods used in this GUIDE. Hope you learned something new, any questions or comments are welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.builtbyprime.com/php/a-guide-to-generic-code-igniter-models/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code Igniter Query Times: Explicit vs. Active Record</title>
		<link>http://bytesofpi.tumblr.com/post/14479351964/codeigniter-active-record-vs-explicit</link>
		<comments>http://bytesofpi.tumblr.com/post/14479351964/codeigniter-active-record-vs-explicit#comments</comments>
		<pubDate>Wed, 16 Feb 2011 01:59:36 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.builtbyprime.com/?p=1506</guid>
		<description><![CDATA[When dealing with frameworks, such as Code Igniter, there is always a question of what type of overhead it adds to application. One rainy day not too long ago we ran some really simple tests on the difference between active &#8230; <a href="http://bytesofpi.tumblr.com/post/14479351964/codeigniter-active-record-vs-explicit">Read more...</a>]]></description>
			<content:encoded><![CDATA[<p>When dealing with frameworks, such as <a href="http://codeigniter.com/">Code Igniter</a>, there is always a question of what type of overhead it adds to application. One rainy day not too long ago we ran some really simple tests on the difference between active record queries, and explicit queries in CI, and decided it might be nice to share the results. There is always the question of &#8220;is it faster&#8221;, and while our results show explicit SQL queries to be faster, database execution time is almost always negligible when compared to PHP run time, or page load speeds.</p>
<h3>The Setup</h3>
<p>We wanted to keep this test pretty bare-bones, so we could really nail down the overhead of just the active record processing. We loaded up a fresh copy of Code Igniter version 1.7.3, and created a typical controller-model relationship. Next, we created a simple timer using PHP&#8217;s <a href="http://php.net/manual/en/function.microtime.php">microtime()</a> function, and wrapped our calls in a for-loop, so it would repeat 1000 times. On each loop it logged the time difference of just the query itself, and at the end it exported to a .csv file so we could chart it up.</p>
<h3>GET Query Times</h3>
<p><img style="margin-top:15px;" src="http://blog.builtbyprime.com/wp-content/uploads/get_active_record.png" alt="" title="get_active_record" width="650" height="416" class="aligncenter size-full wp-image-1535" /></p>
<p><strong>Average Times (s)</strong><br />
Explicit Query: 0.000168<br />
Active Record Query: 0.000309<br />
<br/></p>
<h3>INSERT Query Times</h3>
<p><img style="margin-top:15px;" src="http://blog.builtbyprime.com/wp-content/uploads/insert_active_record.png" alt="" title="insert_active_record" width="650" height="416" class="aligncenter size-full wp-image-1535" /></p>
<p><strong>Average Times (s)</strong><br />
Explicit Query: 0.000161<br />
Active Record Query: 0.000259<br />
<br/></p>
<h3>UPDATE Query Times</h3>
<p><img style="margin-top:15px;" src="http://blog.builtbyprime.com/wp-content/uploads/update_active_record.png" alt="" title="update_active_record" width="650" height="416" class="aligncenter size-full wp-image-1535" /></p>
<p><strong>Average Times (s)</strong><br />
Explicit Query: 0.000172<br />
Active Record Query: 0.000321<br />
<br/></p>
<h3>DELETE Query Times</h3>
<p><img style="margin-top:15px;" src="http://blog.builtbyprime.com/wp-content/uploads/delete_active_record.png" alt="" title="delete_active_record" width="650" height="416" class="aligncenter size-full wp-image-1535" /></p>
<p><strong>Average Times (s)</strong><br />
Explicit Query: 0.000172<br />
Active Record Query: 0.000321<br />
<br/></p>
<h3>Conclusions</h3>
<p>As you might see, and as you might expect, there is a &#8220;significant&#8221; overhead using CI&#8217;s active record; however, I put that in quotations because the time scale we are looking at is so darn small. When you are building applications that require 10e-5 precision on your database queries, well, you probably aren&#8217;t a general-purpose, curious developer.</p>
<p><img style="margin-top:15px;" src="http://blog.builtbyprime.com/wp-content/uploads/average-query-times.png" alt="" title="average_query_times" width="650" height="416" class="aligncenter size-full wp-image-1535" /></p>
]]></content:encoded>
			<wfw:commentRss>http://bytesofpi.tumblr.com/post/14479351964/codeigniter-active-record-vs-explicit/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tiny PHP: A Fun PHP Minifier</title>
		<link>http://blog.builtbyprime.com/php/tiny-php-a-fun-php-minifier</link>
		<comments>http://blog.builtbyprime.com/php/tiny-php-a-fun-php-minifier#comments</comments>
		<pubDate>Wed, 16 Feb 2011 00:43:40 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.builtbyprime.com/?p=1519</guid>
		<description><![CDATA[Tiny PHP is a little tool we put into our labs that performs some &#8220;minification&#8221; on PHP code. Is it a trivial and completely academic exercise because PHP doesn&#8217;t benefit from being smaller like CSS or Javascript? Yes. But it&#8217;s &#8230; <a href="http://blog.builtbyprime.com/php/tiny-php-a-fun-php-minifier">Read more...</a>]]></description>
			<content:encoded><![CDATA[<p>Tiny PHP is a little tool we put into our labs that performs some &#8220;minification&#8221; on PHP code. Is it a trivial and completely academic exercise because PHP doesn&#8217;t benefit from being smaller like CSS or Javascript? Yes. But it&#8217;s still kind of cool.</p>
<h3>What it does</h3>
<p>In short, the goal is to take a snippet, function, or page of PHP and condense it. It will replace variables, remove comments, and/or remove whitespace. To call this tool an obfuscator is not really right, but it does make code harder to read. It also has some fancy options that allow you to exclude certain variables from being replaced so your classe&#8217;s calls don&#8217;t get mushed up.</p>
<h3>What it doesn&#8217;t do</h3>
<p>The Tiny PHP tool does not attempt to minify function names, class names, or any references related to those objects. Were not trying to take your entire app and make it stupidly hard to maintain, there are lots of other programs out there to do that.</p>
<h3>How we use it</h3>
<p>There is really no reason to use this type of tool in production code. If you are just messing around though, it is sometimes nice to take a set of methods or functions, and condense them into four or five lines, if their only purpose is to simply exist and never be edited. Also, if an application has spiraled into a mess of variables that have absolutely no meaning, there becomes no difference between them being long and annoying, or short and sweet.</p>
<p>Give it a try, let us know about any bugs.</p>
<p><a target="_blank" href='http://labs.builtbyprime.com/tinyphp/' class='button inline'><em class='inline'>Take Me to Tiny PHP</em></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.builtbyprime.com/php/tiny-php-a-fun-php-minifier/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

