<?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>Made of Everything You&#039;re Not &#187; debug</title>
	<atom:link href="http://blog.ericlamb.net/tag/debug/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ericlamb.net</link>
	<description>Thoughts on programming, people and life</description>
	<lastBuildDate>Thu, 27 Oct 2011 01:29:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Keeping an Eye on Your Development</title>
		<link>http://blog.ericlamb.net/2009/09/keeping-an-eye-on-your-development/</link>
		<comments>http://blog.ericlamb.net/2009/09/keeping-an-eye-on-your-development/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 13:00:42 +0000</pubDate>
		<dc:creator>Eric Lamb</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.ericlamb.net/?p=2434</guid>
		<description><![CDATA[Oh, var_dump()&#8230; Poor, pathetic, little vardump()&#8230; There was a time when you were my favorite little go-to for debugging. Once upon a time, you were the end all be all of problem solving tools; this would be during my idiot phase of life. Not anymore though; thanks to some god (or whatever) someone smarter than [...]]]></description>
			<content:encoded><![CDATA[<p>Oh, var_dump()&#8230; Poor, pathetic, little vardump()&#8230; There was a time when you were my favorite little go-to for debugging. Once upon a time, you were the end all be all of problem solving tools; this would be during my idiot phase of life. Not anymore though; thanks to some god (or whatever) someone smarter than me (and apparently with more time on their hands) went and invented the Debug Toolbar.</p>
<div id="attachment_2440" class="wp-caption aligncenter" style="width: 264px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/09/spider-eye.jpg" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F09%2Fspider-eye.jpg','Keeping+an+Eye+on+Your+Development')"><img class="size-medium wp-image-2440" title="Keeping an Eye on Your Development" src="http://blog.ericlamb.net/wp-content/uploads/2009/09/spider-eye-254x300.jpg" alt="Keeping an Eye on Your Development" width="254" height="300" /></a><p class="wp-caption-text">Keeping an Eye on Your Development</p></div>
<p>In case you didn&#8217;t know, a Debug Toolbar (I don&#8217;t know if that&#8217;s the universal name for it but it makes sense to me) is a nifty little widget that allows for easy access to all sorts of info on your web program. Since I work primarily in php that&#8217;s what I&#8217;m going focus on; I&#8217;m sure they&#8217;re available in other languages. Like most things; Google is your friend on this.</p>
<p>Usually, a Debug Toolbar contains information on included files, any sessions and cookies available, the database calls with timers and a breakdown of memory usage and performance.</p>
<p>Debug Toolbars usually work by encapsulating different code blocks or functions around &#8220;timer&#8221; functions to record the time it took for a block to run. All the Debug Toolbars I&#8217;ve used also included a memory component; really helps to see where the spikes are. There&#8217;s also the database integration; it&#8217;s just good sense to know where the bottlenecks are in a project.</p>
<p>As I said in the intro var_dump() is a handy little tool for debugging issues in php scripts. It works pretty well for small scripts but, the thing is, on larger projects it just becomes unpractical. Not only is it limited to arrays and objects but you have to manually place the call in the code and depending on the issue, you can get a HUGE amount of data back in a horrible tangle of strings. Makes XML look good.</p>
<p>Instead, using a Debug Toolbar, you get a nicely formatted unobtrusive way to keep an eye on how your code is performing while creating it. Needless to say, these are handy little tools.</p>
<h3>PHP_Debug</h3>
<p>A little disclosure: My first experience with a debug toolbar was with a really early, think pre alpha, version of <a title="PHP_Debug" href="http://www.php-debug.com/www/" onclick="return TrackClick('http%3A%2F%2Fwww.php-debug.com%2Fwww%2F','PHP_Debug')" target="_blank">PHP_Debug</a>. PHP_Debug, at that time, worked by displaying the debug information at the bottom of a <a title="PHP_Debug table example" href="http://www.php-debug.com/www/PHP_Debug_HTML_Table_test.php" onclick="return TrackClick('http%3A%2F%2Fwww.php-debug.com%2Fwww%2FPHP_Debug_HTML_Table_test.php','PHP_Debug+table+example')" onclick="return TrackClick('http%3A%2F%2Fwww.php-debug.com%2Fwww%2FPHP_Debug_HTML_Table_test.php','PHP_Debug+table+example')" target="_blank">page in a table</a>. This was definitely a step up from using var_dump(), to be sure, but it was still a little painful to decipher. Clients would complain.</p>
<p>Then PHP_Debug pretty much innovated the Microsoft way and copied a feature from another application; <a title="Symfony Debug Toolbar" href="http://www.symfony-project.org/blog/2008/08/27/new-in-symfony-1-2-customize-the-web-debug-toolbar" onclick="return TrackClick('http%3A%2F%2Fwww.symfony-project.org%2Fblog%2F2008%2F08%2F27%2Fnew-in-symfony-1-2-customize-the-web-debug-toolbar','Symfony+Debug+Toolbar')" target="_blank">Symfony</a>. (I kid, I kid.)</p>
<p>Seriously though, PHP_Debug does claim inspiration from the Symfony which I think is pretty classy of them; it seems too many times credit goes unsaid.</p>
<p>Keep in mind, this was the first time I saw anything like a debug toolbar. I don&#8217;t want to break down to hyperbole but to say the sky parted and angels sang would be a fucking understatement.</p>
<div id="attachment_2449" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/09/php_debug_toolbar.png" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F09%2Fphp_debug_toolbar.png','PHP_Debug+Toolbar')"><img class="size-medium wp-image-2449" title="PHP_Debug Toolbar" src="http://blog.ericlamb.net/wp-content/uploads/2009/09/php_debug_toolbar-300x9.png" alt="PHP_Debug Toolbar" width="300" height="9" /></a><p class="wp-caption-text">PHP_Debug Toolbar</p></div>
<p>PHP_Debug is perfect for those stand alone projects that are started from scratch. It&#8217;s not <em>impossible </em>to integrate PHP_Debug into an existing program, I&#8217;ve done it a few times, but unless you&#8217;ve abstracted out a good deal of the logic it&#8217;s going to be a little painful. Put aside a few hours if you&#8217;re going to attempt it.</p>
<p>The script displays the output in 2 different ways; through a <a title="PHP_Debug HTML_DIV Renderer" href="http://www.php-debug.com/www/PHP_Debug_HTML_Div_test.php" onclick="return TrackClick('http%3A%2F%2Fwww.php-debug.com%2Fwww%2FPHP_Debug_HTML_Div_test.php','PHP_Debug+HTML_DIV+Renderer')" target="_blank">floating div</a> at the top of a page or as an <a title="PHP_Debug table example" href="http://www.php-debug.com/www/PHP_Debug_HTML_Table_test.php" onclick="return TrackClick('http%3A%2F%2Fwww.php-debug.com%2Fwww%2FPHP_Debug_HTML_Table_test.php','PHP_Debug+table+example')" onclick="return TrackClick('http%3A%2F%2Fwww.php-debug.com%2Fwww%2FPHP_Debug_HTML_Table_test.php','PHP_Debug+table+example')" target="_blank">HTML table</a> displayed at the bottom of the page. <a title="PHP_Debug Installation" href="http://www.php-debug.com/www/install.php" onclick="return TrackClick('http%3A%2F%2Fwww.php-debug.com%2Fwww%2Finstall.php','PHP_Debug+Installation')" target="_blank">Installation</a> is pretty easy and straightforward, either as a PEAR module or as a stand alone script.</p>
<h3>ZFDebug</h3>
<p><a title="ZFDebug" href="http://code.google.com/p/zfdebug/" onclick="return TrackClick('http%3A%2F%2Fcode.google.com%2Fp%2Fzfdebug%2F','ZFDebug')" target="_blank">ZFDebug</a> is a plugin for the Zend Framework that acts pretty much like PHP_Debug except with a simple and easy integration into the Zend Framework and it&#8217;s quite a bit slicker. Smooth animations, version details, sticky states and full of detail. If you use the Zend Framework I can&#8217;t recommend it highly enough.</p>
<div id="attachment_2444" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/09/ZFDebug-image.png" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F09%2FZFDebug-image.png','ZFDebug')"><img class="size-medium wp-image-2444" title="ZFDebug" src="http://blog.ericlamb.net/wp-content/uploads/2009/09/ZFDebug-image-300x11.png" alt="ZFDebug" width="300" height="11" /></a><p class="wp-caption-text">ZFDebug</p></div>
<p>There are some <a title="ZFDebug Installation Instructions" href="http://code.google.com/p/zfdebug/wiki/Installation" onclick="return TrackClick('http%3A%2F%2Fcode.google.com%2Fp%2Fzfdebug%2Fwiki%2FInstallation','ZFDebug+Installation+Instructions')" target="_blank">installation instructions</a> which at the time of this writing are just broken though. Follow the linked instructions but use the below code in place of the code provided in the instructions:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000000; font-weight: bold;">function</span> _initZFDebug<span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span>
<span style="color: #000;">&#123;</span>
    <span style="color: #000088;">$autoloader</span> <span style="color: #339933;">=</span> Zend_Loader_Autoloader<span style="color: #339933;">::</span><span style="color: #004000;">getInstance</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$autoloader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">registerNamespace</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'ZFDebug'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$options</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #000;">&#40;</span>
        <span style="color: #0000ff;">'plugins'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'Variables'</span><span style="color: #339933;">,</span> 
                           <span style="color: #0000ff;">'File'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'base_path'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'/path/to/project/'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">,</span>
                           <span style="color: #0000ff;">'Memory'</span><span style="color: #339933;">,</span> 
                           <span style="color: #0000ff;">'Time'</span><span style="color: #339933;">,</span> 
                           <span style="color: #0000ff;">'Registry'</span><span style="color: #339933;">,</span> 
                           <span style="color: #0000ff;">'Exception'</span><span style="color: #000;">&#41;</span>
    <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># Instantiate the database adapter and setup the plugin.
</span>    <span style="color: #666666; font-style: italic;"># Alternatively just add the plugin like above and rely on the autodiscovery feature.
</span>    <span style="color: #22f;">if</span> <span style="color: #000;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">hasPluginResource</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'db'</span><span style="color: #000;">&#41;</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#123;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">bootstrap</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'db'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$db</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPluginResource</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'db'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getDbAdapter</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$options</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'plugins'</span><span style="color: #000;">&#93;</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'Database'</span><span style="color: #000;">&#93;</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'adapter'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$db</span><span style="color: #339933;">;</span>
    <span style="color: #000;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># Setup the cache plugin
</span>    <span style="color: #22f;">if</span> <span style="color: #000;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">hasPluginResource</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'cache'</span><span style="color: #000;">&#41;</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#123;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">bootstrap</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'cache'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$cache</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPluginResource</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'cache'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getDbAdapter</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$options</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'plugins'</span><span style="color: #000;">&#93;</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'Cache'</span><span style="color: #000;">&#93;</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'backend'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$cache</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getBackend</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000;">&#125;</span>
&nbsp;
    <span style="color: #000088;">$debug</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ZFDebug_Controller_Plugin_Debug<span style="color: #000;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">bootstrap</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'frontController'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$frontController</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getResource</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'frontController'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$frontController</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">registerPlugin</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$debug</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000;">&#125;</span></pre></div></div>

<p>Using ZFDebug is as simple as that. Once installed you&#8217;ll have a div laying at the bottom of the page with all the details you could want. Plus, it comes preinstalled with the hooks for database and cache profiling. It&#8217;s still possible to manually insert timing blocks but the hard part is already done for you. </p>
<h3>Symfony</h3>
<p>If you&#8217;re using Symfony you&#8217;re in luck (and none of this is probably news to you); Symfony comes with a Debug Toolbar (the original maybe?) preinstalled and read to use. All you have to do is either hit up frontend_dev.php in a browser or change:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$configuration</span> <span style="color: #339933;">=</span> ProjectConfiguration<span style="color: #339933;">::</span><span style="color: #004000;">getApplicationConfiguration</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'frontend'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'prod'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>to</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$configuration</span> <span style="color: #339933;">=</span> ProjectConfiguration<span style="color: #339933;">::</span><span style="color: #004000;">getApplicationConfiguration</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'frontend'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'dev'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>in your bootstrap file. </p>
<div id="attachment_2458" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/09/symfony_toolbar.png" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F09%2Fsymfony_toolbar.png','Symfony+Debug+Toolbar')"><img src="http://blog.ericlamb.net/wp-content/uploads/2009/09/symfony_toolbar-300x17.png" alt="Symfony Debug Toolbar" title="Symfony Debug Toolbar" width="300" height="17" class="size-medium wp-image-2458" /></a><p class="wp-caption-text">Symfony Debug Toolbar</p></div>
<p>It&#8217;s not as robust as PHP_Debug or ZFDebug out of the box (oddly, there&#8217;s no included file reference) but it does allow for <a href="http://www.symfony-project.org/cookbook/1_2/en/web_debug_toolbar" onclick="return TrackClick('http%3A%2F%2Fwww.symfony-project.org%2Fcookbook%2F1_2%2Fen%2Fweb_debug_toolbar','How+to+customize+the+Web+Debug+Toolbar')" target="_blank" title="How to customize the Web Debug Toolbar">customization</a> so it has the potential to be very informative and useful. </p>
<p>One last thing about Web Debug Toolbars; they aren&#8217;t a replacement for good practices. You can&#8217;t rely on them too much and sometimes your instinct will contradict the output of the toolbar. In my experience you should trust that instinct. A Web Debug Toolbar should only be used to provide insight not replace common sense.  </p>
<p>One thing to keep in mind is to not focus too much on the</p>
<div><a class="addthis_button" href="http://blog.ericlamb.net//addthis.com/bookmark.php?v=250" addthis:url='http://blog.ericlamb.net/2009/09/keeping-an-eye-on-your-development/' addthis:title='Keeping an Eye on Your Development '><img src="//cache.addthis.com/cachefly/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ericlamb.net/2009/09/keeping-an-eye-on-your-development/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fiddler Web Debugger</title>
		<link>http://blog.ericlamb.net/2009/08/fiddler-web-debugger/</link>
		<comments>http://blog.ericlamb.net/2009/08/fiddler-web-debugger/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 13:00:16 +0000</pubDate>
		<dc:creator>Eric Lamb</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.ericlamb.net/?p=1818</guid>
		<description><![CDATA[Let&#8217;s not kid ourselves: web development isn&#8217;t that hard. Nope, the server side stuff (php, .NET, etc) or even what happens in the browser (JavaScript, CSS, etc) isn&#8217;t too difficult. Not all of it&#8217;s easy though; sometimes when dealing with the HTTP level things can get a little&#8230; random. In FireFox I use a couple [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s not kid ourselves: web development isn&#8217;t that hard. Nope, the server side stuff (php, .NET, etc) or even what happens in the browser (JavaScript, CSS, etc) isn&#8217;t too difficult. Not all of it&#8217;s easy though; sometimes when dealing with the HTTP level things can get a little&#8230; random.</p>
<div id="attachment_2168" class="wp-caption aligncenter" style="width: 287px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/07/FiddlerLogo.png" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F07%2FFiddlerLogo.png','Fiddler+Web+Debugger')"><img class="size-full wp-image-2168" title="Fiddler Web Debugger" src="http://blog.ericlamb.net/wp-content/uploads/2009/07/FiddlerLogo.png" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F07%2FFiddlerLogo.png','Fiddler+Web+Debugger')" alt="Fiddler Web Debugger" width="277" height="84" /></a><p class="wp-caption-text">Fiddler Web Debugger</p></div>
<p>In FireFox I use a couple plugins to help make HTTP debugging a little less painful; HttpFox and the venerable FireBug. There&#8217;s also a cool tool called <a title="Fiddler Web Debugger" href="http://www.fiddler2.com/fiddler2/" onclick="return TrackClick('http%3A%2F%2Fwww.fiddler2.com%2Ffiddler2%2F','Fiddler+Web+Debugger')" target="_blank">Fiddler</a> written by Eric Lawrence of Microsoft.</p>
<blockquote><p>Fiddler is a Web Debugging Proxy which logs all HTTP(S) traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP(S) traffic, set breakpoints, and &#8220;fiddle&#8221; with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language.</p>
<p>Fiddler is freeware and can debug traffic from virtually any application, including Internet Explorer, Mozilla Firefox, Opera, and thousands more.</p></blockquote>
<p>First, it should be noted that Fiddler is covered under a Microsoft license. That might matter to you or your company&#8230;</p>
<p>Anyway, in order to get Fiddler to work with anything other than IE, I&#8217;m talking about programs like FireFox or similar, you have to do some tampering and configuring of Windows, including the registry, along with the program you want ot send requests from, so for now I only tested it using IE (this can&#8217;t last though; I&#8217;m just NOT going to develop in IE).</p>
<p>Fiddler does the basic HTTP sniffing you&#8217;d expect but it also has tools to inspect and tamper with the data in the traffic; this is where HttpFox and Firebug drop the ball. Fiddler allows you to see the basics as you would expect any HTTP sniffer to allow but also displays out an XML rendering as well as the Hex view (if you need that sort of thing).</p>
<p>You can mess with a bunch of the different parts of the session including the session itself using custom built &#8220;rules&#8221;. These rules are written in JavaScript and contain commands that extend Fiddlers UI to allow for extensibility. Needless to say, this is a cool part of the tool.</p>
<p>Another really cool feature of Fiddler is that it can hook into the session for pretty much any Microsoft program that connects to the Internet like Microsoft Office. (I&#8217;d always been curious what connections Office makes while open and finding that out scratched a long standing itch.)</p>
<p>It&#8217;s definitely worth a look if you need to debug any HTTP traffic (AJAX anyone?).</p>
<div><a class="addthis_button" href="http://blog.ericlamb.net//addthis.com/bookmark.php?v=250" addthis:url='http://blog.ericlamb.net/2009/08/fiddler-web-debugger/' addthis:title='Fiddler Web Debugger '><img src="//cache.addthis.com/cachefly/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ericlamb.net/2009/08/fiddler-web-debugger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How Do You Diff?</title>
		<link>http://blog.ericlamb.net/2009/05/how-do-you-diff/</link>
		<comments>http://blog.ericlamb.net/2009/05/how-do-you-diff/#comments</comments>
		<pubDate>Wed, 20 May 2009 13:18:42 +0000</pubDate>
		<dc:creator>Eric Lamb</dc:creator>
				<category><![CDATA[Brain Dump]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[diff]]></category>

		<guid isPermaLink="false">http://blog.ericlamb.net/?p=1694</guid>
		<description><![CDATA[The other day I was working on a page that made heavy use of JavaScript. I&#8217;d been cool about it actually; I was using Prototype and Scriptaculous as the framework. I was even testing with virtual machines and everything! Then, mysteriously, the page stopped working in IE. Really frustrating because, well, fuck man, it WORKED. [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I was working on a page that made heavy use of JavaScript. I&#8217;d been cool about it actually; I was using <a title="Prototype" href="http://www.prototypejs.org/" onclick="return TrackClick('http%3A%2F%2Fwww.prototypejs.org%2F','Prototype')" target="_blank">Prototype</a> and <a title="Scriptaculous" href="http://script.aculo.us/" onclick="return TrackClick('http%3A%2F%2Fscript.aculo.us%2F','Scriptaculous')" target="_blank">Scriptaculous</a> as the framework. I was even testing with virtual machines and everything!</p>
<div id="attachment_1699" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/05/diff_merge.jpg" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F05%2Fdiff_merge.jpg','DiffMerge')"><img class="size-medium wp-image-1699" title="DiffMerge" src="http://blog.ericlamb.net/wp-content/uploads/2009/05/diff_merge-300x183.jpg" alt="DiffMerge" width="300" height="183" /></a><p class="wp-caption-text">DiffMerge</p></div>
<p>Then, mysteriously, the page stopped working in IE. Really frustrating because, well, fuck man, it WORKED. Why it happened doesn&#8217;t matter; I did something pretty stupid.</p>
<p>What is important is that it was fixed. For that, I went through my source (<a title="Subversion" href="http://subversion.tigris.org/" onclick="return TrackClick('http%3A%2F%2Fsubversion.tigris.org%2F','Subversion')" target="_blank">SVN</a>) repository and found the file that worked. Easy really.</p>
<p>This still left the issue of why it happened though.</p>
<p>Quick aside: I don&#8217;t understand people who just accept that something works (ie; it broke, I fixed it, I&#8217;m done). How can you not <em>need</em> to figure out what happened? How will you prevent this from happening again?</p>
<p>To solve that little mystery I busted out my trusy diff tool; SourceGear&#8217;s <a title="DiffMerge" href="http://sourcegear.com/diffmerge/downloads.html" onclick="return TrackClick('http%3A%2F%2Fsourcegear.com%2Fdiffmerge%2Fdownloads.html','DiffMerge')" target="_blank">DiffMerge</a>.</p>
<p>I&#8217;ve tried a bunch of diff tools, on both Windows and Linux, but at this point I&#8217;m really digging DiffMerge. According to the site:</p>
<blockquote>
<ul>
<li><strong>Diff</strong>.  Graphically shows the changes between two files.  Includes intra-line highlighting and full support for editing.</li>
<li><strong>Merge</strong>.  Graphically shows the changes between 3 files.  Allows automatic merging (when safe to do so) and full control over editing the resulting file.</li>
<li><strong>Folder Diff</strong>.  Performs a side-by-side comparison of 2 folders, showing which files are only present in one file or the other, as well as file pairs which are identical or different.</li>
<li><strong>Configurable</strong>.  Rulesets and options provide for customized appearance and behavior.</li>
</ul>
</blockquote>
<p>It&#8217;s a really great diff tool totally worth checking out.</p>
<div><a class="addthis_button" href="http://blog.ericlamb.net//addthis.com/bookmark.php?v=250" addthis:url='http://blog.ericlamb.net/2009/05/how-do-you-diff/' addthis:title='How Do You Diff? '><img src="//cache.addthis.com/cachefly/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ericlamb.net/2009/05/how-do-you-diff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

