<?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>Jeremy Smyth's Blog</title>
	<atom:link href="http://jeremysmyth.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jeremysmyth.com</link>
	<description></description>
	<lastBuildDate>Sun, 04 Jul 2010 07:10:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Scheduling Software Development</title>
		<link>http://jeremysmyth.com/2010/07/01/scheduling-software-development/</link>
		<comments>http://jeremysmyth.com/2010/07/01/scheduling-software-development/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 07:03:28 +0000</pubDate>
		<dc:creator>Jeremy Smyth</dc:creator>
				<category><![CDATA[Project Management]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://jeremysmyth.com/?p=279</guid>
		<description><![CDATA[Don&#8217;t use anything fancy like Microsoft Project. The trouble with Microsoft Project is that it assumes that you want to spend a lot of time worrying about dependencies&#8230;.I&#8217;ve found that with software, the dependencies are so obvious that it&#8217;s just not worth the effort to formally keep track of them.
&#8211; Joel Spolsky, Painless Software Schedules
That [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Don&#8217;t use anything fancy like Microsoft Project. The trouble with Microsoft Project is that it assumes that you want to spend a lot of time worrying about dependencies&#8230;.I&#8217;ve found that with software, the dependencies are so obvious that it&#8217;s just not worth the effort to formally keep track of them.</p></blockquote>
<p>&#8211; Joel Spolsky, <a href="http://www.joelonsoftware.com/articles/fog0000000245.html">Painless Software Schedules</a></p>
<p>That article has many other great insights, including:</p>
<blockquote><p>If you are sloppy, and pick big &#8220;chunky&#8221; tasks (&#8221;implement grammar correction&#8221;), then you haven&#8217;t really thought about what you are going to do. And when you haven&#8217;t thought about what you&#8217;re going to do, you just can&#8217;t know how long it will take.</p></blockquote>
<p>&#8230;and</p>
<blockquote><p>Many rookie software managers think that they can &#8220;motivate&#8221; their programmers to work faster by giving them nice, &#8220;tight&#8221; (unrealistically short) schedules. I think this kind of motivation is brain-dead. When I&#8217;m behind schedule, I feel doomed and depressed and unmotivated. When I&#8217;m working ahead of schedule, I&#8217;m cheerful and productive. The schedule is not the place to play psychological games.</p></blockquote>
<p>As the article is over ten years old, Joel has end-of-lifed it, and replaced it with <a href="http://www.joelonsoftware.com/items/2007/10/26.html">this one</a> from 2007. I still like the original!</p>
]]></content:encoded>
			<wfw:commentRss>http://jeremysmyth.com/2010/07/01/scheduling-software-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CGI Trailing Path Information</title>
		<link>http://jeremysmyth.com/2010/06/28/cgi-trailing-path-information/</link>
		<comments>http://jeremysmyth.com/2010/06/28/cgi-trailing-path-information/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 15:30:39 +0000</pubDate>
		<dc:creator>Jeremy Smyth</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jeremysmyth.com/2010/06/28/cgi-trailing-path-information/</guid>
		<description><![CDATA[Another one I couldn&#8217;t search up information on, so putting it here for posterity.
I was playing with an elderly blogging platform called Blosxom. It&#8217;s really simple to use, although that, combined with its age, means it&#8217;s not up to the current status quo. Regardless, I found it fun to play with. Plus, it&#8217;s written in [...]]]></description>
			<content:encoded><![CDATA[<p>Another one I couldn&#8217;t search up information on, so putting it here for posterity.</p>
<p>I was playing with an elderly blogging platform called <a href="http://www.blosxom.com/">Blosxom</a>. It&#8217;s really simple to use, although that, combined with its age, means it&#8217;s not up to the current status quo. Regardless, I found it fun to play with. Plus, it&#8217;s written in Perl, and everything else is PHP these days, so it was a nice novelty.</p>
<p>Now, one of the things it expects (as does the rest of the internet, apparently), is that the CGI file may be treated as an application, folder, or directory on the web. Like this:</p>
<pre>
http://example.com/blosxom.cgi/2010/06/28#Post
</pre>
<p>Now, the script itself is the cgi file, a file called blosxom.cgi in the root of my server. As you can see, it looks like a directory in that location, and according to the Internet, that feature should work, passing any &#8220;trailing pathname information&#8221; (as Apache calls it) to the script via the PATH_INFO environment variable.</p>
<p>Apache didn&#8217;t think so.</p>
<p>Now, attempts to google for &#8220;apache trailing slashes&#8221; or &#8220;apache cgi trailing slashes&#8221; or anything like that ended up fruitless. It shames me to say I spent over an hour investigating things like ExecCGI, mod-rewrite stuff, and all manner of other things to try to find out why that feature <em>wasn&#8217;t</em> working for me.</p>
<p>Eventually, I did what I probably should&#8217;ve done an hour before, and looked at the server error logs. Yes, they existed and were visible. I didn&#8217;t think that particular host would let me see them &#8212; it&#8217;s a free host &#8212; but I was wrong, and they surprised me yet again.</p>
<p>So, here&#8217;s the key: the host had switched off the <strong><a href="http://httpd.apache.org/docs/2.0/mod/core.html#acceptpathinfo">AcceptPathInfo</a></strong> directive. Ordinarily, that&#8217;s left to the handler concerned (CGI, PHP etc.) to decide, which explains the ubiquity of the &#8220;on&#8221; setting, and the lack of anyone complaining when it&#8217;s switched off in various places I looked.</p>
<p>So there you have it, folks. If your CGI scripts don&#8217;t work when you have trailing slashes or trailing path info after the script&#8217;s name, don&#8217;t get lost in RewriteRules &#8211; have a look for AcceptPathInfo.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeremysmyth.com/2010/06/28/cgi-trailing-path-information/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SIPDroid Locking up Audio</title>
		<link>http://jeremysmyth.com/2010/06/15/sipdroid-locking-up-audio/</link>
		<comments>http://jeremysmyth.com/2010/06/15/sipdroid-locking-up-audio/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 17:12:31 +0000</pubDate>
		<dc:creator>Jeremy Smyth</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Audio Codecs]]></category>
		<category><![CDATA[SIPDroid]]></category>
		<category><![CDATA[XPeria]]></category>

		<guid isPermaLink="false">http://jeremysmyth.com/?p=272</guid>
		<description><![CDATA[When running SIPDroid on my XPeria X10 (although I&#8217;ve heard of other Android phones doing the same), it appears to make one call, then after hanging up, it, well, doesn&#8217;t hang up. In short, SIPDroid seems to lock the call in place, where it continues even though it&#8217;s ended.
Not only that, but the rest of [...]]]></description>
			<content:encoded><![CDATA[<p>When running SIPDroid on my XPeria X10 (although I&#8217;ve heard of other Android phones doing the same), it appears to make one call, then after hanging up, it, well, doesn&#8217;t hang up. In short, SIPDroid seems to lock the call in place, where it continues even though it&#8217;s ended.</p>
<p>Not only that, but the rest of the audio on the phone stops too, until a reboot of the phone.</p>
<p>Here&#8217;s how I fixed it:</p>
<ul>
<li>Make a call.
<li>Note the codec it uses (shown under the call box). It will be something like &#8220;PCMA (64kbit)&#8221; or &#8220;PCMU (64kbit)&#8221; or something else technical looking<a href=#"sipfoot"><sup>[1]</sup></a>.
<li>Assuming the call fails (which is, after all, why you&#8217;re here!) go into the settings, choose &#8220;Audio Codecs&#8221;, and <em>disable</em> the codec you just noted. In my case, I set &#8220;PCMU (64kbit)&#8221; to &#8220;Never&#8221;
<li>This is the annoying bit. You&#8217;ll probably have to reboot the phone if SIPDroid won&#8217;t let you make another call.
<li>Once you&#8217;re back in, make another call, and note the codec. If you&#8217;re lucky, you&#8217;ll have a successful call, and no lockup. Success!
<li>&#8230;on the other hand, if you&#8217;re like me, you&#8217;ll have to repeat this process until it works. For me, I hit GSM before it worked.
</ul>
<p>Of course, there are other known issues at the moment, including one-way audio, issues with registering with the VOIP server, and so on. I didn&#8217;t have these issues, so if you are, you&#8217;ll have to look elsewhere I&#8217;m afraid!</p>
<p><sup id="sipfoot">[1]</sup> &#8230;where &#8220;technical looking&#8221; means stuff like G722 HD Voice (64kbit), silk24, silk16, silk8, speex, GSM, BV16, or other supported audio codecs.</p>
<p>(Writing this here because I haven&#8217;t seen anything similar after much googling. Hopefully it&#8217;ll help someone!)</p>
]]></content:encoded>
			<wfw:commentRss>http://jeremysmyth.com/2010/06/15/sipdroid-locking-up-audio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programmers or Project Managers?</title>
		<link>http://jeremysmyth.com/2010/04/22/programmers-or-project-managers/</link>
		<comments>http://jeremysmyth.com/2010/04/22/programmers-or-project-managers/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 10:51:05 +0000</pubDate>
		<dc:creator>Jeremy Smyth</dc:creator>
				<category><![CDATA[Project Management]]></category>

		<guid isPermaLink="false">http://jeremysmyth.com/?p=269</guid>
		<description><![CDATA[Some programmers are happy to do as asked, following the spec, and building useful code that does what it&#8217;s supposed to do, and no more.
Other programmers are happy to question the spec, to discover business functionality that may not have been known, and to engage more in design.
Sometimes, and ideally, these functions are separated; you [...]]]></description>
			<content:encoded><![CDATA[<p>Some programmers are happy to do as asked, following the spec, and building useful code that does what it&#8217;s supposed to do, and no more.</p>
<p>Other programmers are happy to question the spec, to discover business functionality that may not have been known, and to engage more in design.</p>
<p>Sometimes, and ideally, these functions are separated; you have a programmer who solves problems made clear in the spec, and you have a software project manager/domain expert who designs the solution to be implemented by a programmer.</p>
<p>Having said that, it&#8217;s not unusual to find the two functions in a single person, particularly a developer with more experience within the problem domain (in fact, it&#8217;s hard to find a project manager who&#8217;s experienced enough to design a good solution, who <em>isn&#8217;t</em> an experienced programmer).</p>
<p>Standard project management technique would suggest you start with the scoping, and the environment (the &#8220;why&#8221; and the &#8220;what&#8221;), and only when you get to identifying the work, to get down to the &#8220;how&#8221;.</p>
<p>Frequently, the guys involved in organising the scope are not the guys doing the actual nitty-gritty work, so by the time they&#8217;re involved, the &#8220;why&#8221; and &#8220;what&#8221; should ideally have been specced out.</p>
<p>With software development, particularly with iterative methods, the &#8220;what&#8221; is usually figured out as part of each iteration, which lets the &#8220;why&#8221; leak in, and should ideally involve lots of two-way communication between the developers and the client.</p>
<p>This isn&#8217;t always how it works though. As I said above, it&#8217;s an ideal world that can separate the functions, and often a programmer with enough experience to connect business analysis with programming will already be filling that role in any given project.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeremysmyth.com/2010/04/22/programmers-or-project-managers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inserting a batch of random numbers</title>
		<link>http://jeremysmyth.com/2010/04/09/inserting-a-batch-of-random-numbers/</link>
		<comments>http://jeremysmyth.com/2010/04/09/inserting-a-batch-of-random-numbers/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 18:02:40 +0000</pubDate>
		<dc:creator>Jeremy Smyth</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://jeremysmyth.com/?p=267</guid>
		<description><![CDATA[Let&#8217;s say you want to insert (or, for our example, update) a whole set of random numbers into a table.
You may try this:

UPDATE TABLE SET rnum = RAND&#40;&#41;

&#8230;only you find, to your amazement, that SQL Server has put the same number into each row.
Hmm.
In SQL Server, when rand() is called multiple times in the same [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you want to insert (or, for our example, update) a whole set of random numbers into a table.</p>
<p>You may try this:</p>
<div class="codesnip-container" >
<div class="sql codesnip" style="font-family:monospace;"><span class="kw1">UPDATE</span> <span class="kw1">TABLE</span> <span class="kw1">SET</span> rnum <span class="sy0">=</span> RAND<span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</div>
<p>&#8230;only you find, to your amazement, that SQL Server has put <em>the same number</em> into each row.</p>
<p>Hmm.</p>
<p>In SQL Server, when rand() is called multiple times in the same query (e.g. for multiple rows in an update statement), it usually returns the same number.</p>
<p>Two problems:</p>
<p>    * Firstly, the rand() function returns a number between 0 and 1.<br />
    * Secondly, when rand() is called multiple times in the same query (e.g. for multiple rows in an update statement), it usually returns the same number (which I suspect your algorithm above is trying to solve, by splitting it into multiple calls)</p>
<p>My favourite way around this problem is to use a function that&#8217;s guaranteed to return a unique value each time, like NEWID(), convert it to binary, and use it as the seed.</p>
<div class="codesnip-container" >
<div class="sql codesnip" style="font-family:monospace;"><span class="kw1">UPDATE</span> <span class="kw1">TABLE</span> <span class="kw1">SET</span> rnum <span class="sy0">=</span> RAND<span class="br0">&#40;</span>convert<span class="br0">&#40;</span><span class="kw1">BINARY</span><span class="br0">&#40;</span><span class="nu0">16</span><span class="br0">&#41;</span><span class="sy0">,</span>NEWID<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span></div>
</div>
<p>This works because NEWID() is guaranteed to return a new GUID (a globally unique 16-byte number) each time it&#8217;s invoked. We must convert this to binary before using it, as RAND() won&#8217;t accept GUIDs as its seed. </p>
<p>So, although RAND() ordinarily gives the same random value for each row in an update, we get over the problem with RAND by giving it a different seed for each row using a function that gives a <em>different</em> result for each row.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeremysmyth.com/2010/04/09/inserting-a-batch-of-random-numbers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL: Mass email change</title>
		<link>http://jeremysmyth.com/2010/04/06/mysql-mass-email-change/</link>
		<comments>http://jeremysmyth.com/2010/04/06/mysql-mass-email-change/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 14:43:11 +0000</pubDate>
		<dc:creator>Jeremy Smyth</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://jeremysmyth.com/?p=265</guid>
		<description><![CDATA[It&#8217;s not unheard of for a company to change e-mail domain in mid-thrust; maybe it&#8217;s been bought out, or rebranded, or the parent company has spun it off to its own brand.
Only you&#8217;ve got hundreds of employees, each one with their own email address, and your MySQL database is in dire need of updating to [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s not unheard of for a company to change e-mail domain in mid-thrust; maybe it&#8217;s been bought out, or rebranded, or the parent company has spun it off to its own brand.</p>
<p>Only you&#8217;ve got hundreds of employees, each one with their own email address, and your MySQL database is in dire need of updating to reflect this.</p>
<p>To get around this, you&#8217;ll need to replace the relevant part of each email string within an update statement, grabbing the hostname substring (after the &#8216;@&#8217;) with a REPLACE, and replacing it.</p>
<div class="codesnip-container" >
<div class="sql codesnip" style="font-family:monospace;"><span class="kw1">UPDATE</span> <span class="kw1">TABLE</span> <span class="kw1">SET</span> email<span class="sy0">=</span><span class="kw1">REPLACE</span><span class="br0">&#40;</span>email<span class="sy0">,</span><span class="st0">&#8216;OLDHOST.com&#8217;</span><span class="sy0">,</span> <span class="st0">&#8216;newhost.com&#8217;</span><span class="br0">&#41;</span>;</div>
</div>
<p>Note: REPLACE() <em>is</em> case-sensitive, so if needs be, you can use LOWER(email) inside the REPLACE function if you need to catch all case possibilities, as below:</p>
<div class="codesnip-container" >
<div class="sql codesnip" style="font-family:monospace;"><span class="kw1">UPDATE</span> <span class="kw1">TABLE</span> <span class="kw1">SET</span> email<span class="sy0">=</span><span class="kw1">REPLACE</span><span class="br0">&#40;</span>LOWER<span class="br0">&#40;</span>email<span class="br0">&#41;</span><span class="sy0">,</span><span class="st0">&#8216;oldhost.com&#8217;</span><span class="sy0">,</span> <span class="st0">&#8216;newhost.com&#8217;</span><span class="br0">&#41;</span>;</div>
</div>
<p>This will also convert all your email addresses to lowercase, so be aware of that.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeremysmyth.com/2010/04/06/mysql-mass-email-change/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessibility: HTML Keyboard Shortcuts with &#8220;accesskey&#8221;</title>
		<link>http://jeremysmyth.com/2010/03/29/accessibility-keyboard-shortcuts-on-the-web-with-accesskey/</link>
		<comments>http://jeremysmyth.com/2010/03/29/accessibility-keyboard-shortcuts-on-the-web-with-accesskey/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 09:59:22 +0000</pubDate>
		<dc:creator>Jeremy Smyth</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://jeremysmyth.com/?p=237</guid>
		<description><![CDATA[
function showKeys() {
	if (document.styleSheets) {
		var s = document.styleSheets[0];
		var l = s.cssRules.length;
		s.insertRule("[accesskey]:after {font-weight: 700; border-bottom: 1px blue dotted; content: '[' attr(accesskey) ']';}", l);
	} 
}

Accessibility is a hot topic on the web, and there are many emerging standards to help move in an accessible direction. We have CSS media types, alternative web pages with simpler navigation and [...]]]></description>
			<content:encoded><![CDATA[<p><script language="Javascript1.2">
function showKeys() {
	if (document.styleSheets) {
		var s = document.styleSheets[0];
		var l = s.cssRules.length;
		s.insertRule("[accesskey]:after {font-weight: 700; border-bottom: 1px blue dotted; content: '[' attr(accesskey) ']';}", l);
	} 
}
</script></p>
<p>Accessibility is a hot topic on the web, and there are many emerging standards to help move in an accessible direction. We have CSS media types, alternative web pages with simpler navigation and high-contrast styling, <tt>alt</tt> and <tt>title</tt> tags, and the general move away from mixing style with substance.</p>
<p>Along with all of this, we have the relatively old standard of using the <tt>accesskey</tt> attribute on invokeable elements such as hyperlinks and form inputs. This allows us to attach a keyboard shortcut to elements in our webpage.</p>
<p>Unfortunately, this isn&#8217;t a widely used, or easily implemented standard. Although the accesskey attribute is widely supported, only one commonly-used browser (Opera) at the time of writing provides an easy way for users to see what accesskeys are enabled on a given site, and there is no widely-accepted standard for choosing which accesskeys perform which function.</p>
<p>However, with a little jiggery-pokery we can implement a simple way to show accesskeys on demand:</p>
<div style="width: 90%; border: 1px dashed gray; margin-left: auto; margin-right: auto; padding: 8px;">
<input type="button" value="Show access keys" onclick="showKeys()" style="float: right;" />
<p><a href="http://jeremysmyth.com/2010/03/29/accessibility-keyboard-shortcuts-on-the-web-with-accesskey/"     title="Link to this post"  accesskey="9"><br />
This link</a> will bring you to this post&#8217;s permalink, and can be actuated with the accesskey &#8220;9&#8243;; in Firefox, you hold alt-shift and press 9. </p>
</div>
<p />
<p>The code for the above is pretty simple. First, the button:</p>
<pre>
<div class="codesnip-container" >
<div class="html4strict codesnip" style="font-family:monospace;"><span class="sc2">&lt;<a href="http://december.com/html/4/element/input.html"><span class="kw2">input</span></a> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;button&quot;</span> <span class="kw3">value</span><span class="sy0">=</span><span class="st0">&quot;Show access keys&quot;</span> </span>
<span class="sc2"> &nbsp; &nbsp; &nbsp; <span class="kw3">onclick</span><span class="sy0">=</span><span class="st0">&quot;showKeys()&quot;</span> <span class="kw3">style</span><span class="sy0">=</span><span class="st0">&quot;float: right;&quot;</span> <span class="sy0">/</span>&gt;</span></div>
</div>
</pre>
<p>The hyperlink itself (abbreviated):</p>
<pre>
<div class="codesnip-container" >
<div class="html4strict codesnip" style="font-family:monospace;"><span class="sc2">&lt;<a href="http://december.com/html/4/element/a.html"><span class="kw2">a</span></a> <span class="kw3">href</span><span class="sy0">=</span><span class="st0">&quot;http://jeremysmyth.com/....&quot;</span> </span>
<span class="sc2"> &nbsp; &nbsp; &nbsp; <span class="kw3">title</span><span class="sy0">=</span><span class="st0">&quot;Link to this post&quot;</span> </span>
<span class="sc2"> &nbsp; &nbsp; &nbsp; <span class="kw3">accesskey</span><span class="sy0">=</span><span class="st0">&quot;9&quot;</span>&gt;</span>This link<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/a.html"><span class="kw2">a</span></a>&gt;</span> 
will bring you...</div>
</div>
</pre>
<p>Finally, the javascript:</p>
<pre>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;"><span class="kw2">function</span> showKeys<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>document.<span class="me1">styleSheets</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> sheet <span class="sy0">=</span> document.<span class="me1">styleSheets</span><span class="br0">&#91;</span>0<span class="br0">&#93;</span><span class="sy0">;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> len <span class="sy0">=</span> sheet.<span class="me1">cssRules</span>.<span class="me1">length</span><span class="sy0">;</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// reformatted to fit</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sheet.<span class="me1">insertRule</span><span class="br0">&#40;</span><span class="st0">&quot;[accesskey]:after {&quot;</span> <span class="sy0">+</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;font-weight: 700; &quot;</span> <span class="sy0">+</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;border-bottom: 1px blue dotted; &quot;</span> <span class="sy0">+</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;content: '[' attr(accesskey) ']';}&quot;</span> <span class="sy0">,</span> len<span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> 
<span class="br0">&#125;</span></div>
</div>
</pre>
<p>Clicking on the button calls the &#8220;showKeys()&#8221; function in the Javascript script block, which adds a style to the current stylesheet. The style automatically styles elements with the &#8220;accesskey&#8221; attribute, adding the value of that attribute after the element itself.
</p>
<p>Put simply, it adds a styled [9] after the hyperlink, because (1) it has the &#8220;accesskey&#8221; attribute, and secondly, the &#8220;9&#8243; is the value of that attribute, as calculated by the <tt>attr()</tt> function.</p>
<p><em style="font-style: italic; font-size: 90%;">Note: The above Javascript won&#8217;t currently work in Internet Explorer; for that, you&#8217;d need Microsoft&#8217;s <a href="http://msdn.microsoft.com/en-us/library/aa358796%28VS.85%29.aspx" title="Microsoft StyleSheet reference">addRule</a> function rather than the standards-compliant <a href="http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet" title="W3 StyleSheet standards site">insertRule</a> I&#8217;ve used.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://jeremysmyth.com/2010/03/29/accessibility-keyboard-shortcuts-on-the-web-with-accesskey/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Feature requests: discuss, implement, or reject/deny?</title>
		<link>http://jeremysmyth.com/2010/03/23/feature-requests-discuss-implement-or-rejectdeny/</link>
		<comments>http://jeremysmyth.com/2010/03/23/feature-requests-discuss-implement-or-rejectdeny/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 19:12:13 +0000</pubDate>
		<dc:creator>Jeremy Smyth</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Feature Requests]]></category>

		<guid isPermaLink="false">http://jeremysmyth.com/?p=215</guid>
		<description><![CDATA[I work in another publicly accessible community, where bug reports and feature requests are happily solicited from the userbase.
We have thousands of open idea requests (the codebase is nearing 20 years old), and close only a sizeable fraction of those opened regularly.
From our perspective, the idea requests are welcome, but not all of them are [...]]]></description>
			<content:encoded><![CDATA[<p>I work in another publicly accessible community, where bug reports and feature requests are happily solicited from the userbase.</p>
<p>We have <em>thousands</em> of open idea requests (the codebase is nearing 20 years old), and close only a sizeable fraction of those opened regularly.</p>
<p>From our perspective, the idea requests are welcome, but not all of them are actionable; some are brilliant, and are implemented immediately because they work well with our vision; some are entirely incompatible and are closed/denied.</p>
<p>The majority fit in between; they&#8217;re ideas that would work with a bit of tweaking, or a bit of thought, but aren&#8217;t necessarily on the primary development roadmap, so don&#8217;t get our attention immediately. Nor do they warrant closing, because they are relevant, merely not timely or important.</p>
<p>Because our developers have their own ideas, their own neverending todo lists, we treat the open idea pile more as inspiration than as a roadmap. There&#8217;s very much a feeling of &#8220;we&#8217;ll get to it when we&#8217;ve run out of other things to do&#8221;, but this never happens in practice.</p>
<p>I know it&#8217;s a cop-out not to choose one or the other, but I think it&#8217;s a normal thing to have to choose between two equally bad things in a public forum like this: either responding to most feature requests with a &#8220;denied&#8221;, and so risk upsetting the folk who love the community enough to contribute with their own ideas; or leave some of them dangling because they&#8217;re not immediately and obviously wrong, but to do something worthwhile with them takes more time and effort than the idea deserves<em> right now</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeremysmyth.com/2010/03/23/feature-requests-discuss-implement-or-rejectdeny/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML: Title Tooltips and Alt text</title>
		<link>http://jeremysmyth.com/2010/03/18/html-title-tooltips-and-alt-text/</link>
		<comments>http://jeremysmyth.com/2010/03/18/html-title-tooltips-and-alt-text/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 19:11:18 +0000</pubDate>
		<dc:creator>Jeremy Smyth</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://jeremysmyth.com/?p=227</guid>
		<description><![CDATA[Sadly, another one for the Internet Explorer Vs. Firefox debate.
It&#8217;s pretty well known that most browsers will display a tooltip of sorts when you hover over an image. The alt attribute of the img tag gives rise to that, in pretty much all places.
Lesser known is the title attribute, which is supposed to give the [...]]]></description>
			<content:encoded><![CDATA[<p>Sadly, another one for the Internet Explorer Vs. Firefox debate.</p>
<p>It&#8217;s pretty well known that most browsers will display a tooltip of sorts when you hover over an image. The <tt>alt</tt> attribute of the <tt>img</tt> tag gives rise to that, in pretty much all places.</p>
<p>Lesser known is the <tt>title</tt> attribute, which is <i>supposed</i> to give the tooltip; the <tt>alt</tt> attribute might do that as a side-effect if <tt>title</tt> isn&#8217;t there, but it&#8217;s just that: a side-effect. The <tt>alt</tt> attribute is really there to give browsers that aren&#8217;t displaying images (or screenreaders that can&#8217;t see them anyway) some idea of what the image is.</p>
<p>This separation of concerns is somewhat of a problem when it comes to image maps: in image maps, the <tt>alt</tt> text for the <tt>area</tt> elements is there for similar reasons, to show what options are there when the image isn&#8217;t there. The <tt>title</tt> attribute is there for the tooltip, as ever.</p>
<p>However, if both alt and title are there, Internet Explorer shows the alt text as a tooltip, where Firefox will show the title text. Although they serve very different functions, a conscientious web developer is forced to keep them identical, or risk causing problems for the non-standards-compliant behaviour of Internet Explorer.</p>
<p>Of course, <tt>title</tt> will still work in other places, for example on images or even links:</p>
<div class="codesnip-container" >
<div class="html4strict codesnip" style="font-family:monospace;"><span class="sc2">&lt;<a href="http://december.com/html/4/element/a.html"><span class="kw2">a</span></a> <span class="kw3">href</span><span class="sy0">=</span><span class="st0">&quot;mypage.html&quot;</span> <span class="kw3">title</span><span class="sy0">=</span><span class="st0">&quot;My lovely page!&quot;</span>&gt;</span>My Page<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/a.html"><span class="kw2">a</span></a>&gt;</span></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://jeremysmyth.com/2010/03/18/html-title-tooltips-and-alt-text/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Delving into the XHTML 1.1 DTD</title>
		<link>http://jeremysmyth.com/2010/03/16/delving-into-the-xhtml-1-1-dtd/</link>
		<comments>http://jeremysmyth.com/2010/03/16/delving-into-the-xhtml-1-1-dtd/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 15:11:52 +0000</pubDate>
		<dc:creator>Jeremy Smyth</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[DOCTYPE]]></category>
		<category><![CDATA[DTD]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://jeremysmyth.com/?p=217</guid>
		<description><![CDATA[So, you&#8217;re looking at the top of a web page&#8217;s source code, and you see something like this:


&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.1//EN&#34; 
 &#160; &#34;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&#34;&#62;


What&#8217;s the relationship between that and the actual code in the web page?
Well, a DOCTYPE tag declares what document type this webpage is, by formally specifying a Document Type Descriptor [...]]]></description>
			<content:encoded><![CDATA[<p>So, you&#8217;re looking at the top of a web page&#8217;s source code, and you see something like this:</p>
<pre>
<div class="codesnip-container" >
<div class="html4strict codesnip" style="font-family:monospace;"><span class="sc0">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.1//EN&quot; </span>
<span class="sc0"> &nbsp; &quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&gt;</span></div>
</div>
</pre>
<p>What&#8217;s the relationship between that and the actual code in the web page?</p>
<p>Well, a DOCTYPE tag declares what <em>document type</em> this webpage is, by formally specifying a <em>Document Type Descriptor</em> (that&#8217;s what the &#8220;dtd&#8221; in the filename and in the declaration means). This is the formal specification, written in its own computer language, used to define legal dialects of languages descended from SGML. Most predominantly, this includes languages like HTML 4.01 and XHTML. Hence this walkthrough.</p>
<p>In our specific case, it references a specification for XHTML, which is a modular XML-expressed version of HTML. Let&#8217;s look inside.</p>
<p>Firstly, if we look in the declaration, we see the link &#8220;<a href="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">&#8220;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&#8221;</a> which, if you download it, shows the DTD itself. For XHTML, this is a relatively short document; the specification largely consists of modules, referenced from this document. Let&#8217;s have a look.</p>
<p>Within the DTD, you&#8217;ll see this section (around line 121):</p>
<pre>
<div class="codesnip-container" >
<div class="html4strict codesnip" style="font-family:monospace;"><span class="sc-1">&lt;!-- Text Module (Required) &nbsp;..................................... --&gt;</span>
<span class="sc2">&lt;!ENTITY % xhtml-<span class="kw3">text</span>.module <span class="st0">&quot;INCLUDE&quot;</span> &gt;</span>
<span class="sc2">&lt;!<span class="br0">&#91;</span>%xhtml-<span class="kw3">text</span>.module;<span class="br0">&#91;</span></span>
<span class="sc2">&lt;!ENTITY % xhtml-<span class="kw3">text</span>.mod</span>
<span class="sc2"> &nbsp; &nbsp; PUBLIC <span class="st0">&quot;-//W3C//ELEMENTS XHTML Text 1.0//EN&quot;</span></span>
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-text-1.mod&quot;</span> &gt;</span>
%xhtml-text.mod;]]&gt;</div>
</div>
</pre>
<p>This defines a module to be included, which itself is a technically part of the DTD as it is INCLUDEd.</p>
<p>If you navigate to the included module, <a href="http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-text-1.mod">&#8220;http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-text-1.mod&#8221;</a>, you&#8217;ll see a further set of INCLUDEd items, for example:</p>
<pre>
<div class="codesnip-container" >
<div class="html4strict codesnip" style="font-family:monospace;"><span class="sc2">&lt;!ENTITY % xhtml-inlstruct.module <span class="st0">&quot;INCLUDE&quot;</span> &gt;</span>
<span class="sc2">&lt;!<span class="br0">&#91;</span>%xhtml-inlstruct.module;<span class="br0">&#91;</span></span>
<span class="sc2">&lt;!ENTITY % xhtml-inlstruct.mod</span>
<span class="sc2"> &nbsp; &nbsp; PUBLIC <span class="st0">&quot;-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN&quot;</span></span>
<span class="sc2"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;xhtml-inlstruct-1.mod&quot;</span> &gt;</span>
%xhtml-inlstruct.mod;]]&gt;</div>
</div>
</pre>
<p>This entry includes the inline structural elements br and span, and further down the document we have more included modules containing inline phrasal elements (em, strong etc.), block structural (p and div), and block phrasal (h1, h2 etc.).</p>
<p>Try them:</p>
<ul>
<li> <a href="http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlstruct-1.mod">xhtml-inlstruct-1.mod</a>
<li> <a href="http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlphras-1.mod">xhtml-inlphras-1.mod</a>
<li> <a href="http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-blkstruct-1.mod">xhtml-blkstruct-1.mod</a>
<li> <a href="http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-blkphras-1.mod">xhtml-blkphras-1.mod</a>
</ul>
<p>In each, you&#8217;ll see the definitions for tags such as p, div, code, strong, em and so on.</p>
<p>For comparison, have a look at the HTML 4.01 DTD, which you&#8217;ll be able to follow using the DOCTYPE:</p>
<pre>
<div class="codesnip-container" >
<div class="html4strict codesnip" style="font-family:monospace;"><span class="sc0">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot;</span>
<span class="sc0"> &nbsp; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;</span></div>
</div>
</pre>
<p>&#8230;and linked to from here: <a href="http://www.w3.org/TR/html4/strict.dtd">http://www.w3.org/TR/html4/strict.dtd</a>. As you&#8217;ll see, it&#8217;s not quite modular, but still contains code defining the elements (and their contents, attributes and so on) that are legal within the dialect concerned.</p>
]]></content:encoded>
			<wfw:commentRss>http://jeremysmyth.com/2010/03/16/delving-into-the-xhtml-1-1-dtd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
