<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Malcolm on Malcolm</title>
	<atom:link href="http://metamalcolm.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://metamalcolm.wordpress.com</link>
	<description>More garbage on the Internet</description>
	<lastBuildDate>Wed, 23 Mar 2011 18:26:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='metamalcolm.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Malcolm on Malcolm</title>
		<link>http://metamalcolm.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://metamalcolm.wordpress.com/osd.xml" title="Malcolm on Malcolm" />
	<atom:link rel='hub' href='http://metamalcolm.wordpress.com/?pushpress=hub'/>
		<item>
		<title>FireBug &#8220;console is undefined&#8221;</title>
		<link>http://metamalcolm.wordpress.com/2009/08/06/firebug-console-is-undefined/</link>
		<comments>http://metamalcolm.wordpress.com/2009/08/06/firebug-console-is-undefined/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 18:09:42 +0000</pubDate>
		<dc:creator>Malcolm</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[FireBug]]></category>

		<guid isPermaLink="false">http://metamalcolm.wordpress.com/?p=7</guid>
		<description><![CDATA[A clean wrapper for the FireBug console object, that eliminates the "console is undefined" problem faced when FireBug is not installed.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metamalcolm.wordpress.com&amp;blog=8873476&amp;post=7&amp;subd=metamalcolm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a response to <a title="FireBug &quot;console is undefined&quot;, by Shreevatsa" href="http://shreevatsa.wordpress.com/2009/08/05/firebug-console-is-undefined/">Shreevatsa&#8217;s post</a> of the same title.</p>
<p>I like the simplicity of that solution. In fact, I wish I thought of it a month ago when I needed it! Instead, I came up with a different, but possibly nicer, solution in the end. </p>
<p>My solution was to implement a simple <code>Console</code> object that wrapped the FireBug <code>console</code> object. The wrapper object checks whether FireBug exists, and if so, calls the appropriate <code>console</code> method. So in my client code, instead of calling <code>console.log(...)</code>, for example, I call <code>Console.log(...)</code>.</p>
<p><pre class="brush: jscript;">
function Console () {
}

// To turn off all console features, set Console.enabled to false.
Console.enabled = true;

// Console.log(object[, object, ...]) - Print a message in the log. If
// FireBug is enabled, print the message in the FireBug
// console. Otherwise, do nothing.
Console.log = function () {
    if (Console.enabled &amp;&amp; window.console &amp;&amp; window.console.log) {
        console.log.apply(console, arguments);
    }
};
</pre></p>
<p>There are a couple of benefits to this. First of all, when you want to disable all logging, all you have to do is set <code>Console.enabled</code> to <code>false</code>. This is great if you make extensive use of the FireBug logging features, and don&#8217;t want to permanently remove all of the logging. Second of all, you can use this object from multiple different Javascript files, without having to write more code.</p>
<p>In the above code snippet I only implemented a wrapper for the <code>console.log</code> method; but you can wrap any or all of the <code>console</code> methods. Here are some more.</p>
<p><pre class="brush: jscript;">
// Console.debug(object[, object, ...]) - Writes a message to the
// FireBug console, including a hyperlink to the line where it was
// called.
Console.debug = function () {
    if (Console.enabled &amp;&amp; window.console &amp;&amp; window.console.debug) {
        console.debug.apply(console, arguments);
    }
};

// Console.info(object[, object, ...]) - Writes a message to the
// console with the visual &quot;info&quot; icon and color coding and a
// hyperlink to the line where it was called.
Console.info = function () {
    if (Console.enabled &amp;&amp; window.console &amp;&amp; window.console.info) {
        console.info.apply(console, arguments);
    }
};

// Console.warn(object[, object, ...]) - Writes a message to the
// console with the visual &quot;warning&quot; icon and color coding and a
// hyperlink to the line where it was called.
Console.warn = function () {
    if (Console.enabled &amp;&amp; window.console &amp;&amp; window.console.warn) {
        console.warn.apply(console, arguments);
    }
};

// Console.error(object[, object, ...]) - Writes a message to the
// console with the visual &quot;error&quot; icon and color coding and a
// hyperlink to the line where it was called. If FireBug is not
// enabled, an alert box is displayed, requesting that the user enable
// FireBug to debug the problem.
Console.error = function () {
    if (Console.enabled &amp;&amp; window.console &amp;&amp; window.console.error) {
        console.error.apply(console, arguments);
    } else if (Console.enabled) {
        var errMsg = &quot;&quot;;
        for (arg in arguments) {
            errMsg += arg;
        }
        alert(&quot;An error has occurred. Please enable FireBug to debug it. &quot; + 
            errMsg);
    }
};

// Console.assert(expression[, object, ...]) - Tests that an
// expression is true. If not, it will write a message to the console
// and throw an exception.
Console.assert = function () {
    if (Console.enabled &amp;&amp; window.console &amp;&amp; window.console.assert) {
        console.assert.apply(console, arguments);
    } else if (Console.enabled &amp;&amp; arguments[0] == false) {
        alert(&quot;An error has occurred. Please enable FireBug to debug it. &quot; + 
            arguments[1]);
    }
};

// Console.dir(object) - Prints an interactive listing of all
// properties of the object. This looks identical to the view that you
// would see in the DOM tab.
Console.dir = function () {
    if (Console.enabled &amp;&amp; window.console &amp;&amp; window.console.dir) {
        console.dir.apply(console, arguments);
    }
};
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/metamalcolm.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/metamalcolm.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/metamalcolm.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/metamalcolm.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/metamalcolm.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/metamalcolm.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/metamalcolm.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/metamalcolm.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/metamalcolm.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/metamalcolm.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/metamalcolm.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/metamalcolm.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/metamalcolm.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/metamalcolm.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metamalcolm.wordpress.com&amp;blog=8873476&amp;post=7&amp;subd=metamalcolm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://metamalcolm.wordpress.com/2009/08/06/firebug-console-is-undefined/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/acb3adc74df61b9edbce4ec528c7d9cf?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">malcolm</media:title>
		</media:content>
	</item>
		<item>
		<title>Beware of XHTML</title>
		<link>http://metamalcolm.wordpress.com/2009/08/05/beware-of-xhtml/</link>
		<comments>http://metamalcolm.wordpress.com/2009/08/05/beware-of-xhtml/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 01:55:09 +0000</pubDate>
		<dc:creator>Malcolm</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://metamalcolm.wordpress.com/?p=15</guid>
		<description><![CDATA[I found this interesting article, Beware of XHTML, while browsing the web today. It explains many, if not all, of the misconceptions about XHTML, and why it&#8217;s probably best to continue using HTML 4.01. I&#8217;ve always been of the opinion that writing standards-compliant XHTML 1.x is the best way to develop a website or a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metamalcolm.wordpress.com&amp;blog=8873476&amp;post=15&amp;subd=metamalcolm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I found this interesting article, <a title="Beware of XHTML" href="http://www.webdevout.net/articles/beware-of-xhtml">Beware of <abbr title="Extensible Hypertext Markup Language">XHTML</abbr></a>, while browsing the web today. It explains many, if not all, of the misconceptions about <abbr title="Extensible HyperText Markup Language">XHTML</abbr>, and why it&#8217;s probably best to continue using <abbr title="HyperText Markup Language">HTML</abbr> 4.01.</p>
<p>I&#8217;ve always been of the opinion that writing standards-compliant <abbr title="Extensible Hypertext Markup Language">XHTML</abbr> 1.x is the best way to develop a website or a web application. By &#8220;standards-compliant&#8221;, I mean  writing <abbr title="Extensible Hypertext Markup Language">XHTML</abbr> code that validates using the <a title="W3C Validator" href="http://validator.w3.org">W3C Validator</a>.</p>
<p>As it turns out, however, I have never written <abbr title="Extensible Hypertext Markup Language">XHTML</abbr> that is completely standards compliant, since I&#8217;ve never changed the MIME type specified by the web server when sending <abbr title="Extensible Hypertext Markup Language">XHTML</abbr> pages to <code>application/xhtml+xml</code>. According to the article, unless the MIME type is specified as so, web browsers will continue to use their <abbr title="Hypertext Markup Language">HTML</abbr> parsers on your page, instead of their <abbr title="Extensible Hypertext Markup Language">XHTML</abbr> parsers. Unfortunately, Internet Explorer (even version 8 ) doesn&#8217;t even have an <abbr title="Extensible Hypertext Markup Language">XHTML</abbr> parser. So setting <code>application/xhtml+xml</code> as the MIME type causes anyone who visits an <abbr title="Extensible Hypertext Markup Language">XHTML</abbr> web page to be prompted to download the file in Internet Explorer.</p>
<p>This practically eliminates the possibility of writing XHTML code that actually utilizes the XHTML parsers of web browsers. Even WordPress uses XHTML, but with the HTML MIME type (<code>text/html</code>), which is not considered good practise by the author of <a title="Beware of XHTML" href="http://www.webdevout.net/articles/beware-of-xhtml">Beware of <abbr title="Extensible Hypertext Markup Language">XHTML</abbr></a>, and indeed, most of the Web community. (See <a href="http://en.wikipedia.org/wiki/Xhtml">Wikipedia</a> for more about this. There is some <a href="http://h3h.net/2005/12/xhtml-harmful-to-feelings/">dissent</a> on this opinion, which I think has value.)</p>
<p>The part that bothers me most about using <abbr title="Hypertext Markup Language">HTML</abbr> 4.01 is that it feels like a step backwards in progress. XML is a better metalanguage than SGML, the parent language of HTML. XML has many advantages, such as embedding multiple different languages in a single document. Why should we return to using an older standard? Well I found a pretty good explanation in the <a href="http://www.w3.org/TR/2008/WD-html5-20080122/#relationship0">HTML 5 draft specification</a>.</p>
<p>With all the major players in the web industry endorsing <abbr title="Hypertext Markup Language">HTML</abbr> 5, does XHTML have a future? Yes, according to <a href="http://en.wikipedia.org/wiki/Tim_Berners-Lee">Tim Berners-Lee</a>. He describes why <a href="http://dig.csail.mit.edu/breadcrumbs/node/166">here</a>. So I guess I shouldn&#8217;t feel so bad using <abbr title="Hypertext Markup Language">HTML</abbr>. Eventually we&#8217;ll make the switch, but just not yet.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/metamalcolm.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/metamalcolm.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/metamalcolm.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/metamalcolm.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/metamalcolm.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/metamalcolm.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/metamalcolm.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/metamalcolm.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/metamalcolm.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/metamalcolm.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/metamalcolm.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/metamalcolm.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/metamalcolm.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/metamalcolm.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metamalcolm.wordpress.com&amp;blog=8873476&amp;post=15&amp;subd=metamalcolm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://metamalcolm.wordpress.com/2009/08/05/beware-of-xhtml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/acb3adc74df61b9edbce4ec528c7d9cf?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">malcolm</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world!</title>
		<link>http://metamalcolm.wordpress.com/2009/08/04/hello-world/</link>
		<comments>http://metamalcolm.wordpress.com/2009/08/04/hello-world/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 23:49:30 +0000</pubDate>
		<dc:creator>Malcolm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metamalcolm.wordpress.com&amp;blog=8873476&amp;post=1&amp;subd=metamalcolm&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Welcome to <a href="http://wordpress.com/">WordPress.com</a>. This is your first post. Edit or delete it and start blogging!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/metamalcolm.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/metamalcolm.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/metamalcolm.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/metamalcolm.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/metamalcolm.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/metamalcolm.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/metamalcolm.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/metamalcolm.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/metamalcolm.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/metamalcolm.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/metamalcolm.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/metamalcolm.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/metamalcolm.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/metamalcolm.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=metamalcolm.wordpress.com&amp;blog=8873476&amp;post=1&amp;subd=metamalcolm&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://metamalcolm.wordpress.com/2009/08/04/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/acb3adc74df61b9edbce4ec528c7d9cf?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">malcolm</media:title>
		</media:content>
	</item>
	</channel>
</rss>
