<?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>Troy Sandal &#187; Development</title>
	<atom:link href="http://www.planettroy.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.planettroy.com</link>
	<description>Spouting at the Mouth</description>
	<lastBuildDate>Sun, 23 Jan 2011 15:23:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Zen Garden Sudoku for the iPhone</title>
		<link>http://www.planettroy.com/zen-garden-sudoku-for-the-iphone/</link>
		<comments>http://www.planettroy.com/zen-garden-sudoku-for-the-iphone/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 01:25:32 +0000</pubDate>
		<dc:creator>troy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[sudoku]]></category>

		<guid isPermaLink="false">http://www.planettroy.com/zen-garden-sudoku-for-the-iphone/</guid>
		<description><![CDATA[To learn Objective-C and the iPhone API I decided to write a Sudoku game for the iPhone. It was so fun to play that I decided to release it to the general public. With the help of a friend who is very talented in the art of graphic design we came up with a Zen [...]]]></description>
			<content:encoded><![CDATA[<p>To learn Objective-C and the iPhone API I decided to write a Sudoku game for the iPhone.  It was so fun to play that I decided to release it to the general public. With the help of a friend who is very talented in the art of graphic design we came up with a Zen garden theme and thus called it Zen Garden Sudoku. It is now available on the iTunes AppStore for your iPhone or iPod Touch. Enjoy!  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.planettroy.com/zen-garden-sudoku-for-the-iphone/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>What I&#8217;ve been Doing</title>
		<link>http://www.planettroy.com/what-ive-been-doing/</link>
		<comments>http://www.planettroy.com/what-ive-been-doing/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 17:32:52 +0000</pubDate>
		<dc:creator>troy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[sudoku]]></category>

		<guid isPermaLink="false">http://www.planettroy.com/?p=96</guid>
		<description><![CDATA[A few people have asked recently what I&#8217;m up to so I figured I should at least blog about it.  For the past 2 months I&#8217;ve immersed myself in the iPhone SDK in an attempt to become both a fluent iPhone developer as well as an OS X developer.  To reach my goal of fluency [...]]]></description>
			<content:encoded><![CDATA[<p>A few people have asked recently what I&#8217;m up to so I figured I should at least blog about it.  For the past 2 months I&#8217;ve immersed myself in the iPhone SDK in an attempt to become both a fluent iPhone developer as well as an OS X developer.  To reach my goal of fluency I decided I should build an iPhone application that I&#8217;d want to use on a daily basis and something I might sell in the iTunes AppStore.  That application is Sudoku.  Why?  First, because I love playing Sudoku.  Second, because it&#8217;s a fairly graspable application for my first iPhone attempt.  Third, because there&#8217;s a good chance of people buying it from the store.  Not that I&#8217;m not looking for this to be the killer iPhone application nor a huge money maker.  It&#8217;s just my first or hopefully many applications I&#8217;ll develop for the platform.  My task list is telling me that I&#8217;ll be code complete by August 15th.  If all things go well I&#8217;ll publish a week or so after I return from Burning Man.  I&#8217;ve registered a new domain that I&#8217;ll be using for self publishing.  I&#8217;ll announce it when it is up and running.</p>
<p>Otherwise I&#8217;m still enjoying San Francisco this summer.  The weather has been accomodating for development but I&#8217;m looking forward to fall where it should heat up.  Wow, did I just say that?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.planettroy.com/what-ive-been-doing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thanks Bill</title>
		<link>http://www.planettroy.com/thanks-bill/</link>
		<comments>http://www.planettroy.com/thanks-bill/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 19:08:42 +0000</pubDate>
		<dc:creator>troy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[billgates]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://www.planettroy.com/?p=93</guid>
		<description><![CDATA[Today Bill Gates steps down from his role at Microsoft and I believe I owe him a huge thanks for all he&#8217;s done &#8211; for the software industry, for his community and now what&#8217;s he&#8217;s doing for the world at large.  I grew up not far from Microsoft and remember when its offices were next [...]]]></description>
			<content:encoded><![CDATA[<p>Today Bill Gates steps down from his role at Microsoft and I believe I owe him a huge thanks for all he&#8217;s done &#8211; for the software industry, for his community and now what&#8217;s he&#8217;s doing for the world at large.  I grew up not far from Microsoft and remember when its offices were next to the <a href="http://www.burgermaster.biz/">BurgerMaster</a>.  In High School I dreamed of working there but after college I wound up at a small startup called <a href="http://www.visio.com">Visio</a> instead.  Visio rode the coat tails of Microsoft&#8217;s revolution as they pushed for a PC in every home and on every desk.  We had incredible success due in part to both our product and team but also to the massive growth that Microsoft was causing in the industry.  I remember sitting around with other devs around 1995, we were talking about how important Microsoft was to the current industry expansion and about the role Gates/Microsoft played in it.  Someone speculated that Microsoft, so dependent upon Gates, would crumble if he ever left.  We all agreed until someone, Mike Frederick methinks, reminded us that all things do come to an end and that, though we couldn&#8217;t see that far in the future, he would one day step down. 13 years later and that day is here.  The industry looks completely different now but hearing about his departure is making me wax nostalgic about where we came from.  I&#8217;m proud to have been part of that history and thank Bill for helping make it happen.  Love him or hate him, you have to admit that Microsoft helped fuel the revolution that keeps on moving.  I hope that he has even more success in his philanthropic pursuits.</p>
<p>Thanks Bill.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.planettroy.com/thanks-bill/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Asteroids in Processing</title>
		<link>http://www.planettroy.com/asteroids-in-processing/</link>
		<comments>http://www.planettroy.com/asteroids-in-processing/#comments</comments>
		<pubDate>Tue, 06 May 2008 03:16:31 +0000</pubDate>
		<dc:creator>troy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[asteroids]]></category>
		<category><![CDATA[processing]]></category>

		<guid isPermaLink="false">http://www.planettroy.com/?p=88</guid>
		<description><![CDATA[Last February I decided to write a game. Around that same time I was also introduced to Processing. To great things that work great together. If you are a software developer and are not familiar with Processing then I think you should be. It&#8217;s a wonderful Java based environment in which you can sketch out [...]]]></description>
			<content:encoded><![CDATA[<p>Last February I decided to write a game. Around that same time I was also introduced to <a title="Processing Home Page" href="http://www.processing.org" target="_blank">Processing</a>. To great things that work great together. If you are a software developer and are not familiar with Processing then I think you should be. It&#8217;s a wonderful Java based environment in which you can sketch out graphical ideas very quickly. It lets you worry less about how well structured your code is and instead you quickly formulate your ideas and see them on screen. The number of interesting Processing applications is growing daily and some are<a title="Processing Examples" href="http://processing.org/exhibition/index.html" target="_blank"> very impressive</a>.  It was the perfect platform for my game. Well I should be honest &#8211; it&#8217;s not &#8220;my game&#8221; it&#8217;s a knock off of one by Atari. You see I haven&#8217;t written a video game since high school so I wanted to start with something easy and familiar, hence I chose Asteroids.</p>
<p>It only took me about 24 hours of work to get a good version of the game running. It took an extra 15 hours to try and polish out the rough edges. Honestly I could probably use another 24 hours to polish but at this point I feel happy with the game and feel like releasing it and moving on to my next game. Supposedly there is a bug that causes the ship to lock up though I have not experienced it. If you do please let me know and try in detail what was happening at the time of the lockup. Or <a href="http://www.planettroy.com/uploads/asteroids.zip">download the source</a> and fix it yourself.  Enjoy!</p>
<p>Controls:</p>
<p>Space &#8211; Fire<br />
Left &#8211; Rotate Left<br />
Right &#8211; Rotate Right<br />
Up &#8211; Forward Thrust<br />
Ctrl &#8211; Hyperspace</p>
<p><script src="/scratch/asteroids/asteroids.js" type="text/javascript"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.planettroy.com/asteroids-in-processing/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>First Attempt at Debugging iPhone Web App</title>
		<link>http://www.planettroy.com/first-attempt-at-debugging-iphone-web-app/</link>
		<comments>http://www.planettroy.com/first-attempt-at-debugging-iphone-web-app/#comments</comments>
		<pubDate>Wed, 15 Aug 2007 21:26:45 +0000</pubDate>
		<dc:creator>troy</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.planettroy.com/?p=63</guid>
		<description><![CDATA[I&#8217;ve started debugging an application for the iPhone and thought it decent to post my first thoughts and discoveries. Apologies for the bad code formatting, I&#8217;ve never posted code to my blog before and WordPress really gave me a bad time. I&#8217;ll figure this out. Logging via console.log First off was console output. The simple [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started debugging an application for the iPhone and thought it decent to post my first thoughts and discoveries.  Apologies for the bad code formatting, I&#8217;ve never posted code to my blog before and WordPress really gave me a bad time.  I&#8217;ll figure this out.<br />
<strong>Logging via console.log </strong></p>
<p>First off was console output. The simple console.log() method supported by Safari and FireBug is what I use in much of my code.  Though supported on the iPhone one cannot view the console at the same time.  Instead of falling back to alert() I instead redirect the console output to the server.  <a href="http://www.joehewitt.com/blog/firebug_for_iph.php">John Hewitt built a solution similar to mine</a> which is to have your web server accept log messages.  Since I&#8217;m working on a Java web server I wrote a Servlet that accepts a URL of the form</p>
<blockquote><p>http://localhost/app/logger.js?msg=Hello%20World</p>
</blockquote>
<p>and logs the output to a local file, in my case /tmp/logger.log.  Here&#8217;s the Servlet code.</p>
<pre style="border: 1px dashed #999999; padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: #000000; background-color: #eeeeee; font-size: 10px; line-height: 12px; width: 100%"><code>public class LoggerServlet extends HttpServlet {
@Override
protected void doGet(
HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {

</code><code>   </code><code>response.addHeader("Cache-Control", "no-cache");
</code><code>   </code><code>response.addHeader("pragma", "no-cache");
</code><code>   </code><code>response.addHeader("Expires", "-1");
</code><code>   </code><code>response.setContentType("text/javascript");
</code><code>   </code><code>response.getWriter().write("//Done");
</code><code>   </code><code>response.setContentLength(6);

</code><code>   </code><code>String message = request.getParameter("msg");
</code><code>   </code><code>message = message.replaceAll("rn", "n").replaceAll("r", "n");

</code><code>  </code><code>try {
</code><code>  </code><code>  </code><code>File x = new File("/tmp/logger.log");
</code><code>  </code><code>  </code><code>FileOutputStream fos = new FileOutputStream(x, true);
</code><code>  </code><code>  </code><code>PrintWriter pw = new PrintWriter(fos);
</code><code>  </code><code>  </code><code>pw.println(message);
</code><code>  </code><code>  </code><code>pw.close();
</code><code>  </code><code><code>} catch (java.io.FileNotFoundException fnfe) {
}
}</code></code> <code>}</code></pre>
<p>On the client I detect if I&#8217;m using an iPhone and redirect console.log() to GET this URL instead using a SCRIPT GET.  Perhaps using the Image object is better as it doesn&#8217;t clutter the DOM.  That&#8217;s an optimization.  Here&#8217;s the code.</p>
<pre style="border: 1px dashed #999999; padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: #000000; background-color: #eeeeee; font-size: 10px; line-height: 12px; width: 100%"><code>// This causes browsers without a console or the iPhone to log on the server.
if (typeof console == "undefined" || /iPhone/.test(navigator.platform)) {
var oldConsole = window['console'];
if (typeof console == "undefined")
window.console = { };

console.log = function(msg) {
// Might be too early to do this - can we add directly to the body?
if (typeof document.body == "undefined") {
if (oldConsole) oldConsole.log(msg);
return;
}
var script = document.createElement("script");
script.type = 'text/javascript';
script.src = './logger.js?msg=' + encodeURIComponent(msg);
document.body.appendChild(script);
}
}</code></pre>
<p>It&#8217;s simple and works well for my scenarios.  To see the log output I just open a Terminal window and run &#8216;tail -f -n 50 /tmp/logger.log&#8217; which continuously displays new log output.</p>
<p><strong>Trapping Enter Key</strong></p>
<p>I&#8217;ve got lots of key handlers that check for the enter key by looking for (event.charCode || event.keyCode) == 13.  Sadly this fails on the iPhone as it returns 10 (line-feed) instead of 13 (carriage return).  I find it odd that Safari returns 13 like IE and FireFox but the iPhone is different.  If you are handling the enter key then you must check for 10 on the iPhone and 13 on other browsers, or check for both which seems safe.<br />
<strong>No Scroll bars with CSS Overflow</strong></p>
<p>The next thing I&#8217;ve found but have no fix for is displaying scroll bars on block elements with overflowing content.  I use this as do many sites and it&#8217;s really too bad the iPhone won&#8217;t display a scroll bar.  Below is an example that, when viewed on the iPhone, shows no scroll bars but does in all other browsers.</p>
<div style="border: 1px solid red; overflow: scroll; height: 100px; width: 100px" id="text">asdf<br />
asdf<br />
asdf<br />
asdf<br />
asdf<br />
asdf</div>
]]></content:encoded>
			<wfw:commentRss>http://www.planettroy.com/first-attempt-at-debugging-iphone-web-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

