<?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>Barryvan &#187; Barry van Oudtshoorn</title>
	<atom:link href="http://www.barryvan.com.au/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.barryvan.com.au</link>
	<description>Music, Programming, Design</description>
	<lastBuildDate>Wed, 23 Jun 2010 04:18:22 +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>iOS 4</title>
		<link>http://www.barryvan.com.au/2010/06/ios-4/</link>
		<comments>http://www.barryvan.com.au/2010/06/ios-4/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 23:25:16 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=451</guid>
		<description><![CDATA[I&#8217;ve been living with Apple&#8217;s new OS for about a day now, and the conclusion I&#8217;ve come to is that Apple dropped the ball. There are so many minor frustrations, as well as a few big ones, that the whole experience is at best annoying, and at worst unbearable. The new iOS isn&#8217;t all bad. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been living with Apple&#8217;s new OS for about a day now, and the conclusion I&#8217;ve come to is that Apple dropped the ball. There are so many minor frustrations, as well as a few big ones, that the whole experience is at best annoying, and at worst unbearable.</p>
<p>The new iOS isn&#8217;t all bad. The animations feel snappier, Springboard is prettier, and it&#8217;s got the slick Apple feel which everyone so desperately wants to emulate. The big one, of course, is multitasking, and that I think they got right.</p>
<p>But then there are the problems. Apps crash with neither rhyme nor reason: the iPod app won&#8217;t even startup properly for me anymore. Google Sync is kaput (although I think Google should take some of the blame for that). The new folders, whilst useful, are, to be charitable, ugly. It all feels as though it was released without going through proper testing, let alone going through the spit-and-polish phase.</p>
<p>I was looking forward to this update. I thought that, like all the iOS versions before it, it would Just Work<sup>TM</sup>. I hope that when they patch iOS 4, they don&#8217;t introduce any new features: there&#8217;s just too much that needs to be fixed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2010/06/ios-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Work</title>
		<link>http://www.barryvan.com.au/2010/05/work/</link>
		<comments>http://www.barryvan.com.au/2010/05/work/#comments</comments>
		<pubDate>Fri, 14 May 2010 10:28:10 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=447</guid>
		<description><![CDATA[I&#8217;m a software developer, working for SEQTA Software. We develop software for the education sector; basically, we aim to let teachers just get on with teaching, rather than having to faff around with a myriad different poorly-designed systems. I&#8217;m responsible for most of the front-end development of our two flagship products, Teachers&#8217; Assistant and SEQTA [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a software developer, working for <a href="http://www.seqta.com.au">SEQTA Software</a>. We develop software for the education sector; basically, we aim to let teachers just get on with teaching, rather than having to faff around with a myriad different poorly-designed systems. I&#8217;m responsible for most of the front-end development of our two flagship products, <a href="http://www.seqta.com.au/teachers-assistant">Teachers&#8217; Assistant</a> and <a href="http://www.seqta.com.au/coneqt">SEQTA Coneqt</a>. Recently, I also redesigned the <a href="http://www.seqta.com.au">company website</a>.</p>
<p>Why am I bothering to tell you this? Because I enjoy what I do. I get to develop software that&#8217;s genuinely useful, that people actually appreciate, and that has concrete benefits. Oh, and I also get to play with all of the latest and most interesting new browser developments. One of the things I enjoy most about my job is getting out to sites and training people one-on-one. I love seeing people get caught up in what&#8217;s possible, and I particularly appreciate it when they come up with new ideas &#8212; ideas which can sometimes become central features.</p>
<p>I know, I know, this sounds a lot like I&#8217;m just banging on about work to earn brownie points. But the really weird thing is, it&#8217;s the truth. Yes, I&#8217;m young and idealistic. But then, I think that I&#8217;m work in a young and pretty-nearly ideal job.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2010/05/work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generative Music</title>
		<link>http://www.barryvan.com.au/2010/03/generative-music/</link>
		<comments>http://www.barryvan.com.au/2010/03/generative-music/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 08:08:11 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[Ambient]]></category>
		<category><![CDATA[Chillout]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web design]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=443</guid>
		<description><![CDATA[Continuing my HTML5 and canvas experiments, I&#8217;ve put together a generative music system. Essentially, a series of particles move across a field, occasionally triggering sounds &#8212; the sound triggered depends on their location in the field. There is, of course, a little bit more to it than that. Under the hood, I&#8217;ve got a series [...]]]></description>
			<content:encoded><![CDATA[<p>Continuing my HTML5 and canvas experiments, I&#8217;ve put together a generative music system. Essentially, a series of particles move across a field, occasionally triggering sounds &#8212; the sound triggered depends on their location in the field.</p>
<p>There is, of course, a little bit more to it than that. Under the hood, I&#8217;ve got a series of HTML5 Audio objects that are used to provide polyphonic audio using a simple round-robin algorithm (I encoded the audio in OGG, so you&#8217;ll need to use an OGG-friendly browser, like <a href="http://www.getfirefox.com">Firefox</a>). The particles are much simpler than those in my <a href="/2010/03/canvas-swarms/">previous canvas dalliance</a>, in that they don&#8217;t swarm, and their motion is more linear.</p>
<div class="screenshots">
<a href="/demos/generative.html"><br/><br />
<img alt="Generative Audio Screenshot" src="/wp-content/uploads/2010/03/generative.png" class="aligncenter size-full"/><br/><br />
View (and hear!) it live<br/><br />
</a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2010/03/generative-music/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Canvas Swarms</title>
		<link>http://www.barryvan.com.au/2010/03/canvas-swarms/</link>
		<comments>http://www.barryvan.com.au/2010/03/canvas-swarms/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 00:27:18 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web design]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=440</guid>
		<description><![CDATA[I&#8217;ve been meaning to start playing with the HTML5 &#60;canvas&#62; element for a while now, and yesterday I took the opportunity. I translated a Processing sketch I made a while ago into JavaScript (with a few minor enhancements). View it live Essentially, 1 to 3 swarms of particles move around the canvas, reproducing when the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been meaning to start playing with the HTML5 &lt;canvas&gt; element for a while now, and yesterday I took the opportunity. I translated a Processing sketch I made a while ago into JavaScript (with a few minor enhancements).</p>
<div class="screenshots">
<a href="/demos/swarms/swarms.html"><br />
<img class="aligncenter size-full" src="/demos/swarms/swarms.png" alt="Swarms Screenshot"/><br />
View it live<br />
</a>
</div>
<p>Essentially, 1 to 3 swarms of particles move around the canvas, reproducing when the conditions are just right, and dying of old age. Quite simple, but the patterns produced can be really quite pretty.</p>
<p>One interesting thing that I discovered whilst doing this is that you can&#8217;t pass around a canvas&#8217; context at the instantiation of a MooTools class &#8212; it complains about wrapped natives. That&#8217;s why, if you like in the source JavaScript, you&#8217;ll see me pass the actual context around to various functions. I&#8217;d be interested in hearing if anyone has a workaround for this, because this is, well, a bit clunky.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2010/03/canvas-swarms/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTML: IE file submission</title>
		<link>http://www.barryvan.com.au/2010/02/html-ie-file-submission/</link>
		<comments>http://www.barryvan.com.au/2010/02/html-ie-file-submission/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 07:57:22 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web design]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=437</guid>
		<description><![CDATA[I&#8217;ve been bumping up against an interesting bug in Internet Explorer recently, and, having just found the solution, thought I&#8217;d share it with you. The problem is that in Internet Explorer (tested 7 &#038; 8), when your document is in quirks mode, uploading a file sometimes just sends through the file name, without the actual [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been bumping up against an interesting bug in Internet Explorer recently, and, having just found the solution, thought I&#8217;d share it with you.</p>
<p>The problem is that in Internet Explorer (tested 7 &#038; 8), when your document is in quirks mode, uploading a file sometimes just sends through the file name, without the actual body of the request. Put the document into standards mode, and it all works. It should be noted that this is when you&#8217;re dynamically setting up the elements used with JavaScript.</p>
<p>The cause? In quirks mode, the <em>enctype</em> attribute isn&#8217;t supported. So whilst setting &#8220;encType&#8221; on the form element to the correct &#8220;multipart/form-data&#8221; will indeed set this attribute, it won&#8217;t actually cause the upload to include the file. Instead, you need to set the <em>encoding</em> attribute to this value, too. It certainly doesn&#8217;t help that the MSDN article on the &lt;input type=&#8221;file&#8221;&gt; element tells you to set &#8220;enctype&#8221;, but makes no mention of &#8220;encoding&#8221;.</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/ms533744(VS.85).aspx">MSDN: &#8216;Encoding&#8217; property</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/cc304100%28VS.85%29.aspx">MSDN: &#8216;Enctype&#8217; property</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms535263%28VS.85%29.aspx">MSDN: &lt;input type=&#8221;file&#8221;&gt; element</a></li>
</ul>
<p>I couldn&#8217;t find any reference to this problem on the intertubes (although maybe I just didn&#8217;t look hard enough), so hopefully this will help someone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2010/02/html-ie-file-submission/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript: Print a single element</title>
		<link>http://www.barryvan.com.au/2010/02/javascript-print-a-single-element/</link>
		<comments>http://www.barryvan.com.au/2010/02/javascript-print-a-single-element/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 08:18:47 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web design]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=434</guid>
		<description><![CDATA[Sometimes, you&#8217;ll want to allow users the ability to print only a part of your page; for example, a table but not the various links around the page. It&#8217;s possible to use a printing stylesheet, but this can cause severe headaches when you need different parts printed at different times. Really, we want to be [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, you&#8217;ll want to allow users the ability to print only a part of your page; for example, a table but not the various links around the page. It&#8217;s possible to use a printing stylesheet, but this can cause severe headaches when you need different parts printed at different times. Really, we want to be able to just say <strong>element.printElement()</strong>, and have it just work. That&#8217;s what the MooTools function below does. It&#8217;s loosely based around the concepts outlined at <a href="http://www.bennadel.com/blog/1591-Ask-Ben-Print-Part-Of-A-Web-Page-With-jQuery.htm">this website</a>.</p>
<pre class="brush: javascript">Element.implement({
	printElement: function() {
		var strName = &#039;printer-&#039; + (new Date()).getTime(),
		styles = $$(&#039;link[type=text/css]&#039;).clone(),
		title = document.title,
		that = this,
		iframe = new IFrame({
			name: strName,
			styles: {
				width: 1,
				height: 1,
				position: &#039;absolute&#039;,
				left: -9999
			},
			events: {
				load: function() {
					var doc = this.contentDocument || window.frames[strName].document;
					doc.title = title;
					$(doc.body).adopt(styles, that.clone());
					this.contentWindow.focus(); // IE requires us to focus before printing, or the parent prints.
					this.contentWindow.print();
				}
			}
		}).inject($(document.body));
		iframe.dispose.delay(15000); // Destroy the iframe in 15s so that it doesn&#039;t hang around.
	}
});</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2010/02/javascript-print-a-single-element/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Songs for the Cure 2010</title>
		<link>http://www.barryvan.com.au/2010/02/songs-for-the-cure-2010/</link>
		<comments>http://www.barryvan.com.au/2010/02/songs-for-the-cure-2010/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 10:57:44 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=428</guid>
		<description><![CDATA[Last year, I was proud to be part of the inaugural Indie Music Cancer Drive. Along with a whole lot of very talented artists, I contributed music to a compilation album, &#8220;Songs for the Cure&#8221;. All the proceeds from the sales of this album went to the American Cancer Society. This year, I am once [...]]]></description>
			<content:encoded><![CDATA[<p>Last year, I was proud to be part of the inaugural <b>Indie Music Cancer Drive</b>. Along with a whole lot of very talented artists, I contributed music to a compilation album, &#8220;Songs for the Cure&#8221;. All the proceeds from the sales of this album went to the American Cancer Society.</p>
<div style="text-align:center;"><img src="http://www.cancerdrive.org/SongsCure10Banner-sig.jpg" alt="Songs for the Cure 2010"/></div>
<p>This year, I am once again contributing. I just finished work on the track I will be contributing, so I thought it high time I let everyone know about this. Josh Whelchel, the organiser of the drive (and a fantastic musician to boot), has set a target of $10,000 for this year. If you donate $25 or more, you receive a physical copy of the (two disc!) album; otherwise, you receive the album digitally.</p>
<p>Here&#8217;s the official media release:</p>
<blockquote>
<h2>Indie Music Cancer Drive to Release Songs for the Cure &#8217;10 Album</h2>
<p><b>Twenty-eight artists join together to raise money for the American Cancer Society and aim to raise $10,000.</b></p>
<p><i>Cincinnati, OH, January 24th, 2010.</i> &#8211; The Indie Music Cancer Society will release it&#8217;s 2010 compilation, <b>Songs for the Cure &#8217;10</b> on March 1st, 2010 and forward 100% of all donations and profits to the American Cancer Society through its Relay for Life event held on April 23rd, 2010 at the University of Cincinnati.  The album will feature music from over twenty-eight (28) diverse artists, including Select Start, big giant circles, Alec Holowka, Two Seconds Away, Jay Tholen, Josh Whelchel, Renee Winter, and others.  The organization is currently accepting donations, and all donors of $25 or more before MARCH 1, 2010 will receive a free physical copy of the album.  Supporters with $10 or more will receive a free digital copy.  Genres represented include Pop, Rock, Alternative, Chiptunes, Instrumental, Opera, Classical, Avant-Garde, Jazz, Fusion, and many others.  The organization raised over $6,000 for the event last year and is still forwarding profits from last year&#8217;s album, available on iTunes, Amazon, and others.  A full list of artists can be found at the Songs for the Cure &#8217;10 website at <a href="http://www.cancerdrive.org" target="_blank">http://www.cancerdrive.org</a>.  The fundraiser aims to raise $10,000 by April 23rd, 2010, preceding a digital release of the album to iTunes, Amazon, CDBaby, and other retailers.  Donations are accepted through <a href="http://www.cancerdrive.org" target="_blank">http://www.cancerdrive.org</a>.</p>
<p>For more information please contact:</p>
<p>JOSH WHELCHEL<br />
(513) 549-2336<br />
<a href="http://www.cancerdrive.org" target="_blank">http://www.cancerdrive.org</a>
</p></blockquote>
<p>So there you have it. And for good measure, here&#8217;s the promotional video:</p>
<div style="text-align:center;"><object width="601" height="338"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=8933889&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=8933889&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="601" height="338"></embed></object></div>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2010/02/songs-for-the-cure-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another new theme</title>
		<link>http://www.barryvan.com.au/2010/01/another-new-theme/</link>
		<comments>http://www.barryvan.com.au/2010/01/another-new-theme/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 01:25:15 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=416</guid>
		<description><![CDATA[I was never really happy with my previous 2010 theme, so I&#8217;ve gone and done a completely new one. This new one makes extensive use of CSS3 properties, such as gradients and shadows. It looks best in Firefox &#62;= 3.6,followed by Safari &#62;= 4, then Chrome &#62;= 4, Opera &#62;= 10, and IE &#62;= 8. [...]]]></description>
			<content:encoded><![CDATA[<p>I was never really happy with my previous 2010 theme, so I&#8217;ve gone and done a completely new one.</p>
<p>This new one makes extensive use of CSS3 properties, such as gradients and shadows. It looks best in Firefox &gt;= 3.6,followed by Safari &gt;= 4, then Chrome &gt;= 4, Opera &gt;= 10, and IE &gt;= 8. Theoretically, Firefox and Safari/Chrome support the same level of features, but the webkit gradient syntax is absolutely <em>awful</em>. It&#8217;s confusing, needlessly complex, and poorly thought-out, in my opinion. Contrast the following two lines:</p>
<pre class="brush: css">background: -moz-linear-gradient(top, #111, #333);
background: -webkit-gradient(linear, left top, left bottom, from(#222), to(#333));</pre>
<p>See what I mean?</p>
<div class="screenshots"><img class="aligncenter size-full wp-image-418" title="Gecko rendering" src="http://www.barryvan.com.au/wp-content/uploads/2010/01/gecko.png" alt="" width="200" height="200" /><img class="aligncenter size-full wp-image-420" title="Webkit rendering" src="http://www.barryvan.com.au/wp-content/uploads/2010/01/webkit.png" alt="" width="200" height="199" /><img class="aligncenter size-full wp-image-419" title="Trident rendering" src="http://www.barryvan.com.au/wp-content/uploads/2010/01/trident.png" alt="" width="200" height="200" /></div>
<p>Gecko (Firefox), Webkit (Safari), and Trident (IE) rendering.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2010/01/another-new-theme/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Clean Word markup</title>
		<link>http://www.barryvan.com.au/2010/01/clean-word-markup/</link>
		<comments>http://www.barryvan.com.au/2010/01/clean-word-markup/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 03:21:24 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=410</guid>
		<description><![CDATA[When writing a web-app that accepts formatted input from users, you&#8217;ll often find that they will copy and paste text from Microsoft Word. Unfortunately, Word fills the markup with lots of unnecessary and unwanted muck. To clean this all up, I wrote the following function (directly implemented on the String prototype below): String.implement({ sanitiseWord: function() [...]]]></description>
			<content:encoded><![CDATA[<p>When writing a web-app that accepts formatted input from users, you&#8217;ll often find that they will copy and paste text from Microsoft Word. Unfortunately, Word fills the markup with lots of unnecessary and unwanted muck. To clean this all up, I wrote the following function (directly implemented on the String prototype below):</p>
<pre class="brush: javascript">String.implement({
	sanitiseWord: function() {
		var s = this.replace(/\r/g, &#039;\n&#039;).replace(/\n/g, &#039; &#039;);
		var rs = [];
		rs.push(/&lt;!--.+?--&gt;/g); // Comments
		rs.push(/&lt;title&gt;.+?&lt;\/title&gt;/g); // Title
		rs.push(/&lt;(meta|link|.?o:|.?style|.?div|.?head|.?html|body|.?body|.?span|!\[)[^&gt;]*?&gt;/g); // Unnecessary tags
		rs.push(/ v:.*?=&quot;.*?&quot;/g); // Weird nonsense attributes
		rs.push(/ style=&quot;.*?&quot;/g); // Styles
		rs.push(/ class=&quot;.*?&quot;/g); // Classes
		rs.push(/(&amp;nbsp;){2,}/g); // Redundant &amp;nbsp;s
		rs.push(/&lt;p&gt;(\s|&amp;nbsp;)*?&lt;\/p&gt;/g); // Empty paragraphs
		rs.each(function(regex) {
			s = s.replace(regex, &#039;&#039;);
		});
		return s.replace(/\s+/g, &#039; &#039;);
	}
});</pre>
<p>If you&#8217;re not using MooTools, the function will look something like this:</p>
<pre class="brush: javascript">String.prototype.sanitiseWord = function() {
// function body here...
};</pre>
<h2>Usage</h2>
<pre class="brush: javascript">var s = &quot;(some awful Word markup)&quot;.sanitiseWord();</pre>
<p>In one of the tests I ran, the input went from around 7000 characters to just 700.</p>
<h2>Example</h2>
<p><iframe style="width: 100%; height: 300px" src="http://mootools.net/shell/26Jpf/embedded/"></iframe></p>
<p>Some of the regular expressions I used were adapted from C# ones in <a href="http://www.codinghorror.com/blog/archives/000485.html">a post by Jeff Atwood</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2010/01/clean-word-markup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Full-width text inputs without extraneous markup or scripting</title>
		<link>http://www.barryvan.com.au/2010/01/full-width-text-inputs-without-extraneous-markup-or-scripting/</link>
		<comments>http://www.barryvan.com.au/2010/01/full-width-text-inputs-without-extraneous-markup-or-scripting/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 23:56:34 +0000</pubDate>
		<dc:creator>Barry van Oudtshoorn</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web design]]></category>

		<guid isPermaLink="false">http://www.barryvan.com.au/?p=403</guid>
		<description><![CDATA[The problem When styling text &#60;input&#62; elements, it&#8217;s fairly common to run into a serious problem: they don&#8217;t behave like block-level elements. Note: In all of the examples, the container element is filled with blue, and the &#60;input&#62; itself is filled with red and has an opacity of 50% so that you can see it [...]]]></description>
			<content:encoded><![CDATA[<h1>The problem</h1>
<p>When styling text &lt;input&gt; elements, it&#8217;s fairly common to run into a serious problem: they don&#8217;t behave like block-level elements.</p>
<p>Note: In all of the examples, the container element is filled with blue, and the &lt;input&gt; itself is filled with red and has an opacity of 50% so that you can see it under- or over-flowing the container.</p>
<pre class="brush: xhtml">&lt;div  style=&quot;background: blue; width:200px;&quot;&gt;
  &lt;input  style=&quot;display:block; padding:4px; background: red; opacity:0.5; border:0;&quot; type=&quot;text&quot; value=&quot;text input&quot;/&gt;
&lt;/div&gt;</pre>
<div style="background:blue; width:200px;">
<input  style="display:block;padding:4px;background: red; opacity:0.5;border:0;" type="text" value="text input"/>
</div>
<p>You can see how the input doesn&#8217;t automatically flow to full width, as the &#8220;display: block&#8221; style suggests it should. The kneejerk response is to set the width to 100%:</p>
<pre class="brush: xhtml">&lt;div  style=&quot;background: blue; width:200px;&quot;&gt;
  &lt;input  style=&quot;display:block; padding:4px; background: red; opacity:0.5; width:100%; border:0;&quot; type=&quot;text&quot; value=&quot;text input&quot;/&gt;
&lt;/div&gt;</pre>
<div style="background:blue; width:200px;">
<input  style="display:block;padding:4px;background: red; opacity:0.5;width:100%;border:0;" type="text" value="text input"/>
</div>
<p>But notice now how the input overflows its container&#8217;s boundaries because of the left padding. At this point, people may resort to non-semantic markup (removing the padding on the &lt;input&gt; and putting it inside a padded &lt;div&gt;) or JavaScript solutions that set the pixel width whenever the container&#8217;s width changes (by the addition of scrollbars, for example).</p>
<h1>The (semantic) solution</h1>
<p><strong>But wait!</strong> There <strong>is</strong> a way to achieve this effect without resorting to an extra &lt;div&gt; or JavaScript:</p>
<pre class="brush: xhtml">&lt;div  style=&quot;background: blue; width:200px;&quot;&gt;
  &lt;input  style=&quot;display:block; padding:4px 0; background: red; opacity:0.5; width:100%; border:0; text-indent:4px;&quot; type=&quot;text&quot; value=&quot;text input&quot;/&gt;
&lt;/div&gt;</pre>
<div style="background:blue; width:200px;">
<input  style="display:block;padding:4px 0;background: red; opacity:0.5;width:100%;border:0;text-indent:4px;" type="text" value="text input"/>
</div>
<p>Do you see what I did there? I removed the horizontal padding on the &lt;input&gt;, so the 100% width now works correctly, and replaced it with &#8220;text-indent&#8221;. To the user, this looks no different, and it has the advantage of requiring no extraneous markup or tedious scripting.</p>
<h1>Drawbacks</h1>
<ol>
<li>Should the user enter a long string, their text will bump up against the right edge. But I think that that&#8217;s a boundary condition that I can live with.</li>
<li>Any vertical borders on the &lt;input&gt; will cause it to overflow its container. Personally, if I want a full-width &lt;input&gt;, though, I generally don&#8217;t want any borders on its left or right other than those of its container.</li>
]]></content:encoded>
			<wfw:commentRss>http://www.barryvan.com.au/2010/01/full-width-text-inputs-without-extraneous-markup-or-scripting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
