<?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>TJ Singleton &#187; Uncategorized</title>
	<atom:link href="http://tjsingleton.name/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://tjsingleton.name</link>
	<description>Software Engineer, Baptist Preacher</description>
	<lastBuildDate>Thu, 01 Jul 2010 17:28:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Dave Thomas on the Ruby Object Model</title>
		<link>http://tjsingleton.name/2010/06/dave-on-ruby-object-model/</link>
		<comments>http://tjsingleton.name/2010/06/dave-on-ruby-object-model/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 23:30:07 +0000</pubDate>
		<dc:creator>TJ Singleton</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tjsingleton.name/?p=287</guid>
		<description><![CDATA[Was reminded today of this great video presentation by Dave Thomas from Scotland on Rails 2009 on the Ruby object model.]]></description>
			<content:encoded><![CDATA[<p>Was reminded today of this great video presentation by Dave Thomas from <a href="http://www.rubyinside.com/scotland-on-rails-presentations-now-online-27-awesome-videos-1799.html">Scotland on Rails 2009</a> on the <a href="http://scotland-on-rails.s3.amazonaws.com/2A04_DaveThomas-SOR.mp4">Ruby object model.</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://tjsingleton.name/2010/06/dave-on-ruby-object-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://scotland-on-rails.s3.amazonaws.com/2A04_DaveThomas-SOR.mp4" length="285514197" type="video/mp4" />
		</item>
		<item>
		<title>Example of my JavaScript Skills &#8211; Blackjax</title>
		<link>http://tjsingleton.name/2008/08/example-of-my-javascript-skills-blackjax/</link>
		<comments>http://tjsingleton.name/2008/08/example-of-my-javascript-skills-blackjax/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 02:32:37 +0000</pubDate>
		<dc:creator>TJ Singleton</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tjsingleton.name/2008/08/example-of-my-javascript-skills-blackjax/</guid>
		<description><![CDATA[I was asked to provide some JavaScript for a job interview.  Awhile ago I had started to build a JavaScript version of blackjack. I got the idea from while reading "The Object-Oriented Thought Process." In the sixth chapter Matt Weisfeld used Blackjack as a case study of Designing with Objects. Without further adu, I introduce [...]]]></description>
			<content:encoded><![CDATA[<p>I was asked to provide some JavaScript for a job interview.  Awhile ago I had started to build a JavaScript version of blackjack. I got the idea from while reading "The Object-Oriented Thought Process." In the sixth chapter Matt Weisfeld used Blackjack as a case study of <em>Designing with Objects.</em><span id="more-20"></span></p>
<p>Without further adu, I introduce <a href="http://www.draftdepot.com/blackjax/">Blackjax</a>. It is a simple blackjack game built with JavaScript. I use jQuery to for it's convenience functions and effects.</p>
<p>My focus has been more on the core of the game itself, so there are some things that aren't as polished as others. One example is the form to add players and start the game. Depending on my free-time and pressure from friends I may continue to build upon it.</p>
<h3>Challenge for my fellow code geeks</h3>
<p>I'd love for you to send me your thoughts on the JavaScript. Let me know how you'd have done it differently. I have refactored the code several times and still am not 100% satisfied with it.</p>
<p>One area that I know needs improvement is handling aces. The logic I am using for the possible double value (1, 11) of an ace is oversimplified and can lead to poor choices by the dealer. For instance, two aces will always equal 2, and never 12.</p>
<p>One suggestion that was given to me is to change how I wrote the objects. <a href="http://www.timnovinger.com/">Tim Novinger</a> suggested I switch to <a href="http://pastie.org/261449">a <del datetime="2008-08-29T04:11:55+00:00">JSON</del> <ins datetime="2008-08-29T04:11:55+00:00">Object Literal</ins> approach</a>.  The reason I choose to use functions as objects is the ability to create a new instance of objects.</p>
<h3>Does refactoring ever stop?</h3>
<p>I tried my best to showcase best practices when it came to the design of objects. I spent most of the day yesterday refactoring the code. The last change I made was to separate all the core logic of the game from the display logic. I'm not fully satisfied on how the outcome, but it is much better than before. If you wanted to change from jQuery to mootools it would only effect the display class.</p>
<p>It would be best to refactor the the display code up into smaller objects. The fact that the "BlackjackFrontend" object is responsible for displaying the card just doesn't sit well with me. I'd also like to refactor blackjack specific information from the "Player" object to an one that extends the "Player" to maximize the potential for code reuse.</p>
<p>I think I could refactor this code to death.</p>
<h3>Demonstrating the need for testing</h3>
<p>This project really taught me the need for unit tests and automated testing. The form of automated testing I used was my dear wife, and I have to thank her for her diligent efforts. Her poor fingers from having to refresh until a specific situation occurred. I still am not sure what would happen if everyone got a blackjack on the deal.</p>
<p>In short, I have placed "Find JavaScript testing framework" on my to-do list.</p>
<p>Overall, I think <a href="http://www.draftdepot.com/blackjax/">Blackjax</a> is a solid example of my understanding of JavaScript and a lot more fun that table sorting or form validation. Hopefully it will serve me well.</p>
]]></content:encoded>
			<wfw:commentRss>http://tjsingleton.name/2008/08/example-of-my-javascript-skills-blackjax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Guitar Clip</title>
		<link>http://tjsingleton.name/2005/09/guitar-clip/</link>
		<comments>http://tjsingleton.name/2005/09/guitar-clip/#comments</comments>
		<pubDate>Mon, 05 Sep 2005 07:35:53 +0000</pubDate>
		<dc:creator>TJ Singleton</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tjsingleton.name/2005/09/guitar-clip/</guid>
		<description><![CDATA[I got bored last night with my guitar so I fired up audicity and played a couple bars of a song we sing at church. The Chorus goes like this "I love Jesus, Hallelujah. I love Jesus, Yes, I do. I love Jesus, He's my saviour, Jesus smiles and loves me too. Anyways, this clip [...]]]></description>
			<content:encoded><![CDATA[<p>I got bored last night with my guitar so I fired up <a href="http://audacity.sourceforge.net/">audicity</a> and played a couple bars of a song we sing at church. The Chorus goes like this "I love Jesus, Hallelujah. I love Jesus, Yes, I do. I love Jesus, He's my saviour, Jesus smiles and loves me too.</p>
<p>Anyways, <a href="http://tjsingleton.name/mp3/guitarclip.mp3">this clip</a> is the outcome of that.</p>
]]></content:encoded>
			<wfw:commentRss>http://tjsingleton.name/2005/09/guitar-clip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://tj.preachersweb.org/mp3/guitarclip.mp3" length="372837" type="audio/mpeg" />
<enclosure url="http://tjsingleton.name/mp3/guitarclip.mp3" length="372837" type="audio/mpeg" />
		</item>
		<item>
		<title>Blue Lights of Heaven</title>
		<link>http://tjsingleton.name/2005/09/blue-lights-of-heaven/</link>
		<comments>http://tjsingleton.name/2005/09/blue-lights-of-heaven/#comments</comments>
		<pubDate>Mon, 05 Sep 2005 07:30:16 +0000</pubDate>
		<dc:creator>TJ Singleton</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tjsingleton.name/?p=144</guid>
		<description><![CDATA[In North Carolina with some friend we were stopped by a police officer for speeding. I wasn't driving, we were in the back seat singing praises to Christ. So we found it ironic we got pulled over. We'll I was feeling mighty a bit preachy and I spouted off about what I ought to tell [...]]]></description>
			<content:encoded><![CDATA[<p>In North Carolina with some friend we were stopped by a police officer for speeding. I wasn't driving, we were in the back seat singing praises to Christ. So we found it ironic we got pulled over. We'll I was feeling mighty a bit preachy and I spouted off about what I ought to tell that cop. It started something like this.... "One day officer the blue lights of heaven are gonna chase you down, and you be arrested by the Law of God and it's officer the Holy Spirit......", so I wrote a song about the Blue Lights of Heaven.</p>
<h2>Blue Lights of Heaven</h2>
<p><strong>Verse One:</strong><br />
One day while driving a little too fast,<br />
Behind me police lights flashed,<br />
Then sitting there, God reminded me,<br />
Of that sweet day he convicted me.</p>
<p>The Spirit comes to convict from sin,<br />
Point you to the cross where new life begins.<br />
It's that sweet Spirit that gives godly fear,<br />
O' Holy Spirit, linger near.</p>
<p><strong>Chorus:</strong><br />
Blue lights of heaven came after me,<br />
Blue lights of heaven made me bow my knee,<br />
By the law of God and the Spirit's call,<br />
I trusted Christ and surrendered all.</p>
<p><strong>Verse Two:</strong><br />
Trusting in the Lord is the only way, To reach that land of perfect day, We must be born by the Holy Ghost, It's nothing we do, We cannot boast.</p>
<p>By God's word souls are saved,<br />
We praise Him for the grace He gave.<br />
How one day He came to me,<br />
And by God's grace He set me free!</p>
]]></content:encoded>
			<wfw:commentRss>http://tjsingleton.name/2005/09/blue-lights-of-heaven/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
