<?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>Michael Wright</title>
	<atom:link href="http://michaelwright.me/feed/" rel="self" type="application/rss+xml" />
	<link>http://michaelwright.me</link>
	<description>A portfolio, blog and more...</description>
	<lastBuildDate>Fri, 20 Aug 2010 21:16:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>hoverCheckbox</title>
		<link>http://michaelwright.me/2010/08/hovercheckbox/</link>
		<comments>http://michaelwright.me/2010/08/hovercheckbox/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 21:16:11 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://michaelwright.me/?p=268</guid>
		<description><![CDATA[As part of the current project I&#8217;m working on, it was decided that as an instant feedback to users we would make a checkbox seem &#8220;ticked&#8221; when they hover over it. The other alternative is &#8211; as eBay use &#8211; to use an image that will change when you hover over it. However, the idea [...]]]></description>
			<content:encoded><![CDATA[<p>As part of the current project I&#8217;m working on, it was decided that as an instant feedback to users we would make a checkbox seem &#8220;ticked&#8221; when they hover over it. The other alternative is &#8211; as eBay use &#8211; to use an image that will change when you hover over it. However, the idea of using an image for someone that isn&#8217;t a designer is an instant &#8220;What? Hell no!&#8221;, so I set about finding a better alternative.</p>
<p>The solution was to use some jQuery that would check the status of the checkbox when they hover over it, store that in a variable, and then add a check. Then if they unhover if the box wasn&#8217;t checked then you remove the check, otherwise do nothing.</p>
<p>The demo can be seen over at the<a href="http://test.wserver.co.uk/hoverCheckbox/"> hoverCheckbox Demo</a> site. With the source code visible on the same site.</p>
<p>To activate the hoverCheckbox on a checkbox, simply add the class &#8220;<em>hovercheck</em>&#8220;.</p>
<p>A simple script, but is rather handy when you come to providing instant feedback to users and checkboxes &#8211; this can be adapted for <em>label</em> tags if needed.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelwright.me/2010/08/hovercheckbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Slideshow</title>
		<link>http://michaelwright.me/2010/07/jquery-slideshow/</link>
		<comments>http://michaelwright.me/2010/07/jquery-slideshow/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 20:41:09 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Slideshow]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://michaelwright.me/?p=257</guid>
		<description><![CDATA[So I&#8217;ve got myself some work on a new website for my boss this week, and part of his site currently has some sort of slideshow thing &#8211; using jQuery. I have used them before, but never actually got round to coding one. So I decided to stop being lazy, and actually look at coding [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve got myself some work on a new website for my boss this week, and part of his site currently has some sort of slideshow thing &#8211; using jQuery. I have used them before, but never actually got round to coding one. So I decided to stop being lazy, and actually look at coding something up. So here it is:</p>
<p><code><script src="http://a.wimg.co.uk/js/jQuery.js" type="text/javascript"></script> <script type="text/javascript">// <![CDATA[
var slideShows = [];
$.fn.slideShow = function(){
    $(this).children('img').hide().eq(0).show();
    slideShows[$(this).attr('id')] = {'imgs': $(this).children('img'), 'i': 0};
    setInterval("changeImages('" + $(this).attr('id') + "')", 7000);
}
function changeImages(x){
    $(slideShows[x]['imgs'][slideShows[x]['i']]).fadeOut(1000,
        function(){
            slideShows[x]['i'] = (slideShows[x]['i'] < slideShows[x]['imgs'].length-1? slideShows[x]['i'] + 1 : 0);
            $(slideShows[x]['imgs'][slideShows[x]['i']]).fadeIn(1000);
        }
    );
}
// ]]&gt;</script></code></p>
<p><code> </code></p>
<p><code></p>
<div id="test">
<div>
<div id="magicdomid4653">&lt;script type='text/javascript'&gt;</div>
<div>/*</div>
<div style="padding-left: 30px;">SlideShow jQuery Plugin v1.2</div>
<div style="padding-left: 30px;">Michael Wright</div>
<div style="padding-left: 30px;">http://michaelwright.me</div>
<div>*/</div>
<div id="magicdomid4655">var slideShows = [];</div>
<div id="magicdomid4656">$.fn.slideShow = function(){</div>
<div id="magicdomid4681" style="padding-left: 30px;">$(this).children('img:gt(0)').hide();</div>
<div id="magicdomid4658" style="padding-left: 30px;">slideShows[$(this).attr('id')] = {'imgs': $(this).children('img'), 'i': 0};</div>
<div id="magicdomid4693" style="padding-left: 30px;">setInterval("changeImages('" + $(this).attr('id') + "')", 7000);</div>
<div id="magicdomid4660">}</div>
<div id="magicdomid4661">function changeImages(x){</div>
<div id="magicdomid4686" style="padding-left: 30px;">$(slideShows[x]['imgs'][slideShows[x]['i']]).fadeOut(1000,</div>
<div id="magicdomid4663" style="padding-left: 60px;">function(){</div>
<div id="magicdomid4664" style="padding-left: 90px;">slideShows[x]['i'] = (slideShows[x]['i'] &lt; slideShows[x]['imgs'].length-1? slideShows[x]['i'] + 1 : 0);</div>
<div id="magicdomid4688" style="padding-left: 90px;">$(slideShows[x]['imgs'][slideShows[x]['i']]).fadeIn(1000);</div>
<div id="magicdomid4666" style="padding-left: 60px;">}</div>
<div id="magicdomid4667" style="padding-left: 30px;">);</div>
<div id="magicdomid4668">}</div>
<div id="magicdomid4669">&lt;/script&gt;</div>
<div id="magicdomid4671">&lt;div id='test'&gt;</div>
<div id="magicdomid4684" style="padding-left: 30px;">&lt;img src='<a href="http://wimg.mp/SrM.gif">http://wimg.mp/SrM.gif</a>' /&gt;</div>
<div id="magicdomid4683" style="padding-left: 30px;">&lt;img src='<a href="http://wimg.mp/J0Z.gif">http://wimg.mp/J0Z.gif</a>' /&gt;</div>
<div id="magicdomid4682" style="padding-left: 30px;">&lt;img src='<a href="http://wimg.mp/FHm.gif">http://wimg.mp/FHm.gif</a>' /&gt;</div>
<div id="magicdomid4675">&lt;/div&gt;</div>
<div id="magicdomid4677">&lt;script type='text/javascript'&gt;</div>
<div id="magicdomid4678" style="padding-left: 30px;">$('#test').slideShow();</div>
<div id="magicdomid4679">&lt;/script&gt;</div>
</div>
</div>
<p></code></p>
<p><code><script type="text/javascript">// <![CDATA[
$('#test').slideShow();
// ]]&gt;</script></code></p>
<p>It is obviously lacking proper HTML structure, however, as it is, it works. Ultimately you created an element containing a series of images, and then simply invoke the slideshow function on the element. <strong>Make sure that the element container has an id</strong> as it is used to refer to the slideshow items later.</p>
<p>jQuery is required for this, so ensure that you are including the JavaScript file when using this code.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelwright.me/2010/07/jquery-slideshow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XML Creator</title>
		<link>http://michaelwright.me/2010/06/xml-creator-2/</link>
		<comments>http://michaelwright.me/2010/06/xml-creator-2/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 09:38:07 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://michaelwright.me/?p=244</guid>
		<description><![CDATA[So as part of my current work, I have to export customer information, orders and order details for importing into Sage. Also, product information has to be exported for Google shopping. Both of these are being exported in XML. Instead of writing out all of the coding and causing problems etc. I bodged together a [...]]]></description>
			<content:encoded><![CDATA[<p>So as part of my current work, I have to export customer information, orders and order details for importing into Sage. Also, product information has to be exported for Google shopping. Both of these are being exported in XML. Instead of writing out all of the coding and causing problems etc. I bodged together a simple function &#8211; it is by no means perfect:</p>
<p><code>function createXML($x, $y){</p>
<div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 30px;">$y = (is_array($y)? $y : str_replace("&#038;", "&#038;a<b></b>mp;", $y));<br />
$output = "\n\t&lt;$x&gt;";<br />
if(is_array($y))</div>
<div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 60px;">foreach($y as $key =&gt; $item)</div>
<div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 90px;">$output .= createXML($item[0], $item[1]);</div>
<div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 30px;">else</div>
<div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 60px;">$output .= $y;</div>
<div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 30px;">$output .= "\n\t";<br />
return $output;</div>
<p>}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://michaelwright.me/2010/06/xml-creator-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#8217;m on Twitter</title>
		<link>http://michaelwright.me/2010/06/im-on-twitter/</link>
		<comments>http://michaelwright.me/2010/06/im-on-twitter/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 23:07:55 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://michaelwright.me/?p=239</guid>
		<description><![CDATA[I don&#8217;t like to use this blog for non-work related things. However, I&#8217;m exploiting it and am taking this point in time to advertise my Twitter. I don&#8217;t promise to post anything which will lead to a scientific breakthrough, but anyone interested in the thoughts and workings of a 20 year old web developer should [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t like to use this blog for non-work related things. However, I&#8217;m exploiting it and am taking this point in time to advertise my Twitter. I don&#8217;t promise to post anything which will lead to a scientific breakthrough, but anyone interested in the thoughts and workings of a 20 year old web developer should follow. Click the bird, and then tweet me saying hi! </p>
<div align = 'center'>
<a href = 'http://twitter.com/michaelw90'><img src = 'http://wimg.co.uk/v4n.png' border = '0' /></a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://michaelwright.me/2010/06/im-on-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multi-Format Number</title>
		<link>http://michaelwright.me/2010/06/multi-format-number/</link>
		<comments>http://michaelwright.me/2010/06/multi-format-number/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 14:54:42 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://michaelwright.me/?p=227</guid>
		<description><![CDATA[So for this project that I&#8217;m working on, I have to be able to format a number to be comma separated and decimalised (only if the decimal numbers aren&#8217;t 00) to two decimal places (with rounding &#8211; when there is 3 or more decimal places). So, unfortunately there isn&#8217;t any actual predefined function out there [...]]]></description>
			<content:encoded><![CDATA[<p>So for this project that I&#8217;m working on, I have to be able to format a number to be comma separated and decimalised (only if the decimal numbers aren&#8217;t 00) to two decimal places (with rounding &#8211; when there is 3 or more decimal places). So, unfortunately there isn&#8217;t any actual predefined function out there for any of this. So through the <em>Math.round()</em>, <em>Math.pow()</em> and <em>String.replace()</em> functions, I managed to cobble something together that works flawlessly:</p>
<p><code><br />
function formatPrice(x){
<div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 30px;">
	x = x.split('.');<br />
	while(/(\d+)(\d{3})/.test(x[0]))
</div>
<div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 60px;">
		x[0] = x[0].replace(/(\d+)(\d{3})/, "$1" + "," + "$2");
	</div>
<div style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 30px;">
	x[1] = (typeof x[1] != 'undefined'? (!x[1].match(/^00?$/)? "." : "") + x[1].replace(/^(\d{3,})$/, function($1){return Math.round((($1)/Math.pow(10, $1.length))*100);}).replace(/^00$/, '').replace(/^(\d)$/, "$1" + "0") : "");<br />
return x[0] + x[1];</div>
<p>}<br />
</code></p>
<p>Just to show what it does, here is some testing that I did with the code. Original number on the left, new number on the right:</p>
<blockquote><p>1000 -&gt; 1,000<br />
1000.1 -&gt; 1,000.10<br />
1000.00 -&gt; 1,000<br />
0.00 -&gt; 0<br />
0.1 -&gt; 0.10<br />
0.10 -&gt; 0.10<br />
1000.1236123 -&gt; 1,000.12<br />
1000.1276123 -&gt; 1,000.13</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://michaelwright.me/2010/06/multi-format-number/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parse .extension as .php</title>
		<link>http://michaelwright.me/2010/06/parse-extension-as-php/</link>
		<comments>http://michaelwright.me/2010/06/parse-extension-as-php/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 11:27:18 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://michaelwright.me/?p=224</guid>
		<description><![CDATA[So, one of my friends asked me a moment ago whether it was possible to have a page named &#8220;rawr.james&#8221; and have it parse in the same way as &#8220;rawr.php&#8221;.  Quick searching shows that it&#8217;s possible through one simple line of .htaccess: AddType application/x-httpd-php .james Of course, you can change the &#8220;.james&#8221; to whatever extension [...]]]></description>
			<content:encoded><![CDATA[<p>So, one of my friends asked me a moment ago whether it was possible to have a page named &#8220;rawr.james&#8221; and have it parse in the same way as &#8220;rawr.php&#8221;.  Quick searching shows that it&#8217;s possible through one simple line of .htaccess:</p>
<p><code>AddType application/x-httpd-php .james</code></p>
<p>Of course, you can change the &#8220;.james&#8221; to whatever extension you want. Just save the file as .htaccess and upload to your server.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelwright.me/2010/06/parse-extension-as-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone/iPod Touch Detection</title>
		<link>http://michaelwright.me/2010/05/iphoneipod-touch-browser-detection/</link>
		<comments>http://michaelwright.me/2010/05/iphoneipod-touch-browser-detection/#comments</comments>
		<pubDate>Mon, 24 May 2010 09:02:37 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://michaelwright.me/?p=170</guid>
		<description><![CDATA[So many people are now developing websites that like to deliver specific content if you are viewing from an iPhone or iPod Touch. This can be done using a small snippet of coding that checks the HTTP_USER_AGENT of the browser. strpos($_SERVER['HTTP_USER_AGENT'], "iPhone"); This code could be used within a conditional statement such as: &#60;?php if [...]]]></description>
			<content:encoded><![CDATA[<p>So many people are now developing websites that like to deliver specific content if you are viewing from an iPhone or iPod Touch. This can be done using a small snippet of coding that checks the <em>HTTP_USER_AGENT</em> of the browser.</p>
<p><code>strpos($_SERVER['HTTP_USER_AGENT'], "iPhone");</code></p>
<p>This code could be used within a conditional statement such as:</p>
<p><code>&lt;?php<br />
if (strpos($_SERVER['HTTP_USER_AGENT'], "iPhone"))<br />
   echo 'You are using an iPhone';<br />
else<br />
   echo 'You are not usnig an iPhone';<br />
?&gt;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://michaelwright.me/2010/05/iphoneipod-touch-browser-detection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Under Development</title>
		<link>http://michaelwright.me/2010/05/under-development/</link>
		<comments>http://michaelwright.me/2010/05/under-development/#comments</comments>
		<pubDate>Sun, 16 May 2010 21:32:58 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://michaelwright.me/?p=87</guid>
		<description><![CDATA[This is my new blog &#38; portfolio. This will document information about myself ranging from education to work. My portfolio will be split up into various sections ranging from complete to works in progress. Also including some of my own personal projects. Hopefully my portfolio will be completed and online within a few days. Update: [...]]]></description>
			<content:encoded><![CDATA[<p>This is my new blog &amp; portfolio. This will document information about myself ranging from education to work. My portfolio will be split up into various sections ranging from complete to works in progress. Also including some of my own personal projects.</p>
<p>Hopefully my portfolio will be completed and online within a few days.</p>
<p><strong>Update</strong>: My <a title="Education" href="http://michaelwright.me/education">Education</a> &amp; <a title="About Me" href="http://michaelwright.me/about-me/">About Me</a> pages are now online.</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelwright.me/2010/05/under-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
