<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The Fifth Wheel of andrewg</title>
	<atom:link href="http://andrewgdotcom.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewgdotcom.wordpress.com</link>
	<description>How many blogs does one man need?</description>
	<lastBuildDate>Thu, 11 Aug 2011 17:51:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='andrewgdotcom.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The Fifth Wheel of andrewg</title>
		<link>http://andrewgdotcom.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://andrewgdotcom.wordpress.com/osd.xml" title="The Fifth Wheel of andrewg" />
	<atom:link rel='hub' href='http://andrewgdotcom.wordpress.com/?pushpress=hub'/>
		<item>
		<title>DNS cache locking on Server 2008</title>
		<link>http://andrewgdotcom.wordpress.com/2011/08/11/dns-cache-locking-on-server-2008/</link>
		<comments>http://andrewgdotcom.wordpress.com/2011/08/11/dns-cache-locking-on-server-2008/#comments</comments>
		<pubDate>Thu, 11 Aug 2011 17:51:34 +0000</pubDate>
		<dc:creator>andrewgdotcom</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[cache locking]]></category>
		<category><![CDATA[cache poisoning]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[server 2008]]></category>

		<guid isPermaLink="false">http://andrewgdotcom.wordpress.com/?p=109</guid>
		<description><![CDATA[So I&#8217;ve been informed that there are some bizarre problems resolving a website that has recently changed providers from digiweb to novara (wasn&#8217;t my idea). From elsewhere the new site appears reliably, but from inside our network we are getting the following results: andgal@nbgal185:~$ host -t any peracton.com peracton.com has SOA record ns1.novara.ie. hostmaster.host.ie. 2011080416 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewgdotcom.wordpress.com&amp;blog=416750&amp;post=109&amp;subd=andrewgdotcom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve been informed that there are some bizarre problems resolving a website that has recently changed providers from digiweb to novara (wasn&#8217;t my idea). From elsewhere the new site appears reliably, but from inside our network we are getting the following results:</p>
<pre>andgal@nbgal185:~$ host -t any peracton.com
peracton.com has SOA record ns1.novara.ie. hostmaster.host.ie. 2011080416 10800 3600 604800 14400
peracton.com name server ns1.novara.ie.
peracton.com name server ns2.novara.ie.
peracton.com name server ns3.nameserver.ie.
peracton.com mail is handled by 10 smail3.host.ie.
peracton.com has address 80.93.17.28

andgal@nbgal185:~$ host peracton.com
peracton.com has address 78.137.166.130
peracton.com mail is handled by 10 mail2.hosting.digiweb.ie.</pre>
<p>The first set of results is the &#8220;correct&#8221; one, so why is host (and nslookup, and dig, and firefox&#8230;) still going to the old address by default? I suspect it is something to do with <a href="http://technet.microsoft.com/en-us/library/ee683892%28WS.10%29.aspx">cache locking on our Server 2008 DNS forwarder</a>. It seems that even after I have forced a fresh request by using &#8220;-t any&#8221;, the stale cached A record is being returned for normal searches. This is apparently a security measure to protect against cache poisoning. It would appear that the TTL on the old A record was unusually long, which means that I had to flush the cache on the primary DNS forwarder (the backup DNS forwarder is fine, presumably because the old record was never in its cache).</p>
<p>Sure enough, running &#8220;dnscmd /clearcache&#8221; on the offending server fixed the problem.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewgdotcom.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewgdotcom.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewgdotcom.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewgdotcom.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/andrewgdotcom.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/andrewgdotcom.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/andrewgdotcom.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/andrewgdotcom.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewgdotcom.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewgdotcom.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewgdotcom.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewgdotcom.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewgdotcom.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewgdotcom.wordpress.com/109/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewgdotcom.wordpress.com&amp;blog=416750&amp;post=109&amp;subd=andrewgdotcom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewgdotcom.wordpress.com/2011/08/11/dns-cache-locking-on-server-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d118c29950aad6293423a630477d2db7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andrewgdotcom</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu upgrade hell</title>
		<link>http://andrewgdotcom.wordpress.com/2010/12/23/ubuntu-upgrade-hell/</link>
		<comments>http://andrewgdotcom.wordpress.com/2010/12/23/ubuntu-upgrade-hell/#comments</comments>
		<pubDate>Thu, 23 Dec 2010 15:00:48 +0000</pubDate>
		<dc:creator>andrewgdotcom</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ranting]]></category>
		<category><![CDATA[thinkfinger]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[xorg]]></category>

		<guid isPermaLink="false">http://andrewgdotcom.wordpress.com/?p=103</guid>
		<description><![CDATA[So I decided to upgrade my work ubuntu laptop. I had been putting it off for ages because of the hell I went through upgrading it from 6.06 to 8.10, but being stuck on old versions of pretty much everything (but especially openoffice) was becoming impossible. Strangely though, it was when I tried to install [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewgdotcom.wordpress.com&amp;blog=416750&amp;post=103&amp;subd=andrewgdotcom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So I decided to upgrade my work ubuntu laptop. I had been putting it off for ages because of the hell I went through upgrading it from 6.06 to 8.10, but being stuck on old versions of pretty much everything (but especially openoffice) was becoming impossible. Strangely though, it was when I tried to install monkeysphere that I finally snapped. Time to do a dist-upgrade to 10.04 I thought.</p>
<p>I started using the desktop package manager &#8211; it had been prompting me with &#8220;a new version of Ubuntu is available&#8221; for quite some time, so I pushed the button and let it do its thing. After an initial false start (out of disk space) it downloaded the upgrades and went to work. About half an hour in, it decided to restart kdm, which is where the fun started.</p>
<p>Now I&#8217;m at a command login and the upgrade is in a bad state. A few <em>apt-get -f install</em>s later I find that there&#8217;s a file missing in the latex hyphenation config and one of the postinst scripts keeps failing. The postrm script fails too, so I can&#8217;t even remove the offending package. After sleeping on the problem, <em>grep -r</em> comes to my rescue and I find the reference to the missing file. Commenting that out just bumped me to the next missing file, so I <em>rm</em>ed the lot. I know I now have a badly broken latex system but dammit, I just want this upgrade to finish.</p>
<p>A few more <em>apt-get -f install</em>s and <em>apt-get dist-upgrade</em>s later, and the system is ready to reboot. But grub can&#8217;t find the root partition, and it drops me to an initramfs which can&#8217;t see any hardware. So I had to fire up a 10.04 install cd that I fortunately had to hand, and use it to chroot into the root partition and rebuild the initrd.</p>
<p>Finally, it boots. But I can&#8217;t login graphically because gnome-session can&#8217;t be found. Back into the command line and apt-get install ubuntu-desktop, which takes another half an hour because it&#8217;s all missing, the lot of it. At this point, I notice something odd &#8211; I can use my thinkpad fingerprint reader to log in on the command line, but not graphically &#8211; scanning the finger when in X gives nothing, not even an error.</p>
<p>Anyway, my xorg.conf file is apparently no longer valid, as it doesn&#8217;t recognise the dual screen setup. I rename it and let it run on auto-detect and the screen comes back, but the EmulateWheel on my trackball now doesn&#8217;t work. So I run <em>X :2 -configure</em> to get a skeleton xorg.conf file, save that in /etc/X11/xorg.conf and cut&amp;paste my old mouse settings into it. This doesn&#8217;t work.</p>
<p>At this point, having used sudo several times, I accidentally discover how to make the fingerprint sensor work while inside X. When prompted, scan your finger. Wait two seconds, hit Ctrl-C and then enter. Don&#8217;t ask me why.</p>
<p>It turns out that in recent versions of xorg, you need to set the option &#8220;AllowEmptyInput off&#8221; in the ServerFlags section or else it ignores any mouse or keyboard configuration sections. Sure enough, this allows EmulateWheel to work again, but the mouse pointer also moves while the emulated scroll wheel is turning. I&#8217;m now running very late and this sorry saga will have to continue in the new year.</p>
<p>Merry Christmas, software developers.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewgdotcom.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewgdotcom.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewgdotcom.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewgdotcom.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/andrewgdotcom.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/andrewgdotcom.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/andrewgdotcom.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/andrewgdotcom.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewgdotcom.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewgdotcom.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewgdotcom.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewgdotcom.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewgdotcom.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewgdotcom.wordpress.com/103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewgdotcom.wordpress.com&amp;blog=416750&amp;post=103&amp;subd=andrewgdotcom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewgdotcom.wordpress.com/2010/12/23/ubuntu-upgrade-hell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d118c29950aad6293423a630477d2db7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andrewgdotcom</media:title>
		</media:content>
	</item>
		<item>
		<title>How to create a DNAME record in Server 2008</title>
		<link>http://andrewgdotcom.wordpress.com/2010/12/16/how-to-create-a-dname-record-in-server-2008/</link>
		<comments>http://andrewgdotcom.wordpress.com/2010/12/16/how-to-create-a-dname-record-in-server-2008/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 17:29:18 +0000</pubDate>
		<dc:creator>andrewgdotcom</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[dname]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[server 2008]]></category>

		<guid isPermaLink="false">http://andrewgdotcom.wordpress.com/?p=101</guid>
		<description><![CDATA[I had to do a little searching on the internet to work out how to do this, so here it is in a single post. DNAME records are supported in Server 2008&#8242;s DNS service, but you cannot add them (or edit them) in the graphical tool. You need to use the command line. Right-click &#8220;Command [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewgdotcom.wordpress.com&amp;blog=416750&amp;post=101&amp;subd=andrewgdotcom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had to do a little searching on the internet to work out how to do this, so here it is in a single post.</p>
<p>DNAME records are supported in Server 2008&#8242;s DNS service, but you cannot add them (or edit them) in the graphical tool. You need to use the command line. Right-click &#8220;Command Prompt&#8221; and run as administrator. Then you can type in the following:</p>
<p><code>DNSCMD /RECORDADD myzone.example.com mynewrecord DNAME myoldrecord.example.com</code></p>
<p>If you now refresh the graphical DNS tool you will see a new record with a blank type and contents &#8220;Unknown &#8211; view properties for more info&#8221;. If you do this, you will see the raw hex data for the DNAME RR (type 0&#215;27). The only thing you can do with it in the graphical tool is delete it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewgdotcom.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewgdotcom.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewgdotcom.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewgdotcom.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/andrewgdotcom.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/andrewgdotcom.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/andrewgdotcom.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/andrewgdotcom.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewgdotcom.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewgdotcom.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewgdotcom.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewgdotcom.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewgdotcom.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewgdotcom.wordpress.com/101/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewgdotcom.wordpress.com&amp;blog=416750&amp;post=101&amp;subd=andrewgdotcom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewgdotcom.wordpress.com/2010/12/16/how-to-create-a-dname-record-in-server-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d118c29950aad6293423a630477d2db7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andrewgdotcom</media:title>
		</media:content>
	</item>
		<item>
		<title>More JIRA shenanigans</title>
		<link>http://andrewgdotcom.wordpress.com/2010/10/22/more-jira-shenanigans/</link>
		<comments>http://andrewgdotcom.wordpress.com/2010/10/22/more-jira-shenanigans/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 18:05:50 +0000</pubDate>
		<dc:creator>andrewgdotcom</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[jira]]></category>
		<category><![CDATA[jira database values plugin]]></category>
		<category><![CDATA[jss]]></category>
		<category><![CDATA[jython]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://andrewgdotcom.wordpress.com/?p=92</guid>
		<description><![CDATA[As part of my ongoing project to put every management process possible onto JIRA, I have been working on a way to make our internal account codes smarter. Previously, I was using a custom field with predefined values for each account code &#8211; this worked well until I wanted to automate certain tests and actions [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewgdotcom.wordpress.com&amp;blog=416750&amp;post=92&amp;subd=andrewgdotcom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As part of my ongoing project to put every management process possible onto JIRA, I have been working on a way to make our internal account codes smarter. Previously, I was using a custom field with predefined values for each account code &#8211; this worked well until I wanted to automate certain tests and actions based on account code metadata such as project start/end dates and approval matrices (<a href="http://jira.atlassian.com/browse/JRA-2983">this issue</a> was also a significant problem). Two methods sprung to mind: either I could define a custom field that could contain structured data, or I could implement the account codes as Jira issues and use issue linking. In my solution I ended up doing a bit of both.</p>
<p>The advantage of using JIRA issues to store account codes is twofold: firstly I can define whatever custom fields I require to hold structured data (e.g. budget holder userids, timestamps) in a format that JIRA can easily understand; and secondly the financial administrators and I can manage this data through a familiar interface. The big disadvantage is that issue linking in JIRA is done through a separate interface from issue creation/editing, meaning a two-stage process for my users. The ideal solution would be a drop-down menu in the issue creation/editing screen, but this means using a custom field &#8211; and one I would probably have to write myself.</p>
<p>Being a typical sysadmin, I decided to hack something together with sticky tape and string. I found a likely-looking custom field in the form of the <a href="https://studio.plugins.atlassian.com/browse/JDVP">JIRA Database Values Plugin</a>. Using this to tap directly into JIRA&#8217;s back-end database I can populate a drop-down menu using some horrendous left joins:</p>
<blockquote><p>sql.query=select i.id, cv1.stringvalue, cv2.stringvalue, cv3.stringvalue from (select id from jiraissue where project=10200 and issuetype=13) as i left join (select issue, stringvalue from customfieldvalue where customfield=10140) as cv1 on i.id=cv1.issue left join (select issue, stringvalue from customfieldvalue where customfield=10141) as cv2 on i.id=cv2.issue left join (select issue, stringvalue from customfieldvalue where customfield=10142) as cv3 on i.id=cv3.issue order by cv2.stringvalue, cv3.stringvalue;</p>
<p>primarykey.column.number=0<br />
rendering.viewpattern={1,(none)} {2} {3}</p></blockquote>
<p>The joins are necessary because JIRA uses a relational back end which assumes a fixed number of columns in each table. It handles issues with custom-defined fields by storing the custom field values in a separate table with back-references to the appropriate row in the main table.</p>
<p>The JDVP plugin provides a pretty front end to a custom field that stores the primary key of a database row, which in this case is jiraissue.id. I can then recall the account code issue in a <a href="https://plugins.atlassian.com/plugin/details/16346">JSS</a> script by passing the primary key to getIssueObject() &#8211; the example below is a post-function that I use in an approval workflow to ensure that nobody can approve his own request:</p>
<pre>from com.atlassian.jira import ComponentManager

# Only perform functions on Travel Request issues
if(issue.getIssueTypeObject().getId()=="8") :
  cm = ComponentManager.getInstance()
  cfm = cm.getCustomFieldManager()
  im = cm.getIssueManager()

  accountCodeID = issue.getCustomFieldValue(cfm.getCustomFieldObject('customfield_10134'))
  acIssue = im.getIssueObject(int(accountCodeID))
  acBudgetHolder = acIssue.getCustomFieldValue(cfm.getCustomFieldObject('customfield_10070'))
  acEmergencyBudgetHolder = acIssue.getCustomFieldValue(cfm.getCustomFieldObject('customfield_10151'))

  # Set the budget holder to the account code's budget holder, unless that is the reporter.
  # The Java API for custom fields is crap. I'm using a trick here.
  # http://confluence.atlassian.com/pages/viewpage.action?pageId=160835&amp;focusedCommentId=224398519&amp;#comment-224398519
  # DO NOT USE issue.setCustomFieldValue() - it does NOT persist. This is a feature (!)

  cf=cfm.getCustomFieldObject('customfield_10070')
  if issue.getReporter() == acBudgetHolder :
    cf.getCustomFieldType().updateValue(cf,issue,acEmergencyBudgetHolder)
  else :
    cf.getCustomFieldType().updateValue(cf,issue,acBudgetHolder)</pre>
<p>I have two things to say about the above. Firstly, scripts in a language where leading whitespace is significant are very difficult to post to blogs. Secondly, I meant everything I said about the custom fields API. In my previous post, I complained about the Java standard library requiring double references &#8211; well here&#8217;s another example. Read the last ten lines and try to tell me that the developer in question was sober when he designed the interface.</p>
<p>This does exactly what I want (like all good sticky-tape solutions should). The only thing the JDVP did that annoyed me was to always render &#8220;Unknown&#8221; (or the localisation equivalent) in the case that one of my database fields contained NULL (some of our accounting codes have optional subcodes, for example). After discussions with the developer, I submitted a patch which made the NULL behaviour configurable, and he has included it in the latest release. Thanks, Wim.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewgdotcom.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewgdotcom.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewgdotcom.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewgdotcom.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/andrewgdotcom.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/andrewgdotcom.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/andrewgdotcom.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/andrewgdotcom.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewgdotcom.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewgdotcom.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewgdotcom.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewgdotcom.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewgdotcom.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewgdotcom.wordpress.com/92/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewgdotcom.wordpress.com&amp;blog=416750&amp;post=92&amp;subd=andrewgdotcom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewgdotcom.wordpress.com/2010/10/22/more-jira-shenanigans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d118c29950aad6293423a630477d2db7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andrewgdotcom</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting Jira to enforce a date field is in the future on issue creation</title>
		<link>http://andrewgdotcom.wordpress.com/2010/08/06/getting-jira-to-enforce-a-date-field-is-in-the-future-on-issue-creation/</link>
		<comments>http://andrewgdotcom.wordpress.com/2010/08/06/getting-jira-to-enforce-a-date-field-is-in-the-future-on-issue-creation/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 18:12:42 +0000</pubDate>
		<dc:creator>andrewgdotcom</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jira]]></category>
		<category><![CDATA[jython]]></category>
		<category><![CDATA[timestamp]]></category>
		<category><![CDATA[validator]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://andrewgdotcom.wordpress.com/?p=84</guid>
		<description><![CDATA[As part of a new Jira process I am developing, I need to ensure that the date stored in a certain custom field is in the future. I was using the &#8220;compare date and time&#8221; validator for this, checking to see that the value of the custom field was greater than or equal to that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewgdotcom.wordpress.com&amp;blog=416750&amp;post=84&amp;subd=andrewgdotcom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As part of a new Jira process I am developing, I need to ensure that the date stored in a certain custom field is in the future. I was using the &#8220;compare date and time&#8221; validator for this, checking to see that the value of the custom field was greater than or equal to that of the issue Created field. This was working well while I was using it on a standard workflow transition, but it bothered me that the user needed to create an issue and then immediately transition it in order for the validation to work. My users are a technical lot, but even they are likely to forget the second step of the process.</p>
<p>You can use validators on the Create Issue transition (if you can find it -  go to the initial step of your workflow and look for &#8220;incoming transitions&#8221;), but the technique I was using doesn&#8217;t work, as the Created field isn&#8217;t updated until after the validator is processed and I was thus comparing with Null. I have Misc Workflow Extensions, Jira Suite Utilities and Jira Toolkit installed, but none provided a validator that would compare a date field with anything other than another date field. Luckily I also have the <a href="https://plugins.atlassian.com/plugin/details/16346">Jira Scripting Suite</a> installed, and I thought this would be a trivial use case. Grab the custom field data using a jython one-liner and compare with the system date.</p>
<p>It wasn&#8217;t so simple. Jira returns date custom field values as java.sql.Timestamp objects, which are nontrivial to compare with jython date objects. I then tried using java.util.Calendar instead of the native jython datetime library, thinking that a java.util.Date would be more easily compared with a java.sql.Timestamp because they implement the same interface. This is technically true, but I didn&#8217;t want to compare instantaneous times, only dates, and there is no native method for extracting a date-only component (as a Julian date, say) from a java.util.Date object. One might expect to be able to obtain the raw timestamp data and discard the fractional day components (say, by performing an integer division), but this falls foul of time zones.</p>
<p>Jira treats dates as timestamps with zeroed time-of-day components, but the database backend stores this as milliseconds since the Epoch, and this is what is returned in the Timestamp object. A bare date is thus stored as the timestamp of the immediately previous <strong>local</strong> midnight. In the case of Ireland in summertime, this will cause an off-by-one error in the algorithm if one naïvely performs an integer division by the number of milliseconds in a day. To find the correct number of <strong>local</strong> days since the Epoch, one must add the current timezone offset to both timestamps before discarding fractional days. The resulting algorithm is thus far from the desired one-liner:</p>
<pre>from com.atlassian.jira import ComponentManager
from java.util import Calendar

cfm = ComponentManager.getInstance().getCustomFieldManager()
leavingDate = issue.getCustomFieldValue(cfm.getCustomFieldObject('customfield_10072'))
today = Calendar.getInstance()
tzoffset = today.getTimeZone().getOffset(today.getTimeInMillis())
leavingDateEpoch = (leavingDate.getTime()+tzoffset)//86400000
todayEpoch = (today.getTimeInMillis()+tzoffset)//86400000

if leavingDateEpoch &lt; todayEpoch :
 result = False
 description = "Leaving date cannot be in the past"
 invalid_fields['customfield_10072'] = u"Leaving date cannot be in the past"</pre>
<p>It works, but it&#8217;s damn ugly. I particularly love the double reference to the <em>today</em> object in line 7. How the Java standard library manages to be so verbose and still so lacking in basic functionality is beyond me. They actually seem to be going in the wrong direction &#8211; I found this wonderful piece of documentation on my travels:</p>
<pre>int     Date.getTimezoneOffset()
Deprecated. As of JDK version 1.1, replaced by
-(Calendar.get(Calendar.ZONE_OFFSET) + Calendar.get(Calendar.DST_OFFSET)) / (60 * 1000)</pre>
<p>Says it all, really.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewgdotcom.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewgdotcom.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewgdotcom.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewgdotcom.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/andrewgdotcom.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/andrewgdotcom.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/andrewgdotcom.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/andrewgdotcom.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewgdotcom.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewgdotcom.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewgdotcom.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewgdotcom.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewgdotcom.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewgdotcom.wordpress.com/84/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewgdotcom.wordpress.com&amp;blog=416750&amp;post=84&amp;subd=andrewgdotcom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewgdotcom.wordpress.com/2010/08/06/getting-jira-to-enforce-a-date-field-is-in-the-future-on-issue-creation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d118c29950aad6293423a630477d2db7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andrewgdotcom</media:title>
		</media:content>
	</item>
		<item>
		<title>How to upgrade Debian etch with kernel 2.4</title>
		<link>http://andrewgdotcom.wordpress.com/2010/06/25/how-to-upgrade-debian-etch-with-kernel-2-4/</link>
		<comments>http://andrewgdotcom.wordpress.com/2010/06/25/how-to-upgrade-debian-etch-with-kernel-2-4/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 12:51:27 +0000</pubDate>
		<dc:creator>andrewgdotcom</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[etch]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[udev]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://andrewgdotcom.wordpress.com/?p=80</guid>
		<description><![CDATA[The change to udev badly broke the Debian upgrade pathway from etch to lenny and above. If you are still running a 2.4 kernel when you try to upgrade, you can easily be left without any kernel at all. The &#8220;official&#8221; way to do it is to first add the etch repositories and upgrade to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewgdotcom.wordpress.com&amp;blog=416750&amp;post=80&amp;subd=andrewgdotcom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The change to udev badly broke the Debian upgrade pathway from etch to lenny and above. If you are still running a 2.4 kernel when you try to upgrade, you can easily be left without any kernel at all. The &#8220;official&#8221; way to do it is to first add the etch repositories and upgrade to etch&#8217;s 2.6 kernel, then reboot into your udev-capable kernel before continuing. Now that the etch repositories have gone, this is quite difficult.</p>
<p>But not impossible! You just can&#8217;t do it from within a running system. Instructions follow:</p>
<ol>
<li>add the lenny (or later) repositories to /etc/apt/sources.list and run `apt-get update`</li>
<li>reboot into a lenny (or later) install CD</li>
<li>choose advanced -&gt; rescue mode</li>
<li>answer the usual install/config questions &#8211; don&#8217;t worry about networking for now</li>
<li>execute a shell in the target environment *</li>
<li>`ifup eth0` (or whatever you need to get networking running)</li>
<li>`export TERM=vt100` (because bterm is badly broken)</li>
<li>`apt-get install linux-image-2.6.26-2-686` (or whatever kernel is appropriate)</li>
<li>reboot and do `apt-get dist-upgrade`</li>
</ol>
<p>(*) The installer may not automatically mount your root partition &#8211; if so then you won&#8217;t be able to execute a shell in the target environment. In that case:</p>
<ol>
<li>start a shell in the installer environment</li>
<li>mount your root partition somewhere by hand (this may be nontrivial if you&#8217;re using LVM!)</li>
<li>cd into it</li>
<li>`mount -t proc proc proc`</li>
<li>`chroot .`</li>
</ol>
<p>You now have a shell in the target environment.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewgdotcom.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewgdotcom.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewgdotcom.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewgdotcom.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/andrewgdotcom.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/andrewgdotcom.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/andrewgdotcom.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/andrewgdotcom.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewgdotcom.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewgdotcom.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewgdotcom.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewgdotcom.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewgdotcom.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewgdotcom.wordpress.com/80/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewgdotcom.wordpress.com&amp;blog=416750&amp;post=80&amp;subd=andrewgdotcom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewgdotcom.wordpress.com/2010/06/25/how-to-upgrade-debian-etch-with-kernel-2-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d118c29950aad6293423a630477d2db7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andrewgdotcom</media:title>
		</media:content>
	</item>
		<item>
		<title>How many notes in an octave?</title>
		<link>http://andrewgdotcom.wordpress.com/2009/11/10/how-many-notes-in-an-octave/</link>
		<comments>http://andrewgdotcom.wordpress.com/2009/11/10/how-many-notes-in-an-octave/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 23:57:06 +0000</pubDate>
		<dc:creator>andrewgdotcom</dc:creator>
				<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://andrewgdotcom.wordpress.com/?p=67</guid>
		<description><![CDATA[Short answer? As many as you like. But some choices are better than others. The common &#8220;western&#8221; system is known as 12-TET (12-tone equal temperament), which is a modification of earlier geometrical tunings (such as the Pythagorean and quarter-comma meantone temperaments) where the frequency of each note is defined in terms of a simple ratio [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewgdotcom.wordpress.com&amp;blog=416750&amp;post=67&amp;subd=andrewgdotcom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Short answer? As many as you like. But some choices are better than others. The common &#8220;western&#8221; system is known as 12-TET (<a href="https://secure.wikimedia.org/wikipedia/en/wiki/Equal_temperament">12-tone equal temperament</a>), which is a modification of earlier geometrical tunings (such as the Pythagorean and quarter-comma meantone temperaments) where the frequency of each note is defined in terms of a simple ratio with respect to a reference note (the frequencies of C and G are in the ratio 2:3, for example). There are problems with such systems &#8211; frequency ratios between arbitrary notes are not simple in general, and any geometrical tuning system will have a <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Wolf_interval">wolf interval</a>, whose dissonant sound must be avoided in musical composition.</p>
<p>By contrast, &#8220;equal temperament&#8221; systems define the frequency ratio between any two adjacent notes to be a constant, but this constant cannot be a rational number and note frequencies which were once simple ratios of each other are now very slightly detuned. Analogue instruments have a natural variability in their tuning, so this slight &#8220;error&#8221; usually goes unnoticed.</p>
<p>The division of the octave into twelve equal intervals is a natural progression of the 12-interval Pythagorean system, but is not the only one. The &#8220;ideal&#8221; tuning system is one where all intervals are based on simple frequency ratios, but this is impossible to realise in practise without either providing an infinite number of notes or severely limiting the musical range of one&#8217;s compositions. Many of these ideal intervals are very badly approximated by 12-TET, notably the minor third (the interval between C and E♭). <a href="https://secure.wikimedia.org/wikipedia/en/wiki/31_equal_temperament">31-TET</a> is a better match overall, however it more than doubles the number of notes required on an instrument, and many of these will not be used in the vast majority of compositions because they do not approximate a useful interval.</p>
<p>Compromise tunings which do not require so many redundant notes include the alien-sounding <a href="https://secure.wikimedia.org/wikipedia/en/wiki/22_equal_temperament">22-TET</a> and the more mellow <a href="https://secure.wikimedia.org/wikipedia/en/wiki/19_equal_temperament">19-TET</a>. The latter gives improved major (C-E) and minor (C-E♭) thirds compared to 12-TET, at the expense of a slightly less accurate fifth (C-G). It also has few enough notes that 19-TET instruments are quite practical to construct and play. I had to try.</p>
<div id="attachment_68" class="wp-caption alignleft" style="width: 310px"><a href="http://andrewgdotcom.files.wordpress.com/2009/11/20071018382.jpg"><img class="size-medium wp-image-68" title="19TET refretted Encore strat copy" src="http://andrewgdotcom.files.wordpress.com/2009/11/20071018382.jpg?w=300&#038;h=225" alt="19TET refretted Encore strat copy" width="300" height="225" /></a><p class="wp-caption-text">19TET refretted Encore strat copy</p></div>
<p>I refretted this guitar two years ago and forgot to blog about it at the time. I was fully convinced that I had, up until the point when I tried to find the appropriate link to help spice up my entry into <a href="http://www.totalapps.net/quicktip/win-guitar-rig-4-pro-software/">this competition</a>. I&#8217;m addressing my earlier failing now.</p>
<p>I have three guitars, though technically one of them belongs to my brother. The cheapest and crappest of my two was duly sacrificed in the name of science. I bought a fretsaw and obtained a length of fretwire from a local instrument repair shop. The existing frets on the guitar were easy enough to prise out of their grooves, and new grooves in the appropriate places* were easy to cut. To cut down my workload, I only refretted one octave worth of the neck &#8211; this isn&#8217;t as big a sacrifice as it sounds, as the 19-TET fret spacing close to the body would be far too narrow to play comfortably. The biggest difficulty came in cutting and shaping the new frets &#8211; I ended up having to file off a few offending corners and in doing so scratched the edges of the fretboard. Overall I&#8217;m pleased with the result though &#8211; it plays easily and looks just like a &#8220;real&#8221; guitar until you get too close.</p>
<p>How do you adjust your playing style to a completely different fretboard?  The pearl inlays from its 12-TET days are still present, and provide a useful visual clue for where the fingers should go. If that doesn&#8217;t work, I usually just fiddle with the chords until it sounds right. As a rule of thumb, anything requiring a one-fret interval should now use two, and a two-fret interval becomes three.</p>
<p>One advantage that 19-TET has over (say) 22-TET is that standard music terminology can be (ab)used. The white-note names are unchanged, black flats and sharps are now distinct notes (C♯ is not D♭), and B♯=C♭ and E♯=F♭ are now notes in their own right:</p>
<pre>C C♯ D♭ D D♯ E♭ E (E♯=F♭) F F♯
  G♭ G G♯ A♭ A A♯ B♭ B (B♯=C♭) C</pre>
<p>If you are familiar with the piano, imagine that each black note has been replaced by two black notes, and the gaps between B-C and E-F are now filled by one black note each.</p>
<p>How does it sound, I hear you ask? Unfortunately I can&#8217;t make you a recording at the moment, as the bridge recently came apart (someone remind me to go to the repair shop this weekend please?). However, some fantastic examples of 19-TET music can be found on <a href="http://www.parnasse.com/jh/blog/">Jeff Harrington</a>&#8216;s site &#8211; my favourite is <a href="http://www.harrington.lunarpages.com/mp3/Jeff-Harrington_Prelude_3_for_19ET_Piano.mp3">this one</a>. He&#8217;s a much better musician than me anyway.</p>
<p>* D(n) = D(0)/2^(n/19) where the distances D are measured from the bridge and D(0) is the distance to the nut.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewgdotcom.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewgdotcom.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewgdotcom.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewgdotcom.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/andrewgdotcom.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/andrewgdotcom.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/andrewgdotcom.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/andrewgdotcom.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewgdotcom.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewgdotcom.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewgdotcom.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewgdotcom.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewgdotcom.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewgdotcom.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewgdotcom.wordpress.com&amp;blog=416750&amp;post=67&amp;subd=andrewgdotcom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewgdotcom.wordpress.com/2009/11/10/how-many-notes-in-an-octave/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://www.harrington.lunarpages.com/mp3/Jeff-Harrington_Prelude_3_for_19ET_Piano.mp3" length="4159616" type="audio/mpeg" />
	
		<media:content url="http://1.gravatar.com/avatar/d118c29950aad6293423a630477d2db7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andrewgdotcom</media:title>
		</media:content>

		<media:content url="http://andrewgdotcom.files.wordpress.com/2009/11/20071018382.jpg?w=300" medium="image">
			<media:title type="html">19TET refretted Encore strat copy</media:title>
		</media:content>
	</item>
		<item>
		<title>Best 419 scam yet.</title>
		<link>http://andrewgdotcom.wordpress.com/2009/09/23/best-419-scam-yet/</link>
		<comments>http://andrewgdotcom.wordpress.com/2009/09/23/best-419-scam-yet/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 09:11:55 +0000</pubDate>
		<dc:creator>andrewgdotcom</dc:creator>
				<category><![CDATA[email]]></category>

		<guid isPermaLink="false">http://andrewgdotcom.wordpress.com/2009/09/23/best-419-scam-yet/</guid>
		<description><![CDATA[我有新的電郵地址！ 你現可電郵給我：thomasjoe3313@yahoo.com.hk - As you are aware of the activities of terrorist attacked at our airport,during our daily routine on 100% inspection of incoming and our going flights, we arrested a man with a consignment that claiming to be yourpartner, after we scan thetrunk box, we discovered the trunk box contain liquid cash in [US] [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewgdotcom.wordpress.com&amp;blog=416750&amp;post=66&amp;subd=andrewgdotcom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>我有新的電郵地址！<br />
你現可電郵給我：thomasjoe3313@yahoo.com.hk</p>
<p>- As you are aware of the activities of terrorist attacked at our airport,during our daily routine on 100% inspection of incoming and our going flights, we arrested a man with a consignment that claiming to be yourpartner, after we scan thetrunk box, we discovered the trunk box contain liquid cash in [US] Note and other documents attached to the consignmentdid not carry the suspect name, but carry your name and address as the receivers of the trunk box and this is very SUSPICIOUS.Get back to me immediately to explain your intention; before I proceed to contact my superior and your embassyfor more investigation, hope you arenot sponsoring terrorism with this fund? be very sincere to me please.Yours in service,a Office of Thomas joe,Metropolitan police chief.Heathrow Airport UK.EMAIL mrallen92@hotmail.com</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewgdotcom.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewgdotcom.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewgdotcom.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewgdotcom.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/andrewgdotcom.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/andrewgdotcom.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/andrewgdotcom.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/andrewgdotcom.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewgdotcom.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewgdotcom.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewgdotcom.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewgdotcom.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewgdotcom.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewgdotcom.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewgdotcom.wordpress.com&amp;blog=416750&amp;post=66&amp;subd=andrewgdotcom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewgdotcom.wordpress.com/2009/09/23/best-419-scam-yet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d118c29950aad6293423a630477d2db7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andrewgdotcom</media:title>
		</media:content>
	</item>
		<item>
		<title>Insecure by design</title>
		<link>http://andrewgdotcom.wordpress.com/2009/08/13/insecure-by-design/</link>
		<comments>http://andrewgdotcom.wordpress.com/2009/08/13/insecure-by-design/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 17:41:38 +0000</pubDate>
		<dc:creator>andrewgdotcom</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://andrewgdotcom.wordpress.com/?p=62</guid>
		<description><![CDATA[I came across an article today that lifted my spirits: 100% Verifiable Bug-Free Code Is Possible (Dobbs Code) The executive summary: ok-labs.com and nicta.com.au have developed a microkernel that is provably correct, in defiance of the conventional wisdom that formal methods are only practical for the simplest of projects. While I take my hat off [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewgdotcom.wordpress.com&amp;blog=416750&amp;post=62&amp;subd=andrewgdotcom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I came across an article today that lifted my spirits:</p>
<p><a href="http://dobbscodetalk.com/index.php?option=com_myblog&amp;show=100-Verifiable-Bug-Free-Code-Is-Possible.html&amp;Itemid=29">100% Verifiable Bug-Free Code Is Possible (Dobbs Code)</a></p>
<p>The executive summary: ok-labs.com and nicta.com.au have developed a microkernel that is <em>provably correct</em>, in defiance of the conventional wisdom that formal methods are only practical for the simplest of projects. While I take my hat off to the developers for their heroic efforts, I firmly believe this is only the first step in a process that will revolutionise the industry. The ultimate goal should be a complete, <em>provably correct</em> computing platform. This will not come about quickly or easily, but there are practical things we can do in the meantime.</p>
<p>Recently, the SANS Institute published a list of the <a title="Top 20 Programming Errors" href="http://www.sans.org/top25errors/">25 most dangerous programming errors</a>. Most of these, e.g. buffer overflows, are rookie mistakes that every apprentice programmer is warned about, yet even with better training and increased collective experience, the population of errors in the wild seems to increase daily. The reason is simple: as the number of programmers grows, and their productivity increases, the number of opportunities for errors to creep in grows faster than the ability of the human mind to be vigilant. Or to paraphrase Murphy&#8217;s Law: if a programmer <em>can</em> make mistakes, he <em>will</em> make mistakes.</p>
<p>The conventional wisdom is to accept that such errors will be made, and be vigilant in testing. But no amount of post-facto investigation can give us 100% confidence that a catastrophic error doesn&#8217;t lurk somewhere in the code. With software increasingly responsible for people&#8217;s lives (fly-by-wire aircraft, nuclear power), the potential consequences of code errors will become unmanageable. Let me demonstrate.</p>
<p>The standard equation of risk analysis is</p>
<pre>risk = probability × severity</pre>
<p>What this means in practice is that in order to maintain risk below a given maximum, any event that has N times more severe consequences (e.g. a plane crash that kills 10 times more people than a car crash) should happen N times less often. But going from 99.999% (five nines) certainty to 99.9999% (six nines) is a lot harder than going from 99% to 99.9%, due to diminishing returns. Throwing man-hours of testing at such a problem does not scale.</p>
<p>Formal methods give us a way around this impasse. But we do not even need the expense of formal testing to eliminate the most common errors &#8211; design choices in our programming languages can do a lot of the work for little cost. Consider the state of the art before the introduction of structured programming in Algol-60. Without nested loops or multi-line conditions, the GOTO statement was king. GOTO-based programming languages are Turing-complete, in that they can perform any conceivable algorithm, but they are <em>too</em> flexible. It is quite possible (and easy) to write nonsense algorithms where loops would start or end inside the ELSE block of an IF statement, for example*. No modern programmer would contemplate such absurdities &#8211; there was a very good reason why GOTO statements were banished from polite society. And yet programming languages without GOTO statements are still Turing-complete.</p>
<p>What the above history lesson shows us is that, given sufficiently intelligent design paradigms, we can remove once-thought-necessary features from our lexicon <em>without sacrificing Turing completeness</em>, and thereby eliminate <em>entire classes</em> of potential programming errors.**</p>
<p>Now consider buffer overflow &#8211; this can be generalised to all kinds of array bounds violation; a buffer being merely a 1D array. The array index is constrained between two values, typically 0 and some integer N. If the algorithm attempts to access the array with an index outside this range, we have an array bounds violation. If this is not tested for explicitly by the algorithm (easy for a stressed programmer to forget) or implicitly in the execution environment (inefficient and not always enabled) undesirable behaviour can easily result. We could laboriously check every subscription operation in our algorithm to ensure that sane values were being passed at all times; or we could change our programming paradigm so that it is impossible to write an invalid subscription operation.</p>
<p>This is not as outlandish as it sounds &#8211; we already have a commonly-used language feature that does most of the work for us: FOREACH. A FOREACH loop iterates over the elements of an array, and automatically stops when there are no more elements. We cannot pass an invalid value into the array subscription operation, because there is no such operation; subscription is handled implicitly by the FOREACH. If all buffer operations used FOREACH statements, there would never be an overflow.</p>
<p>Now say that at some point in the near future we find similar, <em>implicit</em>, methods for array subscription that cover <em>all</em> sensible use cases (in the same way we found alternatives for all sensible use cases of GOTO). We could then eliminate the explicit array subscription operation from our lexicon, and buffer overflows would be a historical curiosity.</p>
<p>I think such a development is within reach. Like many programming geeks I have been working, on and off, for some time on a pet language project which, amongst other things, features strict limitations on the array subscription operator, as well as a plethora of implicit alternatives to handle common use cases. I haven&#8217;t yet been able to eliminate subscription completely, but all ideas would be gratefully received.</p>
<p>* This is a real example from personal experience, which shockingly did work but was (unsuprisingly) impossible to understand.<br />
** Of course, if the language is still Turing-complete, it will therefore still be possible to make the same error; but you will have to go out of your way to deliberately do so.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewgdotcom.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewgdotcom.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewgdotcom.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewgdotcom.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/andrewgdotcom.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/andrewgdotcom.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/andrewgdotcom.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/andrewgdotcom.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewgdotcom.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewgdotcom.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewgdotcom.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewgdotcom.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewgdotcom.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewgdotcom.wordpress.com/62/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewgdotcom.wordpress.com&amp;blog=416750&amp;post=62&amp;subd=andrewgdotcom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewgdotcom.wordpress.com/2009/08/13/insecure-by-design/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d118c29950aad6293423a630477d2db7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andrewgdotcom</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows Script Host error 800c0019 (VBScript)</title>
		<link>http://andrewgdotcom.wordpress.com/2009/07/30/windows-script-host-error-800c0019-vbscript/</link>
		<comments>http://andrewgdotcom.wordpress.com/2009/07/30/windows-script-host-error-800c0019-vbscript/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 14:13:49 +0000</pubDate>
		<dc:creator>andrewgdotcom</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[server 2008]]></category>
		<category><![CDATA[vbscript]]></category>
		<category><![CDATA[wsh]]></category>

		<guid isPermaLink="false">http://andrewgdotcom.wordpress.com/2009/07/30/windows-script-host-error-800c0019-vbscript/</guid>
		<description><![CDATA[Came across this gem today on a machine that had recently been upgraded to Server 2008: Error: System error: -2146697191 Code: 800C0019 Source: msxml3.dll Turns out that a custom VBScript was sending a form to one of our secure web servers and the certificate chain couldn&#8217;t be verified up to the root (even though we [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewgdotcom.wordpress.com&amp;blog=416750&amp;post=61&amp;subd=andrewgdotcom&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Came across this gem today on a machine that had recently been upgraded to Server 2008:</p>
<p>Error: System error: -2146697191<br />
Code: 800C0019<br />
Source: msxml3.dll</p>
<p>Turns out that a custom VBScript was sending a form to one of our secure web servers and the certificate chain couldn&#8217;t be verified up to the root (even though we bought it from a reputable source). Adding the offending root certificate to the trusted root certificate authorities database fixed the problem.</p>
<p>This does not seem to be documented anywhere on the internet yet, so here it is.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/andrewgdotcom.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/andrewgdotcom.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/andrewgdotcom.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/andrewgdotcom.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/andrewgdotcom.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/andrewgdotcom.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/andrewgdotcom.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/andrewgdotcom.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/andrewgdotcom.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/andrewgdotcom.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/andrewgdotcom.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/andrewgdotcom.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/andrewgdotcom.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/andrewgdotcom.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=andrewgdotcom.wordpress.com&amp;blog=416750&amp;post=61&amp;subd=andrewgdotcom&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://andrewgdotcom.wordpress.com/2009/07/30/windows-script-host-error-800c0019-vbscript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d118c29950aad6293423a630477d2db7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">andrewgdotcom</media:title>
		</media:content>
	</item>
	</channel>
</rss>
