<?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>Zac Vineyard's Blog</title>
	<atom:link href="http://zacvineyard.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://zacvineyard.com/blog</link>
	<description>code, design, videos, and other nonsense</description>
	<lastBuildDate>Fri, 03 Feb 2012 05:46:50 +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>Review: PhoneGap Beginner&#8217;s Guide (Packt Publishing) by Andrew Lunny</title>
		<link>http://zacvineyard.com/blog/2012/02/02/review-phonegap-beginners-guide-packt-publishing-by-andrew-lunny/</link>
		<comments>http://zacvineyard.com/blog/2012/02/02/review-phonegap-beginners-guide-packt-publishing-by-andrew-lunny/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 05:39:13 +0000</pubDate>
		<dc:creator>Zac</dc:creator>
				<category><![CDATA[PhoneGap]]></category>

		<guid isPermaLink="false">http://zacvineyard.com/blog/?p=583</guid>
		<description><![CDATA[<em>PhoneGap Beginner's Guide</em> is the most informative source of information I've seen/read about PhoneGap. It is a great resource for learning all the nuances that go into making native PhoneGap applications on mobile devices. If you are looking to use PhoneGap, it would be a good idea to start with this book. It really is a comprehensive yet easy-to-read book on using PhoneGap.]]></description>
			<content:encoded><![CDATA[<p><a href="http://zacvineyard.com/blog/wp-content/uploads/2012/02/pgbg_cover.png"><img class="alignright size-medium wp-image-595" title="pgbg_cover" src="http://zacvineyard.com/blog/wp-content/uploads/2012/02/pgbg_cover-235x300.png" alt="" width="235" height="300" /></a>Language: English<br />
Paperback: 328 pages [ 235mm x 191mm ]<br />
Release Date: September 2011<br />
ISBN: 1849515360<br />
ISBN 13: 978-1-84951-536-8<br />
Author: Andrew Lunny</p>
<p>I often find myself buying a book about a programming when I need to learn something substantial to conquer a problem. Because I am a web developer, when it came to building native mobile apps (Andorid and iOS), I looked for the path of least resistance and started learning, as an alternative to learning Java and/or Objective C, about PhoneGap. My story in learning how to use PhoneGap was troublesome. It was a tangled mess of trial-and-error methodology and questions like &#8220;Why isn&#8217;t this working?&#8221; spoken aloud to my computer at night. Having a book like <em>PhoneGap Beginner&#8217;s Guide</em> from Packt Publishing would have been a big help in learning PhoneGap for the following reasons:</p>
<h2>1. Life is short, man</h2>
<p><em>PhoneGap Beginner&#8217;s Guide</em> gets to the heart of mobile development by showing you how to install the Android, iOS, and Blackberry SDKs. This gets you on the road to building an app quickly. I spent a lot of time just getting Eclipse up and running to build an Android project. One of the great benefits of PhoneGap is that it integrates seamlessly with the iOS, and other, SDKs. Because of this, this guide gets you building a project in no time.</p>
<h2>2. Andrew writes to make friends</h2>
<p>Andrew Lunny&#8217;s light tone throughout the book keeps you interested. Take this for example: &#8220;A confession—you don&#8217;t want to set the width and height of your only top-level element, as<br />
we have done.&#8221; Not only is this fun and quirky, but it helps you learn the nuances of PhoneGap. And, if you have any geek-to-geek sensibility, you&#8217;d probably laugh out loud at that phrase.</p>
<h2>3. Yay, WebKit!</h2>
<p>Initially building and debugging a PhoneGap project in a WebKit browser is recommended in this book. This is a good advantage for all you Google Chrome users out there.</p>
<h2>4. HTML5 for Native Phone Apps</h2>
<p>Andrew is very good at leading users into the new frontier of developing native phone apps using HTML5. At some point, app developers will need a database, making the HTML5 LocalStorage API a natural fit. Andrew thoroughly explains how you tap into many of the new features in HTML5, like LocalStorage, for your app.</p>
<h2>5. All the details are here</h2>
<p><em>PhoneGap Beginner&#8217;s Guide</em> is the most informative source of information I&#8217;ve seen/read about PhoneGap. It is a great resource for learning all the nuances that go into making native PhoneGap applications on mobile devices. If you are looking to use PhoneGap, it would be a good idea to start with this book. It really is a comprehensive yet easy-to-read book on using PhoneGap.</p>
]]></content:encoded>
			<wfw:commentRss>http://zacvineyard.com/blog/2012/02/02/review-phonegap-beginners-guide-packt-publishing-by-andrew-lunny/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Post Data to a Remote Server (Cross-domain) with jQuery in PhoneGap</title>
		<link>http://zacvineyard.com/blog/2011/06/19/post-data-to-a-remote-server-cross-domain-with-jquery-in-phonegap/</link>
		<comments>http://zacvineyard.com/blog/2011/06/19/post-data-to-a-remote-server-cross-domain-with-jquery-in-phonegap/#comments</comments>
		<pubDate>Sun, 19 Jun 2011 19:21:29 +0000</pubDate>
		<dc:creator>Zac</dc:creator>
				<category><![CDATA[PhoneGap]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://zacvineyard.com/blog/?p=510</guid>
		<description><![CDATA[Android and iPhone apps built with PhoneGap are (because of PhoneGap's nature) compiled code, and because this compiled code is not a browser, you can execute cross-domain requests. In this short tutorial, I'll provide some sample code for sending a POST request to a remote server.]]></description>
			<content:encoded><![CDATA[<p><img src="http://zacvineyard.com/blog/wp-content/uploads/2011/06/phonegap_post.jpg" alt="post json to remote server cross domain phonegap" title="phonegap_post" width="630" height="300" class="aligncenter size-full wp-image-536" />Android and iPhone apps built with PhoneGap are (because of PhoneGap&#8217;s nature) compiled code, and because this compiled code is not a browser, you can execute cross-domain requests. The example code I provide below will not work in a browser, but it does work in a phone emulator (whether Android or iPhone) and, of course, on mobile devices.</p>
<p><!--ad--></p>
<div class="warn" style="margin-bottom:30px;">This example will work on a mobile device and in a mobile device emulator. It will not work in an internet browser.</div>
<h2>The HTML Form</h2>
<p>This example starts with a basic form in HTML, as seen below. </p>
<blockquote class="overflow">

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;form method=&quot;post&quot; id=&quot;infoForm&quot;&gt;
    &lt;input type=&quot;text&quot; name=&quot;first_name&quot; id=&quot;first_name&quot; value=&quot;&quot; placeholder=&quot;First Name&quot;  /&gt;
    &lt;input type=&quot;text&quot; name=&quot;last_name&quot; id=&quot;last_name&quot; value=&quot;&quot; placeholder=&quot;Last Name&quot;  /&gt;   
    &lt;input type=&quot;text&quot; name=&quot;email&quot; id=&quot;email&quot; value=&quot;&quot; placeholder=&quot;Email&quot;  /&gt;
    &lt;button type=&quot;submit&quot;&gt;Submit&lt;/button&gt; 
&lt;/form&gt;</pre></div></div>

</blockquote>
<h2>The Javascript (jQuery)</h2>
<p>Once you have the form, we&#8217;ll need some jQuery to process the form and post the data to a script on a remote server. Make sure you change the <code>postTo</code> variable in the example code below so that it points to your own PHP script.</p>
<p>I am using <code>jQuery.post()</code> to send the data to the server. You can <a href="http://api.jquery.com/jQuery.post/">learn more about <code>jQuery.post()</code> on the jQuery website</a>. </p>
<blockquote class="overflow">

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#infoForm'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">submit</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">var</span> postTo <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://yourdomain.com/test.php'</span><span style="color: #339933;">;</span>
&nbsp;
    $.<span style="color: #660066;">post</span><span style="color: #009900;">&#40;</span>postTo<span style="color: #339933;">,</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>first_name<span style="color: #339933;">:</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'[name=first_name]'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> last_name<span style="color: #339933;">:</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'[name=last_name]'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> email<span style="color: #339933;">:</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'[name=email]'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>data <span style="color: #339933;">!=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #006600; font-style: italic;">// do something</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #006600; font-style: italic;">// couldn't connect</span>
        <span style="color: #009900;">&#125;</span>        
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'json'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</blockquote>
<p>Essentially this bit of jQuery takes the data from a form with the id attribute of &#8220;infoForm&#8221; and POSTs it to a PHP script as a JSON string. Make sure you build the data string you&#8217;ll submit using <code>jQuery.post()</code> with the names of your form inputs. In other words, make sure you add the data from your form to the JSON data string you&#8217;re building as part of the jQuery POST request.</p>
]]></content:encoded>
			<wfw:commentRss>http://zacvineyard.com/blog/2011/06/19/post-data-to-a-remote-server-cross-domain-with-jquery-in-phonegap/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Change the NS Record on a Domain and Not Interrupt Email Delivery</title>
		<link>http://zacvineyard.com/blog/2011/05/21/how-to-change-the-ns-record-on-a-domain-and-not-interrupt-email-delivery/</link>
		<comments>http://zacvineyard.com/blog/2011/05/21/how-to-change-the-ns-record-on-a-domain-and-not-interrupt-email-delivery/#comments</comments>
		<pubDate>Sun, 22 May 2011 02:48:56 +0000</pubDate>
		<dc:creator>Zac</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[domain]]></category>
		<category><![CDATA[ns records]]></category>
		<category><![CDATA[zone file]]></category>

		<guid isPermaLink="false">http://zacvineyard.com/blog/?p=496</guid>
		<description><![CDATA[I was going to be hosting a web site for a company using GoDaddy, but this company's old site and domain were hosted and controlled somewhere else. With this situation, the problem I faced was that I needed to change the site's DNS record (zone file) to point to the new website (by changing the ns records) but make sure that email delivery didn't get interrupted.]]></description>
			<content:encoded><![CDATA[<p><a href="http://zacvineyard.com/blog/wp-content/uploads/2011/05/internet.jpg"><img src="http://zacvineyard.com/blog/wp-content/uploads/2011/05/internet.jpg" alt="" title="internet" width="300" height="300" class="alignright size-full wp-image-505" /></a>Here was my situation: I was going to be hosting a web site for a company using GoDaddy, but this company&#8217;s old site and domain were hosted and controlled somewhere else. With this situation, the problem I faced was that I needed to change the site&#8217;s DNS record (zone file) to point to the new website (by changing the ns records) but make sure that email delivery didn&#8217;t get interrupted.</p>
<p>So, when you change a ns record on a domain you&#8217;re telling DNS servers that the information about a particular domain is now being housed in a different spot; meaning that the new nameserver for your domain will be the authority on what your domain name does (be the zone file owner). Once the new ns records propagate, your domain will act according to the zone file on the new nameserver.</p>
<p>So, in order to ensure that you don&#8217;t disrupt email for a business when you make a change like this, here are a couple of pointers:</p>
<ol>
<li>Add an A record to the zone file that points to the IP address of the (old) mail server; like<br />
A → mail →  xxx.xxx.xxx.xxx</li>
<li>Add an MX record for mail.yourdomain.com (make sure you use your own domain name) pointing to the new A record for the IP address of the old server</li>
</ol>
<p>Here is a picture that helps explain what I&#8217;m talking about.</p>
<p><a href="http://zacvineyard.com/blog/wp-content/uploads/2011/05/domain_zone_file.jpg"><img class="alignnone size-medium wp-image-498" title="domain_zone_file" src="http://zacvineyard.com/blog/wp-content/uploads/2011/05/domain_zone_file-300x206.jpg" alt="" width="300" height="206" /></a></p>
<div class="warn">Now, this is just one solution to a varying number of ways to fix this problem, so please explore all troubleshooting options when changing a zone file.</div>
]]></content:encoded>
			<wfw:commentRss>http://zacvineyard.com/blog/2011/05/21/how-to-change-the-ns-record-on-a-domain-and-not-interrupt-email-delivery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upload a File to a Remote Server with PhoneGap (revised for version 1.2.0)</title>
		<link>http://zacvineyard.com/blog/2011/03/25/upload-a-file-to-a-remote-server-with-phonegap/</link>
		<comments>http://zacvineyard.com/blog/2011/03/25/upload-a-file-to-a-remote-server-with-phonegap/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 03:54:53 +0000</pubDate>
		<dc:creator>Zac</dc:creator>
				<category><![CDATA[PhoneGap]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[native]]></category>
		<category><![CDATA[phonegap]]></category>
		<category><![CDATA[POST]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://zacvineyard.com/blog/?p=453</guid>
		<description><![CDATA[I recently started looking at <a href="http://www.phonegap.com/" target="_blank">PhoneGap</a> as a way to build native smartphone applications without having to learn another programming language. The process, so far, has been going very well. I've been able to build a basic application with very little trouble. I did, however, hit a big hiccup in development when I decided to try and upload a file from a phone to a remote location. In this post, I want to explain how I was able to upload a photo from a phone, using PhoneGap (and PHP on the remote server), to a remote server.]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-468" title="phonegap_and_php" src="http://zacvineyard.com/blog/wp-content/uploads/2011/03/phonegap_and_php.jpg" alt="" width="630" height="300" />I recently started looking at <a href="http://www.phonegap.com/" target="_blank">PhoneGap</a> as a way to build native smartphone applications without having to learn another programming language. The process, so far, has been going very well. I&#8217;ve been able to build a basic application with very little trouble. I did, however, hit a big hiccup in development when I decided to try and upload a file from a phone to a remote location. The unfortunate part of this hiccup was that I think its primary cause is rooted in poor documentation.</p>
<p>In this post, I want to explain how I was able to upload a photo from a phone, using PhoneGap (and PHP on the remote server), to a remote server. I am going to assume that you have some knowledge of PhoneGap and already have a method, either the Android SDK or the iPhone SDK, to test your native application.</p>
<h2>The HTML / Javascript</h2>
<p>Rather then use a jQuery Ajax call, I am relying on <a href="http://docs.phonegap.com/phonegap_file_file.md.html#FileTransfer" target="_blank">PhoneGap&#8217;s FileTransfer object</a> to post the image to a remote server. The code below is all you need to add to your &#8220;index.html&#8221; PhoneGap file for a basic upload. Make sure, if you use the example code below, to add your server&#8217;s URL in the appropriately marked place.</p>
<blockquote class="overflow">

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;File Transfer Example&lt;/title&gt;
&nbsp;
    &lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot; src=&quot;phonegap-1.2.0.js&quot;&gt;&lt;/script&gt;
    &lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;
&nbsp;
        // Wait for PhoneGap to load
        //
        document.addEventListener(&quot;deviceready&quot;, onDeviceReady, false);
&nbsp;
        // PhoneGap is ready
        //
        function onDeviceReady() {
&nbsp;
        }
&nbsp;
        function getImage() {
&nbsp;
            // Retrieve image file location from specified source
            navigator.camera.getPicture(uploadPhoto, function(message) {
			alert('get picture failed');
		},{
			quality: 50, 
			destinationType: navigator.camera.DestinationType.FILE_URI,
			sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY
		}
            );
&nbsp;
        }
&nbsp;
        function uploadPhoto(imageURI) {
            var options = new FileUploadOptions();
            options.fileKey=&quot;file&quot;;
            options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
            options.mimeType=&quot;image/jpeg&quot;;
&nbsp;
            var params = new Object();
            params.value1 = &quot;test&quot;;
            params.value2 = &quot;param&quot;;
&nbsp;
            options.params = params;
            options.chunkedMode = false;
&nbsp;
            var ft = new FileTransfer();
            ft.upload(imageURI, &quot;http://zacvineyard.com/upload.php&quot;, win, fail, options);
        }
&nbsp;
        function win(r) {
            console.log(&quot;Code = &quot; + r.responseCode);
            console.log(&quot;Response = &quot; + r.response);
            console.log(&quot;Sent = &quot; + r.bytesSent);
            alert(r.response);
        }
&nbsp;
        function fail(error) {
            alert(&quot;An error has occurred: Code = &quot; = error.code);
        }
&nbsp;
        &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;button onclick=&quot;getImage();&quot;&gt;Upload a Photo&lt;/button&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

</blockquote>
<p>As you can see, the code above allows you to browse for a photo in the device&#8217;s photo library using the function <code>getImage()</code>. Once a photo is chosen, it gets POSTed as multi-part data to the server. You will notice that you can include some test parameters in the upload data which will be POSTed to your server as well, but these are optional. One very important piece of information discovered by other PhoneGap developers (thank you Ryan and Jeff) is that this script doesn&#8217;t work until you add &#8220;options.chunkedMode = false;&#8221; to the code. If you don&#8217;t append this line of code, data won&#8217;t be readable by your PHP server.</p>
<h2>The PHP</h2>
<p>Now that you are able to find a file and upload it to a server, you&#8217;ll need a server side script to handle the data. Here is a very basic PHP example on handling the multi-part form data (image) that was just sent from the device.</p>
<blockquote class="overflow">

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;?php
print_r($_FILES);
$new_image_name = &quot;namethisimage.jpg&quot;;
move_uploaded_file($_FILES[&quot;file&quot;][&quot;tmp_name&quot;], &quot;/srv/www/upload/&quot;.$new_image_name);
?&gt;</pre></div></div>

</blockquote>
<p>The above code uses PHP&#8217;s <code><a href="http://php.net/manual/en/function.move-uploaded-file.php" target="_blank">move_uploaded_file()</a></code> to move the uploaded file from a temporary location to a new directory. To make sure it works, change &#8220;/srv/www/upload/&#8221; to a directory on your server. I usually have to pass an absolute file-path as the second variable in the <code>move_uploaded_file()</code> for it to work. You can learn more about PHP uploads in a <a href="http://zacvineyard.com/blog/2010/03/15/a-better-php-upload-and-rename-script/">previous post of mine</a>.</p>
<h2>Finished</h2>
<p>Above is a short example of how to upload a file to a remote server using PhoneGap, including how to handle that data once it gets to the server.</p>
<h2>Source</h2>
<p>If you are developing on an Android device, you can download an Eclipse project below.<br />
<a href="http://goo.gl/59hwI">Download the Eclipse Project</a></p>
]]></content:encoded>
			<wfw:commentRss>http://zacvineyard.com/blog/2011/03/25/upload-a-file-to-a-remote-server-with-phonegap/feed/</wfw:commentRss>
		<slash:comments>72</slash:comments>
		</item>
		<item>
		<title>Responsive Web Design at nnu.edu</title>
		<link>http://zacvineyard.com/blog/2011/03/15/responsive-web-design-at-nnu-edu/</link>
		<comments>http://zacvineyard.com/blog/2011/03/15/responsive-web-design-at-nnu-edu/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 03:33:43 +0000</pubDate>
		<dc:creator>Zac</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[UX]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[media queries]]></category>
		<category><![CDATA[responsive]]></category>

		<guid isPermaLink="false">http://zacvineyard.com/blog/?p=437</guid>
		<description><![CDATA[With a variety of resources in tow, I've been able to quickly release the first chunk of CSS behind a media query on nnu.edu. This process was mostly pain free, fast, and fun; but it came with a few problems to solve, three of which I'd like to quickly overview for web developers who may face similar challenges. ]]></description>
			<content:encoded><![CDATA[<p><img src="http://zacvineyard.com/blog/wp-content/uploads/2011/03/droid_incredible_small.jpg" alt="" title="droid_incredible_small" width="300" height="300" class="alignright size-full wp-image-481" /><br />
Responsive web design is not a new subject, and I believe this quote from <a href="http://ethanmarcotte.com">Ethan Marcotte</a> is gold:</p>
<blockquote><p>Rather than tailoring disconnected designs to each of an ever-increasing number of web devices, we can treat them as facets of the same experience.<sup>1</sup></p></blockquote>
<p>With a variety of resources in tow, I&#8217;ve been able to quickly release the first chunk of CSS behind a media query on <a title="Northwest Nazarene University" href="http://www.nnu.edu">nnu.edu</a>. This process was mostly pain free, fast, and fun; but it came with a few problems to solve, three of which I&#8217;d like to quickly overview for web developers who may face similar challenges. The things I mention below are really for your &#8220;tips &amp; tricks&#8221; toolbox.</p>
<h2>Positioning</h2>
<p>If you are working with a site that doesn&#8217;t have a fluid layout, you will be faced with a positioning problem. A few things to remember when making your static layouts responsive are:</p>
<ul>
<li>Set all wrapper tags to width:100%</li>
<li>You can use the <code>!important</code> tag in CSS to override inline style attributes</li>
<li>Clear content areas accordingly</li>
</ul>
<p>The main goal when making your site responsive, with exception of designs for tablet PCs, is to package all your data into a single column layout, which is representative of the standard smartphone screen.</p>
<h2>Image Resizing</h2>
<p>When I added responsive code to nnu.edu, I wanted images to resize without the use of Javascript. To do this, I set the image size to an EM unit instead of a screen width percentage. This would ensure that my images would change size in relation to text size instead of screen size (zoom). This is a good fix for developers looking to lower their code footprint. Here is a code example:</p>
<blockquote><p><code>div.csc-textpic-single-image {<br />
max-width:100%;<br />
width:12em;<br />
}</code></p></blockquote>
<h2>Scope</h2>
<p>Inevitably you will have to make a choice on what stays in your responsive page content and what goes. If you&#8217;re working on a large website (as I am for NNU), try to keep your pool of content similar from page to page. More custom content leads to more CSS. Brevity is king, so don&#8217;t be afraid to whip out <code>display:none</code> on more than one HTML tag.</p>
<h2>Examples</h2>
<p>Not all of nnu.edu is currently mobile enabled. I&#8217;m currently in the process of rolling all the site&#8217;s pages into new templates. These templates come with the shiny new CSS3 I talked about above. You can see examples of mobile-enables pages at:</p>
<ul>
<li><a href="http://nnu.edu">nnu.edu</a></li>
<li><a href="http://nnu.edu/financialaid">nnu.edu/financialaid</a></li>
<li><a href="http://nnu.edu/religion">nnu.edu/religion</a></li>
<li><a href="http://nnu.edu/gtoe">nnu.edu/gtoe</a></li>
<li><a href="http://nnu.edu/math">nnu.edu/math</a></li>
</ul>
<p><small>1. Responsive Web Design, Ethan Marcotte. <em>A List Apart</em>, May 25, 2010. http://www.alistapart.com/articles/responsive-web-design/</small></p>
]]></content:encoded>
			<wfw:commentRss>http://zacvineyard.com/blog/2011/03/15/responsive-web-design-at-nnu-edu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working with Google&#8217;s Cr-48 Chrome Notebook: Proof of the Cloud Concept</title>
		<link>http://zacvineyard.com/blog/2011/02/17/working-with-googles-cr-48-chrome-notebook-proof-of-the-cloud-concept/</link>
		<comments>http://zacvineyard.com/blog/2011/02/17/working-with-googles-cr-48-chrome-notebook-proof-of-the-cloud-concept/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 02:36:38 +0000</pubDate>
		<dc:creator>Zac</dc:creator>
				<category><![CDATA[Chrome Cr-48]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[Cr-48]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://zacvineyard.com/blog/?p=402</guid>
		<description><![CDATA[I want to start talking about the Cr-48 with a review, but unlike a huge number of other bloggers and writers who spend time talking about the hardware, I want to talk about proof of the cloud concept. The primary reason, after all, that I received this notebook from Google is to prove whether or not I (or anyone else) can successfully live in the cloud; not to see isf the machine could be cracked open and loaded with Ubuntu.]]></description>
			<content:encoded><![CDATA[<p><img src="http://zacvineyard.com/blog/wp-content/uploads/2011/02/Cr-48-Laptop-con-Chrome-OS.jpg" alt="" title="Cr-48-Laptop-con-Chrome-OS" width="630" height="300" class="aligncenter size-full wp-image-477" /></p>
<p>I want to start talking about the Cr-48 with a review, but unlike a huge number of other bloggers and writers who spend time talking about the hardware, I want to talk about proof of the cloud concept. The primary reason, after all, that I received this notebook from Google is to prove whether or not I (or anyone else) can successfully live in the cloud; not to see if the machine could be cracked open and loaded with Ubuntu. So, for now, I am going to avoid the tempting developer switch on this machine and pretend that I&#8217;m not the go-for-broke nerd others expect me to personify while holding a shiny new notebook.</p>
<h2>The Problem of Minimalism</h2>
<p>The Cr-48 epitomizes minimalism. As a concept, a lifestyle, minimalism is attractive. And the Cr-48&#8242;s appearance is just the sleek cover to a magnificent core of simple software. Other than a limited terminal interface, the user is only presented with a browser. And if you dream in the cloud, then nothing beyond the browser will be required for Chrome OS to survive—and I belive it will. But the world isn&#8217;t ready yet. As a PHP developer, I need to be able to remotely access servers, FTP files to any location, write code, and Skype with my co-workers. These are all essential functions of my work. My question is, knowing full-well that we may all be working on cloud-centric software someday, how do we build the internet on the machine that uses it so well?</p>
<h2>Software Development</h2>
<p>I&#8217;m convinced that with the right tools, I could live on Chrome OS forever. Chrome is fast and jaw-droppingly simple. There just ins&#8217;t enough web based software ready to meet the needs of most users. Yes, Google Docs is awesome and useful, but what about video editing, graphically intense gaming, mobile phone development, and peripheral device connections? It may be a great time to be a web developer.</p>
<h2>The Rain Cloud</h2>
<p>Working with the Cr-48 is a bit like trying to use a computer with one hand. But because of 3G, that hand can always be online. For most users, being comfortable with cloud computing will take a while. This minimalism, I predict, combined with speed and connectivity will ratify our entire computing experience. This is why I think the Cr-48 project is an essential component of future computing. Perhaps we are the Xerox PARC to the future Steve Jobs we lovingly call the world wide web.</p>
]]></content:encoded>
			<wfw:commentRss>http://zacvineyard.com/blog/2011/02/17/working-with-googles-cr-48-chrome-notebook-proof-of-the-cloud-concept/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Add a www Resolve to Apache for Better SEO</title>
		<link>http://zacvineyard.com/blog/2010/10/19/how-to-add-a-www-resolve-to-apache-for-better-seo/</link>
		<comments>http://zacvineyard.com/blog/2010/10/19/how-to-add-a-www-resolve-to-apache-for-better-seo/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 04:58:22 +0000</pubDate>
		<dc:creator>Zac</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Apache www resolve SEO .htaccess]]></category>

		<guid isPermaLink="false">http://zacvineyard.com/blog/?p=369</guid>
		<description><![CDATA[There is a simple way to resolve your site URLs to include the www in each address. Or drop the www from each address. Why is this important? "Redirecting requests from a non-preferred hostname is important because search engines consider URLs with and without "www" as two different websites" (woorank.com). So, if you don't resolve your www, you are harming your SEO performance.]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-thumbnail wp-image-391" title="InfoIcon" src="http://zacvineyard.com/blog/wp-content/uploads/2010/10/InfoIcon-150x150.png" alt="" width="150" height="150" />There is a simple way to resolve your site URLs to include the www in each address. Or drop the www from each address. Why is this important? &#8220;Redirecting requests from a non-preferred hostname is important because search engines consider URLs with and without &#8220;www&#8221; as two different websites&#8221; (woorank.com). So, if you don&#8217;t resolve your www, you are harming your SEO performance.</p>
<p>Here are the three lines of code you can to a .htaccess file to resolve your www to include the www.</p>
<p>Make sure to place the .htaccess file you build in the root directory of your web site.</p>
<p><code>RewriteEngine on<br />
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]<br />
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]</code></p>
<p>Here are the three lines of code to use if you want to drop the www.</p>
<p><code>RewriteEngine on<br />
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]<br />
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]</code></p>
<p>Make sure you replace &#8220;example.com&#8221; with your own domain in the sample code.</p>
]]></content:encoded>
			<wfw:commentRss>http://zacvineyard.com/blog/2010/10/19/how-to-add-a-www-resolve-to-apache-for-better-seo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Configure Apache to Use htaccess Files</title>
		<link>http://zacvineyard.com/blog/2010/10/19/how-to-configure-apache-to-use-htaccess-files/</link>
		<comments>http://zacvineyard.com/blog/2010/10/19/how-to-configure-apache-to-use-htaccess-files/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 04:23:25 +0000</pubDate>
		<dc:creator>Zac</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Apache .htaccess Ubuntu]]></category>

		<guid isPermaLink="false">http://zacvineyard.com/blog/?p=365</guid>
		<description><![CDATA[Getting Apache to recognize .htaccess files is a pretty easy task. All you need to do is look for where your root web directory is defined in your Apache configuration files. On Ubuntu, this location is /etc/apache/sites-enabled. Once you have located the file, just add the line "AllowOverride All" (instead of AllowOverride None) to the root directory configuration detectives. ]]></description>
			<content:encoded><![CDATA[<p>Getting Apache to recognize .htaccess files is a pretty easy task. All you need to do is look for where your root web directory is defined in your Apache configuration files. On Ubuntu, this location is <code>/etc/apache/sites-enabled</code>. Once you have located the file, just add the line &#8220;AllowOverride All&#8221; (instead of AllowOverride None) to the root directory configuration detectives. Your final code should look something like:</p>
<p><code>&lt;Directory /var/www/&gt;</code></p>
<p><code></p>
<div style="margin: 0 0 15px 30px;">Options FollowSymLinks MultiViews<br />
AllowOverride All<br />
Order allow,deny<br />
allow from all</div>
<p></code></p>
<p><code>&lt;/Directory&gt;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://zacvineyard.com/blog/2010/10/19/how-to-configure-apache-to-use-htaccess-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting a GET Parameter as a Variable in Typoscript</title>
		<link>http://zacvineyard.com/blog/2010/07/06/setting-a-get-parameter-as-a-variable-in-typoscript/</link>
		<comments>http://zacvineyard.com/blog/2010/07/06/setting-a-get-parameter-as-a-variable-in-typoscript/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 15:31:55 +0000</pubDate>
		<dc:creator>Zac</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[$_GET]]></category>
		<category><![CDATA[GET]]></category>
		<category><![CDATA[tt_news]]></category>
		<category><![CDATA[Typo3]]></category>
		<category><![CDATA[typoscript]]></category>

		<guid isPermaLink="false">http://zacvineyard.com/blog/?p=344</guid>
		<description><![CDATA[Recently I had a problem that, in spite of many "support leads" on other sites, was hard to figure out. All I wanted to do was reference as GET parameter in a URL as a variable in Typoscript. After many failed attempts, I found a solution to my problem. So, for future reference, and for all others who may be struggling with this problem, here is a solution.]]></description>
			<content:encoded><![CDATA[<p><a href="http://zacvineyard.com/blog/wp-content/uploads/2010/07/typo3.jpg"><img src="http://zacvineyard.com/blog/wp-content/uploads/2010/07/typo3.jpg" alt="" title="typo3" width="150" height="150" class="alignright size-full wp-image-352" /></a>Recently I had a problem that, in spite of many &#8220;support leads&#8221; on other sites, was hard to figure out. All I wanted to do was reference as GET parameter in a URL as a variable in Typoscript. After many failed attempts, I found a solution to my problem. So, for future reference, and for all others who may be struggling with this problem, here is a slice of example code that solved my problem:</p>
<blockquote class="overflow">

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">lib.featured &lt; plugin.tt_news
lib.featured {
    code &gt;
    code = LIST
    pid_list &gt;
    pid_list = 10064
    catImageMode = 1    
    catTextMode = 0
    categorySelection = TEXT
    categorySelection.data = GPvar : cat
    categoryMode = 1
    limit = 1
    singlePid = 1729
    general_stdWrap.crop = 300 |&lt;img src=&quot;fileadmin/templates/news/images/featured.png&quot; class=&quot;tag&quot; /&gt; ... | 1
    templateFile = fileadmin/templates/ext_templates/tt_news_student_life_feature.html
}</pre></div></div>

</blockquote>
<p>What I was trying to accomplish was changing news categories on a single page so that different news would display on a page simply by changing a category number. The two lines you should pay attention to above are:</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">categorySelection = TEXT
categorySelection.data = GPvar : cat</pre></div></div>

</blockquote>
<p>Here, the code &#8220;<code>GPvar : cat</code>&#8221; will get the value of a GET parameter named &#8220;cat&#8221; out of a URL like this:</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">http://www.example.com/index.php?id=7565&amp;cat=19</pre></div></div>

</blockquote>
<p>What I discovered was that, in order to use the GET parameter in Typoscript, I needed to <em>type</em> the variable in Typoscript before it could be referenced. Hence the &#8220;<code>categorySelection = TEXT</code>&#8221; code.</p>
]]></content:encoded>
			<wfw:commentRss>http://zacvineyard.com/blog/2010/07/06/setting-a-get-parameter-as-a-variable-in-typoscript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parse PHP in HTML Pages on GoDaddy Hosting</title>
		<link>http://zacvineyard.com/blog/2010/05/12/parse-php-in-html-pages-on-godaddy-hosting/</link>
		<comments>http://zacvineyard.com/blog/2010/05/12/parse-php-in-html-pages-on-godaddy-hosting/#comments</comments>
		<pubDate>Thu, 13 May 2010 04:02:16 +0000</pubDate>
		<dc:creator>Zac</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[GoDaddy]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://zacvineyard.com/blog/?p=333</guid>
		<description><![CDATA[Sometimes it is helpful, mainly to avoid broken links, to make sure your html files (with a .htm or .html extension) can parse PHP. On GoDaddy hosting, this threw me for a loop.]]></description>
			<content:encoded><![CDATA[<p>Sometimes it is helpful, mainly to avoid broken links, to make sure your html files (with a .htm or .html extension) can parse PHP. Recently I was working on a GoDaddy hosted project where I needed this functionality but it wasn&#8217;t working as I had planned.</p>
<p>Usually, to get html files to parse PHP, I add this line of code to my Apache .htaccess file:</p>
<blockquote><p><code>AddType application/x-httpd-php .htm .html .php</code></p></blockquote>
<p>It is similar for GoDaddy hosting, but this is what you need:</p>
<blockquote><p><code>AddType application/x-httpd-php5 .htm .html .php<br />
AddHandler x-httpd-php5  .htm .html .php</code></p></blockquote>
<p>After you add that to your .htaccess file, your html files will parse PHP on GoDaddy hosting. Super handy!</p>
]]></content:encoded>
			<wfw:commentRss>http://zacvineyard.com/blog/2010/05/12/parse-php-in-html-pages-on-godaddy-hosting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

