<?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>Martin&#039;s Blog</title>
	<atom:link href="http://malor.se/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://malor.se/blog</link>
	<description>Software and fly fishing in harmony</description>
	<lastBuildDate>Thu, 03 Feb 2011 08:23:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>FlexTime plugins</title>
		<link>http://malor.se/blog/?p=192</link>
		<comments>http://malor.se/blog/?p=192#comments</comments>
		<pubDate>Thu, 03 Feb 2011 08:23:57 +0000</pubDate>
		<dc:creator>Martin Altenstedt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://malor.se/blog/?p=192</guid>
		<description><![CDATA[For me, FlexTime has become very useful. One of the reasons it is so useful is that I have written a few plug-ins that complement the standard functionality. For example, I have always kept a log of my working hours. &#8230; <a href="http://malor.se/blog/?p=192">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>For me, <a href="http://inhill.com/">FlexTime</a> has become very useful.  One of the reasons it is so useful is that I have written a few plug-ins that complement the standard functionality.  For example, I have always kept a log of my working hours.  It is a simple text file, written in the <a href="http://www.gnu.org/prep/standards/html_node/Style-of-Change-Logs.html#Style-of-Change-Logs">GNU ChangeLog style</a> (I guess old habits really do die hard.)  I use a plug-in that reads the diary file and displays it in FlexTime, providing context to the working hours spent.  For me, it is <em>very</em> useful.</p>
<p>  <img width="316" height="657" style="display:block; margin-left:auto; margin-right:auto;" src="http://malor.se/20110202/Keywords.png" alt="Keywords extracted from my diary file." /></p>
<p>The projects Doorstop and Jupiter show up as keywords in FlexTime as shown in the image above.  I can see at a glance how much time I have spent on each task.  Since I write the diary anyway, I find it very useful to let FlexTime extract the tags and display them with time calculations.</p>
<p>I have a public Git repository for most of the plugins that I have written.  I hope you might find the code useful too.  The repository is hosted at <a href="https://github.com/altenstedt/FlexTime.Plugins">Github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://malor.se/blog/?feed=rss2&#038;p=192</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using an adorner with WPF DataGrid</title>
		<link>http://malor.se/blog/?p=88</link>
		<comments>http://malor.se/blog/?p=88#comments</comments>
		<pubDate>Sat, 01 May 2010 19:28:46 +0000</pubDate>
		<dc:creator>Martin Altenstedt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://malor.se/blog/?p=88</guid>
		<description><![CDATA[Growing tired of manually keeping track of my work time, I wrote FlexTime, a small application that keeps track of the times I work on my computer and then summarize the result in a time sheet each week. All good &#8230; <a href="http://malor.se/blog/?p=88">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Growing tired of manually keeping track of my work time, I wrote <a href="http://inhill.com/">FlexTime</a>, a small application that keeps track of the times I work on my computer and then summarize the result in a time sheet each week.</p>
<p>All good fun, but since I had a few moments to spare, I decided to add support for project information: textual information on <em>what</em> I have been working on.  So I added a <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.datagrid.aspx">DataGrid</a> and wrote a small plugin framework so that users can <a href="http://msdn.microsoft.com/en-us/library/dd460648.aspx">roll their own</a> storage backend. </p>
<p>Again, good fun but then I wanted to indicate in each grid cell the plugin name of the particular comment.  Just a small, quiet label at the bottom right, like the image below.</p>
<a href="http://malor.se/blog/?attachment_id=89" rel="attachment wp-att-89"><img src="http://malor.se/blog/wp-content/DataGrid-Adorner.png" alt="DataGrid Adorner" title="DataGrid Adorner" width="448" height="109" class="size-full wp-image-89" /></a>
<div style="font-size:smaller; font-style:italic; margin-top:1em">A small, quiet text (&#8220;Native&#8221;) is placed to the bottom right of each row to indicate the source of the comment.</div>
<p>The obvious solution to use a <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.datagridtemplatecolumn.aspx">DataGridTemplateColumn</a> and a <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.grid.aspx">Grid</a> with two text boxes has <a href="http://wpf.codeplex.com/Thread/View.aspx?ThreadId=35540">focus problems</a>.  Instead, a cleaner solution is to use an <a href="http://msdn.microsoft.com/en-us/library/ms743737.aspx">Adorner</a> class on a <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.datagridtextcolumn.aspx">DataGridTextColumn</a>.</p>
<p>The basic idea is to attach the <a href="http://msdn.microsoft.com/en-us/library/ms600191(v=VS.90).aspx">adorner layer</a> to the data grid cell and provide a dependency property where we can set a data template for the adorner using XAML.</p>
<p>First the adorner class.  We simply use a <a href="http://msdn.microsoft.com/en-us/library/ms609804(v=VS.90).aspx">ContentPresenter</a>, passing it the template and content.</p>
<p><script src="http://gist.github.com/386370.js?file=TemplateAdorner.cs"></script></p>
<p>Then we derive our own class from the <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.datagridtextcolumn.aspx">DataGridTextColumn</a> where we define a new dependency property for the template and wire up the adorner class.</p>
<p><script src="http://gist.github.com/386386.js?file=DataGridTextAdornerColumn.cs"></script></p>
<p>And finally we can utilize the new adorner column in the XAML:</p>
<p><script src="http://gist.github.com/386482.js?file=View.xaml"></script></p>
<p>Both the power and complexity of WPF does not cease to amaze me.  Pretty schweet, methinks and great fun too.  Look out for the next release of <a href="http://inhill.com/">FlexTime</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://malor.se/blog/?feed=rss2&#038;p=88</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Map engine for WPF GIS applications</title>
		<link>http://malor.se/blog/?p=65</link>
		<comments>http://malor.se/blog/?p=65#comments</comments>
		<pubDate>Thu, 18 Jun 2009 18:52:29 +0000</pubDate>
		<dc:creator>Martin Altenstedt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://malor.se/blog/?p=65</guid>
		<description><![CDATA[Why is it so hard to buy a map engine to be embedded into a .NET WPF desktop application? When developing your typical command and control system, selecting a GIS component to embed into your WPF based client can be &#8230; <a href="http://malor.se/blog/?p=65">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Why is it so hard to buy a map engine to be embedded into a .NET WPF desktop application? When developing your typical command and control system, selecting a GIS component to embed into your WPF based client can be really difficult.</p>
<p>The choices available are either too limited with regards to supported map data formats, requires data pre-processing or have wholly inadequate licensing models, pricing or both.  Most, if not all of the better choices are based on ActiveX which makes them somewhat cumbersome to embed in clients built on WPF.</p>
<p>Many organizations are moving to more agile development processes where specific architectural roles are often discouraged. Everybody are expected to be able to work on the complete application stack and that means having access to all the tools needed, including the map engine SDK. Pricing and licensing really becomes an issue for teams wanting to stay truly agile.</p>
<p>I feel that WPF is about to finally break through in corporate business applications.  Silverlight has made a difference and the tooling, both the Expression suite and Visual Studio 2010 is getting there, albeit a little late, perhaps. This could mean trouble for the established vendors if they don&#8217;t act to accommodate this growing market.</p>
<p>I would like to see a map engine component that does the following:</p>
<ul>
<li>Native .NET WPF control</li>
<li>Reference system supported canvas for drawing on layers</li>
<li>Complete documentation with a rich set of samples</li>
<li>$499 for the SDK
</li>
<li>No charge for the runtime</li>
</ul>
<p>I think that there might be a feature list in there somewhere that includes <em>just</em> the right amount of functionality that perfectly executed could have fantastic potential.  What do you think?</p>
]]></content:encoded>
			<wfw:commentRss>http://malor.se/blog/?feed=rss2&#038;p=65</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Using SpatialAce in WPF applications</title>
		<link>http://malor.se/blog/?p=61</link>
		<comments>http://malor.se/blog/?p=61#comments</comments>
		<pubDate>Tue, 29 Apr 2008 13:00:19 +0000</pubDate>
		<dc:creator>Martin Altenstedt</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://malor.se/blog/?p=61</guid>
		<description><![CDATA[It’s been a long while since I blogged about SpatialAce. It’s even got a new name since the last time i wrote about it: Carmenta Engine. So I thought I’d write one last post about this excellent GIS map engine; &#8230; <a href="http://malor.se/blog/?p=61">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>It’s been a long while since I blogged about SpatialAce. It’s even got a new name since the last time i wrote about it: <a href="http://www.carmenta.com/products/carmenta-engine/">Carmenta Engine</a>. So I thought I’d write one last post about this excellent GIS map engine; this time about using it in a Windows Presentation Foundation (WPF) application. </p>
<p>Since Carmenta Engine is an ActiveX control, you need to use a WindowsFormsHost wrapper class. I will show a technique where we will create an intermediate WPF wrapper that will enable us to implement a few custom dependency properties that we can use for setting configurations files and view names in XAML.</p>
<p>Start by adding a new WPF Library project to your solution. Name the new project CarmentaEngine. Then add a new Windows Forms UserControl and name it <code>CarmentaEngineFormsControl</code>.  Make sure that you choose a <em>Windows Forms</em> control, not the WPF equivalent.  In this UserControl, you drop your Carmenta Engine ActiveX control and set it’s dock property to fill. </p>
<p>Now create a WPF UserControl in the same project and drop a WindowsFormsHost into it. Name the WPF UserControl <code>CarmentaEngineControl</code>. We can now add the just created Windows Forms UserControl to the WPF UserControl. Sounds a little complicated? Well, the benefit here is that we can implement dependency properties for Carmenta Engine in the WPF UserControl that we can use from XAML later.  </p>
<p>The file <code>CarmentaEngineControl.xaml</code> should look something like this:<br />
<code></p>
<pre>
  &lt;UserControl x:Class="CarmentaEngine.CarmentaEngineControl"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:my="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"             
      xmlns:code="clr-namespace:CarmentaEngine"
      Height="300" Width="300" &gt;
      &lt;Grid&gt;
          &lt;my:WindowsFormsHost Name="windowsFormsHost1"&gt;
              &lt;code:CarmentaEngineFormsControl x:Name="carmentaEngineFormsControl"/&gt;
          &lt;/my:WindowsFormsHost&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
</pre>
<p></code><br />
We’d like to expose the <code>ConfigurationFile</code> and <code>ViewName</code> property of the Carmenta Engine ActiveX control as dependency properties. This is very straightforward code, the only thing to look out for is that we should not set the property values until we have both of them. Setting <code>ViewName</code> without a <code>ConfigurationFile</code> value does not make sense.  Here’s the code behind from <code>CarmentaEngineControl.xaml.cs</code>:<br />
<code></p>
<pre>
  public partial class CarmentaEngineControl : UserControl {
  
      public static readonly DependencyProperty ConfigurationFileProperty;
      public static readonly DependencyProperty ViewNameProperty;
  
      private string viewName = null;
      private string path = null;
  
      public CarmentaEngineControl() {
          InitializeComponent();
      }
  
      static CarmentaEngineControl() {
          ConfigurationFileProperty = DependencyProperty.Register
              ("ConfigurationFile", typeof (string), typeof (CarmentaEngineControl), 
               new FrameworkPropertyMetadata
               (null, FrameworkPropertyMetadataOptions.None, OnConfigurationFileChanged));
  
          ViewNameProperty = DependencyProperty.Register
              ("ViewName", typeof(string), typeof(CarmentaEngineControl),
               new FrameworkPropertyMetadata
               (null, FrameworkPropertyMetadataOptions.None, OnViewNameChanged));
      }
  
      private static void OnViewNameChanged
          (DependencyObject d, DependencyPropertyChangedEventArgs e) {
          CarmentaEngineControl control = d as CarmentaEngineControl;
          if (control != null) {
              control.viewName = (string) e.NewValue;
              control.InitializeEngine();
          }
      }
  
      private static void OnConfigurationFileChanged
          (DependencyObject d, DependencyPropertyChangedEventArgs e) {
          CarmentaEngineControl control = d as CarmentaEngineControl;
          if (control != null) {
              control.path = (string) e.NewValue;
              control.InitializeEngine();
          }
      }
  
      public string ConfigurationFile {
          get { return (string) GetValue(ConfigurationFileProperty); }
          set { SetValue(ConfigurationFileProperty, value); }
      }
  
      public string ViewName {
          get { return (string)GetValue(ViewNameProperty); }
          set { SetValue(ViewNameProperty, value); }
      }
  
      private void InitializeEngine() {
          if (path != null &#038;&#038; viewName != null) {
  
              FileInfo fileInfo = new FileInfo(path);
              if (fileInfo.Exists) {
                  AxSpaceX spaceX = carmentaEngineFormsControl.axSpaceX1;
                  spaceX.ConfigurationFile = path;
                  spaceX.NameSpace = Path.GetFileNameWithoutExtension(path);
                  spaceX.ViewName = viewName;
  
                  spaceX.Tool = new RoamToolClass();
              }
          }
      }
  }
</pre>
<p></code><br />
That’s basically all there is to it. Now, in your original WPF application project, reference the WPF Library project from above and add the following code to your XAML:<br />
<code></p>
<pre>
  &lt;CarmentaEngine:CarmentaEngineControl 
            Margin="31,0,475.75,19" Height="177" VerticalAlignment="Bottom" 
            ConfigurationFile="path to configuration file"
            ViewName="the name of your view"/&gt;
</pre>
<p></code><br />
Don’t forget to reference the CarmentaEngine project in your header:<br />
<code></p>
<pre>
  xmlns:CarmentaEngine="clr-namespace:CarmentaEngine;assembly=CarmentaEngine"
</pre>
<p></code><br />
Since last week, I no longer work at <a href="http://www.carmenta.com/">Carmenta</a> so I can’t verify the syntax. I based the code on some notes on how I did this a few weeks ago and I hope I got all the details right.  I should also say that this was my first encounter with WPF and I found the MSDN documentation to be a little terse.  In other words: there might be syntax errors above and better ways to do this, but I found the technique to have a separate WPF library with custom dependency properties to be pretty powerful.</p>
]]></content:encoded>
			<wfw:commentRss>http://malor.se/blog/?feed=rss2&#038;p=61</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Serving Mercurial using Apache on Ubuntu</title>
		<link>http://malor.se/blog/?p=60</link>
		<comments>http://malor.se/blog/?p=60#comments</comments>
		<pubDate>Sun, 23 Mar 2008 12:56:24 +0000</pubDate>
		<dc:creator>Martin Altenstedt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://malor.se/blog/?p=60</guid>
		<description><![CDATA[If you have even the slightest interest in revision control systems chances are you have been keeping an eye on the development of distributed systems. The dust has not settled yet but I think that Sun’s decision to go with &#8230; <a href="http://malor.se/blog/?p=60">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>If you have even the slightest interest in revision control systems chances are you have been keeping an eye on the development of <a href="http://en.wikipedia.org/wiki/Distributed_revision_control"><em>distributed</em> systems</a>. The dust has not settled yet but I think that Sun’s decision to go with <a href="http://www.selenic.com/mercurial/">Mercurial</a> for OpenSolaris and OpenJDK makes that particular program a fairly safe choice. Some history on Sun’s choice <a href="http://blogs.sun.com/mr/entry/openjdk_scm">here</a>.  A good and fairly recent comparison <a href="http://www.dribin.org/dave/blog/archives/2007/12/28/dvcs/">here</a>.  Don&#8217;t miss out on Linus Torvald&#8217;s <a href="http://lwn.net/Articles/246381/">recommendations</a> to the KDE people.</p>
<p>I have only very briefly tried out distributed revision control systems. The point that stands out for me is the powerful idea of the dual push-pull model. First there is the pull model; sandboxed development where one or more developers collaborate, pulling sources from each other. Each user is responsible for pulling changes from others and the model requires close collaboration and communication. This is the development model usually described and advertised for distributed revision control systems.</p>
<p>The second development model is the push model where changes are pushed to one or more central, master repositories, much like you would check in sources into Subversion or any other centralized version control system.  For commercial projects, you will probably want to support this second mode, setting up master repositories that represents the stable state of your project. Sooner or later you will need HTTP read access to the masters. If nothing else, how else will your <a href="https://hudson.dev.java.net/">Hudson</a> build server access the stable branch?</p>
<p>I really like Mercurial’s <code>serve</code> command that starts serving your repository over HTTP. Just type <code>hg serve</code> and others can access your repository for pulling over the net, just like that.  This is not what you want for your master repositories though. For those you will want a permanent solution and that means using CGI scripts.</p>
<p>The <a href="http://hgbook.red-bean.com/hgbook.html">Mercurial book</a> contains a <a href="http://hgbook.red-bean.com/hgbookch6.html#x10-1310006.6">chapter</a> about serving HTTP using CGI that is a good starting point.  There are also a few posts on the net that I also found useful, <a href="http://digitalspaghetti.me.uk/2007/11/07/setting-up-a-mercurial-repository-from-svn-for-dummies-like-me">here</a> and <a href="http://blog.lstoll.net/2007/11/installing-mercurial-on-ubuntu-704.html">here</a>.  The instructions below have been tested on a blank <a href="http://www.ubuntu.com/">Ubuntu</a> 7.10 (<a href="http://www.ubuntu.com/products/whatisubuntu/serveredition/jeos">Jeos</a>) box. I have chosen Apache as the web server.</p>
<p>I choose to place the root of the Mercurial repositories at <code>/srv/hg/</code>.  See the <a href="http://www.pathname.com/fhs/">FHS</a> for more information on that choice. Serving HTTP access is made using a CGI script, shipped with Merurial.  I prefer to place the script next to the repositories in a directory called <code>/srv/hg/cgi-bin/</code>.</p>
<pre>
<code>
  # mkdir /srv/hg
  # mkdir /srv/hg/cgi-bin
</code>
</pre>
<p>Below, I&#8217;ve chosen to copy the hgwebdir.cgi script which enables access to multiple repositories using the same root.</p>
<pre>
<code>  
  # cp /usr/share/doc/mercurial/examples/hgwebdir.cgi /srv/hg/cgi-bin/
  # chmod a+x /srv/hg/cgi-bin/hgwebdir.cgi 
</code>
</pre>
<p>Create a file <code>/srv/hg/cgi-bin/hgweb.config</code> that contains the following two lines:</p>
<pre>
<code>
  [collections]
  /srv/hg/ = /srv/hg/
</code>
</pre>
<p>And that&#8217;s it as far as Mercurial goes. Just remember that it is Apache that will run the mercurial commands through the CGI scripts. It means that you will need to give read access to the world for the repositories</p>
<pre>
<code>
  # chmod a+rX /srv/hg/your repo(s)
</code>
</pre>
<p>All that&#8217;s left to do is setting up a web server to serve the Mercurial CGI script above.  There are several servers to choose from.  I&#8217;ve chosen to use Apache:</p>
<pre>
<code>
  # apt-get install apache2
</code>
</pre>
<p>Rather than edit the default site, I find it cleaner to setup a separate, new Merurial site.  Create a new file <code>/etc/apache2/sites-available/hg</code> and add the following lines:</p>
<pre>
<code>
  NameVirtualHost *
  &lt;VirtualHost *&gt;
    ServerAdmin webmaster@localhost

    DocumentRoot /srv/hg/cgi-bin/

    &lt;Directory "/srv/hg/cgi-bin/"&gt;
      SetHandler cgi-script
      AllowOverride None
      Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
      Order allow,deny
      Allow from all
    &lt;/Directory&gt;

    ErrorLog /var/log/apache2/hg.log 
  &lt;/VirtualHost&gt;
</code>
</pre>
<p>Disable the default site, enable our new Mercurial site and reload the Apache server.  </p>
<pre>
<code>
  # a2dissite default
  # a2ensite hg
  # /etc/init.d/apache2 reload
</code>
</pre>
<p>That&#8217;s it.  You should now be able to see all your repositories if you point your browser to http://yourhost/hgwebdir.cgi/</p>
]]></content:encoded>
			<wfw:commentRss>http://malor.se/blog/?feed=rss2&#038;p=60</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>SQL Server 2008 slips</title>
		<link>http://malor.se/blog/?p=59</link>
		<comments>http://malor.se/blog/?p=59#comments</comments>
		<pubDate>Tue, 26 Feb 2008 14:13:09 +0000</pubDate>
		<dc:creator>Martin Altenstedt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://malor.se/blog/?p=59</guid>
		<description><![CDATA[Microsoft SQL Server 2008 is late. Hardly unusual or perhaps even surprising given the complexity of these things. Microsoft is nowadays even trying to be pretty transparent about such things, blogging about changes to important roadmaps and so on. However, &#8230; <a href="http://malor.se/blog/?p=59">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Microsoft SQL Server 2008 is late. Hardly unusual or perhaps even surprising given the complexity of these things. Microsoft is nowadays even trying to be pretty transparent about such things, blogging about changes to important roadmaps and so on. However, Francois Ajenstat&#8217;s <a href="http://blogs.technet.com/dataplatforminsider/archive/2008/01/25/microsoft-sql-server-2008-roadmap-clarification.aspx">announcement</a> that SQL Server has slipped was more opaque than usual and quite frankly somewhat hard to understand.  Enough so that Phil Factor wrote <a href="http://www.simple-talk.com/community/blogs/philfactor/archive/2008/01/27/43174.aspx">very funny reply</a> to the market-speak of Francois Ajenstat.  A must read.</p>
]]></content:encoded>
			<wfw:commentRss>http://malor.se/blog/?feed=rss2&#038;p=59</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You suck at Photoshop</title>
		<link>http://malor.se/blog/?p=58</link>
		<comments>http://malor.se/blog/?p=58#comments</comments>
		<pubDate>Thu, 31 Jan 2008 10:58:15 +0000</pubDate>
		<dc:creator>Martin Altenstedt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://malor.se/blog/?p=58</guid>
		<description><![CDATA[There are plenty of good tutorials on Photoshop available on the Net. Some commercial, some free of charge. However, the &#8220;You suck at Photoshop&#8221; tutorials by Donnie Hoyle has to be the funniest of them all. There&#8217;s four of them &#8230; <a href="http://malor.se/blog/?p=58">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>There are plenty of good tutorials on Photoshop available on the Net. Some commercial, some free of charge.  However, the &#8220;You suck at Photoshop&#8221; tutorials by Donnie Hoyle has to be the funniest of them all.  There&#8217;s four of them on YouTube so far and they&#8217;re all hilarious.</p>
<ol>
<li><a href="http://www.youtube.com/watch?v=U_X5uR7VC4M">Distort, warp and layer effects</a></li>
<li><a href="http://www.youtube.com/watch?v=VXeZ0s8DXZ0">Old school</a></li>
<li><a href="http://www.youtube.com/watch?v=MWn0lxRNqos">Clone stamp and manual cloning</a></li>
<li><a href="http://www.youtube.com/watch?v=YNfBF2xvhaE">Paths and masks</a></li>
</ol>
<p>&#8220;Strap on your stupid and lets get at it.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://malor.se/blog/?feed=rss2&#038;p=58</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hudson love</title>
		<link>http://malor.se/blog/?p=57</link>
		<comments>http://malor.se/blog/?p=57#comments</comments>
		<pubDate>Wed, 26 Dec 2007 19:36:17 +0000</pubDate>
		<dc:creator>Martin Altenstedt</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://malor.se/blog/?p=57</guid>
		<description><![CDATA[Some time ago I tried having a separate build machine performing continuous builds every time I checked my project sources into Subversion and I was quickly hooked. It’s a very simple idea but I always found it a little hard &#8230; <a href="http://malor.se/blog/?p=57">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Some time ago I tried having a separate build machine performing <a href="http://www.martinfowler.com/articles/continuousIntegration.html">continuous builds</a> every time I checked my project sources into Subversion and I was quickly hooked. It’s a very simple idea but I always found it a little hard to fully appreciate the benefits before I tried it in a real project.</p>
<p>While having a build machine really shines with unit tests, it has a place even when you don’t have any unit testing at all in place. Firstly, you catch those time-consuming errors not having added all files to the version control system. Breaking a build wastes time for the entire team. Secondly, you have an incentive to keep the build process sane since the system gets built all the time.  Building a system really should be as simple as checking the sources out and running a single command. Performing automated builds can help simply because setting up the builds becomes troublesome otherwise!</p>
<p>So here&#8217;s a suggestion for you existing project that does not have any unit tests: setup a build machine that builds the project every time someone checks something in.  Then create a single unit test and have it run as part of the continuous build process.  That&#8217;s it.  You will now know that your project can be built and that it at least passes some simple test.  Moving forward, you can for example make a point of creating a unit test for all new bug reports from customers.  You decide, but knowing that your project <em>builds</em> alone can be worth quite a lot.</p>
<p>There are several applications for continuous integration to choose from. Most of them seem to have been developed within the Java community, but they are capable of running much more than Java builds and JUnit tests. The first build system I tried was <a href="http://cruisecontrol.sourceforge.net/">CruiseControl</a> because it seemed an obvious choice at the time. It has performed very well, though I remember it was a little cumbersome to set up. Since I recently needed to set up CruiseControl from scratch I figured I might just as well try <a href="https://hudson.dev.java.net/">Hudson</a> out. </p>
<p>For me, the major advantage of Hudson, besides the <em>much</em> neater interface, is the packaging and running behavior.  Hudson is delivered as a WAR file that you can deploy on any Java <a href="http://en.wikipedia.org/wiki/List_of_Servlet_containers">servlet container</a>, but it also contains <a href="http://winstone.sourceforge.net/">Winstone</a>, a lightweight servlet container so that you can actually run Hudson “self-hosted” by simply going:</p>
<pre>
<code>
$ java -jar hudson.war
</code>
</pre>
<p>Starting a self-hosted Hudson on a Linux box as a daemon, typically requires an System V init.d script. I can post a little information on how to write such a script and have Hudson start each time your System V machine boots if you wish;  It&#8217;s not hard since Hudson will run as a single process, but a better solution might be to deploy Hudson to a servlet container, like <a href="http://tomcat.apache.org/">Tomcat</a>, <a href="http://www.jboss.org/">JBoss</a> or <a href="https://glassfish.dev.java.net/">Glassfish</a>.</p>
<p>A reasonable choice of servlet container for an <a href="http://www.ubuntu.com/">Ubuntu</a> box is Tomcat, simply because it is available as an Ubuntu package.  Installation requires you to enable the <em>universe</em> and <em>multiverse</em> repositories.  Details on how to do that can be found <a href="https://help.ubuntu.com/community/Repositories/Ubuntu">here</a>.  Once those repositories are enabled, you can install Tomcat and Hudson on an Ubuntu box by following these steps:</p>
<p>We start by installing Java and Tomcat. </p>
<pre>
<code>
# apt-get install sun-java6-jdk
# apt-get install tomcat5.5
</code>
</pre>
<p>Sun’s Java should be the default but if it is not, you can select the default Java by:</p>
<pre>
<code>
# update-alternatives --config java
</code>
</pre>
<p>Tomcat on Ubuntu comes with the security manager enabled by default and this will cause Hudson not to run.  You can disable the security manager by editing the <code>/etc/default/tomcat5.5</code> file.</p>
<p>Next we need to set the home directory for hudson.  Add the following line to <code>/etc/tomcat5.5/context.xml</code></p>
<pre>
<code>
&lt;Environment name="HUDSON_HOME" value="/srv/hudson" 
  type="java.lang.String" override="false"/&gt;
</code>
</pre>
<p>As you can see, I choose <code>/srv/hudson</code> as the home directory.  See the <a href="http://www.pathname.com/fhs/">FHS</a> for details on that choice.  Whichever directory you choose, create the directory and set the ownership so that the <code>tomcat55</code> user can use it and restart Tomcat:</p>
<pre>
<code>
# mkdir /srv/hudson
# chown tomcat55.nogroup /srv/hudson/
# /etc/init.d/tomcat restart
</code><code>
</code></pre>
<p>Now, simply deploy Hudson by copying the hudson.war file into the <code>/var/lib/tomcat5.5/webapps/</code> directory.  Tomcat will notice the new file and deploy it automatically.  Verify that it all works by pointing your browser to http://hostname:8180/hudson/ To update Hudson simply copy the new hudson.war file to the same location, overwriting the old.</p>
<p>If you wish to restrict access to Hudson, add the following two lines to <code>/etc/tomcat5.5/tomcat-users.xml</code>:</p>
<pre>
<code>
&lt;role rolename="admin"/&gt;
&lt;user username="hudson-admin" password="secret" roles="admin"/&gt;
</code>
</pre>
<p>Restart Tomcat and enable security in the Hudson System Configuration panel.  Users not logged in will still be able to access builds but cannot adjust the settings or force new builds.</p>
<p><strong>Update 2008-12-28:</strong></p>
<p>I just verified that the installation instructions are still valid on Ubuntu 8.10 using Tomcat 6.  All you have to do is replace tomcat55 with tomcat6 above; also, the port seem to have changed from 8180 to 8080.  Here&#8217;s an updated installation summary:</p>
<p>Install Java and Tomcat.</p>
<pre>
<code>
# apt-get install sun-java6-jdk
# apt-get install tomcat6
</code>
</pre>
<p>Configure or disable the security manager:</p>
<pre>
<code>
  # vi /etc/default/tomcat6
</code>
</pre>
<p>Set the home directory for Hudson by adding the follwowing line to <code>/etc/tomcat6/context.xml</code></p>
<pre>
<code>
&lt;Environment name="HUDSON_HOME" value="/srv/hudson" 
  type="java.lang.String" override="false"/&gt;
</code>
</pre>
<p>Create the home directory, set the permissions and restart Tomcat</p>
<pre>
<code>
# mkdir /srv/hudson
# chown tomcat6.nogroup /srv/hudson/
# /etc/init.d/tomcat6 restart
</code>
</pre>
<p>Deploy Hudson by copying the hudson.war file into the <code>/var/lib/tomcat6/webapps/</code> directory.  Verify that it works by pointing your browser to <code>http://hostname:8080/hudson/</code></p>
]]></content:encoded>
			<wfw:commentRss>http://malor.se/blog/?feed=rss2&#038;p=57</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Sixteen applications on my Mac</title>
		<link>http://malor.se/blog/?p=56</link>
		<comments>http://malor.se/blog/?p=56#comments</comments>
		<pubDate>Wed, 28 Nov 2007 19:36:25 +0000</pubDate>
		<dc:creator>Martin Altenstedt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://malor.se/blog/?p=56</guid>
		<description><![CDATA[I&#8217;ve added quite a few applications to my Mac over the last year. Here&#8217;s the list: Adobe Photoshop And I&#8217;ve paid for it. Aperture I take thousands of images each year and managing all those photos can be a real &#8230; <a href="http://malor.se/blog/?p=56">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve added quite a few applications to my Mac over the last year. Here&#8217;s the list:</p>
<dl>
<dt>
  <a href="http://www.adobe.com/products/photoshop/index.html">Adobe Photoshop</a>
</dt>
<dd>
  And I&#8217;ve paid for it.
</dd>
<dt>
  <a href="http://www.apple.com/aperture/">Aperture</a>
</dt>
<dd>
  I take thousands of images each year and managing all those photos can be a real problem.  Aperture (like <a href="http://www.adobe.com/products/photoshoplightroom/">Adobe Lightroom</a>) is designed for just that purpose.  Previously, I could hesitate taking pictures because I knew I had to sort them out later.  I don&#8217;t hesitate like that anymore.
</dd>
<dt>
  <a href="http://appzapper.com/">AppZapper</a>
</dt>
<dd>
  It truly is the application that should have been included with my Mac from the start.  I fail to see why Apple still has not bought the company and made it part of the OS X.
</dd>
<dt>
  <a href="http://discoapp.com/">Disco</a>
</dt>
<dd>
  Yeah, like you really need a CD burning program.  I bought it because my backup disks started spanning multiple DVDs and Disco handles that automatically.  And it smokes.  Like, really smokes.
</dd>
<dt>
  <a href="http://homepage.mac.com/zenitani/emacs-e.html">Emacs</a>
</dt>
<dd>
  Emacs.  Can&#8217;t do without Emacs.
</dd>
<dt>
  <a href="http://outerlevel.com/licensekeeper/">LicenseKeeper</a>
</dt>
<dd>
  LicenseKeeper keeps all those license keys in order.  Sounds a little silly; all you need is a text-file and a mail folder, no?  I dunno but LicenseKeeper is one of the neatest little utilities I&#8217;ve yet to come across.
</dd>
<dt>
  <a href="http://www.parallels.com/en/products/desktop/">Parallels</a>
</dt>
<dd>
  One of the reasons I bought a Mac was that with Intel Core Duo and Parallels you could run hardware supported virtualization, promising almost native performance for Microsoft Windows.  A year later, I can only attest to that promise: it works great.
</dd>
<dt>
  <a href="http://www.acqualia.com/picturesque/">Picturesque</a>
</dt>
<dd>
  Neat little thingie to batch process images for a small set of available effects.  It doesn&#8217;t do a lot but it does it really well.
</dd>
<dt>
  <a href="http://www.realmacsoftware.com/rapidweaver/">RapidWeaver</a>
</dt>
<dd>
  I looked for an alternative to <a href="http://www.apple.com/ilife/iweb/">iWeb</a> which is really underwhelming and RapidWeaver seemed an obvious choise.  It&#8217;s pretty neat when you want to make a site quickly, without any fuss.  If you like to fuss, this is not for you.
</dd>
<dt>
  <a href="http://www.literatureandlatte.com/scrivener.html">Scrivener</a>
</dt>
<dd>
  Don&#8217;t use it much anymore but if you are a writer, or needs to write something non-trivial, it makes a lot of sense for the capturing phase.  It&#8217;s not a word-processor and it&#8217;s not a mindmap thing. It&#8217;s somehwere in between&#8230; a note taking editor organizer, perhaps.
</dd>
<dt>
  <a href="http://c-command.com/spamsieve/">SpamSieve</a>
</dt>
<dd>
  I use Mail.app and the built in spam filter wasn&#8217;t good enough.  I was used to the excellent performance of bogofilter on my Debian box and needed something just as good for the Mac.  SpamSieve is good.  I don&#8217;t get as good results as with bogofilter, but close.
</dd>
<dt>
  <a href="http://www.shirt-pocket.com/SuperDuper/">SuperDuper!</a>
</dt>
<dd>
  Stupid name but a nice backup application.  In Leopard there is Time Machine, of course, but SuperDuper! is still my choice since the application is so simple to use.  But who in their right mind puts an exclamation point in their product name?
</dd>
<dt>
  <a href="http://www.potionfactory.com/tangerine/">Tangerine!</a>
</dt>
<dd>
  Another application with an exclamation point in the name!  What&#8217;s wrong with these people?  I don&#8217;t use it much anymore.  It has a lot of promise but fails to deliver.  Needs an update!
</dd>
<dt>
  <a href="http://macromates.com/">TextMate</a>
</dt>
<dd>
  I got it for the buzz and because I heard that die-hard Emacs users where switching.  I quickly went back to Emacs again though.  I think that you can write plugins to TextMate in several different languages, which seems pretty interesting.  Of course, Emacs is not only an editor, it&#8217;s a full Lisp interpreter which makes it the <a href="http://www.gnu.org/fun/jokes/ed.msg.html">undisputed king</a> of all editors.
</dd>
<dt>
  <a href="http://www.panic.com/transmit/">Transmit</a>
</dt>
<dd>
  You&#8217;ll need a good ftp application and this is the one you are looking for.
</dd>
<dt>
  <a href="http://www.vmware.com/products/fusion/">VMware Fusion</a>
</dt>
<dd>
  I&#8217;ve always thought less of VMware because of how they case their company name, but they make good hypervisors.  I grew tired of Parallels lack of Linux support and got VMware Fusion to replace it.
</dd>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://malor.se/blog/?feed=rss2&#038;p=56</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Med nedpackat spö vid Svanån</title>
		<link>http://malor.se/blog/?p=55</link>
		<comments>http://malor.se/blog/?p=55#comments</comments>
		<pubDate>Mon, 11 Jun 2007 19:34:55 +0000</pubDate>
		<dc:creator>Martin Altenstedt</dc:creator>
				<category><![CDATA[Fiske]]></category>

		<guid isPermaLink="false">http://malor.se/blog/?p=55</guid>
		<description><![CDATA[När jag svänger in till parkeringen vid Svanån så lättar regnet som fallit under morgonen och jag bestämmer mig: idag ska jag ska inte ens tackla upp mitt spö förrän jag får syn på en fisk. Inget blindfiske här inte. &#8230; <a href="http://malor.se/blog/?p=55">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>När jag svänger in till parkeringen vid <a href="http://www.nissansfiske.se/">Svanån</a> så lättar regnet som fallit under morgonen och jag bestämmer mig: idag ska jag ska inte ens tackla upp mitt spö förrän jag får syn på en fisk. Inget blindfiske här inte. Det är varmt ute, men regnet som föll på vägen upp ger mig lite självförtroende. Början på juni, varmt med växlande sol och regn — det kan bli hur bra som helst. Så jag packar ner kaffe och lunch i ryggsäcken och ger mig ut i skogen för att se om jag inte kan få syn på vakande öring.</p>
<div class="myinlineimage">
  <a href="http://malor.se/20070605/2007-06-05 09-48-55.jpg"><img src="http://malor.se/20070605/2007-06-05 09-48-55 small.jpg" style="padding:2px" width="160" alt="Svanån" /></a><a href="http://malor.se/20070605/2007-06-05 09-57-43.jpg"><img src="http://malor.se/20070605/2007-06-05 09-57-43 small.jpg" style="padding:2px" width="80" alt="Svanån" /></a><a href="http://malor.se/20070605/2007-06-05 09-58-51.jpg"><img src="http://malor.se/20070605/2007-06-05 09-58-51 small.jpg" style="padding:2px" width="160" alt="Svanån" /></a>
<p>
  Det är väldigt praktiskt med ett fyrdelat spö. Det är enkelt att ta med sig och om man, som jag gör idag, vandrar utefter ån så är det väldigt smidigt att ha en så kort förpackning med sig. Jag köpte spöt som ett komplement, för att jag skulle kunna ha det med mig på en resa, men nu för tiden så använder jag inte något annat.
  </p>
</div>
<p>Åtminstone ytterligare någon person har varit och gått längs ån sedan jag var här sist för två veckor sedan, jag ser tydliga spår kring parkeringen vid Svanån. Men nedströms, mellan vägbron och parkeringen så är det som om jag är den första som går här denna säsongen. Bitvis är det lite knepigt att ta sig fram eftersom det fortfarande ligger fällen från Gudrun och Per och det kanske är därför som det ser ut att vara så lite folk som är här och fiskar. Jag skrämmer upp en älgkalv som är nere och dricker och det känns som om ån är bara min idag.</p>
<p>Jag spanar och letar efter vak eller andra tecken som kan avslöja en fisk, men solen bryter snart igenom molntäcket och vattnet är minst lika lågt som det var sist. Jag känner på mig att fiskespöt kanske inte kommer fram ur ryggsäcken alls idag. Solen stiger högre på himlen och temperaturen närmar sig 25 grader. Jag sätter mig ner i mossan med en gran som ryggstöd där jag har utsikt över en fin sväng som ån gör över en liten nacke och äter min medhavda soppa. När maten är slut och kaffet urdrucket så har jag fortfarande inte fått se någon fisk tillräckligt stor att fiska på. En del småöring sprätter efter dagsländor som kläcker i enstaka exemplar men de större fiskarna verkar föredra de nedre regionerna.</p>
<div class="myinlineimage">
  <a href="http://malor.se/20070605/2007-06-05 10-13-07.jpg"><img src="http://malor.se/20070605/2007-06-05 10-13-07 small.jpg" style="padding:2px" width="140" alt="Svanån" /></a><a href="http://malor.se/20070605/2007-06-05 10-50-53.jpg"><img src="http://malor.se/20070605/2007-06-05 10-50-53 small.jpg" style="padding:2px" width="140" alt="Svanån" /></a><a href="http://malor.se/20070605/2007-06-05 10-55-56.jpg"><img src="http://malor.se/20070605/2007-06-05 10-55-56 small.jpg" style="padding:2px" width="140" alt="Svanån" /></a>
<p>
  Det kliar lite i fingrarna att lägga ut en nymf i den lite djupare strömmen under bron vid parkeringen. Här står ofta regnbåge och lurar bakom stenarna. Men jag har bestämt mig: inget fiskande om jag inte får syn på fisk och spöt förblir i sitt fodral. Att låta bli att fiska är faktiskt ett bra sätt att njuta av Svanån. Den småländska skogen står grön och vacker, inbjudande till strövande nu under juni. Allemansrätten är en underbar uppfinning!
  </p>
</div>
<p>Om jag hade kunnat stanna till kvällen så kanske det hade kunnat bli väldigt annorlunda. Värmen kan kanske få någon kläckning att komma igång och när solen går ner över skogen så kanske det hade kunnat bli ett riktigt fint fiske. Många kanske men strömmande vatten kan verkligen byta personlighet när kvällen kommer och solen sjunker ner bakom träden. Jag stannar en stund efter lunch men måste sedan ge mig av igen. Det har varit en fin dag i skogen, fåglarna har tystnat allt mer de de senaste veckorna men jag får faktiskt höra göken spela, kanske för sista gången i år?</p>
]]></content:encoded>
			<wfw:commentRss>http://malor.se/blog/?feed=rss2&#038;p=55</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
