<?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>Last Ray of Hope</title>
	<atom:link href="http://www.lastrayofhope.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lastrayofhope.com</link>
	<description>Home of Kaluriel Hargrove</description>
	<lastBuildDate>Thu, 02 Feb 2012 00:21:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>First SMD Reflow</title>
		<link>http://www.lastrayofhope.com/2012/02/02/first-smd-reflow/</link>
		<comments>http://www.lastrayofhope.com/2012/02/02/first-smd-reflow/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 00:12:08 +0000</pubDate>
		<dc:creator>Kaluriel</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[ADC]]></category>
		<category><![CDATA[DAC]]></category>
		<category><![CDATA[prototype adaptor]]></category>
		<category><![CDATA[reflow]]></category>
		<category><![CDATA[SMD]]></category>

		<guid isPermaLink="false">http://www.lastrayofhope.com/?p=4013</guid>
		<description><![CDATA[My iOS development license expired yesterday after I forgot to renew it. Since I hadn't received word back from Apple about it being reactivated, I decided to do some electronics. Having recently buying an analog to digital converter and a prototype adaptor board for an SOIC, I decided to use my reflow tool I bought [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.lastrayofhope.com/wp-content/uploads/2012/02/IMG_0278.jpg"><img class="alignleft size-thumbnail wp-image-4016" title="AD7401 Analog to Digital" src="http://www.lastrayofhope.com/wp-content/uploads/2012/02/IMG_0278-150x150.jpg" alt="" width="150" height="150" /></a>My iOS development license expired yesterday after I forgot to renew it. Since I hadn't received word back from Apple about it being reactivated, I decided to do some electronics.</p>
<p>Having recently buying an <a href="https://uk.farnell.com/jsp/search/productdetail.jsp?SKU=1274242" target="_blank">analog to digital converter</a> and a prototype adaptor board for an SOIC, I decided to use my reflow tool I bought a few month back. One thing I didn't take into account was that my solder paste was out of date in November 2011, making it fairly thick and hard to separate.</p>
<p>Also it turns out the display on my reflow tool is in Fahrenheit, not Celsius.</p>
<p><a href="http://www.lastrayofhope.com/wp-content/uploads/2012/02/IMG_0280.jpg"><img class="alignright size-thumbnail wp-image-4015" title="DAC8580IPW Digital to Analog" src="http://www.lastrayofhope.com/wp-content/uploads/2012/02/IMG_0280-150x150.jpg" alt="" width="150" height="150" /></a>I think it turned out rather well for my first one.</p>
<p>The second one however, a <a href="http://uk.farnell.com/jsp/search/productdetail.jsp?SKU=1754809" target="_blank">digital to analog converter</a>, turned out far worse of a job. It is a TSSOP package - a fraction the size of the SOIC, and I have trouble with bridges being formed between pins, and my cheap solder wick was failing to remove them.</p>
<p>I'm unsure if the chips still work, as I took quite a while to get them in the correct position, but I was 40-60 degrees lower than the maximum soldering temperature. Hopefully I will have time to test them tomorrow.</p>
<p><a href="http://uk.farnell.com/jsp/search/productdetail.jsp?SKU=1426182" target="_blank">TSSOP16 Adaptor</a></p>
<p><a href="http://uk.farnell.com/jsp/search/productdetail.jsp?SKU=1426173" target="_blank">SOIC16 Adaptor</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lastrayofhope.com/2012/02/02/first-smd-reflow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zynga pirate Tiny Tower</title>
		<link>http://www.lastrayofhope.com/2012/01/25/zynga-pirate-tiny-tower/</link>
		<comments>http://www.lastrayofhope.com/2012/01/25/zynga-pirate-tiny-tower/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 11:15:16 +0000</pubDate>
		<dc:creator>Kaluriel</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[nimblebit]]></category>
		<category><![CDATA[zynga]]></category>

		<guid isPermaLink="false">http://www.lastrayofhope.com/?p=4007</guid>
		<description><![CDATA[Zynga, as always, have stolen another game to call their own. After failing to acquire the small indie studio of 3, they decided that if can't beat them, steal their games join them. I suppose being a company of 2700+, ideas are hard to come by. [article link]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.lastrayofhope.com/wp-content/uploads/2012/01/dearzynga-e1327470105989.jpg"><img class="alignleft size-thumbnail wp-image-4008" title="Dear Zynga..." src="http://www.lastrayofhope.com/wp-content/uploads/2012/01/dearzynga-e1327470105989-150x150.jpg" alt="" width="150" height="150" /></a>Zynga, as always, have stolen another game to call their own. After failing to acquire the small indie studio of 3, they decided that if can't beat them, <del>steal their games</del> join them.</p>
<p>I suppose being a company of 2700+, ideas are hard to come by.</p>
<p><a title="Dear Zynga..." href="http://venturebeat.com/2012/01/24/tiny-tower-devs-are-happy-to-inspire-zyngas-new-game-dream-heights-image/" target="_blank">[article link]</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lastrayofhope.com/2012/01/25/zynga-pirate-tiny-tower/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scammers are stealing my ideas</title>
		<link>http://www.lastrayofhope.com/2012/01/23/scammers-are-stealing-my-ideas/</link>
		<comments>http://www.lastrayofhope.com/2012/01/23/scammers-are-stealing-my-ideas/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 11:41:12 +0000</pubDate>
		<dc:creator>Kaluriel</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Ads]]></category>
		<category><![CDATA[Scam]]></category>

		<guid isPermaLink="false">http://www.lastrayofhope.com/?p=3988</guid>
		<description><![CDATA[Last year I wrote a satirical piece about a single mom inventing cold fusion and defying the laws of physics. Well apparently the same online scam artists have thought it was a great idea, and are now selling plans for a zero point energy device. If you want to read the trash they've wrote this time, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.lastrayofhope.com/wp-content/uploads/2012/01/powercompanies.png"><img class="alignleft size-thumbnail wp-image-3991" title="Power Companies Hate This!" src="http://www.lastrayofhope.com/wp-content/uploads/2012/01/powercompanies-150x150.png" alt="" width="150" height="150" /></a>Last year I wrote a satirical piece about a <a title="Nuclear Physicists Hate Her!" href="http://www.lastrayofhope.com/2011/04/28/nuclear-physicists-hate-her/">single mom inventing cold fusion</a> and defying the laws of physics.</p>
<p>Well apparently the same online scam artists have thought it was a great idea, and are now selling plans for a zero point energy device.</p>
<p>If you want to read the trash they've wrote this time, a Google of the Hojo Motor will surely bring it up. It is only a matter of time now before they start selling off pieces of dinosaur DNA claiming that you too can grow your own Jurassic Park, and Zoo Keepers don't want you to know about this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lastrayofhope.com/2012/01/23/scammers-are-stealing-my-ideas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wikipedia Blackout of 2012</title>
		<link>http://www.lastrayofhope.com/2012/01/19/wikipedia-blackout-of-2012/</link>
		<comments>http://www.lastrayofhope.com/2012/01/19/wikipedia-blackout-of-2012/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 12:02:21 +0000</pubDate>
		<dc:creator>Kaluriel</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Wikipedia]]></category>

		<guid isPermaLink="false">http://www.lastrayofhope.com/?p=4003</guid>
		<description><![CDATA[Historians in the future will one day look back on this day, and realise that the 18th January 2012, was the most productive day in human history.]]></description>
			<content:encoded><![CDATA[<p>Historians in the future will one day look back on this day, and realise that the 18th January 2012, was the most productive day in human history.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lastrayofhope.com/2012/01/19/wikipedia-blackout-of-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The International Obfuscated C Code Contest</title>
		<link>http://www.lastrayofhope.com/2012/01/05/the-international-obfuscated-c-code-contest/</link>
		<comments>http://www.lastrayofhope.com/2012/01/05/the-international-obfuscated-c-code-contest/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 21:02:20 +0000</pubDate>
		<dc:creator>Kaluriel</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://www.lastrayofhope.com/?p=3984</guid>
		<description><![CDATA[I got told about this brilliant bit of code recently. It is a magic eye. Supposedly it will compile with a GCC compiler, I was unable to get it to in Visual Studio. More similar code is on the official IO CCC website. http://www.ioccc.org/ http://www.ioccc.org/years.html#2001_herrmann2]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.lastrayofhope.com/wp-content/uploads/2012/01/ioccc.png"><img class="alignleft size-thumbnail wp-image-3994" title="IO CCC" src="http://www.lastrayofhope.com/wp-content/uploads/2012/01/ioccc-150x150.png" alt="" width="150" height="150" /></a>I got told about this brilliant bit of code recently. It is a magic eye. Supposedly it will compile with a GCC compiler, I was unable to get it to in Visual Studio.</p>
<p>More similar code is on the official IO CCC website.</p>
<p><a href="http://www.ioccc.org/" target="_blank">http://www.ioccc.org/</a></p>
<p><a href="http://www.ioccc.org/years.html#2001_herrmann2" target="_blank">http://www.ioccc.org/years.html#2001_herrmann2</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lastrayofhope.com/2012/01/05/the-international-obfuscated-c-code-contest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SprintfCat</title>
		<link>http://www.lastrayofhope.com/2011/11/02/sprintfcat/</link>
		<comments>http://www.lastrayofhope.com/2011/11/02/sprintfcat/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 15:17:23 +0000</pubDate>
		<dc:creator>Kaluriel</dc:creator>
				<category><![CDATA[Athena]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[safe]]></category>
		<category><![CDATA[sprintf]]></category>
		<category><![CDATA[stdlib]]></category>
		<category><![CDATA[strlen]]></category>
		<category><![CDATA[vsprintf]]></category>

		<guid isPermaLink="false">http://www.lastrayofhope.com/?p=3975</guid>
		<description><![CDATA[On the train to Cardiff yesterday, I was creating a fixed function shader generator for the Athena engine. I kept using strcat() with if statements, and in a lot of places I kept using sprintf() then copying that in with strcat(). So I decided to make SprintfCat(), all the wonderful joy of sprintf, with the [...]]]></description>
			<content:encoded><![CDATA[<p>On the train to Cardiff yesterday, I was creating a fixed function shader generator for the Athena engine. I kept using strcat() with if statements, and in a lot of places I kept using sprintf() then copying that in with strcat().</p>
<p>So I decided to make SprintfCat(), all the wonderful joy of sprintf, with the ability to concatenate with a already existant string like strcat.</p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.lastrayofhope.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://www.lastrayofhope.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.lastrayofhope.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.lastrayofhope.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="cpp" style="font-family:monospace;"><span class="co1">//</span>
<span class="co1">//</span>
<span class="kw4">size_t</span> ath<span class="sy4">::</span><span class="me2">SprintfCat</span><span class="br0">&#40;</span> <span class="kw4">char</span> <span class="sy2">*</span> inoutBuffer, <span class="kw4">const</span> <span class="kw4">size_t</span> inBufferSize, <span class="kw4">const</span> <span class="kw4">char</span> <span class="sy2">*</span> inFormat, ... <span class="br0">&#41;</span>
<span class="br0">&#123;</span>
	<span class="kw4">const</span> <span class="kw4">size_t</span> offset <span class="sy1">=</span> StrLen<span class="br0">&#40;</span> inoutBuffer <span class="br0">&#41;</span><span class="sy4">;</span>
	<span class="kw4">size_t</span> ret <span class="sy1">=</span> <span class="nu0">0</span><span class="sy4">;</span>
	<span class="kw4">va_list</span> arg<span class="sy4">;</span>
&nbsp;
	<span class="co1">//</span>
	<span class="kw3">va_start</span><span class="br0">&#40;</span> arg, inFormat <span class="br0">&#41;</span><span class="sy4">;</span>
	<span class="br0">&#123;</span>
		ret <span class="sy1">=</span> VSprintf<span class="br0">&#40;</span> inoutBuffer <span class="sy2">+</span> offset, inBufferSize <span class="sy2">-</span> offset, inFormat, arg <span class="br0">&#41;</span><span class="sy4">;</span>
	<span class="br0">&#125;</span>
	<span class="kw3">va_end</span><span class="br0">&#40;</span> arg <span class="br0">&#41;</span><span class="sy4">;</span>
&nbsp;
	<span class="co1">//</span>
	<span class="kw1">return</span> offset <span class="sy2">+</span> ret<span class="sy4">;</span>
<span class="br0">&#125;</span></pre></div></div>
<p>I had already created my own wrappers around strlen() and vsprintf(), the reason being the fault of Microsoft. With their implementation of the standard library, they decided to deprecate non-safe versions complain at you until you either used their own _s variants, or defined a certain preprocessor.</p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.lastrayofhope.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://www.lastrayofhope.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.lastrayofhope.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.lastrayofhope.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="cpp" style="font-family:monospace;"><span class="co1">//</span>
<span class="co1">//</span>
<span class="kw4">size_t</span> ath<span class="sy4">::</span><span class="me2">VSprintf</span><span class="br0">&#40;</span> <span class="kw4">char</span> <span class="sy2">*</span> outBuffer, <span class="kw4">const</span> <span class="kw4">size_t</span> inBufferSize, <span class="kw4">const</span> <span class="kw4">char</span> <span class="sy2">*</span> inFormat, <span class="kw4">va_list</span> inArgs <span class="br0">&#41;</span>
<span class="br0">&#123;</span>
<span class="co2">#ifndef ATH_PLATFORM_WINDOWS</span>
	<span class="kw1">return</span> vsnprintf<span class="br0">&#40;</span> outBuffer, inBufferSize, inFormat, inArgs <span class="br0">&#41;</span><span class="sy4">;</span>
<span class="co2">#else</span>
	<span class="kw1">return</span> vsprintf_s<span class="br0">&#40;</span> outBuffer, inBufferSize, inFormat, inArgs <span class="br0">&#41;</span><span class="sy4">;</span>
<span class="co2">#endif</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="co1">//</span>
<span class="co1">//</span>
<span class="kw4">size_t</span> ath<span class="sy4">::</span><span class="me2">StrLen</span><span class="br0">&#40;</span> <span class="kw4">const</span> <span class="kw4">char</span> <span class="sy2">*</span> inString <span class="br0">&#41;</span>
<span class="br0">&#123;</span>
	<span class="kw1">return</span> <span class="kw3">strlen</span><span class="br0">&#40;</span> inString <span class="br0">&#41;</span><span class="sy4">;</span>
<span class="br0">&#125;</span></pre></div></div>
<p>While I do prefer to have safe versions, their _s variants are not present in the standard and so it makes the code not portable.</p>
<p>I'm still not quite sure about my naming convention for a variable that is an input and an output. While I do like the <strong>in</strong> or <strong>out</strong> prefix, I don't think <strong>inout</strong> looks right, being slightly too long. I wasn't a fan of <strong>io</strong> either. I have however grown to like the truncation of Athena namespace to ath.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lastrayofhope.com/2011/11/02/sprintfcat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenGL Shader Debugging</title>
		<link>http://www.lastrayofhope.com/2011/10/28/opengl-shader-debugging/</link>
		<comments>http://www.lastrayofhope.com/2011/10/28/opengl-shader-debugging/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 21:17:50 +0000</pubDate>
		<dc:creator>Kaluriel</dc:creator>
				<category><![CDATA[Athena]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[OpenGL ES]]></category>

		<guid isPermaLink="false">http://www.lastrayofhope.com/?p=3969</guid>
		<description><![CDATA[One thing that always annoys me with using glGetShaderInfoLog(), is that when compiling OpenGL shaders multiple sources can be used. Because of this, the line numbers get shifted, and trying to find line 123 where a syntax error exists is a length process. So I made a function that will take the sources list and [...]]]></description>
			<content:encoded><![CDATA[<p>One thing that always annoys me with using glGetShaderInfoLog(), is that when compiling OpenGL shaders multiple sources can be used. Because of this, the line numbers get shifted, and trying to find line 123 where a syntax error exists is a length process.</p>
<p>So I made a function that will take the sources list and output the lines with line numbers.</p>
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.lastrayofhope.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://www.lastrayofhope.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.lastrayofhope.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.lastrayofhope.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="cpp" style="font-family:monospace;"><span class="kw4">void</span> OutputWithLineNumbers<span class="br0">&#40;</span> <span class="kw4">const</span> <span class="kw4">char</span> <span class="sy2">**</span> inSources, <span class="kw4">const</span> <span class="kw4">unsigned</span> <span class="kw4">int</span> inCount <span class="br0">&#41;</span>
<span class="br0">&#123;</span>
	<span class="kw4">bool</span> unendedLineNo <span class="sy1">=</span> <span class="kw2">false</span><span class="sy4">;</span>
	<span class="kw4">int</span> lineNumber <span class="sy1">=</span> <span class="nu0">1</span><span class="sy4">;</span>
&nbsp;
	<span class="kw1">for</span><span class="br0">&#40;</span> <span class="kw4">unsigned</span> <span class="kw4">int</span> i <span class="sy1">=</span> <span class="nu0">0</span><span class="sy4">;</span> i <span class="sy1">&lt;</span> inCount<span class="sy4">;</span> <span class="sy2">++</span>i <span class="br0">&#41;</span>
	<span class="br0">&#123;</span>
		<span class="kw4">const</span> <span class="kw4">char</span> <span class="sy2">*</span> cur <span class="sy1">=</span> inSources<span class="br0">&#91;</span>i<span class="br0">&#93;</span><span class="sy4">;</span>
		<span class="kw4">const</span> <span class="kw4">char</span> <span class="sy2">*</span> next <span class="sy1">=</span> <span class="kw2">NULL</span><span class="sy4">;</span>
&nbsp;
		<span class="kw1">do</span>
		<span class="br0">&#123;</span>
			<span class="co1">//</span>
			<span class="kw1">if</span><span class="br0">&#40;</span> <span class="sy3">!</span>unendedLineNo <span class="br0">&#41;</span>
			<span class="br0">&#123;</span>
				<span class="kw3">printf</span><span class="br0">&#40;</span> <span class="st0">&quot;%04d: &quot;</span>, lineNumber <span class="br0">&#41;</span><span class="sy4">;</span>
			<span class="br0">&#125;</span>
&nbsp;
			<span class="co1">//</span>
			next <span class="sy1">=</span> <span class="kw3">strchr</span><span class="br0">&#40;</span> cur, <span class="st0">'<span class="es1">\r</span>'</span> <span class="br0">&#41;</span><span class="sy4">;</span>
&nbsp;
			<span class="co1">//</span>
			<span class="kw1">if</span><span class="br0">&#40;</span> next <span class="br0">&#41;</span>
			<span class="br0">&#123;</span>
				<span class="kw4">size_t</span> len <span class="sy1">=</span> <span class="br0">&#40;</span> next <span class="sy2">-</span> cur <span class="br0">&#41;</span><span class="sy4">;</span>
				<span class="kw4">char</span> <span class="sy2">*</span> lineText <span class="sy1">=</span> <span class="br0">&#40;</span><span class="kw4">char</span> <span class="sy2">*</span><span class="br0">&#41;</span>alloca<span class="br0">&#40;</span> len <span class="br0">&#41;</span><span class="sy4">;</span>
				<span class="kw3">memcpy</span><span class="br0">&#40;</span> lineText, cur, len <span class="br0">&#41;</span><span class="sy4">;</span>
				lineText<span class="br0">&#91;</span>len<span class="br0">&#93;</span> <span class="sy1">=</span> <span class="nu0">0</span><span class="sy4">;</span>
&nbsp;
				<span class="kw3">printf</span><span class="br0">&#40;</span> <span class="st0">&quot;%s<span class="es1">\n</span>&quot;</span>, lineText <span class="br0">&#41;</span><span class="sy4">;</span>
&nbsp;
				unendedLineNo <span class="sy1">=</span> <span class="kw2">false</span><span class="sy4">;</span>
				<span class="sy2">++</span>lineNumber<span class="sy4">;</span>
			<span class="br0">&#125;</span>
			<span class="kw1">else</span>
			<span class="br0">&#123;</span>
				<span class="kw3">printf</span><span class="br0">&#40;</span> <span class="st0">&quot;%s&quot;</span>, cur <span class="br0">&#41;</span><span class="sy4">;</span>
				unendedLineNo <span class="sy1">=</span> <span class="kw2">true</span><span class="sy4">;</span>
			<span class="br0">&#125;</span>
&nbsp;
			<span class="co1">//</span>
			cur <span class="sy1">=</span> next <span class="sy2">+</span> <span class="nu0">2</span><span class="sy4">;</span>
		<span class="br0">&#125;</span> <span class="kw1">while</span><span class="br0">&#40;</span> next <span class="br0">&#41;</span><span class="sy4">;</span>
	<span class="br0">&#125;</span>
&nbsp;
	<span class="kw1">if</span><span class="br0">&#40;</span> unendedLineNo <span class="br0">&#41;</span>
	<span class="br0">&#123;</span>
		<span class="kw3">printf</span><span class="br0">&#40;</span> <span class="st0">&quot;<span class="es1">\n</span>&quot;</span> <span class="br0">&#41;</span><span class="sy4">;</span>
	<span class="br0">&#125;</span>
<span class="br0">&#125;</span></pre></div></div>
<p>This code requires the source files to have a carriage return as well as a new line character.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lastrayofhope.com/2011/10/28/opengl-shader-debugging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Even heroes fail sometimes</title>
		<link>http://www.lastrayofhope.com/2011/08/27/even-heroes-fail-sometimes/</link>
		<comments>http://www.lastrayofhope.com/2011/08/27/even-heroes-fail-sometimes/#comments</comments>
		<pubDate>Sat, 27 Aug 2011 21:52:40 +0000</pubDate>
		<dc:creator>Kaluriel</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iTunes]]></category>

		<guid isPermaLink="false">http://www.lastrayofhope.com/?p=3959</guid>
		<description><![CDATA[For a "HD" game, the graphics are really crap on the iPad 2. And no antialiasing, shame on you RedLynx.]]></description>
			<content:encoded><![CDATA[<div id="attachment_3960" class="wp-caption aligncenter" style="width: 160px"><a href="http://www.lastrayofhope.com/wp-content/uploads/2011/08/IMG_0001.png"><img class="size-thumbnail wp-image-3960 " title="1000 Heroz HD" src="http://www.lastrayofhope.com/wp-content/uploads/2011/08/IMG_0001-150x150.png" alt="1000 Heroz HD" width="150" height="150" /></a><p class="wp-caption-text">1000 Heroz HD</p></div>
<p>For a "HD" game, the graphics are really crap on the iPad 2. And no antialiasing, shame on you <a href="http://www.redlynx.com/" target="_blank">RedLynx</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lastrayofhope.com/2011/08/27/even-heroes-fail-sometimes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XCode4 Build Rules for iOS</title>
		<link>http://www.lastrayofhope.com/2011/08/26/xcode4-build-rules-for-ios/</link>
		<comments>http://www.lastrayofhope.com/2011/08/26/xcode4-build-rules-for-ios/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 21:30:20 +0000</pubDate>
		<dc:creator>Kaluriel</dc:creator>
				<category><![CDATA[Athena]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://www.lastrayofhope.com/?p=3949</guid>
		<description><![CDATA[For a while now I have been manually compiling files since my asset conversion pipeline tool is not quite finished yet. So I took at look into Build Rules in XCode. My main trouble within using them was finding the environment variables, even googling them doesn't turn up much information. I think the output files [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.lastrayofhope.com/wp-content/uploads/2011/08/Screen-shot-2011-08-26-at-22.21.021.png"><img class="alignleft size-thumbnail wp-image-3999" title="Build Script" src="http://www.lastrayofhope.com/wp-content/uploads/2011/08/Screen-shot-2011-08-26-at-22.21.021-150x150.png" alt="" width="150" height="150" /></a> For a while now I have been manually compiling files since my asset conversion pipeline tool is not quite finished yet.</p>
<p>So I took at look into Build Rules in XCode. My main trouble within using them was finding the environment variables, even googling them doesn't turn up much information.</p>
<p>I think the output files act as an error check, if the output file fails to appear then the tool failed.</p>
<p>One other thing I had an issue with was the source files list. I tried comma and semi colon delimiters, and spaces, but the TGA file kept giving the warning on Tree1.tga. I have yet t0 find the a way to do this without multiple entries. And I'm thinking a separate tool for building files may be easier.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lastrayofhope.com/2011/08/26/xcode4-build-rules-for-ios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone Orientation</title>
		<link>http://www.lastrayofhope.com/2011/08/25/iphone-orientation/</link>
		<comments>http://www.lastrayofhope.com/2011/08/25/iphone-orientation/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 19:08:42 +0000</pubDate>
		<dc:creator>Kaluriel</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://www.lastrayofhope.com/?p=3927</guid>
		<description><![CDATA[Earlier I wanted to test my engine with autorotation for when an iOS device's orientation changes. I spent a fair bit of time trying to work out why, sure that I had written some code somewhere to stop it from triggering. After creating another app and still haven't the same problem, I was about to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.lastrayofhope.com/wp-content/uploads/2011/08/IMG_0002.png"><img class="alignleft size-thumbnail wp-image-3928" title="Screen Lock taunting me" src="http://www.lastrayofhope.com/wp-content/uploads/2011/08/IMG_0002-150x150.png" alt="" width="150" height="150" /></a>Earlier I wanted to test my engine with autorotation for when an iOS device's orientation changes. I spent a fair bit of time trying to work out why, sure that I had written some code somewhere to stop it from triggering.</p>
<p>After creating another app and still haven't the same problem, I was about to report it as a bug when the answer dawned on me, I had the orientation lock on.</p>
<p>It would be nice if you could do it on an application basis as well as a global one, since I only turn it on because photos get orientated incorrectly.</p>
<p>The contents of my "Useless" app folder: Stocks, Weather, Contacts, Calculator, Voice Memos, Compass, Reminders. If only you could turn off the default apps as well.</p>
<p>On another note, I've added a page next to website for iOS specific links.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lastrayofhope.com/2011/08/25/iphone-orientation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

