<?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>David McMurray Dot Net</title>
	<atom:link href="http://www.davidmcmurray.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davidmcmurray.net</link>
	<description>Live To Code, Code To Live</description>
	<lastBuildDate>Wed, 10 Mar 2010 23:30:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>IT Crowd title sequence, register dump during Fedora Core 4 installation (Anaconda)</title>
		<link>http://www.davidmcmurray.net/2010/01/12/it-crowd-title-sequence-register-dump-during-fedora-core-4-installation-anaconda/</link>
		<comments>http://www.davidmcmurray.net/2010/01/12/it-crowd-title-sequence-register-dump-during-fedora-core-4-installation-anaconda/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 01:12:37 +0000</pubDate>
		<dc:creator>David McMurray</dc:creator>
				<category><![CDATA[Bits N Bytes]]></category>
		<category><![CDATA[Anaconda]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[IT Crowd]]></category>
		<category><![CDATA[RedHat]]></category>

		<guid isPermaLink="false">http://www.davidmcmurray.net/?p=269</guid>
		<description><![CDATA[Finally had a few seconds knocking about to see what the screen near the end of the IT Crowd title credits is all about. Which is weird as I&#8217;ve been wondering whether to update my FC9 machines to FC12, hmmm.
But I&#8217;m still not changing my RH9 server, for sentimental reasons&#8230;
]]></description>
			<content:encoded><![CDATA[<p>Finally had a few seconds knocking about to see what the screen near the end of the IT Crowd title credits is all about. Which is weird as I&#8217;ve been wondering whether to update my FC9 machines to FC12, hmmm.</p>
<p>But I&#8217;m still not changing my RH9 server, for sentimental reasons&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidmcmurray.net/2010/01/12/it-crowd-title-sequence-register-dump-during-fedora-core-4-installation-anaconda/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixed it!</title>
		<link>http://www.davidmcmurray.net/2009/07/03/fixed-it/</link>
		<comments>http://www.davidmcmurray.net/2009/07/03/fixed-it/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 23:51:01 +0000</pubDate>
		<dc:creator>David McMurray</dc:creator>
				<category><![CDATA[Blogging]]></category>

		<guid isPermaLink="false">http://www.davidmcmurray.net/?p=229</guid>
		<description><![CDATA[Finally took a couple of minutes to look at why the ngg-gallery slideshow widget wasn&#8217;t working since I moved my sites and upgraded Wordpress. Initially I just wanted to reinsert my code to add my CAPTCHA code back in to stop people spamming comments, then I thought I might as well go one step further [...]]]></description>
			<content:encoded><![CDATA[<p>Finally took a couple of minutes to look at why the ngg-gallery slideshow widget wasn&#8217;t working since I moved my sites and upgraded Wordpress. Initially I just wanted to reinsert my code to add my CAPTCHA code back in to stop people spamming comments, then I thought I might as well go one step further towards getting the site back to normal.</p>
<p>Turns out it was just a case of setting up the location of the JW ImageRotator file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidmcmurray.net/2009/07/03/fixed-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Almost Back To Normal</title>
		<link>http://www.davidmcmurray.net/2009/06/19/almost-back-to-normal/</link>
		<comments>http://www.davidmcmurray.net/2009/06/19/almost-back-to-normal/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 02:04:47 +0000</pubDate>
		<dc:creator>David McMurray</dc:creator>
				<category><![CDATA[Blogging]]></category>

		<guid isPermaLink="false">http://www.davidmcmurray.net/?p=226</guid>
		<description><![CDATA[What a week! After having my websites hacked, my hosting company (*cough* EUKHost) not telling me they had suspended my account, them refusing to re-enable it or allow me to access emails, and suggesting I either pay for a far more expensive hosting package which I don&#8217;t need or find another hosting company. I have [...]]]></description>
			<content:encoded><![CDATA[<p>What a week! After having my websites hacked, my hosting company (*cough* EUKHost) not telling me they had suspended my account, them refusing to re-enable it or allow me to access emails, and suggesting I either pay for a far more expensive hosting package which I don&#8217;t need or find another hosting company. I have managed to get this site back up and running somewhere temporary for now.</p>
<p>Unfortunately the pretty ngg-gallery slideshow widget isn&#8217;t working since I upgraded, which just adds insult to injury.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidmcmurray.net/2009/06/19/almost-back-to-normal/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fleshing out the beast</title>
		<link>http://www.davidmcmurray.net/2009/05/18/fleshing-out-the-beast/</link>
		<comments>http://www.davidmcmurray.net/2009/05/18/fleshing-out-the-beast/#comments</comments>
		<pubDate>Mon, 18 May 2009 21:54:29 +0000</pubDate>
		<dc:creator>David McMurray</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.davidmcmurray.net/?p=220</guid>
		<description><![CDATA[I&#8217;m starting to put the AJAX game framework to the test, and applying it to some game rules. Although currently I&#8217;m starting from a higher level not covered by the rules at the moment, which is where individual game instances are created. Whoever is running a particular game instance can set the parameters of the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m starting to put the AJAX game framework to the test, and applying it to some game rules. Although currently I&#8217;m starting from a higher level not covered by the rules at the moment, which is where individual game instances are created. Whoever is running a particular game instance can set the parameters of the game; starting conditions and victory conditions for instance. Then once the players have joined, the game can begin.</p>
<p>As this system is turn based I intend to allow a turn period to be set as part of the starting parameters. But also provide the option to have this as a maximum turn duration, and process turns as soon as all players have submitted their turn. Since turn processing will take a matter of seconds and the next turn will start once processing has completed, it would actually be possible for all players to be logged in at the same time and submit turn after turn.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidmcmurray.net/2009/05/18/fleshing-out-the-beast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trigger Happy with MySQL</title>
		<link>http://www.davidmcmurray.net/2009/05/15/trigger-happy-with-mysql/</link>
		<comments>http://www.davidmcmurray.net/2009/05/15/trigger-happy-with-mysql/#comments</comments>
		<pubDate>Fri, 15 May 2009 01:16:21 +0000</pubDate>
		<dc:creator>David McMurray</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[triggers]]></category>

		<guid isPermaLink="false">http://www.davidmcmurray.net/?p=211</guid>
		<description><![CDATA[I have to say I am a rather big fan of db triggers, in an effort to bring some discipline to my databases. Since audit tables have become quite a habit of mine, this is probably my main use for triggers. Although MySQL has a little way to go yet before we have the kind [...]]]></description>
			<content:encoded><![CDATA[<p>I have to say I am a rather big fan of db triggers, in an effort to bring some discipline to my databases. Since audit tables have become quite a habit of mine, this is probably my main use for triggers. Although MySQL has a little way to go yet before we have the kind of experience that SQL Server has brought to us in the past, but it&#8217;s getting there.</p>
<p>I was surprised to see how little documentation there is on the &#8216;BEFORE&#8217; and &#8216;AFTER&#8217; keywords. I was looking for something that would explain to me when I should use each of these, and wherever I found *something* on it, it wasn&#8217;t enough.</p>
<p>Through a little bit of testing however, I have found that using &#8216;AFTER&#8217; delivers desirable results for Inserts, Updates and Deletes. Is it important? Well, considering that after performing the tasks of a &#8216;BEFORE&#8217; trigger the actual Insert, Update or Delete might fail, but this doesn&#8217;t undo the effects of the trigger. Using &#8216;AFTER&#8217; triggers ensures that the task has completed before we create the audit record.</p>
<p>An example of auditing triggers, for Insert, Update and Delete:</p>
<p>
<pre><code>
CREATE TRIGGER mytable_audit_trigger_insert
AFTER INSERT ON mytable
FOR EACH ROW BEGIN
    INSERT INTO mytable_audit (
        id, date, name
    )
    VALUES(
        NEW.id, NOW(), NEW.name
    );
END;
</code></pre>
</p>
<p>
<pre><code>
CREATE TRIGGER mytable_audit_trigger_update
AFTER UPDATE ON mytable
FOR EACH ROW BEGIN
    INSERT INTO mytable_audit (
        id, date, name
    )
    VALUES(
        NEW.id, NOW(), NEW.name
    );
END;
</code></pre>
</p>
<p>
<pre><code>
CREATE TRIGGER mytable_audit_trigger_delete
AFTER DELETE ON mytable
FOR EACH ROW BEGIN
    INSERT INTO mytable_audit (
        id, date, name
    )
    VALUES(
        OLD.id, NOW(), OLD.name
    );
END;
</code></pre>
</p>
<p>It would be nice to be able to query/edit triggers, but unfortunately you can only CREATE and DROP them, certainly within the MySQL Query Browser. I&#8217;ve not tried any 3rd party tools as I&#8217;m happy to keep .sql files, with the details of the CREATE TRIGGER statements so I know what&#8217;s in them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidmcmurray.net/2009/05/15/trigger-happy-with-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SPI Ajax Application Development</title>
		<link>http://www.davidmcmurray.net/2009/05/10/spi-ajax-application-development/</link>
		<comments>http://www.davidmcmurray.net/2009/05/10/spi-ajax-application-development/#comments</comments>
		<pubDate>Sun, 10 May 2009 12:25:40 +0000</pubDate>
		<dc:creator>David McMurray</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[SPI]]></category>
		<category><![CDATA[web application]]></category>

		<guid isPermaLink="false">http://www.davidmcmurray.net/?p=194</guid>
		<description><![CDATA[<p>Writing an Ajax-based web application is far from new, and neither is the conundrum of choosing a single-page interface (SPI) or multi-page interface (MPI) and which patterns to implement. But these decisions are made much simpler if you're developing a web version of some traditional local application. For instance the issues of browsing history and bookmarking for which SPI applications would require additional code to implement are not needed. We don't expect this functionality from traditional local applications other than the menus and controls that would be implemented in an Ajax web-based version of the application.</p>

<p>This is why I chose to implement the SPI model for my browser-based application framework, primarily intended for strategy/RPG gaming. Since users will need to be authenticated by the application before they can use it, and once logged in they are presented with navigational controls via menus and other web controls, I see no real requirement for them to bookmark anything other than the main application page. Which they are free to do. Admittedly, particularly in the case of online gaming, there would generally be some content intended for non-members, introduction to the application and enticing screenshots etc, which they may feel the need to bookmark. But if a sufficiently intuitive public menu is on offer then bookmarking and browsing history is still not really necessary.</p>

<p>Anyway, enough of justifying my apparent laziness ;P Time for some code...</p>
]]></description>
			<content:encoded><![CDATA[<p>Writing an Ajax-based web application is far from new, and neither is the conundrum of choosing a single-page interface (SPI) or multi-page interface (MPI) and which patterns to implement. But these decisions are made much simpler if you&#8217;re developing a web version of some traditional local application. For instance the issues of browsing history and bookmarking for which SPI applications would require additional code to implement are not needed. We don&#8217;t expect this functionality from traditional local applications other than the menus and controls that would be implemented in an Ajax web-based version of the application.</p>
<p>This is why I chose to implement the SPI model for my browser-based application framework, primarily intended for strategy/RPG gaming. Since users will need to be authenticated by the application before they can use it, and once logged in they are presented with navigational controls via menus and other web controls, I see no real requirement for them to bookmark anything other than the main application page. Which they are free to do. Admittedly, particularly in the case of online gaming, there would generally be some content intended for non-members, introduction to the application and enticing screenshots etc, which they may feel the need to bookmark. But if a sufficiently intuitive public menu is on offer then bookmarking and browsing history is still not really necessary.</p>
<p>Anyway, enough of justifying my apparent laziness ;P Time for some code&#8230;</p>
<p>I devised an XMLHttpRequest model which uses a single Ajax callback function that receives XML containing individual page updates. For example I have started with a two part interface made up of a menu and main content area. When the user clicks on a menu option an XMLHttpRequest is sent to a specific server-side script for that menu option which will compile an XML update document and pass it back. This will then be picked up from my one, generic callback function. This will then extract each xml page update and perform each update on the page. These updates will specify an ID, which relates to an element on the page.</p>
<p>For example, consider a very simplified situation below, with 2 menu items for introduction and about us sections, a header section that just informs the user where they are in the application and a main content section initially displaying the introduction:</p>
<pre><code>
&lt;html&gt;
  &lt;body&gt;
    &lt;div id="header"&gt;Introduction&lt;/div&gt;
    &lt;div id="menu"&gt;
      &lt;div onclick="AjaxReq('intro');"&gt;Introduction&lt;/div&gt;
      &lt;div onclick="AjaxReq('about');"&gt;About Us&lt;/div.
    &lt;/div&gt;
    &lt;div id="main"&gt;
      This is the introduction page.
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;
</code></pre>
</p>
<p>The AjaxReq function will then look at it&#8217;s one parameter and call the appropriate server-side script, in this case maybe either intro{.php,.asp,.aspx,etc.} or aboutus for example. The aboutus script might then return the following XML:</p>
<pre><code>
&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;
&lt;updates&gt;
  &lt;update target="header"&gt;
    &lt;![CDATA[
      About Us
    ]]&gt;
  &lt;/update&gt;
  &lt;update target="main"&gt;
    &lt;![CDATA[
      This is the about us page.
    ]]&gt;
  &lt;/update&gt;
&lt;/updates&gt;
</code></pre>
</p>
<p>The generic callack function that receives this can then simply replace the contents of each of the html elements specified by the target attributes, with the contents of the CDATA sections. This will give a page that looks like:</p>
<pre><code>
&lt;html&gt;
  &lt;body&gt;
    &lt;div id="header"&gt;About Us&lt;/div&gt;
    &lt;div id="menu"&gt;
      &lt;div onclick="AjaxReq('intro');"&gt;Introduction&lt;/div&gt;
      &lt;div onclick="AjaxReq('about');"&gt;About Us&lt;/div.
    &lt;/div&gt;
    &lt;div id="main"&gt;
      This is the about us page.
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;
</code></pre>
</p>
<p>So a single Ajax request-response can make several updates to the page. So we could expand this to also update the menu if we wanted to include sub-menus.</p>
<p>Also, a single section might have a specific layout and controls within the &#8220;main&#8221; element, whose controls make Ajax requests that return updates for elements specific to that &#8220;main&#8221; section. This is made easier by the addition of passing parameters in the request. So not only can you start with a simple menu-content layout, but each of those sections could load sub-sections whose content can be updated directly.</p>
<p>Time for an example of the Javascript Ajax request and callback functions that could be used in an application implementing this method. These also rely on the use of the prototype library. Here&#8217;s the Ajax request function:</p>
<pre><code>
function AjaxRequest(url, params, callBack) {
    new Ajax.Request(url, {
        parameters: params,
        onSuccess: callBack,
        onFailure: AjaxRequestError
    });
}</code></pre>
</p>
<p>Here&#8217;s the generic callback function:</p>
<pre><code>function AjaxResponse(req) {
    var xmlDoc = req.responseXML;
    var xhtmlUpdate = xmlDoc.getElementsByTagName("xhtmlupdate");
    var i,target;
    for(i=0; i&lt;xhtmlUpdate.length; i++) {
        target = xhtmlUpdate[i].getAttribute("target");
        xhtml = GetNodeXML(xhtmlUpdate[i]);
        // Clear previous data.
        while($(target).hasChildNodes()) {
            $(target).removeChild($(target).lastChild);
        }
        // Add new data if there is any.
        if (xhtml != "") {
            var tmpDiv = document.createElement("div");
            tmpDiv.innerHTML = xhtml;
            $(target).appendChild(tmpDiv);
        }
    }
}</code></pre>
</p>
<p>I&#8217;ve included a login section in my application framework, with the ability for a user to register an account and retrieve forgotten login details. I have also provided a public and private application menu depending on whether the user is currently logged in or not. I&#8217;m hoping to apply it to some game rules soon for a small SPI Ajax space colonisation strategy game. But I&#8217;m also thinking of moving from Prototype to JQuery.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidmcmurray.net/2009/05/10/spi-ajax-application-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Busy Bee</title>
		<link>http://www.davidmcmurray.net/2009/03/06/busy-bee/</link>
		<comments>http://www.davidmcmurray.net/2009/03/06/busy-bee/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 01:24:20 +0000</pubDate>
		<dc:creator>David McMurray</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.davidmcmurray.net/?p=180</guid>
		<description><![CDATA[January to March seems to be just the most manic time of the year for me, sooo busy at work and often having to work till the wee hours to get my main project updated for the college I work for, so that staff can plan their courses and budgets for the next academic year. [...]]]></description>
			<content:encoded><![CDATA[<p>January to March seems to be just the most manic time of the year for me, sooo busy at work and often having to work till the wee hours to get my main project updated for the college I work for, so that staff can plan their courses and budgets for the next academic year. The LSC decided to change the funding methodologies for 08/09, although we didn&#8217;t change things in the last planning period. But now we have the details we&#8217;ve implemented it in this years budget planning tool. Anyway enough of that, I am so booking some holiday when things have settled down a bit.</p>
<p>What else have I been doing? Mostly PHP, JavaScript (although it&#8217;s on my list to give JQuery a try after listening to the FLOSS Weekly podcast no. 55), cURL, libxml2, mySQL, Visual Studio C++ 2008 Express (for my sins ;). Oh and I&#8217;ve converted myself to Gnome, after a long and painful struggle with KDE, swapping kate for gedit and not looking back, much.</p>
<p>Oh and more dabbling with Drupal, wrote a newsfeed reader module for grabbing news items for a website.</p>
<p>Well, that&#8217;s it for now, back to the grind&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidmcmurray.net/2009/03/06/busy-bee/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grabbed By The Attributes</title>
		<link>http://www.davidmcmurray.net/2008/12/19/grabbed-by-the-attributes/</link>
		<comments>http://www.davidmcmurray.net/2008/12/19/grabbed-by-the-attributes/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 01:21:39 +0000</pubDate>
		<dc:creator>David McMurray</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[javascript attributes getElementById grid]]></category>

		<guid isPermaLink="false">http://www.davidmcmurray.net/?p=155</guid>
		<description><![CDATA[The Javascript function &#8216;document.getElementById(&#8220;&#60;ElementId&#62;&#8221;)&#8217; which returns a reference to the first object within a document with the specified id, is certainly in my experience a highly utilised method. But it&#8217;s a bit restricting, certainly in a lot of grid work I&#8217;ve done over the past few years.
Why should we restrict the locating of specific elements [...]]]></description>
			<content:encoded><![CDATA[<p>The Javascript function &#8216;document.getElementById(&#8220;&lt;ElementId&gt;&#8221;)&#8217; which returns a reference to the first object within a document with the specified id, is certainly in my experience a highly utilised method. But it&#8217;s a bit restricting, certainly in a lot of grid work I&#8217;ve done over the past few years.</p>
<p>Why should we restrict the locating of specific elements to just the id attribute? Why not any other attribute? If I have a grid of elements, for example text inputs, I might want to organise them into rows and columns.</p>
<p>
<pre><code>
&lt;input type="text" id="cost" row="4" col="6"/&gt;
</code></pre>
</p>
<p>Now if I want to reference this control from the entire page of controls by it&#8217;s position without knowing it&#8217;s id is &#8216;cost&#8217;, there&#8217;s no straightforward way of doing so. It feels like this should already be available to us. For example, perhaps the control directly below this (on row 5 col 6) has focus and we wish to be able to press the up cursor key and have the focus change to this control on row 4 col 6. This would be much like using cursor keys to move around a spreadsheet. If we could search for the controls by some other attribute like row and col this would be easy. Don&#8217;t get me wrong, this is completely possible using getElementById, you could simply encode the row and column into the id attribute, as I have done many times before.</p>
<p>
<pre><code>
&lt;input type="text" id="r4c6"/&gt;...
&lt;input type="text" id="r5c6"/&gt;...  control with current focus
</code></pre>
</p>
<p><span id="more-155"></span></p>
<p>Then by parsing the id of the control which currently has focus into row and column variables (r5c6 becomes row=5 and col=6) we can simply subtract 1 from the row, re-encode the id (which would now be r4c6). But the problem is you might want the id to have more meaning than just the position of the control, perhaps calculations are done using several different controls on the page. If you then need to move a control to a different row and/or column you would then need to change all calculations to reference the new grid position. Surely it would be better to reference controls in calculations by a more meaningful id, like &#8216;travelCost&#8217;, &#8216;hourPerDay&#8217;, &#8216;distance&#8217;, etc.</p>
<p>&#8230;And this is the very problem that drove me to write the following function, giving the ability to gain a reference to an HTML element via any attribute it might have.</p>
<p>
<pre><code>
function getElementByAttr(attrName, attrValue)
{
    var tags = document.getElementsByTagName("*");
    var result = [];
    var elem, attr;
    var regex = RegExp("^"+attrValue+"$");
    var i = 0;

    while(elem = tags.item(i++))
    {
	attr = elem.getAttribute(attrName);
	if (attr != null)
	    if (regex.test(attr))
		result.push(elem);		
    }

    return result[0];
}
</code></pre>
</p>
<p>This is great for picking out elements by a single attribute, but in the case of the row and col scenario it really doesn&#8217;t help a lot. So I&#8217;m thinking a few more functions are needed for a complete coverage of functionality. What I could do with is a function that can return a subset of the elements, for example an entire row. So I need a getElementsByAttr(attrName, attrValue) (notice the plural Element*s*) function. This would then allow us to do the following which would return an array of references to all elements where the row number is 4 and store them in the variable &#8216;myRow&#8217;:
<p>
<pre><code>
var myRow = getElementsByAttr("row", "4");
</code></pre>
</p>
<p>. But we still need to root out the correct column from that row, so another function is needed, or rather an extension of the original as getElementByAttr(attrName, attrValue, arrayOfElements). Then this would allow us to restrict the search to only those elements currently in the arrayOfElements.</p>
<p>
<pre><code>
//Grab all the elements on row 4.
myRow = getElementsByAttr("row", "4");
//Grab the column 6 element from the array of row 4 elements.
myElement = getElementByAttr("col", "6", myRow);
</code></pre>
</p>
<p>Additionally the getElementsByAttr function would have it&#8217;s uses in instances where you might want to process an entire row or column. E.g. summing the values in a single column.</p>
<p>Assuming a grid with columns and rows numbered from 1 onwards.</p>
<pre><code>
total = 0;
myCol = getElementsByAttr("col","9");
for(i=1; i&lt;=myCol.length; i++)
{
    newVal = parseFloat(myCol[i].value);
    total += (isNaN(newVal))?0:newVal;
}
alert("Total for column 9 = "+total);
</code></pre>
</p>
<p>When I get chance I&#8217;ll post the getElementsByAttr and extended getElementByAttr, but for the last one I need to decide whether to split getElementByAttr(attrName, attrValue) and getElementByAttr(attrName, attrValue, arrayOfElements) into two differently named functions or combine them and allow &#8216;null&#8217; to be passed for the array when it&#8217;s not required.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidmcmurray.net/2008/12/19/grabbed-by-the-attributes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Busy busy busy&#8230;</title>
		<link>http://www.davidmcmurray.net/2008/11/17/busy-busy-busy/</link>
		<comments>http://www.davidmcmurray.net/2008/11/17/busy-busy-busy/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 03:14:37 +0000</pubDate>
		<dc:creator>David McMurray</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.davidmcmurray.net/?p=144</guid>
		<description><![CDATA[I&#8217;m currently working on a couple of projects, as usual too many at once but one is coming along at a reasonable pace, so atleast that&#8217;s something.
I hope to spend more time on the AJAX framework I&#8217;ve been developing, well it&#8217;s more of a framework + design pattern combined and focuses on web applications completely [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently working on a couple of projects, as usual too many at once but one is coming along at a reasonable pace, so atleast that&#8217;s something.</P></p>
<p>I hope to spend more time on the AJAX framework I&#8217;ve been developing, well it&#8217;s more of a framework + design pattern combined and focuses on web applications completely produced from a single page. Basically you navigate to the site and every navigation within that site from then on is handled using AJAX, there is no loading of a new page. Unless of course the user forces a page reload, in which case the session state defines what the user was seeing before and recreates the page as it was before. This also means that during the current session the user never loses their state. It&#8217;s based on PHP for the server side scripting and it&#8217;s something I started a couple of years ago and keep chipping away at it now and then.</p>
<p>So far I&#8217;ve got login functionality, allowing users to register an account, login/logout and viewing public/private &#8220;screens&#8221; depending on whether they are logged in or not.</p>
<p>I&#8217;ve not got anything online as yet, only running on my private RedHat 9 LAMP server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidmcmurray.net/2008/11/17/busy-busy-busy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Time for a minor face lift</title>
		<link>http://www.davidmcmurray.net/2008/08/05/time-for-a-minor-face-lift/</link>
		<comments>http://www.davidmcmurray.net/2008/08/05/time-for-a-minor-face-lift/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 22:33:10 +0000</pubDate>
		<dc:creator>David McMurray</dc:creator>
				<category><![CDATA[Bits N Bytes]]></category>
		<category><![CDATA[Blogging]]></category>

		<guid isPermaLink="false">http://www.davidmcmurray.net/?p=116</guid>
		<description><![CDATA[I was getting bored with the old website colours, so I went for black. Well I like it.
Just catching up on a whole backlog of GeekBrief.TV episodes, so I&#8217;m overdosing on new tech, but after loading more wood on a skip and stripping wallpaper it&#8217;s a nice chance to geek-out for a bit. I&#8217;ll probably [...]]]></description>
			<content:encoded><![CDATA[<p>I was getting bored with the old website colours, so I went for black. Well I like it.</p>
<p>Just catching up on a whole backlog of GeekBrief.TV episodes, so I&#8217;m overdosing on new tech, but after loading more wood on a skip and stripping wallpaper it&#8217;s a nice chance to geek-out for a bit. I&#8217;ll probably listen to the final podcast from LUGRadio in the morning, it&#8217;s a real shame they&#8217;re packing it all in just a couple of months after I discovered it.</p>
<p>Hmmm&#8230; 3 monitors is very tempting, GuildWars on 2 monitors is great apart from having your character (and view) split in half&#8230;</p>
<div id="attachment_119" class="wp-caption alignnone" style="width: 310px"><a href="http://www.davidmcmurray.net/wp-content/uploads/2008/08/gw20080704_2324.jpg"><img src="http://www.davidmcmurray.net/wp-content/uploads/2008/08/gw20080704_2324-300x120.jpg" alt="Wide Widescreen" title="gw20080704_2324" width="300" height="120" class="size-medium wp-image-119" /></a><p class="wp-caption-text">Wide Widescreen</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.davidmcmurray.net/2008/08/05/time-for-a-minor-face-lift/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
