<?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>Stickblog</title>
	<atom:link href="http://the-stickman.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://the-stickman.com</link>
	<description>Random developer notes</description>
	<lastBuildDate>Wed, 10 Mar 2010 15:11:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PayPal Error: Sorry, an Error Occurred After You Clicked the Last Link</title>
		<link>http://the-stickman.com/uncategorized/paypal-error-sorry-an-error-occurred-after-you-clicked-the-last-link/</link>
		<comments>http://the-stickman.com/uncategorized/paypal-error-sorry-an-error-occurred-after-you-clicked-the-last-link/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 15:09:24 +0000</pubDate>
		<dc:creator>Stickman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://the-stickman.com/uncategorized/paypal-error-sorry-an-error-occurred-after-you-clicked-the-last-link/</guid>
		<description><![CDATA[I&#8217;m just coming to the end of a project that required checkout via PayPal. The system is to be hosted in an iframe embedded in a third party site&#8217;s page, but when redirecting to PayPal the iframe &#8216;pops out&#8217; to take over the whole page (PayPal forces this behaviour).
All was working smoothly using the &#8216;PayPal [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m just coming to the end of a project that required checkout via PayPal. The system is to be hosted in an iframe embedded in a third party site&#8217;s page, but when redirecting to PayPal the iframe &#8216;pops out&#8217; to take over the whole page (PayPal forces this behaviour).</p>
<p>All was working smoothly using the &#8216;PayPal sandbox&#8217; testing domain, but when it came to testing a live transaction in Internet Explorer I received the following error:</p>
<p>&#8220;Sorry, an Error Occurred After You Clicked the Last Link&#8221;</p>
<p>&#8230;followed by a lengthy but rather unhelpful block of text suggesting various courses of action &#8212; none of which was any use at all.</p>
<p><a href="http://www.google.co.uk/search?q=paypal+%22Sorry,+an+error+occurred+after+you+clicked+the+last+link%22">Consulting Google</a>, it seems that this is far from an unusual occurrence but there&#8217;s little consensus as to the cause. In the end, I tried adding target=&#8221;_top&#8221; to the form that submits to PayPal (thus forcing the &#8216;pop-out&#8217; of the iframe), and presto, all is now fine again.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-stickman.com/uncategorized/paypal-error-sorry-an-error-occurred-after-you-clicked-the-last-link/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS: Removing that dotted line around a link</title>
		<link>http://the-stickman.com/web-development/css-removing-that-dotted-line-around-a-link/</link>
		<comments>http://the-stickman.com/web-development/css-removing-that-dotted-line-around-a-link/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 09:44:06 +0000</pubDate>
		<dc:creator>Stickman</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://the-stickman.com/?p=219</guid>
		<description><![CDATA[Just a quick note to myself&#8230;
I&#8217;m working on a navigation system that uses CSS image replacement. To hide the text, CSS shifts it out of view by using the text-indent property and a big negative value. However, a side-effect of this is that when you click on a link, the dotted border that appears while [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick note to myself&#8230;</p>
<p>I&#8217;m working on a navigation system that uses CSS image replacement. To hide the text, CSS shifts it out of view by using the <em>text-indent</em> property and a big negative value. However, a side-effect of this is that when you click on a link, the dotted border that appears while you&#8217;re holding the mouse button down goes off the side of the page.</p>
<p>To get around this, I just wanted to disable it. After some searching I discovered the <em>outline</em> property &#8212; setting this to &#8216;none&#8217; gets rid of it entirely:</p>
<p><code>a{<br />
outline: none;<br />
}</code></p>
<p>Of course, the above will remove it for all links, it&#8217;s up to you to decide whether you want to make it more specific.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-stickman.com/web-development/css-removing-that-dotted-line-around-a-link/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Converting latitude and longitude coordinates to map x and y values</title>
		<link>http://the-stickman.com/uncategorized/converting-latitude-and-longitude-coordinates-to-map-x-and-y-values/</link>
		<comments>http://the-stickman.com/uncategorized/converting-latitude-and-longitude-coordinates-to-map-x-and-y-values/#comments</comments>
		<pubDate>Tue, 19 May 2009 08:37:18 +0000</pubDate>
		<dc:creator>Stickman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://the-stickman.com/?p=212</guid>
		<description><![CDATA[I&#8217;m currently working on a project to convert an existing Flash map, which uses location data that&#8217;s been manually entered and maintained, to use data that comes from a database and uses latitude and longitude values. The original data is stored in an XML file so updating it dynamically is not a problem but as [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently working on a project to convert an existing Flash map, which uses location data that&#8217;s been manually entered and maintained, to use data that comes from a database and uses latitude and longitude values. The original data is stored in an XML file so updating it dynamically is not a problem but as you&#8217;ll know if you&#8217;ve ever tried it, plotting latitude and longitude values on a map isn&#8217;t as simple as it might sound.</p>
<p>Briefly, the problem arises from the fact that the world is a sphere and representing it in two dimensions is not a straightforward task. There are various &#8216;projections&#8217; to choose from, each of which uses a different method for mapping points &#8212; you can find out more in <a href="http://en.wikipedia.org/wiki/Map_projection">this Wikipedia article</a>. The most common choice is the <a href="http://en.wikipedia.org/wiki/Mercator_projection">Mercator projection</a>, where lines of latitude are spaced equally, and fortunately for me it&#8217;s the type of map used in the project I&#8217;m working on.</p>
<p>So, being somewhat mathematically inept, I decided that Google would save me from a day&#8217;s head-scratching. That turned out not to be the case, as I tried a good half-dozen different suggestions before finally stumbling across one that actually produced accurate results. To save others from the same fate I decided to reproduce here the code I ended up with, which is based heavily on code found in <a href="http://groups.google.com/group/Google-Maps-API/browse_thread/thread/a45947d72c27cc73#d21b6238fae63a7c">this newsgroup post</a>. My implementation is PHP, but it shouldn&#8217;t be hard to convert it to another platform (see the original thread for a Javascript implementation). Apologies for the rubbish formatting, WordPress isn&#8217;t great at handling code:</p>
<pre>function LongitudeToX( $lat, $lon, $map_zoom, $scale_value, $x_offset = 0 )
{
  $offset=16777216;
  $radius=$offset / pi();
  return ( ( ($offset+$radius*$lon*pi()/180)&gt;&gt;$map_zoom ) * $scale_value ) + $x_offset;
}
function LatitudeToY( $lat, $lon, $map_zoom, $scale_value, $y_offset = 0 )
{
  $offset=16777216;
  $radius=$offset / pi();
  return ( ( ($offset-$radius*log((1+sin($lat*pi()/180))/(1-sin($lat*pi()/180)))/2)&gt;&gt;$map_zoom ) * $scale_value ) + $y_offset;
}</pre>
<p>A few notes about using these functions:</p>
<ul>
<li>From what I can tell, the above code is based on Google Maps and the $map_zoom relates in some way to the &#8216;zoom level&#8217; of the map. I set it at 15 and it seemed to work OK.</li>
<li>Because the dimensions of your own map might not exactly match the assumed dimensions of the map used in the calculation, the $scale_value parameter allows you to adjust the output to fit more precisely. I had to specify two decimal places of scaling to get an exact fit.</li>
<li>Finally, the calculation assumes that the &#8216;origin point&#8217; of the map (x=0, y=0) will be at the top, left-hand corner. This isn&#8217;t the case on the map I&#8217;m working on (the origin is at the centre) so I included $x_offset and $y_offset parameters so that I could adjust the output values accordingly.</li>
</ul>
<p>In order to find the best values for the above parameters, I manually placed three widely-spaced temporary markers on the Flash map marking points whose latitude and longitude I already knew. Then I had the code render these points and adjusted the various parameters until the position of the generated points exactly matched the manually-placed markers.</p>
<p>I hope this code helps someone avoid wasting the sort of time I did yesterday!</p>
]]></content:encoded>
			<wfw:commentRss>http://the-stickman.com/uncategorized/converting-latitude-and-longitude-coordinates-to-map-x-and-y-values/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing Ubuntu on Eee PC 1000</title>
		<link>http://the-stickman.com/general/installing-ubuntu-on-eee-pc-1000/</link>
		<comments>http://the-stickman.com/general/installing-ubuntu-on-eee-pc-1000/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 08:39:40 +0000</pubDate>
		<dc:creator>Stickman</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://the-stickman.com/?p=203</guid>
		<description><![CDATA[I decided the other day that I wanted to try to install Ubuntu on my Eee PC 1000. I&#8217;d already replaced the default Xandros Linux that comes pre-installed with Windows XP (because my other half needed it) but recently I&#8217;ve become annoyed with its tendency to seize up every now and again for no apparent [...]]]></description>
			<content:encoded><![CDATA[<p>I decided the other day that I wanted to try to install Ubuntu on my Eee PC 1000. I&#8217;d already replaced the default Xandros Linux that comes pre-installed with Windows XP (because my other half needed it) but recently I&#8217;ve become annoyed with its tendency to seize up every now and again for no apparent reason.</p>
<p>So I downloaded the <a href="http://www.canonical.com/projects/ubuntu/unr">Ubuntu Netbook Remix</a>, and set about installing it as a dual-boot option. It was very simple, following <a href="https://wiki.ubuntu.com/UNR#The Easy (recommended) way">the instructions</a> took around 40 minutes for the entire process and it all seemed to be going fine. But when I came to reboot, there was no sign of Ubuntu.</p>
<p>Now, the Eee PC 1000 has a 40GB SSD (Solid State Drive) &#8212; which is in fact two drives, one of 8GB and one of 32GB. The 8GB is the &#8216;primary&#8217; drive, and that&#8217;s where Windows is installed, but there wasn&#8217;t space for me to install Ubuntu alongside it so I created a small partition for it on the &#8217;secondary&#8217; drive.</p>
<p>I guessed that the problem was probably related to this fact so I had a poke around to see what could be done. Checking the Eee&#8217;s BIOS, there&#8217;s no distinction between the two drives so you can&#8217;t choose to boot from the secondary drive. I was tempted to give up at this point (I didn&#8217;t seem to be able to find any useful info on the web), but since the install process is so quick I decided to have another go and see if I could spot anything along the way that might be of use.</p>
<p>Sure enough, right near the end of the setup process (after creating/assigning partitions) there&#8217;s a little button labelled &#8216;Advanced&#8217;. Clicking on it popped up a dialog window with a drop-down list that allowed me to assign the boot loader to the primary drive (/dev/sda) instead of the secondary drive (/dev/sdb) that it had defaulted to. So I let it go ahead and install, and one reboot later there it was: a list of boot options. Success!</p>
<p>So, is it any good? Well, it certainly <em>looks</em> good and I like the &#8216;remixed&#8217; desktop/interface which organises applications in a sensible and easy-to-find way. Boot time isn&#8217;t noticeably quicker than WinXP, which is disappointing but could be explained in part by the fact that it&#8217;s running on the slower secondary drive. From what I can tell after one day&#8217;s use, once started it runs very smoothly with apps launching very quickly and no unexplained &#8216;freezes&#8217;.</p>
<p>As far as compatibility is concerned the wireless, sound, touchpad, camera, display, USB and SD ports all worked out-of-the-box with no configuration required. I have my doubts that Bluetooth is working but haven&#8217;t had a chance to test it yet. The one serious gripe is the time it takes for the wireless to establish a connection &#8212; it suffers here even in comparison to Windows, which would (re)connect almost instantly where Ubuntu can take 40 seconds or more. I often use the netbook for a very short time (say, to do a quick web search) and then put it into hibernate, so a slow restart is a definite annoyance.</p>
<p>If you&#8217;re interested in checking out the Ubuntu Netbook Remix but don&#8217;t want to go to the trouble of installing it, then you can run it from a USB stick (1GB or bigger) without any installation. Startup is slow but once it&#8217;s going it&#8217;s fine and if you decide you do want to keep it, then you can install it from the same USB stick.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-stickman.com/general/installing-ubuntu-on-eee-pc-1000/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL UPDATE with SELECT on the same table in the same query</title>
		<link>http://the-stickman.com/uncategorized/mysql-update-with-select-on-the-same-table-in-the-same-query/</link>
		<comments>http://the-stickman.com/uncategorized/mysql-update-with-select-on-the-same-table-in-the-same-query/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 12:55:04 +0000</pubDate>
		<dc:creator>Stickman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://the-stickman.com/?p=194</guid>
		<description><![CDATA[I&#8217;ve been having a week where there&#8217;s a ton of stuff to be done in a short time, yet everything seems to take much longer than it should and every task seems to present multiple unforseen obstacles. 
Yesterday, for example, I was working on something that had already taken several days of my time when I&#8217;d [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been having a week where there&#8217;s a ton of stuff to be done in a short time, yet everything seems to take much longer than it should and every task seems to present multiple unforseen obstacles. </p>
<p>Yesterday, for example, I was working on something that had already taken several days of my time when I&#8217;d hoped to get it done in hours. The final straw came when I found myself facing what appeared to be an intractable problem: a process that needed to insert multiple rows in a table, and increment a certain column in each row to get a unique value. I couldn&#8217;t use an auto-increment value in this case (there was one already), and using a separate query caused concurrency problems (resulting in non-unique values). I should just point out that this is a system that I&#8217;ve inherited, not one that I developed myself.</p>
<p>I started out with a simple update, like this:</p>
<p>UPDATE my_table SET some_value = ( MAX( some_value ) + 1 ) WHERE id = 123;</p>
<p>&#8230;which in hindsight was never going to work but anyway, it gave me this error:</p>
<p><code>#1111 - Invalid use of group function</code></p>
<p>So I thought about it a bit and then struck on this:</p>
<p> <code>UPDATE my_table SET some_value =<br />
(<br />
(<br />
SELECT MAX( some_value )<br />
FROM my_table<br />
) +1<br />
)<br />
WHERE id = 123</code><br />
&#8230;which gave me this error:</p>
<p><code>#1093 - You can't specify target table 'my_table' for update in FROM clause</code></p>
<p>&#8230;damn. I was starting to bang my head on the desk at this point, but Google came to my rescue by pointing me at <a href="http://www.xaprb.com/blog/2006/06/23/how-to-select-from-an-update-target-in-mysql/">this thread</a>, which suggested using a nested sub-select. The result was the following rather ugly query:</p>
<p><code>UPDATE my_table<br />
SET<br />
my_value =<br />
(<br />
(<br />
SELECT selected_value<br />
FROM<br />
(<br />
SELECT MAX( my_value ) AS selected_value<br />
FROM my_table<br />
)<br />
AS sub_selected_value<br />
)<br />
+ 1<br />
)<br />
WHERE id = 123</code></p>
<p>&#8230;which works. It&#8217;s not great  from a performance point of view since it uses a temporary table, but it does what it needs to. I hope in future that I will be given time to go back and rewrite this part of the system so as to entirely remove the issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-stickman.com/uncategorized/mysql-update-with-select-on-the-same-table-in-the-same-query/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Enhanced (&#8216;encouraged&#8217;) blog commenting</title>
		<link>http://the-stickman.com/uncategorized/enhanced-encouraged-blog-commenting/</link>
		<comments>http://the-stickman.com/uncategorized/enhanced-encouraged-blog-commenting/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 10:47:19 +0000</pubDate>
		<dc:creator>Stickman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://the-stickman.com/?p=191</guid>
		<description><![CDATA[Here&#8217;s a great blog post discussing a technique to simplify and encourage commenting on a blog, in particular by quoting text snippets. I might well try to find the time to implement it here on StickBlog.
]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s <a title="Encouraged commentary" href="http://donttrustthisguy.com/2009/01/04/encouraged-commentary/">a great blog post</a> discussing a technique to simplify and encourage commenting on a blog, in particular by quoting text snippets. I might well try to find the time to implement it here on StickBlog.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-stickman.com/uncategorized/enhanced-encouraged-blog-commenting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Comparing changes to MySQL databases</title>
		<link>http://the-stickman.com/web-development/comparing-changes-to-mysql-databases/</link>
		<comments>http://the-stickman.com/web-development/comparing-changes-to-mysql-databases/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 13:51:58 +0000</pubDate>
		<dc:creator>Stickman</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://the-stickman.com/?p=187</guid>
		<description><![CDATA[One of my personal nightmares goes as follows: I&#8217;m working on an existing MySQL-based system, adding or changing something that involves altering existing database tables. I do what I need to, commit the code and then realise that I need to make the database changes too&#8230;only I&#8217;ve forgotten to keep track of the edits I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>One of my personal nightmares goes as follows: I&#8217;m working on an existing MySQL-based system, adding or changing something that involves altering existing database tables. I do what I need to, commit the code and then realise that I need to make the database changes too&#8230;only I&#8217;ve forgotten to keep track of the edits I&#8217;ve made. Oops.</p>
<p>Now there are various things I <em>should</em> do to prevent this happening &#8212; at the very least keep a list of changes as I&#8217;m going along, which I do&#8230;when I remember to. But on those occasions when I don&#8217;t, I usually end up dumping the schemas and comparing them using a diff tool, which works just fine but can be rather laborious.</p>
<p>Today I stumbled (via <a title="DZone" href="http://dzone.com">DZone</a>) upon a piece of freeware called <a href="http://www.toadsoft.com/toadmysql/">Toad for MySQL</a>. It does <a href="http://www.toadsoft.com/toadmysql/Features.htm">a whole bunch of useful things</a>, but the feature that stood out for me was its &#8217;schema compare&#8217; tool. At first it looks like a dolled-up diff tool, but then you notice that in addition to showing you the differences between two databases, it also creates an SQL statement to convert between the two. Very handy.</p>
<p>For those of you who are allergic to MySQL, there are versions of Toad for <a href="http://www.toadsoft.com/toad_oracle.htm">Oracle</a>, <a href="http://www.toadsoft.com/toadsqlserver/toad_sqlserver.htm">SQL Server</a> and <a href="http://www.toadsoft.com/toaddb2/index.html">DB2</a> (although they&#8217;re not freeware).</p>
]]></content:encoded>
			<wfw:commentRss>http://the-stickman.com/web-development/comparing-changes-to-mysql-databases/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery: Dropping items from a draggable list to a sortable list</title>
		<link>http://the-stickman.com/web-development/javascript/jquery-dropping-items-from-a-draggable-list-to-a-sortable-list/</link>
		<comments>http://the-stickman.com/web-development/javascript/jquery-dropping-items-from-a-draggable-list-to-a-sortable-list/#comments</comments>
		<pubDate>Sat, 04 Oct 2008 16:09:25 +0000</pubDate>
		<dc:creator>Stickman</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://the-stickman.com/uncategorized/jquery-dropping-items-from-a-draggable-list-to-a-sortable-list/</guid>
		<description><![CDATA[For reasons that I might outline in another post sometime, I recently decided to replace MooTools as the JavaScript library behind our company CMS (which I&#8217;m in the process of rewriting from scratch) with jQuery.
It&#8217;s been a few weeks now since I made the decision and I&#8217;m starting to become more comfortable with jQuery&#8217;s quite [...]]]></description>
			<content:encoded><![CDATA[<p>For reasons that I might outline in another post sometime, I recently decided to replace <a href="http://mootools.net">MooTools</a> as the JavaScript library behind our company CMS (which I&#8217;m in the process of rewriting from scratch) with <a href="http://jquery.com">jQuery</a>.</p>
<p>It&#8217;s been a few weeks now since I made the decision and I&#8217;m starting to become more comfortable with jQuery&#8217;s quite different approach. I&#8217;ve also begun working on some of the more complicated aspects of the new CMS, including adopting <a href="http://ui.jquery.com/">jQuery UI</a> to provide the interface widgets. One requirement of the system is to have a dialog where search results can be dragged and dropped onto a sortable list.</p>
<p>At first I looked at using two sortable lists and the built-in <a href="http://docs.jquery.com/UI/Sortables/sortable#toptions">&#8216;connectWith&#8217; option</a>, which enables you to link two or more sortable lists together. But then I realised that I didn&#8217;t really want the search results to be a sortable list. In fact, what I wanted was a static list whose items could be dragged and placed in the sortable list.</p>
<p>I tried a few experiments, and when those failed I decided to try looking at the code itself to see if I could hack together a solution without too much extra effort. While browsing the ui.draggables code, I stumbled across the intriguingly-named &#8216;connectToSortable&#8217; option. I was surprised to find it because there&#8217;s (currently) no mention of it in the documentation, and indeed it&#8217;s very hard to find any reference to it at all beyond the code itself (the only useful link I could find was <a href="http://groups.google.com.ph/group/jquery-ui/browse_thread/thread/ae1b7b79356bee12">this one</a>, but it rather over-complicates the issue).</p>
<p>It&#8217;s very simple to use: as with connectWith, just specify which sortable(s) you want to connect to with the connectToSortable property:</p>
<p><code>$('#myDraggable › li').draggable({helper:'clone',connectToSortable:'#mySortable'});</code></p>
<p><a href="http://the-stickman.com/files/jquery/draggable-sortable.html">Full example code here</a>.</p>
<p>The code for the example works just fine, but I found when using it in my own project, for some reason it was necessary to add a $(&#8216;mySortable&#8217;).sortable(&#8216;refresh&#8217;) call after defining the two lists, or the first drop operation would always fail.</p>
<p>By the way, when fiddling around with JavaScript experiments I find <a href="http://jsbin.com">JSBin</a> very useful &#8212; you can load up any of several JS libraries (jQuery, MooTools, dojo, prototype, YUI, script.aculo.us) and create both JavaScript and HTML to test in a &#8216;live&#8217; environment. Very handy.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-stickman.com/web-development/javascript/jquery-dropping-items-from-a-draggable-list-to-a-sortable-list/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Dynamic form elements and Internet Explorer 6</title>
		<link>http://the-stickman.com/web-development/javascript/dynamic-form-elements-and-internet-explorer-6/</link>
		<comments>http://the-stickman.com/web-development/javascript/dynamic-form-elements-and-internet-explorer-6/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 09:58:37 +0000</pubDate>
		<dc:creator>Stickman</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://the-stickman.com/web-development/javascript/dynamic-form-elements-and-internet-explorer-6/</guid>
		<description><![CDATA[A few brief entries from the &#8216;tiny yet annoying bugs that take far too much time to fix&#8217; file&#8230;
I&#8217;m creating forms dynamically using JavaScript. This has led to a number of problems with IE6:
Dynamic checkboxes/radio buttons and the &#8216;checked&#8217; attribute
When creating a field, I wanted to be able to apply a &#8216;default&#8217; value &#8212; for [...]]]></description>
			<content:encoded><![CDATA[<p>A few brief entries from the &#8216;tiny yet annoying bugs that take far too much time to fix&#8217; file&#8230;</p>
<p>I&#8217;m creating forms dynamically using JavaScript. This has led to a number of problems with IE6:</p>
<p><strong>Dynamic checkboxes/radio buttons and the &#8216;checked&#8217; attribute</strong></p>
<p>When creating a field, I wanted to be able to apply a &#8216;default&#8217; value &#8212; for example, a checkbox element might be ticked by default. This was all going smoothly until (guess what?) I tested it on IE6: the checked attribute was set, and returned &#8216;true&#8217; when tested, but the box did not appear to be checked when it appeared in the form.</p>
<p>The answer, as I discovered thanks to <a href="http://bytes.com/forum/thread594613.html">this forum post</a>, was to use the &#8216;defaultChecked&#8217; attribute instead (I set both, just in case). It seems to work across browsers, which is nice. Oh, and this applies to radio buttons as well as checkboxes.</p>
<p><strong>Creating radio buttons</strong></p>
<p>While we&#8217;re on the subject of radio buttons, I also found that IE6 doesn&#8217;t like radio buttons created using document.createElement() (i.e. as a DOM object). It&#8217;ll render them OK, but they&#8217;re unclickable. The answer is to create them by injecting HTML into an element with [element].innerHTML:</p>
<p>var obj = document.createElement( &#8217;span&#8217; );<br />
obj.innerHTML = &#8216;&lt;input type=&#8221;radio&#8221; name=&#8221;somefield&#8221; value=1&gt;1&#8242;;</p>
<p>&#8230;and so forth. Ugly.</p>
<p><strong>Assigning values to multiple select elements</strong></p>
<p>This was a really fiddly one, and seems to happen under only very particular circumstances. Anyway&#8230;</p>
<p>If you create a select element and set the &#8216;multiple&#8217; attribute, IE6 can sometimes have trouble assigning values to it if you do it immediately after it&#8217;s created. Note the word &#8217;sometimes&#8217;: I haven&#8217;t been able to create a simple enough test case to isolate the exact circumstances that are required. And it&#8217;s only a problem if you&#8217;re setting more than one value.</p>
<p>Anyway, the (horrible) fix is to delay setting the values using setTimeout(). The delay doesn&#8217;t matter (1 millisecond will do), but it does work.</p>
<p>I hope these notes help some other unfortunate soul out there avoid wasting the number of hours and brain cells that I just have!</p>
]]></content:encoded>
			<wfw:commentRss>http://the-stickman.com/web-development/javascript/dynamic-form-elements-and-internet-explorer-6/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google Chrome: My two penn&#8217;th</title>
		<link>http://the-stickman.com/web-development/google-chrome-my-two-pennth/</link>
		<comments>http://the-stickman.com/web-development/google-chrome-my-two-pennth/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 09:29:13 +0000</pubDate>
		<dc:creator>Stickman</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://the-stickman.com/uncategorized/google-chrome-my-two-pennth/</guid>
		<description><![CDATA[OK, everyone&#8217;s talking about Google&#8217;s &#8216;new&#8217; browser (check out the comic for an easy introduction) and everyone&#8217;s going to have an opinion. Here&#8217;s mine, based on a few hours&#8217; use.
First (and lasting) impression: damn, it&#8217;s fast. It starts fast, it renders pages fast, it stays fast. JavaScript in particular is noticeably smoother where in other [...]]]></description>
			<content:encoded><![CDATA[<p>OK, everyone&#8217;s talking about <a href="http://www.google.com/chrome">Google&#8217;s &#8216;new&#8217; browser</a> (check out <a href="http://www.google.com/googlebooks/chrome/">the comic</a> for an easy introduction) and everyone&#8217;s going to have an opinion. Here&#8217;s mine, based on a few hours&#8217; use.</p>
<p>First (and lasting) impression: damn, it&#8217;s fast. It starts fast, it renders pages fast, it stays fast. JavaScript in particular is noticeably smoother where in other browsers it has lagged. The latter is thanks to the new V8 JavaScript engine, the rest is at least partly related to the memory model, where each tab is a completely separate process. Given that it&#8217;s using WebKit &#8212; the renderer behind Safari &#8212; the speed difference between the two is striking.</p>
<p>And to be honest, as far as the &#8216;wow&#8217; factor goes, that&#8217;s about it for me. It&#8217;s a browser. The minimalist layout is nice but in fact I&#8217;ve been doing myself with Firefox for a couple of years now. Oh, the tabs are at the top&#8230;ok. The address bar is &#8216;clever&#8217;&#8230;well I don&#8217;t particularly like FF3&#8217;s &#8216;Awesomebar&#8217;, and I&#8217;ve yet to see anything that this does that is likely to make me like it any better. The start page&#8217;s layout is very reminiscent of Opera, which isn&#8217;t necessarily a bad thing &#8212; I might well grow to like it.</p>
<p>But none of the above constitutes a &#8216;major breakthrough&#8217; or &#8216;a paradigm shift in the browser space&#8217;. It&#8217;ll be interesting to see how it develops, though. Maybe the behind-the-scenes, technical advances (esepcially the speed) will feed back into other browser projects. As it stands, it&#8217;s just yet another platform to test for incompatibilities.</p>
<p>But&#8230;the speed! I can see myself using it as a day-to-day browser for non-development purposes, just because it&#8217;s so quick to launch.</p>
]]></content:encoded>
			<wfw:commentRss>http://the-stickman.com/web-development/google-chrome-my-two-pennth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
