<?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>Bugfree.dk - Ronnie Holm&#039;s blog &#187; Productivity</title>
	<atom:link href="http://www.bugfree.dk/blog/tag/productivity/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bugfree.dk/blog</link>
	<description>Not anti-anything, just pro-quality</description>
	<lastBuildDate>Mon, 28 Nov 2011 07:32:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Essential requirements for a developer automation tool</title>
		<link>http://www.bugfree.dk/blog/2010/09/26/essential-requirements-for-a-developer-automation-tool/</link>
		<comments>http://www.bugfree.dk/blog/2010/09/26/essential-requirements-for-a-developer-automation-tool/#comments</comments>
		<pubDate>Sun, 26 Sep 2010 11:19:26 +0000</pubDate>
		<dc:creator>Ronnie Holm</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Tool]]></category>

		<guid isPermaLink="false">http://www.bugfree.dk/blog/?p=1058</guid>
		<description><![CDATA[Developer automation is a subject that I&#8217;ve always felt passionate about. Unit testing may be the most common example, but other tasks may include check-out of source code, build, deploy, setup, and warm-up of an application. I may even want one system rule them all and have the same automation drive continuous integration. Whatever the [...]]]></description>
			<content:encoded><![CDATA[<p>Developer automation is a subject that I&#8217;ve always felt passionate about. Unit testing may be the most common example, but other tasks may include check-out of source code, build, deploy, setup, and warm-up of an application. I may even want <a href="http://simpleprogrammer.com/2010/09/03/one-build-to-rule-them-all">one system rule them all</a> and have the same automation drive <a href="http://martinfowler.com/articles/continuousIntegration.html">continuous integration</a>. Whatever the use, to fully reap the benefits of automation, a developer should master at least one automation tool the same way he masters other developer tools. This and later posts capture my experiences with a few such automation tools centered around Windows and .NET, starting with why the ubiquitous <a href="http://en.wikipedia.org/wiki/Batch_files">batch file</a> is best avoided and how to characterize better solutions in terms of it.</p>
<p>Although Visual Studio, in tandem with the <a href="http://en.wikipedia.org/wiki/Msbuild">MSBuild engine</a>, generally takes good care of compilation, I rarely want to rely on it solely. Instead, I’d prefer that any developer task be easily run from the command-line. This ensures that no magic is going on, that the task is kept simple and flexibility, and that it doesn’t rely on Visual Studio to work. The challenge, however, is which of the many tools available to pick. It must be one that’s flexible enough to meet most requirements with relative ease or the automation will likely not be a valid documentation medium in itself.</p>
<h4>Why not to use Windows batch files</h4>
<p>As a general example, consider the deployment of a <a href="http://www.bugfree.dk/blog/2010/03/31/getting-started-with-sharepoint-presentation">SharePoint 2007 solution</a>. With SharePoint a good deal more than compiling is needed to bring new functionality into a SharePoint installation. Whereas Visual Studio and MSBuild may still compile the code and <a href="http://wspbuilder.codeplex.com">WSPBuilder</a> create the WSP installation package, both from within Visual Studio and from the command-line, getting everything setup cries for automation, even locally. A common approach (possibly inspired by <a href="http://www.amazon.com/Microsoft-Windows-SharePoint-Services-Developer/dp/0735623201/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1285960936&amp;sr=8-1">popular</a> SharePoint 2007 literature) is that of the batch file applying various operations to a WSP. For the sake of brevity, I&#8217;ve kept the example short, but imagine extending it with a check-out source code task, a compilation task, a WSPBuilder task, and a feature deactivation and activation task, and possibly a warm-up task. Add to this a master script that orchestrate the whole thing. In the end, I’d end up with scripts that become increasingly harder to maintain as they grow in number and size.</p>
<pre class="prettyprint lang-sh">    @set STSADM=&quot;c:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm&quot;

    if &quot;%1&quot; == &quot;uninstall&quot; goto uninstall
    if &quot;%1&quot; == &quot;install&quot; goto install
    if &quot;%1&quot; == &quot;&quot; goto reinstall

    :uninstall
        %STSADM% -o retractsolution -name Foo.wsp -immediate
        %STSADM% -o execadmsvcjobs
        %STSADM% -o deletesolution -name Foo.wsp -override
        goto end

    :install
        %STSADM% -o addsolution -filename Foo.wsp
        %STSADM% -o deploysolution -name Foo.wsp -immediate -allowGacDeployment -force
        %STSADM% -o execadmsvcjobs
        goto end

    :reinstall
        call Foo uninstall
        call Foo install
        goto end

    :end</pre>
<p>Still, because of the ubiquitous nature of command.com and cmd.exe, the batch file interpreters, batch files are everywhere. Regardless that the technology is a left-over from the days of MS DOS and haven&#8217;t evolved much since. Not only are the branching and looping constructs limited, so are the <a href="http://technet.microsoft.com/en-us/library/dd560674(WS.10).aspx">available commands</a>. Suppose I want to find out if a command was indeed successful. This turns out to be really hard when all I have to work with is the <a href="http://en.wikipedia.org/wiki/Errorlevel">errorlevel</a> of the most recently executed command. Assuming the command adheres to the errorlevel convention, for the script to fail as early and as close to the real error as possible, I’d have to inspect the property after each command, causing the batch file to grow quite verbose. Sadly, batch files lack the equivalent of <a href="http://www.davidpashley.com/articles/writing-robust-shell-scripts.html#id2399158">set -o errexit</a> of <a href="http://en.wikipedia.org/wiki/Bash_(Unix_shell)">Bash</a>, where the interpreter checks for success after each command and aborts immediately on error. Relying solely on the errorlevel is oftentimes insufficient anyway. To determine success, I’d typically have to parse actual command output or inspect some system property by downloading additional commands or building my own.</p>
<h4>Essential vs. incidental requirements</h4>
<p>Unless I plan to sit idle and stare at the screen and be a human error detector while the batch file run, I think it’s safe to say that it’s mostly unsuitable for developer automation. Hence in late 2005 I <a href="http://www.bugfree.dk/blog/2006/01/04/being-a-functional-pythonian">rolled my own automation tool in Python</a>. With Python or Ruby or a similar dynamic language acting as the glue that ties everything together, almost any task can be automated in a robust way. Of course, I could also automate with a static language like C# (it&#8217;s surprisingly common). But for script-like tasks, I don’t particularly fancy the long cycle of editing source code in Visual Studio, compiling it, deploying it, and having a hard time debugging it in environment without Visual Studio. A dynamic language, on the other hand, short-circuits the development cycle and allows for interactive programming through a <a href="http://en.wikipedia.org/wiki/REPL">REPL</a>.</p>
<p>With a dynamic language that interacts with .NET, such as <a href="http://en.wikipedia.org/wiki/Ironpython">IronPython</a>, <a href="http://en.wikipedia.org/wiki/IronRuby">IronRuby</a>, or <a href="http://en.wikipedia.org/wiki/Powershell">Powershell</a>, possibly with supporting DSLs like <a href="http://www.blueskyonmars.com/projects/paver">Paver</a>, <a href="http://en.wikipedia.org/wiki/Rake_(software)">Rake</a>, or <a href="http://en.wikipedia.org/wiki/Psake">psake</a> on top, the need for writing custom commands to interact with the operating system or the application almost vanishes. The question, then, is which of the dynamic languages to go with when at their technical core they’re so much alike. Besides sharing the concept of a REPL, the notion of a tuple, a list, a map, and operations on each are baked into their syntax, making code quite terse. It even makes it convenient to express any configuration in the language itself and not in XML where I’d first have to come up with a schema, and then create an instance of it before parsing it. On Windows, however, Powershell is gradually becoming the next ubiquitous interpreter, with applications shipping with cmdlets, whereas IronPython or IronRuby is a separate download.</p>
<h4>Conclusion</h4>
<p>No matter the tool, what I end up doing is defining tasks, form dependencies between tasks, and have the tool execute tasks in an order that satisfies their dependencies. As the tool traverses the dependency graph and executes tasks, it’s up to each task to detect success, and up to the tool to report on progress. A good tool is therefore characterized by the ease with which I can express these things, the available language constructs, the ease of debugging, and the tool’s ability to converse in foreign languages.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.bugfree.dk%2Fblog%2F2010%2F09%2F26%2Fessential-requirements-for-a-developer-automation-tool%2F&amp;title=Essential%20requirements%20for%20a%20developer%20automation%20tool" id="wpa2a_2"><img src="http://www.bugfree.dk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.bugfree.dk/blog/2010/09/26/essential-requirements-for-a-developer-automation-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting organized with Emacs Org-mode</title>
		<link>http://www.bugfree.dk/blog/2009/11/05/getting-organized-with-emacs-org-mode/</link>
		<comments>http://www.bugfree.dk/blog/2009/11/05/getting-organized-with-emacs-org-mode/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 21:42:02 +0000</pubDate>
		<dc:creator>Ronnie Holm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[Logging]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Tool]]></category>

		<guid isPermaLink="false">http://www.bugfree.dk/blog/?p=694</guid>
		<description><![CDATA[It&#8217;s been four months and 350 clocked work-hours since I started using Org-mode for Emacs. I use Org-mode, mixed with some of the Pomodoro principles, to maintain my task lists at work and home. In a nutshell Org-mode is a plug-in for Emacs that makes taking notes, maintaining lists, clocking time, and many other tasks [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been four months and 350 clocked work-hours since I started using <a href="http://orgmode.org">Org-mode</a> for <a href="http://www.gnu.org/software/emacs/">Emacs</a>. I use Org-mode, mixed with some of the <a href="http://www.pomodorotechnique.com">Pomodoro principles</a>, to maintain my task lists at work and home.</p>
<p>In a nutshell Org-mode is a plug-in for Emacs that makes taking notes, maintaining lists, clocking time, and many other tasks more straightforward. The mode works by adding features on top of Emacs for editing plain text files. Features that enrich the interaction with the underlying text buffer by parsing and adding (meta-)information to it.</p>
<p>With Org-mode you group items into a hierarchical structure. A path to the item to work on is then formed by unfolding items in a way analogous to how you navigate the file system with Explorer.</p>
<p><img alt="" src="http://www.bugfree.dk/blog/wp-content/uploads/2009/11/Org-mode-example1.png" /></p>
<p>To efficiently work with items, Org-mode supports moving items around the hierarchy. Items may also be tagged (buy, work, phone, etc.) or associated with a state (done, waiting, started, etc.). Additional meta-information may include a deadline, an estimate, or time spent working on a task. The clocking of time is accomplished by Org-mode adding a timestamp to the item. On completion, another timestamp and the elapsed time is calculated and added.</p>
<p>Below is an example of an expanded and a collapsed item containing clocked times and estimates.</p>
<p><img alt="" src="http://www.bugfree.dk/blog/wp-content/uploads/2009/11/Org-mode-example2.png" /></p>
<p>With a few keystrokes, Org-mode is able to correlate estimates with time spent on an item-by-item basis. This truly short-circuits the estimation feedback cycle. Imagine doing this on a file containing a large hierarchy of items and the transparency it brings.</p>
<p><img alt="" src="http://www.bugfree.dk/blog/wp-content/uploads/2009/11/Org-mode-example3.png" /></p>
<p>If you want to keep track of billable hours, it may make sense to clock all your time using Org-mode and generate timesheets from the clocking information. Especially since the billing context is automatically provided by the item storing the timestamp, and since you&#8217;re free to organize the file in any way you see fit. Few other tools manage to compete with the flexibility of a plain text buffer.</p>
<p>This post only scratches the surface of Org-mode. To get a sense of the possibilities, the <a href="http://orgmode.org/org.pdf">manual</a> amounts to 184 pages. However, for a quick introduction I encourage you to watch the <a href="http://orgmode.org/GoogleTech.html">Google Tech Talk on Org-mode</a>.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.bugfree.dk%2Fblog%2F2009%2F11%2F05%2Fgetting-organized-with-emacs-org-mode%2F&amp;title=Getting%20organized%20with%20Emacs%20Org-mode" id="wpa2a_4"><img src="http://www.bugfree.dk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.bugfree.dk/blog/2009/11/05/getting-organized-with-emacs-org-mode/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Becoming aware of and minimizing distractions</title>
		<link>http://www.bugfree.dk/blog/2009/07/27/becoming-aware-of-and-minimizing-distractions/</link>
		<comments>http://www.bugfree.dk/blog/2009/07/27/becoming-aware-of-and-minimizing-distractions/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 20:14:31 +0000</pubDate>
		<dc:creator>Ronnie Holm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Tool]]></category>

		<guid isPermaLink="false">http://www.bugfree.dk/blog/?p=295</guid>
		<description><![CDATA[Spending a great deal of time in front of my computer, I often get carried away by instant messaging, mail, RSS, Twitter, Facebook, etc. For the most part, these activities aren&#8217;t the reason I turned on the computer. Nevertheless they end up being where a lot of time is spent. Like with any habit, every [...]]]></description>
			<content:encoded><![CDATA[<p>Spending a great deal of time in front of my computer, I often get carried away by instant messaging, mail, RSS, Twitter, Facebook, etc. For the most part, these activities aren&#8217;t the reason I turned on the computer. Nevertheless they end up being where a lot of time is spent.
</p>
<p>Like with any habit, every so often you should take the time to review it. I find <a href="http://timesnapper.com/">TimeSnapper</a> (the free edition) to be an invaluable tool for reviewing computer habits. It captures an image of the desktop every few seconds and is able to create a movie from the images. That way, a partial <a href="http://en.wikipedia.org/wiki/Lifelog">life log</a> (mine is currently 393 days) is automatically created to help you remember what you did yesterday and the day before.
</p>
<p>There&#8217;s nothing like reviewing a few of weeks of captured images to make habits stand out. I found that I&#8217;ve a tendency to re-visit the same maybe ten sites all too often. I also have difficulty single-tasking. Listening to a podcast or watching a movie, I&#8217;m often browsing the web instead of paying attention to the podcast or skipping it altogether. I may even have several media players launched at once, although only one playing.
</p>
<p>Most of my distractions can be attributed to me always being online. I need Internet access for work, so turning it off altogether isn&#8217;t an alternative. So, not unlike <a href="http://www.paulgraham.com">Paul Graham</a>, on several occasions, I&#8217;ve made myself adhere to a set of rules for using the Internet. And every time they&#8217;ve worked &#8212; for a short while.
</p>
<p>In <a href="http://www.paulgraham.com/distraction.html">Disconnecting Distraction</a>, Paul takes these rules one step further and argues that using two computers may be a better solution: one computer with Internet access and one without for doing real work. Ideally, the computers should be placed some distance apart to make you psychically get up to go on the Internet.
</p>
<p>For a week I&#8217;ve given the two-computer approach a try. It was hard initially, but I&#8217;ve come to appreciate it. Forming permanent habits takes time. Thus, I&#8217;ll continue the experiment for a couple of weeks. Perhaps in time I&#8217;ll even learn to turn off instant messaging and only do mail once or twice a day. Or I may end up spending most of the time in front of the connected computer.
</p>
<p>Then again, there&#8217;s more to life than work.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.bugfree.dk%2Fblog%2F2009%2F07%2F27%2Fbecoming-aware-of-and-minimizing-distractions%2F&amp;title=Becoming%20aware%20of%20and%20minimizing%20distractions" id="wpa2a_6"><img src="http://www.bugfree.dk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.bugfree.dk/blog/2009/07/27/becoming-aware-of-and-minimizing-distractions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Text files vs. personal wiki</title>
		<link>http://www.bugfree.dk/blog/2006/12/04/text-files-vs-personal-wiki/</link>
		<comments>http://www.bugfree.dk/blog/2006/12/04/text-files-vs-personal-wiki/#comments</comments>
		<pubDate>Sun, 03 Dec 2006 22:18:59 +0000</pubDate>
		<dc:creator>Ronnie Holm</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Tool]]></category>

		<guid isPermaLink="false">http://www.bugfree.dk/blog/2006/12/04/text-files-vs-personal-wiki/</guid>
		<description><![CDATA[I have quite a few small text files lying around, containing everything from to-do lists to shopping lists to code snippets to small howto&#8217;s. Now, instead of having all those text files floating around as regular files, nine months ago I decided to move them into a locally stored, for security reasons, personal wiki. Among [...]]]></description>
			<content:encoded><![CDATA[<p>I have quite a few small text files lying around, containing everything from to-do lists to shopping lists to code snippets to small howto&#8217;s. Now, instead of having all those text files floating around as regular files, nine months ago I decided to move them into a locally stored, for security reasons, personal wiki.</p>
<p>Among the good wiki engines out there (most notably <a href="http://www.mediawiki.org/wiki/MediaWiki">MediaWiki</a>, <a href="http://moinmoin.wikiwikiweb.de">MoinMoin</a>, and <a href="http://www.flexwiki.com">FlexWiki</a>), I went with FlexWiki, because it being asp.net based means that all the software required for a basic configuration ships with Windows. In addition, FlexWiki&#8217;s provider-based storage model lets you store pages in an MS SQL server, if you want to. </p>
<p>My incentive for going the wiki way was that I expected my documents to become more structured when making use of the typical wiki-like features &#8230;</p>
<ul>
<li>Documents are automatically linked together.<br />
I found my pages to be fairly independent, so hyperlinks are almost never present.</li>
<li>All modifications are recoded.<br />
Versioning isn&#8217;t really that big an issue, because I usually add contents to the end of a page rather than changing existing contents, and for pages such as a shopping list, I don&#8217;t really need versioning.</li>
<li>More sophisticating layout capabilities.<br />
Although I occasionally created a table and used colors, generally I can do with simple formatting. For those few cases where I can&#8217;t, a Word document is in place, since it’s equally well indexed by MS or Google desktop search engines.</li>
</ul>
<p>&#8230; but most of the time, I didn&#8217;t make use of the features FlexWiki provided over text files. So, if you also factor in the disadvantages &#8230;</p>
<ul>
<li>Extra infrastructure required.<br />
Web server, and possibly an SQL server, is a must-have-installed. Also, you probably need to figure out how to configure the web server so you don&#8217;t share your live with the world.</li>
<li>Browser required for page edit.<br />
After launching the browser, you must navigate to the wiki page, which may add considerable overhead for quick edits as opposed to simply double clicking a text file from within Explorer.</li>
<li>Lacking WYSIWYG support.<br />
With FlexWiki, editing a page is a two-step process. First you write content in a markup language. Then you click &#8220;Save&#8221; and the browser switches to display view, where your markup is converted to html. Now, if the result is not what you expected, you have to repeat the cycle.</li>
<li>Build-in search less powerful than desktop search engines.<br />
If you use the file system for storing wiki pages then the pages are also searchable by desktop search engines. However, if you opt for MS SQL storage, you have to rely on the build-in search capabilities of the wiki to find pages.</li>
<li>Backup is more involved.<br />
Backing up and restoring a database is more complicated than copying a directory.</li>
</ul>
<p>&#8230; I&#8217;ve decided that the wiki doesn&#8217;t cut it for me: simply because there is less overhead associated with editing text or even Word documents and because with desktop search engines I retain most of the properties I need.</p>
<p>This doesn&#8217;t mean that a wikis aren&#8217;t suited for maintaining a corpus of personal information; just that the corpus should serve a different purpose to make better use of wiki features.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.bugfree.dk%2Fblog%2F2006%2F12%2F04%2Ftext-files-vs-personal-wiki%2F&amp;title=Text%20files%20vs.%20personal%20wiki" id="wpa2a_8"><img src="http://www.bugfree.dk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.bugfree.dk/blog/2006/12/04/text-files-vs-personal-wiki/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

