<?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"
	>

<channel>
	<title>Higgins for President</title>
	<atom:link href="http://higginsforpresident.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://higginsforpresident.net</link>
	<description>Rants, Raves, and Code: the Interwebs and beyond</description>
	<pubDate>Sun, 02 Nov 2008 12:00:03 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Dojo: The Missing APIs</title>
		<link>http://higginsforpresident.net/2008/11/dojo-the-missing-apis/</link>
		<comments>http://higginsforpresident.net/2008/11/dojo-the-missing-apis/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 11:59:00 +0000</pubDate>
		<dc:creator>dante hicks</dc:creator>
		
		<category><![CDATA[dojo]]></category>

		<guid isPermaLink="false">http://higginsforpresident.net/?p=27</guid>
		<description><![CDATA[In my last article I created a set of small, useful utility functions on top of the Base Dojo APIs for personal consumption. Patterns I'd been following and using in Dojo for some time that Dojo didn't have "official" functions for. Well, I've taken it "a little too far", and created a (if I do [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://higginsforpresident.net/2008/10/dojoshow-hide-toggle-and-more/">my last article</a> I created a set of small, useful utility functions on top of the Base Dojo APIs for personal consumption. Patterns I'd been following and using in Dojo for some time that Dojo didn't have "official" functions for. Well, I've taken it "a little too far", and created a (if I do say so myself) rather cool mini-open-source-project called <a href="http://code.google.com/p/plugd/">plugd</a>.  </p>
<p>I've put up a <a href="http://code.google.com/p/plugd/downloads/list">minified version</a> of the most recent "stable" version, and submitted all the code to subversion. Before gzip, the plugin is 2.5k (1.1k after), so I've broken my 1k threshold -- but I think the extra 100 bytes are worth it. So what's new? Where did the bytes comes from!?</p>
<p><a href="http://cometdaily.com/people/michael_carter/">Michael Carter</a> of <a href="http://orbited.org/">Orbited</a> fame stumbled into #dojo recently asking if Dojo had a simple "create some Dom from text" function like jQuery:</p>
<pre class="javascript">&nbsp;
$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;
&lt;div class='bar'&gt;&lt;/div&gt;
&nbsp;
&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">appendTo</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;#baz&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>(<em>note: wordpress doesn't like div tags in code blocks? what's that about?</em>)</p>
<p>And unfortunately, we don't. Dojo's functional approach to things would say: "But dojo.query is a dom <em>selection</em> function, not a dom <em>creation</em> function", which is entirely reasonable.  In order to accomplish the above, you'd have to inject magic [bloat?] into dojo.query functionality to determine if the selector was in fact some DOM, and branch internally to return a NodeList from the created single element. This doesn't seem ideal: it changes the meaning of dojo.query. You can already use query this way by passing a node to dojo.query (and dojo.create from the plugd plugin):</p>
<pre class="javascript">&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> n = dojo.<span style="color: #006600;">create</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #66cc66;">&#41;</span>;
dojo.<span style="color: #006600;">query</span><span style="color: #66cc66;">&#40;</span>n<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">appendTo</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;#foo&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #009900; font-style: italic;">// or, because people seem to like single lines:</span>
dojo.<span style="color: #006600;">query</span><span style="color: #66cc66;">&#40;</span>dojo.<span style="color: #006600;">create</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'div'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">appendTo</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;#foo&quot;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;</pre>
<p>Which is, to me, acceptable in most cases. It does not, however, solve the "complex markup" use case described initially. It would be really convenient if I were able to make calls like:</p>
<pre class="javascript">&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> n = dojo.<span style="color: #006600;">create</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;
&lt;div class='bar'&gt;
&lt;p class='baz'&gt;Hi, &lt;span&gt;Dojo&lt;/span&gt;
&lt;/div&gt;
&nbsp;
&quot;</span><span style="color: #66cc66;">&#41;</span>;
dojo.<span style="color: #006600;">place</span><span style="color: #66cc66;">&#40;</span>n, dojo.<span style="color: #006600;">body</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #3366CC;">&quot;first&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>So that's where to 100 bytes came from. I added some simple detection to the dojo.create function to either create "just a node from a tag", or a full structure of DOM nodes (with the caveat that it is only allowed a single top-level dom node, such as the div in the example). It could likely be more robust, and work around some cross-browser compatibility issues but I'm aiming for size here and can generally remember to not create invalid markup this way. (Note, there is already a much more robust Dom setter utility in the <em>dojo.html</em> plugin already in the Dojo Toolkit, this syntax is just an extremely lightweight version of that)</p>
<p>Truthfully though, that should not have taken 100 bytes -- there's more. I added other stuff, and rearranged some others: </p>
<ul>
<li>deprecated { bling:true }. <em>bling</em> is a silly word. the djConfig parameter is now simply <em>conflict</em>. eg: djConfig = { conflict:true } will create $, and $().ready() API's, mapping $ to dojo.query and providing the .fn stub for your own plugins.
</li>
<li>added dojo.toggle(node), matching the API for the $().toggle() method already in place</li>
<li>exposed the .val() function in NodeList - it seemed useful</li>
<li>added a private _stash method developers can use for advanced chaining, and a public .end() function to get out of it.
</li>
</ul>
<p>NodeList._stash and .end are nice little utilities, too: Sometimes after making a selection of domNodes you want to return a subset of those nodes, or children relative to those nodes, etc, and returning a new NodeList from the last call makes the most sense (so you can continue chaining, except different nodes this time). Even more often, you would like to break out of that list, and back into the original list.</p>
<p>For example, the .create() method returns a "stashed NodeList" because it makes the most sense to return the newly created node(s). wrap() uses the same logic, though provides an optional 'out' by not returning a stashed list by default. By using _stash in the plugin, and utilizing end() we can write Dojo code that looks like:</p>
<pre class="javascript">&nbsp;
$<span style="color: #66cc66;">&#40;</span>document<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">ready</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
  $<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;a[href^=http://]&quot;</span><span style="color: #66cc66;">&#41;</span>
      .<span style="color: #006600;">addClass</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;external&quot;</span><span style="color: #66cc66;">&#41;</span>
      .<span style="color: #006600;">wrap</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;div&quot;</span>, <span style="color: #003366; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>
           <span style="color: #009900; font-style: italic;">// now we're &quot;in&quot; the new list</span>
           .<span style="color: #006600;">addClass</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;aroundExternalLink&quot;</span><span style="color: #66cc66;">&#41;</span>
      .<span style="color: #006600;">end</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #009900; font-style: italic;">// we're back to the &lt;a&gt;'s, but they have a</span>
&lt;div&gt; around them now
      .<span style="color: #006600;">onclick</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>e<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span> ... <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>I've also added DOH unit tests for all base.min.js functions, and added some other experimental plugins like a very simple block overlay based on <a href="http://www.sitepen.com/blog/2008/10/17/dojo-building-blocks-of-the-web/">an earlier article</a>, and a cross-browser position:fixed implementation that is incomplete, but has potential. None of the experimental code has very good in-line documentation though, so use with caution (if at all). base.js is <em>mostly</em> documentation, if you feel like reading.  If you are interested in contributing to this mini-project, let me know ... <a href="https://www.ohloh.net/projects/plugd">Ohloh is complaining</a> it only has one developer, and I'd love to see a whole collection of these "unofficial plugins" out in the wild.</p>
]]></content:encoded>
			<wfw:commentRss>http://higginsforpresident.net/2008/11/dojo-the-missing-apis/feed/</wfw:commentRss>
		</item>
		<item>
		<title>dojo.show, .hide, .toggle, and more &#8230;</title>
		<link>http://higginsforpresident.net/2008/10/dojoshow-hide-toggle-and-more/</link>
		<comments>http://higginsforpresident.net/2008/10/dojoshow-hide-toggle-and-more/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 18:20:23 +0000</pubDate>
		<dc:creator>dante hicks</dc:creator>
		
		<category><![CDATA[dojo]]></category>

		<guid isPermaLink="false">http://higginsforpresident.net/?p=24</guid>
		<description><![CDATA[I've been ill this week (with the changing weather and whatnot) and found myself in a near inebriate state from a hefty dose of NyQuil one evening, unable to fall asleep. So, mind wandering, I started contemplating why Dojo doesn't have a .show() or .hide() method, and a .toggle() to switch them. What started as [...]]]></description>
			<content:encoded><![CDATA[<p>I've been ill this week (with the changing weather and whatnot) and found myself in a near inebriate state from a hefty dose of <a href="http://en.wikipedia.org/wiki/NyQuil">NyQuil</a> one evening, unable to fall asleep. So, mind wandering, I started contemplating why Dojo doesn't have a .show() or .hide() method, and a .toggle() to switch them. What started as a simple experiment turned into a rather fun exercise -- exploring several aspects of the <a href="http://dojotoolkit.org">Dojo Toolkit</a> I've not really tinkered with before, and ending up as some weird pseudo-api-compatibility shim. </p>
<p>(You can <a href="http://higginsforpresident.net/js/plugins/base.js.uncompressed.js">peek at the full code now</a>, or <a href="http://higginsforpresident.net/js/plugins/base.js">download the minified version</a> if you are impatient.)</p>
<p>Dojo doesn't assume things about what you want to happen. That's the reason there is no simple show()/hide() pair stubbed off the dojo namespace. It is too easy to do however you intended it to be:</p>
<pre class="javascript">&nbsp;
d.<span style="color: #006600;">query</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;.nodes&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">style</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span> display:<span style="color: #3366CC;">&quot;none&quot;</span> <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// hide</span>
d.<span style="color: #006600;">query</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;.other &gt; .nodes&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">style</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span> display:<span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// show</span>
&nbsp;</pre>
<p>But we all know display:none behaves differently than visibility:hidden in CSS, and sometimes we want to use that property to hide or show our elements:</p>
<pre class="javascript">&nbsp;
d.<span style="color: #006600;">query</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;.nodes&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">style</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span> visibility:<span style="color: #3366CC;">&quot;hidden&quot;</span> <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// hide</span>
d.<span style="color: #006600;">query</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;.other &gt; .nodes&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">style</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span> visibility:<span style="color: #3366CC;">&quot;visible&quot;</span> <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// show</span>
&nbsp;</pre>
<p>Being clever (really, it was the NyQuil), I wrote a show and hide method that allowed you to specify at runtime which behavior you prefered: toggle with the visibility property, or the display property. Going a step further, I added an option to specify if you preferred display:block to be used instead of simply removing the display property. To force the functions to always use the visibility property: </p>
<pre class="html4strict">&nbsp;
<span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script&gt;</span></a></span>var djConfig = { keepLayout:true }<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span>
<span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- script&gt;</span>
</span>var djConfig = { useBlock:true }<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span>/script--<span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;http://ajax.googleapis.com/ajax/libs/dojo/1.2.0/dojo/dojo.xd.js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span>
<span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;http://higginsforpresident.net/js/plugins/base.js&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span>
&nbsp;</pre>
<p>This allowed you to write code like:</p>
<pre class="javascript">&nbsp;
d.<span style="color: #006600;">query</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;#foo &gt; li&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">hide</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">onclick</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>e<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span> e.<span style="color: #006600;">preventDefault</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>Which is a horrible example, but we've only just implemented this function. Following the <a href="http://www.sitepen.com/blog/2008/10/17/dojo-building-blocks-of-the-web/">same pattern outlined in another similar article</a>, we created dojo.show and dojo.hide functions, and wrapped them into into dojo.NodeList -- anything you can do to a single DOM Node you 'ought to be able to do to a list of them with the same API (excluding the node). dojo.query just being the most popular method of obtaining a list of nodes, and a single-element NodeList not being something Dojo teaches fundamentally, though is entirely useful. </p>
<p>Once I had show and hide implemented - it all went downhill. I added speed selectors named "fast", "slow", and "mild" to the show and hide methods, which now fade in/out still returning the NodeList for more chaining. I added a wrap() method which creates an element and places it in the DOM around some other element (and mapped it in to NodeList). Then I added an .append() method to only NodeList, to append some node to the current selected node and an appendTo() which adds each of the list of nodes to some node matched by a passed CSS selector. By reusing Base Dojo APIs, I was able to do all of this with a minimal ammount of code. </p>
<p>For instance, a .hover() method to register events for the normalized onmouseenter/onmouseleave (one of those rare things IE did right) consists of:</p>
<pre class="javascript">&nbsp;
dojo.<span style="color: #006600;">extend</span><span style="color: #66cc66;">&#40;</span>dojo.<span style="color: #006600;">NodeList</span>, <span style="color: #66cc66;">&#123;</span>
    hover: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>over, out<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
         <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">onmouseenter</span><span style="color: #66cc66;">&#40;</span>over<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">onmouseleave</span><span style="color: #66cc66;">&#40;</span>out ? out : over<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>This way we can register a function for each of the events, or only pass one function and delegate between the events. Pretty nifty. Registering one or two functions to a node is something I do quite often.  I realized I'd implemented jQuery's <a href="http://docs.jquery.com/Events/hover#overout">hover method</a> (though with an optional second parameter - allowing the first function to delegate the event) and got to thinking about what other API's could be mapped in this way.</p>
<p>I started goofing around and mapped in aliases from css() to style(), each() to forEach(), bind() to connect(), and making tiny little stub functions like val():</p>
<pre class="javascript">&nbsp;
dojo.<span style="color: #006600;">extend</span><span style="color: #66cc66;">&#40;</span>dojo.<span style="color: #006600;">NodeList</span>, <span style="color: #66cc66;">&#123;</span>
    val: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>set <span style="color: #009900; font-style: italic;">/* optional */</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">attr</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;value&quot;</span>, set<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>,
    css: dojo.<span style="color: #006600;">NodeList</span>.<span style="color: #006600;">prototype</span>.<span style="color: #006600;">style</span>
<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>I wrapped those in a buildExclude tag called "compat" - but in hindsight didn't feel they were worthwhile to keep, but fun none the less. </p>
<p>Being silly (remember the NyQuil ...) I also added speeds for the show and hide methods labeled "granny", "racecar", "snail", "rocket", and "peller" with values from 100 to 7600, and decided while they were fun to have they were not very practical in any real application. Rather than just remove the options, I decided to find a way to simply remove them in production.</p>
<p>The Build exclude stuff is simple. Consider the code:</p>
<pre class="javascript">&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> speedMap = <span style="color: #66cc66;">&#123;</span>
	<span style="color: #3366CC;">&quot;slow&quot;</span>    : <span style="color: #CC0000;">1800</span>,
	<span style="color: #3366CC;">&quot;fast&quot;</span>    : <span style="color: #CC0000;">420</span>,
	<span style="color: #009900; font-style: italic;">//&gt;&gt;excludeStart(&quot;sillyness&quot;, kwArgs.silly == &quot;off&quot;);</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// these are just to be silly:</span>
	<span style="color: #3366CC;">&quot;granny&quot;</span>  : <span style="color: #CC0000;">7600</span>,
	<span style="color: #3366CC;">&quot;racecar&quot;</span> : <span style="color: #CC0000;">200</span>,
	<span style="color: #3366CC;">&quot;snail&quot;</span>   : <span style="color: #CC0000;">1200</span>,
	<span style="color: #3366CC;">&quot;rocket&quot;</span>  : <span style="color: #CC0000;">100</span>,
	<span style="color: #3366CC;">&quot;peller&quot;</span>  : <span style="color: #CC0000;">3500</span>,
&nbsp;
	<span style="color: #009900; font-style: italic;">// this is &quot;public API&quot; bewlow, down here so we can build-exclude</span>
	<span style="color: #009900; font-style: italic;">// the above silly-ness and not worry about the comma breaking</span>
	<span style="color: #009900; font-style: italic;">// after build.</span>
	<span style="color: #009900; font-style: italic;">//&gt;&gt;excludeEnd(&quot;sillyness&quot;);</span>
&nbsp;
	<span style="color: #3366CC;">&quot;mild&quot;</span>    : <span style="color: #CC0000;">900</span>
<span style="color: #66cc66;">&#125;</span>;
&nbsp;</pre>
<p>If we run a build with <code>silly:"off"</code> in the profile, the exclude pair named "sillyness" will be remove from the shrunken/minified output. Setting compat:"off" will disable the aliases, and setting redundant:"off" will disable the .get() function and a .destroy() method, both with little value. We all know how painful a stray comma can be, so take special note to what comes before and after your exclusion blocks. My technique is illustrated above. </p>
<p>Another interesting function I added was .animate() to NodeList. Dojo Base has a powerful function called .animateProperty() and a slightly less configurable wrapper dojo.anim() -- neither of which are included as functions on NodeList out of the box. You must <code>dojo.require("dojo.NodeList-fx")</code> to have the various animation functions mapped in. The reason being: NodeList-fx requires the advanced animation chaining and combining code in <code>fx.js</code>, and not everyone wants or needs all those extended functions. To keep the Base size down, Core provides the additional code. By using chain and combine, we're able to make truly parallel or sequential animations without too much worry about performance issues, but I wanted an animation function I could use with dojo.query without the extra code -- my NodeLists aren't usually hundreds of elements, and that much animation makes me dizzy. Also, the NodeList-fx API's return the _Animation instance created, allowing better control over the progress and state, and I just want the NodeList back so I can keep chainin' ...</p>
<p>I chose .animate() because .anim() and .animateProperty() are provided by dojo.NodeList-fx, and didn't want to conflict:</p>
<pre class="javascript">&nbsp;
dojo.<span style="color: #006600;">extend</span><span style="color: #66cc66;">&#40;</span>dojo.<span style="color: #006600;">NodeList</span>, <span style="color: #66cc66;">&#123;</span>
    animate: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>props, duration, easing, onEnd<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">forEach</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>n, i, a<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> anim = d.<span style="color: #006600;">anim</span><span style="color: #66cc66;">&#40;</span>n, props, duration, easing<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>onEnd &amp;&amp; i == a.<span style="color: #006600;">length</span> - <span style="color: #CC0000;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
			d.<span style="color: #006600;">connect</span><span style="color: #66cc66;">&#40;</span>anim, <span style="color: #3366CC;">&quot;onEnd&quot;</span>, <span style="color: #000066; font-weight: bold;">this</span>, onEnd<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>, <span style="color: #000066; font-weight: bold;">this</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #009900; font-style: italic;">// dojo.NodeList</span>
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>This creates and plays the animations instantly rather than considering the performance implications, so I wouldn't suggest doing this in large pages, but in the simple cases -- it's perfect. With just a few lines of code, we've provided a quick and easy way to animate some css properties without the extra fx and NodeList-fx modules:</p>
<pre class="javascript">&nbsp;
dojo.<span style="color: #006600;">query</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;li&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">animate</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span> height:<span style="color: #CC0000;">40</span> <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">onclick</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>e<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span> <span style="color: #009900; font-style: italic;">/* code */</span> <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>And the last item of the evening was the silliest of all: implement dojo.conflict() based on <a href="http://dojocampus.org/content/2008/03/13/creating-your-own/">Neil's awesome 'bling' article</a>:</p>
<pre class="javascript">&nbsp;
d.<span style="color: #006600;">conflict</span> = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #009900; font-style: italic;">// summary: Create our $</span>
	$ = d.<span style="color: #006600;">mixin</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> d.<span style="color: #006600;">mixin</span><span style="color: #66cc66;">&#40;</span>d.<span style="color: #006600;">query</span>.<span style="color: #006600;">apply</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>, arguments<span style="color: #66cc66;">&#41;</span>, $.<span style="color: #006600;">fn</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span> fn: <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span> <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>d.<span style="color: #006600;">config</span>.<span style="color: #006600;">bling</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span> d.<span style="color: #006600;">conflict</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span>
&nbsp;</pre>
<p>Dojo doesn't (rather, tries very hard not to) conflict with the other Libraries, and doesn't use any global variables other than the namespace(s). The $ function is quite handy to type: Prototype uses it for byId, jQuery for the entire API, Moo, etc, etc. As a Dojo user, you too can participate in the the quest for the holy bling, potentially causing conflicts along the way. This too can be disabled (excluded) by setting <code>conflict:"off"</code> in the build profile. </p>
<p>By calling <code>dojo.conflict()</code> (or setting djConfig = { bling:true }), you are able to take control of the global $ variable and map it to dojo.query() so you can write Dojo code that looks like this:</p>
<pre class="javascript">&nbsp;
$<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;#someId &gt; span&quot;</span><span style="color: #66cc66;">&#41;</span>
    .<span style="color: #006600;">hover</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>e<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
         $<span style="color: #66cc66;">&#40;</span>e.<span style="color: #006600;">target</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#40;</span>e.<span style="color: #006600;">type</span> == <span style="color: #3366CC;">&quot;mouseover&quot;</span> ? <span style="color: #3366CC;">&quot;addClass&quot;</span> : <span style="color: #3366CC;">&quot;removeClass&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;hovered&quot;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>
    .<span style="color: #006600;">style</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span> color:<span style="color: #3366CC;">&quot;red&quot;</span> <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>
    .<span style="color: #006600;">appendTo</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;#otherId div&quot;</span><span style="color: #66cc66;">&#41;</span>
    .<span style="color: #006600;">wrap</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;a&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">attr</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;href&quot;</span>,<span style="color: #3366CC;">&quot;http://dojotoolkit.org&quot;</span><span style="color: #66cc66;">&#41;</span>
    .<span style="color: #006600;">onclick</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>e<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
         <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>!<span style="color: #000066;">confirm</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;Really leave?&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
             e.<span style="color: #006600;">preventDefault</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
         <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>I've put the <a href="http://higginsforpresident.net/js/plugins/base.js.uncompressed.js">full code</a> as well as a <a href="http://higginsforpresident.net/js/plugins/base.js">minified version</a> you can drop into any page that has Dojo on it. Feel free to use it freely, the license is identical to Dojo's (AFL/newBSD) and is available to them under the terms of my <a href="http://dojotoolkit.org/cla">CLA</a> so they are welcome to use it, too. </p>
<p>I've also put up the <a href="http://higginsforpresident.net/js/plugins/resources/pluginProfile.js">sample pluginProfile.js code</a>, should you be interested in building this too, into your dojo.js directly, or experimenting with the buildExclude syntax. The entire API adds 958 bytes of code (after gzip. With comments it is roughly 13k), which is slightly more than I had hoped for (before I got carried away with new functions it was a staggering 581 bytes). With it you are provided the some handy APIs:</p>
<ul>
<li>dojo.show(node, speed)</li>
<li>dojo.hide(node, speed)</li>
<li>dojo.wrap(node, nodeType)</li>
<li>dojo.query(..).show(speed).hide(speed).wrap(nodeType)</li>
<li>dojo.conflict(); $(...).show(speed)</li>
<li>dojo.query(..).append(selector)</li>
<li>dojo.query(..).appendTo(selector)</li>
<li>dojo.query(..).animate({ /* props */ })</li>
<li>dojo.query(..).hover(function(e){}, function(e){})</li>
</ul>
<p>The whole package can also be downloaded as a tarball, including a simple test. This is the "initial version", 0.1: <a href="http://higginsforpresident.net/js/plugins-0.1.tar.gz">http://higginsforpresident.net/js/plugins-0.1.tar.gz</a></p>
<p>Writing Dojo "plugins" is fun. Any other simple functions you can think of? What convenient stuff would you like to see stubbed off of dojo.query/dojo?</p>
]]></content:encoded>
			<wfw:commentRss>http://higginsforpresident.net/2008/10/dojoshow-hide-toggle-and-more/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A change of face</title>
		<link>http://higginsforpresident.net/2008/08/a-change-of-face/</link>
		<comments>http://higginsforpresident.net/2008/08/a-change-of-face/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 22:20:12 +0000</pubDate>
		<dc:creator>dante hicks</dc:creator>
		
		<category><![CDATA[dojo]]></category>

		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://higginsforpresident.net/?p=19</guid>
		<description><![CDATA[Last Wednesday at our weekly team meeting, Alex Russell announced his resignation as long-time Project Lead for the Dojo Toolkit, the open-source project I've been contributing to for the past two years. I still may be in partial shock (and partial euphoria) about the resignation, but not near much as finding out the nominee: me! [...]]]></description>
			<content:encoded><![CDATA[<p>Last Wednesday at our <a href="http://dojotoolkit.org/book/developers-notebook/weekly-full-team-meetings/dojo-project-meeting-2008-08-06">weekly team meeting</a>, Alex Russell announced his resignation as long-time Project Lead for the Dojo Toolkit, the open-source project I've been contributing to for the past two years. I still may be in partial shock (and partial euphoria) about the resignation, but not near much as <a href="http://turtle.dojotoolkit.org/pipermail/dojo-contributors/2008-August/009571.html">finding out the nominee</a>: <em>me</em>! </p>
<p>Today, the voting was closed, and I have <a href="http://turtle.dojotoolkit.org/pipermail/dojo-contributors/2008-August/009596.html">officailly been named</a> the new [and improved?] Dojo Project Lead by a unanimous 27-to-zero vote of my peers, the <a href="http://turtle.dojotoolkit.org/~dante/skewDemo/demo.html">Dojo core developers</a>. Contained within those ranks of committers are some of the most talented, friendly, and innovative developers I've ever had the pleasure of working with, and am humbled by the outcome.  I'd like to thank everyone involved: Your faith in my abilities, and our common vision and dedication are going to ensure the Dojo Toolkit will remain a major presence within the Open Source, OpenWeb, and Ajax communities for a very long time. Our collective commitment to excellence and never-ending desire to push the limits of browser capabilities will continue to thrive, even as the landscape changes beneath us. </p>
<p>As much as I <em>love</em> talking about myself, I'm going to keep this brief. Alex addressed some highlighted questions in <a href="http://alex.dojotoolkit.org/?p=713">his initial announcement</a>, and I'd like to follow up with a small [read: single item] Q&A of my own:</p>
<p><strong>Q: What does this mean?</strong><br />
Not too terribly much. Dojo is a very mature project: The product of countless man hours, real-world testing, use, mistakes, changes, and growth. We've established who we are, and what we intend to do, and my goal is the keep us all on that same track -- working together to create and maintain the best open source set of tools for web developers. The Toolkit is, in truth, run by smaller groups of committers and contributors -- each applying their own expertise to the components they own or otherwise maintain, myself included. </p>
<p>It doesn't, however, mean there won't be change!  We change every day as it is: seldom does a day pass that a bug isn't fixed, filed, or commented upon, or a new function or component becomes a reality.  It is too early for me to have formulated any serious plans or opinions on the <em>future of Dojo</em>, but It will likely mimic that which I am already a strong proponent of: ongoing open innovation, providing great tools, <a href="http://www.goodold.se/blog/tech/2006/09/13/rambling-on-the-dojo-interest-list/">enabling the community</a>, embracing the community support and contributions, all while never wavering from the overall goal: <strong>dojo.greatness();</strong></p>
<p>I'm looking forward to this experience, and to working with all of the exceptional talent the Ajax community has to offer. I'm <em>usually</em> available as <code>phiggins</code> on irc.freenode.net (#dojo, among others), and you may already know me as <code>dante</code> in the Dojo Forums and Trac, so drop by -- I'm happy to answer any questions or concerns.<br />
I'll have several more announcements and whatnot coming as time progresses, so be on the look ...</p>
<p>Thanks again to everyone for their support. I am confident the power and direction of Dojo will only continue to improve, and it would never have gotten this far without each and every one of you.  </p>
]]></content:encoded>
			<wfw:commentRss>http://higginsforpresident.net/2008/08/a-change-of-face/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dojo Degradability</title>
		<link>http://higginsforpresident.net/2008/08/dojo-degradability/</link>
		<comments>http://higginsforpresident.net/2008/08/dojo-degradability/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 13:21:41 +0000</pubDate>
		<dc:creator>dante hicks</dc:creator>
		
		<category><![CDATA[dojo]]></category>

		<category><![CDATA[unobtrusive]]></category>

		<guid isPermaLink="false">http://higginsforpresident.net/?p=18</guid>
		<description><![CDATA[As a quick example of unobtrusive and degradable Dojo, I'm going to add couple of lines of JavaScript to this blog post, and convert the existing unordered list labeled "Blog Roll" into a new widget I created, which will be released with Dojo 1.2. Here goes:

dojo.addOnLoad(function(){
  dojo.require("dojox.widget.Roller");
  dojo.addOnLoad(function(){
    var n [...]]]></description>
			<content:encoded><![CDATA[<p>As a quick example of unobtrusive and degradable Dojo, I'm going to add couple of lines of JavaScript to this blog post, and convert the existing unordered list labeled "Blog Roll" into a new widget I created, which will be released with Dojo 1.2. Here goes:</p>
<p><script type="text/javascript">
dojo.addOnLoad(function(){
  dojo.require("dojox.widget.Roller");
  dojo.addOnLoad(function(){
    var n = dojo.query("#sidebar #linkcat-2 > ul").instantiate(dojox.widget.Roller, { delay:3200 });
  });
});
</script></p>
<pre class="javascript">&nbsp;
dojo.<span style="color: #006600;">addOnLoad</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
  dojo.<span style="color: #006600;">require</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;dojox.widget.Roller&quot;</span><span style="color: #66cc66;">&#41;</span>;
  dojo.<span style="color: #006600;">addOnLoad</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
    dojo.<span style="color: #006600;">query</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;#sidebar #linkcat-2 &gt; ul&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">instantiate</span><span style="color: #66cc66;">&#40;</span>dojox.<span style="color: #006600;">widget</span>.<span style="color: #006600;">Roller</span>, <span style="color: #66cc66;">&#123;</span> delay:<span style="color: #CC0000;">3200</span> <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>This "embedded addOnLoad" trick is really fun. After the initial/body onLoad, I'm dynamically pulling in the Roller code, and all of its dependencies. This could be avoided if I had included the Roller class in a custom build, but I'm more concerned with the content rendering initially than I am with limiting the number of XHR requests (we're doing it after onLoad, so no blocking is taking place).</p>
<p>Without JavaScript enabled, it should appear as a simple unordered-list. At the time of this writing, there are only three links in my blog roll (I have friends, I promise), but this ensures the list will only ever take up a single line of screen real estate, regardless of the list length. </p>
<p>The code is degradable, reusable, and completely valid XHTML. What more could you ask for? If validation doesn't concern you, you can simply add a <code>dojoType="dojox.widget.Roller"</code> to an existing unordered list, and let the automatic parsing take over for you, creating even less work. There is a solution in Dojo for everyone's needs. </p>
<p>The test file for the Roller, and RollerSlide can be viewed in <a href="http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/widget/tests/test_Roller.html ">the nightly builds</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://higginsforpresident.net/2008/08/dojo-degradability/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Updates from Portland</title>
		<link>http://higginsforpresident.net/2008/07/updates-from-portland/</link>
		<comments>http://higginsforpresident.net/2008/07/updates-from-portland/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 06:11:39 +0000</pubDate>
		<dc:creator>dante</dc:creator>
		
		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://higginsforpresident.net/?p=17</guid>
		<description><![CDATA[So it's a little late to be sending out updates of my stay in Portland, OR -- this is more or a 'reflections' of Portland blog writing -- but all valid none the less. It has been an exceptional adventure. 
I landed in Portland mid-afternoon last Sunday to a beautiful sunny day, typical of a [...]]]></description>
			<content:encoded><![CDATA[<p>So it's a little late to be sending out updates of my stay in Portland, OR -- this is more or a 'reflections' of Portland blog writing -- but all valid none the less. It has been an exceptional adventure. </p>
<p>I landed in Portland mid-afternoon last Sunday to a beautiful sunny day, typical of a Portland summer. The weather stayed consistently pleasant for the duration, which is not atypical, but entirely unexpected (and welcome). I love PDX in the summer. I must remind myself what the winters are like, lest I whimsically decide to rent an apartment and move back ...</p>
<p>I attended <a href="http://en.oreilly.com/oscon2008/public/content/home">OSCON</a> last week. I didn't spend much time in actual talks, but had a chance to sit and chat with a number of people I both had and hadn't met prior. Working for a virtual company, it is easy to detach yourself from face to face communications. I can go whole days without actually having to say a spoken word, though I've spent the entirety of it communicating with people from all regions of the world. I got a chance to hang out with some semi-familiar-faces: <a href="http://dylan.io">Dylan Schiemann</a> (my boss, and CEO SitePen, Inc) ended up on the west side, <a href="http://alex.dojotoolkit.org">Alex Russell</a> of Dojo fame, whose company is always welcome (the man has some weird special insight into them interwebs, and it is certainly entertaining to hear him rant), Matthew Russel, author of a relatively new [awesome] Dojo book: "<a href="http://oreilly.com/catalog/9780596516482/">The Difinitive Guide</a>", and several other Dojo-hackers and/or SitePen folk: <a href="http://blog.xdraw.org/">Gavin Dougtie</a> (Google), Jason Cline (SitePen), <a href="http://www.cb1inc.com/">Chris Barber</a> (CB1, Inc), <a href="http://freelock.com">John Locke</a> (Freelock) ... </p>
<p>... And more importantly, the meeting of great new folks: I had the pleasure of briefly meeting an energetic and charming Leslie Hawthorn of <a href="http://code.google.com/soc/2008/">Google Summer-of-Code</a> fame (I'm mentoring this year), a vocal and hilarious Zend Framework user Jason E, <a href="http://simonwillison.net/">Simon Willison</a>, a seemingly all-around great guy, the guys behind <a href="http://www.orbited.org/">Orbited</a>: Michael Carter, Jacob Rus, and Adrian Weisberg (who got an ad-hoc/realtime port of some trivial jQuery code into some Dojo Base functions, which I pulled off even after a long evening of dojo.beers and dinners ... which reminds me: I'd like to finish my port and replace the rest of the code if you'd like), as well as a number of random Dojo-enthusiasts from [unnamed] places I was surprised/unaware was using Dojo in the first place. The DDD:4.5-slash-dojo.dinner() was a great success: Random seemingly star-trek themed bar on East Burnisde provided a wonderful atmosphere to let loose and talk shop (among other things) with a bunch of faces old and new (over buffalo burgers no less). I've missed the beer in Portland.</p>
<p>It really gives you a jolt of pride when someone notices you wearing a Dojo t-shirt and takes the time to come over to talk about it, though it depresses me to see some of the really great applications written using Dojo, only to find out they are stashed away behind corporate firewalls, probably never to be seen or even mentioned publicly. It makes marketing more challenging, but at least <em>I</em> know, and am proud to continue on contributing to this phenomenal <em><a href="http://alex.dojotoolkit.org/?p=668">truly</a></em> Open Source project. </p>
<p>The most interesting talk I attended was <a href="http://stevesouders.com/">Steve Souders</a>' talk about optimizing pages ... it was fun to see at least half of the techniques suggested and investigated are already available in Dojo, and the rest seemed like they could be automated with our build system in one way or another. It seems like a lot of people know nothing about Dojo's tried-and-true package system and the transparency it provides between keeping code modular and optimization, development versus deployment, obfuscation versus human-readble code. All of the things non-Dojo-users do to speed their pages up are included out-of-the-box with Dojo: ShrinkSafe to minimize bytes on the wire by shrinking (safely) variables, removing comments and excessive whitespace, automatic concatenation of "layers" of modules in a very clean and safe manner ... We can even concat "modular CSS files", stripping comments, inline-ing <em>@import</em> calls and so on, anything to limit the overhead of initial page loading. I'm secretly amazed. It gets even better in 1.2, coming in just a bit: stubs loading (another of Steve's tips), <a href="http://www.sitepen.com/blog/2008/06/23/replacing-the-flash-flickr-badge-with-dojo/">post-onLoad</a> safe module loading might just be my new favorite thing since sliced bread.</p>
<p>I attended a django/python meetup, spending a good portion of the evening describing existing Dojo functionality, mostly when people made comments like "wouldn't it be cool is [my framework] did this?" -- "Oh, right Dojo has done that for a while now" ... I didn't hear about <a href="">dojango</a> until the next day, which is unfortunate, it would have been a perfect topic of conversation. I met <a href="http://ejohn.org">John Resig</a> briefly, though didn't talk as much shop as I'd have liked ...</p>
<p>For those of you wondering: No, I never found a shoe store that sells Birkenstocks, though officially retired the old pair after a seven-hour sea-kayak adventure. Don't kayak barefoot, at least the 17-foot sea-kayak variety. Lesson learned. I nearly destroyed my brother-in-law's brand new boat on it's maiden voyage on a river never intended to be run in a seventeen foot fiberglass tube. There was a reason the Mulhallah river wasn't in the "Flatwater guide of Oregon": The water isn't flat. Sea kayaks simply don't have the mobility a "normal" kayak has, and I'll be damned if I didn't run through one of the rapids only to get sucked into an eddy and bunched up against a sunken tree. I was fine for the most part, simply unable to fight the force of the rapids slowly rolling me (boat included) on end, and eventually over. I <em>almost</em> freed myself without damage or incident, but gave up when I heard the distinct noise of cracking fiberglass. Remember, the boat is seventeen feet long, and at the time of me removing the skirt, probably three-quarters submersed in the running water wedged against a tree. I was able to climb out (all the while holding on to said tree with one hand), roll the boat around and swim it downstream, handoff to my [extremely shaken] sister, swim further downstream and collect my own paddle and Nalgene bottle. Not only did I not lose any gear, I was still wearing my hat. Our peaceful, "zen-like" kayak adventure had instantly become exciting, despite the exceptionally painful bruises on both shins, and that ominous feeling of of sinking boat, which actually turned out to be true: I was taking on water until we beached for lunch and surveyed the damage: a small crack, large enough to seep water, and a six-inch scrape through the fiberglass on the underside. Bet you are glad you got that kevlar upgrade, huh, Bill? (Sorry about the boat. At least it's broken in now!). Tenacious tape is some amazing shit. </p>
<p>For the record, sea kayaking isn't my thing. The rapids part was fun, but atypical for this sport. The part the was supposed to be enjoyable was drowned by passing motorboats on the Willamette and an exceptionally hot sun. I, for the first time ever, have a very bad sunburn in the shape of a very nice Type III PFD. I'd rather do whitewater and/or "regular" kayaking. It didn't take long for me to answer my sister when she suggested we do this in Alaska ... Cold and Wet are my two least favorite sensations, especially when combined. </p>
<p>It was great to see all the old <a href="http://quivah.com">QuiVaH</a> folks again (who are seemingly no longer doing shows together). I think every last one of them is married now, most to people I knew, some to people I didn't, and Tae is still out being the talent-asian. RJ is still RJ, Q is still Q, just as fun and funny but with a better job, Haven is doing well for himself, and anxious to jump into some Dojo, which is great news in itself, Tae and Ran are living together near Goose Hollow (I actually ran into Ran [no pun intended] at the Django meet-up: he was dealing poker downstairs the whole evening), and they all really made my trip to PDX "complete" ... </p>
<p>Now I get all day tomorrow to decide if I want to miss my Tuesday-morning-flight and go apartment hunting ... decisions, decisions. Anyone up for dinner? Last chance to eat in this treasure-trove of excellent food offerings ... </p>
]]></content:encoded>
			<wfw:commentRss>http://higginsforpresident.net/2008/07/updates-from-portland/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I want a monopoly.</title>
		<link>http://higginsforpresident.net/2008/06/i-want-a-monopoly/</link>
		<comments>http://higginsforpresident.net/2008/06/i-want-a-monopoly/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 12:45:16 +0000</pubDate>
		<dc:creator>dante hicks</dc:creator>
		
		<category><![CDATA[Rant]]></category>

		<category><![CDATA[bittorrent]]></category>

		<category><![CDATA[comcast]]></category>

		<category><![CDATA[FCC]]></category>

		<guid isPermaLink="false">http://higginsforpresident.net/?p=11</guid>
		<description><![CDATA[I really enjoy The Week Magazine. Every Monday I'm provided with an amusing overview of world events collated from often opposing editorials of the various news outlets worldwide. A filtered "best of the best" -- or -- to quote the byline: "All you need to know about everything that matters" ... It is an easy [...]]]></description>
			<content:encoded><![CDATA[<p>I really enjoy <a href="http://www.theweekdaily.com/">The Week</a> Magazine. Every Monday I'm provided with an amusing overview of world events collated from often opposing editorials of the various news outlets worldwide. A filtered "best of the best" -- or -- to quote the byline: "All you need to know about everything that matters" ... It is an easy read, and is not blatantly skewed left or right. It usually gets 'my blood boiling' to see the editorials and articles nationwide ... The "Only in America" notes are especially embarassing.</p>
<p>My most recent fit of 'outrage' prompted by the Week was their coverage of the FCC Hearing in Boston. Comcast, with it's <a href="http://www.boston.com/bostonglobe/editorial_opinion/oped/articles/2008/02/23/beyond_net_neutrality/">infinite collective intellect</a>, paid "<a href="http://www.riehlworldview.com/carnivorous_conservative/2008/02/comcast-plants.html">line standers</a>" to hold places in line prior to the meeting happening.  This was done to "allow Comcast employees interested in Net Neutrality" that were unable to get time off work to attend the meeting ... But it turns out the line holders were merely a mini "sleeper cell", most of whom had no interest in the hearing anyway -- riveting testimony -- to the <a href="http://www.savetheinternet.com/blog/2008/02/25/comcast-blocking-first-the-internet-now-the-public/">point of boredom</a>, and eventually slumber.</p>
<p>This is my proverbial straw.  I call Comcast a monopoly. In my area, there is one cable service provider and one telephone service provider (who handles DSL and phone service).  I have two choices: internet, or not. But I work from home in the tech industry, so going without internet isn't really a choice.  I don't watch television, but am unable to have high-speed internet without "basic" digital cable -- I pay an additional $45 monthly with no choice in the matter, for a service I do not use.  The same applies to Embarq, ultimately. In order to have DSL service, I would need local phone service -- something I am wholly uninterested (being one of the many who communicate exclusively via cellular) in, the minimum being somewhere around $35 monthly.</p>
<p>I'm okay with the money. I have come to terms with paying $90 monthly for internet connectivity (advertised as "always on internet") with the side effect of having moving pictures on the various televisions in my house. Unfortunately, the service is far from "always on" ... My most recent experience involved the service running for 5 minutes, and stopping for 2, then restarting. Just long enough for anything running relying on a connection to drop.</p>
<p>It happened for two days in a row, at which point I broke down and called support, asking for help. They believed me at the time, they were unable to ping my modem. They agreed to send a service tech "this afternoon". I called at 7am. Issues persist, though seemingly fixed at some point during the day. They called me asking if my service was okay, and I responded "yes, for now, but I still need a tech to come out -- there is something wrong with the signal or my modem, so please have the tech bring a spare and tester" ... The problems reappeared intermittently throughout the rest of the day. Finally, at 6pm, as I am about to leave for dinner, they call again verifying I'd like a tech to visit. "yes" ... The tech shows up at the door with no spare modem and no testing equipment whatsoever. When asked, the response was akin to "yah - we don't believe you are having trouble, and it wasn't worth carrying it in" ... I was immediately irritated.</p>
<p>Long story short, the tech ended up having to make two trips to the truck, which amused me because the extra trips up three flights of steps could have been avoided had they just brought the damn tester initially. I ended up with a new modem and an extensive lesson on signal strength tolerances.  I was right, the signal was bad. My whole day wasted due to shotty service and dis-believing techs. What ever happened to "the customer is always right"?  Just bring the bloody tester if I've taken the time to call, sit on hold listening to an annoying lady repeat new channel lineups, wondering all the while what a "friendful customer" is.  (She says: "For friendful customers, our lineup has changed ... " ) ... This particular voice is like fingernails on a chalkboard, especially when you realize you've been on hold for 20 minutes and know "SportsSouthwest has been added on channel 23" because of the ten times she'd mentioned it prior.</p>
<p>Overall: I loathe having to call Comcast for anything. I am tolerant of short-lived outages (usually no more than 30 minutes at a time).  One month, the service was out so often, I wrote a script to run on a local machine pinging various hosts on an interval to track "to the minute" how much service I had received. Thankfully, after _serveral_ calls and various requests to speak to supervisors, I convinced them to credit my account for a whole month of service, as my logs indicated I was working with around 25% uptime.  Unfortunately, the credit never showed up on a bill, and my blatant refusal to actually pay them caused every subsequent bill to show up as "past due", at which point I would call them, verify the credit, and make sure I wasn't going to get a service shutoff.  It took four months for the credit to go through and return me to a normal billing cycle.</p>
<p>Then we get into the traffic shaping going on, and all hell breaks loose. I get exceptional upspeeds for the first 10 seconds of any transfer.  I can see progress go from 400k/s and immediately drop to 30k after 10 seconds. It seems <em>any</em> activity on BitTorrent ports causes a vast decrease in overall throughput, both up and down.  My router showing 10 open connections, nothing excessive, and <a href="http://news.cnet.com/8301-13578_3-9800629-38.html">no explanation for why my connectivity is shot</a>. Why would you even tolerate this kind of stuff, as a consumer?  I pay for my service, and have done so on this same account for the past 5 years.</p>
<p>The newest, most fun experience: They don't believe I am me.  I am now unable to modify, upgrade, downgrade, or cancel my service.  For the past five years, It has not been an issue. Magically, a few days ago, I was asked to verify the last four digits of my social security number ... A question I don't usually get wrong ... unfortunately, somehow, someway, the SSN on file at Comcast is <em>no longer mine</em>, and because of which, I am unable to even ask about the account.  They will accept payments from anyone, but require the SSN as an identifier (which if I'm not mistaken is illegal, but out of the scope of this discussion, there is probably some stipulation going on with account numbers, etc).</p>
<p>I decided not to act on it. It would be a waste of my time to go jump through the hoops required to prove my identity to them (which involves a trip to the office with an old bill, ID, and Social Security card in hand, and likely lots of waiting around).  It simply isn't worth it to me. I've not modified the account in any meaningful way in years.  When I finally do decide to dump Comcast (I've seriously considered getting a t1 or the likes directly, they are getting very cheap), I will have to have it shutoff for non-payment, which isn't an issue to me because <em>it's not my social security number</em> they will be sending the non-payment notification to.  I told them it was their issue, and they should restore their records to the SSN that actually signed up the account. They claim there is no log of any change, but their logs "only go back so far" ...  The have zero legal recourse should I, the individual paying the bill for the last 5 years, decide not to pay anymore.  They can call me on the phone number listed in the account, but will be able to verify my Social Security Number. The <em>worst</em> they can do is turn off my service, which isn't really "always on" to being with.</p>
<p>If I had a choice, I would not use Comcast at all. Please support Net Neutrality -- The last thing I want is for my monopoly the dictate which points on the internet get priority throughput.</p>
]]></content:encoded>
			<wfw:commentRss>http://higginsforpresident.net/2008/06/i-want-a-monopoly/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google Analytics after onLoad</title>
		<link>http://higginsforpresident.net/2008/06/google-analytics-after-onload/</link>
		<comments>http://higginsforpresident.net/2008/06/google-analytics-after-onload/#comments</comments>
		<pubDate>Sun, 01 Jun 2008 18:31:27 +0000</pubDate>
		<dc:creator>dante hicks</dc:creator>
		
		<category><![CDATA[dojo]]></category>

		<category><![CDATA[ajax]]></category>

		<category><![CDATA[analytics]]></category>

		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://higginsforpresident.net/?p=10</guid>
		<description><![CDATA[update: This was written during Dojo 1.1, and is outdated. The current documentation can be found at http://docs.dojocampus.org/dojox/analytics/Urchin, as some things have changed regarding parameters and setup since this blog post. 
You've all seen it, especially in the Ajax world. The page is stalled, waiting to render, the status bar woefully proclaims "waiting for google-analytics.com [...]]]></description>
			<content:encoded><![CDATA[<p><strong>update:</strong> This was written during Dojo 1.1, and is outdated. The current documentation can be found at <a href="http://docs.dojocampus.org/dojox/analytics/Urchin">http://docs.dojocampus.org/dojox/analytics/Urchin</a>, as some things have changed regarding parameters and setup since this blog post. </p>
<p>You've all seen it, especially in the Ajax world. The page is stalled, waiting to render, the status bar woefully proclaims "waiting for google-analytics.com ... " The culprit being the ever popular <a href="http://google.com/analytics">urchin</a> tracker, and the [synchronous] script tags placed<br />
at the bottom of your webpage:</p>
<pre class="html4strict">&nbsp;
<span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    var gaJsHost = ((&quot;https:&quot; == document.location.protocol) ? &quot;https://ssl.&quot; : &quot;http://www.&quot;);
    document.write(unescape(&quot;%3Cscript src='&quot; + gaJsHost + &quot;google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E&quot;));
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span>
<span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    var pageTracker = _gat._getTracker(&quot;UA-123456-7&quot;);
    pageTracker._initData();
    pageTracker._trackPageview();
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span>
&nbsp;</pre>
<p>This is usually before the body tag is closed, which causes [at least] Dojo's addOnLoad() function to wait until <em>after</em> ga.js has been loaded, and executed.  I notice it most on the <a href="http://sitepen.com/labs/guides/?guide=DojoQuickStart">SitePen Dojo QuickStart</a> guide. The whole guide is sent as valid HTML and CSS, then enhanced to break major sections into a custom tabbed view, with simple navigation. Unfortunately, all the code to do that is run from within an addOnLoad function, and my poor pitiful ethernets here in Tennessee make ga.js take upwards of five seconds to load. Long story short, sometimes I'm presented with a nasty jolt of rendering as the navigation is added, and the unselected chapters go hidden. </p>
<p>I decided it was a safe bet I could just append a script tag to my head element, and run that onLoad, allowing the rest of the code to execute as soon as the Dom was ready, regardless of Google being ready. This should work with any page that uses Dojo >= 0.9 ... I'm going to test it on this site for a while before considering making it another utility of the Toolkit. It's working so far, let's see if it picks up my traffic (the Analytics dashboard said it was getting data, but I just started it today, so I won't know until tomorrow).</p>
<p>This is just plain JavaScript, with some fancy scope magic for convenience. It uses Dojo because I do.</p>
<pre class="javascript">&nbsp;
dojo.<span style="color: #006600;">provide</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;dojox.analytics.ga&quot;</span><span style="color: #66cc66;">&#41;</span>;
dojo.<span style="color: #006600;">mixin</span><span style="color: #66cc66;">&#40;</span>dojox.<span style="color: #006600;">analytics</span>.<span style="color: #006600;">ga</span>, <span style="color: #66cc66;">&#123;</span>
	<span style="color: #009900; font-style: italic;">// _acct: String</span>
	<span style="color: #009900; font-style: italic;">//		your GA urchin tracker account numbers.</span>
	_acct: dojo.<span style="color: #006600;">config</span>.<span style="color: #006600;">urchin</span> || <span style="color: #3366CC;">&quot;&quot;</span>,
&nbsp;
	<span style="color: #009900; font-style: italic;">// _loadInterval: Integer</span>
	<span style="color: #009900; font-style: italic;">// 		time in ms to wait between checking again</span>
	_loadInterval: <span style="color: #CC0000;">420</span>,
&nbsp;
	_loadGA: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #009900; font-style: italic;">// summary: load the ga.js file and begin initialization process</span>
		<span style="color: #003366; font-weight: bold;">var</span> gaHost = <span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;https:&quot;</span> == document.<span style="color: #006600;">location</span>.<span style="color: #006600;">protocol</span><span style="color: #66cc66;">&#41;</span> ? <span style="color: #3366CC;">&quot;https://ssl.&quot;</span> : <span style="color: #3366CC;">&quot;http://www.&quot;</span>;
		<span style="color: #003366; font-weight: bold;">var</span> s = dojo.<span style="color: #006600;">doc</span>.<span style="color: #006600;">createElement</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'script'</span><span style="color: #66cc66;">&#41;</span>;
		s.<span style="color: #006600;">src</span> = gaHost + <span style="color: #3366CC;">&quot;google-analytics.com/ga.js&quot;</span>;
		dojo.<span style="color: #006600;">doc</span>.<span style="color: #006600;">getElementsByTagName</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;head&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">appendChild</span><span style="color: #66cc66;">&#40;</span>s<span style="color: #66cc66;">&#41;</span>;
		setTimeout<span style="color: #66cc66;">&#40;</span>dojo.<span style="color: #006600;">hitch</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>, <span style="color: #3366CC;">&quot;_checkGA&quot;</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000066; font-weight: bold;">this</span>._loadInterval<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>,
&nbsp;
	_checkGA: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #009900; font-style: italic;">// summary: sniff the global _gat variable Google defines.</span>
		<span style="color: #009900; font-style: italic;">// 		if it exists, run _gotGA, otherwise, do another interval</span>
		setTimeout<span style="color: #66cc66;">&#40;</span>dojo.<span style="color: #006600;">hitch</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>, window<span style="color: #66cc66;">&#91;</span><span style="color: #3366CC;">'_gat'</span><span style="color: #66cc66;">&#93;</span> ? <span style="color: #3366CC;">&quot;_gotGA&quot;</span> : <span style="color: #3366CC;">&quot;_checkGA&quot;</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000066; font-weight: bold;">this</span>._loadInterval<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>,
&nbsp;
	_gotGA: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #009900; font-style: italic;">// summary: initialize the tracker, we've got ga.js loaded</span>
		<span style="color: #003366; font-weight: bold;">var</span> ga = <span style="color: #000066; font-weight: bold;">this</span>._tracker = dojo.<span style="color: #006600;">hitch</span><span style="color: #66cc66;">&#40;</span>_gat, <span style="color: #3366CC;">&quot;_getTracker&quot;</span>, <span style="color: #000066; font-weight: bold;">this</span>._acct<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		ga._initData<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		ga._trackPageview<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #006600;">GAonLoad</span>.<span style="color: #006600;">apply</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>, arguments<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>,
&nbsp;
	GAonLoad: <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #009900; font-style: italic;">// stub function to fire when urchin is complete</span>
		<span style="color: #009900; font-style: italic;">// you also have access in this function to this._tracker, which is the</span>
		<span style="color: #009900; font-style: italic;">// root tracker instance you called _initData() on</span>
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>; 
&nbsp;
<span style="color: #009900; font-style: italic;">// start it all up after body is ready:</span>
dojo.<span style="color: #006600;">addOnLoad</span><span style="color: #66cc66;">&#40;</span>dojox.<span style="color: #006600;">analytics</span>.<span style="color: #006600;">ga</span>,<span style="color: #3366CC;">&quot;_loadGA&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>I've hard-coded my UA-# into the code, but you would be able to define it as part of your djConfig variable, either before dojo.js is loaded:</p>
<pre class="javascript">&nbsp;
&lt;script type=<span style="color: #3366CC;">&quot;text/javascript&quot;</span>&gt;
    <span style="color: #003366; font-weight: bold;">var</span> djConfig = <span style="color: #66cc66;">&#123;</span> parseOnLoad:<span style="color: #003366; font-weight: bold;">true</span>, urchin:<span style="color: #3366CC;">&quot;UA-123456-7&quot;</span> <span style="color: #66cc66;">&#125;</span>;
&lt;/script&gt;
&nbsp;</pre>
<p>or directly on the script tag:</p>
<pre class="javascript">&nbsp;
&lt;script src=<span style="color: #3366CC;">&quot;dojo/dojo.js&quot;</span> djConfig=<span style="color: #3366CC;">&quot;urchin: UA-123456-7, parseOnLoad:true&quot;</span>&gt;&lt;/script&gt;
&nbsp;</pre>
<p>you can see the file is namespaced dojox.analytics.ga in the example. If the file were actually located there, you would be able to simply dojo.require("dojox.analytics.ga"); to include analytics tracking on any Dojo-enabled page. </p>
<p><strong>update:</strong> It works! (or at least seems to.) All of yesterday's traffic apparently was tracked, and showed up in my analytics dashboard this morning.</p>
<p><strong>update 2:</strong> This is now in trunk, as of revision [<a href="http://trac.dojotoolkit.org/changeset/14006">14006</a>], and is known to work with 1.1 without issue. 1.0 is untested. It will be released with 1.2.</p>
]]></content:encoded>
			<wfw:commentRss>http://higginsforpresident.net/2008/06/google-analytics-after-onload/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ajax just got easier</title>
		<link>http://higginsforpresident.net/2008/05/ajax-just-got-easier/</link>
		<comments>http://higginsforpresident.net/2008/05/ajax-just-got-easier/#comments</comments>
		<pubDate>Wed, 21 May 2008 15:04:58 +0000</pubDate>
		<dc:creator>dante hicks</dc:creator>
		
		<category><![CDATA[news]]></category>

		<category><![CDATA[dojo]]></category>

		<category><![CDATA[Framework]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://higginsforpresident.net/?p=7</guid>
		<description><![CDATA[This morning, Andi Gutman broke some very exiting news: The Zend Framework will be integrating Dojo 1.x! I am glad to be directly involved in the effort. It's a big win for both communities. Zend Framework users will have built-in Ajax support courtesy the Dojo Toolkit -- the easiest, most feature complete, liberally licensed JavaScript [...]]]></description>
			<content:encoded><![CDATA[<p>This morning, Andi Gutman <a href="http://andigutmans.blogspot.com/2008/05/dojo-and-zend-framework-partnership.html">broke some very exiting news</a>: The Zend Framework will be integrating Dojo 1.x! I am glad to be directly involved in the effort. It's a big win for both communities. Zend Framework users will have built-in Ajax support courtesy <a href="http://dojotoolkit.org">the Dojo Toolkit</a> -- the easiest, most feature complete, liberally licensed JavaScript library available today. This integration is a perfect example of how a server-side technology and client-side goodness can work together to provide the best possible experience for developers maintaining projects, and the end users consuming them.</p>
]]></content:encoded>
			<wfw:commentRss>http://higginsforpresident.net/2008/05/ajax-just-got-easier/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Sortable object</title>
		<link>http://higginsforpresident.net/2008/05/sortable-object/</link>
		<comments>http://higginsforpresident.net/2008/05/sortable-object/#comments</comments>
		<pubDate>Tue, 20 May 2008 18:12:01 +0000</pubDate>
		<dc:creator>dante hicks</dc:creator>
		
		<category><![CDATA[dojo]]></category>

		<category><![CDATA[functional]]></category>

		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://new.higginsforpresident.net/?p=3</guid>
		<description><![CDATA[To follow up of Wolfram's blog about sorting an object hash by values, I thought i'd make a simple function to work on most single key-pair objects, the JavaScript version of an associative array:
&#160;
var obj = &#123;
	car: 300, bike:60, motorbike:200, airplane:1000,
	helicopter: 500, rocket: 8*60*60
&#125;;
&#160;
function sortObj&#40;theObj, idx&#41;&#123;
	// summary: sort an object hash by a numerical value
	var [...]]]></description>
			<content:encoded><![CDATA[<p>To follow up of <a href="http://wolfram.kriesing.de/blog/index.php/2008/javascript-sort-object-by-a-value">Wolfram's blog about sorting an object</a> hash by values, I thought i'd make a simple function to work on most single key-pair objects, the JavaScript version of an associative array:</p>
<pre class="javascript">&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> obj = <span style="color: #66cc66;">&#123;</span>
	car: <span style="color: #CC0000;">300</span>, bike:<span style="color: #CC0000;">60</span>, motorbike:<span style="color: #CC0000;">200</span>, airplane:<span style="color: #CC0000;">1000</span>,
	helicopter: <span style="color: #CC0000;">500</span>, rocket: <span style="color: #CC0000;">8</span>*<span style="color: #CC0000;">60</span>*<span style="color: #CC0000;">60</span>
<span style="color: #66cc66;">&#125;</span>;
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> sortObj<span style="color: #66cc66;">&#40;</span>theObj, idx<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #009900; font-style: italic;">// summary: sort an object hash by a numerical value</span>
	<span style="color: #003366; font-weight: bold;">var</span> sortable = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;
	<span style="color: #000066; font-weight: bold;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #000066; font-weight: bold;">in</span> theObj<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		sortable.<span style="color: #006600;">push</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>i, theObj<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	sortable.<span style="color: #006600;">sort</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>a,b<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> a<span style="color: #66cc66;">&#91;</span>idx<span style="color: #66cc66;">&#93;</span> - b<span style="color: #66cc66;">&#91;</span>idx<span style="color: #66cc66;">&#93;</span>;
	<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #003366; font-weight: bold;">var</span> newObj = <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>;
	dojo.<span style="color: #006600;">forEach</span><span style="color: #66cc66;">&#40;</span>dojo.<span style="color: #006600;">map</span><span style="color: #66cc66;">&#40;</span>sortable,<span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>elm<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">return</span> elm<span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #66cc66;">&#93;</span>;
	<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>elm<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		newObj<span style="color: #66cc66;">&#91;</span>elm<span style="color: #66cc66;">&#93;</span> = theObj<span style="color: #66cc66;">&#91;</span>elm<span style="color: #66cc66;">&#93;</span>;
	<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #000066; font-weight: bold;">return</span> newObj;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
console.<span style="color: #006600;">log</span><span style="color: #66cc66;">&#40;</span>sortObj<span style="color: #66cc66;">&#40;</span>obj,<span style="color: #CC0000;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://higginsforpresident.net/2008/05/sortable-object/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Branching for IE</title>
		<link>http://higginsforpresident.net/2008/05/branching-for-ie/</link>
		<comments>http://higginsforpresident.net/2008/05/branching-for-ie/#comments</comments>
		<pubDate>Sun, 18 May 2008 11:27:46 +0000</pubDate>
		<dc:creator>dante hicks</dc:creator>
		
		<category><![CDATA[dojo]]></category>

		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://higginsforpresident.net/?p=6</guid>
		<description><![CDATA[I'm working on a really cool demo, and it really pushes the limits of what our current offering of web browsers are capable of doing via JavaScript animations (yes, it's one of those flash-like UI's I recreated in DHTML with surprisingly good results) ... Anyway, it uses a lot of images, and they ALL have [...]]]></description>
			<content:encoded><![CDATA[<p>I'm working on a really cool demo, and it really pushes the limits of what our current offering of web browsers are capable of doing via JavaScript animations (yes, it's one of those flash-like UI's I recreated in DHTML with surprisingly good results) ... Anyway, it uses a lot of images, and they ALL have png alpha channels, making IE6 display this horrible pale green/blue outlay border we all know and love. </p>
<p>So I'm faced with an interesting twist on a common problem, and I think I found a solution I am happy with: Branch for IE6.  This is no ordinary branch, mind you, this is the magical forced upgrade branch. Technically one line of javascript, a function, fired onLoad based on browser sniffing:</p>
<pre class="javascript">&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> newp = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
 <span style="color: #009900; font-style: italic;">// IE6 branch of this demo</span>
 window.<span style="color: #006600;">location</span>.<span style="color: #006600;">href</span> = <span style="color: #3366CC;">&quot;http://&quot;</span> +
  <span style="color: #66cc66;">&#40;</span><span style="color: #000066;">confirm</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;Is it 2008?&quot;</span><span style="color: #66cc66;">&#41;</span> ?
   <span style="color: #3366CC;">&quot;webkit.org&quot;</span> : <span style="color: #3366CC;">&quot;mozilla.org&quot;</span><span style="color: #66cc66;">&#41;</span> +
  <span style="color: #3366CC;">&quot;/&quot;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">// setup our branch launch:</span>
dojo.<span style="color: #006600;">addOnLoad</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>dojo.<span style="color: #006600;">isIE</span> &lt; <span style="color: #CC0000;">7</span> ? newp : init<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>I found humour in it ... It performs a whole lot better than 188 filter: directives, and really, I have no desire to put that burden on anyone's PC. It's 2008 folks, don't test out hot demos using Internet Explorer 6, you will usually be disappointed (when compared to the likes of Safari 3 and even IE7) </p>
<p>Please, Microsoft, for the love of jebus --- end of life IE6 so we, as innovators of the web, can push forward and stop wasting time supporting a near deceased browser anyway, which still has the highest percentage of market share due to your unwillingness to force people up to IE7 ... What version of IE will be out when you finally DO end-of-life it? 9? 10? </p>
<p>I have actually kind of grown to love ie7 -- minus some quirks (solved by dojo sniffing and css sniffing) and poor png support, it actually performs very well, and better than FF2 in some cases. (Granted ff3 picks up any slack ff2 left off, but that's the whole point of these "browser wars" anyway. keep pushing forward ... ) To that end, I reiterate: Microsoft, for the love of jebus ...</p>
<p><strong>update:</strong> I've put the <a href="http://dojotoolkit.org/demos/contributorlisting">demo online</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://higginsforpresident.net/2008/05/branching-for-ie/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
