<?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>For the Love of Geeks &#187; podcast</title>
	<atom:link href="http://www.fortheloveofgeeks.com/tag/podcast/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fortheloveofgeeks.com</link>
	<description>I am a geek, and I&#039;m OK!</description>
	<lastBuildDate>Sun, 12 Jun 2011 20:39:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Good Bye From Geeks On PHP</title>
		<link>http://www.fortheloveofgeeks.com/2010/10/26/good-bye-from-geeks-on-php/</link>
		<comments>http://www.fortheloveofgeeks.com/2010/10/26/good-bye-from-geeks-on-php/#comments</comments>
		<pubDate>Tue, 26 Oct 2010 22:46:41 +0000</pubDate>
		<dc:creator>Nicholas Kreidberg</dc:creator>
				<category><![CDATA[Geeks On PHP]]></category>
		<category><![CDATA[darthweef]]></category>
		<category><![CDATA[kreidberg]]></category>
		<category><![CDATA[niczak]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[podcast]]></category>
		<category><![CDATA[Stephen Johnson]]></category>

		<guid isPermaLink="false">http://www.fortheloveofgeeks.com/?p=1715</guid>
		<description><![CDATA[It has been a long time (far too long) since we let everybody know what is going on with Geeks On PHP so here I am to do exactly that. Due to some scheduling issues and unforeseen events Stephen and I have decided to disband the Geeks On PHP podcast. We had a great time [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.fortheloveofgeeks.com/wp-content/uploads/2009/07/geeksOnPHPsmall.png"><img class="alignleft size-full wp-image-1189" title="Geeks On PHP" src="http://www.fortheloveofgeeks.com/wp-content/uploads/2009/07/geeksOnPHPsmall.png" alt="" width="144" height="144" /></a></p>
<p>It has been a long time (far too long) since we let everybody know what is going on with Geeks On PHP so here I am to do exactly that.  Due to some scheduling issues and unforeseen events Stephen and I have decided to disband the Geeks On PHP podcast.  We had a great time bringing you weekly discussions on PHP, web development, databases and everything in between.</p>
<p>I recently started a new project called <a href="http://tweetphp.com" target="_blank">TweetPHP</a> which is a web site and podcast focused on collaborative PHP development.  We are using <a href="http://github.com/mitchellhislop/TweetPHP" target="_blank">github</a> to host our codebase and allow users to fork off their own copies of the repository and add/modify/contribute.  If you are interested in a podcast focused on PHP and were still waiting for the OOP series then I urge you check out TweetPHP as we will be discussing object oriented programming in our next episode.</p>
<p>I will still be contributing to For the Love of Geeks in the form of blog posts and helping maintain the <a href="http://twitter.com/ftlog" target="_blank">twitter</a> account.  If you are interested in seeing what else I am up to please check out <a href="http://nicholaskreidberg.com" target="_blank">http://nicholaskreidberg.com</a>.</p>
<p>Thanks,</p>
<p>- <a href="mailto:niczak@gmail.com?subject=FTLOG">Nicholas</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.fortheloveofgeeks.com%2F2010%2F10%2F26%2Fgood-bye-from-geeks-on-php%2F&amp;title=Good%20Bye%20From%20Geeks%20On%20PHP" id="wpa2a_2"><img src="http://www.fortheloveofgeeks.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.fortheloveofgeeks.com/2010/10/26/good-bye-from-geeks-on-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Geeks On PHP OOP Update</title>
		<link>http://www.fortheloveofgeeks.com/2010/07/16/geeks-on-php-oop-update/</link>
		<comments>http://www.fortheloveofgeeks.com/2010/07/16/geeks-on-php-oop-update/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 18:26:01 +0000</pubDate>
		<dc:creator>Nicholas Kreidberg</dc:creator>
				<category><![CDATA[Geeks On PHP]]></category>
		<category><![CDATA[darthweef]]></category>
		<category><![CDATA[kreidberg]]></category>
		<category><![CDATA[mitchell hislop]]></category>
		<category><![CDATA[nicholas kreidberg]]></category>
		<category><![CDATA[niczak]]></category>
		<category><![CDATA[oop]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[podcast]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Stephen Johnson]]></category>

		<guid isPermaLink="false">http://www.fortheloveofgeeks.com/?p=1677</guid>
		<description><![CDATA[I want to give everybody a quick update on what is going on with Geeks On PHP and what to expect in the near future. As we talked about on our last episode we are putting together a series of podcasts focused on OOP in PHP. Unfortunately due to time constraints, work overload and other [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.fortheloveofgeeks.com/wp-content/uploads/2009/07/geeksOnPHPsmall.png" alt="" title="Geeks On PHP" width="144" height="144" class="alignleft size-full wp-image-1189" /></p>
<p>I want to give everybody a quick update on what is going on with Geeks On PHP and what to expect in the near future.  As we talked about on our last episode we are putting together a series of podcasts focused on OOP in PHP.  Unfortunately due to time constraints, work overload and other things out of our control we have had to push things back a bit.  The series is still going to happen and we are excited to have <a href="http://twitter.com/mitchellhislop" target="_blank">Mitchell Hislop</a> who is a friend of mine and a very talented developer / social media expert joining us for the series.  </p>
<p>As soon as we are able to settle on dates to record I will provide updates via Twitter and our Facebook page letting people know what to expect.  Thank you for your patience and we look forward to releasing a great series on OOP!</p>
<p>Follow both <a href="http://twitter.com/darthweef" target="_blank">Stephen</a> &#038; <a href="http://twitter.com/niczak" target="_blank">Myself</a> on <a href="http://twitter.com/niczak" target="_blank">Twitter</a> and also <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=325498336" target="_blank">subscribe via Tunes.</a></p>
<p>- <a href="mailto:niczak@gmail.com">Nicholas</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.fortheloveofgeeks.com%2F2010%2F07%2F16%2Fgeeks-on-php-oop-update%2F&amp;title=Geeks%20On%20PHP%20OOP%20Update" id="wpa2a_4"><img src="http://www.fortheloveofgeeks.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.fortheloveofgeeks.com/2010/07/16/geeks-on-php-oop-update/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Geeks On PHP Episode 14</title>
		<link>http://www.fortheloveofgeeks.com/2010/06/21/geeks-on-php-episode-14/</link>
		<comments>http://www.fortheloveofgeeks.com/2010/06/21/geeks-on-php-episode-14/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 17:03:57 +0000</pubDate>
		<dc:creator>Nicholas Kreidberg</dc:creator>
				<category><![CDATA[Geeks On PHP]]></category>
		<category><![CDATA[darthweef]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[geeks]]></category>
		<category><![CDATA[kreidberg]]></category>
		<category><![CDATA[niczak]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[podcast]]></category>

		<guid isPermaLink="false">http://www.fortheloveofgeeks.com/?p=1636</guid>
		<description><![CDATA[This week Stephen and I talk about user defined functions in PHP and why they matter. This is a precursor to our upcoming series on OOP in PHP. Functions are the key to reusable code and thus should be used as often as it makes sense. Duplicating code is a big no no and should [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.fortheloveofgeeks.com/wp-content/uploads/2009/07/geeksOnPHPsmall.png" alt="" title="Geeks On PHP" width="144" height="144" class="alignleft size-full wp-image-1189" /></p>
<p>This week <a href="http://twitter.com/darthweef" target="_blank">Stephen</a> <a href="http://twitter.com/niczak" target="_blank">and I</a> talk about user defined functions in PHP and why they matter.  This is a precursor to our upcoming series on OOP in PHP.</p>
<p>Functions are the key to reusable code and thus should be used as often as it makes sense.  Duplicating code is a big no no and should avoided at all costs, this is where functions come into play.  Just last week I was working on a script that pulled back two different data sets (as arrays) and needed to do essentially the same thing to these two sets.  Rather than duplicate the code twice I just converted my logic to a function and boom I was off an running with no duplication what-so-ever.</p>
<pre>
function fnXML_Body($adata)
{
  $sxml_body = NULL;
  $i = 0;
  foreach($adata as $arow)
  {
    foreach($arow as $svar=>$sval)
    {
      switch($svar)
      {
        case "slabel":
          $slabel = $sval;
          break;
        case "ivalue":
          $ivalue = $sval;
          break;
      }
      if($i < 2)
        $sslice = "isSliced=\"1\"";
      else
        $sslice = NULL;
    }
    $sxml_body .= "<set label=\"$slabel\" value=\"$ivalue\" $sslice />\n";
    $i++;
  }
  return $sxml_body;
}
</pre>
<p>Using the function above I can call pass a new data array to it as many times as I need to in a script without duplicating any code.  The function accepts the data array, does some parsing and returns the XML that I need to generate a 3D Pie Chart.</p>
<p>The call to this function would be as follows:</p>
<pre>
  $sxml_body = fnXML_Body($adata);
</pre>
<p>In the next couple weeks we are going to kick off a series on object oriented programming with PHP which will include all the basics as well as the tools needed to build a small web application from start to finish.  We will be featuring a special guest for this series, it&#8217;s going to be very exciting and something you definitely don&#8217;t want to miss. </p>
<p>Follow both <a href="http://twitter.com/darthweef" target="_blank">Stephen</a> and <a href="http://twitter.com/niczak" target="_blank">Myself</a> on <a href="http://twitter.com/niczak" target="_blank">Twitter</a> and also <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=325498336" target="_blank">subscribe via Tunes</a>!</p>
<p>Enjoy the show and as always, stay geeky!</p>
<p>- <a href="mailto:niczak@gmail.com">Nicholas</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.fortheloveofgeeks.com%2F2010%2F06%2F21%2Fgeeks-on-php-episode-14%2F&amp;title=Geeks%20On%20PHP%20Episode%2014" id="wpa2a_6"><img src="http://www.fortheloveofgeeks.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.fortheloveofgeeks.com/2010/06/21/geeks-on-php-episode-14/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://m.podshow.com/download_media/22614/episodes/236733/phpgeeks-236733-06-20-2010.mp3" length="16961963" type="audio/mpeg" />
		</item>
		<item>
		<title>Geeks On PHP Episode 13</title>
		<link>http://www.fortheloveofgeeks.com/2010/06/05/geeks-on-php-episode-13/</link>
		<comments>http://www.fortheloveofgeeks.com/2010/06/05/geeks-on-php-episode-13/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 20:17:05 +0000</pubDate>
		<dc:creator>Nicholas Kreidberg</dc:creator>
				<category><![CDATA[Geeks On PHP]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[darthweef]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[kreidberg]]></category>
		<category><![CDATA[nicholas]]></category>
		<category><![CDATA[niczak]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[podcast]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Stephen Johnson]]></category>
		<category><![CDATA[strings]]></category>

		<guid isPermaLink="false">http://www.fortheloveofgeeks.com/?p=1599</guid>
		<description><![CDATA[This week Stephen and I talk about strings and how they are accessed, manipulated and used in PHP. We kick off the discussion talking about some differences between echo() and printf(). Below is an example of using both functions to populate a text field on a web form. We will start off with using echo(): [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.fortheloveofgeeks.com/wp-content/uploads/2009/07/geeksOnPHPsmall.png" alt="" title="Geeks On PHP" width="144" height="144" class="alignleft size-full wp-image-1189" /></p>
<p>This week <a href="http://twitter.com/darthweef" target="_blank">Stephen</a> <a href="http://twitter.com/niczak" target="_blank">and I</a> talk about strings and how they are accessed, manipulated and used in PHP.</p>
<p>We kick off the discussion talking about some differences between echo() and printf().  Below is an example of using both functions to populate a text field on a web form.  We will start off with using echo():</p>
<p><code><br />
.. input type="text" name="foo" id="foo"<br />
[Inside PHP Block]<br />
     if(!empty($dbresult['foo']))<br />
          echo ' value="'.$dbresult['foo'].'" />';<br />
     else<br />
          echo ' value="" />';<br />
?><br />
</code></p>
<p>Here is the same end-result using printf():</p>
<p><code><br />
... input type="text" name="foo" id="foo"<br />
[Inside PHP Block]<br />
  printf(" value=\"%s\" ", !empty($dbresult['foo']) ? $aResults['foo'] : "");<br />
?><br />
</code></p>
<p>I tried to make the &#8220;argument&#8221; during the show that printf() allows for a lot more flexibility as well as resulting in slightly more compact code.  Notice the usage of <a href="http://php.net/manual/en/language.operators.comparison.php" target="_blank">PHP&#8217;s ternary operator</a> in the printf() example.  It allows for a great deal of flexibility and power directly in-line w/ your output statement.</p>
<p>Regular Expressions were also a big topic of discussion this week and as promised here are some examples of commonly used RegEx&#8217;s in web application development:</p>
<p><code><br />
$pattern_date = '#(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d#';<br />
$pattern_email = '#^[a-zA-Z._]+@[a-zA-Z_]+?\.[a-zA-Z]{2,4}$#';<br />
$pattern_email2 = '#^\w+([\.%-]\w+)*@\w+([\.-]\w+)*(\.\w{2,})+$#';<br />
$pattern_phone = '#^(?:\([2-9]\d{2}\)\ ?|[2-9]\d{2}(?:\-?|\ ?))[2-9]\d{2}[- ]?\d{4}$#';<br />
$pattern_time = '#(1[0-2]|[1-9]):([0-5][0-9])#';<br />
$pattern_url = '#(http|https)\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,4}(/\S*)?$#';<br />
$pattern_alphanum = "#^[a-zA-Z0-9\s]+$#";<br />
</code></p>
<p>To test matching on these patterns you can simply use the <a href="http://us2.php.net/preg_match" target="_blank">preg_match()</a> function:</p>
<pre>
preg_match($pattern, $string, $matches);
if(!empty($matches))
    print_r($matches);
</pre>
<p>A couple of my favorite resources for regular expressions are:<br />
<a href="http://www.gskinner.com/RegExr/" target="_blank">The Online Regular Expression Testing Tool</a><br />
<a href="http://regexlib.com/" target="_blank">The Regular Expression Library</a></p>
<p>Regular Expressions provide so much power and versatility when it comes to pattern matching and replacements that they just can&#8217;t be ignored.  If you have questions about any of the above please let us know.</p>
<p>Follow both <a href="http://twitter.com/darthweef" target="_blank">Stephen</a> and <a href="http://twitter.com/niczak" target="_blank">Myself</a> on <a href="http://twitter.com/niczak" target="_blank">Twitter</a> and also <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=325498336" target="_blank">subscribe via Tunes</a>!</p>
<p>Enjoy the show and as always, stay geeky!</p>
<p>- <a href="mailto:niczak@gmail.com">Nicholas</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.fortheloveofgeeks.com%2F2010%2F06%2F05%2Fgeeks-on-php-episode-13%2F&amp;title=Geeks%20On%20PHP%20Episode%2013" id="wpa2a_8"><img src="http://www.fortheloveofgeeks.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.fortheloveofgeeks.com/2010/06/05/geeks-on-php-episode-13/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://m.podshow.com/download_media/22614/episodes/234632/phpgeeks-234632-06-05-2010.mp3" length="35126887" type="audio/mpeg" />
		</item>
		<item>
		<title>Geeks On PHP Episode 12</title>
		<link>http://www.fortheloveofgeeks.com/2010/05/27/geeks-on-php-episode-12/</link>
		<comments>http://www.fortheloveofgeeks.com/2010/05/27/geeks-on-php-episode-12/#comments</comments>
		<pubDate>Thu, 27 May 2010 21:52:58 +0000</pubDate>
		<dc:creator>Nicholas Kreidberg</dc:creator>
				<category><![CDATA[Geeks On PHP]]></category>
		<category><![CDATA[darthweef]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[kreidberg]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[niczak]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[podcast]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[Stephen Johnson]]></category>

		<guid isPermaLink="false">http://www.fortheloveofgeeks.com/?p=1582</guid>
		<description><![CDATA[In this episode Stephen and I talk about database connections, retrieving results and making use of those results. Both MySQL and PostgreSQL are discussed in this episode so whichever open source database you are using we got you covered. Here is a link to Stephen&#8217;s database class for MySQL. He discusses it&#8217;s usefulness and some [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.fortheloveofgeeks.com/wp-content/uploads/2009/07/geeksOnPHPsmall.png" alt="" title="Geeks On PHP" width="144" height="144" class="alignleft size-full wp-image-1189" /></p>
<p>In this episode <a href="http://twitter.com/darthweef" target="_blank">Stephen</a> and <a href="http://twitter.com/niczak" target="_blank">I</a> talk about database connections, retrieving results and making use of those results.  Both MySQL and PostgreSQL are discussed in this episode so whichever open source database you are using we got you covered.</p>
<p>Here is a link to <a href="./code/stephen-dbclass.txt" target="_blank">Stephen&#8217;s database class for MySQL</a>.  He discusses it&#8217;s usefulness and some of it&#8217;s functions in the show.</p>
<p>Here is some sample code for getting connected to and pulling out results from a PostgreSQL database.  The database include file should be separate from your application code so that you can easily change connection parameters in one location without touching your application.</p>
<pre>
/* Example of PostgreSQL database include file
	named db.inc */

$host = "hostname";
$port = "port";
$dbname = "database";
$dbuser = "username";
$dbpass = "dbpass";

$hdb = pg_connect("host=$host port=$port dbname=$dbname
	user=$dbuser password=$dbpass");

/* How to include and open connection in script */
require_once("db.inc");

/* How to query a PostgreSQL database */
$res = pg_query($hdb, "SELECT name, email FROM table");

/* Close database connection */
pg_close($hdb);

/* Create associative array */
while($ares = pg_fetch_assoc($res))
{
	// do stuff
}

/* Create object */
while($ores = pg_fetch_object($res))
{
	// do stuff
}
</pre>
<p>Check both <a href="http://twitter.com/darthweef" target="_blank">Stephen</a> and <a href="http://twitter.com/niczak" target="_blank">Myself</a> out on <a href="http://twitter.com/niczak" target="_blank">Twitter</a> and also <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=325498336" target="_blank">subscribe</a> to us on <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=325498336" target="_self">iTunes</a>!</p>
<p>Enjoy the show and as always, stay geeky!</p>
<p>- <a href="mailto:niczak@gmail.com">Nicholas</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.fortheloveofgeeks.com%2F2010%2F05%2F27%2Fgeeks-on-php-episode-12%2F&amp;title=Geeks%20On%20PHP%20Episode%2012" id="wpa2a_10"><img src="http://www.fortheloveofgeeks.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.fortheloveofgeeks.com/2010/05/27/geeks-on-php-episode-12/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://m.podshow.com/download_media/22614/episodes/233421/phpgeeks-233421-05-27-2010.mp3" length="29843674" type="audio/mpeg" />
		</item>
		<item>
		<title>Geeks On PHP Episode 11</title>
		<link>http://www.fortheloveofgeeks.com/2010/05/20/geeks-on-php-episode-11/</link>
		<comments>http://www.fortheloveofgeeks.com/2010/05/20/geeks-on-php-episode-11/#comments</comments>
		<pubDate>Fri, 21 May 2010 01:10:41 +0000</pubDate>
		<dc:creator>Nicholas Kreidberg</dc:creator>
				<category><![CDATA[Geeks On PHP]]></category>
		<category><![CDATA[charts]]></category>
		<category><![CDATA[darthweef]]></category>
		<category><![CDATA[gd]]></category>
		<category><![CDATA[graphing]]></category>
		<category><![CDATA[image manipulation]]></category>
		<category><![CDATA[kreidberg]]></category>
		<category><![CDATA[nicholas]]></category>
		<category><![CDATA[nicholas kreidberg]]></category>
		<category><![CDATA[niczak]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[podcast]]></category>
		<category><![CDATA[stephen]]></category>
		<category><![CDATA[Stephen Johnson]]></category>

		<guid isPermaLink="false">http://www.fortheloveofgeeks.com/?p=1550</guid>
		<description><![CDATA[In this episode we talk about everything from image manipulation, generating charts &#038; graphs, classes and frameworks and even home invasions. The charting libraries I discuss are Fusion Charts and pChart, both are very good libraries and have great documentation on how to get started. The following is a code snippet that I wrote which [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.fortheloveofgeeks.com/wp-content/uploads/2009/07/geeksOnPHPsmall.png" alt="" title="Geeks On PHP" width="144" height="144" class="alignleft size-full wp-image-1189" /></p>
<p>In this episode we talk about everything from <a href="http://php.net/manual/en/book.image.php" target="_blank">image manipulation</a>, generating charts &#038; graphs, classes and frameworks and even home invasions.</p>
<p>The charting libraries I discuss are <a href="http://fusioncharts.com" target="_blank">Fusion Charts</a> and <a href="http://pchart.sourceforge.net" target="_blank">pChart</a>, both are very good libraries and have great documentation on how to get started.</p>
<p>The following is a code snippet that I wrote which takes in an associative array, parses it out for a data label ($a[0]) and a data value ($a[1]) and generates a Fusion compatible XML file.</p>
<pre>
function fnGenerateXML($scaption, $sxaxis, $syaxis, $adata)
{
  if(empty($adata))
    die("Empty data set passed to function.");

  $sdata = "<chart caption=\"$scaption\" xAxisName=\"$sxaxis\" yAxisName=\"$syaxis\"
    showValues=\"0\" decimalPrecision=\"0\" formatNumberScale=\"0\" showBorder=\"1\">\n";

  foreach($adata as $arow)
    $sdata .= " <set label=\"$arow[1]\" value=\"$arow[2]\" />\n";

  $sdata .= "</chart>";

  $sfile_xml = "./chart.xml";
  file_put_contents($sfile_xml, $sdata);
  return $sfile_xml;
}
</pre>
<p>The function is called in the following fashion:</p>
<pre>$sfile_xml = fnGenerateXML("Caption", "X Lbl", "Y Lbl", $a);</pre>
<p>The Fusion Chart is generated using the following method call:</p>
<pre>echo renderChartHTML("./Column3D.swf", "$sfile_xml", "",
      "ID", 650, 650, false);
</pre>
<p>Here is some sample code I wrote to generate a graph using pChart:</p>
<pre>
// Dataset definition
$pData = new pData;
$pData->AddPoint($a1, "s1");
$pData->AddPoint($a2, "s2");
$pData->AddPoint($alabels, "lbl");
$pData->AddSerie("s1");
$pData->AddSerie("s2"); 

$pData->SetSerieName("s1lbl", "s1");
$pData->SetSerieName("s2lbl", "s2");
$pData->SetYAxisName("Ylbl");

$pData->SetAbsciseLabelSerie("lbl");

// Init graph
$pGraph = new pChart(800, 340);
$pGraph->setFontProperties("./tahoma.ttf",8);
$pGraph->setGraphArea(50,30,680,200);
$pGraph->drawFilledRoundedRectangle(7,7,693,240,5,240,240,240);
$pGraph->drawRoundedRectangle(5,5,695,240,5,260,230,230);
$pGraph->drawGraphArea(255,255,255,TRUE);
$pGraph->drawScale($pData->GetData(),
   $pData->GetDataDescription(),SCALE_ADDALL,150,150,150,TRUE,0,2,TRUE);
$pGraph->drawGrid(4,TRUE,230,230,230,50);

// Draw the 0 line
$pGraph->drawTreshold(0,143,55,72,TRUE,TRUE);

// Draw the graph
$pGraph->drawStackedBarGraph($pData->GetData(),
   $pData->GetDataDescription(),TRUE);

// Finish
$pGraph->drawLegend(500,40,$pData->GetDataDescription(),255,255,255);
$pGraph->drawTitle(225,22,"Title",0,0,0);
$pGraph->Stroke();
</pre>
<p>As you can see pChart requires a bit more setup to get going but both are great libraries for getting the job done.  Another free option for charting/graphing that we didn&#8217;t discuss on the podcast is the <a href="http://code.google.com/apis/charttools/">Google Chart API</a>.</p>
<p>Check both <a href="http://twitter.com/darthweef" target="_blank">Stephen</a> and <a href="http://twitter.com/niczak" target="_blank">Myself</a> out on <a href="http://twitter.com/niczak" target="_blank">Twitter</a> and also <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=325498336" target="_blank">subscribe</a> to us on <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=325498336" target="_self">iTunes</a>!</p>
<p>Enjoy the show and as always, stay geeky!</p>
<p>- <a href="mailto:niczak@gmail.com">Nicholas</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.fortheloveofgeeks.com%2F2010%2F05%2F20%2Fgeeks-on-php-episode-11%2F&amp;title=Geeks%20On%20PHP%20Episode%2011" id="wpa2a_12"><img src="http://www.fortheloveofgeeks.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.fortheloveofgeeks.com/2010/05/20/geeks-on-php-episode-11/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://m.podshow.com/download_media/22614/episodes/232340/phpgeeks-232340-05-20-2010.mp3" length="30971537" type="audio/mpeg" />
		</item>
		<item>
		<title>Geeks On PHP Update</title>
		<link>http://www.fortheloveofgeeks.com/2010/05/17/geeks-on-php-update-2/</link>
		<comments>http://www.fortheloveofgeeks.com/2010/05/17/geeks-on-php-update-2/#comments</comments>
		<pubDate>Mon, 17 May 2010 17:37:00 +0000</pubDate>
		<dc:creator>Nicholas Kreidberg</dc:creator>
				<category><![CDATA[Geeks On PHP]]></category>
		<category><![CDATA[darthweef]]></category>
		<category><![CDATA[kreidberg]]></category>
		<category><![CDATA[niczak]]></category>
		<category><![CDATA[podcast]]></category>
		<category><![CDATA[Stephen Johnson]]></category>

		<guid isPermaLink="false">http://www.fortheloveofgeeks.com/?p=1544</guid>
		<description><![CDATA[Hey everybody, I just wanted to let you know that I have been out of town for a few days and wasn&#8217;t able to find time to record last weeks show. I apologize for the unannounced delay and want to let everyone know that we are set to record this Wednesday and I will make [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.fortheloveofgeeks.com/wp-content/uploads/2009/07/geeksOnPHPsmall.png"><img src="http://www.fortheloveofgeeks.com/wp-content/uploads/2009/07/geeksOnPHPsmall.png" alt="" title="Geeks On PHP" width="144" height="144" class="alignleft size-full wp-image-1189" /></a></p>
<p>Hey everybody, I just wanted to let you know that I have been out of town for a few days and wasn&#8217;t able to find time to record last weeks show.  I apologize for the unannounced delay and want to let everyone know that we are set to record this Wednesday and I will make it a point to get the episode out ahead of the usual Sunday release.  If you are wondering what I was up to you are welcome to check out <a href="http://www.flickr.com/photos/niczak/sets/72157623955659979/" target="_blank">my latest Flickr set</a>.</p>
<p>Thank you for your patience and I will let everybody know via the usual channels when Episode 11 is available.</p>
<p>Thanks,</p>
<p>- <a href="mailto:niczak@gmail.com">Nicholas</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.fortheloveofgeeks.com%2F2010%2F05%2F17%2Fgeeks-on-php-update-2%2F&amp;title=Geeks%20On%20PHP%20Update" id="wpa2a_14"><img src="http://www.fortheloveofgeeks.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.fortheloveofgeeks.com/2010/05/17/geeks-on-php-update-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Geeks On PHP Episode 10</title>
		<link>http://www.fortheloveofgeeks.com/2010/05/08/geeks-on-php-episode-10/</link>
		<comments>http://www.fortheloveofgeeks.com/2010/05/08/geeks-on-php-episode-10/#comments</comments>
		<pubDate>Sun, 09 May 2010 00:24:30 +0000</pubDate>
		<dc:creator>Nicholas Kreidberg</dc:creator>
				<category><![CDATA[Geeks On PHP]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[darthweef]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[kreidberg]]></category>
		<category><![CDATA[niczak]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[podcast]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Stephen Johnson]]></category>

		<guid isPermaLink="false">http://www.fortheloveofgeeks.com/?p=1534</guid>
		<description><![CDATA[We are happy to bring you episode 10 of the Geeks On PHP Podcast!  This week we talk about API programming, specific API&#8217;s that we have worked with, some great development tips and even alcohol.  This episode has it all. The Authorize.net API comes up a bit in discussion and I mention the article I [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.fortheloveofgeeks.com/wp-content/uploads/2009/07/geeksOnPHPsmall.png"><img class="alignleft size-full wp-image-1189" title="Geeks On PHP" src="http://www.fortheloveofgeeks.com/wp-content/uploads/2009/07/geeksOnPHPsmall.png" alt="" width="144" height="144" /></a></p>
<p>We are happy to bring you episode 10 of the Geeks On PHP Podcast!  This week we talk about API programming, specific API&#8217;s that we have worked with, some great development tips and even alcohol.  This episode has it all.</p>
<p>The <a href="http://www.authorize.net" target="_blank">Authorize.net</a> API comes up a bit in discussion and I mention <a href="http://www.fortheloveofgeeks.com/2010/05/06/new-mastercard-discover-processing-requirements/" target="_blank">the article I wrote</a> a couple of days ago regarding some changes to online debt card processing as it pertains to the Authorize.net API.</p>
<p>We invite you to follow both <a href="http://twitter.com/darthweef" target="_blank">Stephen</a> and <a href="http://twitter.com/niczak" target="_blank">I</a> on <a href="http://twitter.com/niczak" target="_blank">Twitter</a> and also <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=325498336" target="_blank">subscribe</a> to us on <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=325498336" target="_self">iTunes</a>!</p>
<p>Enjoy the show and as always, stay geeky!</p>
<p>- <a href="mailto:niczak@gmail.com">Nicholas</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.fortheloveofgeeks.com%2F2010%2F05%2F08%2Fgeeks-on-php-episode-10%2F&amp;title=Geeks%20On%20PHP%20Episode%2010" id="wpa2a_16"><img src="http://www.fortheloveofgeeks.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.fortheloveofgeeks.com/2010/05/08/geeks-on-php-episode-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://m.podshow.com/download_media/22614/episodes/230217/phpgeeks-230217-05-08-2010.mp3" length="31055633" type="audio/mpeg" />
		</item>
		<item>
		<title>Geeks On PHP Is Alive!</title>
		<link>http://www.fortheloveofgeeks.com/2010/04/21/geeks-on-php-is-alive/</link>
		<comments>http://www.fortheloveofgeeks.com/2010/04/21/geeks-on-php-is-alive/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 23:46:13 +0000</pubDate>
		<dc:creator>Nicholas Kreidberg</dc:creator>
				<category><![CDATA[Geeks On PHP]]></category>
		<category><![CDATA[darthweef]]></category>
		<category><![CDATA[kreidberg]]></category>
		<category><![CDATA[nicholas]]></category>
		<category><![CDATA[nicholas kreidberg]]></category>
		<category><![CDATA[nick]]></category>
		<category><![CDATA[niczak]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[podcast]]></category>
		<category><![CDATA[stephen]]></category>
		<category><![CDATA[Stephen Johnson]]></category>

		<guid isPermaLink="false">http://www.fortheloveofgeeks.com/?p=1478</guid>
		<description><![CDATA[Hey all, I just want to give everybody an update on the Geeks On PHP podcast.  Stephen and I have arranged our schedules as such that we will be on a regular weekly recording schedule beginning NEXT WEEK.  This is very exciting news for us and for our listeners.  We apologize for the gaps between [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1189" style="margin-left: 5px; margin-right: 5px;" title="Geeks On PHP" src="http://www.fortheloveofgeeks.com/wp-content/uploads/2009/07/geeksOnPHPsmall.png" alt="Geeks On PHP" width="177" height="177" />Hey all, I just want to give everybody an update on the Geeks On PHP podcast.  Stephen and I have arranged our schedules as such that we will be on a regular weekly recording schedule beginning NEXT WEEK.  This is very exciting news for us and for our listeners.  We apologize for the gaps between episodes in the past and the long gap between our last recording and the upcoming one.</p>
<p>Episode 9 will be focused on discussing different ways to utilize data from a database (agnostic discussion) with PHP.  We are set to record on Wednesday 4/28 and the show should be available on iTunes by the weekend.</p>
<p>We really want to thank all of our listeners for the feedback and support we received during our down time.  It means a lot to both of us and we look forward to getting back on track and bringing you the best PHP podcast the internet has to offer.</p>
<p>Sincerely,</p>
<p>- <a href="mailto:niczak@gmail.com">Nicholas Kreidberg</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.fortheloveofgeeks.com%2F2010%2F04%2F21%2Fgeeks-on-php-is-alive%2F&amp;title=Geeks%20On%20PHP%20Is%20Alive%21" id="wpa2a_18"><img src="http://www.fortheloveofgeeks.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.fortheloveofgeeks.com/2010/04/21/geeks-on-php-is-alive/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Geeks on PHP &#8212; Update</title>
		<link>http://www.fortheloveofgeeks.com/2010/02/21/geeks-on-php-update/</link>
		<comments>http://www.fortheloveofgeeks.com/2010/02/21/geeks-on-php-update/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 17:31:02 +0000</pubDate>
		<dc:creator>Nicholas Kreidberg</dc:creator>
				<category><![CDATA[Geek Banter]]></category>
		<category><![CDATA[Geeks On PHP]]></category>
		<category><![CDATA[kreidberg]]></category>
		<category><![CDATA[nicholas]]></category>
		<category><![CDATA[nicholas kreidberg]]></category>
		<category><![CDATA[nick]]></category>
		<category><![CDATA[niczak]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[podcast]]></category>

		<guid isPermaLink="false">http://www.fortheloveofgeeks.com/?p=1415</guid>
		<description><![CDATA[Hey all, I know the release schedule for the Geeks on PHP podcast has been erratic and unpredictable lately. We are currently in the process of revamping the format of the show including me taking over as host and the possibility of adding someone else as co-host. Stephen&#8217;s responsibilities with the New Brew Thursday podcast [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.fortheloveofgeeks.com/wp-content/uploads/2009/07/geeksOnPHP.png" alt="geeksOnPHP" title="geeksOnPHP" class="alignleft size-full wp-image-1174" height="35%" width="35%" /></p>
<p>Hey all, I know the release schedule for the Geeks on PHP podcast has been erratic and unpredictable lately.  We are currently in the process of revamping the format of the show including me taking over as host and the possibility of adding someone else as co-host.  Stephen&#8217;s responsibilities with the New Brew Thursday podcast have increased exponentially which is the underlying reason behind the changes going on with Geeks on PHP.</p>
<p>I have a couple people in mind for co-hosts but would love to get feedback from our readers/listeners about what you would like to get out of the show. If any of you are interested in doing a guest spot please get in touch with me either by <a href="mailto:niczak@gmail.com">Email</a> or on <a href="http://twitter.com/niczak" target="_BLANK">Twitter</a>.</p>
<p>I will keep everybody updated as things progress but for now I just wanted to make people aware of what is going on and also that the show is not dead.</p>
<p>Thanks for listening and please don&#8217;t hesitate to comment, email or otherwise &#8212; your involvement is highly encouraged!</p>
<p>Sincerely,</p>
<p>- <a href="mailto:niczak@gmail.com">Nicholas Kreidberg</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.fortheloveofgeeks.com%2F2010%2F02%2F21%2Fgeeks-on-php-update%2F&amp;title=Geeks%20on%20PHP%20%26%238212%3B%20Update" id="wpa2a_20"><img src="http://www.fortheloveofgeeks.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.fortheloveofgeeks.com/2010/02/21/geeks-on-php-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

