<?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>Mint</title>
	<atom:link href="http://mint.litemedia.se/feed/" rel="self" type="application/rss+xml" />
	<link>http://mint.litemedia.se</link>
	<description>building a .NET application</description>
	<lastBuildDate>Thu, 02 Jun 2011 17:14:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Moving to litemedia.info</title>
		<link>http://mint.litemedia.se/2011/06/01/moving-to-litemedia-info/</link>
		<comments>http://mint.litemedia.se/2011/06/01/moving-to-litemedia-info/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 13:46:22 +0000</pubDate>
		<dc:creator>Mikael Lundin</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[meta blogging]]></category>

		<guid isPermaLink="false">http://mint.litemedia.se/?p=1231</guid>
		<description><![CDATA[I will now move to litemedia.info. See you there!
Time to go live!
Release as soon as you have functionality that will generate business value.
When it comes to my new blog, it is now complete enough to be useful to me. That is why I choose to get it out through the door even though it does [...]]]></description>
			<content:encoded><![CDATA[<p>I will now move to <a href="http://litemedia.info">litemedia.info</a>. See you there!</p>
<h2>Time to go live!</h2>
<blockquote><p>Release as soon as you have functionality that will generate business value.</p></blockquote>
<p>When it comes to my new blog, it is now complete enough to be useful to me. That is why I choose to get it out through the door even though it does not have basic things like search and archive. This is not a big loss since my audience consist of two groups</p>
<ul>
<li>Those who read the blog through Google Reader</li>
<li>Those who Google a specific topic and enter the blog directly to an article</li>
</ul>
<p>of which neither will use the search or archive functionality of the site anyway.</p>
<h2>Why moving the blog?</h2>
<p>My main reasons for moving the blog are</p>
<ul>
<li>Learning Orchard CMS and Azure, the techniques used to build the blog</li>
<li>An English blog should be on an English domain</li>
<li><strong>Mint</strong> was a project that is no longer active. Time to go back to the roots: <em>litemedia</em></li>
<li>Upgrade to html5</li>
</ul>
<h2>New URLs</h2>
<ul>
<li>Website: <a href="http://litemedia.info">http://litemedia.info</a></li>
<li>RSS Feed: <a href="http://litemedia.info/rss?containerid=8">http://litemedia.info/rss?containerid=8</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://mint.litemedia.se/2011/06/01/moving-to-litemedia-info/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrate blog from Wordpress to Orchard CMS</title>
		<link>http://mint.litemedia.se/2011/05/28/migrate-blog-from-wordpress-to-orchard-cms/</link>
		<comments>http://mint.litemedia.se/2011/05/28/migrate-blog-from-wordpress-to-orchard-cms/#comments</comments>
		<pubDate>Sat, 28 May 2011 14:15:39 +0000</pubDate>
		<dc:creator>Mikael Lundin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[orchard]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://mint.litemedia.se/?p=1197</guid>
		<description><![CDATA[As I mentioned before, I&#8217;m working on a replacement for this blog. I&#8217;m going to migrate to Orchard CMS, mostly to learn that content management system. This has been a pleasant experience so far.
Before I can release my new blog I need to move all my content from Wordpress to Orchard CMS. Someone (not me) [...]]]></description>
			<content:encoded><![CDATA[<p>As I mentioned before, I&#8217;m working on a replacement for this blog. I&#8217;m going to migrate to Orchard CMS, mostly to learn that content management system. This has been a pleasant experience so far.</p>
<p>Before I can release my new blog I need to move all my content from Wordpress to Orchard CMS. Someone (not me) should really think about writing a module to make this a pleasant journey. I did this manually, because I only expect to do it once.</p>
<h2>Export from Wordpress</h2>
<p><a href="http://mint.litemedia.se/wp-content/uploads/wpexport.png"><img class="alignnone size-full wp-image-1220" title="wpexport" src="http://mint.litemedia.se/wp-content/uploads/wpexport.png" alt="" width="793" height="520" /></a></p>
<p>Wordpress has an export function. You find it in Tools menu. This is cool, except that the format is some weird kind of RSS, that is extended with Wordpress&#8217; own xml elements. Fine. Let&#8217;s see what we can do about this.</p>
<pre class="xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!-- generator="WordPress/2.9.2" created="2011-05-24 06:45"--&gt;
&lt;rss version="2.0"
	xmlns:excerpt="http://wordpress.org/export/1.0/excerpt/"
	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:wp="http://wordpress.org/export/1.0/"&gt;

&lt;channel&gt;
	&lt;title&gt;Mint&lt;/title&gt;
	&lt;link&gt;http://mint.litemedia.se&lt;/link&gt;
	&lt;description&gt;building a .NET application&lt;/description&gt;
	&lt;pubDate&gt;Tue, 24 May 2011 06:28:55 +0000&lt;/pubDate&gt;
	&lt;generator&gt;http://wordpress.org/?v=2.9.2&lt;/generator&gt;
	&lt;language&gt;en&lt;/language&gt;
	&lt;wp:wxr_version&gt;1.0&lt;/wp:wxr_version&gt;
	&lt;wp:base_site_url&gt;http://mint.litemedia.se&lt;/wp:base_site_url&gt;
	&lt;wp:base_blog_url&gt;http://mint.litemedia.se&lt;/wp:base_blog_url&gt;
	...
&lt;/channel&gt;</pre>
<p>This is your whole Wordpress exported in one file. You will have draft messages, spam comments and even pages in there. All you&#8217;re probably interested in is published pages and accepted comments.</p>
<p>If you want to make some bulk action to your blog data, you should do it now. I&#8217;m thinking, changing all the absolute paths from old blog address to the new blog address with a quick, search and replace. I forgot to do that, and now have to go through 180 blog posts manually. Not that I mind very much. I had planned to do that anyway.</p>
<h2>Import into Orchard CMS</h2>
<p><a href="http://mint.litemedia.se/wp-content/uploads/orchardimport.png"><img class="alignnone size-full wp-image-1222" title="orchardimport" src="http://mint.litemedia.se/wp-content/uploads/orchardimport.png" alt="" width="959" height="286" /></a></p>
<p>Go to the modules gallery, find and install the Orchard Team Install Export module. As the name of the module surely reveal, it let&#8217;s you import and export data into Orchard. To find out what kind of XML Schema Orchard uses, try writing a couple of blog posts, comments and export it. It should look something like this</p>
<pre class="xml">&lt;!--Exported from Orchard--&gt;
&lt;Orchard&gt;
  &lt;Recipe&gt;
    &lt;Name&gt;Generated by Orchard.ImportExport&lt;/Name&gt;
    &lt;Author&gt;Mikael Lundin&lt;/Author&gt;
  &lt;/Recipe&gt;
  &lt;Data&gt;
    &lt;Comment Id="/Identifier=6066991b882a488da366d1f64e19d36d" Status="Published"&gt;
      &lt;CommentPart Author="Mikael Lundin" UserName="Mikael Lundin" Email="myemail@home.se" Status="Approved" CommentDateUtc="2011-05-22T10:54:33Z" CommentText="This is comment number 1. It has no line breaks." CommentedOn="/Route.Slug=what-to-do-before-release" CommentedOnContainer="/Route.Slug=blog" /&gt;
      &lt;CommonPart Owner="/User.UserName=Mikael Lundin" CreatedUtc="2011-05-22T10:54:33Z" PublishedUtc="2011-05-22T10:54:33Z" ModifiedUtc="2011-05-22T10:54:33Z" /&gt;
      &lt;IdentityPart Identifier="6066991b882a488da366d1f64e19d36d" /&gt;
    &lt;/Comment&gt;
    &lt;Comment Id="/Identifier=11376d3721144b2ebb51d4da880592f6" Status="Published"&gt;
      &lt;CommentPart Author="Mikael Lundin" UserName="Mikael Lundin" Email="myemail@home.se" Status="Approved" CommentDateUtc="2011-05-22T10:55:00Z" CommentText="Here comes comment number two.&amp;#xD;&amp;#xA;It has several line breaks.&amp;#xD;&amp;#xA;&amp;#xD;&amp;#xA;Saluté!" CommentedOn="/Route.Slug=what-to-do-before-release" CommentedOnContainer="/Route.Slug=blog" /&gt;
      &lt;CommonPart Owner="/User.UserName=Mikael Lundin" CreatedUtc="2011-05-22T10:55:00Z" PublishedUtc="2011-05-22T10:55:00Z" ModifiedUtc="2011-05-22T10:55:00Z" /&gt;
      &lt;IdentityPart Identifier="11376d3721144b2ebb51d4da880592f6" /&gt;
    &lt;/Comment&gt;
    &lt;BlogPost Id="/Route.Slug=first" Status="Published"&gt;
      &lt;TagsPart Tags="" /&gt;
      &lt;CommentsPart CommentsShown="true" CommentsActive="true" /&gt;
      &lt;RoutePart Title="New blog on litemedia.info" Slug="first" Path="first" /&gt;
      &lt;CommonPart Owner="/User.UserName=Mikael Lundin" Container="/Route.Slug=blog" CreatedUtc="2011-04-16T08:18:28Z" PublishedUtc="2011-04-17T19:59:18Z" ModifiedUtc="2011-04-17T19:59:18Z" /&gt;
      &lt;BodyPart Text="&amp;lt;p&amp;gt;I will move all the blog posts from mint.litemedia.se to litemedia.info&amp;lt;/p&amp;gt;&amp;#xD;&amp;#xA;&amp;lt;p&amp;gt;I hope this will result in&amp;lt;/p&amp;gt;&amp;#xD;&amp;#xA;&amp;lt;ul&amp;gt;&amp;#xD;&amp;#xA;&amp;lt;li&amp;gt;More readers&amp;lt;/li&amp;gt;&amp;#xD;&amp;#xA;&amp;lt;li&amp;gt;Easier management&amp;lt;/li&amp;gt;&amp;#xD;&amp;#xA;&amp;lt;li&amp;gt;Better design&amp;lt;/li&amp;gt;&amp;#xD;&amp;#xA;&amp;lt;/ul&amp;gt;" /&gt;
    &lt;/BlogPost&gt;
    &lt;BlogPost Id="/Route.Slug=what-to-do-before-release" Status="Published"&gt;
      &lt;TagsPart Tags="tag1,tag2,tag3,tag4" /&gt;
      &lt;CommentsPart CommentsShown="true" CommentsActive="true" /&gt;
      &lt;RoutePart Title="What to do before release" Slug="what-to-do-before-release" Path="what-to-do-before-release" /&gt;
      &lt;CommonPart Owner="/User.UserName=Mikael Lundin" Container="/Route.Slug=blog" CreatedUtc="2011-04-19T17:46:23Z" PublishedUtc="2011-05-23T19:17:38Z" ModifiedUtc="2011-05-23T19:17:38Z" /&gt;
      &lt;BodyPart Text="&amp;lt;p&amp;gt;Things that needs to be done before release of the blog&amp;lt;/p&amp;gt;..." /&gt;
    &lt;/BlogPost&gt;
  &lt;/Data&gt;
&lt;/Orchard&gt;</pre>
<p>Now we have our data in Wordpress xml format, and we would like to transform it into Orchard xml format to import it into our new blog. For that we will use my favorite tool.</p>
<h2>Transforming the export data into import data</h2>
<p>We use XSLT to transform from one xml format into another. We could use ordinary scripting, but xslt makes it so easy. Here&#8217;s the script that I used. Excuse me for the VBScript part, but I got lazy and took the simple way out when I had to transform date formats.</p>
<pre class="xml">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:wp="http://wordpress.org/export/1.0/"
	xmlns:msxml="urn:schemas-microsoft-com:xslt"
	xmlns:vb="#VBCustomScript"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"&gt;
    &lt;xsl:output method="xml" indent="yes"/&gt;

	&lt;!-- Yes this is ugly but I didn't have the energy to solve it with Xslt 1.0 --&gt;
	&lt;msxml:script language="VBScript" implements-prefix="vb"&gt;
	&lt;![CDATA[
	function gmtToUtc(str)
	gmtToUtc = Split(str)(0) &amp; "T" &amp; Split(str)(1) &amp; "Z"
	end function
	]]&gt;
	&lt;/msxml:script&gt;  

	&lt;!-- A function to join values together with a seperator
		 Example join(tags, ','
	--&gt;
	&lt;xsl:template name="join"&gt;
		&lt;xsl:param name="list" /&gt;
		&lt;xsl:param name="separator"/&gt;

		&lt;xsl:for-each select="$list"&gt;
			&lt;xsl:value-of select="." /&gt;
			&lt;xsl:if test="position() != last()"&gt;
				&lt;xsl:value-of select="$separator" /&gt;
			&lt;/xsl:if&gt;
		&lt;/xsl:for-each&gt;
	&lt;/xsl:template&gt;	

	&lt;!-- Main entry Point --&gt;
    &lt;xsl:template match="/"&gt;
        &lt;Orchard&gt;
		  &lt;Recipe&gt;
			&lt;Name&gt;Transformed export from Wordpress&lt;/Name&gt;
			&lt;Author&gt;Mikael Lundin&lt;/Author&gt;
		  &lt;/Recipe&gt;
		  &lt;Data&gt;
			&lt;!-- Comments: Only approved ones --&gt;
			&lt;xsl:apply-templates select="//channel/item/wp:comment[wp:comment_approved='1']" /&gt;
			&lt;!-- Blog items: Only published ones --&gt;
			&lt;xsl:apply-templates select="//channel/item[wp:status='publish']"/&gt;
		  &lt;/Data&gt;
		&lt;/Orchard&gt;
    &lt;/xsl:template&gt;

	&lt;!-- Render a comment --&gt;
	&lt;xsl:template match="wp:comment"&gt;
		&lt;!-- Comment publish date --&gt;
		&lt;xsl:variable name="date" select="vb:gmtToUtc(string(wp:comment_date_gmt))" /&gt;
		&lt;!-- Parent identifier --&gt;
		&lt;xsl:variable name="parentSlug" select="../wp:post_name" /&gt;
		&lt;!-- The comment ID --&gt;
		&lt;xsl:variable name="identity" select="wp:comment_id" /&gt;

		&lt;Comment Id="/Identifier={$identity}" Status="Published"&gt;
			&lt;CommentPart Status="Approved" CommentDateUtc="{$date}" CommentedOnContainer="/Route.Slug=blog" CommentedOn="/Route.Slug={$parentSlug}"&gt;
				&lt;xsl:attribute name="Email"&gt;&lt;xsl:value-of select="wp:comment_author_email"/&gt;&lt;/xsl:attribute&gt;
				&lt;xsl:attribute name="Author"&gt;&lt;xsl:value-of select="wp:comment_author"/&gt;&lt;/xsl:attribute&gt;
				&lt;xsl:attribute name="CommentText"&gt;&lt;xsl:value-of select="wp:comment_content/text()"/&gt;&lt;/xsl:attribute&gt;
			&lt;/CommentPart&gt;
			&lt;CommonPart CreatedUtc="{$date}" PublishedUtc="{$date}" ModifiedUtc="{$date}" /&gt;
			&lt;IdentityPart Identifier="{$identity}" /&gt;
		&lt;/Comment&gt;
	&lt;/xsl:template&gt;

	&lt;!-- Render Blog item --&gt;
	&lt;xsl:template match="item"&gt;
		&lt;!-- Blog post identifier --&gt;
		&lt;xsl:variable name="slug" select="wp:post_name" /&gt;
		&lt;!-- Publish date --&gt;
		&lt;xsl:variable name="date" select="vb:gmtToUtc(string(wp:post_date_gmt))" /&gt;

		&lt;BlogPost Id="/Route.Slug={$slug}" Status="Published"&gt;
			&lt;TagsPart&gt;
				&lt;!-- Render parts --&gt;
				&lt;xsl:attribute name="Tags"&gt;
					&lt;xsl:call-template name="join"&gt;
						&lt;xsl:with-param name="list" select="category[@domain='tag']/@nicename" /&gt;
						&lt;xsl:with-param name="separator" select="','" /&gt;
					&lt;/xsl:call-template&gt;
				&lt;/xsl:attribute&gt;
			&lt;/TagsPart&gt;
			&lt;CommentsPart CommentsShown="true" CommentsActive="true" /&gt;
			&lt;RoutePart Slug="{$slug}" Path="{$slug}"&gt;
				&lt;xsl:attribute name="Title"&gt;
					&lt;xsl:value-of select="title" /&gt;
				&lt;/xsl:attribute&gt;
			&lt;/RoutePart&gt;
			&lt;CommonPart Owner="/User.UserName=Mikael Lundin" Container="/Route.Slug=blog" CreatedUtc="{$date}" ModifiedUtc="{$date}" PublishedUtc="{$date}" /&gt;
			&lt;BodyPart&gt;
				&lt;xsl:attribute name="Text"&gt;
					&lt;xsl:value-of select="content:encoded/text()" /&gt;
				&lt;/xsl:attribute&gt;
			&lt;/BodyPart&gt;
		&lt;/BlogPost&gt;
	&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;</pre>
<p>Now you add the following line on the top of the Wordpress xml file, on line 2, under the xml declaration.</p>
<pre class="xml">&lt;?xml-stylesheet type="text/xsl" href="import.xslt" ?&gt;</pre>
<p>At this point it would be pretty simple to create an import from wordpress Orchard module, but I just want to solve my problem and move on. That is why I open my Wordpress xml-file in Internet Explorer and let that transform it for me.</p>
<p>Press F12 and you will have the ability to save the whole transformed file to disc.</p>
<p><a href="http://mint.litemedia.se/wp-content/uploads/iedevtool.png"><img class="alignnone size-full wp-image-1219" title="iedevtool" src="http://mint.litemedia.se/wp-content/uploads/iedevtool.png" alt="" width="663" height="557" /></a></p>
<p>Now you can use that file to import your goodies into Orchard. Don&#8217;t forget to move wp-content into your  media library also and change all the media links accordingly.</p>
<p>Not very hard, was it?</p>
]]></content:encoded>
			<wfw:commentRss>http://mint.litemedia.se/2011/05/28/migrate-blog-from-wordpress-to-orchard-cms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Data driven test cases in NUnit</title>
		<link>http://mint.litemedia.se/2011/05/26/data-driven-test-cases-in-nunit/</link>
		<comments>http://mint.litemedia.se/2011/05/26/data-driven-test-cases-in-nunit/#comments</comments>
		<pubDate>Thu, 26 May 2011 05:12:41 +0000</pubDate>
		<dc:creator>Mikael Lundin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[data driven test]]></category>
		<category><![CDATA[nunit]]></category>
		<category><![CDATA[testcase]]></category>
		<category><![CDATA[testcasesource]]></category>

		<guid isPermaLink="false">http://mint.litemedia.se/?p=1200</guid>
		<description><![CDATA[When you want to create thousands of test cases you don&#8217;t use the [TestCase] attribute in NUnit.   But did you know that there is a &#8220;TestCaseSource&#8221; attribute that specifies a method that will generate test case data?
Look at this.
[TestCaseSource("MassiveAmountOfUsers")]
public void ShouldLogin(string username, string password, bool expected)
{
    /* Setup */
  [...]]]></description>
			<content:encoded><![CDATA[<p>When you want to create thousands of test cases you don&#8217;t use the [TestCase] attribute in NUnit. <img src='http://mint.litemedia.se/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  But did you know that there is a &#8220;TestCaseSource&#8221; attribute that specifies a method that will generate test case data?</p>
<p>Look at this.</p>
<pre class="csharp">[TestCaseSource("MassiveAmountOfUsers")]
public void ShouldLogin(string username, string password, bool expected)
{
    /* Setup */
    var repository = new UserRepository();

    /* Test */
    var result = repository.Authenticate(username, password);

    /* Assert */
    Assert.That(result, Is.EqualTo(expected));
}</pre>
<p>It is an integration test that will try to login a massive amount of users. This is the kind of test where you take a huge diversity of data and try to find out if there is anything that will make it break.</p>
<p>But  where does the data come from? The magic string &#8220;MassiveAmountOfUsers&#8221; holds the answer.</p>
<pre class="csharp">private IEnumerable MassiveAmountOfUsers
{
    get { return GetMassiveAmountOfUsers(); }
}
private IEnumerable GetMassiveAmountOfUsers()
{
    var doc = XDocument.Load("users.xml");
    return
        from user in doc.Descendants("user")
        let username = user.Attribute("username").Value
        let password = user.Attribute("password").Value
        let expected = user.Attribute("success").Value
            .Equals("true", StringComparison.InvariantCultureIgnoreCase)

        select new object[] { username, password, expected };
}</pre>
<p>Test cases will be generated by the framework calling the property MassiveAmountOfUsers. This should return an IEnumerable of an array of arguments. We create that array of arguments by reading an XML file. To enable using different types, string and bools, as arguments we create an untyped array of objects. As long as we put strongly typed members into the array, we can use strong types in the test function.</p>
<p>What the xml looks like, is unimportant, but in my test case like this.</p>
<pre class="xml">&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;users&gt;
  &lt;user username="fsse" password="dj7sihfs" success="true" /&gt;
  &lt;user username="hgtd" password="sd122?=s" success="true" /&gt;
  &lt;user username="asde" password="!!sf3mff" success="true" /&gt;
  &lt;user username="bsfd" password="--sdfj+?" success="true" /&gt;
  &lt;user username="aefb" password="!#¤%/(sd" success="true" /&gt;
  ...
&lt;/users&gt;</pre>
<p>You could get the test data from anywhere, the database if you want to. Testing your code with an massive amount of real data, really gives you confidence with your code.</p>
<p>Running this in the NUnit test runner looks pretty much like any [TestCase] suite, but the test cases are generated when the test assembly is loaded.</p>
<p><a href="http://mint.litemedia.se/wp-content/uploads/nunit-gui.png"><img class="alignnone size-full wp-image-1205" title="nunit-gui" src="http://mint.litemedia.se/wp-content/uploads/nunit-gui.png" alt="" width="710" height="424" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://mint.litemedia.se/2011/05/26/data-driven-test-cases-in-nunit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Real world functional programming</title>
		<link>http://mint.litemedia.se/2011/05/25/real-world-functional-programming/</link>
		<comments>http://mint.litemedia.se/2011/05/25/real-world-functional-programming/#comments</comments>
		<pubDate>Wed, 25 May 2011 16:25:03 +0000</pubDate>
		<dc:creator>Mikael Lundin</dc:creator>
				<category><![CDATA[F#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[f#]]></category>
		<category><![CDATA[fp]]></category>
		<category><![CDATA[functional programming]]></category>
		<category><![CDATA[presentation]]></category>

		<guid isPermaLink="false">http://mint.litemedia.se/?p=1202</guid>
		<description><![CDATA[Today I held a seminar about functional programming at Valtech Tech Day. It&#8217;s no coincidense that the title of the seminar is the same as the book by Tomas Petricek, since it inspired me to do the talk. After playing around with F# for over a year, it&#8217;s time to get serious and use it [...]]]></description>
			<content:encoded><![CDATA[<p>Today I held a seminar about functional programming at <a href="http://www.vtd11.se">Valtech Tech Day</a>. It&#8217;s no coincidense that the title of the seminar is the same as <a href="http://www.amazon.com/Real-World-Functional-Programming-Examples/dp/1933988924">the book by Tomas Petricek</a>, since it inspired me to do the talk. After playing around with F# for over a year, it&#8217;s time to get serious and use it in production case.</p>
<p>You will find my slides <a href="http://fp.litemedia.se">here</a>. (<a href="http://mint.litemedia.se/wp-content/uploads/Real-world-functional-programming-Mikael-Lundin.pdf">or download as pdf</a>)</p>
<h2>Do we need functional programming?</h2>
<p>Yes! Our CPU&#8217;s aren&#8217;t getting faster, but better at doing several things at the same time. That is why we need to focus on parallel programming, and parallel programming is hard to do with imperative programming. That is why we must rethink our problem definitions and make them much more expressive, solving our problems with functional concepts.</p>
<h2>What functional programming language should i learn?</h2>
<p>If you&#8217;re on .NET today, F# will be the shortest path to functional programming for you. If you&#8217;re a hardcore Java developer you should look into Clojure. Erlang seems to be the coolest functional language right now, but Scala is also an alternative.</p>
<h2>Is recursion the answer to everything?</h2>
<p>Some people does not like recursion because they&#8217;re so used to iterative way of thinking. There&#8217;s nothing hard about recursive programming, but your brain is not tuned for it. Recursion is not the solution to everything, just as the foreach/while-loop is not the answer to everything, but I would say that its just as important as a looping construct.</p>
<h2>Monads, gonads?</h2>
<p>Ehhm &#8230; yeah.</p>
]]></content:encoded>
			<wfw:commentRss>http://mint.litemedia.se/2011/05/25/real-world-functional-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Should I use HTML5 or Silverlight?</title>
		<link>http://mint.litemedia.se/2011/05/24/should-i-use-html5-or-silverlight/</link>
		<comments>http://mint.litemedia.se/2011/05/24/should-i-use-html5-or-silverlight/#comments</comments>
		<pubDate>Tue, 24 May 2011 06:28:55 +0000</pubDate>
		<dc:creator>Mikael Lundin</dc:creator>
				<category><![CDATA[Technicalities]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[silverlight]]></category>

		<guid isPermaLink="false">http://mint.litemedia.se/?p=1167</guid>
		<description><![CDATA[
This is an answer to the post of Scott Hanselman with the same title. The problem I have reading these kind of blog posts is that the author is always either a Microsoft/Adobe/Sun spokesman or an open standards zealot.
This has little to do with Silverlight, but could easily be applied to any browser plugin model, like [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>This is an answer to the <a href="http://www.hanselman.com/blog/ShouldIUseHTML5OrSilverlightOneMansOpinion.aspx">post of Scott Hanselman with the same title</a>. The problem I have reading these kind of blog posts is that the author is always either a Microsoft/Adobe/Sun spokesman or an open standards zealot.</p>
<p>This has little to do with Silverlight, but could easily be applied to any browser plugin model, like Flash or JavaFx. The reason I use Silverlight here, is that I&#8217;m a .NET developer and this is a blog about .NET development.</p>
<p>I have no cares for any plugin model, and I&#8217;m not an open standards fan. I just want to get the most possible value with the least possible cost.</p>
<h2>The web is all about semantics</h2>
<p>The web has a language and it is called html. You use it to markup the meaning of your content. For your page title you use &lt;h1&gt; and for your paragraphs you use &lt;p&gt;. If you have an image use use &lt;img&gt; and for table data, the black sheep &lt;table&gt;.</p>
<p>When you place a plugin on the page you remove this sematic markup and replace it with a black box. Before you do that, you should be aware of the consequenses. The meaning of the content within that plugin will never be revealed to the browser. The text is invisible to any screen reader software and Google indexer robot will not reach it.</p>
<p>This is why I say, using Silverlight (or any other browser plugin) to display content is bad.</p>
<h3>How about banners?</h3>
<p>The technology for creating animated banners in html5 canvas + javascript is still very new. Some older browsers do not support it and that might give you enough reason to use flash, which is still the most widespread browser plugin when it comes to animation.</p>
<p>Don&#8217;t forget that you will hide the banner content to anyone that is not a human using a web browser with flash installed.</p>
<h2>Rich Internet Applications</h2>
<p>Rich Internet Applications (RIA) are desktop apps that runs in the browser. It could be a public application like GMail or it could be a private administration console for your e-commerce workflow.</p>
<p>In a public RIA you would like to target as large user base as possible. In that case, html is the obvious choice. Not html5, but standard xhtml 1.0. Imagine if GMail was written in Flash. I don&#8217;t think it would have gotten that kind of popularity that it has. The experience of having a full scale e-mail client as a web application is just seamless for the user.</p>
<p>If the RIA is not a free application but something that your customers buy, you may set another stage. The customer accepts that they need to use the latest Silverlight plugin to be able to run your application. They login, and they install the latest Silverlight runtime (takes 2 minutes) and then they are up and running. Why is this acceptable? I guess it has to do with perception &#8211; I buy an application &#8211; it should be an application.</p>
<p>Silverlight is perfect for the RIA scenario because it has much better integration between frontend and backend. You use C# on both. There are a lot of controls that will make your development smoother and the maintainability is just higher with XAML/C# than HTML/JavaScript/Css.</p>
<p>When you have an internal private application, the choice is simple. You control the machines that your application will run on, and may demand what version of Silverlight should be available.</p>
<p>Last time I worked with Flash, this was not suited for RIA development. The maintainability was really poor and it was hard to produce anything that was stable enough for production use. My recommendation is that Flash, only suits banner development, and should not be used for any larger scale project.</p>
<h2>Where to use Silverlight?</h2>
<p>To sum it up. You should use Silverlight in windows application development. When you write an application in Silverlight it can be used both inside and outside of browser, and that is very powerful.</p>
<p>It&#8217;s easy to maintain a Silverlight application, not only because of the .NET infrastructure, but only for release management. You deploy the application to an URL and your customer service team will get the update as soon as they refreshes the url in their browser.</p>
<p>Silverlight is the only development platform for Windows Phone 7, and a quite nice one.</p>
<h3>When you shouldn&#8217;t use Silverlight?</h3>
<ul>
<li>When you need to target a larger audience</li>
<li>When the application represent content, blog, news articles</li>
<li>When you can&#8217;t control the environment that your users are in</li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://mint.litemedia.se/2011/05/24/should-i-use-html5-or-silverlight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

