<?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 Gareth Morgan</title>
	<atom:link href="http://www.michaelgarethmorgan.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.michaelgarethmorgan.com</link>
	<description>Michaels website</description>
	<lastBuildDate>Thu, 22 Jul 2010 08:30:53 +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>SEO &#8211; The domain is vital</title>
		<link>http://www.michaelgarethmorgan.com/seo-the-domain-is-vital/</link>
		<comments>http://www.michaelgarethmorgan.com/seo-the-domain-is-vital/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 08:30:53 +0000</pubDate>
		<dc:creator>Michael Morgan</dc:creator>
				<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.michaelgarethmorgan.com/?p=313</guid>
		<description><![CDATA[Over the past few years and in particularly the last 18 months I&#8217;ve come to realize what I consider to be the most important factor for getting ranked high in the search engine results of todays search engines. It&#8217;s all about the domain name. Okay, so maybe it&#8217;s not ALL about the domain name but [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.michaelgarethmorgan.com/seo-the-domain-is-vital/" title="Importance of domain name"><img src="http://files.michaelgarethmorgan.com/importance-of-domain-name.png" alt="Importance of domain name" title="Importance of domain name" width="128" height="128" class="alignright size-full wp-image-314" /></a>Over the past few years and in particularly the last 18 months I&#8217;ve come to realize what I consider to be the most important factor for getting ranked high in the search engine results of todays search engines. It&#8217;s all about the domain name.</p>
<p>Okay, so maybe it&#8217;s not ALL about the domain name but the domain definitely plays a very big part. I&#8217;m saying this not based on scientific facts or even based on any particular tests or experiments but instead I based this on my own experience with SEO. Over the past 18 months or so I&#8217;ve launched several sites, some of which have achieved a page #1 ranking in Google whilst others have not. For each of these sites I&#8217;ve done the standard search engine optimization tasks including optimizing keywords, link building, article marketing and more. Looking over my sites I can see a trend that in general the sites whose domains are either an exact or very similar match to their primary keyword/phrase seem to be ranking much better compares to those sites whose domains are slightly less specific.</p>
<p>From this I&#8217;m led to believe that one of the most important things you can do if you intend to rank well in the search engines would be to make sure you choose the right domain name. I am by no means saying that choosing the perfect domain on its own will get you ranked higher. Instead I&#8217;m simply saying that a better, more specifically matched domain from what I can see has a big impact on how your site will rank (at least with Google).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelgarethmorgan.com/seo-the-domain-is-vital/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#8217;m not happy with Apple</title>
		<link>http://www.michaelgarethmorgan.com/im-not-happy-with-apple/</link>
		<comments>http://www.michaelgarethmorgan.com/im-not-happy-with-apple/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 22:05:10 +0000</pubDate>
		<dc:creator>Michael Morgan</dc:creator>
				<category><![CDATA[Everything else]]></category>

		<guid isPermaLink="false">http://www.michaelgarethmorgan.com/?p=309</guid>
		<description><![CDATA[What&#8217;s the worst thing that could happen to an affiliate site whose revenue comes from selling cases for the iPhone? Well, it&#8217;s happened to me. Due to the signal issues with the iPhone 4 Apple have decided that they will now provide free bumper cases to those who have or are about to purchase an [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.michaelgarethmorgan.com/im-not-happy-with-apple/" title="Apple affiliate program"><img src="http://files.michaelgarethmorgan.com/apple.png" alt="Apple affiliates" title="Apple affiliates" width="128" height="128" class="alignright size-full wp-image-310" /></a>What&#8217;s the worst thing that could happen to an affiliate site whose revenue comes from selling cases for the iPhone? Well, it&#8217;s happened to me. Due to the signal issues with the iPhone 4 Apple have decided that they will now provide free <a href="http://www.bumpercase.com" title="iPhone bumper">bumper cases</a> to those who have or are about to purchase an iPhone 4. On top of that they are also offering a full refund to all customers who have previously purchased a bumper case from Apple.</p>
<p>I&#8217;ve seen the effects of this with one of my affiliate sites right away and have watched sales figures plummet since the announcement was made. Sure, my site may not be affiliated with the official bumper case product but who&#8217;s going to buy an iPhone case if Apple are handing them out for free? There may be the occasional iPhone owner who wants something different than what Apple is offering and may go ahead and purchase their own but this has put myself and many other iPhone accessory affiliates at a disadvantage which will likely cost quite a bit in affiliate sales.</p>
<p>I guess it&#8217;s time to concentrate my SEO efforts on alternative products.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelgarethmorgan.com/im-not-happy-with-apple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upload an image using Java + PHP</title>
		<link>http://www.michaelgarethmorgan.com/upload-an-image-using-java-php/</link>
		<comments>http://www.michaelgarethmorgan.com/upload-an-image-using-java-php/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 12:01:31 +0000</pubDate>
		<dc:creator>Michael Morgan</dc:creator>
				<category><![CDATA[Software development]]></category>

		<guid isPermaLink="false">http://www.michaelgarethmorgan.com/?p=302</guid>
		<description><![CDATA[Whilst working on a recent project I needed a way of transferring images (screenshots to be specific) from the client machine to a web server hosted in the cloud. My choice of platform was Java on the client machine and then PHP on the server side to recieve and process the upload. So basically I [...]]]></description>
			<content:encoded><![CDATA[<p>Whilst working on a recent project I needed a way of transferring images (screenshots to be specific) from the client machine to a web server hosted in the cloud. My choice of platform was Java on the client machine and then PHP on the server side to recieve and process the upload.</p>
<p>So basically I needed to upload an image to a web server using Java and PHP. Reading and writing simple data to and from a web server with Java is pretty easy really but when it comes to transferring files things get that little bit tougher. This is because when uploading files the content type of the HTTP request changes from plain text to multipart making it trickier. You could either write a whole load of extra code to deal with this or you could simply send the data over as plain text and then just let PHP deal with it. Here&#8217;s how it&#8217;s done.<span id="more-302"></span></p>
<h3>The Java</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Setup vars</span>
<span style="color: #003399;">HttpURLConnection</span> httpUrlConnection<span style="color: #339933;">;</span>
<span style="color: #003399;">OutputStream</span> outputStream<span style="color: #339933;">;</span>
<span style="color: #003399;">BufferedInputStream</span> fileInputStream<span style="color: #339933;">;</span>
<span style="color: #003399;">BufferedReader</span> serverReader<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> totalBytes<span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> bytesTrasferred<span style="color: #339933;">;</span>
<span style="color: #003399;">String</span> response <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">String</span> serverResponse <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">String</span> localFileName <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;mypicture.jpg&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Establish a connection</span>
httpUrlConnection<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">HttpURLConnection</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">URL</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://www.example.com/upload.php&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">openConnection</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
httpUrlConnection.<span style="color: #006633;">setDoOutput</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
httpUrlConnection.<span style="color: #006633;">setRequestMethod</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;POST&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
outputStream <span style="color: #339933;">=</span> httpUrlConnection.<span style="color: #006633;">getOutputStream</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Buffered input stream</span>
fileInputStream <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">BufferedInputStream</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">FileInputStream</span><span style="color: #009900;">&#40;</span>localFileName<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Get the size of the image</span>
totalBytes <span style="color: #339933;">=</span> fileInputStream.<span style="color: #006633;">available</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Loop through the files data</span>
<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> totalBytes<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// Write the data to the output stream</span>
	outputStream.<span style="color: #006633;">write</span><span style="color: #009900;">&#40;</span>fileInputStream.<span style="color: #006633;">read</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	bytesTrasferred <span style="color: #339933;">=</span> i <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Close the output stream</span>
outputStream.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// New reader to get server response</span>
serverReader <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">BufferedReader</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">InputStreamReader</span><span style="color: #009900;">&#40;</span>httpUrlConnection.<span style="color: #006633;">getInputStream</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Read the servers response</span>
serverResponse <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">while</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>response <span style="color: #339933;">=</span> serverReader.<span style="color: #006633;">readLine</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	serverResponse <span style="color: #339933;">=</span> serverResponse <span style="color: #339933;">+</span> response<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Close the buffered reader</span>
serverReader.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Close the file input stream</span>
fileInputStream.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>The PHP</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Config</span>
<span style="color: #000088;">$uploadBase</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;img/&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$uploadFilename</span> <span style="color: #339933;">=</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;.jpg&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$uploadPath</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$uploadBase</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$uploadFilename</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Upload directory</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_dir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$uploadBase</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #990000;">mkdir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$uploadBase</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Grab the data</span>
<span style="color: #000088;">$incomingData</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'php://input'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Valid data?</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$incomingData</span><span style="color: #009900;">&#41;</span>
	<span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;No input data&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Write to disk</span>
<span style="color: #000088;">$fh</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$uploadPath</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'w'</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Error opening file&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fwrite</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fh</span><span style="color: #339933;">,</span> <span style="color: #000088;">$incomingData</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Error writing to file&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fh</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Error closing file&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Success&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>And that&#8217;s all there is. By placing the PHP script above onto a suitable web server and then executing the Java code you&#8217;ll be able to quite easily and painlessly transfer images (or any other file types) from the desktop client to the web.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelgarethmorgan.com/upload-an-image-using-java-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#8217;ve graduated</title>
		<link>http://www.michaelgarethmorgan.com/ive-graduated/</link>
		<comments>http://www.michaelgarethmorgan.com/ive-graduated/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 11:19:53 +0000</pubDate>
		<dc:creator>Michael Morgan</dc:creator>
				<category><![CDATA[Everything else]]></category>

		<guid isPermaLink="false">http://www.michaelgarethmorgan.com/?p=297</guid>
		<description><![CDATA[I&#8217;m actually a few days late posting this as it happened mid last week, but, I&#8217;ve now graduated from university with a upper second class honours degree in Software Engineering. One thing is for sure is that I&#8217;m glad to have it over and done with. It&#8217;s not that the work was particularly difficult it [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m actually a few days late posting this as it happened mid last week, but, I&#8217;ve now graduated from university with a upper second class honours degree in Software Engineering. One thing is for sure is that I&#8217;m glad to have it over and done with. It&#8217;s not that the work was particularly difficult it was just that I don&#8217;t particularly like writing 5,000 word reports <img src='http://www.michaelgarethmorgan.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>I suppose some sort of celebration is in order <img src='http://www.michaelgarethmorgan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelgarethmorgan.com/ive-graduated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Themedy &#8211; Free WordPress theme</title>
		<link>http://www.michaelgarethmorgan.com/themedy-free-wordpress-theme/</link>
		<comments>http://www.michaelgarethmorgan.com/themedy-free-wordpress-theme/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 20:19:08 +0000</pubDate>
		<dc:creator>Michael Morgan</dc:creator>
				<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.michaelgarethmorgan.com/?p=288</guid>
		<description><![CDATA[I&#8217;d like to share with you my latest free WordPress theme which is called Themedy. This free WordPress theme comes packed with plenty of cool features including four colour schemes, a customizable image scroller and much more. You can quickly and easily change things like the colour scheme, the scrolling images (and their link), footer [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d like to share with you my latest free WordPress theme which is called Themedy. This free WordPress theme comes packed with plenty of cool features including four colour schemes, a customizable image scroller and much more. You can quickly and easily change things like the colour scheme, the scrolling images (and their link), footer text, navigation text and more right from the administration panel.</p>
<p><a href="http://files.michaelgarethmorgan.com/Themedy.rar"><img src="http://files.michaelgarethmorgan.com/themedy-free-wordpress-theme-460x151.png" alt="Free WordPress theme - Themedy" title="Free WordPress theme - Themedy" width="460" height="151" class="aligncenter size-medium wp-image-291" /></a></p>
<p>A demo is available <a href="http://www.michaelgarethmorgan.com/wordpress/"><strong>here</strong></a>.<br />
This WordPress is available for use for free and can be downloaded <strong><a href="http://files.michaelgarethmorgan.com/Themedy.rar" title="Free WordPress theme Themedy">here</a></strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelgarethmorgan.com/themedy-free-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I have an iPad</title>
		<link>http://www.michaelgarethmorgan.com/i-have-an-ipad/</link>
		<comments>http://www.michaelgarethmorgan.com/i-have-an-ipad/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 19:02:06 +0000</pubDate>
		<dc:creator>Michael Morgan</dc:creator>
				<category><![CDATA[Everything else]]></category>

		<guid isPermaLink="false">http://www.michaelgarethmorgan.com/i-have-an-ipad/</guid>
		<description><![CDATA[I&#8217;ve had my eye on an iPad for quite some time now and I finally gave in. After a little shopping around and a few days of hearing the words &#8220;out of stock&#8221; I finally found somewhere which had one. I ended up getting a 16gb wifi only iPad from PC World. And, I absolutely [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had my eye on an iPad for quite some time now and I finally gave in. After a little shopping around and a few days of hearing the words &#8220;out of stock&#8221; I finally found somewhere which had one. I ended up getting a 16gb wifi only iPad from PC World. </p>
<p>And, I absolutely love the thing! I&#8217;ve barely put it down since I got my hands on it yesterday. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelgarethmorgan.com/i-have-an-ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comments are back</title>
		<link>http://www.michaelgarethmorgan.com/comments-are-back/</link>
		<comments>http://www.michaelgarethmorgan.com/comments-are-back/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 12:22:04 +0000</pubDate>
		<dc:creator>Michael Morgan</dc:creator>
				<category><![CDATA[Everything else]]></category>

		<guid isPermaLink="false">http://www.michaelgarethmorgan.com/?p=276</guid>
		<description><![CDATA[A little while back when I redesigned this site I, for whatever reason decided not to make use of the comments section meaning not only could no one post comments to any of my posts but also that existing comments made prior to the redesign simply dissapeared. I&#8217;ve now decided to bring comments back so [...]]]></description>
			<content:encoded><![CDATA[<p>A little while back when I redesigned this site I, for whatever reason decided not to make use of the comments section meaning not only could no one post comments to any of my posts but also that existing comments made prior to the redesign simply dissapeared. I&#8217;ve now decided to bring comments back so now anybody can say what they think. So&#8230; get commenting!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelgarethmorgan.com/comments-are-back/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery toggle fade in/out</title>
		<link>http://www.michaelgarethmorgan.com/jquery-toggle-fade-in-out/</link>
		<comments>http://www.michaelgarethmorgan.com/jquery-toggle-fade-in-out/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 11:40:03 +0000</pubDate>
		<dc:creator>Michael Morgan</dc:creator>
				<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.michaelgarethmorgan.com/?p=270</guid>
		<description><![CDATA[For a recent interface design I had to apply a little jQuery to make some of the page interactions more intuitive (and nicer to use). One of the things needed was a quick and easy to way to toggle a particular elements display but in a way so that it faded in and out. The [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.michaelgarethmorgan.com/jquery-toggle-fade-in-out/"><img src="http://files.michaelgarethmorgan.com/jquery-toggle-fade-in-out.png" alt="jQuery toggle fade in/out" title="jQuery toggle fade in/out" width="128" height="128" class="alignright size-full wp-image-274" /></a>For a recent interface design I had to apply a little jQuery to make some of the page interactions more intuitive (and nicer to use). One of the things needed was a quick and easy to way to toggle a particular elements display but in a way so that it faded in and out. The idea was simple &#8211; have a class which could be attached to a bunch of anchor tags which when clicked would fade in a div element. Then, upon clicking on that link (or any of the other links which also had the same class) the div element would fade out.</p>
<p>It&#8217;s actually quite easy really. Here&#8217;s the code for toggling an element on click with jQuery.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#hiddenbox'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">'toggle'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'fast'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>To use it simply have an anchor tag like this&#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;&quot; class=&quot;toggle-fade&quot;&gt;Toggle box&lt;/a&gt;</pre></td></tr></table></div>

<p>And then the jQuery code&#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.toggle-fade'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#hiddenbox).animate({opacity: '</span>toggle<span style="color: #3366CC;">'}, '</span>fast<span style="color: #3366CC;">');
		return false;
	});
});</span></pre></td></tr></table></div>

<p>Perfect!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelgarethmorgan.com/jquery-toggle-fade-in-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeIgniter model database interaction</title>
		<link>http://www.michaelgarethmorgan.com/codeigniter-model-database-interaction/</link>
		<comments>http://www.michaelgarethmorgan.com/codeigniter-model-database-interaction/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 22:57:45 +0000</pubDate>
		<dc:creator>Michael Morgan</dc:creator>
				<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.michaelgarethmorgan.com/?p=266</guid>
		<description><![CDATA[Recently I&#8217;ve been doing quite a bit of work with the PHP MVC framework, CodeIgniter. First of all &#8211; it&#8217;s great! I&#8217;ve always been a fan of object oriented programming software approaches and the CodeIgniter handles this almost perfectly. As my CodeIgniter based projects start to grow, more and more database tables are introduced which [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve been doing quite a bit of work with the PHP MVC framework, CodeIgniter. First of all &#8211; it&#8217;s great! I&#8217;ve always been a fan of object oriented programming software approaches and the CodeIgniter handles this almost perfectly. As my CodeIgniter based projects start to grow, more and more database tables are introduced which is made a lot easier with the model part of the MVC design pattern.</p>
<p>When it comes to CodeIgniter though I&#8217;ve found that all of my table models all have the same 2 common functions. To me it makes sense to have this functionality built into the parent &#8216;Model&#8217; class within CodeIgniter but since they&#8217;re not here they are for you to add them yourself.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> get<span style="color: #009900;">&#40;</span><span style="color: #000088;">$where</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$limit</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1000</span><span style="color: #339933;">,</span> <span style="color: #000088;">$offset</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$rows</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">db</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">select</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'*'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">db</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">where</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$where</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
	<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">db</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;tablename&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$limit</span><span style="color: #339933;">,</span> <span style="color: #000088;">$offset</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// How many rows?</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// Loop through each row</span>
		<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">result</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">AS</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$rows</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$rows</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> get_by_id<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ID</span><span style="color: #339933;">,</span> <span style="color: #000088;">$where</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$where</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_merge</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ID'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$ID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$where</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$rows</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$where</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$rows</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>So what exactly are these two functions? They&#8217;re a quick and simple way for retrieving information from a database table using the relevant model within your application. By simply calling either of these functions you can quickly retrieve whatever data required and then carry on without needing to worry about table names, etc. So, if for example for whatever reason you had to rename a table you&#8217;d only need to modify it in just the one place (in the model) as opposed to having to wade through all your code if you&#8217;ve typed it manually. Sure, the likelyhood of you changing a table name is quite slim but you never know.</p>
<p>Of course you may want to extend this to allow for updates, deletes and inserts which only takes a few minutes. Just thought I&#8217;d put this out there in case anyone&#8217;s interested.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelgarethmorgan.com/codeigniter-model-database-interaction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An Unknown error occurred (9)</title>
		<link>http://www.michaelgarethmorgan.com/an-unknown-error-occurred-9-iphone/</link>
		<comments>http://www.michaelgarethmorgan.com/an-unknown-error-occurred-9-iphone/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 19:30:27 +0000</pubDate>
		<dc:creator>Michael Morgan</dc:creator>
				<category><![CDATA[Everything else]]></category>

		<guid isPermaLink="false">http://www.michaelgarethmorgan.com/?p=264</guid>
		<description><![CDATA[I&#8217;ve just tried updating my iPhone OS to the latest version but came across a very annoying problem. After downloading the iPhone update and clicked through the steps I received the error &#8220;An Unknown error occurred (9)&#8221;. After a little searching around the web for a good fifteen minutes or so I wasn&#8217;t able to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just tried updating my iPhone OS to the latest version but came across a very annoying problem. After downloading the iPhone update and clicked through the steps I received the error &#8220;An Unknown error occurred (9)&#8221;. After a little searching around the web for a good fifteen minutes or so I wasn&#8217;t able to find any fix to this although I did come across plenty of forum threads where people have been having the same problem.</p>
<p>Some of the suggestions I fould included changing the USB cable, using a different USB port, upgrading to the latest iTunes version, etc. &#8211; All the standard stuff really. But none of this seemed to work.</p>
<p>After a little thinking I thought I&#8217;d disable my firewall (why not aye?). And guess what, it worked perfectly. My iPhone has been updated and is working nicely.</p>
<p>I just thought I&#8217;d put this up in case anyone else comes across the same problem and is looking for possible fixes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelgarethmorgan.com/an-unknown-error-occurred-9-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
