<?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>Derek Winton &#187; Blog</title>
	<atom:link href="http://www.derekwinton.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.derekwinton.com</link>
	<description>Web Solutions and Change Management</description>
	<lastBuildDate>Mon, 30 Aug 2010 15:03:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>jQuery first steps</title>
		<link>http://www.derekwinton.com/webdevelopment/jquery-first-steps/</link>
		<comments>http://www.derekwinton.com/webdevelopment/jquery-first-steps/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 13:36:38 +0000</pubDate>
		<dc:creator>derekwinton</dc:creator>
				<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.derekwinton.com/?p=460</guid>
		<description><![CDATA[Have been intrigued by jquery for a while but have been wary of learning another computer language. Particularly one that looks so different (at least on first inspection) to JavaScript.Decided to take the plunge at the weekend and it turns out it&#8217;s not so bad! The introductory tutorial on the jquery site is actually pretty [...]]]></description>
			<content:encoded><![CDATA[<p>Have been intrigued by jquery for a while but have been wary of learning another computer language. Particularly one that looks so different (at least on first inspection) to JavaScript.Decided to take the plunge at the weekend and it turns out it&#8217;s not so bad!</p>
<p>The introductory tutorial on the jquery site is actually pretty bad. <a href="http://www.w3schools.com/jquery/default.asp">w3schools</a> is a much better starting point.</p>
<p>It turns out you can combine jquery with existing javascript in a page. Where jquery comes into it&#8217;s own is adding graphical effects to a page.</p>
<p>The syntax is along the lines of:</p>
<p>$(page element).event behaviour</p>
<p>I wanted to add a sliding menu to my itunes style navigation menus. Found <a href="http://blog.jquery.com/2006/11/14/expandable-sidebar-menu-screencast/">this tutorial</a> and amended to toggle between expand and contract sub menus</p>
<pre id="line36">&lt;html&gt;
&lt;head&gt;
&lt;script src='scripts/jquery-1.4.2.min.js'&gt;&lt;/script&gt;
 &lt;script&gt;
  // Run this code when the page is ready
  $(document).ready(function(){

    // Hide all dd lists apart from the first
    $("dd:not(:first)").hide();

    // Attach this behaviour to the click event of all a elements inside dt tags
    $("dt a").click(function(){

      // show / hide the next element in the page (ie. the list!)
      $(this).parent().next().slideToggle("fast"); // mine
      return false;

     });

   });
 &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;dl&gt;
	&lt;dt&gt;&lt;a href="#"&gt;Header 1&lt;/a&gt;&lt;/dt&gt;
	&lt;dd&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;a href=""&gt;Item 1&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=""&gt;Item 2&lt;/a&gt;&lt;/li&gt;
       &lt;/ul&gt;
	&lt;/dd&gt;
        &lt;dt&gt;&lt;a href="#"&gt;Header 2&lt;/a&gt;&lt;/dt&gt;
<pre id="line36">	&lt;dd&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;a href=""&gt;Item 3&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=""&gt;Item 4&lt;/a&gt;&lt;/li&gt;
       &lt;/ul&gt;
	&lt;/dd&gt;</pre>
<p>&lt;/dl&gt;</p>
<p>&lt;/body&gt;&lt;/html&gt;</pre>
<p>You can then style the list in any way you like</p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekwinton.com/webdevelopment/jquery-first-steps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Single quotes in forms and pdf</title>
		<link>http://www.derekwinton.com/webdevelopment/single-quotes-in-forms-and-pdf/</link>
		<comments>http://www.derekwinton.com/webdevelopment/single-quotes-in-forms-and-pdf/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 20:27:27 +0000</pubDate>
		<dc:creator>derekwinton</dc:creator>
				<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.derekwinton.com/?p=474</guid>
		<description><![CDATA[Turns out there are encodings for left and right single quotes! I had no idea but someone managed to get some into one of my forms (I suspect copying from word or similar) and caused some problems. The following will strip left, right and neutral single quotes oldstring = oldstring.replace(/\u2018/g,"invertedcommasymbol"); oldstring = oldstring.replace(/\u2019/g,"invertedcommasymbol"); oldstring = [...]]]></description>
			<content:encoded><![CDATA[<p>Turns out there are encodings for left and right single quotes! I had no idea but someone managed to get some into one of my forms (I suspect copying from word or similar) and caused some problems.</p>
<p>The following will strip left, right and neutral single quotes</p>
<p><code>oldstring = oldstring.replace(/\u2018/g,"invertedcommasymbol");<br />
oldstring = oldstring.replace(/\u2019/g,"invertedcommasymbol");<br />
oldstring = oldstring.replace(/\u0027/g,"invertedcommasymbol");</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekwinton.com/webdevelopment/single-quotes-in-forms-and-pdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UK Pound symbol in fpdf</title>
		<link>http://www.derekwinton.com/webdevelopment/uk-pound-symbol-in-fpdf/</link>
		<comments>http://www.derekwinton.com/webdevelopment/uk-pound-symbol-in-fpdf/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 20:09:00 +0000</pubDate>
		<dc:creator>derekwinton</dc:creator>
				<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.derekwinton.com/?p=472</guid>
		<description><![CDATA[Was having problems with pound symbols displaying as A£ in pdfs I created with fpdf. Apparently, fpdf requires text to be in utf8 format. It&#8217;s easily fixed with the following: $cleantext = utf8_decode($dirtytext);]]></description>
			<content:encoded><![CDATA[<p>Was having problems with pound symbols displaying as A£ in pdfs I created with fpdf.</p>
<p>Apparently, fpdf requires text to be in utf8 format.</p>
<p>It&#8217;s easily fixed with the following:</p>
<p><code>$cleantext = utf8_decode($dirtytext);</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekwinton.com/webdevelopment/uk-pound-symbol-in-fpdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sanctuary 17 strategy</title>
		<link>http://www.derekwinton.com/webdevelopment/sanctuary-17-strategy/</link>
		<comments>http://www.derekwinton.com/webdevelopment/sanctuary-17-strategy/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 14:20:45 +0000</pubDate>
		<dc:creator>derekwinton</dc:creator>
				<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.derekwinton.com/?p=468</guid>
		<description><![CDATA[OK this isn&#8217;t strictly development but it is problem solving! Sanctuary 17 is an 8-bit style flash game in the style of old ZX Spectrum classics. Part of the retro charm is the breaking of some modern gaming conventions. You don&#8217;t have unlimited lives 1 hit will kill you You lose power ups when you [...]]]></description>
			<content:encoded><![CDATA[<p>OK this isn&#8217;t strictly development but it is problem solving!</p>
<p><a href="http://twofoldsecret.com/games/sanctuary-17/">Sanctuary 17</a> is an 8-bit style flash game in the style of old ZX Spectrum classics. Part of the retro charm is the breaking of some modern gaming conventions.</p>
<ul>
<li>You don&#8217;t have unlimited lives</li>
<li>1 hit will kill you</li>
<li>You lose power ups when you die</li>
</ul>
<p>This can make it very frustrating (at least to start with) but there is a payoff in the form of a good back story and a surprising amount of atmosphere. Another thing which pulls you in is you get better each time you play. I got a bit obsessed by it and eventually got all three endings and thought this might be handy for anyone who&#8217;s stuck.</p>
<p>You play in a 6*6 grid and you can see your position by pressing escape. Rooms are randomly allocated except for your starting position which is always 4 from the left and 4 from the top.</p>
<p>There are 2 types of room, &#8216;node&#8217; rooms &#8211; 26 in total each containing a computer node and some bad robots and 10 robot-free &#8216;equipment&#8217; rooms : The start point, the power station, the   library, the water station, the scanner room, the end point and four   rooms containing objects (night vision, lightning, big gun and lantern).</p>
<p>There are four types of enemy robots. The best way to kill each is to wait on a straight and shoot them as they reach a corner.</p>
<ol>
<li>green square ones (can walk behind them and shoot in the back)</li>
<li>blue spider ones (can walk behind them and shoot in the back)</li>
<li>red humanoid ones (turn round and fire when you pass behind them)</li>
<li>green humanoid ones (same as red but two shots to kill)</li>
</ol>
<p>The purpose of the game is to explore rooms, activate nodes and equipment until you can escape, killing robots on the way as necessary.</p>
<p>Here&#8217;s the clincher, (which they don&#8217;t tell you!)&#8230; As you turn on more nodes or activate equipment, new types of robot appear. So&#8230; if you <strong>explore all the rooms first without activating anything</strong> you get an easy time of it! Even better, <strong>you don&#8217;t need to explore every room. Just the ones with equipment in them and an additional 9 nodes</strong>. The best way to do this is, once you&#8217;ve found an equipment room, explore every exit leading from it. If you find another, check all the exits from that and so on. It&#8217;s sometimes possible to find a path leading directly from the start point to the exit, passing all the equipment rooms without a single robot room!.</p>
<p><strong>Once you&#8217;ve found all the equipment rooms, activate a node</strong>. This saves your position. <strong>If you die now, don&#8217;t carry on. Refresh the page and click continue</strong>. This is a bit of a cheat and not entirely necessary but if you want a failsafe this is the way to go.</p>
<p>Once you&#8217;ve activated 9 nodes in total the exit will open. This is where the three endings come in.</p>
<ol>
<li>If you go through the door now, only you escape</li>
<li>If you go back to the start point, you and your band of followers escape</li>
<li>If you activate all the equipment (in order water, power, scanner) and go back to the start point, all the survivors will follow you to freedom!</li>
</ol>
<p>Fruitful way to spend time? Possibly not. Hugely satisfying to beat? Definitely.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekwinton.com/webdevelopment/sanctuary-17-strategy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preventing javascript injection</title>
		<link>http://www.derekwinton.com/webdevelopment/preventing-javascript-injection/</link>
		<comments>http://www.derekwinton.com/webdevelopment/preventing-javascript-injection/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 19:09:03 +0000</pubDate>
		<dc:creator>derekwinton</dc:creator>
				<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.derekwinton.com/?p=464</guid>
		<description><![CDATA[Need to prevent users deciphering function calls and executing functions from the address bar. Not a major issue at the moment as no pages are open to the public but need to sort out before bigger roll outs. First thought&#8230; add an owner variable to all tables. Only allow changes by owner in the php [...]]]></description>
			<content:encoded><![CDATA[<p>Need to prevent users deciphering function calls and executing functions from the address bar.</p>
<p>Not a major issue at the moment as no pages are open to the public but need to sort out before bigger roll outs.</p>
<p>First thought&#8230; add an owner variable to all tables. Only allow changes by owner in the php updater file.</p>
<p>Also need to add session validation to updater file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekwinton.com/webdevelopment/preventing-javascript-injection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure ubr uploads folders</title>
		<link>http://www.derekwinton.com/webdevelopment/configure-ubr-uploads-folders/</link>
		<comments>http://www.derekwinton.com/webdevelopment/configure-ubr-uploads-folders/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 13:16:47 +0000</pubDate>
		<dc:creator>derekwinton</dc:creator>
				<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.derekwinton.com/?p=459</guid>
		<description><![CDATA[These instructions are for me copying files from an existing implementation. If you&#8217;re installing from scratch, download the INSTALL_AND_FAQ.HTML file from here and follow the instructions step by step. They&#8217;re easy to get wrong! Ask server team to make a new folder above web root called uploads ie. /var/www/uploads Set permissions to read/write/execute for that [...]]]></description>
			<content:encoded><![CDATA[<p>These instructions are for me copying files from an existing implementation. If you&#8217;re installing from scratch, download the INSTALL_AND_FAQ.HTML file from <a href="http://sourceforge.net/projects/uber-uploader/files/uber-uploader/6.8.2/Uber-Uploader_6.8.2.zip/download" target="_blank">here</a> and <strong>follow the instructions step by step.</strong> They&#8217;re easy to get wrong!</p>
<ol>
<li>Ask server team to make a new folder above web root called uploads ie. /var/www/uploads</li>
<li>Set permissions to read/write/execute for that folder for all users via file manager</li>
<li>Upload the following to /var/www/cgi-bin/ :
<ul>
<li> .htaccess</li>
<li>ubr_upload.pl</li>
</ul>
</li>
<li>Open terminal and set permissions for those two files :
<ul>
<li>chmod 644 .htaccess</li>
<li>chmod 755 ubr_upload.pl</li>
</ul>
</li>
</ol>
<p>That should be it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekwinton.com/webdevelopment/configure-ubr-uploads-folders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Refresh O2 dns on a mac</title>
		<link>http://www.derekwinton.com/webdevelopment/refresh-o2-dns-on-a-mac/</link>
		<comments>http://www.derekwinton.com/webdevelopment/refresh-o2-dns-on-a-mac/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 16:09:19 +0000</pubDate>
		<dc:creator>derekwinton</dc:creator>
				<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.derekwinton.com/?p=454</guid>
		<description><![CDATA[Having set up a new domain name, it can take a while for the changes to cascade around the dns&#8217;s. O2&#8242;s dns is apparently very slow and after 24 hours I had to take matters into my own hands. Found this excellent link to force the dns to update. I&#8217;ve summarised below. Open the terminal [...]]]></description>
			<content:encoded><![CDATA[<p>Having set up a new domain name, it can take a while for the changes to cascade around the dns&#8217;s. O2&#8242;s dns is apparently very slow and after 24 hours I had to take matters into my own hands.</p>
<p>Found this excellent <a href="http://www.beforum.co.uk/showthread.php?t=9733">link</a> to force the dns to update. I&#8217;ve summarised below.</p>
<ul>
<li>Open the terminal application</li>
<li>At the command prompt type telnet</li>
<li>Then type :  <code>open 192.168.1.254</code></li>
<li>Enter username : SuperUser (the ID seems to be CASE SENSITIVE, ie with S and U in capitals)</li>
<li>Enter password : CP********** (This will be written on the bottom of your router or on the sticker inside your quick start guide)</li>
<li>Enter the following (pressing return after each line):
<ul>
<li><code>dns server route flush</code></li>
<li><code>dns server route add dns=84.45.18.139 metric=0 intf=O2_ADSL2plus</code></li>
<li><code>dns server route add dns=84.45.18.138 metric=0 intf=O2_ADSL2plus</code></li>
<li><code>dns server route add dns=84.45.18.140 metric=0 intf=O2_ADSL2plus</code></li>
<li><code>dns server route list</code></li>
<li><code>saveall</code></li>
</ul>
</li>
</ul>
<p>That should be it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekwinton.com/webdevelopment/refresh-o2-dns-on-a-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calling a function by name stored as a string</title>
		<link>http://www.derekwinton.com/webdevelopment/calling-a-function-by-name-stored-as-a-string/</link>
		<comments>http://www.derekwinton.com/webdevelopment/calling-a-function-by-name-stored-as-a-string/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 14:54:43 +0000</pubDate>
		<dc:creator>derekwinton</dc:creator>
				<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.derekwinton.com/?p=443</guid>
		<description><![CDATA[Further to this post, you might want to access a function where both the object and function names are stored as strings. For example: var objectname = "myobject"; var behaviourname = "mybehaviour()"; In this case you can use eval to trigger the behaviour for that object. eval objectname+"."+mybehaviour; The eval function evaluates the string as [...]]]></description>
			<content:encoded><![CDATA[<p>Further to <a href="http://www.derekwinton.com/webdevelopment/accessing-javascript-object-variables-by-names-stored-in-an-array/">this post</a>, you might want to access a function where both the object and function names are stored as strings. For example:</p>
<p><code>var objectname = "myobject";<br />
var behaviourname = "mybehaviour()";</code></p>
<p>In this case you can use eval to trigger the behaviour for that object.</p>
<p><code>eval objectname+"."+mybehaviour;</code></p>
<p>The eval function evaluates the string as &#8220;<code>objectname.mybehaviour()</code>&#8221; and executes it!</p>
<p>Thanks to this <a href="http://www.webmasterworld.com/forum91/1283.htm">post</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekwinton.com/webdevelopment/calling-a-function-by-name-stored-as-a-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google calendar on iphone, website and ical</title>
		<link>http://www.derekwinton.com/businessadmin/google-calendar-on-iphone-website-and-ical/</link>
		<comments>http://www.derekwinton.com/businessadmin/google-calendar-on-iphone-website-and-ical/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 11:57:04 +0000</pubDate>
		<dc:creator>derekwinton</dc:creator>
				<category><![CDATA[Business Admin]]></category>

		<guid isPermaLink="false">http://www.derekwinton.com/?p=439</guid>
		<description><![CDATA[Google provide a very good free calendar service here It&#8217;s web based which is handy when you&#8217;re on the move but it also lets you publish calendars for other people to see AND syncs with the calendar app on your iphone to give reminders. Some of the tutorials / settings are a bit hard to [...]]]></description>
			<content:encoded><![CDATA[<p>Google provide a very good free calendar service <a title="Google Calendar" href="http://www.google.com/intl/en/googlecalendar/about.html" target="_blank">here</a></p>
<p>It&#8217;s web based which is handy when you&#8217;re on the move but it also lets you publish calendars for other people to see AND syncs with the calendar app on your iphone to give reminders.</p>
<p>Some of the tutorials / settings are a bit hard to find so I&#8217;ve summarised them below.</p>
<p>To set up on the iphone go <a href="http://www.google.com/support/mobile/bin/answer.py?answer=138740&amp;cbid=-1g49h5pztcbw0&amp;src=cb&amp;lev=answer" target="_blank">here</a></p>
<p>To sync with iCal in your desktop go <a href="http://www.google.com/support/calendar/bin/answer.py?answer=99358#ical" target="_blank">here</a></p>
<p>To publish the calendar in a blog:</p>
<ol>
<li>Create a calendar and view it (put in a couple of test entries)</li>
<li>Go to &#8216;Settings&#8217; (Link on lower left of screen when viewing the calendar) then &#8216;Edit settings&#8217;</li>
<li>Click the &#8216;Share this calendar&#8217; tab and tick &#8216;Make this calendar public&#8217;</li>
<li>On the same page, click the &#8216;calendar details&#8217; tab and copy the code in the &#8216;Embed this calendar&#8217; section.</li>
<li>Paste the code into your web page or blog</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.derekwinton.com/businessadmin/google-calendar-on-iphone-website-and-ical/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Imac OS X Hard drive full! &#8211; Solved</title>
		<link>http://www.derekwinton.com/webdevelopment/imac-os-x-hard-drive-full-solved/</link>
		<comments>http://www.derekwinton.com/webdevelopment/imac-os-x-hard-drive-full-solved/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 14:49:42 +0000</pubDate>
		<dc:creator>derekwinton</dc:creator>
				<category><![CDATA[Business Admin]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.derekwinton.com/blog/?p=331</guid>
		<description><![CDATA[The quick bit. Restart, then find and remove console.log Details: A few strange things starting happening with my imac today: Search button stopped working in firefox Itunes started throwing an error saying it couldn&#8217;t save the library Iphone wouldn&#8217;t back up Itunes was saying the hard drive was full. But that couldn&#8217;t be! I&#8217;ve got [...]]]></description>
			<content:encoded><![CDATA[<p>The quick bit.</p>
<p>Restart, then find and remove console.log</p>
<p>Details:</p>
<p>A few strange things starting happening with my imac today:</p>
<ul>
<li>Search button stopped working in firefox</li>
<li>Itunes started throwing an error saying it couldn&#8217;t save the library</li>
<li>Iphone wouldn&#8217;t back up</li>
</ul>
<p>Itunes was saying the hard drive was full. But that couldn&#8217;t be! I&#8217;ve got 250GB of space. Or could it&#8230;</p>
<p>Checked the drive info for the hard drive and sure enough 240GB was full.</p>
<p>Checked what I thought would be the worst culprits. My business files, photos and music but these were all within 50GB.</p>
<p>Hmm, tried a systematic search of the hard drive and eventually narrowed it down to console.log A single file that was 165GB!!</p>
<p>Did some internet snooping and it turns out this is just an error log generated by OS X. Somethings throwing a ridiculous amount of errors to run to 165GB but didn&#8217;t want to try to open the file as knew with such a large file it would take ages.</p>
<p>Tried to delete the file but as it was still in use I couldn&#8217;t. Had to reboot the machine to get it to start a new log file. Then deleted the big one.</p>
<p>Not sure what caused it yet. Could be spotify, itunes, openoffice, aptana or gimp. I&#8217;ll keep an eye on the log file for now for clues.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekwinton.com/webdevelopment/imac-os-x-hard-drive-full-solved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
