<?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"
	>

<channel>
	<title>Marc O'Morain</title>
	<atom:link href="http://marcomorain.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://marcomorain.com</link>
	<description>WYSIWTF</description>
	<pubDate>Tue, 13 May 2008 16:17:18 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>Banjo Kazooie - Nuts and Bolts!</title>
		<link>http://marcomorain.com/archives/2008/05/13/234/banjo-kazooie-nuts-and-bolts/</link>
		<comments>http://marcomorain.com/archives/2008/05/13/234/banjo-kazooie-nuts-and-bolts/#comments</comments>
		<pubDate>Tue, 13 May 2008 16:17:18 +0000</pubDate>
		<dc:creator>marc</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://marcomorain.com/?p=234</guid>
		<description><![CDATA[
One of my favourite games from the N64 has a new sequel in the works, due out this year.
]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="500" height="319" id="gamevideos6" align="middle"><param name="quality" value="high" /><param name="play" value="true" /><param name="loop" value="true" /><param name="scale" value="showall" /><param name="wmode" value="window" /><param name="devicefont" value="false" /><param name="bgcolor" value="#000000" /><param name="menu" value="true" /><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="true" /><param name="salign" value="" /><param name="movie" value="http://gamevideos.com//swf/gamevideos11.swf?embedded=1&amp;fullscreen=1&amp;autoplay=0&amp;src=http://gamevideos.com/video/videoListXML%3Fid%3D18831%26ordinal%3D%26adPlay%3Dfalse" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="http://gamevideos.com//swf/gamevideos11.swf?embedded=1&amp;fullscreen=1&amp;autoplay=0&amp;src=http://gamevideos.com/video/videoListXML%3Fid%3D18831%26ordinal%3D%26adPlay%3Dfalse" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" play="true" loop="true" scale="showall" wmode="window" devicefont="false" id="gamevideos6" bgcolor="#000000" name="gamevideos6" menu="true" allowscriptaccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" align="middle" width="500" height="319" /></object></p>
<p>One of my favourite games from the N64 has a new sequel in the works, due out this year.</p>
]]></content:encoded>
			<wfw:commentRss>http://marcomorain.com/archives/2008/05/13/234/banjo-kazooie-nuts-and-bolts/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Very long file copy from Windows Vista</title>
		<link>http://marcomorain.com/archives/2008/04/27/232/very-long-file-copy-from-windows-vista/</link>
		<comments>http://marcomorain.com/archives/2008/04/27/232/very-long-file-copy-from-windows-vista/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 19:21:37 +0000</pubDate>
		<dc:creator>marc</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Bug]]></category>

		<category><![CDATA[Vista]]></category>

		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://marcomorain.com/?p=232</guid>
		<description><![CDATA[
This should have taken about an hour to copy.
]]></description>
			<content:encoded><![CDATA[<p><a href='http://marcomorain.com/wp-content/uploads/2008/04/longcopy.png'><img src="http://marcomorain.com/wp-content/uploads/2008/04/longcopy.png" alt="A very long time to copy a file" title="Long Copy" width="416" height="244" class="alignnone size-full wp-image-233" /></a></p>
<p>This should have taken about an hour to copy.</p>
]]></content:encoded>
			<wfw:commentRss>http://marcomorain.com/archives/2008/04/27/232/very-long-file-copy-from-windows-vista/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Cloth Video</title>
		<link>http://marcomorain.com/archives/2008/02/20/230/cloth-video/</link>
		<comments>http://marcomorain.com/archives/2008/02/20/230/cloth-video/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 23:13:29 +0000</pubDate>
		<dc:creator>marc</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://marcomorain.com/archives/2008/02/20/230/cloth-video/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="420" height="405" id="gamevideos6" align="middle"><param name="quality" value="high"></param><param name="play" value="true"></param><param name="loop" value="true"></param><param name="scale" value="showall"></param><param name="wmode" value="window"></param><param name="devicefont" value="false"></param><param name="bgcolor" value="#000000"></param><param name="menu" value="true"></param><param name="allowScriptAccess" value="sameDomain"></param><param name="allowFullScreen" value="true"></param><param name="salign" value=""><param name="movie" value="http://www.gamevideos.com:80/swf/gamevideos11.swf?embedded=1&#038;fullscreen=1&#038;autoplay=0&#038;src=http://www.gamevideos.com:80/video/videoListXML%3Fid%3D17589%26ordinal%3D1203462766928%26adPlay%3Dfalse" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="http://www.gamevideos.com:80/swf/gamevideos11.swf?embedded=1&#038;fullscreen=1&#038;autoplay=0&#038;src=http://www.gamevideos.com:80/video/videoListXML%3Fid%3D17589%26ordinal%3D1203462766928%26adPlay%3Dfalse" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" play="true" loop="true" scale="showall" wmode="window" devicefont="false" id="gamevideos6" bgcolor="#000000" name="gamevideos6" menu="true" allowscriptaccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" align="middle" height="405" width="420"/></param></object></p>
]]></content:encoded>
			<wfw:commentRss>http://marcomorain.com/archives/2008/02/20/230/cloth-video/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Battlefield: Bad Company - Destruction</title>
		<link>http://marcomorain.com/archives/2008/02/11/229/battlefield-bad-company-destruction/</link>
		<comments>http://marcomorain.com/archives/2008/02/11/229/battlefield-bad-company-destruction/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 22:02:27 +0000</pubDate>
		<dc:creator>marc</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://marcomorain.com/archives/2008/02/11/229/battlefield-bad-company-destruction/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="gtembed" width="480" height="392"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="true" /><param name="movie" value="http://www.gametrailers.com/remote_wrap.php?mid=29446"/><param name="quality" value="high" /><embed src="http://www.gametrailers.com/remote_wrap.php?mid=29446" swLiveConnect="true" name="gtembed" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="480" height="392"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://marcomorain.com/archives/2008/02/11/229/battlefield-bad-company-destruction/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Great Web Usability</title>
		<link>http://marcomorain.com/archives/2008/02/11/225/great-web-usability/</link>
		<comments>http://marcomorain.com/archives/2008/02/11/225/great-web-usability/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 15:45:59 +0000</pubDate>
		<dc:creator>marc</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://marcomorain.com/archives/2008/02/11/225/great-web-usability/</guid>
		<description><![CDATA[I just noticed some really lazy web programming. Go to CarZone.ie and select a car type. I picked Porsche, and hit &#8216;find&#8217;.

But the website can&#8217;t do a search based just on car type. Here is the error dialogue that I got:

This is a bit annoying, since I don&#8217;t know what type of Porsche I want, [...]]]></description>
			<content:encoded><![CDATA[<p>I just noticed some really lazy web programming. Go to CarZone.ie and select a car type. I picked Porsche, and hit &#8216;find&#8217;.</p>
<p><a href='http://marcomorain.com/wp-content/uploads/2008/02/carzone_ie_1.png' title='CarZone1'><img src='http://marcomorain.com/wp-content/uploads/2008/02/carzone_ie_1.png' alt='CarZone1' /></a></p>
<p>But the website can&#8217;t do a search based just on car type. Here is the error dialogue that I got:</p>
<p><a href='http://marcomorain.com/wp-content/uploads/2008/02/carzone_ie_2.png' title='CarZone2'><img src='http://marcomorain.com/wp-content/uploads/2008/02/carzone_ie_2.png' alt='CarZone2' /></a></p>
<p>This is a bit annoying, since I don&#8217;t know what type of Porsche I want, I just want to look at Porsches. So I followed the site&#8217;s advice and went to the advanced search page. I selected Porsche, and hit find.</p>
<p><a href='http://marcomorain.com/wp-content/uploads/2008/02/carzone_ie_3.png' title='CarZone3'><img src='http://marcomorain.com/wp-content/uploads/2008/02/carzone_ie_3.png' alt='CarZone3' /></a></p>
<p>But when doing an advanced search, just giving the type of car was enough. Here is the list of Porsches:</p>
<p><a href='http://marcomorain.com/wp-content/uploads/2008/02/carzone_ie_4.png' title='CarZone4'><img src='http://marcomorain.com/wp-content/uploads/2008/02/carzone_ie_4.png' alt='CarZone4' /></a></p>
<p>Why can&#8217;t they just do that on the main page?</p>
]]></content:encoded>
			<wfw:commentRss>http://marcomorain.com/archives/2008/02/11/225/great-web-usability/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New software</title>
		<link>http://marcomorain.com/archives/2007/12/05/223/new-software/</link>
		<comments>http://marcomorain.com/archives/2007/12/05/223/new-software/#comments</comments>
		<pubDate>Wed, 05 Dec 2007 22:46:04 +0000</pubDate>
		<dc:creator>marc</dc:creator>
		
		<category><![CDATA[C++]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://marcomorain.com/archives/2007/12/05/223/new-software/</guid>
		<description><![CDATA[I added a new page for my new program, screenshoot.exe. Read about it here.
]]></description>
			<content:encoded><![CDATA[<p>I added a new page for my new program, screenshoot.exe. <a href="http://marcomorain.com/software/screenshoot/">Read about it here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://marcomorain.com/archives/2007/12/05/223/new-software/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How Many Buzzwords Can You Fit in One Sentence?</title>
		<link>http://marcomorain.com/archives/2007/11/30/220/how-many-buzzwords-can-you-fit-in-one-sentence/</link>
		<comments>http://marcomorain.com/archives/2007/11/30/220/how-many-buzzwords-can-you-fit-in-one-sentence/#comments</comments>
		<pubDate>Thu, 29 Nov 2007 23:06:12 +0000</pubDate>
		<dc:creator>marc</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://marcomorain.com/archives/2007/11/30/220/how-many-buzzwords-can-you-fit-in-one-sentence/</guid>
		<description><![CDATA[I came across this article on reddit. It contains the following sentence, that left me awestruck:
&#8220;Many industries are barreling toward paradigm shifts that will require the high-level programming and development skills needed to create and maintain industrial-strength applications for multi-core processing, large-scale Internet computing and Software as a Service (SaaS), as well as rich clients [...]]]></description>
			<content:encoded><![CDATA[<p>I came across <a href="http://reddevnews.com/features/article.aspx?editorialsid=2373">this article</a> on reddit. It contains the following sentence, that left me awestruck:</p>
<p>&#8220;Many industries are barreling toward paradigm shifts that will require the high-level programming and development skills needed to create and maintain industrial-strength applications for multi-core processing, large-scale Internet computing and Software as a Service (SaaS), as well as rich clients for desktop, Web and mobile platforms.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://marcomorain.com/archives/2007/11/30/220/how-many-buzzwords-can-you-fit-in-one-sentence/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CAPTCHA resistance test</title>
		<link>http://marcomorain.com/archives/2007/11/19/219/captcha-resistance-test/</link>
		<comments>http://marcomorain.com/archives/2007/11/19/219/captcha-resistance-test/#comments</comments>
		<pubDate>Mon, 19 Nov 2007 17:58:47 +0000</pubDate>
		<dc:creator>marc</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://marcomorain.com/archives/2007/11/19/219/captcha-resistance-test/</guid>
		<description><![CDATA[This is a CAPTCHA resistance test. Fun.
]]></description>
			<content:encoded><![CDATA[<p>This is a <a href="http://www.biais.org/blog/index.php/2007/01/26/22-captcha-resistance-test">CAPTCHA resistance test</a>. Fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://marcomorain.com/archives/2007/11/19/219/captcha-resistance-test/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Virtual Interfaces in C++</title>
		<link>http://marcomorain.com/archives/2007/11/18/218/virtual-interfaces-in-c/</link>
		<comments>http://marcomorain.com/archives/2007/11/18/218/virtual-interfaces-in-c/#comments</comments>
		<pubDate>Sun, 18 Nov 2007 02:15:28 +0000</pubDate>
		<dc:creator>marc</dc:creator>
		
		<category><![CDATA[C++]]></category>

		<category><![CDATA[General]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://marcomorain.com/archives/2007/11/18/218/virtual-interfaces-in-c/</guid>
		<description><![CDATA[I read about the following way of implementing virtual interfaces in Exceptional C++ Style, but I only really realised the need for it this evening.
Suppose I have a class like this:

class Object
{
  public:
    virtual void translate (Vector d) = 0;
};

Other classes will inherit from Object, and they will override translate() as [...]]]></description>
			<content:encoded><![CDATA[<p>I read about the following way of implementing virtual interfaces in <a href="http://www.gotw.ca/publications/xc++s.htm">Exceptional C++ Style</a>, but I only really realised the need for it this evening.</p>
<p>Suppose I have a class like this:</p>
<pre>
class Object
{
  public:
    virtual void translate (Vector d) = 0;
};
</pre>
<p>Other classes will inherit from Object, and they will override <i>translate()</i> as necesssary.</p>
<pre>
class Ball : public Object
{
  private:
    Vector m_position;
  public:
    virtual void translate (Vector d)
    {
        m_position += d;
    }
};
</pre>
<p>Now, suppose later on I decide that I want to keep track of the last time an Object was moved. I might add a variable to store the time of the last movement. I can then set this variable to be the current time in <i>Object::translate()</i>.</p>
<pre>
class Object
{
  private:
    float m_timeOfLastMove;
  public:
    virtual void translate (Vector d)
    {
        m_timeOfLastMove = getCurrentTimeFromSomewhere();
    }
};
</pre>
<p>Now, because <i>translate()</i> was abstract, every other class that I have derived from Object has implemented its own custom implementation of <i>translate()</i>. I now need to go through all my code, and add a call to <i>Object::translate()</i> in each implementation of <i>translate()</i>.</p>
<pre>
class Ball : public Object
{
  private:
    Vector m_position;
  public:
    virtual void translate (Vector d)
    {
        Object::translate(d);
        m_position += d;
    }
};
</pre>
<p>This involes a lot of copying and pasting of code, and I end up with calls to <i>Object::translate(d)</i> all over my code. If I forget to add one of these, the compiler will not complain. If I derive a new class from Object later on, and forget to add this call to the base implementation, I have created a new bug also. The bug will likely not lead to a crash immediately, as I am not doing anything particularily dangerous by not calling the base implementation of <i>translate()</i> in this case. If the bug does not lead to a crash, I might not know that the bug exists for some time.</p>
<p>If I had seperated the implementation of <i>translate()</i> from the public interface right from the start, the code would have been more flexible.</p>
<pre>
class Object
{
  private:
    virtual void translateImplementation (Vector d) = 0;

  public:
    void translate (Vector d)
    {
        translateImplemenentation(d);
    }
};
</pre>
<p>The Object class now has two contracts: Any Object can be translated by calling <i>Object::translate()</i>, and any class that derives from Object must implement translateImplementation(). I am free to change one of these without affecting the other. For example, I could rename the <i>translate()</i> function to <i>move()</i>, and I would not have to change any class the derives from Object.</p>
<p>Suppose I wanted to allow for rotation in the movement of Objects. I could change <i>translateImplementation(Vector d)</i> to <i>transformImplementation(Matrix m)</i>.</p>
<pre>
class Object
{
  private:
    virtual void transformImplementation (Matrix m) = 0;

  public:
    void translate (Vector d)
    {
        Matrix m;
        m.translation = d;
        transformImplementation(m);
    }

    void transform (Matrix m)
    {
        transformImplementation(m);
    }

};
</pre>
<p>All classes that derive from Object would have to change their implementation of translateImplementation(), but all code that calls <i>Object::translate()</i> would not have to be to changed. I can keep the existing <i>translate()</i> function, but also add a <i>transform()</i> function.</p>
<p>The fact that I have made <i>translateImplementation()</i> private is very important. If any other code wants to translate an instance of Object, it must call <i>Object::translate()</i>. It is illegal for any code to call <i>translateImplementation()</i> directly.</p>
<p>Now if I want to go back and modify <i>translate()</i>, it is much easier for me. I may want to add some profiling or logging to all calls to <i>translate()</i>, or I might want to impose some pre-conditions or post-conditions. I can be confident that any additions to the <i>translate()</i> function will not be bypassed by some other class which derived from Object.</p>
]]></content:encoded>
			<wfw:commentRss>http://marcomorain.com/archives/2007/11/18/218/virtual-interfaces-in-c/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Nifty C++ Tip</title>
		<link>http://marcomorain.com/archives/2007/11/18/217/nifty-c-tip/</link>
		<comments>http://marcomorain.com/archives/2007/11/18/217/nifty-c-tip/#comments</comments>
		<pubDate>Sun, 18 Nov 2007 01:21:21 +0000</pubDate>
		<dc:creator>marc</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://marcomorain.com/archives/2007/11/18/217/nifty-c-tip/</guid>
		<description><![CDATA[I have been using this little function in the game I am writing:

template &#60;typename Target, typename Source&#62;
inline Target checked_cast (Source* source)
{
    // In debug, make sure that the cast is valid, using RTTI.
    assert(dynamic_cast&#60;Target&#62;(source));
    return static_cast&#60;Target&#62;(source);
}

In release, it compiles away to a static_cast, whereas in debug [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using this little function in the game I am writing:</p>
<pre>
template &lt;typename Target, typename Source&gt;
inline Target checked_cast (Source* source)
{
    // In debug, make sure that the cast is valid, using RTTI.
    assert(dynamic_cast&lt;Target&gt;(source));
    return static_cast&lt;Target&gt;(source);
}
</pre>
<p>In release, it compiles away to a static_cast, whereas in debug it will assert if the cast is invalid.</p>
]]></content:encoded>
			<wfw:commentRss>http://marcomorain.com/archives/2007/11/18/217/nifty-c-tip/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
