<?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>CornEmpire Software</title>
	<atom:link href="http://cornempire.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://cornempire.net</link>
	<description>Tidbits about programming, web development, gaming and other random stuff.</description>
	<lastBuildDate>Sat, 31 Mar 2012 11:43:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Linux Mint 12 &#8211; Failure to Boot, and Video Problems (AMD/NVIDIA)</title>
		<link>http://cornempire.net/2012/03/31/linux-mint-12-failure-to-boot-and-video-problems-amd-nvidia/</link>
		<comments>http://cornempire.net/2012/03/31/linux-mint-12-failure-to-boot-and-video-problems-amd-nvidia/#comments</comments>
		<pubDate>Sat, 31 Mar 2012 11:43:47 +0000</pubDate>
		<dc:creator>cornmaster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cornempire.net/?p=370</guid>
		<description><![CDATA[A few weeks ago, I tossed Mint on an old machine to give it a try. Looking for something to replace my Ubuntu 10.04, and I&#8217;m not a fan of Unity at all. Mint, with its extensions to Gnome 3, seem to give the best of the new paradigm without changing everything I like about <a href='http://cornempire.net/2012/03/31/linux-mint-12-failure-to-boot-and-video-problems-amd-nvidia/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, I tossed Mint on an old machine to give it a try.  Looking for something to replace my Ubuntu 10.04, and I&#8217;m not a fan of Unity at all.  Mint, with its extensions to Gnome 3, seem to give the best of the new paradigm without changing everything I like about the old.</p>
<p>So last night I backup up my computer, and began the reinstall.  I had issues even booting the Live DVD on my main computer.  After some internet searching I resolved this by:</p>
<ul>
<li>Pressing <strong>e</strong> at the bootup screen</li>
<li>Adding <strong>nomodeset</strong> to the configuration line before the &#8211;</li>
</ul>
<p>I was then able to boot, and install the OS.  This didn&#8217;t surprise me, as I&#8217;ve had to do similar tricks over the years to install OSes.  Normally when everything is installed, we are good to go.</p>
<p>Oh boy, not this time.  So after the install and reboot, I could not get X to load.  Using the same trick as above, I was able to get into a GUI, but video performance was lack luster as no drivers were loaded.  I attempted to install the restricted drivers, but they would install, and then on reboot, I&#8217;d have nothing again.  I have noticed similar problems on other computers I have which have NVIDIA cards and AMD cpus.  I was determined to find a fix this time.  Instead of using the drivers from the repos, or the open source nouveau driver, I decided to go straight to the <a href="http://www.geforce.com/Drivers" target="_blank">source</a>, and download the driver from NVIDIA.  You can&#8217;t install this from within X, and you will also need some extra packages, so before you start, make sure that:</p>
<ul>
<li>You have all of the compilation tools installed: <strong>sudo apt-get install build-essential</strong></li>
<li>And you have any header or development libraries that are needed for your kernel.</li>
</ul>
<p>Once that is installed, you need to disable X.  You cannot simply kill the X process, because it will start itself back up, and you can&#8217;t really run in runmode 3 or 1 as in the Debian world, 2 &#8211; 5 seem to be the same, and 1 may not run some of the system services required to install the driver.  Many earlier tutorials mention running these commands to stop X for gnome:</p>
<ul>
<li>sudo /etc/init.d/gdm stop</li>
<li>sudo /etc/init.d/gdm3 stop</li>
</ul>
<p>Or KDE:</p>
<ul>
<li>sudo /etc/init.d/kdm stop</li>
</ul>
<p>But on mint, you need to use:</p>
<ul>
<li>sudo /etc/init.d/lightdm stop</li>
</ul>
<p>Once I ran that, I was dropped to a terminal, and I could run the NVIDIA installer as per the instructions.  It disabled the nouveau driver and compiled my driver.  After a reboot, all was good in the world.</p>
<p>I have a few thoughts on a simpler process.  It is possible that the nouveau driver was conflicting with the NVIDIA driver.  If I just disabled, or blacklisted the nouveau driver, the restricted drivers install wizard may have worked fine.</p>
<p>Here are a list of the pages I consulted to come to my resolution:</p>
<ul>
<li><a href="http://forums.linuxmint.com/viewtopic.php?f=191&amp;t=82424&amp;start=20" target="_blank">http://forums.linuxmint.com/viewtopic.php?f=191&amp;t=82424&amp;start=20</a></li>
<li><a href="http://www.geforce.com/Drivers" target="_blank">http://www.geforce.com/Drivers</a></li>
<li><a href="http://us.download.nvidia.com/XFree86/Linux-x86_64/295.33/README/index.html" target="_blank">http://us.download.nvidia.com/XFree86/Linux-x86_64/295.33/README/index.html</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://cornempire.net/2012/03/31/linux-mint-12-failure-to-boot-and-video-problems-amd-nvidia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tournament Bracket Display</title>
		<link>http://cornempire.net/2012/02/26/tournament-bracket-display/</link>
		<comments>http://cornempire.net/2012/02/26/tournament-bracket-display/#comments</comments>
		<pubDate>Sun, 26 Feb 2012 21:36:31 +0000</pubDate>
		<dc:creator>cornmaster</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Sports]]></category>
		<category><![CDATA[Tennis]]></category>
		<category><![CDATA[bracket]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tournament]]></category>

		<guid isPermaLink="false">http://cornempire.net/?p=363</guid>
		<description><![CDATA[One of my long time goals has been to be able to easily display tournament brackets on the web. It seems to be a difficult problem to solve with lots of questions out there, and few answers. There are a few solutions, but they have various issues and downfalls. I decided to give it another <a href='http://cornempire.net/2012/02/26/tournament-bracket-display/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>One of my long time goals has been to be able to easily display tournament brackets on the web.  It seems to be a difficult problem to solve with lots of questions out there, and few answers.  There are a few solutions, but they have various issues and downfalls.  </p>
<p>I decided to give it another try myself.  And this is what I have come up with: <strong>A bracket builder</strong>, a <strong>saved file with raw data</strong>, and a <strong>bracket viewer</strong> that can read the files.  If all that sounds like too much, the bracket builder can just spit out the HTML code to display the tree.</p>
<p>I&#8217;ve outlined how it works, uploaded an example and have provided a download so you can integrate it with your own applications.</p>
<ul>
<li>If you want to see an example of a rendered tree, <a href="http://mptc.tennisnewfoundland.com/bracketviewer.php?file=2011-preseason-mens-consolation" target="_blank">take a look here</a></li>
<li>If you want to generate your own tree, <a href="http://cornempire.net/scripts/bracketcreatordemo/treesetup.php" target="_blank">take a look here</a></li>
<li>Take a look here for complete information: <a href="http://wiki.cornempire.net/tournament/start" title="http://wiki.cornempire.net/tournament/start">http://wiki.cornempire.net/tournament/start</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://cornempire.net/2012/02/26/tournament-bracket-display/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Part 3: A Sample Web Page For Bookings</title>
		<link>http://cornempire.net/2012/01/15/part-3-oauth2-and-configuring-your-application-with-google/</link>
		<comments>http://cornempire.net/2012/01/15/part-3-oauth2-and-configuring-your-application-with-google/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 15:27:21 +0000</pubDate>
		<dc:creator>cornmaster</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[gcal]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://cornempire.net/?p=352</guid>
		<description><![CDATA[This is the third part of a three part series on how to embed a Google Calendar into a web page and use it to accept online bookings/appointments from other online users. The Series: Part 1: Setting up Google Calendar Part 2: OAuth2 and Configuring Your ‘Application’ With Google Part 3: A Sample Web Page <a href='http://cornempire.net/2012/01/15/part-3-oauth2-and-configuring-your-application-with-google/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>This is the third part of a three part series on how to embed a Google Calendar into a web page and use it to accept online bookings/appointments from other online users.</p>
<p>The Series:</p>
<ol>
<li><a href="http://cornempire.net/2011/12/31/part-1-setting-up-google-calendar/">Part 1: Setting up Google Calendar</a></li>
<li><a href="http://cornempire.net/2012/01/08/part-2-oauth2-and-configuring-your-application-with-google/">Part 2: OAuth2 and Configuring Your ‘Application’ With Google</a></li>
<li>Part 3: A Sample Web Page For Bookings &lt;- You Are Here</li>
</ol>
<h2>Recap</h2>
<p>So, I&#8217;ve gone through adding a calendar to your webpage to display to your users, and then creating your application with Google so that you can do queries against your calendar.  Now we get to the fun part, writing the application!  I should mention that this is written in PHP, because I don&#8217;t know if I mentioned that specifically yet.</p>
<h2>The Plan</h2>
<p>The plan is to create a PHP script that will display a list of calendars people can book items on, and then allow them to book off time on one of these calendars.  We will also include some restrictions, like not booking over other events, not booking in the past, only allowing bookings so far into the future, and not allowing bookings during &#8216;closed&#8217; times.  You can add more restrictions as you see fit.</p>
<p>In my example, the script is hosted behind some password protection and user accounts.  Depending on the nature of your application, that may or may not be required.  For this example, I&#8217;m going to assume it is an open system.</p>
<h2>The API</h2>
<p>Google provides a series of classes that you can use to interface with their API.  However, I could not figure out how to use them with refresh tokens.  If you intend to use a lot of the functions of the API, it might be worth while for you to get it working.  However, for me, it was easier to make raw calls to the API since I&#8217;m only using 2 of the API functions.  If you want to download all of the Google code for PHP, you can find the directions <a href="http://code.google.com/apis/calendar/v3/using.html#setup">here</a>.</p>
<h2>Getting Started</h2>
<p>The Google API is based on REST principles, and uses JSON to encode data.  To know exactly what to send to the API, I played around with the <a href="http://code.google.com/apis/explorer/">Google API explorer</a>.  To make a long story short, I&#8217;ll include the code I used for my calls.</p>
<h2>The Functions Needed</h2>
<p>As we are not using the Google code, we will need to create some functions to do our bidding.  We need a function to manage our authentication tokens, to submit post requests (to add events), to submit get requests (to check for previous bookings), and to craft our JSON request for the POST.</p>
<h3>Auth Function</h3>
<pre class="brush: php; title: ; notranslate">
function getAccessToken(){
	$tokenURL = 'https://accounts.google.com/o/oauth2/token';
	$postData = array(
		'client_secret'=&gt;'############',
		'grant_type'=&gt;'refresh_token',
		'refresh_token'=&gt;'###############',
		'client_id'=&gt;'#############.apps.googleusercontent.com'
	);
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $tokenURL);
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

	$tokenReturn = curl_exec($ch);
	$token = json_decode($tokenReturn);
	//var_dump($tokenReturn);
	$accessToken = $token-&gt;access_token;
	return $accessToken;
}
</pre>
<p>You will need to add your values for client_id, refresh_token and client_secret that you established in Part 2 of this tutorial.  This function is pretty stand alone.  The only thing you might want to add to your finished product is better token management. I generate a new token every time.   It would be best to check the token before regenerating, as tokens tend to be good for 3600 seconds.</p>
<h3>Format JSON For Post</h3>
<pre class="brush: php; title: ; notranslate">
function createPostArgsJSON($date,$starttime,$endtime,$title){
	$arg_list = func_get_args();
	foreach($arg_list as $key =&gt; $arg){
		$arg_list[$key] = urlencode($arg);
	}
	$postargs = &lt;&lt;&lt;JSON
{
 &quot;start&quot;: {
  &quot;dateTime&quot;: &quot;{$date}T{$starttime}:00.000-03:30&quot;
 },
 &quot;end&quot;: {
  &quot;dateTime&quot;: &quot;{$date}T{$endtime}:00.000-03:30&quot;
 },
 &quot;summary&quot;: &quot;$title&quot;,
 &quot;description&quot;: &quot;$title&quot;
}
JSON;
	return $postargs;
}
</pre>
<p>This function creates the body of the our post request.  What you include depends on what you are storing in the event.  I only need the start and end time, and a title for the event.  Check out the API explorer to see what you can do.</p>
<p>The date is YYYY-MM-DD format, and times are passed to the function in HH:mm format.  I then pad the string with the seconds and timezone. </p>
<h3>Odds and Ends</h3>
<p>The rest of my functions depend on these odds and ends I set up before   I start doing stuff, so I&#8217;ll cover them here.</p>
<pre class="brush: php; title: ; notranslate">
$thecal = 'court1';
if(isset($_GET['cal'])){
	$thecal = addslashes($_GET['cal']);
}

/*
 * Advance is the amount of time in the future someone can book something.
 * days
 * weeks
 * months
 * If it is 0, it will allow unlimited future booking
 */
$courts = array(
	'court1' =&gt; array('cid' =&gt; 'court1', 'name' =&gt; 'Court 1', 'id' =&gt; '###########@group.calendar.google.com', 'starttime' =&gt; '08:00:00', 'endtime' =&gt; '23:00:00', 'advance' =&gt; '1 week'),
	'court2' =&gt; array('cid' =&gt; 'court2', 'name' =&gt; 'Court 2', 'id' =&gt; '###########@group.calendar.google.com', 'starttime' =&gt; '08:00:00', 'endtime' =&gt; '23:00:00', 'advance' =&gt; '1 week'),
);

$APIKEY = '###################';
</pre>
<p>This script expects a URL parameter to tell it which calendar to load.  I first set it if nothing is specified.  Then I set up the calendars.  I&#8217;m using this for tennis court bookings, hence my naming conventions.  The keys here are:</p>
<ul>
<li>The array index/cid &#8211; This is the url parameter you will pass to the page to load the correct calendar.</li>
<li>name &#8211; The nice name you will display to users.</li>
<li>id &#8211; This is your calendar id from Google that you set up in Part 1.</li>
<li>starttime/endtime &#8211; The limits in booking times specified in HH:mm:ss</li>
<li>advance &#8211; This is the amount of time in the future that you allow bookings.  PHPs strtotime syntax is used for defining the future time.</li>
</ul>
<p>The API key is the key from Part 2.</p>
<h3>Function For Get Requests</h3>
<pre class="brush: php; title: ; notranslate">
function sendGetRequest($token,$request){
	global $APIKEY;

	$session = curl_init($request);

	// Tell curl to use HTTP POST
	curl_setopt ($session, CURLOPT_HTTPGET, true);
	// Tell curl not to return headers, but do return the response
	curl_setopt($session, CURLOPT_HEADER, false);
	curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($session, CURLINFO_HEADER_OUT, false);
	curl_setopt($session, CURLOPT_HTTPHEADER, array('Authorization:  Bearer ' . $token,'X-JavaScript-User-Agent:  Mount Pearl Tennis Club Bookings'));

	$response = curl_exec($session);

	curl_close($session);
	return $response;
}
</pre>
<p>This function preforms a get request.  You need to pass into it the request you want to make, as well as a valid auth token to complete the request.  The function returns the response from the server.</p>
<h3>Function For Post Requests</h3>
<pre class="brush: php; title: ; notranslate">
function sendPostRequest($postargs,$token, $cal){
	global $APIKEY;
	$request = 'https://www.googleapis.com/calendar/v3/calendars/' . $cal . '/events?pp=1&amp;key=' . $APIKEY;

	$session = curl_init($request);

	// Tell curl to use HTTP POST
	curl_setopt ($session, CURLOPT_POST, true);
	// Tell curl that this is the body of the POST
	curl_setopt ($session, CURLOPT_POSTFIELDS, $postargs);
	// Tell curl not to return headers, but do return the response
	curl_setopt($session, CURLOPT_HEADER, false);
	curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
	//curl_setopt($session, CURLOPT_VERBOSE, true);
	curl_setopt($session, CURLINFO_HEADER_OUT, true);
	curl_setopt($session, CURLOPT_HTTPHEADER, array('Content-Type:  application/json','Authorization:  Bearer ' . $token,'X-JavaScript-User-Agent:  Mount Pearl Tennis Club Bookings'));

	$response = curl_exec($session);

	curl_close($session);
	return $response;
}
</pre>
<p>This function accepts your post arguments that were created in another function, your valid auth token, as well as the calendar you want to post too.  </p>
<p>It returns the result from the API.</p>
<h3>Function To Test If Booked Already</h3>
<pre class="brush: php; title: ; notranslate">
function isTimeBooked($date,$starttime,$endtime,$cal){
	global $APIKEY;
	$start = $date . 'T' . $starttime . ':00-03%3A30';
	$end = $date . 'T' . $endtime . ':00-03%3A30';
	$token = getAccessToken();
	$result = sendGetRequest($token, 'https://www.googleapis.com/calendar/v3/calendars/' . $cal . '/events?timeMax=' . $end . '&amp;timeMin=' . $start . '&amp;fields=items(end%2Cstart%2Csummary)&amp;pp=1&amp;key=' . $APIKEY);
	if(strlen($result) &gt; 5){
		return true;
	}
	else{
		return false;
	}
}
</pre>
<p>This function accepts the date, starttime, endtime and calendar id.  It does a check to see if any event exists for this time on the calendar already.  It uses the get request function to get it&#8217;s result.  If the result is more than 5 characters return true, telling us that the time is used, but if it is less then 5, then there are no events, so return false.</p>
<h3>HTML Code For Page</h3>
<pre class="brush: xml; title: ; notranslate">
&lt;html&gt;
&lt;head&gt;

&lt;/head&gt;
&lt;body&gt;

&lt;div class=&quot;courtlist&quot;&gt;
&lt;?php
	foreach($courts as $court){
		echo '&lt;a href=&quot;calbook.php?cal=' . $court['cid'] . '&quot;&gt;' . $court['name'] . '&lt;/a&gt; | ';
	}
?&gt;
&lt;/div&gt;

&lt;?php
	if(strlen($message) &gt; 1){
		echo '&lt;div class=&quot;message&quot;&gt;';
		echo $message;
		echo '&lt;/div&gt;';
	}
?&gt;

&lt;iframe src=&quot;https://www.google.com/calendar/embed?mode=WEEK&amp;amp;showTitle=1&amp;amp;showCalendars=0&amp;amp;height=1000&amp;amp;wkst=2&amp;amp;bgcolor=%23FFFFFF&amp;amp;src=&lt;?php echo $courts[$thecal]['id']; ?&gt;&amp;amp;color=%232952A3&amp;amp;ctz=America%2FSt_Johns&quot; style=&quot; border-width:0 &quot; width=&quot;800&quot; height=&quot;600&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; id=&quot;califrame&quot; onload=&quot;document.getElementById('califrame').contentWindow.scrollTo(0,document.getElementById('califrame').contentWindow.document.body.scrollHeight)&quot;&gt;&lt;/iframe&gt;
&lt;h2&gt;Book a Court&lt;/h2&gt;
&lt;form action=&quot;calbook.php?cal=&lt;?php echo $thecal; ?&gt;&quot; method=&quot;post&quot; name=&quot;booking&quot;&gt;
	&lt;input type=&quot;hidden&quot; readonly=&quot;true&quot; value=&quot;&lt;?php echo $thecal; ?&gt;&quot; name=&quot;calendar&quot;&gt;&lt;/input&gt;
	Court: &lt;input type=&quot;text&quot; readonly=&quot;true&quot; value=&quot;&lt;?php echo $courts[$thecal]['name']; ?&gt;&quot; name=&quot;calendarname&quot;&gt;&lt;/input&gt;&lt;br /&gt;
	Title of Booking: &lt;input type=&quot;text&quot; value=&quot;Booking for ....&quot; name=&quot;title&quot;&gt;&lt;/input&gt;&lt;br /&gt;
	Date: &lt;input type=&quot;text&quot; value=&quot;&lt;?php echo date('Y-m-d'); ?&gt;&quot; id=&quot;startdate&quot; name=&quot;startdate&quot;&gt;&lt;/input&gt;&lt;br /&gt;
	Start Time: &lt;input type=&quot;text&quot; value=&quot;&quot; id=&quot;starttime&quot; name=&quot;starttime&quot;&gt;&lt;/input&gt;&lt;br /&gt;
	End Time: &lt;input type=&quot;text&quot; value=&quot;&quot; id=&quot;endtime&quot; name=&quot;endtime&quot;&gt;&lt;/input&gt;&lt;br /&gt;
	&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Book Court&quot;&gt;&lt;/input&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>This code prints out a list of calendars from our array, and links to them.  </p>
<p>Then it prints out a message if one is set.</p>
<p>Then we use the Google iframe code from Part 1 to display a calendar.</p>
<p>Then we create a form to accept input from our users.  Using a nice date/time picker would make things easier on the user.  The forms posts back to itself, but you could separate much of this code into different files.</p>
<h3>PHP Code To Handle Booking</h3>
<p>So now that we have all of the pieces in place, we can create the code that will accept the input from the users.</p>
<pre class="brush: php; title: ; notranslate">
$message = &quot;&quot;;

if(isset($_POST['submit']) &amp;&amp; $_POST['submit'] == 'Book Court'){
	/*
	 * Check to see if everything was filled out properly.
	 */
	if(date('Ymd') &gt; date('Ymd',strtotime($_POST['startdate']))){
		$message = 'You cannot make a booking in the past.  Please check your date.';
	}
	elseif($_POST['starttime'] == ''){
		$message = 'You must enter a start time.';
	}
	elseif($_POST['endtime'] == ''){
		$message = 'You must enter an end time.';
	}
	/*
	 * Check to see if booking is available for this time.
	 */
	elseif(date('Hms', strtotime($_POST['starttime'] . ':00')) &lt; date('Hms', strtotime($courts[$_POST['calendar']]['starttime'])) || date('Hms', strtotime($_POST['endtime'] . ':00')) &gt; date('Hms', strtotime($courts[$_POST['calendar']]['endtime']))){
		$message = 'Booking not available during this time.  Please select another time.';
	}
	/*
	 * Check to see if we are alowed to book this far in advance.
	 */
	elseif(date('Ymd',strtotime($_POST['startdate'])) &gt; date('Ymd',strtotime('+' . $courts[$_POST['calendar']]['advance'],strtotime($_POST['startdate'])))){
		$message = 'You cannot book that far into the future.  You can only book ' . $courts[$_POST['calendar']]['advance'] . ' in the future.  Please try again.';
		//$message .= date('Ymd',strtotime($_POST['startdate'])) . ' &gt; ' . date('Ymd',strtotime('+' . $courts[$_POST['calendar']]['advance'],strtotime($_POST['startdate'])));
	}
	/*
	 * Check and see if a booking already exists.
	 */
	elseif(isTimeBooked($_POST['startdate'],$_POST['starttime'],$_POST['endtime'],$courts[$_POST['calendar']]['id'])){
		$message = 'Time already booked.  Please select another time.';
	}
	/*
	 * Everything is good, submit the event.
	 */
	else{
		$postargs = createPostArgsJSON($_POST['startdate'],$_POST['starttime'],$_POST['endtime'],$_POST['title']);
		$token = getAccessToken();
		$result = sendPostRequest($postargs,$token,$courts[$_POST['calendar']]['id']);
		//echo '&lt;pre&gt;' . $result . '&lt;/pre&gt;';
	}
}
</pre>
<p>This code checks to see if a form was submitted, and then completes a series of checks to make sure that it is a valid request.  If they all pass, then the event is added to the calendar.  You may want to print a message to let the user know that the event was added.</p>
<p>At this point, you have a fully working calendar booking system.  You can experiment with the API to add additional features.</p>
<p>Hopefully this tutorial series was of some use to you.  If you have any questions, feel free to post them below.</p>
]]></content:encoded>
			<wfw:commentRss>http://cornempire.net/2012/01/15/part-3-oauth2-and-configuring-your-application-with-google/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Part 2: OAuth2 and Configuring Your ‘Application’ With Google</title>
		<link>http://cornempire.net/2012/01/08/part-2-oauth2-and-configuring-your-application-with-google/</link>
		<comments>http://cornempire.net/2012/01/08/part-2-oauth2-and-configuring-your-application-with-google/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 19:58:38 +0000</pubDate>
		<dc:creator>cornmaster</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[gcal]]></category>
		<category><![CDATA[google calendar]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://cornempire.net/?p=322</guid>
		<description><![CDATA[This is the second part of a three part series on how to embed a Google Calendar into a web page and use it to accept online bookings/appointments from other online users. The Series: Part 1: Setting up Google Calendar Part 2: OAuth2 and Configuring Your ‘Application’ With Google &#60;- You Are Here Part 3: <a href='http://cornempire.net/2012/01/08/part-2-oauth2-and-configuring-your-application-with-google/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>This is the second part of a three part series on how to embed a Google Calendar into a web page and use it to accept online bookings/appointments from other online users.</p>
<p>The Series:</p>
<ol>
<li><a href="http://cornempire.net/2011/12/31/part-1-setting-up-google-calendar/">Part 1: Setting up Google Calendar</a></li>
<li>Part 2: OAuth2 and Configuring Your ‘Application’ With Google &lt;- You Are Here</li>
<li><a href="http://cornempire.net/2012/01/15/part-3-oauth2-and-configuring-your-application-with-google/">Part 3: A Sample Web Page For Bookings</a></li>
</ol>
<h2>Background</h2>
<p>This was by far the hardest part of the whole exercise. I had worked with version 1 of the Google API for PHP a few years back. This allowed you to code your username and password into your script, and it would handle authentication for your application. Now that we are on to version 3 of the API, that method is no longer available. Instead OAuth2 is used for authentication and token management.</p>
<p>I downloaded code samples, and went about building my application, however, I quickly realized that the OAuth2 code samples are designed to allow you to interact with a visitors calendar. In the case of taking online bookings, I need to work with a single calendar, namely my calendar, not theirs.</p>
<p>After a lot of trial and error, and then reading, I realized that it could be done, and relied on what is called a &#8216;Refresh Token&#8217; in OAuth2. This token allows you to get a new valid authentication token when the initial grant from your end user expires. Since the refresh token doesn&#8217;t expire, you can always use it to get a new authentication token, and therefore people can continue to use your application after you have initially configured it. I spent a while trying to implement it myself with no success, but then I came across this page: <a title="http://www.ericnagel.com/how-to-tips/google-affiliate-network-api.html" href="http://www.ericnagel.com/how-to-tips/google-affiliate-network-api.html" target="_blank">http://www.ericnagel.com/how-to-tips/google-affiliate-network-api.html</a> This explains in some detail how to configure the application and token. It is written for the Google Affiliate Network API, but I made a few tweaks to make it work for Calendar. I will now take you through the steps of setting up your application with Google, and generating your Refresh Token.</p>
<h2>Create Your Application</h2>
<p>Log into your Google Account, and then visit <a title="https://code.google.com/apis/console/" href="https://code.google.com/apis/console/" target="_blank">https://code.google.com/apis/console/</a>. This will take you to a page that invites you to create a project with the Google API. Click on <strong>Create project&#8230;</strong>.</p>
<p>You are now asked to activate the services you wish to use. Click the button next to <strong>Calendar API</strong> to enable the calendar. You will be redirected to a page with a Terms of Service. Read and accept this.</p>
<p>Now click on <strong>API Access</strong>. Here we will configure the IDs needed for your application to authenticate with Google. Click on <strong>Create an OAuth2 client ID&#8230;</strong>. You will be offered to create Branding Information. You should add your project/product name. The rest won&#8217;t be necessary as you will not be asking users directly for access to their resources, but you can complete it if you like.</p>
<p><a href="http://cornempire.net/files/2012/01/oauth1.png"><img src="http://cornempire.net/files/2012/01/oauth1.png" alt="" width="755" height="551" class="aligncenter size-full wp-image-344" /></a></p>
<p>Then click <strong>Next</strong>. Here you will want to select <strong>Installed application</strong>. Click <strong>Create client ID</strong>.</p>
<p><a href="http://cornempire.net/files/2012/01/oauth2.png"><img src="http://cornempire.net/files/2012/01/oauth2.png" alt="" width="561" height="300" class="aligncenter size-full wp-image-345" /></a></p>
<p>You will be taken back to the API Access screen, with your new Client ID and Client secret. You will need this information to generate your Refresh Token, and to configure your application. </p>
<p><a href="http://cornempire.net/files/2012/01/oauth3.png"><img src="http://cornempire.net/files/2012/01/oauth3.png" alt="" width="560" height="280" class="aligncenter size-full wp-image-346" /></a></p>
<p>This page will also have your API key for &#8216;Simple API Access&#8217;. You will also need this API Key for your final calendar application.</p>
<p><a href="http://cornempire.net/files/2012/01/api1.png"><img src="http://cornempire.net/files/2012/01/api1.png" alt="" width="538" height="215" class="aligncenter size-full wp-image-342" /></a> </p>
<h2>Get Your Application Information</h2>
<p>Now that you have your application information, it is time to generate your refresh token. I&#8217;ve modified the script available from <a title="http://www.ericnagel.com/how-to-tips/google-affiliate-network-api.html" href="http://www.ericnagel.com/how-to-tips/google-affiliate-network-api.html" target="_blank">http://www.ericnagel.com/how-to-tips/google-affiliate-network-api.html</a> to just get us our refresh token for our calendar application. Here is the code for the script.  Download this and save it as <em>oauth-setup.php</em>:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
$cScope         =   'https://www.googleapis.com/auth/calendar';
$cClientID      =   '';
$cClientSecret  =   '';
$cRedirectURI   =   'urn:ietf:wg:oauth:2.0:oob';

$cAuthCode      =   '';

if (empty($cAuthCode)) {
    $rsParams = array(
                        'response_type' =&gt;   'code',
                        'client_id'     =&gt;   $cClientID,
                        'redirect_uri'  =&gt;   $cRedirectURI,
                        'scope'         =&gt;   $cScope
                        );
    $cOauthURL = 'https://accounts.google.com/o/oauth2/auth?' . http_build_query($rsParams);
    echo(&quot;Go to\n$cOauthURL\nand enter the given value into this script under \$cAuthCode\n&quot;);
    exit();
} // ends if (empty($cAuthCode))
elseif (empty($cRefreshToken)) {
    $cTokenURL = 'https://accounts.google.com/o/oauth2/token';
    $rsPostData = array(
                        'code'          =&gt;   $cAuthCode,
                        'client_id'     =&gt;   $cClientID,
                        'client_secret' =&gt;   $cClientSecret,
                        'redirect_uri'  =&gt;   $cRedirectURI,
                        'grant_type'    =&gt;   'authorization_code',
                        );
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $cTokenURL);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $rsPostData);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $cTokenReturn = curl_exec($ch);
    $oToken = json_decode($cTokenReturn);
    echo(&quot;Here is your Refresh Token for your application.  Do not loose this!\n\n&quot;);
    echo(&quot;Refresh Token = '&quot; . $oToken-&gt;refresh_token . &quot;';\n&quot;);
} // ends
?&gt;
</pre>
<p>Before running this script, you will need to enter your Client ID ($cClientID) and Client Secret ($cClientSecret) as we found on the API page with Google.  Once these values are added, run this script from the command line like this: <strong>php oauth-setup.php</strong>.  You should see output like this:</p>
<pre>
thomas@thomas-desktop:~/code$ php oauth-setup.php
Go to

https://accounts.google.com/o/oauth2/auth?response_type=code&#038;client_id=##########################&#038;redirect_uri=###############&#038;scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcalendar

and enter the given value into this script under $cAuthCode
</pre>
<p>Visit the website, grant permission to access your resources, and then copy the code on this page.  This is your auth code, and is normally good for 3600 seconds or so.  </p>
<p><a href="http://cornempire.net/files/2012/01/authcode.png"><img src="http://cornempire.net/files/2012/01/authcode.png" alt="" width="400" height="57" class="aligncenter size-full wp-image-343" /></a></p>
<p>Enter this code into the oauth-setup.php script in the $cAuthCode variable.  Then run the script again: <strong>php oauth-setup.php</strong>.  You should see output like this:</p>
<pre>
thomas@thomas-desktop:~/code$ php oauth-setup.php
Here is your Refresh Token for your application.  Do not loose this!

Refresh Token = '#####################################';
</pre>
<p>Now, copy down the Refresh Token and save it for later.  You will need it to make subsequent requests to Google to get a valid Auth Code for a transaction.</p>
<p>Stay tuned for Part 3 of the tutorial, which will use the above information to make calendar requests to Google.  And allow us to create a web application that uses Google Calendar as a backend for a scheduling application.</p>
]]></content:encoded>
			<wfw:commentRss>http://cornempire.net/2012/01/08/part-2-oauth2-and-configuring-your-application-with-google/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Part 1: Setting Up Google Calendar</title>
		<link>http://cornempire.net/2011/12/31/part-1-setting-up-google-calendar/</link>
		<comments>http://cornempire.net/2011/12/31/part-1-setting-up-google-calendar/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 14:46:35 +0000</pubDate>
		<dc:creator>cornmaster</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[gcal]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://cornempire.net/?p=311</guid>
		<description><![CDATA[This is the first part of a three part series on how to embed a Google Calendar into a web page and use it to accept online bookings/appointments from other online users. The Series: Part 1: Setting up Google Calendar &#60;- You Are Here Part 2: OAuth2 and Configuring Your &#8216;Application&#8217; With Google Part 3: <a href='http://cornempire.net/2011/12/31/part-1-setting-up-google-calendar/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>This is the first part of a three part series on how to embed a Google Calendar into a web page and use it to accept online bookings/appointments from other online users.</p>
<p>The Series:</p>
<ol>
<li>Part 1: Setting up Google Calendar &lt;- You Are Here</li>
<li><a href="http://cornempire.net/2012/01/08/part-2-oauth2-and-configuring-your-application-with-google/">Part 2: OAuth2 and Configuring Your &#8216;Application&#8217; With Google</a></li>
<li><a href="http://cornempire.net/2012/01/15/part-3-oauth2-and-configuring-your-application-with-google/">Part 3: A Sample Web Page For Bookings</a></li>
</ol>
<h2>Part 1: Setting up Google Calendar to be embedded into a web page</h2>
<p>You can already use Google Calendar on your web page for displaying your schedule.  This tutorial will take you through that process quickly highlighting some of the key pieces that you will need later.</p>
<h3>Step 1: Signup for a Google Account and Create Your Calendar</h3>
<p>I&#8217;m going to assume you have, or know how to get a Google Account.  You can get a Google Account (with your email address) here: <a href="https://accounts.google.com/NewAccount" target="_blank">https://accounts.google.com/NewAccount</a> or you can just sign up for a Gmail account, which is awesome, here: <a href="https://accounts.google.com/NewAccount?service=mail&amp;continue=http://mail.google.com/mail/e-11-cf5c9f72b92b7a0f5c1f47b879e4b-e035ec50fab44f274a9436e7e96b8bbcef278d4e&amp;type=2" target="_blank">https://accounts.google.com/NewAccount?service=mail&amp;continue=http://mail.google.com/mail/e-11-cf5c9f72b92b7a0f5c1f47b879e4b-e035ec50fab44f274a9436e7e96b8bbcef278d4e&amp;type=2</a>.</p>
<p>Now, go into Google Calendar, and create a calendar that you will use for your appointments.</p>
<p><a href="http://cornempire.net/files/2011/12/create1.png"><img src="http://cornempire.net/files/2011/12/create1.png" alt="" width="424" height="384" class="aligncenter size-full wp-image-312" /></a></p>
<p><a href="http://cornempire.net/files/2011/12/create2.png"><img src="http://cornempire.net/files/2011/12/create2.png" alt="" width="572" height="487" class="aligncenter size-full wp-image-313" /></a></p>
<p>Give the calendar a name (1), description (2), and location (3).</p>
<p>Here you have the option to configure sharing (4).  You will need to make the calendar public for others to see it.  You can optionally choose to display only Free/Busy information to protect the privacy of the events (5).</p>
<p>Now, you need to grab the embed code to add the calendar to your site.  You grab this by going to Calendar Settings.  </p>
<p><a href="http://cornempire.net/files/2011/12/settings1.png"><img src="http://cornempire.net/files/2011/12/settings1.png" alt="" width="355" height="367" class="aligncenter size-full wp-image-314" /></a></p>
<h3>Step 2: Get The Calendar Embed Code and Calendar ID</h3>
<p>Here you will see the embed code (1), and a link to customize your output.  On this page you will also see the Calendar ID (2).</p>
<p><a href="http://cornempire.net/files/2011/12/settings2.png"><img src="http://cornempire.net/files/2011/12/settings2.png" alt="" width="773" height="348" class="aligncenter size-full wp-image-315" /></a></p>
<p>This code will put an IFRAME on your page which will display your calendar.  You can use the customized to tweak the look and feel of the calendar.</p>
<p>You will need the calendar ID for the next parts of the tutorial.</p>
<p>That is the end of this tutorial.  You now have a calendar added to your website which will display your schedule to your web users.</p>
<p>Stay tuned for Part 2 of the tutorial, which will get our application set up with Google so that we can use the API to add events to the calendar.</p>
]]></content:encoded>
			<wfw:commentRss>http://cornempire.net/2011/12/31/part-1-setting-up-google-calendar/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Speed Up X11 Forwarding</title>
		<link>http://cornempire.net/2011/12/24/speed-up-x11-forwarding/</link>
		<comments>http://cornempire.net/2011/12/24/speed-up-x11-forwarding/#comments</comments>
		<pubDate>Sat, 24 Dec 2011 01:22:43 +0000</pubDate>
		<dc:creator>cornmaster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cornempire.net/?p=305</guid>
		<description><![CDATA[For those who work on multiple Linux/Unix machines, we sometimes need to do work remotely. Sometimes the terminal doesn&#8217;t cut it, and we need to use a GUI application. There are a number of ways to view a GUI on a remote machine, but one way is by X11 forwarding through an SSH connection. One <a href='http://cornempire.net/2011/12/24/speed-up-x11-forwarding/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>For those who work on multiple Linux/Unix machines, we sometimes need to do work remotely.  Sometimes the terminal doesn&#8217;t cut it, and we need to use a GUI application.  There are a number of ways to view a GUI on a remote machine, but one way is by X11 forwarding through an SSH connection.</p>
<p>One problem with X11 forwarding, especially over the internet, is the slow speed.  This post hopes to explain X11 forwarding, and ways to speed it up.</p>
<p>You can use the command:<br />
<code>ssh -c arcfour,blowfish-cbc -X -C user@192.168.11.3</code><br />
To establish an SSH session with X11 forwarding enabled.  Then all you need to do is launch a X program and it should appear on your local display.  Before I explain the command, you must first have X11 forwarding enabled in your sshd_config on your server.  Set <em>X11Forwarding yes</em> in your config file.</p>
<p>Now, for the SSH command:</p>
<ul>
<li><strong>-c arcfour,blowfish-cbc</strong> : specifies the encryption algorithms to use.  These seem to be some of the fastest.</li>
<li><strong>-X</strong> : This enables X11 Forwarding</li>
<li><strong>-C</strong> : This enables compression</li>
<li><strong>user@192.168.11.3</strong> : This is the user name of the remote machine, and the IP address of that server.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://cornempire.net/2011/12/24/speed-up-x11-forwarding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Management Game</title>
		<link>http://cornempire.net/2011/12/07/project-management-game/</link>
		<comments>http://cornempire.net/2011/12/07/project-management-game/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 01:55:20 +0000</pubDate>
		<dc:creator>cornmaster</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cornempire.net/?p=300</guid>
		<description><![CDATA[Yeah, I&#8217;m a dork. But as a project manager, it was fun for a bit. http://thatpmgame.com Can you beat my score? &#8220;You have completed 6 projects on-time and under-budget valued at $5.1 million. Put THAT on your resume!&#8221;]]></description>
			<content:encoded><![CDATA[<p>Yeah, I&#8217;m a dork.  But as a project manager, it was fun for a bit.</p>
<p><a href="http://thatpmgame.com/">http://thatpmgame.com</a></p>
<p>Can you beat my score?</p>
<p>&#8220;You have completed 6 projects on-time and under-budget valued at $5.1 million. Put THAT on your resume!&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://cornempire.net/2011/12/07/project-management-game/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Diff in Filezilla</title>
		<link>http://cornempire.net/2011/08/09/diff-in-filezilla/</link>
		<comments>http://cornempire.net/2011/08/09/diff-in-filezilla/#comments</comments>
		<pubDate>Tue, 09 Aug 2011 14:13:15 +0000</pubDate>
		<dc:creator>cornmaster</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[filezilla]]></category>

		<guid isPermaLink="false">http://cornempire.net/?p=296</guid>
		<description><![CDATA[Filezilla is a great ftp/sftp/&#8230; tool. But it is missing one feature that would make it more useful: a file diff ability. This allows you to see the remote file, and local file side by side to see what is different between them. This is an often requested feature in the Filezilla forums, and until <a href='http://cornempire.net/2011/08/09/diff-in-filezilla/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Filezilla is a great ftp/sftp/&#8230; tool.  But it is missing one feature that would make it more useful: a file diff ability.  This allows you to see the remote file, and local file side by side to see what is different between them.  This is an often requested feature in the Filezilla forums, and until it is implemented officially, you can use this workaround to get diffs in Filezilla.</p>
<p>This was done running Filezilla 3.3.1 on Ubuntu 10.04.</p>
<ol>
<li>First, install Meld (haven&#8217;t tried it with any other diff viewer yet)</li>
<li>Then go to Edit -&gt; Settings -&gt; File editing</li>
<li>Change to &#8216;Use custom editor:&#8217; and enter: /usr/bin/meld /home/{yourusername}/filezillafake.txt</li>
<li>Click OK.</li>
<li>Create a file in your home directory called filezillafake.txt</li>
<li>You may need to also select &#8220;Always use default editor&#8221;.  Optionally, you can go one menu below to &#8220;Filetype associations&#8221; and add the command for any file types that you want so it isn&#8217;t available for all.</li>
</ol>
<p>Now, when you View/Edit a file, it will open in meld with your fake file on the left, and the remote file on the right. Then <strong>drag the file from your filezilla window into the &#8216;Browse&#8217; area</strong> for the fake file in the Meld Window. It will load up and show you the diff.</p>
<p>You should be able to edit the file here and save it and Filezilla should prompt for an upload.</p>
<p>This works because Meld supports drag and drop, and also inserting two file names at the command prompt. Any application for any platform that does that should be supported by this method. The only downside is that Meld is now your default editor for files, and you may not like that if you do a lot of remote editing.</p>
]]></content:encoded>
			<wfw:commentRss>http://cornempire.net/2011/08/09/diff-in-filezilla/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tennis Court Catalog for Newfoundland</title>
		<link>http://cornempire.net/2011/08/07/tennis-court-catalog-for-newfoundland/</link>
		<comments>http://cornempire.net/2011/08/07/tennis-court-catalog-for-newfoundland/#comments</comments>
		<pubDate>Sun, 07 Aug 2011 23:10:06 +0000</pubDate>
		<dc:creator>cornmaster</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tennis]]></category>
		<category><![CDATA[tennisnl]]></category>

		<guid isPermaLink="false">http://cornempire.net/?p=294</guid>
		<description><![CDATA[I recently began working on a new website that will catalog all of the tennis courts in Newfoundland.  You can visit at http://www.tennisnewfoundland.com Today I added coordinates for each court and city. This allows me to create a custom google map for each page and put links directly on the map. I also added a <a href='http://cornempire.net/2011/08/07/tennis-court-catalog-for-newfoundland/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I recently began working on a new website that will catalog all of the tennis courts in Newfoundland.  You can visit at <a href="http://www.tennisnewfoundland.com">http://www.tennisnewfoundland.com</a></p>
<p>Today I added coordinates for each court and city.  This allows me to create a custom google map for each page and put links directly on the map.  I also added a verification feature so that courts which are confirmed open float to the top and those which aren&#8217;t float to the bottom.  I made some tweaks to the style sheets as well which should make the site more userfriendly on mobile devices.</p>
<p>Other features include a commenting feature using Disqus, pages for cities and a list of clubs in the province.</p>
<p>Take a look and let me know what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://cornempire.net/2011/08/07/tennis-court-catalog-for-newfoundland/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Duke Nukem Forever/Flatout</title>
		<link>http://cornempire.net/2011/07/01/duke-nukem-foreverflatout/</link>
		<comments>http://cornempire.net/2011/07/01/duke-nukem-foreverflatout/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 16:22:54 +0000</pubDate>
		<dc:creator>cornmaster</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[dnf]]></category>
		<category><![CDATA[duke nukem]]></category>
		<category><![CDATA[flatout]]></category>
		<category><![CDATA[gog]]></category>

		<guid isPermaLink="false">http://cornempire.net/?p=290</guid>
		<description><![CDATA[Duke Nukem Forever Well, I spent real money and actually bought a game recently.  And it was Duke Nukem Forever.  I played the original Dukes and Duke 3D when I was younger.  It was a lot of fun, and took the FPS genre a little farther, with destroy-able worlds, humour, and fun weapons. I haven&#8217;t <a href='http://cornempire.net/2011/07/01/duke-nukem-foreverflatout/' class='excerpt-more'>[...]</a>]]></description>
			<content:encoded><![CDATA[<h1>Duke Nukem Forever</h1>
<p>Well, I spent real money and actually bought a game recently.  And it was <a href="http://www.dukenukemforever.com/" target="_blank">Duke Nukem Forever</a>.  I played the original Dukes and Duke 3D when I was younger.  It was a lot of fun, and took the FPS genre a little farther, with destroy-able worlds, humour, and fun weapons.</p>
<p>I haven&#8217;t played many FPSes since then, played through Doom 3 single player, and a bit of the Unreal Tournament Series with a focus on multiplayer and some more realistic shooters.  I was hoping that Duke Nukem Forever (DNF) would bring back good old days of funny gameplay in a very interactive world with crazy weapons and exploration based gameplay.  Boy, was I disappointed.</p>
<p>DNF was not much fun to play.  The level design was very linear, with a focus on pre-programmed areas of massive combat.  Duke was only allowed to carry two weapons (only two weapons!  This is freaken Duke Nukem!) and there wasn&#8217;t much exploration at all.  Also, the boss battles were very, very, very repetitive.  The game was also very short.  I gave multiplayer a try, but it doesn&#8217;t seem all that good yet either.</p>
<p>All that said, when it wasn&#8217;t offensive, it was kind of funny, and the graphics, music and sounds were pretty good.  If I were you, and you were interested, pick it up on the cheap, and hope the modding community can pump out some good levels.</p>
<h1>Flatout</h1>
<p>To contrast that experience, I found <a href="http://en.wikipedia.org/wiki/FlatOut_%28video_game%29" target="_blank">Flatout</a> from <a href="http://www.gog.com/" target="_blank">Good Old Games</a> for the low, low price of $3.  All games from GOG are DRM free, and available online for download right after you purchase them.</p>
<p>The $3 for Flatout was the best $3 I&#8217;ve ever spent.  Flatout is an excellent racing game with several modes and bonus modes such as darts and bowling.  Where you eject your driver through the windshield to try and score points.</p>
<p>I even dusted off the old game pad and hooked it up to play.</p>
<p>If you like racing games, I would highly recommend this title.</p>
]]></content:encoded>
			<wfw:commentRss>http://cornempire.net/2011/07/01/duke-nukem-foreverflatout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

