<?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>Milburn &#187; Fun</title>
	<atom:link href="http://instantsolve.net/blog/category/fun/feed/" rel="self" type="application/rss+xml" />
	<link>http://instantsolve.net/blog</link>
	<description>The Life and Work of Thomas Milburn</description>
	<lastBuildDate>Wed, 14 Oct 2009 10:58:56 +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>ExcelOff</title>
		<link>http://instantsolve.net/blog/2009/04/exceloff/</link>
		<comments>http://instantsolve.net/blog/2009/04/exceloff/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 19:51:10 +0000</pubDate>
		<dc:creator>milburn</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://instantsolve.net/blog/?p=176</guid>
		<description><![CDATA[Let me introduce my latest tool: ExcelOff. It cleans up badly formed tables created by Microsoft Excel and similarly bad programs. This tool came about because I have created a site which users can edit and add tables to through a visual editor. Unfortunately copying and pasting from Excel into this visual editor results in [...]]]></description>
			<content:encoded><![CDATA[<p class="first-child "><span title="L" class="cap"><span>L</span></span>et me introduce my latest tool: <a href="http://instantsolve.net/exceloff/">ExcelOff</a>. It cleans up badly formed tables created by Microsoft Excel and similarly bad programs.</p>
<p>This tool came about because I have created a site which users can edit and add tables to through a visual editor. Unfortunately copying and pasting from Excel into this visual editor results in &#8220;tag soup&#8221;!<span id="more-176"></span> I needed a solution.</p>
<p>I looked around and found <a href="http://wordoff.org/">WordOff</a> which cleans up word documents but doesn&#8217;t work on tables. I decided to take the code, convert it to PHP and modify it so that it doesn&#8217;t get ris of some of the essential stuff for tables. With the help of David Hopkin&#8217;s  <a href="http://semlabs.co.uk/journal/php-strip-attributes-class-for-xml-and-html">Strip Attributes Class</a></p>
<p>Please go to <a href="http://instantsolve.net/exceloff/">ExcelOff</a>, copy and paste a table from Excel or similar. Click clean up and lines of beautifully formed HTMl code will result!</p>
<p>Hopefully I will be able to incorporate this into a WordPress plugin for all WordPress users to conveniently use. Watch this space.</p>
]]></content:encoded>
			<wfw:commentRss>http://instantsolve.net/blog/2009/04/exceloff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript Anaglyph Maker</title>
		<link>http://instantsolve.net/blog/2009/04/javascript-anaglyph-maker/</link>
		<comments>http://instantsolve.net/blog/2009/04/javascript-anaglyph-maker/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 14:56:55 +0000</pubDate>
		<dc:creator>milburn</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://instantsolve.net/blog/?p=144</guid>
		<description><![CDATA[My own anaglyph maker uses PHP to make anaglyphs from two images uploaded by a user. But I&#8217;ve found someone who has gone one step further. They&#8217;ve managed to make them using JavaScript alone. Unfortunately Internet Explorer fails miserably on this task. This is because his method uses the canvas object which so far is [...]]]></description>
			<content:encoded><![CDATA[<p class="first-child "><img src="http://instantsolve.net/blog/wp-content/uploads/2009/04/mars-300x225.png" alt="mars" title="mars" width="300" height="225" class="alignright size-medium wp-image-152" /> <span title="M" class="cap"><span>M</span></span>y own <a href="http://instantsolve.net/anaglyph/">anaglyph maker</a> uses PHP to make anaglyphs from two images uploaded by a user. But I&#8217;ve found someone who has gone one step further. They&#8217;ve managed to make them <a href="http://svay.com/blog/index/post/2009/04/03/G%C3%A9n%C3%A9rer-des-anaglyphes-avec-javascript-et-canvas">using JavaScript alone</a>. Unfortunately Internet Explorer fails miserably on this task. This is because his method uses the canvas object which so far is only supported by Firefox, Safari and Opera.</p>
<p>It simply loads the two images into two canvas elements and extracts the red channel from one of them and inserts that red channel into the other canvas. Hey presto you get a simple anaglyph. This method has another flaw. Modifying an images data channels can only be done from an image on the same domain to obey the same domain security policy. A small proxy sorts that out but means the solution isn&#8217;t all JavaScript.<span id="more-144"></span></p>
<p>Here&#8217;s the source code for his anaglyph generator:</p>
<p><code>&lt;<span class="start-tag">script</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text/javascript"</span>&gt;<br />
&lt;!--<br />
Anaglyph = {<br />
imgLeft : null,<br />
imgRigt : null,<br />
//Load images<br />
load : function(left, right) {<br />
//console.log('Load');<br />
Anaglyph.imgLeft = document.createElement('img');<br />
Anaglyph.imgLeft.src = left;<br />
Anaglyph.imgRight = document.createElement('img');<br />
Anaglyph.imgRight.src = right;<br />
Anaglyph.wait();<br />
},<br />
//Wait for images to load<br />
wait: function() {<br />
if (Anaglyph.imgLeft.complete &amp;&amp; Anaglyph.imgRight.complete) {<br />
Anaglyph.make();<br />
} else {<br />
setTimeout('Anaglyph.wait()', 100);<br />
}<br />
},<br />
//Actually make the anaglyph with some canvas magic<br />
make: function() {<br />
//console.log('Make');<br />
var w = 640;<br />
var h = 480;<br />
var canvas = document.getElementsByTagName('canvas')[0];<br />
try {<br />
//Left image in temporary canvas<br />
var canvasLeft = document.createElement('canvas');<br />
canvasLeft.width = w;<br />
canvasLeft.height = h;<br />
var ctxLeft = canvasLeft.getContext('2d');<br />
ctxLeft.drawImage(Anaglyph.imgLeft, 0, 0, w, h);<br />
var dataLeft = ctxLeft.getImageData(0,0, w, h);<br />
//Right image in result canvas<br />
canvas.width = w;<br />
canvas.height = h;<br />
var ctx = canvas.getContext('2d');<br />
ctx.drawImage(Anaglyph.imgRight, 0, 0, w, h);<br />
var data = ctx.getImageData(0,0, w, h);<br />
for (var i=0,l=dataLeft.data.length/4; i&lt;l; i++) {<br />
data.data[i * 4 + 0] = dataLeft.data[i * 4 + 0];<br />
}<br />
ctx.putImageData(data, 0, 0);<br />
//console.log('Done!');<br />
} catch (e) {<br />
//console.log('FAIL!')<br />
}<br />
document.getElementById('result').className = '';<br />
}<br />
}<br />
function getQueryParameter(name) {<br />
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");<br />
var regexS = "[\\?&amp;]"+name+"=([^&amp;#]*)";<br />
var regex = new RegExp( regexS );<br />
var results = regex.exec( window.location.href );<br />
if( results == null ) {<br />
return "";<br />
} else {<br />
return results[1];<br />
}<br />
}<br />
window.onload = function() {<br />
if ('' != getQueryParameter('left') &amp;&amp; '' != getQueryParameter('right')) {<br />
var left = getQueryParameter('left');<br />
var right = getQueryParameter('right');<br />
document.getElementById('result').className = 'loading';<br />
Anaglyph.load(<br />
'image.php?url='+left,<br />
'image.php?url='+right<br />
);<br />
}<br />
}<br />
--&gt;<br />
&lt;/<span class="end-tag">script</span>&gt;</code></p>
<p>The canvas element can do so many things and my guess is we&#8217;ll be seeing it even more in the next few years.</p>
]]></content:encoded>
			<wfw:commentRss>http://instantsolve.net/blog/2009/04/javascript-anaglyph-maker/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Quiz</title>
		<link>http://instantsolve.net/blog/2009/03/php-quiz/</link>
		<comments>http://instantsolve.net/blog/2009/03/php-quiz/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 17:16:45 +0000</pubDate>
		<dc:creator>milburn</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://instantsolve.net/blog/?p=135</guid>
		<description><![CDATA[Do you know your PHP? If you think you do please try out the PHP quiz. This is part of a web application which I am developing. It is currently in the beta state so I would appreciate any feedback.]]></description>
			<content:encoded><![CDATA[<p class="first-child "><img class="alignright size-full wp-image-137" title="PHP quiz" src="http://instantsolve.net/blog/wp-content/uploads/2009/03/image1.gif" alt="PHP quiz" width="200" height="200" /> <span title="D" class="cap"><span>D</span></span>o you know your PHP? If you think you do please try out the <a href="http://instantsolve.net/quiz/view/php/">PHP quiz</a>. This is part of a web application which I am developing. It is currently in the beta state so I would appreciate any feedback.</p>
]]></content:encoded>
			<wfw:commentRss>http://instantsolve.net/blog/2009/03/php-quiz/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
