<?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>JonathanMcCarver.com</title>
	<atom:link href="http://www.jonathanmccarver.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jonathanmccarver.com</link>
	<description></description>
	<lastBuildDate>Wed, 16 Nov 2011 04:15:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Monitor Your Own Uptime</title>
		<link>http://www.jonathanmccarver.com/monitor-your-own-uptime/</link>
		<comments>http://www.jonathanmccarver.com/monitor-your-own-uptime/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 04:13:24 +0000</pubDate>
		<dc:creator>Jonathan McCarver</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[monitor my site]]></category>
		<category><![CDATA[monitor my uptime]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php uptime script]]></category>
		<category><![CDATA[server administration]]></category>
		<category><![CDATA[site monitor]]></category>
		<category><![CDATA[site monitoring]]></category>
		<category><![CDATA[uptime]]></category>
		<category><![CDATA[uptime script]]></category>

		<guid isPermaLink="false">http://www.jonathanmccarver.com/?p=355</guid>
		<description><![CDATA[If you manage websites you know how bad it feels to have someone tell you a site is not only down but it&#8217;s been that way for 2 hours &#8230; or days. There are solutions out there to monitor your &#8230; <a href="http://www.jonathanmccarver.com/monitor-your-own-uptime/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you manage websites you know how bad it feels to have someone tell you a site is not only down but it&#8217;s been that way for 2 hours &#8230; or days. There are solutions out there to monitor your sites uptime but many of them charge and are at best clunky. I&#8217;m going to share with you a simple php script I wrote to monitor the sites I maintain for my work and my personal sites.</p>
<p>I&#8217;ll assume you can use PHP already in this, if you can&#8217;t <a href="http://www.w3schools.com/php/default.asp">start here</a>. First you want an array of the sites<span id="more-355"></span> to test:</p>
<pre class="wp-code-highlight prettyprint"> $sitelist = array(
        &quot;http://asdf.not_a_domain_and_will_fail.com&quot;,
        &quot;http://www.jonathanmccarver.com&quot;,
        &quot;http://google.com&quot;

);</pre>
<p>The first url is one we know will fail for testing purposes. The next two should be up and have content. To test the sites I will be using <a href="http://en.wikipedia.org/wiki/CURL">curl</a> because it is well integrated with php already and it does everything we need. So in a loop on the array objects lets use curl to read the contents of each site.</p>
<pre class="wp-code-highlight prettyprint">$errormsg = &quot;There is an error with the following sites: \n\n&quot;;
$error = False;

foreach ($sitelist as $i =&gt; $site)
{
        $crl = curl_init(); // create a curl object
        $timeout = 10; // give it 10 seconds to attempt to read the site
        curl_setopt ($crl, CURLOPT_URL, $site); // assign url
        curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1); // I don't know what that means
        curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout); // set timeout
        $content = curl_exec($crl); // run the read command

        if( curl_errno($crl) ) // see if the curl object threw an error
        {
                $error = True;
                $errormsg .= $site.&quot; was not able to be read. (curl error: &quot;.curl_error($crl).&quot;\n&quot;;
                // save the error
        }
}</pre>
<p>Now we have a loop that attempts to read each site and saves a message if the site times out. This is good but unfortunately this is not the only way sites fail. You may have a 404 not found, a 503 error, a blank page, or a successful load. Lets start by checking status codes.</p>
<pre class="wp-code-highlight prettyprint">        $status = curl_getinfo($crl, CURLINFO_HTTP_CODE);
        $status_range =  (string)$status; // convert to a string
        $status_range = $status_range[0]; // get the first digit

        if( !( $status_range == '2' || $status_range == '3' ) )
        // 200's are a good response and 300's are redirects
        // everything else is some kind of error.
        {
                $error = True;
                $errormsg .= $site.&quot; returned a code of &quot;.$status.&quot; and needs to be checked.\n&quot;;
        }</pre>
<p>Http codes are 3 digit numbers and there&#8217;s a whole bunch of them. 200 codes are all good and 300 codes are a redirect of some kind which for my purposes is also a working site. By writing the code to only pass if the first digit is a 2 or a 3 we are catching every possible error code. There is one more situation to check though, if a site successfully renders it has a 200 code but what if it delivers no content? We will look at the length of the content to see if that is the case.</p>
<pre class="wp-code-highlight prettyprint">        $length = strlen( $content );
        if( $length &lt; 2 )
        {
                $error = True;
                $errormsg .= $site.&quot; returned no content.\n&quot;;
        }

        curl_close($crl);</pre>
<p>This is all happening in the same loop we started with. At the end of this snippet you will see we close the curl object. This is good to prevent memory leaks especially since we will be running this code on a timer unattended. Remember if the server hosting this code crashes you&#8217;ll never know the difference.</p>
<p>We&#8217;ve done a pretty good job of determining if the sites on our list are up and working or not but this script doesn&#8217;t communicate with anyone. You could output the string but that doesn&#8217;t alert you, it just displays when you run the script. First lets make it email us if it finds a problem.</p>
<pre class="wp-code-highlight prettyprint">if( $error )
{
        echo $errormsg;

        $to      = 'address1@email.com,address2@email.com';
        $subject = '## Websites are down ##';
        $message = $errormsg;
        $headers = 'From: noreply@mywebsite.com' . &quot;\r\n&quot; .
        'X-Mailer: PHP/' . phpversion();

        mail($to, $subject, $message, $headers);
}else
{
        echo &quot;No errors encountered.\n&quot;;
}</pre>
<p>Now it sends an email but it needs to run on a timer. I have linux based servers to that means I&#8217;ll use a <a href="http://en.wikipedia.org/wiki/Cron">cron job</a>. Editing your crontab or cron configuration can be confusing and it is easy to mess up. On the command line, assuming you have the right permissions, you can enter crontab -l (thats a lowercase L) to see what crons your system has. You can enter crontab -e to start editing the file but be warned it uses the default editor which will probably be &#8220;vi&#8221;; a VERY confusing program. You can change your default to the easy to use nano program by adding this line to your .bash_profile file: &#8220;export EDITOR=nano&#8221; but if none of the last 3 sentences have made any sense to you then you should probably stop here and work on learning unix/linux a little better before trying to set a cron.</p>
<p>Here is an example of the line you might add to your crontab.</p>
<pre class="wp-code-highlight prettyprint">0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/local/bin/php /home/mydirectory/htdocs/uptime/index.php &amp;gt;&amp;gt; /home/mydirectory/htdocs/uptime/Logfile.txt</pre>
<p>If that looks like a lot of jibberish then it just means you&#8217;re paying attention. This part &#8220;0,5,10,15,20,25,30,35,40,45,50,55 * * * * &#8221; instructs the script to run every 5 minutes. The part after that is just a command that you could type on the command line yourself and that&#8217;s what gets executed. One important difference from being logged in and typing it yourself is you need to use full paths. If I were in the right directory I could just enter &#8220;php index.php&#8221; and run the program but the cron executes the line from nowhere and with no prior knowledge so you have to spell everything out. Find out where your php install is (the first thing after the asterisks) by typing &#8220;which php&#8221; on the command line. I also am keeping a log by appending the output to Logfile.txt. The &gt;&gt; instructs the system to append the programs output to the end of that file ( as opposed to one &gt; that would overwrite it every time ).</p>
<p>I know you just want the full source code so here it is:</p>
<pre class="wp-code-highlight prettyprint">&lt;?

$sitelist = array(
        &quot;http://asdf.not_a_domain_and_will_fail.com&quot;,
        &quot;http://www.jonathanmccarver.com&quot;,
        &quot;google.com&quot;
);

$errormsg = &quot;There is an error with the following sites: \n\n&quot;;
$error = False;

foreach ($sitelist as $i =&gt; $site)
{
        $crl = curl_init();
        $timeout = 10;
        curl_setopt ($crl, CURLOPT_URL, $site);
        curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout);
        $content = curl_exec($crl);

        if( curl_errno($crl) )
        {
                $error = True;
                $errormsg .= $site.&quot; was not able to be read. (curl error: &quot;.curl_error($crl).&quot;\n&quot;;
        }

        $status = curl_getinfo($crl, CURLINFO_HTTP_CODE);
        $status_range =  (string)$status;
        $status_range = $status_range[0]; // status starts as an integer and has to be converted to string to get the first digit

        if( !( $status_range == '2' || $status_range == '3' ) ) // 200's are a good response and 300's are redirects
        {
                $error = True;
                $errormsg .= $site.&quot; returned a code of &quot;.$status.&quot; and needs to be checked.\n&quot;;
        }

        $length = strlen( $content );
        if( $length &lt; 2 )
        {
                $error = True;
                $errormsg .= $site.&quot; returned no content.\n&quot;;
        }

        curl_close($crl);
}

if( $error )
{
        echo $errormsg;

        $to      = 'address1@email.com,address2@email.com';
        $subject = '## Websites are down ##';
        $message = $errormsg;
        $headers = 'From: noreply@mywebsite.com' . &quot;\r\n&quot; .
        'X-Mailer: PHP/' . phpversion();

        mail($to, $subject, $message, $headers);
}else
{
        echo &quot;No errors encountered.\n&quot;;
}

echo date(DATE_RSS).&quot;\n&quot;;

?&gt;</pre>
<p>And since you skipped down here to copy and paste it good luck to you. If you have any trouble read the article and if it just doesn&#8217;t work leave me a comment.</p>
<p>One last tip, get another server. If you run the code that checks your site on the server that hosts it then you&#8217;ve just wasted a bunch of time. If the server crashes then NEITHER of those two things work so your website is down and you don&#8217;t get an email because your checking script is also down. If you&#8217;re running a site that&#8217;s important enough for constant monitoring then it&#8217;s worth another 8 or 10 dollars a month for a second hosting plan to do it from.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanmccarver.com/monitor-your-own-uptime/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Being an Adult</title>
		<link>http://www.jonathanmccarver.com/being-an-adult/</link>
		<comments>http://www.jonathanmccarver.com/being-an-adult/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 22:47:10 +0000</pubDate>
		<dc:creator>Jonathan McCarver</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jonathanmccarver.com/?p=347</guid>
		<description><![CDATA[The great thing about being an adult is that you can do whatever you want all of the time. You can do it when you&#8217;re a kid too but it took me twenty something years to figure that out. - &#8230; <a href="http://www.jonathanmccarver.com/being-an-adult/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The great thing about being an adult is that you can do whatever you want all of the time. You can do it when you&#8217;re a kid too but it took me twenty something years to figure that out.</p>
<p>- Jonathan McCarver</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanmccarver.com/being-an-adult/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Occupy Greyskull</title>
		<link>http://www.jonathanmccarver.com/occupy-greyskull/</link>
		<comments>http://www.jonathanmccarver.com/occupy-greyskull/#comments</comments>
		<pubDate>Fri, 11 Nov 2011 22:34:13 +0000</pubDate>
		<dc:creator>Jonathan McCarver</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[greyskull]]></category>
		<category><![CDATA[he man]]></category>
		<category><![CDATA[occupy]]></category>
		<category><![CDATA[occupy eternia]]></category>
		<category><![CDATA[occupy greyskull]]></category>
		<category><![CDATA[skelator]]></category>

		<guid isPermaLink="false">http://www.jonathanmccarver.com/?p=335</guid>
		<description><![CDATA[This is my contribution to the world today.]]></description>
			<content:encoded><![CDATA[<p>This is my contribution to the world today.</p>
<p><a href="http://www.jonathanmccarver.com/occupy-greyskull/occupyeternia/" rel="attachment wp-att-336"><img class="aligncenter size-full wp-image-336" title="OccupyEternia" src="http://www.jonathanmccarver.com/wp-content/uploads/2011/11/OccupyEternia.jpg" alt="" width="575" height="912" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanmccarver.com/occupy-greyskull/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If You&#8217;re in IT Learn to Use a Mac</title>
		<link>http://www.jonathanmccarver.com/if-youre-in-it-learn-to-use-a-mac/</link>
		<comments>http://www.jonathanmccarver.com/if-youre-in-it-learn-to-use-a-mac/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 19:58:55 +0000</pubDate>
		<dc:creator>Jonathan McCarver</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jonathanmccarver.com/?p=329</guid>
		<description><![CDATA[I am a computer programmer by trade and a long time computer user. I&#8217;ve had a Macintosh Performa 405, a Compaq Presario, a poorly build hand made computer, a Macbook Pro, a Dell Vostro 1000 laptop, a better built custom &#8230; <a href="http://www.jonathanmccarver.com/if-youre-in-it-learn-to-use-a-mac/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am a computer programmer by trade and a long time computer user. I&#8217;ve had a Macintosh Performa 405, a Compaq Presario, a poorly build hand made computer, a Macbook Pro, a Dell Vostro 1000 laptop, a better built custom computer, a toshiba touchscreen tablet pc, 2 kinds of iphone and a sony vaio that I am writing on now. I&#8217;ve administrated several linux servers remotely and run both red hat and ubuntu on home computers (deciding finally it&#8217;s not worth the work to run linux at home). Suffice it to say I&#8217;ve used a lot of computers.</p>
<p>In using dozens of different computers over the years I&#8217;ve noticed one thing, <strong>they are all computers</strong>. All of them do the same things. You can write documents, connect to networks, install programs, print, and browse the internet. None of this is particularly hard to figure out on a Mac but across the board I have seen IT departments that flatly give up when asked to do any of them using a non-windows computer.</p>
<p>10 years ago you could get away with acting like macs were a foriegn language and not supporting them but not today. Apple is the biggest company IN THE WORLD. It actually just beat oil in that competition. Every company is vying to get iPads pointed at their website or app and every consumer is either using or wishing they could afford a mac.</p>
<p>I know it&#8217;s easy to administrate for a group of windows pcs over a network but when it&#8217;s time to do your job it doesn&#8217;t matter what&#8217;s easy it matters what needs to get done. Figure macs out and be ready to work on them or someone else will and your value will fade away.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanmccarver.com/if-youre-in-it-learn-to-use-a-mac/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My Problem with Unbreakable</title>
		<link>http://www.jonathanmccarver.com/my-problem-with-unbreakable/</link>
		<comments>http://www.jonathanmccarver.com/my-problem-with-unbreakable/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 19:00:41 +0000</pubDate>
		<dc:creator>Jonathan McCarver</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bruce willis]]></category>
		<category><![CDATA[movie]]></category>
		<category><![CDATA[shamalon]]></category>
		<category><![CDATA[unbreakable]]></category>

		<guid isPermaLink="false">http://www.jonathanmccarver.com/?p=321</guid>
		<description><![CDATA[I just had one problem with the movie unbreakable.]]></description>
			<content:encoded><![CDATA[<p>I just had one problem with the movie unbreakable.</p>
<p><a href="http://www.jonathanmccarver.com/my-problem-with-unbreakable/unbreakable_stupid/" rel="attachment wp-att-322"><img class="aligncenter size-full wp-image-322" title="unbreakable_stupid" src="http://www.jonathanmccarver.com/wp-content/uploads/2011/09/unbreakable_stupid.jpg" alt="" width="500" height="301" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanmccarver.com/my-problem-with-unbreakable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another Touch Screen Phone</title>
		<link>http://www.jonathanmccarver.com/another-touch-screen-phone/</link>
		<comments>http://www.jonathanmccarver.com/another-touch-screen-phone/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 18:24:54 +0000</pubDate>
		<dc:creator>Jonathan McCarver</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.jonathanmccarver.com/?p=300</guid>
		<description><![CDATA[The HTC Rhyme just came out for Verizon. It seems to be a good phone and HTC is a good company but honestly who cares? It&#8217;s another Android phone with a big hi res touch screen and cameras and an &#8230; <a href="http://www.jonathanmccarver.com/another-touch-screen-phone/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.htc.com/www/smartphones/htc-rhyme/">HTC Rhyme</a> just came out for Verizon. It seems to be a good phone and HTC is a good company but honestly who cares?</p>
<p><a href="http://www.jonathanmccarver.com/another-touch-screen-phone/htc-rhyme/" rel="attachment wp-att-301"><img class="aligncenter size-medium wp-image-301" title="htc-rhyme" src="http://www.jonathanmccarver.com/wp-content/uploads/2011/09/htc-rhyme-500x392.jpg" alt="" width="500" height="392" /></a>It&#8217;s another Android phone with a big hi res touch screen and cameras and an LED light and a cool interface. It has all the features of an iPhone which has all the features of a Droid which has all the features of an Evo. Nothing matters anymore.<span id="more-300"></span></p>
<p>I&#8217;m not picking on the phone. It&#8217;s good. If I had one I would keep it but it&#8217;s not any different than the iPhone I have now. Since the <a href="http://en.wikipedia.org/wiki/IPhone_(original)">first iPhone</a> came out in June of 2007 four years ago all of phone design has largely gone in the same direction. The world has gotten used to tablets as well and even windows is making a very real effort to be useful through a pure touch interface. More software and more features will continue to come up as well as faster processing and higher data rates but none of it will feel like a revolution until the form factor is reinvented once again.</p>
<p>I don&#8217;t know what that new form will be. There were plenty of miniature projectors developed recently that lead to cool interfaces but they aren&#8217;t really ready for prime time.</p>
<p><a href="http://www.youtube.com/watch?v=m9KEsMlw6gY"><img src="http://img.youtube.com/vi/m9KEsMlw6gY/2.jpg"></a></p>
<p><a href="http://www.youtube.com/watch?v=m9KEsMlw6gY">Click here</a> to view the video on YouTube.</p>

<p>There are flexible touch screens in the works and tools that harvest energy from sound but it&#8217;s not going to change things until someone else comes up with a whole new experience for real people, not engineers, to use. Usually these innovations are half intention and half happy accidents. The app store was not planned by apple but it was immediately demanded by a few nerds that had the skills to make it on their own. Until this next revolution happens feel free to make a new mobile device every month or two but don&#8217;t expect me to get too excited.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanmccarver.com/another-touch-screen-phone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beale Street</title>
		<link>http://www.jonathanmccarver.com/beale-street/</link>
		<comments>http://www.jonathanmccarver.com/beale-street/#comments</comments>
		<pubDate>Wed, 14 Sep 2011 16:07:59 +0000</pubDate>
		<dc:creator>Jonathan McCarver</dc:creator>
				<category><![CDATA[Memphis]]></category>
		<category><![CDATA[Beale]]></category>
		<category><![CDATA[Beale Street]]></category>

		<guid isPermaLink="false">http://www.jonathanmccarver.com/?p=280</guid>
		<description><![CDATA[When you talk about Beale Street do your friends say things like &#8220;Uuugh, why would anyone want to go there?&#8221; Do you say those things? I don&#8217;t understand it. Beale Street is fun. It&#8217;s really fun! There is live music &#8230; <a href="http://www.jonathanmccarver.com/beale-street/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When you talk about Beale Street do your friends say things like &#8220;Uuugh, why would anyone want to go there?&#8221; Do you say those things? I don&#8217;t understand it.</p>
<p><a href="http://www.jonathanmccarver.com/wp-content/uploads/2011/09/beale-street.jpg"><img class="aligncenter size-full wp-image-282" title="beale-street" src="http://www.jonathanmccarver.com/wp-content/uploads/2011/09/beale-street.jpg" alt="" width="508" height="338" /></a></p>
<p>Beale Street is fun. It&#8217;s really fun! There is live music all the time. For free anyone can walk down the street and hear 2 to 7 live musicians that are all really good playing blues and rock and roll all day. Want a beer? Walk in any direction and you&#8217;ll probably bump into a counter where you can buy a large beer to drink and carry around with you place to place. Hungry? Despite what most memphians seem to believe there is really good food on Beale too. Mrs Pollys may have the best chicken and waffles in town, Johnny G&#8217;s is true good New Orleans creole food, Dyers burgers was featured on the food network for their long tradition of greasy burgers.</p>
<p><a href="http://www.jonathanmccarver.com/wp-content/uploads/2011/09/goats.jpg"><img class="aligncenter size-full wp-image-283" title="goats" src="http://www.jonathanmccarver.com/wp-content/uploads/2011/09/goats.jpg" alt="" width="375" height="500" /></a></p>
<p>There&#8217;s even goats! Two live goats have a pen in the Silky O&#8217;Sullivans courtyard. Can we put this to rest memphis? I know it&#8217;s crazy on a friday or saturday night but that&#8217;s like hating the grocery store because you only go there at 5pm on weekdays. There are also a lot of tourists down there&#8230; why not meet some and expand your horizons? That&#8217;s all. I love Memphis and I love downtown so I had to say something about it. Thanks for reading and have a good day.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanmccarver.com/beale-street/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Been a While</title>
		<link>http://www.jonathanmccarver.com/been-a-while/</link>
		<comments>http://www.jonathanmccarver.com/been-a-while/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 00:14:22 +0000</pubDate>
		<dc:creator>Jonathan McCarver</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jonathanmccarver.com/?p=274</guid>
		<description><![CDATA[It&#8217;s been a while since I wrote anything. The last post on programming languages was a bit difficult and the break was nice. I&#8217;m always open to topics people are interested in learning about and you can submit them via &#8230; <a href="http://www.jonathanmccarver.com/been-a-while/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since I wrote anything. The last post on programming languages was a bit difficult and the break was nice. I&#8217;m always open to topics people are interested in learning about and you can submit them via comments here. I have been more active lately exercising and doing parkour. In fact <a href="https://www.facebook.com/groups/2831026335/" target="_blank">my group</a> got an <a href="http://www.commercialappeal.com/news/2011/sep/05/what-obstacle/" target="_blank">article in the paper</a> for doing parkour in Memphis. I&#8217;m pretty happy with it and its done a lot of good for letting people know parkour is available here.</p>
<p>I&#8217;m also running a lot to get ready for <a href="http://luvmud.com/" target="_blank">Luv Mud</a>, a dirt and obstacle 5k race. I&#8217;m really bad at running so I&#8217;m doing a lot of it. I want to be competitive but that may be unrealistic. I guess that&#8217;s all for now. I&#8217;ll be working on another tech article soon, till then stay happy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanmccarver.com/been-a-while/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programming Languages for the Internet</title>
		<link>http://www.jonathanmccarver.com/programming-languages-for-the-internet/</link>
		<comments>http://www.jonathanmccarver.com/programming-languages-for-the-internet/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 22:06:57 +0000</pubDate>
		<dc:creator>Jonathan McCarver</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[summary]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.jonathanmccarver.com/?p=226</guid>
		<description><![CDATA[These aren&#8217;t all programming languages and this list doesn&#8217;t have every web programming language possible on it but this is generally (in no particular order) what you will encounter in the world of web design, development, programming, or whatever else &#8230; <a href="http://www.jonathanmccarver.com/programming-languages-for-the-internet/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>These aren&#8217;t all programming languages and this list doesn&#8217;t have every web programming language possible on it but this is generally (in no particular order) what you will encounter in the world of web design, development, programming, or whatever else you want to call making things online. This list is more like what you&#8217;d see in a job description or on a resume as opposed to purely being a list of programming languages. So here are the languages we will cover:</p>
<ul>
<li><a href="#html">html</a></li>
<li><a href="#php">php</a></li>
<li><a href="#asp">asp .net</a></li>
<li><a href="#javascript">javascript</a></li>
<li><a href="#css">css</a></li>
<li><a href="#java">java</a></li>
<li><a href="#python">python</a></li>
<li><a href="#actionscript">actionscript</a></li>
<li><a href="#ruby">ruby</a></li>
<li><a href="#sql">sql</a></li>
<li><a href="#ajax">ajax</a></li>
</ul>
<p><a name="html"></a><br />
<strong>HTML</strong><br />
<a href="http://www.w3.org/wiki/HTML">http://www.w3.org/wiki/HTML</a><br />
Type: A markup language, not a programming language.<br />
HTML (HyperText Markup Language) is what websites are made of. When you view the source of a webpage you are seeing html. It is structured as an<span id="more-226"></span> xml document which means that it&#8217;s easy for a person to read and understand. If you are going to do anything on the internet then you need to at least gain a basic understanding of html. The best beginning place for this (and almost any web technology) is the <a href="http://www.w3schools.com/">W3 Schools website</a>. While it doesn&#8217;t delve deeply into them this resource will start you off on the right path with all of the basic web technologies and it is made and maintained by the same group that develops the web standards so you can be sure the instruction is up to date and reflects good practices.</p>
<p><a name="php"></a><br />
<strong>PHP</strong><br />
<a href="http://www.php.net/">http://www.php.net/</a><br />
Type: Server side interpreted, scripting, language (not compiled)<br />
PHP (<em>PHP: Hypertext Preprocessor</em>) is a language that can be interspersed into html code. You will find there are also many pure php files for frameworks and libraries. In an html file with php in it you can use special tags to change into the php language mode. The commands you then write allow the manipulation of the page <strong>before</strong> it is delivered to the user and displayed in the browser. The before part is important because once someone is viewing the page php scripts are finished running and will not resume until the user makes another request. That is how all of the server side languages we will cover operate.</p>
<p>Php is a good language for a beginning web developer to learn because it is easy to understand and start with but it is also useful in the job market. Many very big and noteworthy sites and pieces of software are developed in php like WordPress (which this site uses), Facebook, and the <a href="http://www.mediawiki.org/wiki/MediaWiki">MediaWiki</a> engine that powers Wikipedia.</p>
<p><a name="asp"></a><br />
<strong>ASP.net</strong><br />
<a href="http://www.asp.net/">http://www.asp.net/</a><br />
Type: Server side interpreted, scripting, language (not compiled)<br />
ASP (Active Server Pages) is a language in the Microsoft .net suite of programming languages. Its syntax and its capabilities are similar to php with the primary difference being that ASP runs on a windows server and not on anything else. Advanced users will find more differences because ASP has a rather unique feature of letting you change languages. By default you are going to be writing <a href="http://en.wikipedia.org/wiki/VBScript">VBScript</a> but you can use special features of the language to change it to <a href="http://en.wikipedia.org/wiki/JScript">JScript </a>or several other syntax types.</p>
<p><a name="javascript"></a><br />
<strong>Javascript<br />
</strong><a href="http://en.wikipedia.org/wiki/JavaScript">http://en.wikipedia.org/wiki/JavaScript</a><br />
Type: Client side script language<br />
Javascript is the only language embedded in all web browsers. It allows a huge number of the &#8220;web 2.0&#8243; features we&#8217;ve all become comfortable with such as animated menus, dynamic content, user behavior tracking, context sensitive inserts (ads) and many many more things.</p>
<p>Javascript is a client side programming language which means that after the page has loaded on a users (clients) device the javascript runs there, on their computer, as part of the web page. This can be confusing to a new web developer trying to make their server side language (such as php) talk to javascript or vice versa. The confusion is because the two languages never run at the same time. Your php runs on the server and delivers the webpage, then your javascript runs on that page. The two can communicate but it happens much differently and is covered at the end of this article.</p>
<p>Users can disable javascript but that has become so rare that it&#8217;s barely a concern anymore since you can scarcely navigate today&#8217;s internet without javascript turned on.<strong></strong></p>
<p><a name="css"></a><br />
<strong><br />
CSS<br />
</strong><a href="http://www.w3.org/Style/CSS/">http://www.w3.org/Style/CSS/</a><br />
Type: Not a programming language. Adds visual description to html.<br />
CSS (Cascading Style Sheets) can be considered part of html, it can be used in an html document or written in its own file to be included to an html doc later. Css exists to give style, visual description of how things should look and be placed, to the elements of an html document. These properties used to be integrated into the writing of html code but they became separated as coders realized they were having to write repetitive code and make changes in too many places. Now pages of a whole website can be written with no styles and all include the same css file. This means changes to fonts, colors and backgrounds can be made in one place. This also has allowed web development to follow the concepts of <a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller">MVC (Model View Controller)</a> design which is outside the scope of this article but a very important part of designing good software and good interfaces.<strong></strong></p>
<p><a name="java"></a><br />
<strong><br />
Java<br />
</strong><a href="http://www.java.com/en/">http://www.java.com/en/<br />
</a>Type: Server side compiled language using a virtual machine.<br />
Java was developed by Sun Microsystems which has since been incorporated into Oracle. It is similar in many ways to C++ but it&#8217;s primary goal was to be totally platform agnostic meaning it can run on anything anywhere. It is not only object oriented but strictly operates in objects. You can&#8217;t write java code without it being in an object. Unlike the script languages we&#8217;ve seen so far java is compiled into bytecode before it can be run. This adds performance speed at the cost of more overhead in development time and effort. Generally java is harder to understand use and implement than script languages meaning you need higher level talent to program for it (it&#8217;s more expensive). <strong>Java is not javascript, they are in no way connected in technology, implementation or use. They only share similar names and nothing else and <span style="text-decoration: underline;">cannot</span> be used interchangeably.</strong></p>
<p>Using java for web development means using a <a href="http://en.wikipedia.org/wiki/Java_%28programming_language%29#Servlet">servlet</a> class to process requests and responses through a web server. This is only one of many ways the java language can be used. Notable sites powered by java include Ebay and Amazon and it is widely regarded as one of the best platforms for large scale collaborative enterprise level web work. Small shops are not well served by developing in java because of its complexity and the difficulty and expense of hiring capable developers.<strong></strong></p>
<p><a name="python"></a><br />
<strong>Python<br />
</strong><a href="http://www.python.org/">http://www.python.org/</a><strong><br />
</strong>Type: Server side interpreted, scripting, language (not compiled)<strong><br />
</strong>Python is a server side language that is unique in its attention to whitespace. In python you do not have brackets. Instead code blocks are defined by indentation and lines are ended with linebreaks and not a special character. While it can be used on its own python is only really worth talking about as a web language in relation to the <a href="https://www.djangoproject.com/">django framework</a>. This is used to power many newspaper sites as well as other projects and it is the basis of the <a href="http://www.ellingtoncms.com/">ellington cms</a>.</p>
<p><strong></strong>The django framework is a tool that helps do many common tasks for you. Namely it lets a developer decide on how the data should be structured and stored and have database tables and basic user interfaces to the data built automatically. It also handles users, profiles, registration and cookies with built in tools.</p>
<p><a name="actionscript"></a><br />
<strong>Actionscript<br />
</strong><a href="http://en.wikipedia.org/wiki/ActionScript">http://en.wikipedia.org/wiki/ActionScript<br />
</a>Type: Compiled proprietary plugin language.<br />
Actionscript is the programming language of flash. It has had three major iterations over the years that are now referred to as actionscript 1 2 and 3. It is important, especially if you are making advertisements, to know how to develop in actionscript 2 or 3. This is because many ad networks only accept files that have been coded in actionscript 2 (because they are compatible with older systems).</p>
<p>One key difference in actionscript 3 is the ability to compile a flash file outside of the flash program using the free <a href="http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK">Flex SDK</a>. Flex is another application of the actionscript language that can be used to make desktop applications. The most well known of these is probably <a href="http://www.tweetdeck.com/">Tweetdeck</a>. Whatever you use it for actionscript is a pretty solid language for media. It is easy to pull in videos, images, vector graphics and sound files and use them all dynamically. The disadvantage to working in flash however is that users have to have the flash runtime installed to see your content. On iOS devices like the ipod, iphone and ipad this is impossible (without jailbreaking) meaning your audience is limited. It is expected by many that advances in browsers and html5 media will make javascript fully replace actionscript.</p>
<p><a name="ruby"></a><br />
<strong>Ruby<br />
</strong><a href="http://www.ruby-lang.org/en/">http://www.ruby-lang.org/en/<br />
</a>Type: Server side interpreted, scripting, language (not compiled)<strong><br />
</strong>Ruby is Japanese in origin and has no official specification. I personally have never written ruby code and so I can&#8217;t speak as well on it as other languages but I am including it because of the prominent use of <a href="http://rubyonrails.org/">ruby on rails</a>. Rails as it is often called is a rapid development framework like django is for python. In many ways rails is further along than django being that it has built in javascript and ajax support and it can handle on the fly data structure manipulations that are much harder in django. In the end both are good tools. <a href="http://www.ctctlabs.com/index.php/blog/detail/rails_vs_django/">This article</a> shows more details on the differences between the two.</p>
<p><a name="sql"></a><br />
<strong>SQL<br />
</strong><a href="http://en.wikipedia.org/wiki/SQL">http://en.wikipedia.org/wiki/SQL</a><br />
Type: Not a programming language. Interface to relational databases.<br />
SQL (Structured Query Language) is not a programming language or a markup language. It is the standard interface used to move information in and out of databases, manipulate that data, and generate reports and other information based on data. Sql isn&#8217;t the only way to use a database but it is the most common way. <a href="http://www.mysql.com/">MySql</a> is the most widely used relational database and is a good starting point to learn from as a web developer.</p>
<p>There is also a type of database now that does not use sql at all to avoid the overhead needed to process every feature of the language. <a href="http://www.mongodb.org/">MongoDB </a>is the leading example of this concept.<strong></strong></p>
<p><a name="ajax"></a><br />
<strong>Ajax<br />
</strong><a href="http://en.wikipedia.org/wiki/Ajax_%28programming%29">http://en.wikipedia.org/wiki/Ajax_%28programming%29</a><br />
Type: A method of using several languages in conjunction.<br />
Ajax (asynchronous JavaScript and XML) is really just a concept. By smartly using javascript in the browser to communicate with the server in the background and then change the page it is possible for the user to send and recieve information without reloading the page. This is used very very extensively today. Any in browser chat is ajax based, the gmail interface is all ajax, facebook uses it extensively now for photos and chat. A good place to learn the basic concepts of ajax is through the <a href="http://www.w3schools.com/ajax/default.asp">w3schools lessons</a>.<strong></strong></p>
<p>&nbsp;</p>
<p>That&#8217;s all for now. This is just the beginning if you want to be a web developer but I hope this is useful information for the less technical people that need to communicate with developers too. I know I&#8217;ve left things out. If you want to add anything please do. I am happy to incorporate more information or modify my explanations if it seems necessary.<strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanmccarver.com/programming-languages-for-the-internet/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Google Silently Launches Chromebooks</title>
		<link>http://www.jonathanmccarver.com/google-silently-launches-chromebooks/</link>
		<comments>http://www.jonathanmccarver.com/google-silently-launches-chromebooks/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 15:02:47 +0000</pubDate>
		<dc:creator>Jonathan McCarver</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[chromebook]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[netbook]]></category>

		<guid isPermaLink="false">http://www.jonathanmccarver.com/?p=255</guid>
		<description><![CDATA[The google laptop has come to retail. There was a stir a few months ago when google gave a select few chrome OS laptops out to testers. Today I went to read an article on The Register and saw an &#8230; <a href="http://www.jonathanmccarver.com/google-silently-launches-chromebooks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The google laptop has come to retail. There was a stir a few months ago when google gave a select few chrome OS laptops out to testers. Today I went to read an article on The Register and saw an ad to buy one. It took me to <a href="http://www.amazon.com/b/ref=os_chrm_34?&amp;node=2858603011">this amazon page</a>.</p>
<p><a href="http://www.jonathanmccarver.com/wp-content/uploads/2011/08/chromebook.jpg"><img class="alignnone size-medium wp-image-256 aligncenter" title="chromebook" src="http://www.jonathanmccarver.com/wp-content/uploads/2011/08/chromebook-300x240.jpg" alt="" width="300" height="240" /></a>Apparently they are available from several common laptop makers and all feature the signature chrome keyboard where caps lock is replaced with a search button. Most use a small solid state drive and are netbook sized. Not much of a value compared to their competition but it&#8217;s way cheaper than a macbook air (and a lot less powerful). Do you think this line has any hope?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanmccarver.com/google-silently-launches-chromebooks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

