<?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>Chad Sturtz</title>
	<atom:link href="http://chadsturtz.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://chadsturtz.com</link>
	<description>A Journey Through Software</description>
	<lastBuildDate>Thu, 04 Mar 2010 21:37:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Joda Time: Find the amount of time between two dates</title>
		<link>http://chadsturtz.com/2010/03/joda-time-find-the-amount-of-time-between-two-dates/</link>
		<comments>http://chadsturtz.com/2010/03/joda-time-find-the-amount-of-time-between-two-dates/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 21:37:30 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://chadsturtz.com/?p=75</guid>
		<description><![CDATA[A Joda Time example for finding the difference in time between two dates.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fchadsturtz.com%2F2010%2F03%2Fjoda-time-find-the-amount-of-time-between-two-dates%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fchadsturtz.com%2F2010%2F03%2Fjoda-time-find-the-amount-of-time-between-two-dates%2F" height="61" width="51" /></a></div><p><a href="http://today.java.net/pub/a/today/2008/09/18/jsr-310-new-java-date-time-api.html">Joda Time</a> is a Date/Time API proposed for Java SE 7.  Below, I have a Groovy script that uses the 1.6 Joda Time library to find the difference between two dates.</p>
<pre>
 import org.joda.time.*
    ...
 def i = new Interval(startDate.getTime(),endDate.getTime())
 def p = i.toPeriod()

 println "Time Difference: " + p.getSeconds() + "." + p.getMillis() + " Seconds"</pre>
<p><br/><br />
In addition to Seconds and Milliseconds, you can get the number of Days, Hours, Minutes, Months, Weeks, and Years.</p>
]]></content:encoded>
			<wfw:commentRss>http://chadsturtz.com/2010/03/joda-time-find-the-amount-of-time-between-two-dates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic MSI Project: Setup.exe Custom Command-Line Arguments</title>
		<link>http://chadsturtz.com/2010/02/basic-msi-project-setup-exe-custom-command-line-arguments/</link>
		<comments>http://chadsturtz.com/2010/02/basic-msi-project-setup-exe-custom-command-line-arguments/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 19:28:18 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[InstallShield]]></category>

		<guid isPermaLink="false">http://chadsturtz.com/?p=53</guid>
		<description><![CDATA[This one eluded me for way too long considering how straight-forward it is.  So, in an effort to help others who may have the same question, I thought I&#8217;d write it down..
Problem: For a Basic MSI Project in InstallShield 2009, I need to pass in 1 or more custom command-line arguments to use during installation/un-installation/etc.

Step [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fchadsturtz.com%2F2010%2F02%2Fbasic-msi-project-setup-exe-custom-command-line-arguments%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fchadsturtz.com%2F2010%2F02%2Fbasic-msi-project-setup-exe-custom-command-line-arguments%2F" height="61" width="51" /></a></div><p>This one eluded me for way too long considering how straight-forward it is.  So, in an effort to help others who may have the same question, I thought I&#8217;d write it down..</p>
<p><strong>Problem:</strong> For a Basic MSI Project in InstallShield 2009, I need to pass in 1 or more custom command-line arguments to use during installation/un-installation/etc.<br />
<br/><br/><br />
<h2><strong>Step 1 &#8211; Accessing your custom command-line arguments</strong></h2>
<p>First, accessing these values are as easy as accessing other variables in InstallShield.  All you need to do is use the format [MYARGUMENTNAME].  So, for example, if you want to use one of the arguments when invoking an executable from a custom action, it may look like this image below.  My custom action is invoking an executable called <strong>myapp.exe</strong> and I am accessing a custom command line argument named <strong>FILENAME</strong> to use as part of the invocation of my executable.</p>
<p><img class="size-full wp-image-54 alignnone" title="example1" src="http://chadsturtz.com/wp-content/uploads/2010/02/example1.PNG" alt="example1" width="786" height="405" /><br />
<br/><br/><br />
<h2><strong>Step 2 &#8211; Passing in your custom command-line arguments</strong></h2>
<p>It&#8217;s really this simple.. each argument needs to be preceeded by a /v and wrapped in quotes.  Continuing the example above, here is how I pass in my custom command line argument named FILENAME:</p>
<pre>     <em>setup.exe /v"FILENAME=\"myfile.txt\""
</em></pre>
<p><em> </em></p>
<p>This would result in my custom action invoking my executable as follows:   <em>myapp.exe -f myfile.txt</em></p>
<p>To be clear on multiple custom command-line arguments, the following example adds a second argument to my example above:</p>
<pre>     <em>setup.exe /v"FILENAME=\"myfile.txt\"" /vSECONDARGUMENT=\"value2\""
</em></pre>
<p><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://chadsturtz.com/2010/02/basic-msi-project-setup-exe-custom-command-line-arguments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My 10 Favorite Android Apps</title>
		<link>http://chadsturtz.com/2010/01/my-10-favorite-android-apps/</link>
		<comments>http://chadsturtz.com/2010/01/my-10-favorite-android-apps/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 14:55:08 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://chadsturtz.com/?p=46</guid>
		<description><![CDATA[I&#8217;ve had my new phone for a week.. a Motorola Droid. Without including any games, here are my top 10 favorite apps so far.  I&#8217;m curious how this list will change over the coming months.
1. Google Maps Navigation &#8211; This is the free app from Google that transforms your phone into a mobile GPS Navigation unit.
2. Seesmic [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fchadsturtz.com%2F2010%2F01%2Fmy-10-favorite-android-apps%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fchadsturtz.com%2F2010%2F01%2Fmy-10-favorite-android-apps%2F" height="61" width="51" /></a></div><p>I&#8217;ve had my new phone for a week.. a Motorola Droid. Without including any games, here are my top 10 favorite apps so far.  I&#8217;m curious how this list will change over the coming months.</p>
<p>1. <strong>Google Maps Navigation</strong> &#8211; This is the free app from Google that transforms your phone into a mobile GPS Navigation unit.</p>
<p>2. <strong>Seesmic</strong> &#8211; Twitter client</p>
<p>3. <strong>GMail</strong> &#8211; Do i have to spell it out?</p>
<p>4. <strong>Pandora</strong> &#8211; Music, like last.fm, but much better.</p>
<p>5. <strong>Facebook</strong> for Android</p>
<p>6. <strong>Flashlight</strong> &#8211; I have the version that just turns your screen bright white.. not the version that uses the phone&#8217;s camera&#8217;s LED flash bulbs.</p>
<p>7. <strong>Calendar</strong> &#8211; Syncs to your Google calendar.</p>
<p>8. <strong>FourSquare</strong> &#8211; Location based social application, allowing you to &#8216;check-in&#8217; at venues.</p>
<p>9. <strong>WorldTour</strong> &#8211; Retrieves images to be used as your wallpaper from all over the world.  Can be set up to randomly change every 30 minutes, or choose a static site.</p>
<p>10. <strong>Yammer</strong> &#8211; A client for Yammer (much like Twitter except for internal corporate use).</p>
]]></content:encoded>
			<wfw:commentRss>http://chadsturtz.com/2010/01/my-10-favorite-android-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replacing new with a Transparent Factory</title>
		<link>http://chadsturtz.com/2009/12/replacing-new-with-a-transparent-factory/</link>
		<comments>http://chadsturtz.com/2009/12/replacing-new-with-a-transparent-factory/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 17:31:42 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[Groovy]]></category>

		<guid isPermaLink="false">http://chadsturtz.com/?p=33</guid>
		<description><![CDATA[Overriding getAt and using a Transparent Factory to create the feeling of instantiation of an Interface or Abstract Class]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fchadsturtz.com%2F2009%2F12%2Freplacing-new-with-a-transparent-factory%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fchadsturtz.com%2F2009%2F12%2Freplacing-new-with-a-transparent-factory%2F" height="61" width="51" /></a></div><p>A little while back, I decided I would try and come up with some fun things to try and accomplish in Groovy and blog about them.  The primary goal being to learn more about the Groovy language.</p>
<p>The adventure I chose for this post was to somehow make the use of a Factory transparent by allowing what appeared to be the instantiation of an Interface or Abstract Class.  I looked for ways to override the new keyword so that when new was used with an Interface or Abstract Class, it would call a factory behind the scenes.  I figured out that I could not override the new keyword, but ended up finding <a href="http://groovyconsole.appspot.com/script/49002">this</a> example of overriding the getAt method as a way of constructing an object.  I thought this was very innovative and it be best to use this approach for the task at hand.</p>
<p>In this code segment, you can see I have an interface <em>Animal</em>, two implementations, <em>Dog</em> and <em>Cat</em>, along with a factory <em>AnimalFactory</em>.  Now, the factory here is not very useful.  It simply calls the first constructor of the Class passed in as a parameter to its only method, <em>create()</em>.  However, the focus in this post is how we can transparently use a factory, not the logic used by the factory itself.</p>
<pre>    interface Animal {
     def talk();
    }

    class Dog implements Animal {
     def talk() {"bark"}
    }

    class Cat implements Animal {
     def talk() {"meow"}
    }

    class AnimalFactory {
     static Object create(Class c) {
      c.getConstructors()[0].newInstance()
     }
    }</pre>
<p><br/><br />
This following segment is where the magic happens.  First, I&#8217;m creating a static method on all classes called <em>registerFactory()</em> that allows us to register a factory with an Interface or Abstract class.  The second thing i&#8217;m doing is what you saw in the example I linked to above by <a href="http://groovyconsole.appspot.com/author/Alex%20Tkachman">Alex Tkachman</a>, where we override the static getAt method, allowing us to use square brackets for object instantiation.</p>
<pre>    Class.metaClass.static.registerFactory = { clazz -&gt;
     delegate.metaClass.static.getClassFactory = { -&gt; clazz}
    }
    Class.metaClass.static.getAt = { c -&gt; delegate.classFactory.create(c)}</pre>
<p><br/><br />
Now, you can see an example of using the registerFactory() method and instantiating an object through the getAt method on an interface.</p>
<pre>    Animal.registerFactory(AnimalFactory)

    def c = Animal[Cat]
    c.talk()</pre>
<p><br/><br />
Finally, the output from this previous segment is shown below.</p>
<pre>    Result: meow</pre>
<p><br/><br />
I thought about taking this post even further and making the factory more useful by trying out some dynamic constructor invocation based on the arguments passed in through the square brackets, but I think I&#8217;ll save that for later.  For now, I hope you can see past my useless factory implementation.</p>
]]></content:encoded>
			<wfw:commentRss>http://chadsturtz.com/2009/12/replacing-new-with-a-transparent-factory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Groovy Applied: findAll</title>
		<link>http://chadsturtz.com/2009/12/groovy-applied-findall/</link>
		<comments>http://chadsturtz.com/2009/12/groovy-applied-findall/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 14:00:45 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[Groovy]]></category>

		<guid isPermaLink="false">http://chadsturtz.com/?p=16</guid>
		<description><![CDATA[An example of using findAll to match items in separate lists]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fchadsturtz.com%2F2009%2F12%2Fgroovy-applied-findall%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fchadsturtz.com%2F2009%2F12%2Fgroovy-applied-findall%2F" height="61" width="51" /></a></div><p>Use findAll to match items in separate lists.</p>
<p><strong>Problem: </strong>Given a list of employee names and a list of employee objects, find the id of each employee whose name is in the list.</p>
<p><strong>Provided:</strong></p>
<pre style="padding-left: 30px;">def namesList = ["Joe","Jane"]</pre>
<pre style="padding-left: 30px;">class Student {def name; def id}
def students = [
    new Student([name:"Joe",id:101]),
    new Student([name:"Fred",id:102]),
    new Student([name:"Jane",id:104])
    ]</pre>
<p><nbsp/><br />
<strong>Solution:</strong></p>
<pre style="padding-left: 30px;">students.findAll {
    namesList.contains(it.name)
}.id</pre>
<p><nbsp/><br />
<strong>Output:<br />
</strong></p>
<pre style="padding-left: 30px;">[101,104]</pre>
<p><nbsp/><br />
<nbsp/><br />
<nbsp/></p>
]]></content:encoded>
			<wfw:commentRss>http://chadsturtz.com/2009/12/groovy-applied-findall/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Problem Solvers</title>
		<link>http://chadsturtz.com/2009/11/problem-solvers/</link>
		<comments>http://chadsturtz.com/2009/11/problem-solvers/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 20:47:19 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[People]]></category>

		<guid isPermaLink="false">http://chadsturtz.com/?p=8</guid>
		<description><![CDATA[Over the past 5 years, I&#8217;ve had the opportunity to work with many people who were very knowledgeable in many different areas.  However, one thing I&#8217;ve come to realize all too often is that when it comes to solving difficult problems, knowledge is, at most, half the battle.  Time and time again I have seen people [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fchadsturtz.com%2F2009%2F11%2Fproblem-solvers%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fchadsturtz.com%2F2009%2F11%2Fproblem-solvers%2F" height="61" width="51" /></a></div><p>Over the past 5 years, I&#8217;ve had the opportunity to work with many people who were very knowledgeable in many different areas.  However, one thing I&#8217;ve come to realize all too often is that when it comes to solving difficult problems, knowledge is, at most, half the battle.  Time and time again I have seen people struggle at solving a problem they did not immediately know the answer to.  Without a suite of problem solving skills, the value of their knowledge of the problem domain quickly diminishes.  These are the times when the Problem Solvers step in and get the job done.</p>
<p>So, who are the real problem solvers?</p>
<p><strong>Visionaries &#8211; </strong>The greatest Problem Solvers can very quickly identify a clear path to success.  From this vision they are able to generate a plan of attack that will strategically expose the root problem and find the correct solution(s).</p>
<p><strong>Leaders &#8211; </strong>As a leader, the Problem Solver is able to coordinate the effort.  They break the the plan of attack down into individual tasks that can be executed in parallel by the resources at hand.</p>
<p><strong>Enablers &#8211; </strong>Possibly the most important skill a Problem Solver has is the ability to remove roadblocks or find alternative paths.  The key to solving a problem quickly is to never stop.  The Problem Solver recognizes this and focuses on getting himself/herself and others whatever it is they need to identify and fix the issue.</p>
<p><strong>Communicators &#8211; </strong>Solving problems requires that the right people have the right information.  The Problem Solver is able to recognize important data and ensure that the information is shared.  Furthermore, they identify all available communication channels and use them effectively.</p>
<p><strong>Adaptive -</strong> The Problem Solver knows that any new discovery can change everything.  At a moment&#8217;s notice, they are able to shift resources, open new communication channels, and devise an entirely new plan of attack.</p>
]]></content:encoded>
			<wfw:commentRss>http://chadsturtz.com/2009/11/problem-solvers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome</title>
		<link>http://chadsturtz.com/2009/11/welcome/</link>
		<comments>http://chadsturtz.com/2009/11/welcome/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 15:33:30 +0000</pubDate>
		<dc:creator>Chad</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://chadsturtz.com/?p=6</guid>
		<description><![CDATA[About a year ago, I stopped blogging publicly.  It really just came down to a change in priorities for a while.  However, I&#8217;m back and excited to get going again.  This site is very likely to change over the next little while.  I just picked the first decent theme I could find to get things [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fchadsturtz.com%2F2009%2F11%2Fwelcome%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fchadsturtz.com%2F2009%2F11%2Fwelcome%2F" height="61" width="51" /></a></div><p>About a year ago, I stopped blogging publicly.  It really just came down to a change in priorities for a while.  However, I&#8217;m back and excited to get going again.  This site is very likely to change over the next little while.  I just picked the first decent theme I could find to get things up going.</p>
<p>Anyway&#8230; welcome and hopefully you find something I write to be educational, thought provoking or entertaining.</p>
<p>-Chad</p>
]]></content:encoded>
			<wfw:commentRss>http://chadsturtz.com/2009/11/welcome/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
