<?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>Reel Geek</title>
	<atom:link href="http://reelgeek.co.uk/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://reelgeek.co.uk/blog</link>
	<description>in an adventure in coding</description>
	<lastBuildDate>Fri, 22 Feb 2013 22:56:36 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Game Engine &#8211; Memory</title>
		<link>http://reelgeek.co.uk/blog/2013/02/22/game-engine-memory/</link>
		<comments>http://reelgeek.co.uk/blog/2013/02/22/game-engine-memory/#comments</comments>
		<pubDate>Fri, 22 Feb 2013 22:56:36 +0000</pubDate>
		<dc:creator>Luthi</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[School]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[game engine]]></category>

		<guid isPermaLink="false">http://reelgeek.co.uk/blog/?p=1380</guid>
		<description><![CDATA[The point of the second assignment was to use our heap system instead of the default. Where we can create multiple heaps to speed up allocation and reduce fragmentation. For instance if you have 1 heap for everything that will stay around the entire game, that data is not in the way when searching for [...]]]></description>
				<content:encoded><![CDATA[<p>The point of the second assignment was to use our heap system instead of the default.  Where we can create multiple heaps to speed up allocation and reduce fragmentation.  For instance if you have 1 heap for everything that will stay around the entire game, that data is not in the way when searching for other data or space to put more data.  We also created tracking information for each piece of data and a redundancy in case of corruption.  </p>
<p><strong>The structure:</strong><br />
We had a memory singleton (Mem) that controlled everything.  It contained all the information like the amount of heaps, amount of allocated data, and total size of allocations in bytes.  In it was a pointer to the heap list and data doubly linked lists.  The heap class points to the next and previous heaps and starts the data list.  It also holds the amount and size of allocations for that heap.  </p>
<p>The tracking class completes the data linked lists for both heap and mem as well holding tracking information.  This part was tricky as it sits above the data and we return the pointer to the actual data on return, so how do you find it again?  You store the pointer to the tracking block in the 4bytes above the data.  </p>
<p><strong>Windows system programming:</strong><br />
This was my first go with direct system calls and I&#8217;d be lying if it didn&#8217;t scare the fuck out of me.  Though it was a lot easier and less dangerous than I feared.  HeapCreate(), HeapDestory(), HeapAllocate(), HeapFree(), HeapRealloc(), HeapSize(), and overloaded new and deletes.</p>
<p><strong>Problems:</strong><br />
The second call to HeapAllocate, I get &#8220;Windows has triggered a breakpoint in PA2.exe.&#8221;  Awesome.  Thanks for the helpful information.  I write print statements, I degbug it every way I know how.  The time to leave for yoga comes and goes.  I&#8217;m too tunnel visioned to care.  I even watch the memory: create heap, allocate heap header, allocate first block, and I see it go red as it attempts to allocate the next.  And boom.</p>
<p>I&#8217;m not certain how, but eventually I notice that I&#8217;m not seeing the tracking head pointer being added.  I type in the address of where it&#8217;s going, the memory window jumps way down.  Oops.  My pointer math was written incorrectly for calculating the end of the tracking block.  Why is it always the little things that trip you up?</p>
<p>Sometime after delete started working, I started to get random crashes.  And I mean random.  With the same break point it would crash sometimes before and sometime not.  When it&#8217;s difficult to reproduce, it&#8217;s even more frustrating to find what&#8217;s causing it.  I&#8217;d fix it, move on, and it&#8217;d come back.  All I knew was sometimes a pointer had issues.  When do they not?</p>
<p>First I added the destroyHeap in the mem initialize method (only if there are some allocated from before) to clean up from previous tests.  I figure if we are zeroing out everything else anyways, might as well make it nice and clean.  Plus there might be a heap pointer going awry somewhere.  That really just made it crash more.  So I&#8217;d go back and forth with commenting it out and then using it again. </p>
<p>Then I added freeing the blocks in the heap before destroying the heap in order to clean up the global linked list.  So really it was a continue on and see if that fixes the problem sort of situation. </p>
<p>In the end, I was debugging something else when I realized that fixing the global pointers in the heapFree function was acting unusual.  Fixed it and no more random crashes.  Then it was only a short time before I fixed the remaining unit test failures.   </p>
<p><strong>Some code:</strong></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span>Heap<span style="color: #008080;">::</span><span style="color: #007788;">privHeapAlloc</span><span style="color: #008000;">&#40;</span>Align align, <span style="color: #0000ff;">size_t</span> inSize, <span style="color: #0000ff;">char</span> <span style="color: #000040;">*</span>inName,  <span style="color: #0000ff;">int</span> lineNum<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
   <span style="color: #0000ff;">int</span> alignment <span style="color: #000080;">=</span> this<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>privGetAlign<span style="color: #008000;">&#40;</span>align<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
   TrackingBlock <span style="color: #000040;">*</span>head <span style="color: #000080;">=</span> this<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>TrackingBlockHead<span style="color: #008080;">;</span>
   <span style="color: #0000ff;">size_t</span> totalSize <span style="color: #000080;">=</span> inSize <span style="color: #000040;">+</span> <span style="color: #0000dd;">sizeof</span><span style="color: #008000;">&#40;</span>TrackingBlock<span style="color: #008000;">&#41;</span><span style="color: #000040;">+</span>alignment<span style="color: #000040;">+</span><span style="color: #0000dd;">1</span><span style="color: #008080;">;</span>
&nbsp;
   <span style="color: #666666;">//allocation of space</span>
   <span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span>unAlignedAddr <span style="color: #000080;">=</span> HeapAlloc<span style="color: #008000;">&#40;</span>winHeapHandle, <span style="color: #0000dd;">0</span>, totalSize<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
   <span style="color: #666666;">//check allocation</span>
   <span style="color: #0000dd;">assert</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">0</span> <span style="color: #000040;">!</span><span style="color: #000080;">=</span> unAlignedAddr<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
   TrackingBlock <span style="color: #000040;">*</span>block <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span><span style="color: #008000;">&#40;</span>unAlignedAddr<span style="color: #008000;">&#41;</span> TrackingBlock<span style="color: #008000;">&#40;</span>inName,lineNum<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
   Mem<span style="color: #008080;">::</span><span style="color: #007788;">privAddAllocInfo</span><span style="color: #008000;">&#40;</span>inSize, block<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
   <span style="color: #666666;">//attach heap pointers</span>
   <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>head <span style="color: #000040;">!</span><span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span>
   <span style="color: #008000;">&#123;</span>
      head<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>hPrev <span style="color: #000080;">=</span> block<span style="color: #008080;">;</span>
      block<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>hNext <span style="color: #000080;">=</span> head<span style="color: #008080;">;</span>
   <span style="color: #008000;">&#125;</span>
   this<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>TrackingBlockHead <span style="color: #000080;">=</span> block<span style="color: #008080;">;</span>
&nbsp;
   <span style="color: #666666;">//update allocation info</span>
   this<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>privAddAllocInfo<span style="color: #008000;">&#40;</span>inSize<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
   <span style="color: #666666;">//update block information</span>
   block<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>allocSize <span style="color: #000080;">=</span> inSize<span style="color: #008080;">;</span>
&nbsp;
   <span style="color: #666666;">//get the address at the end of the trackingblock</span>
   <span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span>temp <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">int</span><span style="color: #008000;">&#41;</span>block <span style="color: #000040;">+</span> <span style="color: #0000dd;">sizeof</span><span style="color: #008000;">&#40;</span>TrackingBlock<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
   <span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span> p <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">int</span><span style="color: #008000;">&#41;</span>temp <span style="color: #000040;">+</span><span style="color: #008000;">&#40;</span>alignment <span style="color: #000040;">-</span> <span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span> <span style="color: #000040;">&amp;</span> ~<span style="color: #008000;">&#40;</span>alignment <span style="color: #000040;">-</span> <span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> 
&nbsp;
   <span style="color: #666666;">//write the address to the top in the 4 bytes above</span>
   <span style="color: #000040;">*</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">int</span> <span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">char</span><span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span>p<span style="color: #000040;">-</span><span style="color: #0000dd;">4</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">int</span><span style="color: #008000;">&#41;</span>block<span style="color: #008080;">;</span>
&nbsp;
   <span style="color: #0000ff;">return</span> p<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://reelgeek.co.uk/blog/2013/02/22/game-engine-memory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Game Engine &#8211; PCS Tree</title>
		<link>http://reelgeek.co.uk/blog/2013/02/22/game-engine-pcs-tree/</link>
		<comments>http://reelgeek.co.uk/blog/2013/02/22/game-engine-pcs-tree/#comments</comments>
		<pubDate>Fri, 22 Feb 2013 22:27:22 +0000</pubDate>
		<dc:creator>Luthi</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[School]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[game engine]]></category>

		<guid isPermaLink="false">http://reelgeek.co.uk/blog/?p=1368</guid>
		<description><![CDATA[The first assignment this term was a parent/child/sibling tree. Each node had a pointers for a parent, child and sibling. That meant the siblings were a singly linked list which made things a bit tricky down the line. We were given a bare bones project with the PCS class and unit test. The point was [...]]]></description>
				<content:encoded><![CDATA[<p>The first assignment this term was a parent/child/sibling tree.  Each node had a pointers for a parent, child and sibling.  That meant the siblings were a singly linked list which made things a bit tricky down the line.  We were given a bare bones project with the PCS class and unit test.  The point was to make all the functions actually do something (properly) so the tests would pass.</p>
<p><strong>Setup:</strong><br />
While I knew the tests would fail, I honesty didn&#8217;t think it would blow up as it did:     </p>
<blockquote><p> The application has failed to start because its side-by-side configuration is incorrect.  </p></blockquote>
<p>That&#8217;s helpful!  Thanks windows!  Cheeky shit.  So I go to the event log&#8230;</p>
<blockquote><p>Activation context generation failed for &#8220;&#8230;PA1.exe&#8221;. Dependent Assembly Microsoft.VC90.DebugCRT, processorArchitecture=&#8221;x86&#8243;, publicKeyToken=&#8221;1fc8b3b9a1e18e3b&#8221;, type=&#8221;win32&#8243;, version=&#8221;9.0.21022.8&#8243; could not be found.</p></blockquote>
<p>My google-fu first tells me to install Microsoft Visual C++ 2005 Redistributable Package, which is odd since I already have it.  Figured it couldn&#8217;t hurt so went ahead and tried that.  Nope.  Further digging, which isn&#8217;t a lot out there, I keep seeing references to Visual Studio 08.  Odd I think since I&#8217;m using 10.  Eventually come to an old posting that mentions installing 08.  I grab a copy from MSDNAA, because I&#8217;m all out of ideas.  The next day someone started a discussion and the best response was: You don&#8217;t need to install VS2008. Just open Project Properties and go to Linker > Manifest File, switch Generate Manifest to No.</p>
<p>Did I mention I&#8217;m too stubborn to ask (other than google) until I&#8217;ve tried everything?  Something about proving that an old art nerd can in fact think with the other side of her brain again.  Or maybe it&#8217;s a lady problem.  I can do <a href="http://xkcd.com/385/">maths</a>!  Probably more likely though is that I remember more by fixing it myself.</p>
<p><strong>Coding begins:</strong><br />
Most of it was pretty straight forward tree building stuff.  It&#8217;d been a while since I&#8217;d dealt with trees and I&#8217;m pretty sure I&#8217;ve never actually written one.  </p>
<p>Recursion and I have never been friendly.  Spending most of my life in tangible ideas &#8211; photography and film &#8211; my brain gets stuck on the abstract concepts.  For instance, it used to be that I wanted to punch whomever thought up pointers.  That is until I took Computer Systems 2 where I figured out that sometimes you want to manipulate something while keeping the original in tact.  All of a sudden, it clicked and I haven&#8217;t had a problem with them since.</p>
<p>I understand that recursion (if done on the right things) will speed up the run time.  Divide and conquer and all that.  But it takes me so long to see what it&#8217;s doing, tracing it out, and holy fuck the debugging nightmare it gives me. </p>
<p><strong>Remove:</strong><br />
We were supposed to remove (not delete) the node and all of it&#8217;s children.  This I spent quite a bit of my time on drawing, writing and rewriting.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #666666;">//Remove a node and all of it's children. Remove the node.</span>
 <span style="color: #0000ff;">void</span> PCSTree<span style="color: #008080;">::</span><span style="color: #0000dd;">remove</span><span style="color: #008000;">&#40;</span>PCSNode <span style="color: #000040;">*</span> <span style="color: #0000ff;">const</span> inNode<span style="color: #008000;">&#41;</span>
 <span style="color: #008000;">&#123;</span>
    PCSNode <span style="color: #000040;">*</span>prevSibling <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
    PCSNode <span style="color: #000040;">*</span>child <span style="color: #000080;">=</span> inNode<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>getChild<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    PCSNode <span style="color: #000040;">*</span>sibling <span style="color: #000080;">=</span> inNode<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>getSibling<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
    <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>inNode <span style="color: #000040;">!</span><span style="color: #000080;">=</span> this<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>root<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
       PCSNode <span style="color: #000040;">*</span>parent <span style="color: #000080;">=</span> inNode<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>getParent<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
       <span style="color: #666666;">//find the previous sibling</span>
       prevSibling <span style="color: #000080;">=</span> parent<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>getChild<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
       <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>prevSibling <span style="color: #000040;">!</span><span style="color: #000080;">=</span> inNode<span style="color: #008000;">&#41;</span>
       <span style="color: #008000;">&#123;</span>
          <span style="color: #0000ff;">while</span><span style="color: #008000;">&#40;</span>prevSibling<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>getSibling<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #000040;">!</span><span style="color: #000080;">=</span> inNode<span style="color: #008000;">&#41;</span>
          <span style="color: #008000;">&#123;</span>
             prevSibling <span style="color: #000080;">=</span> prevSibling<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>getSibling<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
          <span style="color: #008000;">&#125;</span>
          prevSibling<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>setSibling<span style="color: #008000;">&#40;</span>sibling<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
       <span style="color: #008000;">&#125;</span>
       <span style="color: #0000ff;">else</span>
       <span style="color: #008000;">&#123;</span>
          <span style="color: #666666;">//attach parent node to sibling</span>
          parent<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>setChild<span style="color: #008000;">&#40;</span>sibling<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
       <span style="color: #008000;">&#125;</span>
&nbsp;
       <span style="color: #666666;">//null pointers</span>
       inNode<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>setParent<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
       inNode<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>setSibling<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0000ff;">else</span>
    <span style="color: #008000;">&#123;</span>
       root <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    removeHelper<span style="color: #008000;">&#40;</span>inNode<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    info.<span style="color: #007788;">numLevels</span> <span style="color: #000080;">=</span> this<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>getLevel<span style="color: #008000;">&#40;</span>root<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
 <span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #666666;">//remove all of the children.</span>
 <span style="color: #0000ff;">void</span> PCSTree<span style="color: #008080;">::</span><span style="color: #007788;">removeHelper</span><span style="color: #008000;">&#40;</span>PCSNode <span style="color: #000040;">*</span> <span style="color: #0000ff;">const</span> inNode<span style="color: #008000;">&#41;</span>
 <span style="color: #008000;">&#123;</span>  
    PCSNode <span style="color: #000040;">*</span>child <span style="color: #000080;">=</span> inNode<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>getChild<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    PCSNode <span style="color: #000040;">*</span>sibling <span style="color: #000080;">=</span> inNode<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>getSibling<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
    <span style="color: #0000ff;">while</span><span style="color: #008000;">&#40;</span>child <span style="color: #000040;">!</span><span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
       <span style="color: #0000dd;">remove</span><span style="color: #008000;">&#40;</span>child<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
       child <span style="color: #000080;">=</span> inNode<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>getChild<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0000ff;">while</span><span style="color: #008000;">&#40;</span>sibling <span style="color: #000040;">!</span><span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
       <span style="color: #0000dd;">remove</span><span style="color: #008000;">&#40;</span>sibling<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
       sibling <span style="color: #000080;">=</span> inNode<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>getSibling<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>child <span style="color: #000080;">==</span> <span style="color: #0000dd;">0</span> <span style="color: #000040;">&amp;&amp;</span> sibling <span style="color: #000080;">==</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
       info.<span style="color: #007788;">numNodes</span><span style="color: #000040;">--</span><span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
 <span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p><strong>Get Level:</strong><br />
The point here is to get the height of the tree &#8211; the amount of steps from root to the lowest node.  It was another tricky one due to the singly linked list for siblings.  Once I got it to not crash, I figured out that it wasn&#8217;t hitting all the siblings.  Figuring it out really got me to learn how to debug a recursive function.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">int</span> PCSTree<span style="color: #008080;">::</span><span style="color: #007788;">getLevel</span><span style="color: #008000;">&#40;</span>PCSNode <span style="color: #000040;">*</span> <span style="color: #0000ff;">const</span> inNode<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
   <span style="color: #0000ff;">int</span> max <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
   <span style="color: #0000ff;">int</span> height <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
&nbsp;
   <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>inNode <span style="color: #000080;">==</span> <span style="color: #0000ff;">NULL</span><span style="color: #008000;">&#41;</span>
   <span style="color: #008000;">&#123;</span>
      <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
   <span style="color: #008000;">&#125;</span>
   <span style="color: #0000ff;">else</span>
   <span style="color: #008000;">&#123;</span>
      PCSNode <span style="color: #000040;">*</span>child <span style="color: #000080;">=</span> inNode<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>getChild<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
      PCSNode <span style="color: #000040;">*</span>sibling <span style="color: #000080;">=</span> inNode<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>getSibling<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
      PCSNode <span style="color: #000040;">*</span>siblingChild<span style="color: #008080;">;</span>
&nbsp;
      <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>child <span style="color: #000080;">==</span> <span style="color: #0000dd;">0</span> <span style="color: #000040;">&amp;&amp;</span> sibling <span style="color: #000080;">==</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span>
      <span style="color: #008000;">&#123;</span>
         <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span>
      <span style="color: #008000;">&#125;</span>   
      <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>child <span style="color: #000040;">!</span><span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span>
      <span style="color: #008000;">&#123;</span>       
         height <span style="color: #000080;">=</span> this<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>getLevel<span style="color: #008000;">&#40;</span>child<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
         <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>height <span style="color: #000080;">&gt;</span> max<span style="color: #008000;">&#41;</span>
         <span style="color: #008000;">&#123;</span>
            max <span style="color: #000080;">=</span> height<span style="color: #008080;">;</span>
         <span style="color: #008000;">&#125;</span>
      <span style="color: #008000;">&#125;</span>
&nbsp;
      <span style="color: #0000ff;">while</span><span style="color: #008000;">&#40;</span>sibling <span style="color: #000040;">!</span><span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span>
      <span style="color: #008000;">&#123;</span>
         siblingChild <span style="color: #000080;">=</span> sibling<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>getChild<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
         <span style="color: #0000ff;">if</span><span style="color: #008000;">&#40;</span>siblingChild <span style="color: #000040;">!</span><span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span>
         <span style="color: #008000;">&#123;</span>
            height <span style="color: #000080;">=</span> this<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>getLevel<span style="color: #008000;">&#40;</span>siblingChild<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
            <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>height <span style="color: #000080;">&gt;</span> max<span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
               max <span style="color: #000080;">=</span> height<span style="color: #008080;">;</span>
            <span style="color: #008000;">&#125;</span>
         <span style="color: #008000;">&#125;</span>
         sibling <span style="color: #000080;">=</span> sibling<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>getSibling<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
      <span style="color: #008000;">&#125;</span>
&nbsp;
   <span style="color: #008000;">&#125;</span>
      <span style="color: #0000ff;">return</span> max <span style="color: #000040;">+</span><span style="color: #0000dd;">1</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://reelgeek.co.uk/blog/2013/02/22/game-engine-pcs-tree/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>fundamentals of game programing</title>
		<link>http://reelgeek.co.uk/blog/2013/01/24/fundamentals-of-game-programing/</link>
		<comments>http://reelgeek.co.uk/blog/2013/01/24/fundamentals-of-game-programing/#comments</comments>
		<pubDate>Thu, 24 Jan 2013 22:38:11 +0000</pubDate>
		<dc:creator>Luthi</dc:creator>
				<category><![CDATA[School]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[fundamentals of game programming]]></category>

		<guid isPermaLink="false">http://reelgeek.co.uk/blog/?p=1361</guid>
		<description><![CDATA[Last term was mental. I took this class that covered the game loop, collision basics, controls, cameras, OpenGL, etc. In all honesty, it really wasn&#8217;t all that difficult. I had a crazy amount of fun &#8211; especially with collisions. It really was the first time I made a game (mostly from scratch) from start to [...]]]></description>
				<content:encoded><![CDATA[<p>Last term was mental.  I took this class that covered the game loop, collision basics, controls, cameras, OpenGL, etc.  In all honesty, it really wasn&#8217;t all that difficult.  I had a crazy amount of fun &#8211; especially with collisions.  It really was the first time I made a game (mostly from scratch) from start to finish.  I saw mostly because we were working with a simple game engine that was made for the class.  It did however make the structure of a game make sense from the update->collision->draw basic loop to adding levels.  </p>
<p>What was mental about the experience was the sheer amount of things we were doing in a short amount of time.  I had a week to make pong.  Another week to code asteroids.  Luckily the final game (missile command) we had a bit more time.  I still have the games and I may or may not post them.  </p>
<p>We were also grouped up for the entire term so for the first time I had someone to ask when I got stuck.  Though I did end up spending more time helping him than the reverse.  It was still a good experience.  We had actually met up for coffee and coding a couple of times.  </p>
<p>I&#8217;m trying to post more going forward.  I really am going to try this time.  So maybe it&#8217;ll sound less like a quick rundown from memory and more of an actual code brain dump.  </p>
]]></content:encoded>
			<wfw:commentRss>http://reelgeek.co.uk/blog/2013/01/24/fundamentals-of-game-programing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>#1reasonwhy</title>
		<link>http://reelgeek.co.uk/blog/2013/01/24/1reasonwhy/</link>
		<comments>http://reelgeek.co.uk/blog/2013/01/24/1reasonwhy/#comments</comments>
		<pubDate>Thu, 24 Jan 2013 20:48:05 +0000</pubDate>
		<dc:creator>Luthi</dc:creator>
				<category><![CDATA[Randomness]]></category>
		<category><![CDATA[School]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://reelgeek.co.uk/blog/?p=1349</guid>
		<description><![CDATA[At the end of November, twitter blew up with women in games sharing their experiences in the industry: #1ReasonWhy. In a response to the (albeit common) question of “Why are there so few lady game creators?” I even added my own: Because I was the only one heckled during my final game project presentation. #1reasonwhy [...]]]></description>
				<content:encoded><![CDATA[<p>At the end of November, twitter blew up with women in games sharing their experiences in the industry: <a href="http://www.themarysue.com/1-reason-why-women-in-games/">#1ReasonWhy</a>.  In a response to the (albeit common) question of “Why are there so few lady game creators?”  I even added my own: Because I was the only one heckled during my final game project presentation. #1reasonwhy</p>
<p>It was an amazing event to witness.  The only shocking part of it all was the sheer amount of people who had the gumption to speak up.  No matter how many tried to silence them.  It makes me feel lucky that not only have I had it easy in comparison, but to know that I am in fact not alone.</p>
<p>This is my 3rd year in the game dev department at DePaul in Chicago.  There were several prerequisites I had to take before the grad program actually started and I can only go mostly part-time, so it&#8217;s taking a while.  All things considered, it&#8217;s far better than I had expected.  Every professor I&#8217;ve come into contact with has been respectful from the beginning and I haven&#8217;t had a single instance of condescension.  As well as no special treatment, at least as far as I can tell.  In fact they have welcomed my class participation more than enough to make someone who is normally very quiet actually speak up.  Last term I had to ask one to not put me on a team with a specific classmate (I will explain later).  The email exchange was professional and respectful and he did so without question or making it an issue.  </p>
<p>They do also have support for women in the computer department that sadly only caters to those without full-time jobs.  While I could get to campus for a 4:30pm meeting, but the emails don&#8217;t always go out and rarely do I know more than a day in advance.  </p>
<p>That&#8217;s not to say that things have been easy or that it&#8217;s been without incident.  </p>
<p>Being the only or one of a handful of women in a class isn&#8217;t comfortable.  It will make anyone question whether or not they belong.  We as humans strive for situations that we fit in, and while I should feel at home with others who love games and coding, I just don&#8217;t.  I feel uncomfortable most of the time.  As if I really shouldn&#8217;t be there.   </p>
<p>It doesn&#8217;t really help when the professor shows incredibly masculine videos to emphasize points.  I&#8217;m pretty certain there is something better out there to signify now being advanced C++ coders than &#8220;welcome to the world of gentlemen, gentlemen.&#8221;  Perhaps it would help to not bring up a study that women multitask better than men, especially when other studies say it&#8217;s actually men just prove that some <strong>people</strong> multitask better than other <strong>people</strong>.  All that did was encourage the person sitting behind me to bring up the idea that &#8220;women are more emotional.&#8221;  I turned around and asked if he was looking for a punch in the face and it made the class laugh.  What I don&#8217;t understand is that if someone had said &#8220;all ____ (race) are _____ (stereotype)&#8221; shit would have gone down.  It&#8217;s the same thing just instead of racist, it&#8217;s sexist.  </p>
<p>For the most part my classmates aren&#8217;t exactly friendly to me and seem to just tolerate my existence.  Conversations before/after class and during breaks aren&#8217;t what you&#8217;d call inclusive.  While my interjections don&#8217;t fall on deaf ears, it&#8217;s not exactly welcoming either.  Don&#8217;t get me wrong, there have been some that are like me and shy at first, but fine once they warm up to you.  On the flipside, there have also been a handful that have been varying levels of terrible.  </p>
<p>One that used the phrase &#8220;women shouldn&#8217;t talk like that,&#8221; to someone else.  Luckily we both shot him down with looks and a response of &#8220;we can say whatever we want.&#8221;  Strangely enough, he was one of the heckling offenders while I nervously gave a demo of my final game last term while trying not to throw up or pass out.  Public speaking and I don&#8217;t really mix well.  Perhaps I should have sat there invalidating myself through it like another woman had?  </p>
<p>Last year there was one that fully believed I would commiserate with him on his failing grades no matter how many times I tried to get out the conversation.  Every night during break he would follow me out to the cold of Chicago, stand too close and talked of failing classes, bad grades on projects and the state of our classmates geeky tee shirt attire.  All I wanted to do was enjoy my smoke.  Granted he never really paid attention to my responses of doing just fine nor the fact that I wear a different geek tee every week.  While annoying, that would have been fine.  It was the being 1 step behind me on the walk to the train &#8211; whether I took the elevator or ran down 10 flights of stairs.  He would then get on the same train and watch me read from across the train car.  That&#8217;s what set off my spidey sense enough ask not to work with him in the next class.   </p>
<p>In all honesty, what&#8217;s worse is what happens in the outside world.  Whenever I wear my xkcd tee &#8220;I&#8217;m not slacking off, my code is compiling,&#8221; without fail someone has to ask &#8220;are you really a programmer?&#8221;  I don&#8217;t see why anyone would actually wear it if they weren&#8217;t.  Though the attempted C++ syntax exams are rather unnecessary.    </p>
<p><strong>How I&#8217;ve chosen to deal with it</strong><br />
For the most part, I focus on the work.  Doing as well as I am seriously helps the negative self-talk that comes from not feeling like I belong.  I get A&#8217;s, that&#8217;s proof enough.  I love coding and no one is going to take that away from me.</p>
<p>Comments that are sexist?  It depends on the situation.  Sometimes I jokingly threaten violence, but that&#8217;s only in very specific moments.  Most of the time, it&#8217;s &#8220;Please explain how that is funny.&#8221; Then watch them try to justify the behaviour.  </p>
<p>Sometimes, like the heckling, I don&#8217;t notice right away.  I know it&#8217;s kind of shitty, but I&#8217;m too busy to focus on why.  For the most part, it turns into jokes with friends.  1 that I&#8217;m turning into a game based on a conversation.  Just something silly with Unity more for humour value.  </p>
<p>Other than that, seriously taking a look at that mentoring list.        </p>
]]></content:encoded>
			<wfw:commentRss>http://reelgeek.co.uk/blog/2013/01/24/1reasonwhy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>indie game the movie</title>
		<link>http://reelgeek.co.uk/blog/2012/12/22/indie-game-the-movie/</link>
		<comments>http://reelgeek.co.uk/blog/2012/12/22/indie-game-the-movie/#comments</comments>
		<pubDate>Sat, 22 Dec 2012 18:46:14 +0000</pubDate>
		<dc:creator>Luthi</dc:creator>
				<category><![CDATA[indie games]]></category>
		<category><![CDATA[films]]></category>

		<guid isPermaLink="false">http://reelgeek.co.uk/blog/?p=1333</guid>
		<description><![CDATA[I finally watched it last night. A long time ago, I was a documentary film editor and I honestly don&#8217;t like watching them anymore. I&#8217;m too critical. And I was worried that I was going to be watching as both an editor and a programmer. That was kind of difficult to wrap my head around. [...]]]></description>
				<content:encoded><![CDATA[<p>I finally watched it last night.  A long time ago, I was a documentary film editor and I honestly don&#8217;t like watching them anymore.  I&#8217;m too critical.  And I was worried that I was going to be watching as both an editor and a programmer.  That was kind of difficult to wrap my head around.  So I put it off.  However I really enjoyed it.  </p>
<p>I think the best things I took out of it for me as a game dev student is the following:</p>
<p>1.  Don&#8217;t let early hype get to your head.<br />
I could see it coming a mile away.  Perhaps the film skewed it well, but the Phil Fish subplot seemed to be a &#8220;what not to do.&#8221;  He came off as an arrogant asshole that I wanted to feel for, but I just kept cringing the further he dug himself.  To me, at least, it seemed less a labour of love but one of ego.     </p>
<p>2.  SCOPE!<br />
What makes a great game is interesting ideas, good execution and passion.  What keeps it together and makes it releasable is project scope.  Braid and Super Meat Boy, just from what little we saw of it, clearly had well defined scope.  Well planned AND well executed.  Compare it with the insanity of Fez.  Which would you rather work on? </p>
<p>3.  Work/life balance is important.<br />
The juxtaposition between Edmund McMillen and Tommy Refenes was incredibly fascinating.  While both completely threw themselves into the game, you could clearly see the difference in balance.  McMillen had an anchor away from the game that, from what was shown, kept him more emotionally stable.  As a programmer, I know all too well how much you can get done while being really in it.  It&#8217;s this tunnel vision that can take a bit to get into, but takes even more to step away from it.  But you have to.  Your life can&#8217;t be the game.      </p>
]]></content:encoded>
			<wfw:commentRss>http://reelgeek.co.uk/blog/2012/12/22/indie-game-the-movie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Overload</title>
		<link>http://reelgeek.co.uk/blog/2012/09/22/overload/</link>
		<comments>http://reelgeek.co.uk/blog/2012/09/22/overload/#comments</comments>
		<pubDate>Sat, 22 Sep 2012 00:10:57 +0000</pubDate>
		<dc:creator>Luthi</dc:creator>
				<category><![CDATA[School]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[overwhelmed]]></category>
		<category><![CDATA[past]]></category>

		<guid isPermaLink="false">http://reelgeek.co.uk/blog/?p=1319</guid>
		<description><![CDATA[I remember the first time I ever walked into the neighourhood public library as a kid. It was a pretty unforgettable moment. I stepped in, took a look around and promptly had a panic attack. I&#8217;ve always been a big reader. Books, as well as games, was a small town girl&#8217;s escape into something bigger [...]]]></description>
				<content:encoded><![CDATA[<p>I remember the first time I ever walked into the neighourhood public library as a kid.  It was a pretty unforgettable moment.  I stepped in, took a look around and promptly had a panic attack.  </p>
<p>I&#8217;ve always been a big reader.  Books, as well as games, was a small town girl&#8217;s escape into something bigger and more exciting than the life I was forced to live.  Where I could experience everything that there was, be anything that I wanted to be, and do everything.  School was a bore since they hadn&#8217;t yet figured out that I should be challenged, not held back.  Everyone around me seemed to only expect the minimum life experience that had to do with marriage and babies and never included even leaving town.  Books seemed to be the only one that understood my desire to go into space, or be a pirate, or something&#8230; bigger.  Well.. and my imaginary friend who happened to be an alien.      </p>
<p>That moment was as clear now as it was that day. I took one look around what I know now is actually a rather pitiful Midwestern small town library, and knew that I was never going to be able to read all the books I want.  Panic attack hit.  Then I passed out.  I shit you not.    </p>
<p>As I grew up, I reconciled it with the basic fact that some books are terrible.  And others are even worse.  I don&#8217;t need to know everything, right?  Just get through what I can and hope for reincarnation.  Ever since it&#8217;s really just been a quirky story of just how nerdy I was as a kid.</p>
<p>Sometimes when I stumble onto something about game dev, I get that feeling again.  Like the syllabus for a class.  An article or blog post that&#8217;s just a bit too far out of my league as of right now.  And I freak the fuck out about being too old to start learning all this nonsense.  Then my brain explodes.  Or maybe not because I&#8217;m still sitting here.  </p>
<p>Then I&#8217;m in class, reading, or working on the project and it all just makes perfect sense.  I guess it&#8217;s a bit like coding itself.  If you try to tackle an entire large project all in one go, it&#8217;s going to look like a big jumbled mess.  But if you take it 1 chunk at a time and make that part work right, it all sort of fits together in the end.      </p>
]]></content:encoded>
			<wfw:commentRss>http://reelgeek.co.uk/blog/2012/09/22/overload/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>one crazy summer</title>
		<link>http://reelgeek.co.uk/blog/2012/09/21/one-crazy-summer/</link>
		<comments>http://reelgeek.co.uk/blog/2012/09/21/one-crazy-summer/#comments</comments>
		<pubDate>Fri, 21 Sep 2012 01:40:22 +0000</pubDate>
		<dc:creator>Luthi</dc:creator>
				<category><![CDATA[Randomness]]></category>

		<guid isPermaLink="false">http://reelgeek.co.uk/blog/?p=1317</guid>
		<description><![CDATA[3 months just isn&#8217;t a long enough time. Or maybe I just do too much. moving I moved twice. My new landlord mixed up moving dates and it was a big mess of sleeping on a futon and living out of boxes for a month between leaving my old place and moving into my new [...]]]></description>
				<content:encoded><![CDATA[<p>3 months just isn&#8217;t a long enough time.  Or maybe I just do too much.  </p>
<p><strong>moving</strong><br />
I moved twice.  My new landlord mixed up moving dates and it was a big mess of sleeping on a futon and living out of boxes for a month between leaving my old place and moving into my new one.  At least I wasn&#8217;t sleeping out of my car that doesn&#8217;t exist.  Sleeping out of my bike would have been a bit difficult.  I could have taken the unit I was camping out in for a month, but I&#8217;m glad to be away from the crazy lady upstairs and the constant speed metal downstairs.  My real place is super quiet.  </p>
<p>I&#8217;m almost fully unpacked.  A few bits and pieces here and there and artwork to put up.  I&#8217;ve got the ps3 and computer hooked up.  And the pc connected to the tv with a wireless controller.  And the Legos scattered about.  What more could I ask for?</p>
<p><strong>fitness</strong><br />
I lost weight, but didn&#8217;t loose weight.  I find it kind of funny really.  I&#8217;ve always been active (kung fu) and a healthy eater for the most part, so weight has never been a worry.  Well as someone with ladybits, it&#8217;s always a worry.  It&#8217;s just the way we are cultured to be.  I don&#8217;t have the body type to be THIN so I just went with healthy without being terribly annoying about it and just let nature take it&#8217;s course.  The very idea of counting calories was really absurd to me because that did seem to be part of the annoyingness of certain people.  That is until a friend got me to try.  Turns out on the days I&#8217;d work out, I&#8217;d eat far lower than what I should, by like 1500 calories.  You know how much ice cream I ate this summer?  YUM!  Vice versa for the days I didn&#8217;t, so that took some getting used to.  </p>
<p>I worked on balancing it out, but the scale didn&#8217;t move.  I felt better and things were fitting differently, but the scale didn&#8217;t move.  I know about the entire muscle weighing more than fat and I was getting more toned, but every week I&#8217;d weigh myself and it didn&#8217;t change.  It should change a little bit, right?  And then one day the capris I had bought to cycle in no longer stayed up.  Maybe I need a new scale.    </p>
<p><strong>coding</strong><br />
I didn&#8217;t spend enough time on this.  I always say I will, and then I find other things to distract me.  Stuff like life.  I got through a couple of the books I wanted to, and spent a lot of time on <a href="http://projecteuler.net/">Project Euler</a>, which at least is something.      </p>
]]></content:encoded>
			<wfw:commentRss>http://reelgeek.co.uk/blog/2012/09/21/one-crazy-summer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>summer.begin()</title>
		<link>http://reelgeek.co.uk/blog/2012/06/09/summer-begin/</link>
		<comments>http://reelgeek.co.uk/blog/2012/06/09/summer-begin/#comments</comments>
		<pubDate>Sat, 09 Jun 2012 02:48:23 +0000</pubDate>
		<dc:creator>Luthi</dc:creator>
				<category><![CDATA[School]]></category>
		<category><![CDATA[Applied Algorithms]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[finals]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[summer]]></category>

		<guid isPermaLink="false">http://reelgeek.co.uk/blog/?p=1302</guid>
		<description><![CDATA[I had a completely brutal final exam on Monday that left my brain mush for the rest of the week and oddly unable to sleep. 10 questions that I spent the full 3 hours on. I left at 5min left to go and most of the class was still there, so that made me feel [...]]]></description>
				<content:encoded><![CDATA[<p>I had a completely brutal final exam on Monday that left my brain mush for the rest of the week and oddly unable to sleep.  10 questions that I spent the full 3 hours on.  I left at 5min left to go and most of the class was still there, so that made me feel better about it.  I did better than I thought, but then again I always leave thinking I&#8217;d failed.  Which is kind of absurd since I never get anything below a B.  Final grade: A!  Total GPA: 4.0!  Yay!</p>
<p>I&#8217;m only partially disappointed that there are no classes I can take over the summer.  I need a break, but I really don&#8217;t want to be pushing 40 when I graduate.  I suppose now I have time to catch up on some things.  </p>
<p><strong>Coding Portability:</strong><br />
Last night I found a group of women coders who meet once a week to sit around and code together.  They do have other meetups also.  The problem is that my laptop is a 3 year old eee pc running linux.  I want the ease of going back and forth from my desktop, so I just went ahead and reformatted and installed win7.  It&#8217;s running fine, but there isn&#8217;t enough room on the main drive to install visual studio.  So I guess I&#8217;ll just remote in or use notepad++ for now.  At least until I can buy a new one.  The bonus is that I can go to a coffee shop or sit outside and code anytime I please.  Good thing since it&#8217;s getting hot and my apartment doesn&#8217;t have AC.    </p>
<p><strong>Gaming:</strong><br />
I need to play more.  I have a stack of games that I want to play/need to finish but enough desire to at the moment to find the time.  Today was my first full day of not having anything I <strong>needed</strong> to do and I played Diablo III for about 10min.  Instead I logged out, walked to staples, and bought some random supplies.  Perhaps I&#8217;ll fare better tomorrow.    </p>
<p><strong>Women in Computing Conference:</strong><br />
This week I received an email about a scholarship to <a href="http://gracehopper.org/2012/">Grace Hopper Celebration of Women in Computing 2012</a> conference.  DePaul is sending 5 students this year &#8211; airfare, hotel and registration included.  I don&#8217;t actually remember when the last time I wrote an essay, but I&#8217;m going to get a shot.  Nothing to loose.     </p>
<p><strong>Women in Geekdom:</strong><br />
I mentioned in the comments for the C2E2 post that I&#8217;m thinking about doing something.  Right now I&#8217;m working on a site that is a bit of a mix between a blog and a forum.  A safe zone for us ladies to talk about the issues.  Basically a blog in style, but anyone registered can post.  I&#8217;m still playing around with ideas and trying to figure out if I can commit the time.  We&#8217;ll see if anything comes of it.    </p>
<p><strong>Summer Learning List:</strong><br />
Right now I&#8217;m reading Effective C++.  After that (or perhaps during for coding practice) I&#8217;m going to learn openGL.  I also have a book on directx that I might dust off.  Then there is C# and Unity3D.  </p>
]]></content:encoded>
			<wfw:commentRss>http://reelgeek.co.uk/blog/2012/06/09/summer-begin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>for the love of code</title>
		<link>http://reelgeek.co.uk/blog/2012/05/31/for-the-love-of-code/</link>
		<comments>http://reelgeek.co.uk/blog/2012/05/31/for-the-love-of-code/#comments</comments>
		<pubDate>Thu, 31 May 2012 00:45:59 +0000</pubDate>
		<dc:creator>Luthi</dc:creator>
				<category><![CDATA[Randomness]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[past]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://reelgeek.co.uk/blog/?p=1281</guid>
		<description><![CDATA[There is this learn to code meme/movement/whatever that&#8217;s been going around for a couple of weeks now. Please don&#8217;t learn to code vs please learn to code. &#8220;Learning to code simply means having a basic grasp of how computers work instead of blindly following whatever a talking paperclip tells you.&#8221; First of all, this is [...]]]></description>
				<content:encoded><![CDATA[<p>There is this learn to code meme/movement/whatever that&#8217;s been going around for a couple of weeks now.   <strong><a href="http://www.codinghorror.com/blog/2012/05/please-dont-learn-to-code.html">Please don&#8217;t learn to code</a> vs <a href="http://sachagreif.com/please-learn-to-code/">please learn to code</a>.</strong></p>
<blockquote><p>&#8220;Learning to code simply means having a basic grasp of how computers work instead of blindly following whatever a talking paperclip tells you.&#8221;</p></blockquote>
<p>First of all, this is false.  Having a basic grasp of how computers work has little to do with sitting down and learning a programming language.  How did I get my mother to be complimented by the IT department for her computer understanding?  Anytime she asked me a computer question, I told her to google it.  That&#8217;s a basic grasp.  And all most people <strong>need</strong> to know.  </p>
<p>I had an epic battle with the Diablo III download this weekend and even though I have a rather in depth understanding of C++, I was still a slave to their programming.  Oh I could read and understand the error but there was nothing I could do about it.  The point is, you could be the most epic programmer ever and still have to blindly follow someone else&#8217;s program.  There just isn&#8217;t enough time available to make every program and game out there.  </p>
<p>What really got me thinking is when the topic brought up mandatory comp sci classes in schools. If I had found my love for programming earlier, would I be in a different place now?  Maybe.  But I regret none of it. </p>
<p>I found my love of photography freshman year of High School which pretty much dictated my life until the age of 21.  So I can pretty much guarantee that nothing would have changed there.  Well.. at least not until a pivotal point that happened roughly when I was 19.  I say roughly only because it&#8217;s all kind of mushed together in my memory.  </p>
<p>I was a portrait photographer &#8211; hadn&#8217;t gone to university yet &#8211; and my free time was split between my art friends and my nerd friends.  As time went on, my art friends got more into experimental art that I found silly and more importantly became annoying.  Oddly inflated egos and hypocritical attitudes of demanding acceptance of who they are while making fun of others.  So I found myself choosing chess, DnD, irc, linux, gaming, html, and the like more and more often.  </p>
<p>I had a lot of fun those few years.  It was ~1995 and the net was just gaining momentum.  Linux was still pretty new so we spent a lot of time trying to break it.  Since there really wasn&#8217;t much else to do with it.  If there was a way to write html in anything other than notepad, I didn&#8217;t know about it.  </p>
<p>The pivotal moment happened when my computer science major boyfriend quickly explained QBasic and the program he was working on.  My job was to travel to small towns in Nebraska, Kansas and Missouri and do portrait photography in whatever store we had a contract in so I had a lot of time by myself.  With my beast of a dell laptop and too much boredom, I sat down and wrote a text based adventure game.  </p>
<p>I brought it home for him to test and had hoped I would be met with pride, but instead what I got was a deflated ego masked by anger.  I didn&#8217;t understand what I had done wrong and we were both too young and inexperienced to communicate it properly.  So it was the beginning of the end of that relationship.    </p>
<p>Had he seen other females excel in computers earlier, it might have lessened the effect to his ego.  I use might very loosely here because this is Nebraska we are talking about and tech was a boys only club.  And I might have gotten use to the reaction like I have now.  </p>
<p>The experience soured me pretty heavily in the years to come, but it wasn&#8217;t the only aspect.  The year before art school I worked at best buy, a video store and a computer repair shop all at the same time.  At best buy I was delegated to the printer aisle even though I knew more about computers than all of my male coworkers.  Anytime I answered the phone, the customer asked to speak to a man.  I eventually took control of the software section and ran it artfully, but no matter how much I proved I knew every piece of software, they always wanted a male opinion.  I met the same indignation every night at the repair shop.  </p>
<p>In my long thought process of what I wanted to do in my life, computers just seemed more trouble than it was worth.  Had it been my only passion, things might have been different.  Had I had a bit more time to foster my love of programming, I might have fought til the end.  Now, 15 years later it&#8217;s a bit easier.  I may have less fight in me, but there is less fight to be had.  </p>
<p>Like I said before, I don&#8217;t regret my path.  I may be too old for getting into the gaming industry and I&#8217;m OK with it. There&#8217;s a lot I could have learned but I wouldn&#8217;t be the person I am now without the experiences I&#8217;ve had.  I just really hope I graduate before I get too close to 40.   </p>
]]></content:encoded>
			<wfw:commentRss>http://reelgeek.co.uk/blog/2012/05/31/for-the-love-of-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Graham&#8217;s Scan</title>
		<link>http://reelgeek.co.uk/blog/2012/05/11/grahams-scan/</link>
		<comments>http://reelgeek.co.uk/blog/2012/05/11/grahams-scan/#comments</comments>
		<pubDate>Fri, 11 May 2012 18:34:59 +0000</pubDate>
		<dc:creator>Luthi</dc:creator>
				<category><![CDATA[School]]></category>
		<category><![CDATA[Applied Algorithms]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[computational geometry]]></category>

		<guid isPermaLink="false">http://reelgeek.co.uk/blog/?p=1278</guid>
		<description><![CDATA[Last Friday I attempted my implementation of Graham&#8217;s Scan. My C++ is a bit rusty since I haven&#8217;t used it since the fall. Last term was all C, but we were doing with it was different enough to make me a bit rusty. The project isn&#8217;t due until this Monday so the plan was to [...]]]></description>
				<content:encoded><![CDATA[<p>Last Friday I attempted my implementation of Graham&#8217;s Scan.  My C++ is a bit rusty since I haven&#8217;t used it since the fall.  Last term was all C, but we were doing with it was different enough to make me a bit rusty.  The project isn&#8217;t due until this Monday so the plan was to get the following coded:</p>
<p>1.  Write the point class for holding the coords and the doing the math needed &#8211; mostly cross product and distance.</p>
<p>2. Input the points coords from the given files &#8211; we were given 6 different sets.  To make it easier on the grader, I made a switch statement so all they have to do is type the # of the file and it passes the file name to the input function.  I&#8217;m nice like that.</p>
<p>3.  Write and test the function that finds Point 0 &#8211; the point with the smallest Y coord.  And if there is a tie, to choose the one with the smallest X. </p>
<p>4.  Write and test a merge sort that sorts the remaining points by polar axis to P0 by calculating the cross product (the vector of P0Pi x the vector of P0Pj).  If positive Pi goes first and if negative Pj goes first. </p>
<p>Midnight.  This is where I hit a brick wall.  Or more specifically this part of my notes: if two points have the same polar angle, throw out the one with the shortest distance to P0.  Fuck.  I was using an array of point objects.  Doing it in the merge sort might have worked by just ignoring it and not copying, but not if it was the last element and then you have issues with the size.  I might have gotten it to work correctly, but it seemed more trouble than it was worth.  </p>
<p>So which container to use instead?  A vector would be the easiest to implement, but will it work?  A linked list would be a lot more complicated, but would work better.  I opened a new project and started over using a linked list.  </p>
<p>1am: eff this.  I need to sleep on it.  I have an assignment due this week that I haven&#8217;t even looked at yet.  Not to mention personal obligations.  There really are only so many times a person can not show up to social events before people stop asking.  </p>
<p>8am: I should just try a vector.  Just to see what happens.  By 1pm I had a fully working version including the merge sort!  Which left enough time to go to the market, stuff some strawberries and go to the cinco de mayo party.    </p>
<p>Would a link list be better?  Yeah.  But I think it would have been overkill for the assignment.  There are only 18 set of points in the largest file, so the copying of merge sort isn&#8217;t a big deal.  It also doesn&#8217;t matter if I rearrange the points since the only thing I&#8217;m doing with them is this.  Using a vector is the most efficient way to go in this case.</p>
<p>All I have left to do this weekend is the graham&#8217;s scan function.  Should be fine.  </p>
]]></content:encoded>
			<wfw:commentRss>http://reelgeek.co.uk/blog/2012/05/11/grahams-scan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
