<?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>Jacob Repp &#187; programming</title>
	<atom:link href="http://jrepp.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://jrepp.com</link>
	<description>Game programming, music and life</description>
	<lastBuildDate>Fri, 16 Dec 2011 06:03:01 +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>Select a Single Item in a List View Control</title>
		<link>http://jrepp.com/2009/07/31/select-a-single-item-in-a-list-view-control/</link>
		<comments>http://jrepp.com/2009/07/31/select-a-single-item-in-a-list-view-control/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 18:43:20 +0000</pubDate>
		<dc:creator>proj</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://jrepp.com/2009/07/31/select-a-single-item-in-a-list-view-control/</guid>
		<description><![CDATA[This simple operation took me longer to figure out than I would like, the answer wasn&#8217;t obvious on msdn or in any of the searches I did so I figure I should just put it up here for anyone else &#8230; <a href="http://jrepp.com/2009/07/31/select-a-single-item-in-a-list-view-control/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This simple operation took me longer to figure out than I would like, the answer wasn&#8217;t obvious on msdn or in any of the searches I did so I figure I should just put it up here for anyone else who might look for it:</p>

<p>To select an item in a list view create an LVITEM structure, change a few of it&#8217;s fields and pass it to LVM_SETITEMSTATE:</p>

<pre><code>// Select current item in the list
LVITEM item = {0};
item.mask = LVIF_STATE;
item.state = item.stateMask = LVIS_SELECTED;
SendMessage(mhProductList, LVM_SETITEMSTATE, mCurrentSettings, (LPARAM)&amp;item);
</code></pre>

<p>Oh and if you&#8217;re trying to turn on whole line section you&#8217;ll need to use the extended styles:</p>

<pre><code>// Set extended styles
SendMessage(hWndListView, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://jrepp.com/2009/07/31/select-a-single-item-in-a-list-view-control/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tracking down Circular Dependencies in Static Libraries</title>
		<link>http://jrepp.com/2009/06/26/tracking-down-circular-dependencies-in-static-libraries/</link>
		<comments>http://jrepp.com/2009/06/26/tracking-down-circular-dependencies-in-static-libraries/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 23:18:51 +0000</pubDate>
		<dc:creator>proj</dc:creator>
				<category><![CDATA[linking]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://jrepp.com/2009/06/26/tracking-down-circular-dependencies-in-static-libraries/</guid>
		<description><![CDATA[The GNU linker has some trouble when you present it with multiple library archives that depend upon each other. Libraries with symbols resolved in other libraries must be presented earlier on the command line. You can work around this with &#8230; <a href="http://jrepp.com/2009/06/26/tracking-down-circular-dependencies-in-static-libraries/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The GNU linker has some trouble when you present it with multiple library archives that depend upon each other. Libraries with symbols resolved in other libraries must be presented earlier on the command line. You can work around this with a command line argument:</p>

<pre><code>"--start-group", "--end-group", aternatively "-(" "-)"
</code></pre>

<p><a href="http://linux.die.net/man/1/ld">See the man page for LD for more info</a></p>

<p>Unfortunately this argument comes with the following little warning:</p>

<blockquote>
  <p>Using this option has a significant performance cost. It is best to use it only when there are unavoidable circular references between two or more archives. </p>
</blockquote>

<p>The particular case I was dealing with was the havok version 6 libraries on linux. I was advised that there may be way to link them but hadn&#8217;t been worked out. In order to test this theory I hacked together a little bit of ruby to show library dependencies. I feel this may be of some use to someone else so I present it here:</p>

<pre><code>require 'find'

$symbs = {}
$archives = []

class Archive
    attr_reader :name, :symbs, :depends, :undef
    def initialize name
        @name = name
        @symbs = {}
        @undef = {}
        @depends = Hash.new(0)
    end

    def add_definition loc, name
        @symbs[name] = loc
        $symbs[name] = self
    end

    def add_undefined name
    @undef[name] = 0
    end

    def resolve_undefined
        @undef.each do |k,v|
            archive = $symbs[k]
           if not archive or archive == self then
                next
            end
            @undef[k] = archive
            @depends[archive] = @depends[archive] + 1
        end
    end
end

Find.find('.') do |path|
    next if not /.a$/.match(path)

    io = IO.popen("nm #{path}")
    archive = Archive.new(path)
    $archives &lt;&lt; archive
    while (str = io.gets) do
        case str
        when /\w+\.a/
            archive = Archive.new(str)
            puts "archive: #{str}"
        when /[A-F0-9]+ [A-Za-z] \w+/
            parts = str.split
            archive.add_definition parts[0], parts[2]
        when /\s+U\s+\w+/
            archive.add_undefined str.split[1]
        end
   end
   puts "processed #{path}, #{archive.symbs.count} defined, #{archive.undef.count} undefined"
end

$archives.each do |archive|
    archive.resolve_undefined
end

$archives.sort! {|a,b| a.depends.count &lt;=&gt; b.depends.count }

puts "dependency list:"
$archives.each do |archive|
    puts "#{archive.name}: #{archive.depends.count}"
    archive.depends.each do |depend,count|
        puts "    #{depend.name}: #{count}"
    end
end
</code></pre>

<p>The final solution was to simply remove the object files from the static libraries and put them into a single combined library:</p>

<pre><code>rm *.o
find . -name \*.a -exec ar x {} \;
ar rcs libHavok.a *.o
ranlib libHavok.a
rm *.o
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://jrepp.com/2009/06/26/tracking-down-circular-dependencies-in-static-libraries/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tell, Don&#8217;t Ask</title>
		<link>http://jrepp.com/2008/04/24/tell-dont-ask/</link>
		<comments>http://jrepp.com/2008/04/24/tell-dont-ask/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 02:46:37 +0000</pubDate>
		<dc:creator>proj</dc:creator>
				<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://jrepp.com/2008/04/24/tell-dont-ask/</guid>
		<description><![CDATA[The post over at pragmatic programmer is timely for me because Tell, Don&#8217;t Ask is a concept that I have outlined in a programming style presentation for my new team. The quote at the beginning of the article is perfect: &#8230; <a href="http://jrepp.com/2008/04/24/tell-dont-ask/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The post over at pragmatic programmer is timely for me because <a href="http://pragmaticprogrammer.com/articles/tell-dont-ask">Tell, Don&#8217;t Ask</a> is a concept that I have outlined in a programming style presentation for my new team. </p>

<p>The quote at the beginning of the article is perfect:</p>

<pre><code>     Procedural code gets information then makes decisions. Object-oriented code tells objects to do things.
     â€” Alec Sharp 
</code></pre>

<p>This is a great example of taking a complex concept and boiling it down to one phrase. That is something that I try to do as much as possible. It forms a great foundation for effective communication.</p>
]]></content:encoded>
			<wfw:commentRss>http://jrepp.com/2008/04/24/tell-dont-ask/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Impromtu has my head spinning</title>
		<link>http://jrepp.com/2008/04/19/impromtu-has-my-head-spinning/</link>
		<comments>http://jrepp.com/2008/04/19/impromtu-has-my-head-spinning/#comments</comments>
		<pubDate>Sat, 19 Apr 2008 03:41:01 +0000</pubDate>
		<dc:creator>proj</dc:creator>
				<category><![CDATA[music]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://jrepp.com/2008/04/19/impromtu-has-my-head-spinning/</guid>
		<description><![CDATA[This is very much what I have been dreaming of having rubycube accomplish. A very slick presentation.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.synthtopia.com/content/2007/11/26/check-out-this-amazing-demo-of-impromptu-for-os-x/">This is very much what I have been dreaming of</a> having rubycube accomplish. A very slick presentation.</p>
]]></content:encoded>
			<wfw:commentRss>http://jrepp.com/2008/04/19/impromtu-has-my-head-spinning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Read this Paper if you use Make</title>
		<link>http://jrepp.com/2008/04/18/read-this-paper-if-you-use-make/</link>
		<comments>http://jrepp.com/2008/04/18/read-this-paper-if-you-use-make/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 05:56:33 +0000</pubDate>
		<dc:creator>proj</dc:creator>
				<category><![CDATA[build]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://jrepp.com/2008/04/18/read-this-paper-if-you-use-make/</guid>
		<description><![CDATA[I investigated make, cmake, cook, jam, bjam, ftjam, scons, cons, rake, ant. What I come to find is this wonderful little paper that turns my out-moded ideas about make completely on it&#8217;s head. I wrote a wonderful beginnings of a &#8230; <a href="http://jrepp.com/2008/04/18/read-this-paper-if-you-use-make/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I investigated make, cmake, cook, jam, bjam, ftjam, scons, cons, rake, ant. What I come to find is this wonderful little paper that turns my out-moded ideas about make completely on it&#8217;s head. I wrote a wonderful beginnings of a new build system using 300 lines of Make and 100 lines of bourne shell. Shane dubs it &#8216;Wookie&#8217;.</p>

<p><a href='http://jrepp.com/wp-content/uploads/2008/04/snowy-wookie.jpg' title='snowy-wookie.jpg'><img src='http://jrepp.com/wp-content/uploads/2008/04/snowy-wookie.jpg' alt='snowy-wookie.jpg' /></a></p>

<p><a href="http://aegis.sourceforge.net/auug97.pdf">Recursive Make Considered Harmful</a>
<a href="http://www.google.com/url?sa=t&amp;ct=html&amp;cd=2&amp;url=http%3A%2F%2F64.233.167.104%2Fsearch%3Fq%3Dcache%3AHwuX7YF2uBIJ%3Aaegis.sourceforge.net%2Fauug97.pdf%2Brecursive%2Bmake%2Bconsidered%2Bharmful%26hl%3Den%26ct%3Dclnk%26cd%3D2%26gl%3Dus%26client%3Dfirefox-a&amp;ei=YMQHSKGkKoOqigG50r2CDA&amp;usg=AFQjCNGI8q1UKQjhMOQXlGHNWnLU7Y6akA&amp;sig2=tRHcjwAPWDpAueSF0-6fmg">Google HTMLized Version</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jrepp.com/2008/04/18/read-this-paper-if-you-use-make/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Best Way to Learn &#8211; Use the Source</title>
		<link>http://jrepp.com/2007/12/06/the-best-way-to-learn-use-the-source/</link>
		<comments>http://jrepp.com/2007/12/06/the-best-way-to-learn-use-the-source/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 03:27:18 +0000</pubDate>
		<dc:creator>proj</dc:creator>
				<category><![CDATA[lisp]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://jrepp.com/2007/12/06/the-best-way-to-learn-use-the-source/</guid>
		<description><![CDATA[Once again I have found the best way to learn is to go to the source. If you really want to learn something you have to find dig into the implementation, read the classics and seek out the originators. In &#8230; <a href="http://jrepp.com/2007/12/06/the-best-way-to-learn-use-the-source/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Once again I have found the best way to learn is to go to the source. If you really want to learn something you have to find dig into the implementation, read the classics and seek out the originators. In my quest to better understand the lisp I came across this <a href="http://c2.com/cgi/wiki?ImplementingLisp">C2 lisp resource</a> with tons of great info. I have spent a lot of time researching common lisp online and this is one of the best collections of info I have found.</p>

<p>Also the <a href="http://c2.com/cgi/wiki?ImplementingLispDiscussion">discussion page</a> is full of gems.</p>
]]></content:encoded>
			<wfw:commentRss>http://jrepp.com/2007/12/06/the-best-way-to-learn-use-the-source/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implementing a Finite State Machine with a Ruby Domain Specific Language</title>
		<link>http://jrepp.com/2007/08/14/implementing-a-finite-state-machine-with-a-ruby-domain-specific-language/</link>
		<comments>http://jrepp.com/2007/08/14/implementing-a-finite-state-machine-with-a-ruby-domain-specific-language/#comments</comments>
		<pubDate>Tue, 14 Aug 2007 09:12:21 +0000</pubDate>
		<dc:creator>proj</dc:creator>
				<category><![CDATA[austin]]></category>
		<category><![CDATA[game programming]]></category>
		<category><![CDATA[meetup]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://jrepp.com/2007/08/14/implementing-a-finite-state-machine-with-a-ruby-domain-specific-language/</guid>
		<description><![CDATA[DSL-FSM.. that kinda sounds like some wierd internet sub-culture. It stands for domain specific language &#8211; finite state machine. I proposed both topics as presentation material for the austin-ruby group that I meet with once a month. Steven Harms the &#8230; <a href="http://jrepp.com/2007/08/14/implementing-a-finite-state-machine-with-a-ruby-domain-specific-language/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>DSL-FSM.. that kinda sounds like some wierd internet sub-culture.  It stands for domain specific language &#8211; finite state machine. I proposed both topics as presentation material for the austin-ruby group that I meet with once a month. <a href="http://stevengharms.com">Steven Harms</a> the organizer recommended both/either so I combined it into one piece of code as it actually works pretty well that way.</p>

<p>The DSL that I&#8217;m using is pretty small right now, which lends itself to easier understanding and explanation.</p>

<p><a href="http://jrepp.com/code/rbfsm.tgz"> Ruby code tarball can be downloaded here. </a></p>

<p>A FSM is defined in a ruby script file without any class definition using the following rules:
<ol>
    <li>All attributes are specified in a method named &#8216;setup&#8217;. Setup takes an argument hash which may contain arguments that can be used to setup a FSM entity.</li>
    <li>All states are specified by defining top level methods with the name &#8216;while<em>&lt;statename&gt;&#8217;. These methods are called in a tick update while that state is active.</li>
    <li>All transitions are initiated by saying start :statename</li>
</ol>
For example the creature FSM is has a method:
<blockquote><strong>def while</em>idle</strong>
<blockquote><strong>target_nearest</strong></p>

<p><strong>start :chasing if @target</strong></blockquote>
<strong>end</strong></blockquote>
All FSM entity templates  can be loaded in the world using world.load(&#8216;template-name&#8217;). The world is currently driven by a simple script named &#8216;simulate.rb&#8217; which allows you to single step the world simulation and watch all the state machines make their choices. There are some debugging tools available. You can list all active entities and dump the world grid.</p>

<p>World#load uses the Object#instance_eval method to evaluate the contents of the FSM definition in terms of a FSM base instance. The FSM class defines some methods that can be called within the FSM definition to control state transitions and to access common methods.</p>

<p>Practically speak this is a very simple way to enable easy extension of a system. It provides an easier path to refactor the individual state machines and lowers the barrier to entry for writing state machine code. Additionally, it would be nice to include certain types of behavior from modules so that state machine authors could have easy access to some of the methods currently defined in creature FSM. This would include methods like target_nearest.Â  You could also mix in native C modules to get access to things like a path finding grid.</p>

<p>Ideas for playing with the code:
<ol>
    <li>Make creatures pick up the &#8216;ammo&#8217; entities</li>
    <li>Make creatures compete for the &#8216;fark&#8217; entities</li>
    <li>Add a new term to the FSM for state transitions. The method names should be named &#8216;when<em>changing</em>from<em>&lt;statename&gt;, when</em>changing<em>to</em>&lt;statename&gt;, when<em>changing</em>from<em>&lt;statename&gt;</em>to_&lt;statename&gt;&#8217; and should be executed when those state change patterns are matched.</li>
    <li>Allow entities to die</li>
</ol>
Some Notes:</p>

<p>A great article about some of the different types of DSL creation and the mindset from one of the coders at 37signals:</p>

<p><a href="http://weblog.jamisbuck.org/2006/4/20/writing-domain-specific-languages"> http://weblog.jamisbuck.org/2006/4/20/writing-domain-specific-languages</a></p>

<p>Careful of using missing_method, it bit me in the arse a number of times:</p>

<p><a href="http://redhanded.hobix.com/inspect/theBestOfMethod_missing.html"> http://redhanded.hobix.com/inspect/theBestOfMethod_missing.html</a></p>

<p>It&#8217;s really hard to track down bugs related to method<em>missing, any code you write inside an object implementing this needs to be carefully checked. It can also lead to blowing your stack when an error in method</em>missing recalls method_missing.. and on and on.</p>

<p>This little gem is nice to keep in your back pocket when trying to raise a descriptive exception:</p>

<p><a href="http://blog.nicksieger.com/articles/2006/09/06/rubys-exception-hierarchy"> http://blog.nicksieger.com/articles/2006/09/06/rubys-exception-hierarchy</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jrepp.com/2007/08/14/implementing-a-finite-state-machine-with-a-ruby-domain-specific-language/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Codified Thinking</title>
		<link>http://jrepp.com/2007/08/07/codified-thinking/</link>
		<comments>http://jrepp.com/2007/08/07/codified-thinking/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 21:01:50 +0000</pubDate>
		<dc:creator>proj</dc:creator>
				<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://jrepp.com/2007/08/07/codified-thinking/</guid>
		<description><![CDATA[There are many choices that must be made during the coding process and how we arrive at those choices is important and can influence our thinking and code quality a great deal. I try to make a concentrated effort to &#8230; <a href="http://jrepp.com/2007/08/07/codified-thinking/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are many choices that must be made during the coding process and how we arrive at those choices is important and can influence our thinking and code quality a great deal. I try to make a concentrated effort to put thought behind each of my choices and be able to explain them to myself at least and secondly to others. I keep a critical eye on my code and try my best to ask hard questions about the validity of choices in the code at all times. This kind of questioning attitude doesn&#8217;t fly well in certain circles but it&#8217;s how I was raised and I currently don&#8217;t have a good reason to turn away from it. I&#8217;m still working on how I go about communicating these ideas and encourage productive debate with others. That tends to be the most difficult part.</p>

<p>When I was first starting out in my career I relied a lot on the wisdom of my mentors and peers. This wasn&#8217;t a bad descision at all, learning by walking a path made by others is often the easiest way. There were certainly times when I went against the common wisdom and even if it was a dead-end, I still learned a great deal. As a newbie I spent a lot of time in &#8216;the shop&#8217; trying out one new idea after another. I quickly found that once the first summit is mounted things take on a different look and one must plan their own ascent carefully.</p>

<p>I&#8217;m writing this post because I&#8217;m tending to forget the why behind some of the choices that I&#8217;ve made over the years in style and approach that have become habit over the years. Even though I feel that I&#8217;m well into my ascent I still find myself revisiting choices and thinking, &#8216;now why do I do that?&#8217;.</p>

<p>One small thing that just caught my attention is my habit of starting method names with an upper-case. I usually tend to do this more frequently in true object-oriented languages, Java (alghough doing this breaks standard), C#, Ruby, Python and C++ (not even in the same class of OO-ness, still there it is).</p>

<p>The reason that I codified this personal standard is so that I would tend to think of methods more as first class citizens in the object space. When naming methods with a lowercase they tend to be thought of more as values, parts or fields. In fact they are much more, you can think of them as classes of your program space, passing them around, storing them and transmitting them and giving them a proper name more easily promotes the semantics of this type of coding in an environment where usually only classes are capitalized. This was an early descision I made not because of style but to form a habit of something which would form a useful mental model.</p>

<p>Another habit which is more of a constant discipline is minimalization of all code that I create. This has absolutely nothing to do with KLOC or anything silly of that nature, in fact it runs contrary to anyone brought up in that type of coding culture.</p>

<p>As you ascend higher, oxygen becomes more scarce and harder to breath. You will find that code takes on a life of it&#8217;s own, sometimes spending more energy is a less effecient way to treach the top.</p>

<p>The code must be minimally specified, it must do what it says and no more.  There are some general rules, avoid over branching, tend towards shorter code bodies. Whitespace and comments are more telling than the code they surround. On a larger scale prefer loose coupling and composition over strong interfaces and inheritance. Do not be scared of creating a small library. Prefer pull over push.</p>

<p>The last bit I wanted to write may be a bit controversial with some but I find that when presented two paths, one steep, rocky and trecherous and the other wide, mellow and gradual I always prefer the former. Personally in the long term I would rather look back on a lot of hard problems that were overcome it is much more satisfying for me personally and prepares me for even more technical challenges ahead.</p>
]]></content:encoded>
			<wfw:commentRss>http://jrepp.com/2007/08/07/codified-thinking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips for Getting in the Zone</title>
		<link>http://jrepp.com/2007/07/27/tips-for-getting-in-the-zone/</link>
		<comments>http://jrepp.com/2007/07/27/tips-for-getting-in-the-zone/#comments</comments>
		<pubDate>Fri, 27 Jul 2007 17:01:58 +0000</pubDate>
		<dc:creator>proj</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://jrepp.com/2007/07/27/tips-for-getting-in-the-zone/</guid>
		<description><![CDATA[Came across this post on programming.reddit.com today (the programming reddit has been one my guilty pleasures lately). The author has some good tips on staying in the zone. I have some tips of my own as I enjoy the feeling &#8230; <a href="http://jrepp.com/2007/07/27/tips-for-getting-in-the-zone/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Came across <a href="http://www.doolwind.com/blog/?p=65">this post</a> on <a href="http://programming.reddit.com">programming.reddit.com</a> today (the programming reddit has been one my guilty pleasures lately). The author has some good tips on staying in the zone. I have some tips of my own as I enjoy the feeling of being in the zone and lament when I&#8217;m not.</p>

<p>While it&#8217;s nice to get rid of distractions, block off big chunks of time and lay out large chunks of work here&#8217;s some tips that can help if you work on large teams and just can&#8217;t really get rid of all the interruptions.</p>

<p>Keep a pad of paper and pencil by your keyboard. Write your thoughts down and what you&#8217;re currently working on. Write down small ideas you have to fix up the code. When you sit down in the morning or interrupted look over your notes to get back on task. If you&#8217;re having trouble getting started on some code draw some pictures of what you&#8217;re trying to build.</p>

<p>Open your editor. Sometimes all that you need to get yourself started is to actually open the code and look at it. If you&#8217;re working on something new sometimes a blank screen in your favorite editor is enough to launch you.</p>

<p>Write unit tests. Unit tests are a great way to give yourself some small bite size piece of code to get the juices flowing. I can&#8217;t emphasise enough how good this is for your thought process. This is a way of kicking off the  little positive feedback loop that is instrumental in getting you in the zone. You can immediately transition into the code side with the right mindset and at the same time you&#8217;re reaping a huge net benefit to your code quality.</p>

<p>Lastly, take real breaks. That is breaks away from your office where you actually get your blood flowing to other parts of your body besides your brain. If you can do some pushups, do a brisk walk or engage in some other kind of physical activity for even 15 minutes you&#8217;ll find when you come back to your desk you&#8217;ll have a fresh perspective and you&#8217;ll feel much better. The endorphins you get from physical activity are great creativity boosters.</p>

<p>Feel free to leave comments if you have any more tips.</p>
]]></content:encoded>
			<wfw:commentRss>http://jrepp.com/2007/07/27/tips-for-getting-in-the-zone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Simple Continuous Test Script in Python</title>
		<link>http://jrepp.com/2007/07/12/a-simple-continuous-test-script-in-python/</link>
		<comments>http://jrepp.com/2007/07/12/a-simple-continuous-test-script-in-python/#comments</comments>
		<pubDate>Thu, 12 Jul 2007 03:18:52 +0000</pubDate>
		<dc:creator>proj</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://jrepp.com/2007/07/12/a-simple-continuous-test-script-in-python/</guid>
		<description><![CDATA[I was working on an in-memory database prototype in python and decided I didn&#8217;t want to keep manually running the unit tests so I whipped up a little auto test script that I can run in another terminal. autotest.py It&#8217;s &#8230; <a href="http://jrepp.com/2007/07/12/a-simple-continuous-test-script-in-python/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was working on an in-memory database prototype in python and decided I didn&#8217;t want to keep manually running the unit tests so I whipped up a little auto test script that I can run in another terminal.</p>

<p><a href="http://jrepp.com/code/autotest.py.txt"> autotest.py</a></p>

<p>It&#8217;s very simple it relies on a static list of files and an internal cache of the last modified time via stat(). The tests are implemented using standard pyunit. Any time a test or implementation file is written to disk it re-runs the tests. If you&#8217;ve never had a tool like this give it a try and I think  you&#8217;ll find that it&#8217;s an enjoyable way to work.</p>
]]></content:encoded>
			<wfw:commentRss>http://jrepp.com/2007/07/12/a-simple-continuous-test-script-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

