<?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>David Orriss Jr - The Delusion That People Care About What I Think</title>
	<atom:link href="http://codethought.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://codethought.com/blog</link>
	<description>Dad, Curmudgeon, Java Enterprise Expert, Tech Superfreak, Android Developer</description>
	<lastBuildDate>Wed, 23 Nov 2011 23:39:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Getting Started with Grails</title>
		<link>http://codethought.com/blog/?p=298&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=getting-started-with-grails</link>
		<comments>http://codethought.com/blog/?p=298#comments</comments>
		<pubDate>Wed, 23 Nov 2011 19:27:04 +0000</pubDate>
		<dc:creator>codethought</dc:creator>
				<category><![CDATA[Grails]]></category>
		<category><![CDATA[Groovy Language]]></category>
		<category><![CDATA[J2EE]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[groovy on grails]]></category>

		<guid isPermaLink="false">http://codethought.com/blog/?p=298</guid>
		<description><![CDATA[Grails is an open-source, rapid web application development framework that provides a super-productive full-stack programming model based on the Groovy scripting language and built on top of Spring, Hibernate, and other standard Java frameworks. At least that&#8217;s what the marketing hype says. My take &#8211; Grails is an open-source answer to Rails for the Java [...]]]></description>
			<content:encoded><![CDATA[<p><em>Grails is an open-source, rapid web application development framework that provides a super-productive full-stack programming model based on the Groovy scripting language and built on top of Spring, Hibernate, and other standard Java frameworks.</em></p>
<p>At least that&#8217;s what the marketing hype says.</p>
<p>My take &#8211; Grails is an open-source answer to Rails for the Java Enterprise crowd.  It&#8217;s got all the flexibility of Ruby on Rails with the added benefit of being able to quickly leverage Java SDK resources from within the underlying language (called Groovy).  I&#8217;ve recently been working with Grails and a can say it&#8217;s an excellent platform for rapidly developing web front-ends that can work with your existing enterprise infrastructure.  Even better, it can work with almost seamlessly with your current/legacy Java application codebase.  But the trick to all of this is getting started.  The available documentation that you find online could be FAR better (and I&#8217;ll talk about that in other posts) but here are some resources and books that I&#8217;ve found to be excellent starting points.</p>
<h2>Programming Groovy: Dynamic Productivity for the Java Developer</h2>
<h3>by Venkat Subramaniam</h3>
<p><img style="float: left;" src="http://codethought.com/blog/wp-content/uploads/2011/11/vslg1.jpeg" border="0" alt="Vslg" width="162" height="195" /> To become proficient at Grails, you need to understand the Groovy Programming language, it&#8217;s constructs, and it&#8217;s importance in contrast to the Java ecosphere.  Dr. Subramaniam&#8217;s book provides an excellent foundation and starting point.  I&#8217;ve kept the printed edition in my backpack with me and refer to it regularly.  I&#8217;ve found the information and insights Dr. Subramaniam provides to be invaluable.You can order the printed and PDF book editions at the Pragmatic Programmer&#8217;s Website: </p>
<p><br clear=all></p>
<p> <a href="http://pragprog.com/book/vslg/programming-groovy">http://pragprog.com/book/vslg/programming-groovy</a></p>
</p>
<h2>Getting Started with Grails, Second Edition</h2>
<h3>Scott Davis &#038; Jason Rudolph</h3>
<p><img src="http://codethought.com/blog/wp-content/uploads/2011/11/LandingPageCover.png" alt="LandingPageCover" border="0" width="138" height="192" style="float:right;" />So you&#8217;ve started reading about Groovy, but you need to find out more about Grails&#8230; This book is the next logical step in that progression.  Davis&#8217; and Rudolph&#8217;s book provides a step-by-step example showing how to create a basic application (called Racetrack) that takes you along the same development lines that the Depot application in the Dave Thomas/David Heinemeier Hansson Rails book does.  You&#8217;ll learn how to leverage the underlying Hibernate layer via GORM (Grails Object Relational Mapping), connecting to external databases, the basics for developing robust MVC-based applications using GSP and Grails controllers, implementing basic security and user authentication, and working with the vast plugin library available to Grails developers.  The best part is you can the book is in a &#8220;try before you buy&#8221; model.  You can download the book for free from the InfoQ website, and if you find you like the book and find it useful, you can support the author&#8217;s efforts and buy a print version.  I found the book valuable and was able to get a basic version of an application completed for a project in a day after working through the Racetrack example.<br clear=all /></p>
<p><a href="http://www.infoq.com/minibooks/grails-getting-started">http://www.infoq.com/minibooks/grails-getting-started</a></p>
</p>
<h2>The Groovy Language Homepage</h2>
<p>Before you can do Grails &#8211; you need to get Groovy.  Go here and get your Groove on.</p>
<p><a href="http://groovy.codehaus.org/">http://groovy.codehaus.org/</a></p>
<h2>The Grails Quick Start</h2>
<p>Get grails direct from the source at Grails.org.  If you want to spin up a Grails application and you are familiar with Ruby and Rails &#8211; this will get you going fast.  Be sure to read the Installation section for getting the Grails environment configured and running before you use the Quick Start or you&#8217;ll get nowhere fast.
</p>
<p><a href="http://grails.org/Quick+Start"><a href="http://grails.org/Quick+Start">http://grails.org/Quick+Start</a></a></p>
]]></content:encoded>
			<wfw:commentRss>http://codethought.com/blog/?feed=rss2&#038;p=298</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Hosting Provider&#8230;</title>
		<link>http://codethought.com/blog/?p=3&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=new-hosting-provider</link>
		<comments>http://codethought.com/blog/?p=3#comments</comments>
		<pubDate>Tue, 15 Nov 2011 20:30:32 +0000</pubDate>
		<dc:creator>codethought</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://codethought.com/blog/?p=3</guid>
		<description><![CDATA[If you noticed an interruption to the blog or trying to email me it&#8217;s because I just changed all of my hosting and domain management to godaddy.com.  Now I&#8217;m not getting paid by them and I&#8217;m not going to post some &#8216;affilate link&#8217; to them where I get a bonus if you sign up for [...]]]></description>
			<content:encoded><![CDATA[<p>If you noticed an interruption to the blog or trying to email me it&#8217;s because I just changed all of my hosting and domain management to <a href="http://godaddy.com">godaddy.com</a>.  Now I&#8217;m not getting paid by them and I&#8217;m not going to post some &#8216;affilate link&#8217; to them where I get a bonus if you sign up for service with them.  But what I AM going to say is that they&#8217;re probably the best hosting provider I&#8217;ve used since my original provider was bought.  Their prices are outstanding, their hosting feature set is excellent (they support WordPress, Ruby/Rails, and pretty much everything except Java/Tomcat/J2EE servers) and their technical support thus far has been second to none.</p>
<p>If you are looking for hosting or if you feel like you might be paying too MUCH for hosting (I certainly was) then I recommend you check out godaddy.com.  It&#8217;ll be worth your time.  It certainly was worth mine!</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://codethought.com/blog/?feed=rss2&#038;p=3</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Join me on Google Plus!</title>
		<link>http://codethought.com/blog/?p=288&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=join-me-on-google-plus</link>
		<comments>http://codethought.com/blog/?p=288#comments</comments>
		<pubDate>Sat, 29 Oct 2011 18:08:18 +0000</pubDate>
		<dc:creator>codethought</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[google plus]]></category>

		<guid isPermaLink="false">http://codethought.com/blog/?p=288</guid>
		<description><![CDATA[Hey! You can always see what I&#8217;m thinking about, doing, or Sharing over on Google Plus. Just click the button below.. What&#8217;s that? You DON&#8217;T have a Google Plus account? Then click THIS link and join today!]]></description>
			<content:encoded><![CDATA[<p>Hey!</p>
<p>You can always see what I&#8217;m thinking about, doing, or Sharing over on Google Plus. Just click the button below..</p>
<p><a href="http://gplus.to/Codethought" rel="author"><br />
<img src="http://www.google.com/images/icons/ui/gprofile_button-64.png" alt="" width="64" height="64" /><br />
</a></p>
<p>What&#8217;s that? You DON&#8217;T have a Google Plus account? Then click THIS link and join today!</p>
<p><a href="https://plus.google.com/i/JNS07i2oKnU:fwbpK8v1IAQ" rel="author"><br />
<img src="http://www.graceblogger.com/wp-content/uploads/2011/07/need-google-plus-invite-570x201.png" alt="" width="60%" /><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://codethought.com/blog/?feed=rss2&#038;p=288</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ADT and the &#8216;Debug Certificate Expired&#8217; Error</title>
		<link>http://codethought.com/blog/?p=267&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=adt-and-the-debug-certificate-expired-error</link>
		<comments>http://codethought.com/blog/?p=267#comments</comments>
		<pubDate>Sat, 08 Oct 2011 18:27:44 +0000</pubDate>
		<dc:creator>codethought</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://codethought.com/blog/?p=267</guid>
		<description><![CDATA[Ran into this just this morning. I started up my Eclipse for Android environment and had all my projects greeting me with the error; &#8220;Debug certificate expired on 10/1/2011&#8243;. It&#8217;s an easy enough fix. Delete your debug certificate under ~/.android/debug.keystore (on Linux and Mac OS X); the directory is something like %USERHOME%/.androidon Windows. The Eclipse [...]]]></description>
			<content:encoded><![CDATA[<p>Ran into this just this morning.  I started up my Eclipse for Android environment and had all my projects greeting me with the error; &#8220;Debug certificate expired on 10/1/2011&#8243;.  It&#8217;s an easy enough fix.</p>
<p>Delete your debug certificate under ~/.android/debug.keystore (on Linux and Mac OS X); the directory is something like %USERHOME%/.androidon Windows.</p>
<p>The Eclipse plugin should then generate a new certificate when you next try to build a debug package. You may need to clean and then build to generate the certificate.</p>
<p>Problem solved.</p>
]]></content:encoded>
			<wfw:commentRss>http://codethought.com/blog/?feed=rss2&#038;p=267</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#8217;m writing this with tears on my eyes !!!</title>
		<link>http://codethought.com/blog/?p=263&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=im-writing-this-with-tears-on-my-eyes</link>
		<comments>http://codethought.com/blog/?p=263#comments</comments>
		<pubDate>Thu, 02 Dec 2010 04:31:42 +0000</pubDate>
		<dc:creator>codethought</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://codethought.com/blog/?p=263</guid>
		<description><![CDATA[Does that title sound familiar? My wife and I got an email this morning from my father that read as follows: Subject: I&#8217;m writing this with tears on my eyes !!! Hello, I&#8217;m sorry for this odd request and I&#8217;m writing this with tears on my eyes due to the situation of things right now, [...]]]></description>
			<content:encoded><![CDATA[<p>Does that title sound familiar?  My wife and I got an email this morning from my father that read as follows:</p>
<blockquote>
<p><strong>Subject:</strong> I&#8217;m writing this with tears on my eyes !!!</p>
<p>Hello,</p>
<p>  I&#8217;m sorry for this odd request and I&#8217;m writing this with tears on my eyes due to the situation of things right now, I&#8217;m stuck in London United Kingdom with my family,we came down here for vacation and we got Mugged at gunpoint, worse of it is cash cell phone and credit cards were stolen , it&#8217;s such a crazy and terrifying experience for us, we need help sort out our hotel bill and flying back home, the authorities are not being 100% helping us, but we thanks God we still have our passports, Our return flight leave today,But we still have problem in sorting out the hotel bills.Please help us i promise to refund it back.</p>
<p>Now I&#8217;m freaked out.</p>
<p> David.
</p></blockquote>
<p>There were two problems with this email:</p>
<ol>
<li> My father doesn&#8217;t write like he barely understands english.  In fact he&#8217;s one of the most eloquent writers I have ever known and is a native speaker of the Queen&#8217;s English.
<li> My father lives 12 miles away and has no travel plans
</ol>
<p>Turns out this is happening to a surprising number of people.  It&#8217;s a growingly common scam.  It&#8217;s also happened to a friend of mine.  Apparently there is a keystroke-logging trojan that&#8217;s in the wild.  Virus scanners like F-Prot, and current Mal-ware scanners are not detecting it and it&#8217;s causing a lot of havoc:</p>
<p></p>
<ol >
<li><a href="http://articles.cnn.com/2010-03-28/opinion/greene.email.scam_1_e-mail-first-byline-subject-line?_s=PM:OPINION">http://articles.cnn.com/2010-03-28/opinion/greene.email.scam_1_e-mail-first-byline-subject-line</a>
<li><a href="http://community.ca.com/blogs/securityadvisor/archive/2010/04/15/beware-of-scam-emails-i-m-writing-this-with-tears-in-my-eyes.aspx">http://community.ca.com/blogs/securityadvisor/archive/2010/04/15/beware-of-scam-emails-i-m-writing-this-with-tears-in-my-eyes.aspx</a>
<li><a href="http://www.google.com/support/forum/p/gmail/thread?tid=6c2f800138082e0a&#038;hl=en">Google Support</a>
</ol>
<p>If you see an email like this from any of your friends&#8230; CALL THEM before you decide to try to send money to them.  Also, if you get an email like this from your friends, tell them to UNPLUG THEIR COMPUTER from the internet.. erase it completely and RE-install windows.</p>
<p>You could also tell them that perhaps they should consider buying a Mac&#8230;  Because in 4 years of owning and using them I have yet to have them compromised by trash like this.</p>
]]></content:encoded>
			<wfw:commentRss>http://codethought.com/blog/?feed=rss2&#038;p=263</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Terminal Here in Snow Leopard using Automator</title>
		<link>http://codethought.com/blog/?p=261&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=open-terminal-here-in-snow-leopard-using-automator</link>
		<comments>http://codethought.com/blog/?p=261#comments</comments>
		<pubDate>Sun, 28 Nov 2010 04:56:23 +0000</pubDate>
		<dc:creator>codethought</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[automator]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[snow leopard]]></category>

		<guid isPermaLink="false">http://codethought.com/blog/?p=261</guid>
		<description><![CDATA[A subject that has been visited plenty of times is having an &#8220;Open Terminal Here&#8221; ability from the Finder. For developers, it&#8217;s a easy way to look at files or folders and then jump quickly to a shell for the folder and execute shell commands (like mv or cp). Or to execute a build using [...]]]></description>
			<content:encoded><![CDATA[<p>A subject that has been visited plenty of times is having an &#8220;Open Terminal Here&#8221; ability from the Finder.  For developers, it&#8217;s a easy way to look at files or folders and then jump quickly to a shell for the folder and execute shell commands (like <code> mv</code> or <code>cp</code>).  Or to execute a build using <code>make</code> or <code>ant</code>.</p>
<p>I decided to make a version of that would work off the &#8220;Services&#8221; context menu.  If you control-click a file and select <code>Services | Open Terminal Here</code> you&#8217;ll be taken to the folder containing that file.  A control-click on a folder will take you to the folder you selected.</p>
<p>To use it, just unzip this file and put it in your <code>~/Library/Services</code> folder.</p>
<p><a href="http://codethought.com/blog/wp-content/uploads/2010/11/Open-Terminal-Here.zip" title="Open Terminal Here.zip">Open Terminal Here.zip</a></p>
<p>The code itself is pretty straightforward:</p>
<pre>
<span class="as2">(*
</span><span class="as2">   Workflow - Open Terminal Here
   By David Orriss Jr - November 2010
   Another "Open Terminal Here" option.  This time as a service workflow in Automator
</span><span class="as2">
</span><span class="as2">   For Snow Leopard
</span><span class="as2">*)</span><span class="as3">
</span><span class="as4">on</span><span class="as3"> </span><span class="as5">run</span><span class="as3"> {</span><span class="as6">input</span><span class="as3">, </span><span class="as6">parameters</span><span class="as3">}
</span><span class="as3">
	</span><span class="as4">set</span><span class="as3"> </span><span class="as6">the_path</span><span class="as3"> </span><span class="as4">to</span><span class="as3"> (</span><span class="as4">the</span><span class="as3"> </span><span class="as7">POSIX path</span><span class="as3"> </span><span class="as4">of</span><span class="as3"> </span><span class="as6">input</span><span class="as3">)

	</span><span class="as4">set</span><span class="as3"> </span><span class="as7">AppleScript</span><span class="as3">'s </span><span class="as7">text item delimiters</span><span class="as3"> </span><span class="as4">to</span><span class="as3"> "/"

	</span><span class="as4">if</span><span class="as3"> </span><span class="as6">the_path</span><span class="as3"> </span><span class="as4">does not</span><span class="as3"> </span><span class="as4">end</span><span class="as3"> </span><span class="as4">with</span><span class="as3"> "/" </span><span class="as4">then</span><span class="as3">
</span><span class="as3">		</span><span class="as4">set</span><span class="as3"> </span><span class="as6">parentPath</span><span class="as3"> </span><span class="as4">to</span><span class="as3"> (</span><span class="as8">items</span><span class="as3"> 1 </span><span class="as4">thru</span><span class="as3"> -2 </span><span class="as4">of</span><span class="as3"> </span><span class="as8">text items</span><span class="as3"> </span><span class="as4">of</span><span class="as3"> </span><span class="as6">the_path</span><span class="as3">) </span><span class="as4">as</span><span class="as3"> </span><span class="as8">string</span><span class="as3">
		</span><span class="as4">set</span><span class="as3"> </span><span class="as6">the_path</span><span class="as3"> </span><span class="as4">to</span><span class="as3"> </span><span class="as6">parentPath</span><span class="as3">
</span><span class="as3">	</span><span class="as4">end</span><span class="as3"> </span><span class="as4">if</span><span class="as3">

	</span><span class="as4">set</span><span class="as3"> </span><span class="as6">cmd</span><span class="as3"> </span><span class="as4">to</span><span class="as3"> "cd " &#038; </span><span class="as7">quoted form</span><span class="as3"> </span><span class="as4">of</span><span class="as3"> </span><span class="as6">the_path</span><span class="as3"> &#038; " &#038;&#038; echo $'\ec'"

	</span><span class="as4">tell</span><span class="as3"> </span><span class="as8">application</span><span class="as3"> "System Events" </span><span class="as4">to</span><span class="as3"> </span><span class="as4">set</span><span class="as3"> </span><span class="as6">terminalIsRunning</span><span class="as3"> </span><span class="as4">to</span><span class="as3"> </span><span class="as5">exists</span><span class="as3"> </span><span class="as8">application process</span><span class="as3"> "Terminal"

	</span><span class="as4">tell</span><span class="as3"> </span><span class="as8">application</span><span class="as3"> "Terminal"
</span><span class="as3">		</span><span class="as5">activate</span><span class="as3">
		</span><span class="as4">if</span><span class="as3"> </span><span class="as6">terminalIsRunning</span><span class="as3"> </span><span class="as4">is</span><span class="as3"> </span><span class="as9">true</span><span class="as3"> </span><span class="as4">then</span><span class="as3">
</span><span class="as3">			</span><span class="as5">do script</span><span class="as3"> </span><span class="as10">with command</span><span class="as3"> </span><span class="as6">cmd</span><span class="as3">
</span><span class="as3">		</span><span class="as4">else</span><span class="as3">
</span><span class="as3">			</span><span class="as5">do script</span><span class="as3"> </span><span class="as10">with command</span><span class="as3"> </span><span class="as6">cmd</span><span class="as3"> </span><span class="as10">in</span><span class="as3"> </span><span class="as8">window</span><span class="as3"> 1
</span><span class="as3">		</span><span class="as4">end</span><span class="as3"> </span><span class="as4">if</span><span class="as3">
</span><span class="as3">	</span><span class="as4">end</span><span class="as3"> </span><span class="as4">tell</span><span class="as3">
</span><span class="as4">end</span><span class="as3"> </span><span class="as5">run</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://codethought.com/blog/?feed=rss2&#038;p=261</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Seconds, Minutes, Hours &#8211; Converting Time Units in Ruby</title>
		<link>http://codethought.com/blog/?p=248&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=seconds-minutes-hours-converting-time-units-in-ruby</link>
		<comments>http://codethought.com/blog/?p=248#comments</comments>
		<pubDate>Wed, 27 Jan 2010 17:40:14 +0000</pubDate>
		<dc:creator>codethought</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://codethought.com/blog/?p=248</guid>
		<description><![CDATA[I&#8217;m sure you&#8217;ve probably seen this question in your programming classes.. I decided I wanted to play with Ruby again and was remind of this problem, so thought it might be fun as a simple exercise to do this in Ruby. The problem is to take a long integer and convert it to hours, minutes [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure you&#8217;ve probably seen this question in your programming classes.. I decided I wanted to play with Ruby again and was remind of this problem, so thought it might be fun as a simple exercise to do this in Ruby.</p>
<p>The problem is to take a long integer and convert it to hours, minutes and seconds.  This is a common issue in games, for example, where a countdown timer is represent internally in seconds. But players don&#8217;t want to <strong>see</strong> some huge number like 43678 seconds.  They&#8217;d <strong>rather</strong> see 12:07:58 for hours, minutes and seconds.  A couple of uses of the mod operator, and a couple of uses of the built-in formatter and you&#8217;re good to go.</p>
<p>
<strong>Update:</strong> I wanted to clean up the code a bit more and put the ruby equivalent of a &#8220;main&#8221; via the <code>__FILE__</code> check.  This way you can just reuse the code via require if you so desire.</p>
<pre><span class="comment">#!/usr/bin/env ruby</span>

<span class="keyword">class </span><span class="class">TimeFormatter</span>

  <span class="keyword">def </span><span class="method">format_time</span> <span class="punct">(</span><span class="ident">timeElapsed</span><span class="punct">)</span>

    <span class="attribute">@timeElapsed</span> <span class="punct">=</span> <span class="ident">timeElapsed</span>

    <span class="comment">#find the seconds</span>
    <span class="ident">seconds</span> <span class="punct">=</span> <span class="attribute">@timeElapsed</span> <span class="punct">%</span> <span class="number">60</span>

    <span class="comment">#find the minutes</span>
    <span class="ident">minutes</span> <span class="punct">=</span> <span class="punct">(</span><span class="attribute">@timeElapsed</span> <span class="punct">/</span> <span class="number">60</span><span class="punct">)</span> <span class="punct">%</span> <span class="number">60</span>

    <span class="comment">#find the hours</span>
    <span class="ident">hours</span> <span class="punct">=</span> <span class="punct">(</span><span class="attribute">@timeElapsed</span><span class="punct">/</span><span class="number">3600</span><span class="punct">)</span>

    <span class="comment">#format the time</span>

    <span class="keyword">return</span> <span class="ident">hours</span><span class="punct">.</span><span class="ident">to_s</span> <span class="punct">+</span> <span class="punct">&quot;</span><span class="string">:</span><span class="punct">&quot;</span> <span class="punct">+</span> <span class="ident">format</span><span class="punct">(&quot;</span><span class="string">%02d</span><span class="punct">&quot;,</span><span class="ident">minutes</span><span class="punct">.</span><span class="ident">to_s</span><span class="punct">)</span> <span class="punct">+</span> <span class="punct">&quot;</span><span class="string">:</span><span class="punct">&quot;</span> <span class="punct">+</span> <span class="ident">format</span><span class="punct">(&quot;</span><span class="string">%02d</span><span class="punct">&quot;,</span><span class="ident">seconds</span><span class="punct">.</span><span class="ident">to_s</span><span class="punct">)</span>
  <span class="keyword">end</span>
<span class="keyword">end</span>

<span class="keyword">if</span> <span class="constant">__FILE__</span> <span class="punct">==</span> <span class="global">$0</span>
  <span class="ident">formatter</span> <span class="punct">=</span> <span class="constant">TimeFormatter</span><span class="punct">.</span><span class="ident">new</span>

  <span class="ident">puts</span> <span class="ident">formatter</span><span class="punct">.</span><span class="ident">format_time</span><span class="punct">(</span><span class="number">43678</span><span class="punct">)</span>
<span class="keyword">end</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://codethought.com/blog/?feed=rss2&#038;p=248</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>require: command not found in ruby</title>
		<link>http://codethought.com/blog/?p=246&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=require-command-not-found-in-ruby</link>
		<comments>http://codethought.com/blog/?p=246#comments</comments>
		<pubDate>Wed, 27 Jan 2010 17:09:15 +0000</pubDate>
		<dc:creator>codethought</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://codethought.com/blog/?p=246</guid>
		<description><![CDATA[While I was getting some old Ruby code of mine out to convert ruby code to pretty HTML-formatted code suitable for blogging from Wolfman&#8217;s Howlings I got the following error: $ ./ruby2html.rb ./ruby2html.rb: line 9: require: command not found ./ruby2html.rb: line 10: require: command not found ./ruby2html.rb: line 11: require: command not found ./ruby2html.rb: line [...]]]></description>
			<content:encoded><![CDATA[<p>While I was getting some old Ruby code of mine out to convert ruby code to pretty HTML-formatted code suitable for blogging from <a href="http://blog.wolfman.com/articles/2006/05/26/howto-format-ruby-code-for-blogs">Wolfman&#8217;s Howlings</a>  I got the following error:</p>
<pre>
$ ./ruby2html.rb
./ruby2html.rb: line 9: require: command not found
./ruby2html.rb: line 10: require: command not found
./ruby2html.rb: line 11: require: command not found
./ruby2html.rb: line 14: syntax error near unexpected token `('
./ruby2html.rb: line 14: `    code= File.read(ARGV[0])'
</pre>
<p>Never saw this problem before, but obviously it was frustrating.  </p>
<p>What had happened was I hadn’t deleted the tab spaces before the <code>#!/usr/bin/env ruby line.</code></p>
<p>Apparently if there is any white space before the #!/usr/bin/env ruby the script will not run.</p>
<p>Swell.. <img src='http://codethought.com/blog/wp-includes/images/smilies/icon_neutral.gif' alt=':|' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://codethought.com/blog/?feed=rss2&#038;p=246</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To: Apple Boot Camp 64-bit for Windows 7 on &#8220;unsupported&#8221; Macs</title>
		<link>http://codethought.com/blog/?p=244&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-apple-boot-camp-64-bit-for-windows-7-on-%25e2%2580%259cunsupported%25e2%2580%259d-macs</link>
		<comments>http://codethought.com/blog/?p=244#comments</comments>
		<pubDate>Mon, 25 Jan 2010 05:07:17 +0000</pubDate>
		<dc:creator>codethought</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[2007 mac]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[windows 7]]></category>

		<guid isPermaLink="false">http://codethought.com/blog/?p=244</guid>
		<description><![CDATA[Do you own a Macbook Air or other modern Apple and want to install and use Windows 7 ala Boot Camp? If so, you may have encountered the dreaded &#8220;Boot Camp x64 is unsupported on this computer model&#8221; error dialog when trying to run the provided Snow Leopard Bood Camp setup.exe. Techulous has documented the [...]]]></description>
			<content:encoded><![CDATA[<p>Do you own a Macbook Air or other modern Apple and want to install and use Windows 7 ala Boot Camp? If so, you may have encountered the dreaded &#8220;Boot Camp x64 is unsupported on this computer model&#8221; error dialog when trying to run the provided Snow Leopard Bood Camp setup.exe.  Techulous has documented the workaround:</p>
<p><a href="http://www.techulous.com/hardware/how-to-apple-boot-camp-64-bit-for-windows-7-on-unsupported-macs.html">http://www.techulous.com/hardware/how-to-apple-boot-camp-64-bit-for-windows-7-on-unsupported-macs.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://codethought.com/blog/?feed=rss2&#038;p=244</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding the Android Dev Phone 1 ROM Images</title>
		<link>http://codethought.com/blog/?p=241&#038;utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=finding-the-android-dev-phone-1-rom-images</link>
		<comments>http://codethought.com/blog/?p=241#comments</comments>
		<pubDate>Mon, 21 Dec 2009 16:36:36 +0000</pubDate>
		<dc:creator>codethought</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[android dev phone]]></category>
		<category><![CDATA[htc]]></category>

		<guid isPermaLink="false">http://codethought.com/blog/?p=241</guid>
		<description><![CDATA[For some reason the ROM Images for the Android Dev Phone 1 have the links missing from the main ADP-1 download site. When you go to http://developer.htc.com/adp.html You&#8217;re greeted with a table of ROM images and file names but the links have been removed: (You can click on the image to see the full-size version [...]]]></description>
			<content:encoded><![CDATA[<p>For some reason the ROM Images for the Android Dev Phone 1 have the links missing from the main ADP-1 download site.  When you go to <a href="http://developer.htc.com/adp.html">http://developer.htc.com/adp.html</a>  You&#8217;re greeted with a table of ROM images and file names but the links have been removed:</p>
<p><a href="http://codethought.com/blog/wp-content/uploads/2009/12/FirefoxScreenSnapz010.jpg"><img src="http://codethought.com/blog/wp-content/uploads/2009/12/FirefoxScreenSnapz010.jpg" alt="FirefoxScreenSnapz010.jpg" border="0" width="65%"  /></a><br />
<br />
<em>(You can click on the image to see the full-size version of the table.)</em></p>
<p>After some digging around I found that someone on the Android Developer List has found that the files are still on the website, only the links to them have been removed from the ADP-1 page.  Creating the URL links are simple enough.  You just start them with <code>http://member.america.htc.com/download/RomCode/ADP</code> and send with the file you want (i.e. <code>ota-radio-2_22_19_26I.zip</code>) The challenge here is that you cannot access those files directly, you have to be re-directed from <code>http://developer.htc.com</code>.  If you&#8217;re a Linux or Mac user, this is solved with a simple shell script and the <code>wget</code> command.  Modify the script for the ROM images that you want to download and you&#8217;re in business.</p>
<pre>
#!/bin/sh
IDIOTS1="http://developer.htc.com"
IDIOTS2="http://member.america.htc.com/download/RomCode/ADP"
wget "--referer=$IDIOTS1" "$IDIOTS2/ota-radio-2_22_19_26I.zip"
wget "--referer=$IDIOTS1" "$IDIOTS2/signed-dream_devphone_userdebug-img-14721.zip"
wget "--referer=$IDIOTS1" "$IDIOTS2/signed-dream_devphone_userdebug-ota-14721.zip"
</pre>
<p>If you&#8217;re a Windows user, you can accomplish the same thing if you have Cygwin installed: <a href="http://www.cygwin.com/">http://www.cygwin.com/</a></p>
<p><cite><br />
The script source for fetching the ROMs came from  <a href="http://groups.google.com/group/android-developers/browse_thread/thread/e894abe86a7827ac/41924a468596ff70?hl=en&#038;lnk=gst#41924a468596ff70">this discussion at The Android Developer mailing list.</a>  Thanks to Noah Tilton.<br />
</cite></p>
]]></content:encoded>
			<wfw:commentRss>http://codethought.com/blog/?feed=rss2&#038;p=241</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

