<?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>Whitespace Considered Harmful</title>
	<atom:link href="http://whitespaceconsideredharmful.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://whitespaceconsideredharmful.com</link>
	<description>Works on my machine</description>
	<lastBuildDate>Tue, 27 Dec 2011 19:36:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Hailstorm: First Version Tagged</title>
		<link>http://whitespaceconsideredharmful.com/2011/12/hailstorm-first-version-tagged/</link>
		<comments>http://whitespaceconsideredharmful.com/2011/12/hailstorm-first-version-tagged/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 19:36:25 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Hailstorm]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://whitespaceconsideredharmful.com/?p=94</guid>
		<description><![CDATA[Well, I know its not much&#8230; but I figured I should start writing about all my programming (and non-programming) exploits more regularly. A lot of these are going to be shorter status updates, since I may not always have that much to write about. At least I&#8217;m going to get back in to the habit [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I know its not much&#8230; but I figured I should start writing about all my programming (and non-programming) exploits more regularly. A lot of these are going to be shorter status updates, since I may not always have that much to write about. At least I&#8217;m going to get back in to the habit <img src='http://whitespaceconsideredharmful.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Here&#8217;s a screenshot from my the new improved Hailstorm engine! A big thanks to Christine who got me a DirectX programming book for Christmas. Right now the program only starts up a window and DirectX, but more is coming.</p>
<div id="attachment_95" class="wp-caption alignnone" style="width: 310px"><a href="http://whitespaceconsideredharmful.com/wp-content/uploads/2011/12/hailstorm_firstscreen.png" rel="lightbox[94]"><img src="http://whitespaceconsideredharmful.com/wp-content/uploads/2011/12/hailstorm_firstscreen-300x225.png" alt="The first screenshot from hailstorm" title="Hailstorm First Screenshot" width="300" height="225" class="size-medium wp-image-95" /></a><p class="wp-caption-text">I know its just a blank window <img src='http://whitespaceconsideredharmful.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p></div>
<p>Check out https://github.com/smacdo/Hailstorm for the code and wiki!</p>
]]></content:encoded>
			<wfw:commentRss>http://whitespaceconsideredharmful.com/2011/12/hailstorm-first-version-tagged/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tip of the Day: Generic Containers</title>
		<link>http://whitespaceconsideredharmful.com/2011/06/tip-of-the-day-generic-containers/</link>
		<comments>http://whitespaceconsideredharmful.com/2011/06/tip-of-the-day-generic-containers/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 03:30:08 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://whitespaceconsideredharmful.com/?p=55</guid>
		<description><![CDATA[Always wanted a simple utility function to print our an arbitrary STL container? Well, so long as your container type support directional iterators&#8230; this method I wrote will work perfectly! Its a great example for why templates are awesome]]></description>
			<content:encoded><![CDATA[<p>Always wanted a simple utility function to print our an arbitrary STL container? Well, so long as your container type support directional iterators&#8230; this method I wrote will work perfectly! Its a great example for why templates are awesome <img src='http://whitespaceconsideredharmful.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre class="brush: cpp; title: Generic dumpContainer&lt;T&gt; implementation; notranslate">
#include &lt;sstream&gt;

template&lt;typename T&gt;
std::string dumpContainer( const T&amp; container, std::string sep )
{
    typename T::const_iterator itr;
    std::stringstream sstream;

    for ( itr = container.begin(); itr != container.end(); ++itr )
    {
        // insert a seperator char for all but the first element
        if ( itr != container.begin() )
        {
            sstream &lt;&lt; sep;
        }

        sstream &lt;&lt; *itr;
    }

    return sstream.str();
}
</pre>
<pre class="brush: cpp; title: Using dumpContainer&lt;T&gt;; notranslate">
#include &lt;vector&gt;
#include &lt;iostream&gt;

int main( int argc, char* argv[] )
{
    std::vector&lt;int&gt; values = { 1, 2, 3, 5 };
    std::cout &lt;&lt; dumpContainer( values, &quot;, &quot; ) &lt;&lt; std::endl;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://whitespaceconsideredharmful.com/2011/06/tip-of-the-day-generic-containers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On Qt and Visual Studio</title>
		<link>http://whitespaceconsideredharmful.com/2011/06/on-qt-and-visual-studio/</link>
		<comments>http://whitespaceconsideredharmful.com/2011/06/on-qt-and-visual-studio/#comments</comments>
		<pubDate>Sat, 11 Jun 2011 03:13:00 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://whitespaceconsideredharmful.com/?p=45</guid>
		<description><![CDATA[So your awesome project that you&#8217;re developing with Visual Studio, and you want to use Trolltech&#8217;s Qt library? Luckily Trolltech provides an awesome Visual Studio plugin that does almost everything Qt creator does (minus Intellisense support for slots). The bad news is that Trolltech doesn&#8217;t directly tell you how to go about doing this: Download [...]]]></description>
			<content:encoded><![CDATA[<p>So your awesome project that you&#8217;re developing with Visual Studio, and you want to use Trolltech&#8217;s Qt library? Luckily Trolltech provides an awesome Visual Studio plugin that does almost everything Qt creator does (minus Intellisense support for slots). The bad news is that Trolltech doesn&#8217;t directly tell you how to go about doing this:</p>
<ol>
<li>Download and install the Qt for <a title="Qt Visual Studio plugin" href="http://qt.nokia.com/downloads/visual-studio-add-in" target="_blank">Visual Studio plugin</a>.</li>
<li>Download the<a title="Qt Source Code" href="http://qt.nokia.com/downloads/windows-cpp-vs2008" target="_blank"> source code</a> for Qt 4.7</li>
<li>Start the Visual Studio 2010 Command Prompt ( Microsoft Visual Studio 2010 -&gt; Visual Studio Tools -&gt; Visual Studio Command Prompt)</li>
<li>Navigate to the directory with your downloaded Qt SDK</li>
<li>Run the configure program like so: &#8220;configure -platform win32-msvc2010 -debug-and-release -static -no-gif -no-qt3support -no-dbus -no-phonon-backend&#8221;</li>
<li>Wait ten or so minutes for configure to finish</li>
<li>Now run nmake. And make dinner, because this will take a very long time</li>
<li>You have Qt ready to go! Yay!</li>
</ol>
<p>The configure parameters I provide will configure Visual Studio to build the vast majority of Qt. There&#8217;s a lot of extra options you can explore if you desire more control &#8211; for instance, you can enable exception support.</p>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://whitespaceconsideredharmful.com/2011/06/on-qt-and-visual-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On Randomness</title>
		<link>http://whitespaceconsideredharmful.com/2011/06/on-randomness/</link>
		<comments>http://whitespaceconsideredharmful.com/2011/06/on-randomness/#comments</comments>
		<pubDate>Thu, 02 Jun 2011 03:11:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Game Desgn]]></category>
		<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://whitespaceconsideredharmful.com/?p=42</guid>
		<description><![CDATA[So, here&#8217;s an interesting problem that I&#8217;ve been thinking about. Most (if not all) games make very heavy use of random values to determine outcomes and results. The interesting thing about this though is the idea of luck, or more specifically runs of bad luck (aka incurring the wrath RNG God) where you consistently do [...]]]></description>
			<content:encoded><![CDATA[<p>So, here&#8217;s an interesting problem that I&#8217;ve been thinking about. Most (if not all) games make very heavy use of random values to determine outcomes and results.</p>
<p>The interesting thing about this though is the idea of luck, or more specifically runs of bad luck (aka incurring the wrath RNG God) where you consistently do not realize the outcome you wish. Ask your average RPG player &#8211; what&#8217;s more frustrating then attacking a low level spider and missing the next five attacks only to have the spider slay you? Impossible? Not at all. Improbable? Of course. Another infuriating example of this comes in with loot drops. Many bosses drop unique or rare types of loot that people want to collect, and expecting to collect these items can be an exercise in frustration. A 25% drop in no way means that you will have the item within four kills, rather you will need to kill the boss 14 times before you have a 98% chance of collecting said item.</p>
<p>So basically, pure random rolls stink. Over time, the bad runs average out with the good runs, so its not like these situations happen all the time. However it&#8217;s human nature to remember the bad runs, and sometimes enough improbable bad strings of luck is enough to make the player quit your game entirely. Sure, it might be _fair_&#8230; but who plays a game to die to a lowly spider just because of bad luck? People play games because they want GOOD luck.</p>
<p>So how do we fix this? Well this is what I&#8217;ve been thinking about for the past few days. Instead of a pure random number generator, I want a &#8220;nice&#8221; random number generator that somehow ensures you will get a desired outcome sooner rather than later. Essentially, we want to break up runs of &#8220;bad results&#8221; with good results in between.  The best answer I&#8217;ve found so far is the concept of a &#8220;grab bag&#8221;, which is array of pick results that is shuffled.</p>
<p>I&#8217;ll go over this concept more in my next post, and some of interesting properties it brings up. The results are more &#8220;balanced&#8221;, but does it ruin the concept of a game? Stick around! <img src='http://whitespaceconsideredharmful.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>(I&#8217;m going to try writing more entries to practice my writing abilities, and also to share my thoughts with everyone else on game programming and design. Please share criticism or suggestions with me!)</p>
]]></content:encoded>
			<wfw:commentRss>http://whitespaceconsideredharmful.com/2011/06/on-randomness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tip of the Day: Of Vectors and Arrays</title>
		<link>http://whitespaceconsideredharmful.com/2011/03/tip-of-the-day-of-vectors-and-arrays/</link>
		<comments>http://whitespaceconsideredharmful.com/2011/03/tip-of-the-day-of-vectors-and-arrays/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 00:46:17 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://whitespaceconsideredharmful.com/?p=30</guid>
		<description><![CDATA[STL vectors can act as typical c-style arrays. To cast from vector&#60;T&#62; to T*, simply take the address of the first element.]]></description>
			<content:encoded><![CDATA[<p>STL vectors can act as typical c-style arrays. To cast from vector&lt;T&gt; to T*, simply take the address of the first element.</p>
<pre class="brush: cpp; title: Sample function taking int pointer; notranslate">
void myFunction( int* i )
{
	std::cout &lt;&lt; *i &lt;&lt; std::endl;
}
</pre>
<pre class="brush: cpp; title: Passing the STL vector as a pointer; notranslate">
std::vector myVector;

myFunction( &amp;myVector[0] );
</pre>
]]></content:encoded>
			<wfw:commentRss>http://whitespaceconsideredharmful.com/2011/03/tip-of-the-day-of-vectors-and-arrays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C++ Template Name Madness</title>
		<link>http://whitespaceconsideredharmful.com/2010/06/c-template-name-madness/</link>
		<comments>http://whitespaceconsideredharmful.com/2010/06/c-template-name-madness/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 00:54:09 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://whitespaceconsideredharmful.com/?p=20</guid>
		<description><![CDATA[As I learned today, name lookups with regards to template based inheritance is a nightmare. I&#8217;ll try to write more later on why this is the case (two phase lookup), but for know lets highlight the situation. Pretend you have an awesome templated square matrix class, parameterized on the value type and its size. It [...]]]></description>
			<content:encoded><![CDATA[<p>As I learned today, name lookups with regards to template based inheritance is a nightmare. I&#8217;ll try to write more later on why this is the case (two phase lookup), but for know lets highlight the situation.</p>
<p>Pretend you have an awesome templated square matrix class, parameterized on the value type and its size. It would probably look something like this:</p>
<blockquote><p>// the template class</p></blockquote>
<p>Once you have the matrix, you&#8217;d want to specialize it for specific sizes (say N=4). Its also a good idea to do this so you can add more constructors (doubt you want to keep creating arrays to pass in!). Anyhow, your implementation might end up looking something like</p>
<blockquote><p>// derieved TMatrix4&lt;T&gt;</p></blockquote>
<p>Guess what? It won&#8217;t work! But before we can get to that, the compiler is going to try to confuse us into thinking the problem is somewhere else! Take the following code. It should work, right?</p>
<blockquote><p>TMatrix4&lt;float&gt; a = b + c;</p></blockquote>
<p>Ha! The compiler throws a really nasty error, which I&#8217;ll paraphrase here:</p>
<blockquote><p>&#8220;No match for operator= in &#8216;n=TMatrix&lt;T,N&gt;::operator + ( const TMatrixT,N&gt;&amp; ) const [with T= float, int N=4]&#8220;</p></blockquote>
<p>&#8220;What black magic is this?&#8221;, I hear you say. Without going into details, the compiler is lying to you &#8211; while the compiler is erroring out on the assignment operator it is actually trying to find the constructor. (Return Value Optimization). So, implementing the copy constructor in the derieved TMatrix4 class should solve the problem, right?</p>
<p>Wrong!</p>
<blockquote><p>// i need to recreate the error for you guys</p></blockquote>
<p>When you created TMatrix4, you created a templated class that depended TMatrix&lt;T,N&gt;. When you call operator +, it is using TMatrix&lt;T,N&gt;::+ which has a return type of TMatrix&lt;T,N&gt;. Open returning from operator +, it needs to construct a new object &#8211; but the compiler cannot tell that the returned object is TMatrix4&lt;T&gt;. So the solution:</p>
<blockquote><p>TMatrix4( const TMatrix&lt;T,4&gt;&amp; mat )</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://whitespaceconsideredharmful.com/2010/06/c-template-name-madness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t panic!</title>
		<link>http://whitespaceconsideredharmful.com/2009/10/combatting-spam-in-wordpress-the-easy-way/</link>
		<comments>http://whitespaceconsideredharmful.com/2009/10/combatting-spam-in-wordpress-the-easy-way/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 16:34:58 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://whitespaceconsideredharmful.com//?p=1</guid>
		<description><![CDATA[I just finished upgrading to the newest WordPress, and guess what! WordPress ate my weblog entries, and its almost 2:00 in the morning. I&#8217;ll get everything transferred over tomorrow morning.]]></description>
			<content:encoded><![CDATA[<p>I just finished upgrading to the newest WordPress, and guess what! WordPress ate my weblog entries, and its almost 2:00 in the morning. I&#8217;ll get everything transferred over tomorrow morning.</p>
]]></content:encoded>
			<wfw:commentRss>http://whitespaceconsideredharmful.com/2009/10/combatting-spam-in-wordpress-the-easy-way/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

