<?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>deepcode.net</title>
	<atom:link href="http://www.deepcode.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.deepcode.net</link>
	<description></description>
	<lastBuildDate>Wed, 03 Mar 2010 04:36:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Use the luhn algorithm to check Credit Card validity</title>
		<link>http://www.deepcode.net/use-the-luhn-algorithm-to-check-credit-card-validity/</link>
		<comments>http://www.deepcode.net/use-the-luhn-algorithm-to-check-credit-card-validity/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 04:36:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.deepcode.net/?p=28</guid>
		<description><![CDATA[The other day I was checking my feed reader and saw this post on lifehacker entitled &#8220;What the Numbers on Your Credit Card Mean&#8221;; Since I am always interested in learning, it led me to the Wikipedia page for the Luhn Algorithm.
Basically, the Luhn Algorithm allows you to, before actually processing the credit card, check [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I was checking my feed reader and saw <a href="http://lifehacker.com/5483784/what-the-numbers-on-your-credit-card-mean">this</a> post on lifehacker entitled &#8220;What the Numbers on Your Credit Card Mean&#8221;; Since I am always interested in learning, it led me to the Wikipedia page for the <a title="Luhn Algorithm" href="http://en.wikipedia.org/wiki/Luhn_algorithm" target="_blank">Luhn Algorithm</a>.</p>
<p>Basically, the Luhn Algorithm allows you to, before actually processing the credit card, check the validity of a credit card number. Well, it sounded pretty awesome and a very easy initial validation. After reading the steps carefully, I looked over the Python code sample provided (top sample as of writing this) and decided I would write one in PHP in order to understand how it&#8217;s working and to test it using the card in my wallet. I posted it on <a href="http://gist.github.com/sgricci">Gist</a> if anyone is interested.</p>
<p><script src="http://gist.github.com/320310.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.deepcode.net/use-the-luhn-algorithm-to-check-credit-card-validity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Global Hot Keys for Songbird in Linux</title>
		<link>http://www.deepcode.net/global-hot-keys-for-songbird-in-linux/</link>
		<comments>http://www.deepcode.net/global-hot-keys-for-songbird-in-linux/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 12:06:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[songbird]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://dev.deepcode.net/?p=22</guid>
		<description><![CDATA[First, let me preface this by saying I used to love Amarok, but I feel Amarok 2 is just a bit too far off par for me to continue using.  It all really came to a head when I was listening to a 4-disc set, which all had the same Album name, and I couldn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>First, let me preface this by saying I used to love Amarok, but I feel Amarok 2 is just a bit too far off par for me to continue using.  It all really came to a head when I was listening to a 4-disc set, which all had the same Album name, and I couldn&#8217;t sort them by disc, or even by track number.  In the end, I broke down and <a href="https://help.ubuntu.com/community/Songbird">installed Songbird</a> on my Ubuntu desktop.  I should also mention I am a Gnome user, so these instructions may not work for you KDE users.</p>
<p>Now Songbird has come a long way since I tried it a while back, but it still has a lack of global shortcut keys on Linux.  A very helpful user of the Songbird community released an add-on which enables <a href="http://addons.songbirdnest.com/addon/1381">Command Line Support</a>.</p>
<p>Now that I&#8217;ve set up my machine with Global Hot Keys, I&#8217;ll show you how to do so as well.  Here&#8217;s a step-by-step:</p>
<blockquote><p><b>Note</b>: If you are using the .deb installed from gotdeb, there is a wrapper script located at /usr/bin/songbird<br />
Open this file as root in your favorite text editor.  At the bottom of the short file, you&#8217;ll see:</p>
<pre>./songbird</pre>
<p>You need to add &#8220;$@&#8221; to the end of this line, so it should look like:</p>
<pre>./songbird "$@"</pre>
<p>This will allow the command line arguments to be passed to the actual binary.</p></blockquote>
<p>&middot; Run &#8220;gconf-editor&#8221; either from a terminal or the run dialog.  This will bring up an window to edit the gnome configuration options.</p>
<p>&middot; In the menu list to the left, go to &#8220;apps&#8221; -&gt; &#8220;metacity&#8221; -&gt; &#8220;keybinding_commands&#8221;</p>
<p>&middot; I used the first 3 commands as follows (double click on the line to edit):<br />
- command_1: /usr/bin/songbird -pause<br />
- command_2: /usr/bin/songbird -next<br />
- command_3: /usr/bin/songbird -previous</p>
<p>&middot; Once that is done, you will want to go back to your menu list on the left, and find the &#8220;global_keybindings&#8221; folder (&#8220;apps&#8221; -&gt; &#8220;metacity&#8221; -&gt; &#8220;global_keybindings&#8221;)</p>
<p>&middot; Inside this folder, You should see run_command_1 through run_command_12.  You can now set you desired key bindings.  Personally, I set them similar to Amarok (since I&#8217;m used to them.)<br />
- run_command_1: &lt;Super&gt;c<br />
- run_command_2: &lt;Super&gt;b<br />
- run_command_3: &lt;Super&gt;z</p>
<blockquote><p>If you run into any problems during this process, or just want to keep in touch, you can contact me on <a href="http://twitter.com/sgricci">twitter</a> or leave a comment below.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.deepcode.net/global-hot-keys-for-songbird-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use wget to download large directories recursively</title>
		<link>http://www.deepcode.net/use-wget-to-download-large-directories-recursively/</link>
		<comments>http://www.deepcode.net/use-wget-to-download-large-directories-recursively/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 10:19:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://dev.deepcode.net/?p=19</guid>
		<description><![CDATA[Have you ever wanted to recursively get a web directory? Or how about a web site?
If your a linux user, you can use wget (man wget for more info). Wget is a non-interactive network downloader. Mac users can try to get a binary &#60;a href=&#8221;http://www.statusq.org/archives/2008/07/30/1954/&#8221;&#62;here&#60;/a&#62;.  Wget is a very powerful tool for many reasons, but [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted to recursively get a web directory? Or how about a web site?</p>
<p>If your a linux user, you can use wget (man wget for more info). Wget is a non-interactive network downloader. Mac users can try to get a binary &lt;a href=&#8221;http://www.statusq.org/archives/2008/07/30/1954/&#8221;&gt;here&lt;/a&gt;.  Wget is a very powerful tool for many reasons, but it can be quite useful if you want to download multiple files from a site.</p>
<p>A few days ago, I complained that I didn&#8217;t have many fonts for use in designing, so a friend linked me to &lt;a href=&#8221;http://www.fonts500.com&#8221;&gt;fonts500.com&lt;/a&gt;.  My first thought was &#8220;Wow, I want all of these fonts, but I don&#8217;t want to click all of those links, spread over 5 pages.&#8221; Enter wget!</p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.deepcode.net/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://www.deepcode.net/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_about(1)" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.deepcode.net/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="kw2">wget</span> <span class="re5">-r</span> <span class="re5">--level</span>=2 <span class="re5">-A</span> <span class="kw2">zip</span> <span class="re5">--quiet</span> http:<span class="sy0">//</span>www.fonts500.com<span class="sy0">/</span></pre></div></div>
<p>A little explanation of the command:</p>
<p>The -r is to be recursive.</p>
<p>The &#8211;level=2  sets the maximum depth (we don&#8217;t want to go too far off the page)</p>
<p>The &#8220;-A zip&#8221; sets the file inclusion parameter, which means we only want the zip files.</p>
<p>&#8211;quiet is just to squelch output, just a personal preference.</p>
<p>And lastly, the URL you want to use.</p>
<p>Hope it helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deepcode.net/use-wget-to-download-large-directories-recursively/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Clean URLs with mod_rewrite and .htaccess</title>
		<link>http://www.deepcode.net/clean-urls-with-mod_rewrite-and-htaccess/</link>
		<comments>http://www.deepcode.net/clean-urls-with-mod_rewrite-and-htaccess/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 03:20:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[URLs]]></category>
		<category><![CDATA[mod_rewrite]]></category>

		<guid isPermaLink="false">http://dev.deepcode.net/?p=14</guid>
		<description><![CDATA[Do you stop and think that the .php  file extension on your files looks ugly and unnecessary?  I do. When I&#8217;m creating a project, one of the first things I do is get rid of those file extensions.
Here&#8217;s a quick and easy way to do that using &#60;a href=&#8221;http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html&#8221;&#62;mod_rewrite&#60;/a&#62; in your .htaccess file. (&#60;i&#62;Note: You [...]]]></description>
			<content:encoded><![CDATA[<p>Do you stop and think that the .php  file extension on your files looks ugly and unnecessary?  I do. When I&#8217;m creating a project, one of the first things I do is get rid of those file extensions.</p>
<p>Here&#8217;s a quick and easy way to do that using &lt;a href=&#8221;http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html&#8221;&gt;mod_rewrite&lt;/a&gt; in your .htaccess file. (&lt;i&gt;Note: You will need to have the mod_rewrite module enabled, and the directory will need &lt;a href=&#8221;http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride&#8221;&gt;AuthOverride&lt;/a&gt; All on, in the apache configuration&lt;/i&gt;)</p>
<p style="padding-left: 30px;">
<pre style="padding-left: 30px;">RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php</pre>
<p>This code basically tells mod_rewrite that if the requested filename is not a file, and not a directory (the first 2 lines), then rewirte the URL as %{REQUEST_FILENAME}.php.  Take this code, create a new file in your web root, named .htaccess, paste the code in and save it. That&#8217;s all there is to it.</p>
<p>So if you have a file called &#8220;file.php&#8221; on your domain (http://example.com/), you should now be able to access it by going to http://example.com/file rather than http://example.com/file.php.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deepcode.net/clean-urls-with-mod_rewrite-and-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Tip: Use unsigned int for larger values</title>
		<link>http://www.deepcode.net/mysql-tip-use-unsigned-int-for-larger-values/</link>
		<comments>http://www.deepcode.net/mysql-tip-use-unsigned-int-for-larger-values/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 11:40:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Datatypes]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://dev.deepcode.net/?p=11</guid>
		<description><![CDATA[Have you ever created an &#60;b&#62;int&#60;/b&#62; field for a primary key? Or perhaps to store a numeric value? Chances are, you probably have, and if you don&#8217;t know what &#60;b&#62;unsigned&#60;/b&#62; means, you are limiting the number of possible values that can be used in that field.
In MySQL, a field with the data type of int, [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever created an &lt;b&gt;int&lt;/b&gt; field for a primary key? Or perhaps to store a numeric value? Chances are, you probably have, and if you don&#8217;t know what &lt;b&gt;unsigned&lt;/b&gt; means, you are limiting the number of possible values that can be used in that field.</p>
<p>In MySQL, a field with the data type of int, without unsigned specified is capable of storing negative values. Since auto incremented primary keys will not use negative numbers for identifiers, you are limiting yourself to effectively half of the possible values of the int data type (between 0 and 2147483647).</p>
<p>That may seem like a fairly large number to most of you, but why take the risk?  If you specify your integer field as &lt;b&gt;unsigned&lt;/b&gt;, you will double the number of values accepted by the field.</p>
<p>&lt;b&gt;Why?&lt;/b&gt;  A &lt;b&gt;signed&lt;/b&gt; integer, which in MySQL are all integers that are not specified as unsigned, will use the first of 32 bits as a marker for negative or positive.  This means that the possible values for are 2^31.  With an unsigned integer, the values are 2^32, or 0 to 4294967295.</p>
<p>The same exact rules apply for BIGINT (which is signed 2^63 and unsigned 2^64).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deepcode.net/mysql-tip-use-unsigned-int-for-larger-values/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy Benchmarking class</title>
		<link>http://www.deepcode.net/easy-benchmarking-class/</link>
		<comments>http://www.deepcode.net/easy-benchmarking-class/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 01:51:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[benchmarking]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[optimizing]]></category>

		<guid isPermaLink="false">http://dev.deepcode.net/?p=3</guid>
		<description><![CDATA[When working to optimize either your own or someone else&#8217;s PHP code, it can be very useful to find out where the most time is being spent.  This is especially true with long running cron scripts.
It&#8217;s pretty easy to do on a case-by-case basis, but after years of programming and writing the code to [...]]]></description>
			<content:encoded><![CDATA[<p>When working to optimize either your own or someone else&#8217;s PHP code, it can be very useful to find out where the most time is being spent.  This is especially true with long running cron scripts.</p>
<p>It&#8217;s pretty easy to do on a case-by-case basis, but after years of programming and writing the code to accomplish this, I decided it was easier to just create a Bench class.</p>
<p>The point of the Bench class is to allow me to add multiple data points throughout the code, and to show me the results upon completion of the script. I tried to make it as least obstructive as possible.</p>
<p>Please feel free to use and share this code as desired. If you run into any problems, or have any issues, let me know.</p>
<p><span style="text-decoration: underline;">Bench.php Source Code:<br />
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.deepcode.net/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://www.deepcode.net/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_about(2)" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.deepcode.net/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><span class="kw2">&lt;?php</span>
<span class="coMULTI">/*
* author sgricci
* access public
* license gpl
* website http://deepcode.net
*/</span>
<span class="kw2">class</span> Bench <span class="br0">&#123;</span>
	<span class="kw2">private</span> <span class="re0">$points</span> <span class="sy0">=</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
	<span class="kw2">private</span> <span class="re0">$start</span><span class="sy0">;</span>
&nbsp;
	<span class="kw2">public</span> <span class="kw2">function</span> __construct<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
		<span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">start</span> <span class="sy0">=</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">utime</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
	<span class="br0">&#125;</span>
&nbsp;
	<span class="kw2">private</span> <span class="kw2">function</span> utime<span class="br0">&#40;</span><span class="br0">&#41;</span>
	<span class="br0">&#123;</span>
		<span class="re0">$time</span> <span class="sy0">=</span> <a href="http://www.php.net/explode"><span class="kw3">explode</span></a><span class="br0">&#40;</span><span class="st0">&quot; &quot;</span><span class="sy0">,</span> <a href="http://www.php.net/microtime"><span class="kw3">microtime</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
		<span class="re0">$usec</span> <span class="sy0">=</span> <span class="br0">&#40;</span>double<span class="br0">&#41;</span> <span class="re0">$time</span><span class="br0">&#91;</span>0<span class="br0">&#93;</span><span class="sy0">;</span>
		<span class="re0">$sec</span> <span class="sy0">=</span> <span class="br0">&#40;</span>double<span class="br0">&#41;</span> <span class="re0">$time</span><span class="br0">&#91;</span>1<span class="br0">&#93;</span><span class="sy0">;</span>
		<span class="kw1">return</span> <span class="br0">&#40;</span><span class="re0">$sec</span> <span class="sy0">+</span> <span class="re0">$usec</span><span class="br0">&#41;</span><span class="sy0">;</span>
	<span class="br0">&#125;</span>
&nbsp;
	<span class="kw2">public</span> <span class="kw2">function</span> pt<span class="br0">&#40;</span><span class="re0">$name</span> <span class="sy0">=</span> <span class="st0">&quot;&quot;</span><span class="br0">&#41;</span>
	<span class="br0">&#123;</span>
		<span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><span class="re0">$name</span><span class="br0">&#41;</span>
			<span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">points</span><span class="br0">&#91;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">utime</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
		<span class="kw1">else</span>
			<span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">points</span><span class="br0">&#91;</span><span class="re0">$name</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">utime</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
	<span class="br0">&#125;</span>
&nbsp;
	<span class="kw2">public</span> <span class="kw2">function</span> __destruct<span class="br0">&#40;</span><span class="br0">&#41;</span>
	<span class="br0">&#123;</span>
		<span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">pt</span><span class="br0">&#40;</span><span class="st0">&quot;total&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
		<span class="kw1">foreach</span> <span class="br0">&#40;</span><span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">points</span> <span class="kw1">as</span> <span class="re0">$name</span> <span class="sy0">=&gt;</span> <span class="re0">$pt</span><span class="br0">&#41;</span>
		<span class="br0">&#123;</span>
			<span class="kw1">echo</span> <span class="re0">$name</span><span class="sy0">.</span><span class="st0">&quot;: &quot;</span><span class="sy0">.</span><a href="http://www.php.net/round"><span class="kw3">round</span></a><span class="br0">&#40;</span><a href="http://www.php.net/abs"><span class="kw3">abs</span></a><span class="br0">&#40;</span><span class="re0">$this</span><span class="sy0">-&gt;</span><span class="me1">start</span> <span class="sy0">-</span> <span class="re0">$pt</span><span class="br0">&#41;</span><span class="sy0">,</span><span class="nu0">4</span><span class="br0">&#41;</span><span class="sy0">.</span><span class="st0">&quot;<span class="es1">\n</span>&quot;</span><span class="sy0">;</span>
		<span class="br0">&#125;</span>
	<span class="br0">&#125;</span>
<span class="br0">&#125;</span>
<span class="sy1">?&gt;</span></pre></div></div></span></p>
<p><span style="text-decoration: underline;">Usage:<br />
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.deepcode.net/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://www.deepcode.net/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_about(3)" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.deepcode.net/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><span class="kw2">&lt;?php</span>
<span class="kw1">require_once</span> <span class="st0">&quot;Bench.php&quot;</span><span class="sy0">;</span>
<span class="re0">$B</span> <span class="sy0">=</span> <span class="kw2">new</span> Bench<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co2"># Place at the beginning of the script.
</span><span class="co1">// process some queries and then call</span>
<span class="re0">$B</span><span class="sy0">-&gt;</span><span class="me1">pt</span><span class="br0">&#40;</span><span class="st0">&quot;post-query process&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="co1">// process the data from the queries and then call</span>
<span class="re0">$B</span><span class="sy0">-&gt;</span><span class="me1">pt</span><span class="br0">&#40;</span><span class="st0">&quot;post-data process&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="co1">// go on with the rest of your script</span>
<span class="sy1">?&gt;</span></pre></div></div></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.deepcode.net/easy-benchmarking-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
