<?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>OVMS</title>
	<atom:link href="http://ovms.co/feed/" rel="self" type="application/rss+xml" />
	<link>http://ovms.co</link>
	<description>Software, The Web, Gaming &#38; Open-source :: HTML CSS JavaScript XHTML XML VBScript Emulation Virtualisation jQuery Intel x86 Documentation References Examples Free Advice.</description>
	<lastBuildDate>Tue, 20 Dec 2011 14:08:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>What is Currying?</title>
		<link>http://ovms.co/2011/11/what-is-currying/</link>
		<comments>http://ovms.co/2011/11/what-is-currying/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 15:48:10 +0000</pubDate>
		<dc:creator>Dan Phillimore</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://ovms.co/?p=334</guid>
		<description><![CDATA[Being a (fairly) little-known concept in programming, currying seems worthy of its own blog post. In general Simply put, currying is where: Methods may define multiple parameter lists. When a method is called with a fewer number of parameter lists, then this will yield a function taking the missing parameter lists as its arguments. &#8212; [...]]]></description>
			<content:encoded><![CDATA[<p>Being a (fairly) little-known concept in programming, <a href="http://stackoverflow.com/questions/36314/what-is-currying" title="Stack Overflow: What is Currying?">currying</a> seems worthy of its own blog post.</p>
<h2>In general</h2>
<p>Simply put, currying is where:</p>
<blockquote>
<p>Methods may define multiple parameter lists. When a method is called<br />
  with a fewer number of parameter lists, then this will yield a function<br />
  taking the missing parameter lists as its arguments.<br />
  &mdash; <cite><a href="http://www.scala-lang.org/node/135" title="Currying at scala-lang.org">scala-lang.org</a></cite></p>
</blockquote>
<h2>In PHP</h2>
<p>Currying is not a built-in feature of <a href="http://php.net" title="PHP.net documentation">PHP</a>. However, as outlined in quite some depth <a href="http://zaemis.blogspot.com/2009/06/currying-in-php.html" title="Zaemis: Currying in PHP">in this excellent post over at Zaemis&#8217; blog</a>, it is possible to emulate much of the functionality of currying in PHP (or at least, in PHP v5.3 and above) through use of closures.</p>
<h3>An example</h3>
<p>My favourite example from <a href="http://zaemis.blogspot.com/2009/06/currying-in-php.html" title="Zaemis: Currying in PHP">Zaemis&#8217; blog post</a> (which I recommend you read) is as below:</p>
<blockquote>
<p>
<code class="synlite synlite_line_numbers synlite_block synlite_php"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span style="color: #000088;">$userPercent</span> <span style="color: #339933;">=</span> <span style="color:#800080;">0.5</span><span style="color: #339933;">;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span style="color: #000088;">$userList</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_filter</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$percentVowels</span><span style="color: #339933;">,</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$percent</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">use</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$userPercent</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$percent</span> <span style="color: #339933;">&gt;=</span> <span style="color: #000088;">$userPercent</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> </span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></span></span>
</code><br />
  It showed an anonymous function being used with array_filter() to filter an array. The array is filtered based on a dynamic value, and a closure is used to &#8220;inject&#8221; the threshold rather than using a global statement. The same could also be accomplished with currying.</p>
<p>  The problem is array_filter() expects a callback function that accepts one argument&#8211;the current array element. Currying will allow us to prepare the function with the sorting threshold, and the intermediate function can be used as the callback.</p>
<p>
<code class="synlite synlite_line_numbers synlite_block synlite_php"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span style="color: #000000; font-weight: bold;">function</span> callback<span style="color: #009900;">&#40;</span><span style="color: #000088;">$userPercent</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$percent</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">use</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$userPercent</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$percent</span> <span style="color: #339933;">&gt;=</span> <span style="color: #000088;">$userPercent</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span style="color: #009900;">&#125;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span style="color: #000088;">$userList</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_filter</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$percentVowels</span><span style="color: #339933;">,</span> callback<span style="color: #009900;">&#40;</span><span style="color:#800080;">0.5</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></span></span>
</code></p>
</blockquote>

<div class="signature">
Cheers,
<em>Dan Phillimore</em>
<h4>About the author</h4>
<ul>
<li>Dan has spent the past 10 years developing specialist software, using everything from x86 assembly to C++ and VB. For the past few years he has focused on JavaScript development of high-performance virtual machines for the modern web and developing bespoke modern websites using the LAMP stack.</li>
<li>When he is not working on the next web-based OS, he spends his time out with friends, his girlfriend Jen or planning to buy an <a href="http://en.wikipedia.org/wiki/Muscle_car">American muscle car</a>.</li>
</ul>
</div>]]></content:encoded>
			<wfw:commentRss>http://ovms.co/2011/11/what-is-currying/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why isn&#8217;t my code being executed in IE?</title>
		<link>http://ovms.co/2011/07/why-isnt-my-code-being-run-in-ie/</link>
		<comments>http://ovms.co/2011/07/why-isnt-my-code-being-run-in-ie/#comments</comments>
		<pubDate>Wed, 27 Jul 2011 13:50:08 +0000</pubDate>
		<dc:creator>Dan Phillimore</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[closure]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jscript]]></category>
		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://ovms.co/?p=292</guid>
		<description><![CDATA[The problem if &#40; !window.TestClass &#41; &#123; &#160;function TestClass&#40;&#41; &#123; &#160; &#160;// ... &#160;&#125; &#160;TestClass.prototype.go = function &#40;&#41; &#123; &#160; &#160;alert&#40;&#34;gone&#34;&#41;; &#160;&#125;; &#125; var test = new TestClass&#40;&#41;; test.go&#40;&#41;; In IEv6, v7 &#38; v8, the above test case fails. This is probably an example of IE&#8217;s JScript engine getting ahead of itself: the function &#8220;TestClass&#8221;, [...]]]></description>
			<content:encoded><![CDATA[<h3>The problem</h3>
<p>
<code class="synlite synlite_line_numbers synlite_block synlite_javascript"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>window.<span style="color: #660066;">TestClass</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;<span style="color: #003366; font-weight: bold;">function</span> TestClass<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;<span style="color: #006600; font-style: italic;">// ...</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;<span style="color: #009900;">&#125;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;TestClass.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">go</span> <span style="color: #339933;">=</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></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;gone&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&#125;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #003366; font-weight: bold;">var</span> test <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> TestClass<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">test.<span style="color: #660066;">go</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></span></span>
</code></p>
<p>In IEv6, v7 &amp; v8, the above test case fails. This is probably an example of <a href="http://en.wikipedia.org/wiki/JScript" title="JScript on Wikipedia">IE&#8217;s JScript engine</a> getting ahead of itself: the function &#8220;TestClass&#8221;, a class constructor here, appears to be defined ahead-of-time (ie. before the 
<code class="synlite synlite_inline synlite_javascript"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>...<span style="color: #009900;">&#41;</span></span></span>
</code> is reached), resulting in the 
<code class="synlite synlite_inline synlite_javascript"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>...<span style="color: #009900;">&#41;</span></span></span>
</code> test failing and the prototype method not being set. The error then occurs on line 10 because there is no defined method &#8220;go&#8221;.</p>
<h3>The solution</h3>
<p>Many of you will probably never encounter the above problem: it only seems to be an issue <strong>when the function is defined in the global scope</strong>. If defined in a closure (as is common for module patterns), the problem goes away. Example below:</p>
<p>
<code class="synlite synlite_line_numbers synlite_block synlite_javascript"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><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></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>window.<span style="color: #660066;">TestClass</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span style="color: #003366; font-weight: bold;">function</span> TestClass<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// ...</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span style="color: #009900;">&#125;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; TestClass.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">go</span> <span style="color: #339933;">=</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></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;gone&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span style="color: #006600; font-style: italic;">// (Of course, this line is now needed in order to expose</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span style="color: #006600; font-style: italic;">// &nbsp;the class to the global object)</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; window.<span style="color: #660066;">TestClass</span> <span style="color: #339933;">=</span> TestClass<span style="color: #339933;">;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;<span style="color: #009900;">&#125;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;<span style="color: #003366; font-weight: bold;">var</span> test <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> TestClass<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;test.<span style="color: #660066;">go</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></span></span>
</code></p>
<p>This problem will affect any logic (in the global scope) that defines functions in IE &#8211; use of functions as class constructors is just one example. Assuming you use a proper module pattern to encapsulate the code you write, you should not encounter this problem. Gotcha!</p>
<hr />
<h3>Update 27/07/2011</h3>
<p>It appears that this problem affects more than just Internet Explorer: further testing in Google Chrome reveals that the following code will create issues:</p>
<p>
<code class="synlite synlite_line_numbers synlite_block synlite_javascript"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #006600; font-style: italic;">// You would expect that DOMParser would only be created if it wasn't already defined;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #006600; font-style: italic;">// &nbsp;unfortunately, the function declaration below is always executed, overwriting</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #006600; font-style: italic;">// &nbsp;any native implementation. The fix, as mentioned below, is to wrap this code</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #006600; font-style: italic;">// &nbsp;in a closure to give it a private scope, then expose the class outside.</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>window.<span style="color: #660066;">DOMParser</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;<span style="color: #003366; font-weight: bold;">function</span> DOMParser<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span style="color: #006600; font-style: italic;">// ...</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;<span style="color: #009900;">&#125;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&#125;</span></span></span>
</code></p>
<p>This is a simplified example (of the job I was solving before in IE, that of emulating the <a href="http://www.w3schools.com/dom/dom_parser.asp" title="DOMParser at W3Schools">W3C-defined class 
<code class="synlite synlite_inline synlite_javascript"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOMParser</span></span>
</code></a>), but it demonstrates the problem again. The idea is to define a 
<code class="synlite synlite_inline synlite_javascript"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOMParser</span></span>
</code> class only if one does not already exist (leaving a native implementation alone). Unfortunately, ECMAScript is counter-intuitive in this respect: the class/function 
<code class="synlite synlite_inline synlite_javascript"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOMParser</span></span>
</code> is defined regardless of whether the 
<code class="synlite synlite_inline synlite_javascript"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>...<span style="color: #009900;">&#41;</span></span></span>
</code> passes, overwriting Chrome&#8217;s own native 
<code class="synlite synlite_inline synlite_javascript"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOMParser</span></span>
</code> class/function.</p>
<p>Once again, the fix is simple: to properly wrap the code in a closure for a module pattern:</p>
<p>
<code class="synlite synlite_line_numbers synlite_block synlite_javascript"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><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></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;<span style="color: #006600; font-style: italic;">// Now DOMParser is hidden inside this private scope, stopping it from overwriting</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;<span style="color: #006600; font-style: italic;">// &nbsp;any native implementation if one exists. Note the need for an additional</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;<span style="color: #006600; font-style: italic;">// &nbsp;instruction at the end to expose the class/function to the global scope once again.</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>window.<span style="color: #660066;">DOMParser</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span style="color: #003366; font-weight: bold;">function</span> DOMParser<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;<span style="color: #006600; font-style: italic;">// ...</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span style="color: #009900;">&#125;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span style="color: #006600; font-style: italic;">// See above: expose to global scope</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; window.<span style="color: #660066;">DOMParser</span> <span style="color: #339933;">=</span> DOMParser<span style="color: #339933;">;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;<span style="color: #009900;">&#125;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></span></span>
</code></p>

<div class="signature">
Cheers,
<em>Dan Phillimore</em>
<h4>About the author</h4>
<ul>
<li>Dan has spent the past 10 years developing specialist software, using everything from x86 assembly to C++ and VB. For the past few years he has focused on JavaScript development of high-performance virtual machines for the modern web and developing bespoke modern websites using the LAMP stack.</li>
<li>When he is not working on the next web-based OS, he spends his time out with friends, his girlfriend Jen or planning to buy an <a href="http://en.wikipedia.org/wiki/Muscle_car">American muscle car</a>.</li>
</ul>
</div>]]></content:encoded>
			<wfw:commentRss>http://ovms.co/2011/07/why-isnt-my-code-being-run-in-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE X-UA-Compatible Multiple Versions &amp; Conditional Comments</title>
		<link>http://ovms.co/2011/06/ie-x-ua-compatible-multiple-versions-conditional-comments/</link>
		<comments>http://ovms.co/2011/06/ie-x-ua-compatible-multiple-versions-conditional-comments/#comments</comments>
		<pubDate>Sun, 05 Jun 2011 22:24:21 +0000</pubDate>
		<dc:creator>Dan Phillimore</dc:creator>
				<category><![CDATA[IE]]></category>
		<category><![CDATA[Tweaks]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[condcoms]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[ie7]]></category>
		<category><![CDATA[x-ua-compatible]]></category>

		<guid isPermaLink="false">http://ovms.co/?p=60</guid>
		<description><![CDATA[Internet Explorer v9 will include includes a great many performance &#38; compatibility enhancements over its predecessors. For IE8, it has been useful to limit its rendering engine to display as IE7&#8242;s: for this, the X-UA-Compatible header is used, &#60;meta http-equiv=&#34;X-UA-Compatible&#34; content=&#34;IE=EmulateIE7&#34; /&#62; as documented at MSDN. To target different versions of IE with different engines, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://internet-explorer.uk.msn.com/">Internet Explorer</a> v9 <del>will include</del> includes a great many performance &amp; compatibility enhancements over its predecessors. For IE8, it has been useful to limit its rendering engine to display as IE7&#8242;s: for this, the X-UA-Compatible header is used,<br />

<code class="synlite synlite_block synlite_html5"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;X-UA-Compatible&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;IE=EmulateIE7&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></span></span>
</code><br />
<a title="X-UA-Compatible at MSDN" href="http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx">as documented at MSDN</a>.</p>
<p>To target different versions of IE with different engines, for example when needing IE8 to use IE7-mode but leaving IE9 to use the latest engine, MSDN states to use the following syntax, eg:</p>
<p>
<code class="synlite synlite_line_numbers synlite_block synlite_html5"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">&lt;!-- MSDN-recommended syntax (warning: see note below) --&gt;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;X-UA-Compatible&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;IE=7;IE=9&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></span></span>
</code></p>
<p>However, as stated in <a title="Stackoverflow" href="http://stackoverflow.com/questions/3413629/emulate-ie7-for-ie8-but-not-for-ie9-using-x-ua-compatible">this post at stackoverflow</a>, this does not work: instead, use a comma to separate the values (&#8220;,&#8221;), rather than a semi-colon (&#8220;;&#8221;):</p>
<p>
<code class="synlite synlite_line_numbers synlite_block synlite_html5"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">&lt;!-- Correct (working) syntax --&gt;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;X-UA-Compatible&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;IE=7,IE=9&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></span></span>
</code></p>
<p>In theory, an alternative would involve wrapping the X-UA-Compatible &lt;meta&gt; tag with some of IE&#8217;s proprietary <a href="http://msdn.microsoft.com/en-us/library/ms537512(v=vs.85).aspx">conditional comments (condcoms)</a>. Unfortunately, this would present a &#8220;chicken-and-egg&#8221; problem, as the effective browser version (ie. v8 for IE8, v7 if EmulateIE7-mode) must be determined before any condcoms are evaluated: this means the X-UA-Compatible tag cannot then change the browser version (for example, to &#8220;EmulateIE7&#8243;).</p>
<h3>Modes for &#8220;IE=&#8221; component of X-UA-Compatible:</h3>
<dl>
<dt>IE=7</dt>
<dd>IE7 &#8211; forced mode, rendering will always be as for 7</dd>
<dt>IE=EmulateIE7</dt>
<dd>IE7 &#8211; emulated mode, rendering will be determined as it would in IE7 itself, using &lt;!DOCTYPE &#8230;&gt;, choosing between IE5-compatible &#8220;quirks&#8221; mode or IE7&#8242;s &#8220;standards-compliant&#8221; mode</dd>
</dl>

<div class="signature">
Cheers,
<em>Dan Phillimore</em>
<h4>About the author</h4>
<ul>
<li>Dan has spent the past 10 years developing specialist software, using everything from x86 assembly to C++ and VB. For the past few years he has focused on JavaScript development of high-performance virtual machines for the modern web and developing bespoke modern websites using the LAMP stack.</li>
<li>When he is not working on the next web-based OS, he spends his time out with friends, his girlfriend Jen or planning to buy an <a href="http://en.wikipedia.org/wiki/Muscle_car">American muscle car</a>.</li>
</ul>
</div>]]></content:encoded>
			<wfw:commentRss>http://ovms.co/2011/06/ie-x-ua-compatible-multiple-versions-conditional-comments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Live (Hotmail) POP3/SMTP settings for Mozilla Thunderbird (and others)</title>
		<link>http://ovms.co/2011/06/windows-live-hotmail-pop3smtp-settings-mozilla-thunderbird/</link>
		<comments>http://ovms.co/2011/06/windows-live-hotmail-pop3smtp-settings-mozilla-thunderbird/#comments</comments>
		<pubDate>Sun, 05 Jun 2011 15:03:16 +0000</pubDate>
		<dc:creator>Dan Phillimore</dc:creator>
				<category><![CDATA[Email]]></category>
		<category><![CDATA[Hotmail / Windows Live]]></category>

		<guid isPermaLink="false">http://ovms.co/?p=79</guid>
		<description><![CDATA[Having been plagued by error messages from the Hotmail/Webmail extension for Thunderbird, I finally decided to try and fix the problem. It turns out that the extension is no longer supported (see also here) &#8211; as Hotmail is now available for POP3/SMTP use, details (set up for Thunderbird) are: POP3 (incoming) settings: POP3 Server: pop3.live.com [...]]]></description>
			<content:encoded><![CDATA[<p>Having been plagued by error messages from the <a href="http://www.neilturner.me.uk/2005/04/09/thunderbird_webmail_extension.html">Hotmail/Webmail extension</a> for <a href="http://www.mozillamessaging.com/en-US/">Thunderbird</a>, I finally decided to try and fix the problem.</p>
<p>It turns out that the extension <a href="http://groups.google.com/group/thunderbird-webmail-extension/browse_thread/thread/72ffcb53f786bfde">is no longer supported</a> (see also <a href="http://www.neilturner.me.uk/2005/04/09/thunderbird_webmail_extension.html">here</a>) &#8211; as Hotmail is now available for POP3/SMTP use, details (set up for <span class="name">Thunderbird</span>) are:</p>
<h3><a href="http://en.wikipedia.org/wiki/Post_Office_Protocol">POP3 (incoming)</a> settings:</h3>
<dl>
<dt>POP3 Server:</dt>
<dd>pop3.live.com</dd>
<dt>Port:</dt>
<dd>995</dd>
<dt>User Name:</dt>
<dd>(Hotmail email address)</dd>
<dt>Connection security:</dt>
<dd>SSL/TLS <em>(which is odd: see below)</em></dd>
<dt>Authentication method:</dt>
<dd>Normal password</dd>
</dl>
<h3><a href="http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol">SMTP (outgoing)</a> settings:</h3>
<dl>
<dt>SMTP Server:</dt>
<dd>smtp.live.com</dd>
<dt>Port:</dt>
<dd>25 (or 587)</dd>
<dt>Connection security:</dt>
<dd>STARTTLS <em>(<strong>SSL/TLS</strong> does not work for Hotmail!)</em></dd>
<dt>Authentication method:</dt>
<dd>Normal password</dd>
</dl>
<p>As noted above, it took me several hours to figure out that <span class="name">Thunderbird</span>&#8216;s <strong>SSL/TLS</strong> option is not compatible with <a href="http://www.hotmail.com/">Hotmail</a> <em>(but this only applies to <strong>SMTP</strong>) &#8211; I had to use <strong>STARTTLS</strong>.</em></p>

<div class="signature">
Cheers,
<em>Dan Phillimore</em>
<h4>About the author</h4>
<ul>
<li>Dan has spent the past 10 years developing specialist software, using everything from x86 assembly to C++ and VB. For the past few years he has focused on JavaScript development of high-performance virtual machines for the modern web and developing bespoke modern websites using the LAMP stack.</li>
<li>When he is not working on the next web-based OS, he spends his time out with friends, his girlfriend Jen or planning to buy an <a href="http://en.wikipedia.org/wiki/Muscle_car">American muscle car</a>.</li>
</ul>
</div>]]></content:encoded>
			<wfw:commentRss>http://ovms.co/2011/06/windows-live-hotmail-pop3smtp-settings-mozilla-thunderbird/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Basic website workflow</title>
		<link>http://ovms.co/2010/06/basic-website-workflow/</link>
		<comments>http://ovms.co/2010/06/basic-website-workflow/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 22:46:51 +0000</pubDate>
		<dc:creator>Dan Phillimore</dc:creator>
				<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[colour scheme]]></category>
		<category><![CDATA[content]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://ovms.co/?p=51</guid>
		<description><![CDATA[In this post I would like to outline the basic workflow I follow when designing and building a website from the ground up. This is by no means a complete list, its intention is to clarify for myself, if anything, the basic steps required and hopefully to give some pointers to aspiring developers on how [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I would like to outline the basic workflow I follow when designing and building a website from the ground up. This is by no means a complete list, its intention is to clarify for myself, if anything, the basic steps required and hopefully to give some pointers to aspiring developers on how to design their own workflow. I also intentionally leave out stages where server-side scripting is involved, for example, for simplicity.</p>
<h3>Step 1. Determine that a WWW site is the solution.</h3>
<p>This step is far too complex to explain fully here: suffice to say that you must always decide on the optimum way to proceed with a project, before actually embarking on it. Are you a locally-based business who would find it difficult to work outside a 100-mile range? If so, perhaps a world-reaching website is not the best solution to advertise your business: you may find that, at least in the short term, your resources would be better spent setting up billboard/on-vehicle (eg. bus) or local radio advertising, for example. Once you know you want a website, put some resources into it: remember, first impressions count, so you want your new website to impact hard, or those potential customers might leave and never come back. Pool your resources, bring together any information which might help you organise your site, be it photos, your company logo/coat of arms, letterheads, posters and other promotional gear, and use those to make sure your website forms an extension of your existing promotional material (and reduce how much time you need to lean on your graphics designer.)</p>
<h3>Step 2. Draw-up a spider diagram</h3>
<p>Nobody can visualise the perfect website in their head: design, colour scheme, layout, content, categories, tags &#8211; these should all be noted down and linked together, in much the same way your site&#8217;s pages will need to link to each other. Do you need to design a new logo for the site? If you have a colour scheme in mind, you should use it in the logo to bring the look together: if not, you should design your logo and then derive the basic colour scheme from there (see below.)</p>
<h3>Step 3. Content is King</h3>
<p>Now that you know what kind of content you need on your site, your best next move is to get some content written down: use an existing editor, such as <a title="Wordpress" href="http://wordpress.org/">WordPress</a>, even if you plan on building your own CMS, to quickly set those wheels in motion and generate unique, relevant and useful content for your site. Link early, link often: outbound links should direct the user to further information, in the same way you would (hopefully) direct your customers elsewhere if you did not have the item they wanted. You might not have their custom this time, but they are likely to gratefully remember your helpful advice and recommend you to others.</p>
<p>Remember: <a title="Content is King, Baby!" href="http://www.seomoz.org/blog/content-is-king-baby"><strong>Content is King</strong></a>. In the past, design was involved and tied to the editing process, as 
<code class="synlite synlite_inline synlite_html5"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;font&gt;</span></span></span>
</code> tags and 
<code class="synlite synlite_inline synlite_html5"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">b</span>&gt;</span>/<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">i</span>&gt;</span></span></span>
</code> etc. were used to style the content. Fast and effortless, but changing the layout later, or even just keeping it consistent, quickly becomes laborious. Instead, use modern techniques. Mark up those articles in a semantic way, using 
<code class="synlite synlite_inline synlite_html5"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span></span></span>
</code> for paragraphs, 
<code class="synlite synlite_inline synlite_html5"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h1</span>&gt;</span></span></span>
</code> etc. for headings, 
<code class="synlite synlite_inline synlite_html5"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ol</span>&gt;</span></span></span>
</code> for lists of items where the order matters, 
<code class="synlite synlite_inline synlite_html5"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></span></span>
</code> for lists where it does not, etc. These allow CSS to be utilised later to apply your chosen design to the content, at the same time enabling future changes in design to be implemented right across the site with ease.</p>
<h3>Step 4. Decide on a colour scheme</h3>
<p>Your colour scheme will usually have little to no bearing or effect on the content of your site, so you can safely leave this part until now provided you semantically mark up your content. I always recommend the following basic guidelines when choosing a colour scheme: black and white can of course be combined with anything, so these are the first two items in your colour scheme. Now choose around 4 other colours: there are many excellent tutorials on the web for this, <a title="How to Choose a Great Colour Scheme for Your Site" href="http://www.apaddedcell.com/how-choose-great-colour-scheme">aPaddedCell article here</a> being a good example.</p>
<h3>Step 5. Basic HTML structure</h3>
<p>Aim for either HTML 4.01 or XHTML 1.0 compliance. Which to choose <a href="http://elevate.wordpress.com/2007/04/24/xhtml-or-html-4-strict/">depends</a> on many <a href="http://www.optimiced.com/en/2009/05/15/xhtml1-html4-html5/">factors</a>, personally I prefer the strictness of XHTML where possible. Once decided, begin building your basic code structure template: use a &lt;!DOCTYPE&gt;, include the &lt;html&gt; tag, include the &lt;head&gt; and &lt;body&gt; and try to close elements where possible (eg. &lt;p&gt; tags, but never &lt;img&gt; tags) to eliminate the possibility of a &#8220;tag soup&#8221; as <a href="http://www.optimiced.com/en/2009/05/15/xhtml1-html4-html5/">this post</a> explains.</p>
<p>Try to avoid writing any CSS until you have the HTML structure laid down. When building a house, the foundation must be solid before you start building the walls. With HTML/CSS, you follow a similar pattern: this also allows users with outdated browsers, or those with CSS disabled, to continue to use your site: allow for &#8220;graceful degradation&#8221;. Make allowances in the code for the CSS to be applied, though: if there is no suitable semantic element for a block of content, a &lt;div&gt; will of course be used &#8211; It would be a good idea to assign these semantic, relevant classes so styling rules can easily be pointed at them later. Use &lt;div class=&#8221;links_wrapper&#8221;&gt;&#8230;&lt;/div&gt; instead of &lt;div class=&#8221;blue&#8221;&gt;&#8230;&lt;/div&gt; so that classnames reflect the purpose or function of an element, rather than their styling. For sections which will only exist once on the page, it may be more suitable to use an id, eg. 
<code class="synlite synlite_inline synlite_html5"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;footer&quot;</span>&gt;</span>...<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></span></span>
</code>. Avoid use of the 
<code class="synlite synlite_inline synlite_html5"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">style</span></span>
</code> attribute: it has much the same drawbacks as 
<code class="synlite synlite_inline synlite_html5"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;font&gt;</span>...<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>font&gt;</span></span></span>
</code> or 
<code class="synlite synlite_inline synlite_html5"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">b</span>&gt;</span>/<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">i</span>&gt;</span></span></span>
</code> tags.</p>
<h3>Step 6. Begin styling your site</h3>
<p>This stage of the development is where the fun (and headaches) begin. With so many browsers out there, each with its own quirks, it is virtually impossible to make your site look the same across all browsers, possible user configurations and eg. <a href="http://en.wikipedia.org/wiki/ClearType">MS ClearType</a> and similar settings. There have been major improvements in this area, particularly with the advancement of standards-compliant browsers, and it is clear that websites should be developed to accommodate the user&#8217;s settings, rather than compensate for or override them. Using ems for measurements (where applicable) is preferable as it allows proportional scaling of the page&#8217;s text by the user (a good comparison of units em, pt, px and % is <a href="http://www.kyleschaeffer.com/best-practices/css-font-size-em-vs-px-vs-pt-vs/">available here</a>, be sure to read the comments too.)</p>
<p>Once you have your layout looking acceptable in modern, compliant browsers (Firefox, Chrome, Opera, Safari etc.) and have your semantically marked-up pages easily styled consistently, it is then time to test for Internet Explorer. There have been many articles on IE-related headaches and workarounds, too many to count or list here, but my own technique is to begin with the latest (currently IE8, although an IE9 RC (Vista+ only) is currently in the works), apply any fixes in a separate stylesheet included using conditional comments:</p>
<p>
<code class="synlite synlite_line_numbers synlite_block synlite_html5"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">&lt;!-- ... --&gt;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">&lt;!-- ... --&gt;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">&lt;!--[if lte IE 8]&gt;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;link rel=&quot;stylesheet&quot; href=&quot;css/ie_lte_6.css&quot; /&gt;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">&lt;![endif]--&gt;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">&lt;!-- ... --&gt;</span></span></span>
</code></p>
<p>&#8230; and then move back a version &amp; add fixes for IE7. I often find it useful to apply the fixes as shown before, so all IE8-related fixes are applied to 7 &amp; 6, as this usually results in less work and less CSS, but <a href="http://wiki.answers.com/Q/What_does_yMMV_mean">YMMV</a>.</p>
<h3>Step 7. Review, Rinse, Repeat</h3>
<p>So you have your basic website: but are you happy with it? By now you will undoubtedly have identified some problems with either your own workflow or the way in which your content is marked up, so go ahead and correct those errors now while there are few changes to make: it will save you time in the long run. Remember: build a solid website first and then publicise it: you want your first impression to impact your audience hard, draw those customers in and keep them there, but you want to build solid, useful content first and not concentrate on link building to begin with &#8211; after all, what use is a high-ranking site with many inbound links and a high PageRank if your customers have nothing to read when they get there?</p>
<hr />
<p>This post is by no means complete, I intend to improve on it at a later date, but please feel free to leave a comment.</p>

<div class="signature">
Cheers,
<em>Dan Phillimore</em>
<h4>About the author</h4>
<ul>
<li>Dan has spent the past 10 years developing specialist software, using everything from x86 assembly to C++ and VB. For the past few years he has focused on JavaScript development of high-performance virtual machines for the modern web and developing bespoke modern websites using the LAMP stack.</li>
<li>When he is not working on the next web-based OS, he spends his time out with friends, his girlfriend Jen or planning to buy an <a href="http://en.wikipedia.org/wiki/Muscle_car">American muscle car</a>.</li>
</ul>
</div>]]></content:encoded>
			<wfw:commentRss>http://ovms.co/2010/06/basic-website-workflow/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Fix Firefox Button Padding</title>
		<link>http://ovms.co/2010/06/fix-firefox-button-padding/</link>
		<comments>http://ovms.co/2010/06/fix-firefox-button-padding/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 09:58:17 +0000</pubDate>
		<dc:creator>Dan Phillimore</dc:creator>
				<category><![CDATA[Firefox / Mozilla]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[mozilla]]></category>

		<guid isPermaLink="false">http://ovms.co/?p=18</guid>
		<description><![CDATA[As we all know by now, consistently styling form elements with CSS is virtually impossible. However, with a few tweaks and after reading Firefox&#8217;s user-agent CSS file forms.css, I discovered the following: button::-moz-focus-inner, &#160;input&#91;type=&#34;reset&#34;&#93;::-moz-focus-inner, &#160;input&#91;type=&#34;button&#34;&#93;::-moz-focus-inner, &#160;input&#91;type=&#34;submit&#34;&#93;::-moz-focus-inner, input&#91;type=&#34;file&#34;&#93; &#62; input&#91;type=&#34;button&#34;&#93;::-moz-focus-inner &#123; &#160; &#160; border: 1px dotted transparent; &#160; &#160; padding: 0 2px; &#125; &#8230; Firefox uses [...]]]></description>
			<content:encoded><![CDATA[<p>As we all know by now, consistently styling form elements with CSS is virtually impossible. However, with a few tweaks and after reading Firefox&#8217;s user-agent CSS file forms.css, I discovered the following:</p>
<p>
<code class="synlite synlite_line_numbers synlite_block synlite_css"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">button<span style="color: #00AA00;">:</span><span style="color: #3333ff;">:-moz-focus-inner</span><span style="color: #00AA00;">,</span> &nbsp;input<span style="color: #00AA00;">&#91;</span>type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;reset&quot;</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">:</span><span style="color: #3333ff;">:-moz-focus-inner</span><span style="color: #00AA00;">,</span> &nbsp;input<span style="color: #00AA00;">&#91;</span>type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;button&quot;</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">:</span><span style="color: #3333ff;">:-moz-focus-inner</span><span style="color: #00AA00;">,</span> &nbsp;input<span style="color: #00AA00;">&#91;</span>type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">:</span><span style="color: #3333ff;">:-moz-focus-inner</span><span style="color: #00AA00;">,</span> input<span style="color: #00AA00;">&#91;</span>type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;file&quot;</span><span style="color: #00AA00;">&#93;</span> <span style="color: #00AA00;">&gt;</span> input<span style="color: #00AA00;">&#91;</span>type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;button&quot;</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">:</span><span style="color: #3333ff;">:-moz-focus-inner </span><span style="color: #00AA00;">&#123;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">dotted</span> <span style="color: #993333;">transparent</span><span style="color: #00AA00;">;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00AA00;">&#125;</span></span></span>
</code></p>
<p>&#8230; Firefox uses pseudo-elements within the button elements themselves for drawing. As you can see above, this means that padding of 2px is added to the top and bottom of this inner pseudo-element, therefore it may be removed as follows:</p>
<p>
<code class="synlite synlite_line_numbers synlite_block synlite_css"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">button<span style="color: #00AA00;">:</span><span style="color: #3333ff;">:-moz-focus-inner</span><span style="color: #00AA00;">,</span> input<span style="color: #00AA00;">&#91;</span>type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;button&quot;</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">:</span><span style="color: #3333ff;">:-moz-focus-inner</span><span style="color: #00AA00;">,</span> input<span style="color: #00AA00;">&#91;</span>type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">:</span><span style="color: #3333ff;">:-moz-focus-inner</span><span style="color: #00AA00;">,</span> input<span style="color: #00AA00;">&#91;</span>type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;reset&quot;</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">:</span><span style="color: #3333ff;">:-moz-focus-inner </span><span style="color: #00AA00;">&#123;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> !important<span style="color: #00AA00;">;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333;">none</span> !important<span style="color: #00AA00;">;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00AA00;">&#125;</span></span></span>
</code></p>
<p>&#8230; thereby removing the padding (and in this case, the inner border too, as it was extra spacing not required; however I suspect it is used for the dotted selection border visible when a button has the focus.)</p>
<p>For completeness, I generally enclose such Firefox-specific code as below, more as a descriptive markup than anything else, however it serves to stop the rules being interpreted by any other browser, also being useful for targeting Firefox-only CSS:</p>
<p>
<code class="synlite synlite_line_numbers synlite_block synlite_css"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">/* Used within FF chrome to target CSS to specific URLs: being FF-specific,</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">it is also useful for targeting FF-only code */</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #a1a100;">@-moz-document url-prefix(http://) {</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; button<span style="color: #00AA00;">:</span><span style="color: #3333ff;">:-moz-focus-inner</span><span style="color: #00AA00;">,</span> input<span style="color: #00AA00;">&#91;</span>type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;button&quot;</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">:</span><span style="color: #3333ff;">:-moz-focus-inner</span><span style="color: #00AA00;">,</span> input<span style="color: #00AA00;">&#91;</span>type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">:</span><span style="color: #3333ff;">:-moz-focus-inner</span><span style="color: #00AA00;">,</span> input<span style="color: #00AA00;">&#91;</span>type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;reset&quot;</span><span style="color: #00AA00;">&#93;</span><span style="color: #00AA00;">:</span><span style="color: #3333ff;">:-moz-focus-inner </span><span style="color: #00AA00;">&#123;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> !important<span style="color: #00AA00;">;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333;">none</span> !important<span style="color: #00AA00;">;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #00AA00;">&#125;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #00AA00;">&#125;</span></span></span>
</code></p>

<div class="signature">
Cheers,
<em>Dan Phillimore</em>
<h4>About the author</h4>
<ul>
<li>Dan has spent the past 10 years developing specialist software, using everything from x86 assembly to C++ and VB. For the past few years he has focused on JavaScript development of high-performance virtual machines for the modern web and developing bespoke modern websites using the LAMP stack.</li>
<li>When he is not working on the next web-based OS, he spends his time out with friends, his girlfriend Jen or planning to buy an <a href="http://en.wikipedia.org/wiki/Muscle_car">American muscle car</a>.</li>
</ul>
</div>]]></content:encoded>
			<wfw:commentRss>http://ovms.co/2010/06/fix-firefox-button-padding/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Useful Intel x86 emulator development links</title>
		<link>http://ovms.co/2010/06/useful-intel-x86-emulator-development-links/</link>
		<comments>http://ovms.co/2010/06/useful-intel-x86-emulator-development-links/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 07:56:22 +0000</pubDate>
		<dc:creator>Dan Phillimore</dc:creator>
				<category><![CDATA[Emulators]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[80486]]></category>
		<category><![CDATA[emulation]]></category>
		<category><![CDATA[i486]]></category>
		<category><![CDATA[ia-32]]></category>
		<category><![CDATA[intel]]></category>
		<category><![CDATA[virtual machine]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[x86]]></category>

		<guid isPermaLink="false">http://ovms.co/?p=14</guid>
		<description><![CDATA[After looking over the many piles of paper lying around with hastily-scribbled notes on, some of which were starting to fall behind cupboards or collect numerous coffee rings, I decided to start noting things down on this blog instead. This post is mainly intended to serve as an aide-mémoire, used in a recent project of [...]]]></description>
			<content:encoded><![CDATA[<p>After looking over the many piles of paper lying around with hastily-scribbled notes on, some of which were starting to fall behind cupboards or collect numerous coffee rings, I decided to start noting things down on this blog instead. This post is mainly intended to serve as an <a title="Phrase - Aide-mémoire" href="http://www.phrases.org.uk/meanings/25200.html">aide-mémoire</a>, used in a recent project of mine which should see the light of day this year.</p>
<h4>Ralf Brown&#8217;s Interrupt List (RBIL)</h4>
<p>At time of writing, RBIL is currently <q cite="http://en.wikipedia.org/wiki/Ralf_Brown's_Interrupt_List">in Revision 61, July 17, 2000 and is almost 8 <a title="Megabyte" href="http://en.wikipedia.org/wiki/Megabyte">MB</a> in <a title="ASCII" href="http://en.wikipedia.org/wiki/ASCII">ASCII</a> text</q> (see <a title="Ralf Brown's Interrupt List (RBIL)" href="http://en.wikipedia.org/wiki/Ralf_Brown's_Interrupt_List">Wikipedia&#8217;s article</a>.)</p>
<ul>
<li>Ralf&#8217;s original page(s) are available <a title="Ralf Brown" href="http://www.cs.cmu.edu/~ralf/">here</a>, as linked to in the <a title="Ralf Brown's Interrupt List (RBIL)" href="http://en.wikipedia.org/wiki/Ralf_Brown%27s_Interrupt_List">Wikipedia   article</a> above.<a title="Ralf Brown's Interrupt List (RBIL)" href="http://en.wikipedia.org/wiki/Ralf_Brown%27s_Interrupt_List"></a></li>
<li>A dated, but HTML version of this useful list is <a title="Ralf Brown's Interrupt List, Indexed HTML Version - Release 61" href="http://www.ctyme.com/rbrown.htm">available here</a>.</li>
</ul>
<h4>Common, well-supported x86 emulators</h4>
<h5>Bochs</h5>
<p>Highly portable, open source PC emulator, written in C++. <a title="Bochs" href="http://bochs.sourceforge.net/">Bochs</a> is/was much-referenced during the development of a recent project of mine, as mentioned above.</p>
<h5>QEMU</h5>
<p>A generic and open source machine <a title="Virtual Machines: Virtualization vs. Emulation" href="http://blog.1530technologies.com/2006/08/virtual-machines-virtualization-vs-emulation.html">emulator and virtualizer</a>, <a title="QEMU" href="http://wiki.qemu.org/Main_Page">QEMU</a> is open source and extremely fast during emulation thanks to its dynamic translation engine.</p>

<div class="signature">
Cheers,
<em>Dan Phillimore</em>
<h4>About the author</h4>
<ul>
<li>Dan has spent the past 10 years developing specialist software, using everything from x86 assembly to C++ and VB. For the past few years he has focused on JavaScript development of high-performance virtual machines for the modern web and developing bespoke modern websites using the LAMP stack.</li>
<li>When he is not working on the next web-based OS, he spends his time out with friends, his girlfriend Jen or planning to buy an <a href="http://en.wikipedia.org/wiki/Muscle_car">American muscle car</a>.</li>
</ul>
</div>]]></content:encoded>
			<wfw:commentRss>http://ovms.co/2010/06/useful-intel-x86-emulator-development-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smoothly scale images in IE (-ms-interpolation-mode: bicubic)</title>
		<link>http://ovms.co/2010/06/smoothly-scale-images-in-ie-ms-interpolation-mode-bicubic/</link>
		<comments>http://ovms.co/2010/06/smoothly-scale-images-in-ie-ms-interpolation-mode-bicubic/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 06:17:03 +0000</pubDate>
		<dc:creator>Dan Phillimore</dc:creator>
				<category><![CDATA[IE]]></category>
		<category><![CDATA[Tweaks]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[ie7]]></category>
		<category><![CDATA[msdn]]></category>
		<category><![CDATA[scale images]]></category>

		<guid isPermaLink="false">http://ovms.co/?p=5</guid>
		<description><![CDATA[Today I discovered a much-improved method to fix IE7&#8242;s default image-resizing behaviour: as described in this Flickr post it is possible to tweak IE7 into applying the (much smoother) Bicubic interpolation method when scaling images. The result is depicted in this archived post here (which also happens to provide a solution for IE6, using the [...]]]></description>
			<content:encoded><![CDATA[<p>Today I discovered a much-improved method to fix IE7&#8242;s default image-resizing behaviour: as described in <a title="On UI Quality (The Little Things): Client-side Image Resizing" href="http://code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/">this Flickr post</a> it is possible to tweak IE7 into applying the (much smoother) Bicubic interpolation method when scaling images.</p>
<p>The result is depicted in <a title="From the Department of Badly Chosen Defaults" href="http://www.joelonsoftware.com/items/2008/12/22.html">this archived post here</a> (which also happens to provide a solution for IE6, using <a title="Transparent PNGs in Internet Explorer 6" href="http://24ways.org/2007/supersleight-transparent-png-in-ie6">the</a> <a title="PNG Behavior (WebFX)" href="http://webfx.eae.net/dhtml/pngbehavior/pngbehavior.html">infamous</a> <a title="AlphaImageLoader Filter (MSDN)" href="http://msdn.microsoft.com/en-us/library/ms532969%28VS.85%29.aspx">AlphaImageLoader</a>).</p>
<p>This is definitely an improvement on my previous method: after copying the client&#8217;s images over, I used GD on my own server (as they happened to be stuck with Windows shared hosting) to perform the smooth downsampling (think <a title="PHP: imagecopyresampled" href="http://www.php.net/manual/en/function.imagecopyresampled.php">imagecopyresampled</a>) before presenting to the user. A nice effect, but cost me (and my client) precious bandwidth &#8211; this solution is much more acceptable.</p>
<h4>Microsoft&#8217;s hidden -ms-interpolation-mode CSS property</h4>
<p>This little gem kicks IE7&#8242;s rendering engine into touch: &#8220;<a title="-ms-interpolation-mode" href="http://msdn.microsoft.com/en-us/library/ms530822%28VS.85%29.aspx">-ms-interpolation-mode</a>: bicubic;&#8221;</p>
<p>Possible values for those interested (from <a title="-ms-interpolation-mode" href="http://msdn.microsoft.com/en-us/library/ms530822%28VS.85%29.aspx">MSDN</a>) :</p>
<p>
<code class="synlite synlite_line_numbers synlite_block synlite_css"><span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">/* ... */</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">/* (Default) - Always use nearest neighbor interpolation mode. */</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">-ms-interpolation-mode<span style="color: #00AA00;">:</span> nearest-neighbor<span style="color: #00AA00;">;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">/* --- OR --- */</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">/* Always use &lt;strong&gt;high-quality&lt;/strong&gt; bicubic interpolation mode. */</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">-ms-interpolation-mode<span style="color: #00AA00;">:</span> bicubic<span style="color: #00AA00;">;</span></span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</span></span>
<span class='line' style="font-weight: normal; vertical-align:top;"><span style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #808080; font-style: italic;">/* ... */</span></span></span>
</code></p>

<div class="signature">
Cheers,
<em>Dan Phillimore</em>
<h4>About the author</h4>
<ul>
<li>Dan has spent the past 10 years developing specialist software, using everything from x86 assembly to C++ and VB. For the past few years he has focused on JavaScript development of high-performance virtual machines for the modern web and developing bespoke modern websites using the LAMP stack.</li>
<li>When he is not working on the next web-based OS, he spends his time out with friends, his girlfriend Jen or planning to buy an <a href="http://en.wikipedia.org/wiki/Muscle_car">American muscle car</a>.</li>
</ul>
</div>]]></content:encoded>
			<wfw:commentRss>http://ovms.co/2010/06/smoothly-scale-images-in-ie-ms-interpolation-mode-bicubic/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

