<?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>endjin blog</title>
	<atom:link href="http://blogs.endjin.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.endjin.com</link>
	<description>work smarter</description>
	<lastBuildDate>Fri, 24 May 2013 09:44:35 +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>Windows Run Commands for Developers</title>
		<link>http://blogs.endjin.com/2013/05/windows-run-commands-for-developers/</link>
		<comments>http://blogs.endjin.com/2013/05/windows-run-commands-for-developers/#comments</comments>
		<pubDate>Fri, 24 May 2013 00:00:43 +0000</pubDate>
		<dc:creator>Pascal Arnould</dc:creator>
				<category><![CDATA[Work Smarter Not Harder]]></category>
		<category><![CDATA[8]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blogs.endjin.com/?p=10202</guid>
		<description><![CDATA[<p>The other day I wanted to bring up the Windows "Program and Features" panel using the run command (Win+R or just start typing in the Start screen in Win 8). ... Open the Run Dialog (Win+R) and type in %windir% Once Windows Explorer is open, select New item &#62; Shortcut in the menu (or right-click somewhere in the blank area) Create the shortcut using the wizard specifying the alias for the run command (e.g. st3) <img src="http://blogs.endjin.com/wp-content/uploads/2013/05/201305232237.jpg" width="452" height="335" alt="201305232237.jpg" /> <img src="http://blogs.endjin.com/wp-content/uploads/2013/05/201305232241.jpg" width="450" height="334" alt="201305232241.jpg" /> From now on, you will be able to quickly open your program either by typing the command on the start page (if you're using Windows 8) or in the Run Dialog.</p>]]></description>
				<content:encoded><![CDATA[<p>The other day I wanted to bring up the Windows &#8220;Program and Features&#8221; panel using the run command (Win+R or just start typing in the Start screen in Win 8). Something I&#8217;ve done countless number of times in the past. For some reason, I had a complete blank and couldn&#8217;t recall what that particular command was. So I thought it would be good to have a couple of tips and some of the most useful run commands of Developers (and everybody else) in one place.</p>
<p><img alt="201305210936.jpg" src="http://blogs.endjin.com/wp-content/uploads/2013/05/201305210936.jpg" width="427" height="236" /></p>
<h2>Run… Program</h2>
<p>If you enable indexing on your Program Files folders, all your programs will then be available either in the Run dialog or in the Windows 8 start screen.</p>
<p>1. Go to the <b>Control Panel</b></p>
<p>2. Type in <b>Indexing</b> in the search box</p>
<p>3. Open the <b>Indexing Options</b> dialog</p>
<p>4. Click on <b>Modify</b> and select your Program Files folders</p>
<p><img alt="201305241000.jpg" src="http://blogs.endjin.com/wp-content/uploads/2013/05/201305241000.jpg" width="341" height="480" /></p>
<p>You should then see the folders in the Included Locations list:</p>
<p><img alt="201305240947.jpg" src="http://blogs.endjin.com/wp-content/uploads/2013/05/201305240947.jpg" width="442" height="480" /></p>
<p>Close the Indexing Options window. Once indexing is completed, you can start your programs using the Run dialog.</p>
<p>For example, I can now launch <a title="Sublime Text" href="http://www.sublimetext.com">Sublime Text</a> like this:</p>
<p><img alt="201305241003.jpg" src="http://blogs.endjin.com/wp-content/uploads/2013/05/201305241003.jpg" width="427" height="236" /></p>
<h2>But did you know?</h2>
<p>You can create your own run commands. Here&#8217;s an example on how to create a run command for <a href="http://www.sublimetext.com">Sublime Text</a>.</p>
<ol>
<li>Open the Run Dialog (Win+R) and type in <b>%windir%</b></li>
<li>Once Windows Explorer is open, select <b>New item &gt; Shortcut</b> in the menu (or right-click somewhere in the blank area)</li>
<li>Create the shortcut using the wizard specifying the alias for the run command (e.g. st3)</li>
</ol>
<p><img alt="201305232237.jpg" src="http://blogs.endjin.com/wp-content/uploads/2013/05/201305232237.jpg" width="452" height="335" /></p>
<p><img alt="201305232241.jpg" src="http://blogs.endjin.com/wp-content/uploads/2013/05/201305232241.jpg" width="450" height="334" /><br />
From now on, you will be able to quickly open your program either by typing the command on the start page (if you&#8217;re using Windows 8) or in the Run Dialog.</p>
<h2>Run Commands Cheat sheet</h2>
<table border="1" cellpadding="10">
<tbody>
<tr>
<th>Description</th>
<th>Command</th>
</tr>
<tr>
<td>About Windows</td>
<td>winver</td>
</tr>
<tr>
<td>Add Hardware Wizard</td>
<td>hdwwiz.cpl</td>
</tr>
<tr>
<td>Add/Remove Programs</td>
<td>appwiz.cpl</td>
</tr>
<tr>
<td>Administrative Tools</td>
<td>control admintools</td>
</tr>
<tr>
<td>Advanced Startup Options</td>
<td>bootim</td>
</tr>
<tr>
<td>Advanced User Accounts</td>
<td>netplwiz</td>
</tr>
<tr>
<td>Application Data Folder</td>
<td>%appdata%</td>
</tr>
<tr>
<td>Authorization manager</td>
<td>azman.msc</td>
</tr>
<tr>
<td>Calculator</td>
<td>calc</td>
</tr>
<tr>
<td>Certificate Manager</td>
<td>certmgr.msc</td>
</tr>
<tr>
<td>Performance Options</td>
<td>systempropertiesperformance</td>
</tr>
<tr>
<td>Character Map</td>
<td>charmap</td>
</tr>
<tr>
<td>Check Disk Utility</td>
<td>chkdsk</td>
</tr>
<tr>
<td>ClearType Tuner</td>
<td>cttune</td>
</tr>
<tr>
<td>Colour Management</td>
<td>colorcpl</td>
</tr>
<tr>
<td>Command Prompt</td>
<td>cmd</td>
</tr>
<tr>
<td>Compare files</td>
<td>comp</td>
</tr>
<tr>
<td>Computer Management</td>
<td>compmgmt.msc</td>
</tr>
<tr>
<td>Control Panel</td>
<td>control</td>
</tr>
<tr>
<td>Device Manager</td>
<td>devmgmt.msc</td>
</tr>
<tr>
<td>Disk Cleanup Utility</td>
<td>cleanmgr</td>
</tr>
<tr>
<td>Disk Management</td>
<td>diskmgmt.msc</td>
</tr>
<tr>
<td>Disk Partition Manager</td>
<td>diskpart</td>
</tr>
<tr>
<td>Screen Resolution</td>
<td>desk.cpl</td>
</tr>
<tr>
<td>Display Switch</td>
<td>displayswitch</td>
</tr>
<tr>
<td>Ease of Access Center</td>
<td>utilman</td>
</tr>
<tr>
<td>Event Viewer</td>
<td>eventvwr.msc</td>
</tr>
<tr>
<td>File History</td>
<td>filehistory</td>
</tr>
<tr>
<td>Firewall</td>
<td>firewall.cpl</td>
</tr>
<tr>
<td>Folders Properties</td>
<td>control folders</td>
</tr>
<tr>
<td>Fonts Folder</td>
<td>fonts</td>
</tr>
<tr>
<td>Home Drive</td>
<td>%homedrive%</td>
</tr>
<tr>
<td>Home Directory</td>
<td>%homepath%</td>
</tr>
<tr>
<td>Internet Explorer</td>
<td>iexplore</td>
</tr>
<tr>
<td>Internet Options</td>
<td>inetcpl.cpl</td>
</tr>
<tr>
<td>Keyboard Properties</td>
<td>control keyboard</td>
</tr>
<tr>
<td>Local Group Policy Editor</td>
<td>gpedit.msc</td>
</tr>
<tr>
<td>Local Users and Groups</td>
<td>lusrmgr.msc</td>
</tr>
<tr>
<td>Log Off Windows</td>
<td>logoff</td>
</tr>
<tr>
<td>Magnifier</td>
<td>magnify</td>
</tr>
<tr>
<td>Microsoft Management Console</td>
<td>mmc</td>
</tr>
<tr>
<td>Microsoft Paint</td>
<td>mspaint</td>
</tr>
<tr>
<td>Mouse Properties</td>
<td>control mouse</td>
</tr>
<tr>
<td>Network Connections</td>
<td>control netconnections</td>
</tr>
<tr>
<td>Notepad</td>
<td>notepad</td>
</tr>
<tr>
<td>On Screen Keyboard</td>
<td>osk</td>
</tr>
<tr>
<td>Paint</td>
<td>mspaint</td>
</tr>
<tr>
<td>Performance Monitor</td>
<td>perfmon</td>
</tr>
<tr>
<td>Power Configuration</td>
<td>powercfg.cpl</td>
</tr>
<tr>
<td>Program Files folder</td>
<td>%programfiles%</td>
</tr>
<tr>
<td>Region and Language Settings</td>
<td>intl.cpl</td>
</tr>
<tr>
<td>Registry Editor</td>
<td>regedit</td>
</tr>
<tr>
<td>Remote Desktop</td>
<td>mstsc</td>
</tr>
<tr>
<td>Restart Windows</td>
<td>shutdown -r</td>
</tr>
<tr>
<td>Scheduled Tasks</td>
<td>control schedtasks</td>
</tr>
<tr>
<td>Security Center</td>
<td>wscui.cpl</td>
</tr>
<tr>
<td>Services</td>
<td>services.msc</td>
</tr>
<tr>
<td>Shared Folders</td>
<td>fsmgmt.msc</td>
</tr>
<tr>
<td>Shutdown Windows</td>
<td>shutdown</td>
</tr>
<tr>
<td>Snipping Tool</td>
<td>snippingtool</td>
</tr>
<tr>
<td>Sounds and Audio</td>
<td>mmsys.cpl</td>
</tr>
<tr>
<td>Backup/Restore User Names and Passwords</td>
<td>credwiz</td>
</tr>
<tr>
<td>System Configuration</td>
<td>msconfig</td>
</tr>
<tr>
<td>System Information</td>
<td>msinfo32.</td>
</tr>
<tr>
<td>System Properties</td>
<td>sysdm.cpl</td>
</tr>
<tr>
<td>Task Manager</td>
<td>taskmgr</td>
</tr>
<tr>
<td>Temporary Folder</td>
<td>%temp%</td>
</tr>
<tr>
<td>Time and Date Settings</td>
<td>timedate.cpl</td>
</tr>
<tr>
<td>User Account Control Settings</td>
<td>useraccountcontrolsettings</td>
</tr>
<tr>
<td>Volume Control</td>
<td>sndvol</td>
</tr>
<tr>
<td>Windows Explorer</td>
<td>explorer</td>
</tr>
<tr>
<td>Windows PowerShell ISE</td>
<td>powershell_ise</td>
</tr>
<tr>
<td>Windows PowerShell</td>
<td>powershell</td>
</tr>
<tr>
<td>Windows Root Directory</td>
<td>%windir%</td>
</tr>
<tr>
<td>Windows Root Drive</td>
<td>%systemdrive%</td>
</tr>
<tr>
<td>WMI Management</td>
<td>wmimgmt.msc</td>
</tr>
<tr>
<td>WMI Tester</td>
<td>wbemtest</td>
</tr>
<tr>
<td>XPS Viewer</td>
<td>xpsrchvw</td>
</tr>
</tbody>
</table>
<p>This list is intentionally cut down as I don&#8217;t think a lot of the other commands are that relevant. If you want a more comprehensive list check out one of these links:<br />
<a title="complete list of Windows 8 run commands" href="http://pcsupport.about.com/od/commandlinereference/a/run-commands-windows-8.htm">Complete List of Windows 8 Run Commands</a><br />
<a href="http://www.keyboard-shortcut.com/windows/run.php">Run… Command</a></p>
<p><a title="Twitter" href="https://twitter.com/TheBooleanFrog">Pascal Arnould on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.endjin.com/2013/05/windows-run-commands-for-developers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Introducing endjin composition framework 2.0 : Part 3 &#8211; Using the content factory</title>
		<link>http://blogs.endjin.com/2013/05/introducing-endjin-composition-framework-2-0-part-3-using-the-content-factory/</link>
		<comments>http://blogs.endjin.com/2013/05/introducing-endjin-composition-framework-2-0-part-3-using-the-content-factory/#comments</comments>
		<pubDate>Thu, 23 May 2013 07:00:34 +0000</pubDate>
		<dc:creator>Mike.Larah</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[OSS]]></category>
		<category><![CDATA[Samples]]></category>
		<category><![CDATA[Dependency Injection]]></category>
		<category><![CDATA[Endjin Composition]]></category>

		<guid isPermaLink="false">http://blogs.endjin.com/?p=8272</guid>
		<description><![CDATA[As I explained in this post, the framework provides a set of installers for registering components against interfaces in the container. Another powerful tool in the composition framework is the ContentFactory. This provides methods for registering and getting content based on a contentType string. When getting content, if the contentType is not found in the [...]]]></description>
				<content:encoded><![CDATA[<p>As I explained in <a href="http://wp.me/p19Amb-1Zg">this post</a>, the framework provides a set of installers for registering components against interfaces in the container.</p>
<p>Another powerful tool in the composition framework is the <code>ContentFactory</code>. This provides methods for registering and getting content based on a <code>contentType</code> string. When getting content, if the <code>contentType</code> is not found in the container, it will try to fallback using substrings of <code>contentType</code> by progressively removing sections after a <code>.</code></p>
<p>As an example, we might have some serializers that inherit from <code>ISerializer</code>.</p>
<script src="https://gist.github.com/e2c0fa287e7f4524b2ee.js"></script><noscript><pre><code class="language-c# c#">public class FooSerializer : ISerializer
{
}

public class BarSerializer : ISerializer
{
}

public class FooBarSerializer : ISerializer
{
}</code></pre></noscript>
<p>We can create a new <code>SerializerFactory</code> that inherits from <code>ContentFactory</code>.</p>
<script src="https://gist.github.com/6151fa3b39fe121648f4.js"></script><noscript><pre><code class="language-c# c#">public class SerializerFactory : ContentFactory&lt;ISerializer&gt;, ISerializerFactory
{
    private const string Extension = &quot;+Serializer&quot;;

    public override void RegisterContentFor&lt;TInstance&gt;(string contentType)
    {
        base.RegisterContentFor&lt;TInstance&gt;(contentType + Extension);
    }

    public override ISerializer GetContentFor(string contentType)
    {
        return base.GetContentFor(contentType + Extension);
    }
}</code></pre></noscript>
<p>Then we use a custom installer to register the factory as a singleton, and also to register our default content (i.e. the serializers).</p>
<script src="https://gist.github.com/9a7a26abd167ef418ae4.js"></script><noscript><pre><code class="language-c# c#">public class SerializerFactoryInstaller : IInstaller
{
    public void Install(IContainer container)
    {
        var serializerFactory = new SerializerFactory();
              container.Register(Component.For&lt;ISerializerFactory&gt;).Instance(serializerFactory).LifeStyle.Singleton);

        RegisterDefaultContent(serializerFactory);
    }

    private static void RegisterDefaultContent(SerializerFactory serializerFactory)
    {
        serializerFactory.RegisterContentFor&lt;FooSerializer&gt;(&quot;Foo&quot;);
        serializerFactory.RegisterContentFor&lt;BarSerializer&gt;(&quot;Bar&quot;);
        serializerFactory.RegisterContentFor&lt;FooBarSerializer&gt;(&quot;Foo.Bar&quot;);
    }
}</code></pre></noscript>
<p>We are now able to use the <code>SerializerFactory.GetContentFor(string contentType)</code> method to retrieve our serializers by the name we registered them with:</p>
<ul>
<li><code>SerializerFactory.GetContentFor("Foo")</code> will return <code>FooSerializer</code></li>
<li><code>SerializerFactory.GetContentFor("Foo.Bar")</code> will return <code>FooBarSerializer</code></li>
<li><code>SerializerFactory.GetContentFor("Foo.Bar.Baz")</code> will fallback to contentType of &#8220;Foo.Bar&#8221; and return <code>FooBarSerializer</code></li>
</ul>
<p>In the next post I&#8217;ll show you how to get set up with endjin composition framework in an MVC4 / WebAPI application.</p>
<p><a href="http://twiiter.com/MikeLarah">@MikeLarah</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.endjin.com/2013/05/introducing-endjin-composition-framework-2-0-part-3-using-the-content-factory/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Retrying tasks with TPL, async and synchronous code</title>
		<link>http://blogs.endjin.com/2013/05/retrying-tasks-with-tpl-async-and-synchronous-code/</link>
		<comments>http://blogs.endjin.com/2013/05/retrying-tasks-with-tpl-async-and-synchronous-code/#comments</comments>
		<pubDate>Thu, 23 May 2013 07:00:00 +0000</pubDate>
		<dc:creator>Matthew Adams</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[OSS]]></category>

		<guid isPermaLink="false">http://blogs.endjin.com/?p=10092</guid>
		<description><![CDATA[In this world, we have to face up to the horrible possibility of failure. Sometimes, that failure is irrecoverable. There’s no going back. Sometimes, we can have another bash at it and see if it comes out OK the second time around. Or maybe the third. Or the fourth. In the software business, historically, we’ve [...]]]></description>
				<content:encoded><![CDATA[<p>In this world, we have to face up to the horrible possibility of failure. Sometimes, that failure is irrecoverable. There’s no going back. Sometimes, we can have another bash at it and see if it comes out OK the second time around. Or maybe the third. Or the fourth.</p>
<p>In the software business, historically, we’ve kind of got away with assuming that everything is going to work fine. Resources are ‘just there’ when we ask for them. They don’t mysteriously disappear only to  reappear a moment later. Tasks complete if you set them going…</p>
<p>Of course, that was never really true before, and the unreality of that attitude is all the more obvious when dealing with cloud services.  Here resources really can be temporarily missing, refused or moved. Tasks may begin and never complete because our thread has suspended or died in some virtual infrastructure, only to be resurrected again later.</p>
<p>When we start an operation that may potentially fail, there are a few failure scenarios that could play out:</p>
<p>1) A catastrophic error has occurred, so we want to propagate that exception straight out to the caller</p>
<p>2) A potentially transient error has occurred, so we want to retry the exact same operation again</p>
<p>3) We want to abandon the operation</p>
<p>Abandoning the operation is straightforward. We can use the standard .NET CancellationToken mechanism.</p>
<p>Scenarios 1 and 2 require a Retry mechanism of some kind,</p>
<p>For those, we’ve provided the <a href="http://nuget.org/packages/Endjin.Retry/" target="_blank">Endjin Retry Framework</a>. (That link takes you to the nuget package download.) <a href="https://github.com/endjin/Endjin.Retry" target="_blank">Source code is also available</a>, along with <a href="https://github.com/endjin/Endjin.Retry/tree/master/Solutions/Endjin.Retry.Samples" target="_blank">a sample</a>.</p>
<h2>Policy</h2>
<p>Policies are used to determine whether we should consider retrying at all, given that a particular exception has occurred The default policy is AnyException &#8211; you can always retry regardless of the particular exception or its content</p>
<p>We also provide an AggregatePolicy which allows you to retry if and only if all of a set of policies allow you to retry.</p>
<p>It is up to you to write custom policy if you want particular exceptions to be &#8220;non-retryable&#8221; For example, you might set up a policy that does not allow you to retry if you get a 404 (not found) from an http operation, but does retry if you get a 501 (internal server error). To do this, you implement the  (very simple) IRetryPolicy interface.</p>
<script src="https://gist.github.com/5631180.js"></script><noscript><pre><code class="language-c# c#">public class AnyException : IRetryPolicy
{
    public bool CanRetry(Exception exception)
    {
        return true;
    }
}
</code></pre></noscript>
<h2>Strategy</h2>
<p>The strategy determines how a task is retried. There are two phases to this. In the first phase, we prepare to retry given a particular exception, and calculate an optional delay before we retry the operation. In the second phase, the framework checks whether we are allowed to attempt a retry (we haven’t, for example, exceeded some maximum number of retries).</p>
<p>The strategy also aggregates the exceptions that caused us to require a retry attempt, and raises a Retrying event just before a retry attempt occurs.</p>
<p>We provide three strategies in the box:</p>
<p><strong>Count</strong>: will retry immediately up to a maximum number of times</p>
<p><strong>Incremental</strong>: retries up to a maximum number of times, with an (optionally increasing) delay between retries.</p>
<p><strong>Backoff</strong>: is similar to Incremental, but provides an exponentially increasing delay between retries, with a random element.</p>
<p><em>Note &#8211; you don&#8217;t want to use the Incremental or BackOff strategies in Windows Azure. It is better to hammer the fabric and let it adapt to your preferred usage pattern.</em></p>
<p>If you want to implement your own strategy, you inherit from RetryStrategy and override the PrepareToRetry() and CanRetry() methods. Here’s an example.</p>
<script src="https://gist.github.com/5631223.js"></script><noscript><pre><code class="language-c# c#">public class Count : RetryStrategy
{
    private readonly int maxTries;
    private int tryCount;

    public Count()
        : this(5)
    {
    }

    public Count(int maxTries)
    {
        this.maxTries = maxTries;
    }

    public override bool CanRetry
    {
        get
        {
            return this.tryCount &lt; this.maxTries;
        }
    }

    public override TimeSpan PrepareToRetry(Exception lastException)
    {
        this.AddException(lastException);

        this.tryCount += 1;

        return TimeSpan.Zero;
    }
}</code></pre></noscript>
<h2>Scenario One: TPL</h2>
<p>If you want to start a new Task using the TPL, but automatically retry that task using our retry framework, we provide a source-compatible replacement for Task&lt;T&gt;.Factory.StartNew() and Task.Factory.StartNew() called RetryTask&lt;T&gt;.Factory.StartNew(), and RetryTask.Factory.StartNew().</p>
<p>Each of the overloads also takes additional optional parameters for the Strategy and Policy, defaulting to AnyException and Count (with a maximum of 5 retries).</p>
<p>Here’s an example of that.</p>
<script src="https://gist.github.com/5631329.js"></script><noscript><pre><code class="language-c# c#">ISomeService someTasks = new MyService();
var result = await RetryTask&lt;string&gt;.Factory.StartNew(
    () =&gt; someTasks.SecondTask(someTasks.FirstTask()), new Count(10));
</code></pre></noscript>
<h2>Scenario Two: Async</h2>
<p>Sometimes, you are using the async/await pattern and need to call an async method. In that case, you can use our Retriable.RetryAsync() method.</p>
<script src="https://gist.github.com/5631346.js"></script><noscript><pre><code class="language-c# c#">private static async Task RunAsync()
{
    ISomeService someTasks = new MyService();
    var result = await Retriable.RetryAsync(() =&gt; SomeFuncAsync(someTasks));
}

private static async Task&lt;string&gt; SomeFuncAsync(ISomeService someTasks)
{
    var response = await someTasks.FirstTaskAsync();
    return await someTasks.SecondTaskAsync(response);
}</code></pre></noscript>
<p>This also works for inline async delegates</p>
<script src="https://gist.github.com/5631354.js"></script><noscript><pre><code class="language-c# c#">ISomeService someTasks = new MyService();
var result = await Retriable.RetryAsync(
    async delegate
    {
        var response = await someTasks.FirstTaskAsync();
        return await someTasks.SecondTaskAsync(response);                
    });
</code></pre></noscript>
<h2>Scenario Three: Synchronous</h2>
<p>Finally, it works just as well for a synchronous method.</p>
<script src="https://gist.github.com/5631363.js"></script><noscript><pre><code class="language-c# c#">ISomeService someTasks = new MyService();
var result = Retriable.Retry(() =&gt; someTasks.SecondTask(someTasks.FirstTask()));
</code></pre></noscript>
]]></content:encoded>
			<wfw:commentRss>http://blogs.endjin.com/2013/05/retrying-tasks-with-tpl-async-and-synchronous-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Learning To Program &#8211; A Beginners Guide &#8211; Part Two</title>
		<link>http://blogs.endjin.com/2013/05/learning-to-program-a-beginners-guide-part-two/</link>
		<comments>http://blogs.endjin.com/2013/05/learning-to-program-a-beginners-guide-part-two/#comments</comments>
		<pubDate>Mon, 20 May 2013 07:00:22 +0000</pubDate>
		<dc:creator>Matthew Adams</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Learning to program]]></category>

		<guid isPermaLink="false">http://blogs.endjin.com/?p=9652</guid>
		<description><![CDATA[In part two of this series, we&#8217;re going to get set up with an environment in which we can execute code. If you&#8217;re running a version of Windows on your desktop/laptop, then this is the post for you. If you&#8217;re running a version of Linux on your desktop/laptop, then this is the one you need. [...]]]></description>
				<content:encoded><![CDATA[<p>In part two of this series, we&#8217;re going to get set up with an environment in which we can execute code.</p>
<p>If you&#8217;re running a version of Windows on your desktop/laptop, <a href="http://blogs.endjin.com/2013/05/a-step-by-step-guide-to-installing-an-f-repl-environment-on-windows/" title="A step by step guide to installing an F# REPL environment on Windows">then this is the post</a> for you.</p>
<p>If you&#8217;re running a version of Linux on your desktop/laptop, <a href="http://blogs.endjin.com/2013/05/a-step-by-step-guide-to-installing-an-f-repl-environment-on-linux/" title="A step by step guide to installing an F# REPL environment on Linux">then this is the one</a> you need.</p>
<p><a href="http://blogs.endjin.com/2013/05/learning-to-program-a-beginners-guide-part-one-introduction/" title="Learning To Program – A Beginners Guide – Part One">Learning To Program – A Beginners Guide – Part One &#8211; Introduction</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.endjin.com/2013/05/learning-to-program-a-beginners-guide-part-two/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A step by step guide to installing an F# REPL environment on Linux</title>
		<link>http://blogs.endjin.com/2013/05/a-step-by-step-guide-to-installing-an-f-repl-environment-on-linux/</link>
		<comments>http://blogs.endjin.com/2013/05/a-step-by-step-guide-to-installing-an-f-repl-environment-on-linux/#comments</comments>
		<pubDate>Mon, 20 May 2013 07:00:00 +0000</pubDate>
		<dc:creator>Matthew Adams</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Step by Step Guides]]></category>

		<guid isPermaLink="false">http://blogs.endjin.com/?p=7082</guid>
		<description><![CDATA[Getting set up on Linux Installing on Linux is a bit more complicated than installing on Windows. I&#8217;m assuming that if you&#8217;ve opted for Linux, you&#8217;ve got a bit more technical experience. I hope so, or some of this is going to be a bit confusing! I&#8217;ve used Ubuntu Linux 12.10 in a default desktop [...]]]></description>
				<content:encoded><![CDATA[<h2>Getting set up on Linux</h2>
<p>Installing on Linux is a bit more complicated than installing on Windows. I&#8217;m assuming that if you&#8217;ve opted for Linux, you&#8217;ve got a bit more technical experience. I hope so, or some of this is going to be a bit confusing! I&#8217;ve used Ubuntu Linux 12.10 in a default desktop install for these instructions. Your mileage may vary with other flavours. You&#8217;ll also need at least 2GB of RAM in the computer, and plenty of free disk space.</p>
<p>To get started, you need to open up a Terminal, which we&#8217;re going to use to install some packages to set up our programming environment.</p>
<p>We&#8217;re going to use a tool called &#8216;apt-get&#8217; to pull these packages down, along with a tool called &#8216;sudo&#8217; to give apt-get permission to make changes to our system as it installs the packages.</p>
<p>At any stage, it is also possible that sudo will ask you for your password to allow the package to be installed. Just check that it is really sudo that is asking, and input your password if required.</p>
<p>The first package to install is Mono Develop. Type the following line, and press enter.</p>
<p><code>sudo apt-get install mono-devel</code></p>
<p>A bunch of information will scroll past, and then it will ask: Do you want to continue [Y/n]? Just hit enter (for &#8216;yes&#8217;). It should all install OK, spewing a load of information at you as it does so.</p>
<p>Then, we need the mono compiler (type the line and press enter as before)</p>
<p><code>sudo apt-get install mono-gmcs</code></p>
<p>A bunch of information will scroll past, again, before it asks: Do you want to continue [Y/n]? Just hit enter (for &#8216;yes&#8217;). It should all install OK.</p>
<p>We also need a package called autoconf.</p>
<p><code>sudo apt-get install autoconf</code></p>
<p>Another bunch of information will scroll past, and then it will ask: Do you want to continue [Y/n]? Hit enter (for &#8216;yes&#8217;) as before to complete installation.</p>
<p>Then there&#8217;s a package called libtool</p>
<p><code>sudo apt-get install libtool</code></p>
<p>Another bunch of information will scroll past, and then it will ask: Do you want to continue [Y/n]? Hit enter (for &#8216;yes&#8217;) once again, and all should proceed happily.</p>
<p>Still not done. Now we need a package called g++</p>
<p><code>sudo apt-get install g++</code></p>
<p>Guess what. It asks: Do you want to continue [Y/n]? Hit enter (for &#8216;yes&#8217;) once again, and all should proceed happily. (You should be pretty familiar with apt-get by now.)</p>
<p>Then, we need to install a package called &#8216;git&#8217;</p>
<p><code>sudo apt-get install git</code></p>
<p>Again, a bunch of information will scroll past, and again it will ask: Do you want to continue [Y/n]?. Hit enter (for yes), again.</p>
<p>Now, we&#8217;re going to use git to pull down a later version of our Mono runtime (Version 3.0)</p>
<p><code>git clone <a href="https://github.com/mono/mono">https://github.com/mono/mono</a></code></p>
<p>You&#8217;ll see some progress as it downloads (it will take a few minutes). Once it is down, we need to build and install it. So, switch to the mono directory:</p>
<p><code>cd mono</code></p>
<p>Then, we generate the build scripts for mono:</p>
<p><code>./autogen.sh</code></p>
<p>(Lots and lots of scrolling information, downloaded packages etc…)</p>
<p>Build mono:</p>
<p><code>make</code></p>
<p>(Plenty more of the scrolling text, consuming several more minutes of your life…maybe half an hour or so. Go and get something to drink.)</p>
<p>And install mono:</p>
<p><code>sudo make install</code></p>
<p>If that was all OK, we can move back up out of the mono folder.</p>
<p><code>cd ..</code></p>
<p>Right. With that done, we&#8217;re now going to use git to pull down the F# development tools.</p>
<p><code>git clone <a href="https://github.com/fsharp/fsharp">https://github.com/fsharp/fsharp</a></code></p>
<p>You&#8217;ll see some progress as it downloads. Next, switch to the fsharp directory</p>
<p><code>cd fsharp</code></p>
<p>Generate the F# build scripts:</p>
<p><code>./autogen.sh</code></p>
<p>(Lots and lots of scrolling information, downloaded packages etc…)</p>
<p>Build F#:</p>
<p><code>make</code></p>
<p>(Plenty more of the scrolling text, consuming yet more of your life…maybe another half an hour or so. Perhaps it is time to go and buy some healthy snacks.)</p>
<p>And install F#:</p>
<p><code>sudo make install</code></p>
<p>If that was all OK, we can move back up out of the fsharp folder.</p>
<p><code>cd ..</code></p>
<p>Now, we can start the interactive fsharp environment.</p>
<p><code>fsharpi</code></p>
<p><a href="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image0011.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="clip_image001" alt="clip_image001" src="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image001_thumb1.png" width="244" height="184" border="0" /></a></p>
<p>You should see the F# interactive environment start up as in the image above.</p>
<p>To quit the interactive F# environment, type</p>
<p><code>#quit;;</code></p>
<p><a href="http://twitter.com/ythos">Matthew Adams on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.endjin.com/2013/05/a-step-by-step-guide-to-installing-an-f-repl-environment-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A step by step guide to installing an F# REPL environment on Windows</title>
		<link>http://blogs.endjin.com/2013/05/a-step-by-step-guide-to-installing-an-f-repl-environment-on-windows/</link>
		<comments>http://blogs.endjin.com/2013/05/a-step-by-step-guide-to-installing-an-f-repl-environment-on-windows/#comments</comments>
		<pubDate>Mon, 20 May 2013 07:00:00 +0000</pubDate>
		<dc:creator>Matthew Adams</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Step by Step Guides]]></category>

		<guid isPermaLink="false">http://blogs.endjin.com/?p=7052</guid>
		<description><![CDATA[Getting set up on Windows You need to be running Windows 7 or Windows 8 (or later). If you&#8217;re running Windows Vista or Windows XP, I&#8217;m sorry, but this isn&#8217;t going to work for you. First, we need to make sure that the .NET Framework V4.5 is installed. If you happen to have installed Visual [...]]]></description>
				<content:encoded><![CDATA[<h2>Getting set up on Windows</h2>
<p>You need to be running Windows 7 or Windows 8 (or later).</p>
<p><strong>If you&#8217;re running Windows Vista or Windows XP</strong>, I&#8217;m sorry, but this isn&#8217;t going to work for you.</p>
<h3>First, we need to make sure that the .NET Framework V4.5 is installed.</h3>
<p><strong>If you happen to have installed Visual Studio 2012</strong>, then you&#8217;ve got it already.</p>
<p><strong>If you are running Windows 8</strong>, then you&#8217;ve got it already.</p>
<p><strong>If you are running Windows 7</strong>, then go to this link to download and run the .NET V4.5 installer.</p>
<p><a href="http://go.microsoft.com/?linkid=9810134">http://go.microsoft.com/?linkid=9810134</a></p>
<p>Follow the instructions in the wizard to get .NET installed on your operating system. This may require a reboot.</p>
<h3>Next, we have to install the Windows SDK.</h3>
<p><strong>If you have installed Visual Studio 2012</strong>, then you&#8217;ve got it already.</p>
<p><strong>If you are running Windows 8</strong>, you need the Windows 8 SDK</p>
<p>Go to the Windows 8 <a href="http://msdn.microsoft.com/en-us/windows/hardware/hh852363.aspx">SDK download page</a>:</p>
<p><a href="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image001.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border: 0px;" title="clip_image001" alt="clip_image001" src="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image001_thumb.png" width="244" height="164" border="0" /></a></p>
<p>Find the download button and run the installer. Follow the instructions in the Wizard to install the SDK with the default options.</p>
<p><strong>If you are running Windows 7</strong>, you need the Windows 7 SDK</p>
<p>Go to the Windows 7 SDK <a href="http://www.microsoft.com/en-us/download/details.aspx?id=8279">download page</a>:</p>
<p><a href="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image002.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border: 0px;" title="clip_image002" alt="clip_image002" src="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image002_thumb.png" width="244" height="85" border="0" /></a></p>
<p>Find the download button, and run the installer. Follow the instructions in the Wizard to install the SDK with the default options.</p>
<h3>Next, we can install the F# Runtime environment and tools.</h3>
<p>Download and run the F# tools <a href="http://go.microsoft.com/fwlink/?LinkId=261286">from here</a>.</p>
<p>Agree to the license, and click next. The tools will be setup for you.</p>
<p>Once you&#8217;ve done that, the tools are on your computer, but getting at them is a bit tricky!</p>
<p>To make things easier, we need to add the Fsharp tools to our environment PATH.</p>
<p>Open up a Windows Explorer window, and find Computer. Right click it and choose &#8216;Properties&#8217;.</p>
<p><a href="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image003.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border: 0px;" title="clip_image003" alt="clip_image003" src="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image003_thumb.png" width="244" height="182" border="0" /></a></p>
<p>This opens the system properties Window (the picture is of the Windows 8 version, but Windows 7 is very similar).</p>
<p><a href="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image004.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border: 0px;" title="clip_image004" alt="clip_image004" src="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image004_thumb.png" width="244" height="213" border="0" /></a></p>
<p>First take note of whether you are running a 32bit or 64bit operating system, this will be important in a minute.</p>
<p><a href="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image005.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border: 0px;" title="clip_image005" alt="clip_image005" src="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image005_thumb.png" width="244" height="72" border="0" /></a></p>
<p>Then, on the left hand side of the window, click &#8216;Advanced System Settings&#8217;.</p>
<p><a href="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image006.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border: 0px;" title="clip_image006" alt="clip_image006" src="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image006_thumb.png" width="244" height="179" border="0" /></a></p>
<p>This pops open the System Properties Dialog. Click &#8216;Environment Variables&#8217;</p>
<p><a href="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image007.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border: 0px;" title="clip_image007" alt="clip_image007" src="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image007_thumb.png" width="237" height="244" border="0" /></a></p>
<p>This opens the Environment Variables window. In the &#8216;System Variables&#8217; section, scroll down until you can see the &#8216;Path&#8217; item, and select it. Then click the &#8216;Edit&#8217; button.</p>
<p><a href="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image008.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border: 0px;" title="clip_image008" alt="clip_image008" src="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image008_thumb.png" width="209" height="244" border="0" /></a></p>
<p>This opens the Edit window.</p>
<p><a href="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image009.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border: 0px;" title="clip_image009" alt="clip_image009" src="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image009_thumb.png" width="244" height="113" border="0" /></a></p>
<p>Put the cursor at the end of the &#8216;Variable Value&#8217; text field and type a semi-colon to separate this new path from the next one:</p>
<p><code>;</code></p>
<p>Then add the path to the directory where the F# tools were installed:</p>
<p><strong>If you have a standard 32bit installation of Windows 7</strong>, this will be</p>
<p><code>C:\Program Files\Microsoft SDKs\F#\3.0\Framework\v4.0</code></p>
<p><strong>If you have a standard 64bit installation of Windows 7 or Windows 8</strong>, this will be</p>
<p><code>C:\Program Files (x86)\Microsoft SDKs\F#\3.0\Framework\v4.0</code></p>
<p>Now, click &#8216;OK&#8217; to close the &#8216;Edit System Variable&#8217; window, &#8216;OK&#8217; again to close the &#8216;Environment Variables&#8217; window, and &#8216;OK&#8217; again to close the &#8216;System Properties&#8217; window.</p>
<p>You can then start a command prompt:</p>
<p><strong>On Windows 8</strong> go to the start screen and start typing</p>
<p><code>cmd</code></p>
<p>make sure<strong> Command Prompt</strong> is highlighted and press enter (or click it)</p>
<p><strong>On Windows 7</strong> click the start button and type</p>
<p><code>cmd</code></p>
<p>make sure <strong>Command Prompt</strong> is highlighted and press enter (or click it)</p>
<p><a href="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image010.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border: 0px;" title="clip_image010" alt="clip_image010" src="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image010_thumb.png" width="244" height="173" border="0" /></a></p>
<h3>Finally, we can check that the environment is installed correctly.</h3>
<p>To start the interactive F# environment, just type</p>
<p><code>fsi</code></p>
<p>You should see the F# interactive command prompt.</p>
<p><a href="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image011.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="clip_image011" alt="clip_image011" src="http://blogs.endjin.com/wp-content/uploads/2013/05/clip_image011_thumb.png" width="244" height="81" border="0" /></a></p>
<p>To quit, type</p>
<p><code>#quit;;</code></p>
<p><a href="http://twitter.com/ythos">Matthew Adams on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.endjin.com/2013/05/a-step-by-step-guide-to-installing-an-f-repl-environment-on-windows/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Xamarin platform setup gotchas</title>
		<link>http://blogs.endjin.com/2013/05/xamarin-platform-setup-gotchas/</link>
		<comments>http://blogs.endjin.com/2013/05/xamarin-platform-setup-gotchas/#comments</comments>
		<pubDate>Fri, 17 May 2013 07:00:40 +0000</pubDate>
		<dc:creator>Pascal Arnould</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Xamarin]]></category>

		<guid isPermaLink="false">http://blogs.endjin.com/?p=9872</guid>
		<description><![CDATA[<p>Yesterday I attended the "C# and Mvvm - Developing apps for all of Android, iPhone and Windows" event hosted by <a href="https://twitter.com/slodge" title="Stuart Lodge">Stuart Lodge</a> at <a href="http://www.modernjago.co.uk/" title="Modern Jago">Modern Jago</a>. In preparation for the day I had the daunting task of setting up my Mac (<span style="font-family: 'Lucida Grande';font-size: 11px;text-indent: -138.5px">OS X 10.8</span>) for cross platform development with <a href="http://xamarin.com/" title="Xamarin">Xamarin</a>. While most of it was fairly straight forward and well documented (see <a href="http://docs.xamarin.com/guides/ios/getting_started/installation" title="Installing Xamarin.iOS">Installing Xamarin.iOS</a>), I came across a few gotchas worth blogging about.<br /></p>]]></description>
				<content:encoded><![CDATA[<p>Yesterday (at the time of writing) I attended the &#8220;C# and Mvvm &#8211; Developing apps for all of Android, iPhone and Windows&#8221; event hosted by <a title="Stuart Lodge" href="https://twitter.com/slodge">Stuart Lodge</a> at <a title="Modern Jago" href="http://www.modernjago.co.uk">Modern Jago</a>. In preparation for the day I had the daunting task of setting up my Mac (<span style="font-family: 'Lucida Grande'; font-size: 11px; text-indent: -138.5px;">OS X 10.8</span>) for cross platform development with <a title="Xamarin" href="http://xamarin.com">Xamarin</a>. While most of it was fairly straight forward and well documented (see <a title="Installing Xamarin.iOS" href="http://docs.xamarin.com/guides/ios/getting_started/installation">Installing Xamarin.iOS</a>), I came across a few gotchas worth blogging about.</p>
<h2>Gotcha #1: Activation</h2>
<p>If you follow the <a title="Installation guide for Mac" href="http://docs.xamarin.com/guides/ios/getting_started/installation/mac">installation guide for Mac</a>, one of the step covers activation: &#8220;As you start developing, you will be asked to activate your installation&#8221;. What it actually means is that you have to fire up <a title="Xamarin Studio" href="http://xamarin.com/studio">Xamarin Studio</a>, create a new project and start building it. Only then will you see the activation dialog:</p>
<p><span style="text-decoration: underline;">Create a new iOS solution</span></p>
<p><img alt="xamarin_new_project.jpg" src="http://blogs.endjin.com/wp-content/uploads/2013/05/xamarin_new_project.jpg" width="480" height="255" /></p>
<p><span style="text-decoration: underline;">Activation dialog</span></p>
<p><img alt="xamarin_activation.png" src="http://blogs.endjin.com/wp-content/uploads/2013/05/xamarin_activation.png" width="480" height="270" /></p>
<p>What caught me is that I proceeded with the Windows installation on my VM to enable Visual Studio integration before activating it on the Mac &#8216;side&#8217;. Trying to run an iPhone project inside VS 2012 obviously threw an activation error and I naturally looked for a way to activate the install from within Xamarin Studio; something like an &#8216;Activate&#8217; button. There isn&#8217;t! I&#8217;m not sure why activation doesn&#8217;t take place while running the installer but it would be useful to have at least the option to register the product from the menu bar like so many other products do.</p>
<h2>Gotcha #2: Application Properties</h2>
<p>With everything activated, I then decided to test my setup by running <a title="Tasky" href="http://xamarin.com/getting-started/ios">Tasky</a>, a sample application provided by Xamarin. Unfortunately the iPhone simulator would simply quit on start with little indication as to what cause the crash.</p>
<p><span style="text-decoration: underline;">Error</span>: &#8220;The simulated application quit.&#8221;</p>
<p><img alt="201305141906.jpg" src="http://blogs.endjin.com/wp-content/uploads/2013/05/201305141906.jpg" width="474" height="150" /></p>
<p>After a bit of googling around, <a title="Xamarin forum" href="http://forums.xamarin.com/discussion/1514/cannot-debug-helloworld-template-with-sdk-6-or-6-1">this thread</a> on the Xamarin forum provided the solution. What solved it for me was to first delete the <b>~/Library/Application Support/iPhone Simulator</b> directory on my Mac. Then going back to Visual Studio, I went into the project properties and checked that the fields highlighted in red were filled correctly.</p>
<p><img alt="201305141930.jpg" src="http://blogs.endjin.com/wp-content/uploads/2013/05/201305141930.jpg" width="1107" height="449" /></p>
<p>Tasky running in the simulator:</p>
<p><img alt="201305141939.jpg" src="http://blogs.endjin.com/wp-content/uploads/2013/05/201305141939.jpg" width="388" height="480" /></p>
<h2>Gotcha #3: Profiles</h2>
<p>If you are going to use <a title="MvvmCross" href="https://github.com/slodge/MvvmCross">MvvmCross</a>, an <a href="http://en.wikipedia.org/wiki/Model_View_ViewModel">MVVM</a> framework for Xamarin that relies on the <a title="Portable Class Library" href="http://msdn.microsoft.com/en-us/library/gg597391.aspx">PCL</a> (Portable Class Library) at its core, you have to, at least for now, setup the correct framework profiles for developing Android apps with Visual Studio and Xamarin. Further details and the files can be found in <a title="PCL setup" href="http://slodge.blogspot.co.uk/2013/04/my-current-pcl-setup-in-visual-studio.html">this post</a> from <a title="Stuart Lodge" href="https://twitter.com/slodge">Stuart Lodge</a>.</p>
<p>Once you&#8217;ve copied the required files, you can start a new PCL project that will be reusable across platforms.</p>
<p><img alt="201305142026.jpg" src="http://blogs.endjin.com/wp-content/uploads/2013/05/201305142026.jpg" width="828" height="572" /></p>
<div class="page" title="Page 18"></div>
<p>Before creating the project, Visual Studio will prompt you for the target frameworks. As you can see from the screenshot below, the &#8220;Mono for Android&#8221; and &#8220;MonoTouch&#8221; frameworks are now available.</p>
<p><img alt="201305142031.jpg" src="http://blogs.endjin.com/wp-content/uploads/2013/05/201305142031.jpg" width="385" height="375" /></p>
<p>When I selected one of the Mono frameworks, I got this warning:</p>
<p><img alt="201305142035.jpg" src="http://blogs.endjin.com/wp-content/uploads/2013/05/201305142035.jpg" width="385" height="411" /></p>
<p>I initially thought something was wrong with my setup but quickly realised that the answer is simply to pick the correct WP version:</p>
<p><img alt="201305142039.jpg" src="http://blogs.endjin.com/wp-content/uploads/2013/05/201305142039.jpg" width="385" height="441" /></p>
<p>So apart from the few niggly issues above, the rest was rather painless. Everything ran smoothly on the day and I am now all set for some mobile dev.</p>
<p><a title="Twitter" href="https://twitter.com/TheBooleanFrog">Pascal Arnould on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.endjin.com/2013/05/xamarin-platform-setup-gotchas/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Introducing endjin composition framework 2.0 : Part 2 &#8211; Getting Started</title>
		<link>http://blogs.endjin.com/2013/05/introducing-endjin-composition-framework-2-0-part-2-getting-started/</link>
		<comments>http://blogs.endjin.com/2013/05/introducing-endjin-composition-framework-2-0-part-2-getting-started/#comments</comments>
		<pubDate>Thu, 16 May 2013 07:00:08 +0000</pubDate>
		<dc:creator>Mike.Larah</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[OSS]]></category>
		<category><![CDATA[Samples]]></category>
		<category><![CDATA[Dependency Injection]]></category>
		<category><![CDATA[Endjin Composition]]></category>

		<guid isPermaLink="false">http://blogs.endjin.com/?p=7642</guid>
		<description><![CDATA[In the last post I introduced v2.0 of our open source, composition framework. In this post, I&#8217;m going to cover a quick example of how to get started with the basics of the endjin composition framework. Firstly, we define an interface for some type Then, we create a concrete type for our interface Now we can [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://wp.me/p19Amb-1V4">In the last post</a> I introduced<a href="https://github.com/endjin/Endjin.Core.Composition-V2" target="_blank"> v2.0 of our open source, composition framework</a>. In this post, I&#8217;m going to cover a quick example of how to get started with the basics of the endjin composition framework.</p>
<p>Firstly, we define an interface for some type</p>
<script src="https://gist.github.com/c8839ffbbd1fc6c74703.js"></script><noscript><pre><code class="language-c# c#">namespace Endjin.CompositionExample.Contracts
{
    public interface IRepository
    {
        string GetMessage();
    }
}</code></pre></noscript>
<p>Then, we create a concrete type for our interface</p>
<script src="https://gist.github.com/a5ee5494f75c335d477c.js"></script><noscript><pre><code class="language-c# c#">namespace Endjin.CompositionExample.Storage
{
    public class SampleRepository  : IRepository
    {
        public string GetMessage()
        {
            return &quot;Hello, world!&quot;;
        }
    }
}</code></pre></noscript>
<p>Now we can use one the composition framework&#8217;s convention based installers. For instance we could use the namespace installer, to install all types in a given namespace into the container.</p>
<script src="https://gist.github.com/5fa418ce4a5e6e58d0a8.js"></script><noscript><pre><code class="language-c# c#">namespace Endjin.CompositionExample.Installers
{
    using Endjin.Core.Installers;

    public class StorageInstaller : NamespaceInstallerBase&lt;StorageInstaller&gt;
    {
        public StorageInstaller() : base(&quot;Storage&quot;)
        {
        }
    }
}</code></pre></noscript>
<p>The namespace installer will register types against their Default interface &#8211; where the default interface is the interface that follows the naming convention <code>I</code> + [my specific name] + [service name] (e.g. the default interface for <code>class FooBarService : IFooService, IFooBarService</code> is <code>IFooBarService</code>)</p>
<p>Most of the convention-based installers will install the concrete type into the container as Transient by default, but we can explicit specify the lifestyle using <code>[Singleton]</code> and <code>[Transient]</code> attributes.</p>
<p>See the <a href="https://github.com/endjin/Endjin.Core.Composition-V2/wiki/Installers">Installers</a> page on the GitHub wiki for a complete list of all the installers included in the framework, and explanations of how they work.</p>
<p>Next step is to initialize the container within our application&#8217;s start-up code. This is done using the Bootstrapper appropriate for whichever framework we are using, which will locate the installers in our assemblies and install the types they find into the container.</p>
<p><strong>WP8</strong></p>
<script src="https://gist.github.com/2069915b8fef938ea8b8.js"></script><noscript><pre><code class="language-c# c#">public partial class App : Application
{
  ...

  private async void Application_Launching(object sender, LaunchingEventArgs e)
  {
      // Initialize container using WP8 Bootstrapper
      await ApplicationServiceLocator.InitializeAsync(new Container(), new Wp8Bootstrapper());
  }

  ...
}</code></pre></noscript>
<p><strong>WinRT</strong></p>
<script src="https://gist.github.com/50c25568f1c2812ac0d3.js"></script><noscript><pre><code class="language-c# c#">sealed partial class App : Application
{
  ...
  
    protected override async void OnLaunched(LaunchActivatedEventArgs args)
    {
        Frame rootFrame = Window.Current.Content as Frame;

        if (rootFrame == null)
        {
            // Initialize the container for the application using the WinRT Bootstrapper
            await ApplicationServiceLocator.InitializeAsync(
                 new Container(),
                 new WinRtBootstrapper());
            
            ...
        }

  ...
}</code></pre></noscript>
<p><strong>.NET 4.0/4.5</strong></p>
<script src="https://gist.github.com/65ba5ab998f3ec998ad3.js"></script><noscript><pre><code class="language-c# c#">private async void Initialize()
{
    ...

    await ApplicationServiceLocator.InitializeAsync(new Container(), new DesktopBootstrapper());

    ...
}</code></pre></noscript>
<p>You can now use the static <code>ApplicationServiceLocator.Container</code> for resolving your root types.</p>
<script src="https://gist.github.com/b5d51463a1bf162dfb6d.js"></script><noscript><pre><code class="language-c# c#">public class FooService
{
    private readonly IRepository repository;

    public FooService()
    {
        this.repository = ApplicationServiceLocator.Container.Resolve&lt;IRepository&gt;();
    }

    public void WriteMessage()
    {
        var message = this.repository.GetMessage();
        Console.WriteLine(message);
    }
}</code></pre></noscript>
<p>In the next post, I&#8217;ll go over how to use the ContentFactory for registering content with custom names.</p>
<p><a href="http://twiiter.com/MikeLarah">@MikeLarah</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.endjin.com/2013/05/introducing-endjin-composition-framework-2-0-part-2-getting-started/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Learning To Program &#8211; A Beginners Guide &#8211; Part One</title>
		<link>http://blogs.endjin.com/2013/05/learning-to-program-a-beginners-guide-part-one-introduction/</link>
		<comments>http://blogs.endjin.com/2013/05/learning-to-program-a-beginners-guide-part-one-introduction/#comments</comments>
		<pubDate>Mon, 13 May 2013 07:00:25 +0000</pubDate>
		<dc:creator>Matthew Adams</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Learning to program]]></category>

		<guid isPermaLink="false">http://blogs.endjin.com/?p=7132</guid>
		<description><![CDATA[Introduction Programming, like most crafts, is the process of taking one thing and turning it into another thing. Turn a touch on a screen into a character in a message, or a tap on controller into the sideways shuffle of a character in a game. Simple to describe, they&#8217;re actually quite complicated to achieve, involving [...]]]></description>
				<content:encoded><![CDATA[<h2>Introduction</h2>
<p>Programming, like most crafts, is the process of taking one thing and turning it into another thing. Turn a touch on a screen into a character in a message, or a tap on controller into the sideways shuffle of a character in a game. Simple to describe, they&#8217;re actually quite complicated to achieve, involving many thousands (or even millions!) of such processes, all chained together. </p>
<p>The Art of Programming is breaking those big problems down into ever smaller chunks, organizing them so that we can keep them in our heads without going crazy, and recognizing patterns that we can apply again and again to solve the same kinds of problems.</p>
<p>Being a programmer is quite new, as crafts go. If you worked in wood, or metal, you&#8217;d have thousands of years of experience to draw on. Most of the tools we use today would be recognizable to people working 1,000 years ago &#8211; albeit that they are often now computer controlled and operating unimaginably more quickly, and reproducibly.</p>
<p>But our craft, give or take some early precursors, is only about 70 years old. Not only are the tools (the programming languages and environments) still developing, but the raw materials we&#8217;re working with (computers, sensors and output devices) are evolving all the time. It&#8217;s rather like the copper age, bronze age, iron age and the invention of steel and modern alloys all happened in a single lifetime, and we&#8217;re still racing to keep up.</p>
<p>So it can all be rather confusing. </p>
<p>The great Medieval Cathedrals in Europe were built by craftsmen. They used their experience, guile and a fair slice of dumb luck to build awe-inspiring edifices, most of which have stood the test of time. Admittedly, some have collapsed spectacularly, and bits have fallen off other ones, or the roofs have caved in, and they&#8217;ve need centuries of <a href="http://www.bing.com/images/search?q=chesterfield+catherdral&#038;qpvt=chesterfield+catherdral&#038;FORM=IGRE#view=detail&#038;id=6240BAF0A958E9B90BD718A9AFEF8F83A76BB5F3&#038;selectedIndex=3" title="Twisted Spire">botching</a> and buttressing and patching. But they&#8217;re still there.</p>
<p>We don&#8217;t build spectacular architecture in that way anymore. Scientists have worked out a load of really useful theory that helps us to understand the forces involved, model them, and allow the current generation of craftspeople to design and construct buildings that look almost impossible to us, let alone those medieval cathedral guys.</p>
<p>A computer programmer today is rather like one of those medieval craftsmen. We build incredible things through experience, guile and a fair slice of dumb luck, but sometimes things collapse spectacularly, bits fall off, and they almost always need constant botching and patching to keep them running.</p>
<p>A few people come to computer programming through an academic Computer Science route at University. Many more are drawn this way through happy accident, and there is a definite divide between the Scientists and the Craftspeople. We&#8217;re going to try to close up that divide a bit, and learn a bit of the science that underpins our craft as we go along, in an effort to be more like a modern architect than a medieval one. </p>
<p>Computer Science is a very important discipline, closely related to Mathematics, and responsible for the fundamental advances in our subject from the first ideas of computability (we&#8217;ll come on to that later), to stored program computers (like the one in front of you), to many of the programming languages, tools and algorithms (we&#8217;ll come onto those too) we use today.</p>
<p>If you want to learn the craft of computer programming you don&#8217;t have to be a computer scientist, or an awesome maths whizz, but you are going to end up learning a fair slug of maths along the way &#8211; at least, some particular bits of it. If you&#8217;re interested in computer graphics, even more so (who&#8217;d've thought all that trigonometry was going to be useful?)</p>
<p>In this series, we&#8217;re going to assume that you&#8217;ve got some basic high school maths. You&#8217;re comfortable with addition, multiplication and division, squaring numbers, and calculating percentages; and can, if you&#8217;re forced to, remember (or look up) how to do things like long division by hand. If you&#8217;re OK with that stuff, you&#8217;ve got the fundamental apparatus to start thinking like a programmer. Even if you&#8217;re not super-confident don&#8217;t worry! We&#8217;ll be taking it slowly and explaining everything as we go. </p>
<p>If all that maths talk was scary and baffling and reminds you of your most hated hours at school, take a deep breath. That&#8217;s your teacher&#8217;s fault, not yours (well, maybe you contributed a bit if you were as sulky a teenager as I was). Remember: it&#8217;s never too late! If you&#8217;re interested in programming, I&#8217;d go and learn a bit of basic maths <a href="http://www.bbc.co.uk/skillswise/maths">over here</a> where it is safe and friendly, practice a bit, then come back here in a week if you&#8217;ve still got the bug!</p>
<p>The other thing is that we&#8217;re not going to be able to leap straight from a standing start to the programming equivalent of a Cathedral. We&#8217;re going to have a series of very small triumphs that, eventually, will lead to something like a modest garden outbuilding. </p>
<p>We&#8217;ll slave away for a few hours or days or weeks, and learn something new. We&#8217;ll know it is a huge achievement, but when we show it to our husband or housemate or colleague, the best we can hope for (if they really like us) is that they&#8217;ll stifle their yawn and not make too derisive a snorting noise as you point at the number &#8217;3&#8242; which has appeared somewhere on the screen along with a load of seemingly unintelligible bafflegab.</p>
<p>The important thing is that we know that it is a breakthrough, and another bit of our craft mastered. That&#8217;s what really matters. It&#8217;s going to be hard work, but that&#8217;s what makes it satisfying.</p>
<p>Ok, there&#8217;s one more prerequisite. </p>
<p>I&#8217;m going to assume that you&#8217;ve got a computer or laptop of some kind that runs a traditional &#8216;desktop&#8217; operating system. Either Windows 7 or 8, MacOS X, or a popular flavour of Linux. And that you know how to find files, install software and so forth on your preferred computer. Again, you don&#8217;t have to be a total wizard because we&#8217;ll show you a screenshot/walkthrough of the setup we have to do to be able to start programming, and check it is all OK as we go on, but it&#8217;ll help if you know how to use the file explorer/finder and do basic housekeeping tasks.</p>
<p>In the next couple of posts, we&#8217;re going to set up the tools that we&#8217;re going to use in the rest of this course on Windows or Linux.</p>
<p><a href="http://blogs.endjin.com/2013/05/learning-to-program-a-beginners-guide-part-two/" title="Learning To Program – A Beginners Guide – Part Two">Learning To Program – A Beginners Guide – Part Two</a></p>
<p><a href="http://twitter.com/ythos">Matthew Adams on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.endjin.com/2013/05/learning-to-program-a-beginners-guide-part-one-introduction/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Introducing endjin composition framework 2.0 : Part 1</title>
		<link>http://blogs.endjin.com/2013/05/introducing-endjin-composition-framework-2-0-part-1/</link>
		<comments>http://blogs.endjin.com/2013/05/introducing-endjin-composition-framework-2-0-part-1/#comments</comments>
		<pubDate>Thu, 09 May 2013 07:00:31 +0000</pubDate>
		<dc:creator>Mike.Larah</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Engineering Practices]]></category>
		<category><![CDATA[OSS]]></category>
		<category><![CDATA[Dependency Injection]]></category>
		<category><![CDATA[Endjin Composition]]></category>

		<guid isPermaLink="false">http://blogs.endjin.com/?p=7382</guid>
		<description><![CDATA[We’ve just pushed out version 2.0 of our open-source, component composition framework. This is the framework we use internally day-in, day-out for our dependency injection. The previous version had a dependency on Castle Windsor, but in this new version we have implemented our own container. There are a few reasons we decided to take this [...]]]></description>
				<content:encoded><![CDATA[<p>We’ve just pushed out version 2.0 of our open-source, component composition framework. This is the framework we use internally <a href="http://endjin.com/our-work" target="_blank">day-in, day-out</a> for our dependency injection. The <a href="http://blogs.endjin.com/2010/12/work-smarter-with-convention-over-configuration-and-the-endjin-composition-framework/">previous version</a> had a dependency on <a href="http://docs.castleproject.org/">Castle Windsor</a>, but in this new version we have implemented our own container.</p>
<p>There are a few reasons we decided to take this step. Mainly, we were developing some early Windows Phone 8 and Windows 8 applications last year, like our <a href="http://blogs.endjin.com/2013/04/prototyping-and-proof-of-concept-charting-and-data-visualization-on-the-microsoft-platforms/">cross-platform charting controls</a> and <a href="http://endjin.com/our-work/milliman">Milliman&#8217;s Azure Compute Dashboard</a>, and we couldn&#8217;t live without DI. At the time, none of the existing container frameworks supported all the main Microsoft platforms that we were working with, so we had to &#8220;roll our own&#8221;. I did attempt to build a Windows 8 Azure Dashboard app (see pic) without DI to begin with, but the barrier to maintainability meant when it got large enough I ended up pretty much going back to the start and reimplementing it using our new framework.</p>
<p><a href="http://blogs.endjin.com/wp-content/uploads/2013/05/AzureDashboard.png"><img class="alignnone  wp-image-8122" alt="AzureDashboard" src="http://blogs.endjin.com/wp-content/uploads/2013/05/AzureDashboard.png" width="1152" height="720" /></a></p>
<p>Other containers are also really expensive for a &#8216;miss&#8217; scenario (i.e. trying to resolve a component that isn&#8217;t registered in the container), because they use exceptions to implement this. We wanted to be really efficient for failing to find a match so we could implement an inexpensive &#8220;fallback mechanism&#8221; (e.g. looking in the container for handlers for specific content types, falling back to more general versions, if they were not found).</p>
<p>The other reason was, as much as we love Castle Windsor, it does a lot (much like the Spring Framework in the Java ecosystem). It suffers from a problem that many OSS projects do &#8211; it&#8217;s based on contributions from the community but rarely do people rationalise and prune the feature set. So with our container, we&#8217;ve stripped it back and included only the features we require. This means that there&#8217;s lots it doesn&#8217;t do, but in this series of blog posts, we&#8217;re going to cover many of the main usage scenarios.</p>
<p>Whatever the framework, component composition works the same way: you have contracts and concrete implementations and you need to map one against the other. The <a href="https://github.com/endjin/Endjin.Core.Composition-V2" target="_blank">Endjin Composition Framework</a> helps you work smarter, not harder by making component composition simple.</p>
<p>You can install the packages via <a href="http://nuget.org/packages/Endjin.Core.Composition/">NuGet</a> or the <a href="https://github.com/endjin/Endjin.Core.Composition-V2">source code</a> is available up on the <a href="http://www.github.com/endjin">endjin GitHub page</a>. There are packages for use with .NET 4.0, .NET 4.5, WinRT and Windows Phone 8 frameworks. Additionally there is an <a href="http://nuget.org/packages/Endjin.Core.Composition.Web/">Endjin.Core.Composition.Web</a> package with extensions for use in ASP.NET MVC 4 / WebAPI applications.</p>
<p>There are samples in the GitHub repo for how to use component composition for each of the supported frameworks, and in the next post I&#8217;ll go over how to get set up.</p>
<p><a href="http://twiiter.com/MikeLarah">@MikeLarah</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.endjin.com/2013/05/introducing-endjin-composition-framework-2-0-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
