<?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>brettdargan.com &#187; code</title>
	<atom:link href="http://brettdargan.com/blog/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://brettdargan.com/blog</link>
	<description>&#955; Thoughts and rants</description>
	<lastBuildDate>Fri, 28 May 2010 01:35:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>HATEOAS for legacy object models</title>
		<link>http://brettdargan.com/blog/2009/01/14/hateoas-for-legacy-object-models/</link>
		<comments>http://brettdargan.com/blog/2009/01/14/hateoas-for-legacy-object-models/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 15:44:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Patterns]]></category>
		<category><![CDATA[RESTful]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[aop]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[hateoas]]></category>
		<category><![CDATA[rest]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/?p=196</guid>
		<description><![CDATA[One of the best aspects of RESTful orientated services is getting your resources connected, possibly even achieving HATEOAS. Making that jump with with legacy object models or data can be tricky, depending on how intrusive you want to be. There is such a large amount of legacy data in various forms, usually with minimal links/relations [...]]]></description>
			<content:encoded><![CDATA[
<div class="document">


<!-- -*- mode: rst -*- -->
<p>One of the best aspects of RESTful orientated services is getting your resources connected, possibly even achieving HATEOAS. Making that jump with with legacy object models or data can be tricky, depending on how intrusive you want to be.</p>
<p>There is such a large amount of legacy data in various forms, usually with minimal links/relations that could be leveraged.</p>
<p>So it is a worthy challenge to try and do it in the least intrusive manner possible.</p>
<p>This is one approach that is reasonably decoupled from an existing legacy model.</p>
<p>There are three main parts to this technique:</p>
<ol class="arabic simple">
<li>Enhance your model objects so they have a placeholder/collection so you can accumulate links</li>
<li>Annotate your model at interesting points with <strong>link templates</strong>, around attributes or methods or classes</li>
<li>Use a custom <a class="reference external" href="http://jersey.dev.java.net&quot;">ContainerResponseFilter</a> class of jersey to scan for annotations of interest, then evaluate your link templates (at run time), using the data of your models and any request based information you may require.</li>
</ol>
<p>I chose to enhance my model classes using <a class="reference external" href="http://eclipse.org/aspectj">AspectJ</a> at compile time.</p>
<p><a class="reference external" href="http://brettdargan.com/blog/wp-content/uploads/2009/01/hateoas4legacytar.bz2">Download the source</a></p>
<div class="codeblock"><div class="highlight"><pre>mvn glassfish:run
./curl_test #will hit two urls
</pre></div>
</div><p>and you should see some results, with links like this:</p>
<div class="codeblock"><div class="highlight"><pre><span style="color: #BC7A00">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;</span>
<span style="color: #008000; font-weight: bold">&lt;country</span> <span style="color: #7D9029">xmlns:ns2=</span><span style="color: #BA2121">&quot;http://www.w3.org/1999/xlink&quot;</span><span style="color: #008000; font-weight: bold">&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;links&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;link</span> <span style="color: #7D9029">rel=</span><span style="color: #BA2121">&quot;&quot;</span> <span style="color: #7D9029">ns2:type=</span><span style="color: #BA2121">&quot;locator&quot;</span>
        <span style="color: #7D9029">ns2:href=</span><span style="color: #BA2121">&quot;http://localhost:8080/hateoas4legacy/rs/cities/Brisbane&quot;</span><span style="color: #008000; font-weight: bold">/&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;link</span> <span style="color: #7D9029">rel=</span><span style="color: #BA2121">&quot;&quot;</span>
        <span style="color: #7D9029">ns2:type=</span><span style="color: #BA2121">&quot;locator&quot;</span> <span style="color: #7D9029">ns2:href=</span><span style="color: #BA2121">&quot;http://localhost:8080/hateoas4legacy/rs/cities/Sydney&quot;</span><span style="color: #008000; font-weight: bold">/&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;link</span> <span style="color: #7D9029">rel=</span><span style="color: #BA2121">&quot;&quot;</span>
        <span style="color: #7D9029">ns2:type=</span><span style="color: #BA2121">&quot;locator&quot;</span> <span style="color: #7D9029">ns2:href=</span><span style="color: #BA2121">&quot;http://localhost:8080/hateoas4legacy/rs/cities/Melbourne&quot;</span><span style="color: #008000; font-weight: bold">/&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;link</span> <span style="color: #7D9029">rel=</span><span style="color: #BA2121">&quot;&quot;</span>
        <span style="color: #7D9029">ns2:type=</span><span style="color: #BA2121">&quot;locator&quot;</span> <span style="color: #7D9029">ns2:href=</span><span style="color: #BA2121">&quot;http://localhost:8080/hateoas4legacy/rs/countries/AU&quot;</span><span style="color: #008000; font-weight: bold">/&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;/links&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;cities&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;city&gt;</span>
      <span style="color: #008000; font-weight: bold">&lt;links/&gt;</span>
      <span style="color: #008000; font-weight: bold">&lt;name&gt;</span>Brisbane<span style="color: #008000; font-weight: bold">&lt;/name&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;/city&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;city&gt;</span>
        <span style="color: #008000; font-weight: bold">&lt;links/&gt;</span>
        <span style="color: #008000; font-weight: bold">&lt;name&gt;</span>Sydney<span style="color: #008000; font-weight: bold">&lt;/name&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;/city&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;city&gt;</span>
      <span style="color: #008000; font-weight: bold">&lt;links/&gt;</span>
      <span style="color: #008000; font-weight: bold">&lt;name&gt;</span>Melbourne<span style="color: #008000; font-weight: bold">&lt;/name&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;/city&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;/cities&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;isoCode&gt;</span>AU<span style="color: #008000; font-weight: bold">&lt;/isoCode&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;name&gt;</span>Australia<span style="color: #008000; font-weight: bold">&lt;/name&gt;</span>
<span style="color: #008000; font-weight: bold">&lt;/country&gt;</span>
</pre></div>
</div><p>All countries Results</p>
<div class="codeblock"><div class="highlight"><pre><span style="color: #BC7A00">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;</span>
<span style="color: #008000; font-weight: bold">&lt;countries&gt;</span>
<span style="color: #008000; font-weight: bold">&lt;country</span> <span style="color: #7D9029">xmlns:ns2=</span><span style="color: #BA2121">&quot;http://www.w3.org/1999/xlink&quot;</span><span style="color: #008000; font-weight: bold">&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;links&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;link</span> <span style="color: #7D9029">rel=</span><span style="color: #BA2121">&quot;&quot;</span>
        <span style="color: #7D9029">ns2:type=</span><span style="color: #BA2121">&quot;locator&quot;</span> <span style="color: #7D9029">ns2:href=</span><span style="color: #BA2121">&quot;http://localhost:8080/hateoas4legacy/rs/countries/AU&quot;</span><span style="color: #008000; font-weight: bold">/&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;/links&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;cities/&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;isoCode&gt;</span>AU<span style="color: #008000; font-weight: bold">&lt;/isoCode&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;name&gt;</span>Australia<span style="color: #008000; font-weight: bold">&lt;/name&gt;</span>
<span style="color: #008000; font-weight: bold">&lt;/country&gt;</span>
<span style="color: #008000; font-weight: bold">&lt;country</span> <span style="color: #7D9029">xmlns:ns2=</span><span style="color: #BA2121">&quot;http://www.w3.org/1999/xlink&quot;</span><span style="color: #008000; font-weight: bold">&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;links&gt;</span>
    <span style="color: #008000; font-weight: bold">&lt;link</span> <span style="color: #7D9029">rel=</span><span style="color: #BA2121">&quot;&quot;</span>
        <span style="color: #7D9029">ns2:type=</span><span style="color: #BA2121">&quot;locator&quot;</span> <span style="color: #7D9029">ns2:href=</span><span style="color: #BA2121">&quot;http://localhost:8080/hateoas4legacy/rs/countries/USA&quot;</span><span style="color: #008000; font-weight: bold">/&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;/links&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;cities/&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;isoCode&gt;</span>USA<span style="color: #008000; font-weight: bold">&lt;/isoCode&gt;</span>
  <span style="color: #008000; font-weight: bold">&lt;name&gt;</span>United States of America<span style="color: #008000; font-weight: bold">&lt;/name&gt;</span>
<span style="color: #008000; font-weight: bold">&lt;/country&gt;</span>
<span style="color: #008000; font-weight: bold">&lt;/countries&gt;</span>
</pre></div>
</div><p>It is very crufty, but does work in the simple cases.
I haven't had a chance to demonstrate all of the features yet.</p>
<p>I'm likely to further flesh out this example as it is interesting in other RESTful related ways.</p>
</div>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=HATEOAS+for+legacy+object+models+http%3A%2F%2Ftinyurl.com%2Fcee6ve" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=HATEOAS+for+legacy+object+models+http%3A%2F%2Ftinyurl.com%2Fcee6ve" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2009/01/14/hateoas-for-legacy-object-models/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Experimental Java Circuit Breaker Pattern Implementation</title>
		<link>http://brettdargan.com/blog/2007/12/15/experimental-circuit-breaker-pattern-implementation/</link>
		<comments>http://brettdargan.com/blog/2007/12/15/experimental-circuit-breaker-pattern-implementation/#comments</comments>
		<pubDate>Fri, 14 Dec 2007 15:24:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Patterns]]></category>
		<category><![CDATA[Stability, Performance and Monitoring]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/2007/12/15/experimental-circuit-breaker-pattern-implementation/</guid>
		<description><![CDATA[I read "Release It" recently, not a bad book, some good stories, I wish more people would pay attention to things like Stability and Capacity. Anyway I liked the Circuit Breaker pattern, as I've seen a number of apps with highly coupled systems that barf once latency increases in the back ends then you get [...]]]></description>
			<content:encoded><![CDATA[<p>I read <a href="http://www.pragprog.com/titles/mnee" title="Release It">"Release It"</a> recently, not a bad book, some good stories, I wish more people would pay attention to things like Stability and Capacity.</p>
<p>Anyway I liked the Circuit Breaker pattern, as I've seen a number of apps with highly coupled systems that barf once latency increases in the back ends then you get "Cascading Failures" and the webapp's request handler thread pool is exhausted and they all wait their mandatory 30 seconds for a response. Eventually the app either dies, or gets taken out of a load balance farm causing a "Chain Reaction".</p>
<p>Here is an <a href="http://brettdargan.com/blog/wp-content/uploads/2007/12/circuit_breaker.tgz" title="Experimental Circuit Breaker Implementation (circuit_breaker.tgz)">Experimental Circuit Breaker Implementation (circuit_breaker.tgz)</a> , <strong>NOT built or tested FOR PRODUCTION use in anyway</strong>. There is explicity no thread safety no the actual CircuitBreakerSimple class.</p>
<p>download, extract and run ant.</p>
<p>Play around with the parameters to see the affect. Generally it seems to thrash more with increased concurrent threads and interestingly in jdk1.6 sometimes reverts to the default timeout instead of the instance value.</p>
<p>Based roughly on the following logic:<br />
When Circuit is Closed:<br />
on call = pass through<br />
call succeeds = reset count<br />
call fails = count failure<br />
threshold reached = trip breaker. Open State</p>
<p>when Circuit is Half-Open<br />
on call = pass through<br />
call succeeds = reset go. Close State<br />
call fails = trip breaker. Open State</p>
<p>when Circuit is Open<br />
on call = return/fail<br />
on timeout = attempt reset. Half-Open State</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Experimental+Java+Circuit+Breaker+Pattern+Implementation+http%3A%2F%2Ftinyurl.com%2F6avqqeb" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Experimental+Java+Circuit+Breaker+Pattern+Implementation+http%3A%2F%2Ftinyurl.com%2F6avqqeb" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2007/12/15/experimental-circuit-breaker-pattern-implementation/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>IE6 Operation Aborted not just for the DOM not being ready</title>
		<link>http://brettdargan.com/blog/2007/12/05/ie6-operation-aborted-not-just-for-the-dom-not-being-ready/</link>
		<comments>http://brettdargan.com/blog/2007/12/05/ie6-operation-aborted-not-just-for-the-dom-not-being-ready/#comments</comments>
		<pubDate>Tue, 04 Dec 2007 14:03:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/2007/12/05/ie6-operation-aborted-not-just-for-the-dom-not-being-ready/</guid>
		<description><![CDATA[Most discussions about Operation Aborted only mention when javascript is attempting to manipulate the DOM prior to it being ready. I've seen it fail prior to any of your own js executing. Try this for an experiment have an onload event log something but also return: You have an large list of table results that [...]]]></description>
			<content:encoded><![CDATA[<p>Most discussions about Operation Aborted only mention when javascript is attempting to manipulate the DOM prior to it being ready.</p>
<p>I've seen it fail prior to any of your own js executing.</p>
<p>Try this for an experiment have an onload event log something but also return:</p>
<p>You have an large list of table results that are fed back to the browser with a slight delay per row (ie. an unfortunate logging statement per row)</p>
<p>What comes first?</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=IE6+Operation+Aborted+not+just+for+the+DOM+not+being+ready+http%3A%2F%2Ftinyurl.com%2F5w32e7t" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=IE6+Operation+Aborted+not+just+for+the+DOM+not+being+ready+http%3A%2F%2Ftinyurl.com%2F5w32e7t" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2007/12/05/ie6-operation-aborted-not-just-for-the-dom-not-being-ready/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Packaging Custom Widgets with Dojo</title>
		<link>http://brettdargan.com/blog/2006/08/14/packaging-custom-widgets-with-dojo/</link>
		<comments>http://brettdargan.com/blog/2006/08/14/packaging-custom-widgets-with-dojo/#comments</comments>
		<pubDate>Mon, 14 Aug 2006 00:41:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/?p=76</guid>
		<description><![CDATA[Recently I was involved in investigating integration of a client site with an affiliate site. Both parties were interested in avoiding iframes and it's baggage. Ideally we were looking for a solution that involved: minimal (html,css,js) code on affiliates pages. After all who would want deployment dependencies across organisations? dynamic json data served from our [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was involved in investigating integration of a client site with an affiliate site.</p>
<p>Both parties were interested in avoiding iframes and it's baggage.</p>
<p>Ideally we were looking for a solution that involved:
<ul>
<li>minimal (html,css,js) code on affiliates pages. After all who would want deployment dependencies across organisations?</li>
<li>dynamic <a href="http://json.org">json data</a> served from our site</li>
<li>long lived highly compressed components</li>
<li>efficient use of connections to our server</li>
</ul>
<p>We evaluated <a href="http://dojotoolkit.org">dojo</a> and <a href="http://code.google.com/webtoolkit/">google web toolkit</a></p>
<p>Dojo won out, among it's many features it has:</p>
<ul>
<li>Nice Custom Widgets</li>
<li><a href="http://ajaxian.com/archives/ajax-experience-day-2-alex-russells-dojo-in-depth">Cross Domain IO</a> via <a href="http://archive.dojotoolkit.org/nightly/tests/io/test_ScriptSrcIO.html">ScriptSrcIO</a></li>
<li><a href="http://manual.dojotoolkit.org/WikiHome/DojoDotBook/Book52">compression and packaging into a single js</a>. create your own profile listing your dependencies and dojo buildscripts</li>
<li><a href="http://manual.dojotoolkit.org/WikiHome/DojoDotBook/Book48">XDomain package loading</a>. You need to build it from source, Although this wasn't required for us in the end.</li>
</ul>
<h3>Widget Issues</h3>
<p>Unfortunately widgets are not completely self-contained. CSS is a bit of a problem. Typical custom widget will result in your css being inlined into your html widget, but this isn't required or always the bestway to go.</p>
<p>CSS relative image references are resolved relative to the host the base page was served from not our site.  </p>
<p>We decided to keep our relative image references and have our stylesheet added to our affiliate pages dynamically.</p>
<p>Give namespaces are changing in new version we didn't create our own and just used dojo.widget...</p>
<h3>Should Dojo be called Sumo? (says teagles)</h3>
<p>Most ajax libraries are fairly heavy, you are looking at atleast 100K with the average closer to 200K to get simple io, events, effects and dom manipulation functionality. Disclaimer, it was a pretty quick scan a couple of weeks ago, of <a href="http://mochikit.org">mochikit</a>, <a href="http://dojotoolkit.org">dojo</a> and <a href="http://script.aculo.us/">scriptaculous</a>. </p>
<p>After various packaging experimentation the Animation.js heavyweight seemed pretty core if you want to use custom widgets.</p>
<h3>Why GWT wasn't for us</h3>
<ul>
<li>binary format</li>
<li>can't use 5.0 features</li>
<li>not all features supported, ie new ArrayList(size)</li>
<li>active monitoring</li>
<li>components served off <a href="http://www.google.com">google</a></li>
<li>...</li>
</ul>
<p>GWT does have some upsides though:</p>
<ul>
<li>testability</li>
<li>small footprint</li>
<li>cross browser compatibility verified by google</li>
</ul>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Packaging+Custom+Widgets+with+Dojo+http%3A%2F%2Ftinyurl.com%2F6lbctrz" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Packaging+Custom+Widgets+with+Dojo+http%3A%2F%2Ftinyurl.com%2F6lbctrz" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2006/08/14/packaging-custom-widgets-with-dojo/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Firebug, cool new firefox plugin</title>
		<link>http://brettdargan.com/blog/2006/04/17/firebug-cool-new-firefox-plugin/</link>
		<comments>http://brettdargan.com/blog/2006/04/17/firebug-cool-new-firefox-plugin/#comments</comments>
		<pubDate>Sun, 16 Apr 2006 22:46:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/?p=70</guid>
		<description><![CDATA[in case you haven't seen it yet. Firebug * Status bar icon shows you when there is an error in a web page * A console that shows errors from JavaScript and CSS * Log messages from JavaScript in your web page to the console (bye bye "alert debugging") * An JavaScript command line (no [...]]]></description>
			<content:encoded><![CDATA[<p>in case you haven't seen it yet.</p>
<p><a href="https://addons.mozilla.org/firefox/1843/">Firebug</a></p>
<p>* Status bar icon shows you when there is an error in a web page<br />
* A console that shows errors from JavaScript and CSS<br />
* Log messages from JavaScript in your web page to the console (bye bye "alert debugging")<br />
* An JavaScript command line (no more "javascript:" in the URL bar)<br />
* Spy on XMLHttpRequest traffic<br />
* Inspect HTML source, computed style, events, layout and the DOM</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Firebug%2C+cool+new+firefox+plugin+http%3A%2F%2Ftinyurl.com%2F6z9qt8s" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Firebug%2C+cool+new+firefox+plugin+http%3A%2F%2Ftinyurl.com%2F6z9qt8s" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2006/04/17/firebug-cool-new-firefox-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keeping layers decoupled</title>
		<link>http://brettdargan.com/blog/2006/02/11/keeping-layers-decoupled/</link>
		<comments>http://brettdargan.com/blog/2006/02/11/keeping-layers-decoupled/#comments</comments>
		<pubDate>Fri, 10 Feb 2006 16:02:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/?p=56</guid>
		<description><![CDATA[A while ago I wrote a unit test that used JDepend to help keep developers using a layered approach when using packages. Unfortunately devs worked out that by creating new packages they could work around that limitation instead of using IOC and avoiding circular dependencies. So Tom mentioned the ant-contrib tasks, Compile With Walls and [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I wrote a unit test that used JDepend to help keep developers using a layered approach when using packages. Unfortunately devs worked out that by creating new packages they could work around that limitation instead of using IOC and avoiding circular dependencies.</p>
<p>So Tom mentioned the <a href="http://sourceforge.net/projects/ant-contrib">ant-contrib</a> tasks, Compile With Walls and VerifyDesign. </p>
<p>Compile with Walls is great, packages won't compile if layers are broken. It is marked as deprecated with Verify Design to replace it. </p>
<p>Verify Design works after compilation and can't detect the source code violations of constants imported from other packages.</p>
<p>Compile With Walls requires dependant packages to declare all dependencies and the dependencies of dependencies, which could get unwieldly, but still potentially useful. An option to not have to do that would be nice.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Keeping+layers+decoupled+http%3A%2F%2Ftinyurl.com%2F5sxzn5d" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Keeping+layers+decoupled+http%3A%2F%2Ftinyurl.com%2F5sxzn5d" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2006/02/11/keeping-layers-decoupled/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Oracle &#8220;IN&#8221; condition limits</title>
		<link>http://brettdargan.com/blog/2004/10/13/oracle-in-condition-limits/</link>
		<comments>http://brettdargan.com/blog/2004/10/13/oracle-in-condition-limits/#comments</comments>
		<pubDate>Tue, 12 Oct 2004 22:17:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/?p=16</guid>
		<description><![CDATA[In Oracle 8i it use to be that the "IN" condition was limited to 254 expressions, in total so stringing a few together with "OR" didn't work. But now in 10g you have alot more freedom, for starters the expression list is now limited to 1000 plus you can have multiple "IN" conditions in the [...]]]></description>
			<content:encoded><![CDATA[<p>In Oracle 8i it use to be that the "IN" condition was limited to 254 expressions,  in total so stringing a few together with "OR" didn't work.  </p>
<p>But now in 10g you have alot more freedom, for starters the expression list is now limited to 1000 plus you can have multiple "IN" conditions in the query to extend that and if you want something less smelly, create a collection and use the CAST and TABLE commands to join an in memory collection of predefined type to real tables. </p>
<p>When I first tried the latter method in 8i it was too unreliable to use, but now it seems better, thanks to Gary Mandelkow for doing the leg work and testing 10g, we can reliably do this with atleast a 3000 member collection.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Oracle+%E2%80%9CIN%E2%80%9D+condition+limits+http%3A%2F%2Ftinyurl.com%2F6b43snh" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Oracle+%E2%80%9CIN%E2%80%9D+condition+limits+http%3A%2F%2Ftinyurl.com%2F6b43snh" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2004/10/13/oracle-in-condition-limits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion and WebDAV</title>
		<link>http://brettdargan.com/blog/2004/09/04/subversion-and-webdav/</link>
		<comments>http://brettdargan.com/blog/2004/09/04/subversion-and-webdav/#comments</comments>
		<pubDate>Sat, 04 Sep 2004 00:56:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/?p=13</guid>
		<description><![CDATA[Apart from this blog I wanted to integrate other content for future reference, preferably under source code control. In keeping with the theme "do the simplest thing possible" I decided to go with configuring apache with a webdav location backed by an subversion repository. It seems really ironic to me that the "V" in WebDAV [...]]]></description>
			<content:encoded><![CDATA[<p>Apart from this blog I wanted to integrate other content for future reference, preferably under source code control. In keeping with the theme "do the simplest thing possible" I decided to go with configuring <a href="httpd.apache.org">apache</a> with a <a href="www.webdav.org">webdav</a> location backed by an <a href="svn.tigris.org">subversion</a> repository.</p>
<p>It seems really ironic to me that the "V" in WebDAV is optional, but that's the way it is. It does mean you can have your DAV location backed by a file system and only one version.</p>
<p>Get <a href="subversion.tigris.org">subversion</a> installed with ssl support:<br /><code>./configure --with-ssl</code> so it will build <a href="http://www.webdav.org/neon/neon">neon</a> as well. This is important if you want your svn client to access your server via https://myserver.com/svn.</p>
<p>Follow the <a href="subversion.tigris.org">subversion documentation</a> or checkout the <a href="http://svnbook.red-bean.com/svnbook/">subversion book</a> to create a repository add a test file, and make sure all that is working before doing the <a href="httpd.apache.org">httpd</a> integration.</p>
<p>When you follow the <a href="http://svnbook.red-bean.com/svnbook/ch06s04.html">svn httpd setup</a> one thing that tripped me up in setting up the config was turning AutoVersioning option function, in the books example they have config for the mod_dav_fs not mod_dav_svn.<br />
<code><br />
    DAV svn<br />
    SVNPath /fullpath<br />
    SVNAutoversioning on<br />
...<br />
</code></p>
<p>And if that worked you should have no problems viewing one of the files in your repository, via http://myserver.com/svn/index.html</p>
<p>Back at the start of this blog I wanted to setup some versioned docs that I could access over the net, but chances are that if you browse to that location you will only get the plain text version of the file. </p>
<p>WebDAV supports meta data about files, called Properties, which is exactly how mime-type's are treated, so by doing something like this <code>svn propset svn:mime-type text/html index.html</code>. </p>
<p>You only need to add it manually if the svn client you used to add the file had "auto-props" option set to "no", which is the default. </p>
<p>Now that that is up and running, you can get your life in order with <a href="http://www.mozilla.org/projects/calendar/">sunbird</a><br />
and keep versioned remote calendars on your server. <a href="http://www.twilight-systems.com/flacco/mozcal/mozcal-webdav.html">Creating a remote calendar</a> is pretty straight forward, although the screenshots from that link didn't match with the current build, I couldn't import, since the authentication option was not provided in the gui, so I had to add the local file directly with svn then subscribe to it. </p>
<p>I went straight for setting up https over the other types of secure options subversion supports. You might also want to checkout the "LimitExcept" options for creating a anonymous read but write protected repository. </p>
<p>There are some other common tools available for WebDAV like <a href="http://www.webdav.org/cadaver/">cadaver</a>, but since i'm only interested in dav locations backed by svn, the svn client is the only cli tool I'll need.</p>
<p>You could try out the <a href="http://www.webdav.org/neon/litmus/">litmus</a> test to see how good the support is, although be warned, <a href="subversion.tigris.org">subversion</a> does not yet fully support the WebDAV protocol.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Subversion+and+WebDAV+http%3A%2F%2Ftinyurl.com%2F6xr8th5" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Subversion+and+WebDAV+http%3A%2F%2Ftinyurl.com%2F6xr8th5" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2004/09/04/subversion-and-webdav/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>hello Ruby, goodbye perl, awk&#8230;</title>
		<link>http://brettdargan.com/blog/2004/08/20/hello-ruby-goodbye-perl-awk/</link>
		<comments>http://brettdargan.com/blog/2004/08/20/hello-ruby-goodbye-perl-awk/#comments</comments>
		<pubDate>Thu, 19 Aug 2004 23:27:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[languages]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/?p=12</guid>
		<description><![CDATA[Ruby has been around for a while, I've been meaning to look at this for ages and when Jon Tirsen mentioned DamageControl is written in it, it was yet another push for me to have a squiz. I had a superficial look mainly from a scripting point of view and it looks great, I might [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ruby-lang.org/">Ruby</a> has been around for a while, I've been meaning to look at this for ages and when <a href="http://www.codehaus.org/~tirsen/">Jon Tirsen</a> mentioned DamageControl is written in it, it was yet another push for me to have a squiz. </p>
<p>I had a superficial look mainly from a scripting point of view and it looks great, I might never have to write another awk script again!</p>
<p>Here is the socketcount program from a recent post rewritten in ruby.<br />
<code><br />
#!/usr/bin/ruby<br />
#socketcount in ruby<br />
if $*.size > 0<br />
  regex = $*[0]<br />
else<br />
  regex = '^..p'<br />
end<br />
result = %x{sudo netstat -tpa | grep #{regex} | grep -v LISTEN }<br />
# All Socket connections counted (originating and terminating)<br />
h = {}<br />
result.each() { |s|<br />
  service = s.split(' ')[4]<br />
  h[service] = h[service].to_i + 1<br />
}<br />
h.each { | key, value | print key, " ",value, "n" }<br />
</code></p>
<p>It suits my purposes for scripting and seems to be pretty impressive in other aspects.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=hello+Ruby%2C+goodbye+perl%2C+awk%E2%80%A6+http%3A%2F%2Ftinyurl.com%2F6ghnsdl" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=hello+Ruby%2C+goodbye+perl%2C+awk%E2%80%A6+http%3A%2F%2Ftinyurl.com%2F6ghnsdl" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2004/08/20/hello-ruby-goodbye-perl-awk/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Debugging IntelliJ Plugins</title>
		<link>http://brettdargan.com/blog/2004/08/16/debugging-intellij-plugins/</link>
		<comments>http://brettdargan.com/blog/2004/08/16/debugging-intellij-plugins/#comments</comments>
		<pubDate>Mon, 16 Aug 2004 00:41:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/?p=11</guid>
		<description><![CDATA[The IntelliJ community just hasn't caught up with the Eclipse community in terms quantity and quality of plugins available. I don't know how many plugins I thought would be cool, download and try and configure it no doco and buggy configuration forms to not get any results. So in disgust I thought I'd look at [...]]]></description>
			<content:encoded><![CDATA[<p>The IntelliJ community just hasn't caught up with the Eclipse community in terms quantity and quality of plugins available.</p>
<p>I don't know how many plugins I thought would be cool, download and try and configure it no doco and buggy configuration forms to not get any results.</p>
<p>So in disgust I thought I'd look at debugging some, so I had a look at jetstyle, it was bugging me that it didn't work and the cvs version looked like it should work in 4.5.</p>
<p>http://www.intellij.org/twiki/bin/view/Main/PluginTesting had some tips for debugging in IntelliJ, I wrote some unix scripts for option 1, it didn't work very cleanly but it does run.</p>
<p>After all of that it was easy to see a problem at configuration time and then a problem at run checkstyle execution, I just had to remove our Custom Checkstyle Rule and hey presto it worked. It would be nice if they could support that and do a release for 4.5, it's been along time between releases for the jetstyle project.</p>
<p>The PSIViewer plugin is very cool and would be worth looking at if you are thinking about writing a plugin.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Debugging+IntelliJ+Plugins+http%3A%2F%2Ftinyurl.com%2F6ahpwdl" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Debugging+IntelliJ+Plugins+http%3A%2F%2Ftinyurl.com%2F6ahpwdl" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2004/08/16/debugging-intellij-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

