<?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; niczak</title>
	<atom:link href="http://www.fortheloveofgeeks.com/tag/niczak/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>New MasterCard &amp; Discover Processing Requirements</title>
		<link>http://www.fortheloveofgeeks.com/2010/05/06/new-mastercard-discover-processing-requirements/</link>
		<comments>http://www.fortheloveofgeeks.com/2010/05/06/new-mastercard-discover-processing-requirements/#comments</comments>
		<pubDate>Thu, 06 May 2010 23:47:55 +0000</pubDate>
		<dc:creator>Nicholas Kreidberg</dc:creator>
				<category><![CDATA[Geek Banter]]></category>
		<category><![CDATA[Geeks On PHP]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[authorize]]></category>
		<category><![CDATA[credit processing]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[kreidberg]]></category>
		<category><![CDATA[nicholas]]></category>
		<category><![CDATA[niczak]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.fortheloveofgeeks.com/?p=1507</guid>
		<description><![CDATA[MasterCard and Discover are modifying their rules concerning processing of debit, prepaid and gift cards. MasterCard&#8217;s rule changes went into effect 5/1/2010 and Discover&#8217;s rule changes went into effect on 4/16/2010. Merchants using Authorize.Net have until 6/30/2011 to comply with the new standards but since I am compliance hound I wanted to make these changes [...]]]></description>
			<content:encoded><![CDATA[<p>MasterCard and Discover are modifying their rules concerning processing of debit, prepaid and gift cards.  MasterCard&#8217;s rule changes went into effect 5/1/2010 and Discover&#8217;s rule changes went into effect on 4/16/2010.  Merchants using Authorize.Net have until 6/30/2011 to comply with the new standards but since I am compliance hound I wanted to make these changes immediately.</p>
<p>Since I was reading up on all of the documentation and re-working my API code accordingly I figured I would share the changes with everyone in hopes of saving people a bit of time when they sit down to modify their own code.</p>
<p><span style="text-decoration: underline;">So what&#8217;s new?</span><br />
 &#8211; Balance response transactions<br />
 &#8211; Partial authorization transactions<br />
 &#8211; Authorization reversals</p>
<p><span style="text-decoration: underline;">So what does all that mean?</span><br />
Transactions made on a gift/debt/etc card can now be split among multiple cards using partial authorization and the splitTenderId value.  This value &#8220;links&#8221; the authorization request to subsequent transactions.</p>
<p>The new API request fields to pay attention to are <strong>['x_allow_partial_Auth']</strong> which is either true or false and <strong>['x_split_tender_id']</strong> which gets set to the original authorization request value.</p>
<p>The new relay response reply fields are as follows:<br />
<strong>['x_account_number']</strong> = last 4 digits of card<br />
<strong>['x_card_type']</strong> = string value indicating the type of card used<br />
<strong>['x_split_tender_id']</strong> = original authorization value<br />
<strong>['x_prepaid_requested_amount']</strong> = amount requested in original auto<br />
<strong>['x_prepaid_balance_on_card']</strong> = balance on the debit/prepaid card</p>
<p>The obvious things to note here (aside from the tender id) are the card balance and the requested amount.  With these two values you can easily determine if the transaction can go through or if a subsequent transaction (w/ the sane tender id) has been requested.</p>
<p>New response codes to take note of are the following:<br />
<strong>Reason: 295 Code: 4</strong> &#8212; Amount was only partially approved<br />
<strong>Reason: 296 Code: 3</strong> &#8212; The splitTenderId is invalid.<br />
<strong>Reason: 297 Code: 3</strong> &#8212; A trans ID and a Split Tender ID can&#8217;t both be used in a single transaction request.<br />
<strong>Reason: 298 Code: 3</strong> &#8212; The splitTenderId has been completed (released or voided) and can not be associated with new transactions.</p>
<p>Here is what a sample relay repines looks like: (Taken from official documentation)</p>
<p><img class="alignleft size-full wp-image-1509" title="Authnet Relay Response" src="http://www.fortheloveofgeeks.com/wp-content/uploads/2010/05/Screen-shot-2010-05-06-at-3.13.30-PM1.png" alt="" width="450" height="364" /></p>
<p>Hopefully this summary helps identify the changes that need to be made and why.  All of this information can be found in the official documentation which is available at: <a href="http://www.authorize.net/support/pafaqs/" target="_blank">http://www.authorize.net/support/pafaqs/</a></p>
<h3>- <a href="mailto:niczak@gmail.com">Nicholas</a></h3>
<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%2F06%2Fnew-mastercard-discover-processing-requirements%2F&amp;title=New%20MasterCard%20%26%23038%3B%20Discover%20Processing%20Requirements" 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/05/06/new-mastercard-discover-processing-requirements/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Geeks On PHP &#8211; Episode 9</title>
		<link>http://www.fortheloveofgeeks.com/2010/05/02/geeks-on-php-episode-9/</link>
		<comments>http://www.fortheloveofgeeks.com/2010/05/02/geeks-on-php-episode-9/#comments</comments>
		<pubDate>Mon, 03 May 2010 02:36:03 +0000</pubDate>
		<dc:creator>Nicholas Kreidberg</dc:creator>
				<category><![CDATA[Geeks On PHP]]></category>
		<category><![CDATA[darthweef]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[geeks]]></category>
		<category><![CDATA[johnson]]></category>
		<category><![CDATA[kreidberg]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[nicholas]]></category>
		<category><![CDATA[nick]]></category>
		<category><![CDATA[niczak]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[stephen]]></category>

		<guid isPermaLink="false">http://www.fortheloveofgeeks.com/?p=1493</guid>
		<description><![CDATA[After a long wait, Geeks on PHP &#8211; Episode 9 is finally out!  As I mentioned in a previous post we are now on a weekly recording schedule and will be releasing a new episode every Sunday evening unless otherwise specified. In this exciting episode we discuss lots of information and things to think about [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.fortheloveofgeeks.com/wp-content/uploads/2009/07/geeksOnPHPsmall.png" alt="" width="144" height="144" /></p>
<p>After a long wait, Geeks on PHP &#8211; Episode 9 is finally out!  As I mentioned in a previous post we are now on a weekly recording schedule and will be releasing a new episode every Sunday evening unless otherwise specified.</p>
<p>In this exciting episode we discuss lots of information and things to think about *before* you start  building your database or writing your application.  We also touch on SQL statements, database schema design and how they relate to your PHP applications.</p>
<p>Also, subscribe to us on iTunes and leave us your comments: [ <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=325498336">Launch iTunes</a> ]</p>
<p><span style="font-family: verdana,geneva;">Follow us on Twitter :<br />
Nick : <a href="http://www.twitter.com/niczak" target="_blank">http://www.twitter.com/niczak</a><br />
Stephen : <a href="http://www.twitter.com/darthweef" target="_blank">http://www.twitter.com/darthweef</a><br />
</span></p>
<h3>- <a href="mailto:niczak@gmail.com">Nicholas</a></h3>
<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%2F02%2Fgeeks-on-php-episode-9%2F&amp;title=Geeks%20On%20PHP%20%26%238211%3B%20Episode%209" 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/05/02/geeks-on-php-episode-9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://m.podshow.com/download_media/22614/episodes/229247/phpgeeks-229247-05-02-2010.mp3" length="32941382" type="audio/mpeg" />
		</item>
	</channel>
</rss>

