<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><description>Fun with Agile practices and .Net Development</description><title>Alsagile</title><generator>Tumblr (3.0; @alsagile)</generator><link>http://alsagile.com/</link><item><title>Calling roundhouse from powershell</title><description>&lt;p&gt;It&amp;rsquo;s not the first time I struggle to pass parameters containing spaces to an executable from powershell. And since I finally managed to get it right, I will not miss that chance to document it for my future self.&lt;/p&gt;

&lt;p&gt;Pay attention to the back-ticks to escape the double quotes&amp;hellip;&lt;/p&gt;

&lt;p&gt;And pay attention to how it checks for the exit code (don&amp;rsquo;t forget the -PassThru parameter to get the process object out).&lt;/p&gt;

&lt;p&gt;Here is the small powershell wrapper I used for the &lt;a href="https://github.com/chucknorris/roundhouse"&gt;roundhouse&lt;/a&gt; excutable.&lt;/p&gt;

&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/serbrech/8333695"&gt;https://gist.github.com/serbrech/8333695&lt;/a&gt;&lt;/div&gt;</description><link>http://alsagile.com/post/72762547008</link><guid>http://alsagile.com/post/72762547008</guid><pubDate>Thu, 09 Jan 2014 14:04:26 +0100</pubDate><category>powershell</category><category>roundhouse</category><category>CI</category><category>teamcity</category></item><item><title>Find the local path from a local UNC network share path with Powershell</title><description>&lt;p&gt;Just making sure that I will know where to find this if I need it again in the future.&lt;/p&gt;

&lt;p&gt;If you have a UNC network share path, such as \Computer1\Shared and you need to know the &lt;em&gt;local&lt;/em&gt; folder linked to that when running a script from &lt;em&gt;Computer1&lt;/em&gt;,  you can achieve that easily in powershell :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;gwmi win32_share | ? {$_.Name -eq "Shared" } | select -expand path
&lt;/code&gt;&lt;/pre&gt;</description><link>http://alsagile.com/post/70376571644</link><guid>http://alsagile.com/post/70376571644</guid><pubDate>Wed, 18 Dec 2013 09:38:14 +0100</pubDate><category>powershell</category></item><item><title>Deploying to IIS using MSDeploy from powershell with a non-admin user</title><description>&lt;p&gt;&lt;img src="http://66.media.tumblr.com/cc1ffbb83e9ba26c771cb88c9d70bc10/tumblr_inline_mxy9wrg17k1qfqwml.png" alt=""/&gt;&lt;br/&gt;
In theory, msdeploy is perfect to deploy to IIS, but it was written for cmd, not for powershell. That means that when you call it from a powershell script, &lt;a href="http://stackoverflow.com/questions/3499699/how-do-you-call-msdeploy-from-powershell-when-the-parameters-have-spaces"&gt;things start to fall appart&lt;/a&gt;&amp;hellip;&lt;/p&gt;

&lt;p&gt;I was pretty sure that I would find people who were doing the same thing on github, and indeed, It didn&amp;rsquo;t take long to find a trusted source: the &lt;a href="https://github.com/NuGet/NuGetGallery/blob/fc8a90a73bc4e3955897bd9d7ba14923db4b46e8/ops/Modules/NuGetOps/Private/DeployWebsite.ps1"&gt;NugetGallery website deployment script uses msdeploy&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It was helpful, but that was not it&amp;hellip; Ready to do the things the right way, I did not want to use an administrator account in my script as &lt;a href="http://www.iis.net/learn/publish/troubleshooting-web-deploy/web-deploy-error-codes#ERROR_USER_UNAUTHORIZED"&gt;MSDeploy seems to want it&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And apparently &lt;a href="http://www.jrjlee.com/2011/12/deploying-web-packages-as-non.html"&gt;there are ways to use a standard user&lt;/a&gt; with just the necessary rights.&lt;/p&gt;

&lt;p&gt;The user you create on the machine where you want to deploy, needs to have the ACL rights to the folder of course, and he also needs to have the IIS Manager permission on the application that you want to deploy.
You then deploy to the &lt;strong&gt;Web Site&lt;/strong&gt; url (for example, &amp;ldquo;Default Web Site&amp;rdquo;)
but you give an extra parameter to msdeploy that points to the &lt;strong&gt;Web Applilcation&lt;/strong&gt; this time.&lt;/p&gt;

&lt;p&gt;Summarized, it&amp;rsquo;s something like this :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$AppName = "MyApp"
$Site = "Default Web Site"
$WebApp= "$Site/$AppName" 

# Here we use the $Site variable, **Not the $WebApp**
$PublishUrl = "https://WebServer:8172/MSDeploy.axd?site=$($Site)"

$arguments = [string[]]@(
    "-verb:sync",
    "-source:package='$Package'",
    "-dest:auto,computerName='$PublishUrl',userName='$UserName',password='$Password',authtype='Basic'",  
# This is where you point to the WebApp
    "-setParam:name='IIS Web Application Name',value='$($WebApp)'",
    "-allowUntrusted")

# And this is how you call msdeploy with spaces in the arguments without problems
Start-Process $msdeploy -ArgumentList $arguments -NoNewWindow -Wait
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;But somehow that would not work, and the error message was not really helpful. It turns out, as most of the time, that I was doing it wrong (but in that case MSDeploy is really making it easy to shoot yourself in the foot)&lt;/p&gt;

&lt;p&gt;I published the complete powershell wrapper that I use as a gist on github, I hope this helps someone. :)&lt;/p&gt;

&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/serbrech/8003858"&gt;https://gist.github.com/serbrech/8003858&lt;/a&gt;&lt;/div&gt;</description><link>http://alsagile.com/post/70283855921</link><guid>http://alsagile.com/post/70283855921</guid><pubDate>Tue, 17 Dec 2013 12:58:00 +0100</pubDate><category>powershell</category><category>CI</category><category>msdeploy</category></item><item><title>Running Nunit tests in Teamcity using wildcards to find dlls</title><description>&lt;p&gt;Quick note for my future self to avoid an hunting for the imaginary problem.&lt;/p&gt;

&lt;p&gt;When using wildcards to run nunit tests in Teamcity, use this :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;**\bin\debug\*Test*.dll    
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And &lt;strong&gt;not&lt;/strong&gt; this :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;**\*Test*.dll
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The reason being that if we don&amp;rsquo;t specify the bin folder in the path, it will pick up the dll in the obj folder, and that folder will not contain the referenced dlls, hence it will run the tests twice and fail on the one from the obj folder.&lt;/p&gt;</description><link>http://alsagile.com/post/70189963777</link><guid>http://alsagile.com/post/70189963777</guid><pubDate>Mon, 16 Dec 2013 15:19:00 +0100</pubDate></item><item><title>Quick Start on using Oracle Text</title><description>&lt;a href="http://arnekroeger.blogspot.de/2011/02/using-oracle-text-search.html"&gt;Quick Start on using Oracle Text&lt;/a&gt;: &lt;p&gt;&lt;a href="http://arnekroeger.blogspot.de/2011/02/using-oracle-text-search.html"&gt;Using Oracle Text Search&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The author goes from creating the tables, a multicolumn index and queries it.&lt;br/&gt;
I believe there is a better query, but that is still a good and simple start.&lt;/p&gt;</description><link>http://alsagile.com/post/37253250677</link><guid>http://alsagile.com/post/37253250677</guid><pubDate>Wed, 05 Dec 2012 10:55:00 +0100</pubDate></item><item><title>Testing the IDataReader mapping</title><description>&lt;p&gt;I don&amp;rsquo;t want to enter the discussion if you should or not use a datareader, this is another topic. I will just show how I test the mapping between the reader and my objects easily.&lt;/p&gt;

&lt;p&gt;First of all, I try to isolate the mapping from the rest of the code&lt;/p&gt;

&lt;p&gt;I usually create one class by mapping and pass it the datareader. I use this base class :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;public abstract class DataReaderMapperBase&amp;lt;T&amp;gt; where T:class
{
      public abstract T Map(IDataReader reader);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;A simple example of using this base class :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;public class PersonDataReaderMapper : DataReaderMapperBase&amp;lt;Person&amp;gt;
{
     public override Person Map(IDataReader reader)
     {
           return new Person 
           {
                  FirstName = reader.GetString("Name"),
                  LastName = reader.GetString("LastName"),
                  ...
           }
     }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;But how to test this? there is &lt;a href="http://www.lazycoder.com/weblog/2008/12/12/mocking-idatareader-using-rhinomocks-35/"&gt;a simple way of stubbing a datareader using a DataTable and a DataTableReader&lt;/a&gt;. 
But that is still a cumbersome syntax, so I wrapped it in a helper that could take objects and transform them into a DataReader row. I will probably package a little better, but here is the raw draft, with an example of how you use it :&lt;/p&gt;

&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/3713904"&gt;https://gist.github.com/3713904&lt;/a&gt;&lt;/div&gt;</description><link>http://alsagile.com/post/31458348401</link><guid>http://alsagile.com/post/31458348401</guid><pubDate>Thu, 13 Sep 2012 14:24:00 +0200</pubDate></item><item><title>Using psake to run your TeamCity continuous integration build</title><description>&lt;p&gt;Recently I had to setup a CI build in TeamCity.&lt;br/&gt;
I already did this once using msbuild script, and met very quickly walls when I wanted to get into more advanced deployment scripts. So I looked for a different solution and found psake.
From the &lt;a href="https://github.com/psake/psake"&gt;github project&lt;/a&gt; :&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;psake is a build automation tool written in PowerShell. It avoids the angle-bracket tax associated with executable XML by leveraging the PowerShell syntax in your build scripts. psake has a syntax inspired by rake (aka make in Ruby) and bake (aka make in Boo), but is easier to script because it leverages your existent command-line knowledge.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;DISCLAIMER : 
&lt;img src="http://65.media.tumblr.com/tumblr_m31xya0nn01qg8w62o1_250.jpg" alt="Works on my machine!" title="I decline all responsibilities if the following doesn't make you happy :)"/&gt;&lt;/p&gt;

&lt;h3&gt;The psake build script&lt;/h3&gt;

&lt;p&gt;At the top of my default.ps1 I have&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;properties {
    $home = $psake.build_script_dir + "/../.."
    $sln_file_server = "$home/Server/Server.sln"
    $sln_file_client = "$home/Client/Client.sln"
    $sln_file_common = "$home/Common/Common.sln"
    $configuration = "Debug"
    $framework = "4.0"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;My build script is not at the root of the repository, so I adjust a $home variable myself.&lt;/p&gt;

&lt;p&gt;And here are my tasks :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;task CompileCommon {
  exec { msbuild "$sln_file_common" /p:Configuration=$configuration }
}

task CompileClient {
  exec { msbuild "$sln_file_client" /p:Configuration=$configuration }
}

task CompileServer {
  exec { msbuild "$sln_file_server" /p:Configuration=$configuration }
}

task All -depends Clean, CompileCommon, CompileClient, CompileServer {
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Awesome, but the integration with teamcity has some surprises (fortunately relatively simple to overcome).
In short, Powershell does not use the exit codes of the programs you launch from it.
If msbuild exits with the code 1 (for failure), the powershell process will still exit with the code 0 (success). Unfortunately, this is what teamcity is looking at to tell if the build step passed or failed.&lt;/p&gt;

&lt;p&gt;I ran into this problem and had a hard time making the build fail when the compilation was failing.
Here is how I solved it, which is similar to &lt;a href="https://github.com/psake/psake/wiki/How-can-I-integrate-psake-with-Team-City%3F"&gt;what the wiki says&lt;/a&gt;:&lt;/p&gt;

&lt;h3&gt;Make TeamCity fail when the compilation fails&lt;/h3&gt;

&lt;p&gt;I fixed this in the teamcity build step setup. I have tried multiple things (running the psake.cmd didn&amp;rsquo;t do it for me), and I ended up with the following configuration (click to see a higher resolution) :&lt;/p&gt;

&lt;p&gt;&lt;a href="http://24.media.tumblr.com/tumblr_m7axvySja21qg8w62o1_1280.png"&gt;
&lt;img class="image_thumbnail enlarged" alt="" id="thumbnail_photo_27401772431" onclick="
                if (this.src.indexOf('_100') != -1) { this.style.backgroundColor = 'transparent'; this.src='http://25.media.tumblr.com/tumblr_m7axvySja21qg8w62o1_500.png'; }&amp;lt;/p&amp;gt;

&amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;            if ($(this).hasClassName('enlarged')) {
                this.style.width = '150px';
                this.style.height = '95px';
                $(this).removeClassName('enlarged');
                if ($('photo_info_27401772431')) $('photo_info_27401772431').hide();
                if ($('photo_exif_flipper_27401772431')) $('photo_exif_flipper_27401772431').hide();
                $('post_content_27401772431').style.clear = 'none';
            } else {
                $('post_content_27401772431').style.clear = 'both';
                if ($('photo_info_27401772431')) $('photo_info_27401772431').show();
                if ($('photo_exif_flipper_27401772431')) $('photo_exif_flipper_27401772431').show();
                this.style.width = '500px';
                this.style.height = '317px';
                $(this).addClassName('enlarged');
            }
            this.blur();
            return false;
        " style="cursor: pointer; background-color: transparent; width: 500px; height: 317px; " width="150" height="95" src="http://65.media.tumblr.com/tumblr_m7axvySja21qg8w62o1_500.png" onload="if (this.src.indexOf('_100') != -1) { this.style.backgroundColor = 'transparent'; this.src='http://25.media.tumblr.com/tumblr_m7axvySja21qg8w62o1_500.png'; }"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Some tips&lt;/h3&gt;

&lt;p&gt;To reference the paths in my build script, psake has this nice little helper : &lt;em&gt;$psake.build_script_dir&lt;/em&gt;&lt;br/&gt;
This variable will have the path to the script that you execute. Whether you execute it from another folder or right from the script folder, it will hold the correct value. That&amp;rsquo;s what I base the path to the .sln files in the properties section&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$home = $psake.build_script_dir + "/../.."
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That&amp;rsquo;s also how I let psake know where my powershell modules are in the psake.config.ps1 :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$root = $psake.build_script_dir
$config.modules=("$root\modules\*.psm1")
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Another useful tip is that psake has a built-in function to configure the build environment (access to msbuild.exe of a specific framework for example)&lt;/p&gt;

&lt;p&gt;if you digg into psake.psm1 source code, you will find this function :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function Configure-BuildEnvironment {
$framework = $psake.context.peek().config.framework
if ($framework.Length -ne 3 -and $framework.Length -ne 6) {
    throw ($msgs.error_invalid_framework -f $framework)
}
$versionPart = $framework.Substring(0, 3)
$bitnessPart = $framework.Substring(3)
$versions = $null
switch ($versionPart) {
    '1.0' {
        $versions = @('v1.0.3705')
    }
    '1.1' {
        $versions = @('v1.1.4322')
    }
    '2.0' {
        $versions = @('v2.0.50727')
    }
    '3.0' {
        $versions = @('v2.0.50727')
    }
    '3.5' {
        $versions = @('v3.5', 'v2.0.50727')
    }
    '4.0' {
        $versions = @('v4.0.30319')
    }
    default {
        throw ($msgs.error_unknown_framework -f $versionPart, $framework)
    }
}

$bitness = 'Framework'
if ($versionPart -ne '1.0' -and $versionPart -ne '1.1') {
    switch ($bitnessPart) {
        'x86' {
            $bitness = 'Framework'
        }
        'x64' {
            $bitness = 'Framework64'
        }
        { [string]::IsNullOrEmpty($_) } {
            $ptrSize = [System.IntPtr]::Size
            switch ($ptrSize) {
                4 {
                    $bitness = 'Framework'
                }
                8 {
                    $bitness = 'Framework64'
                }
                default {
                    throw ($msgs.error_unknown_pointersize -f $ptrSize)
                }
            }
        }
        default {
            throw ($msgs.error_unknown_bitnesspart -f $bitnessPart, $framework)
        }
    }
}
$frameworkDirs = $versions | foreach { "$env:windir\Microsoft.NET\$bitness\$_\" }

$frameworkDirs | foreach { Assert (test-path $_ -pathType Container) ($msgs.error_no_framework_install_dir_found -f $_)}

$env:path = ($frameworkDirs -join ";") + ";$env:path"
# if any error occurs in a PS function then "stop" processing immediately
# this does not effect any external programs that return a non-zero exit code
$global:ErrorActionPreference = "Stop"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That function is called automatically by psake before the tasks are run. It looks at psake&amp;rsquo;s configuration hash to find the  &lt;em&gt;$framework&lt;/em&gt; property that you can set at the top of the default.ps1 file.
You maybe noticed that I do the following :&lt;br/&gt;
    properties { 
        &amp;hellip;
        $framework = &amp;ldquo;4.0&amp;rdquo;
    }&lt;/p&gt;

&lt;p&gt;I can then do &lt;em&gt;exec { msbuild &amp;hellip; }&lt;/em&gt;   in my tasks without caring where it is located on my build server. 
The best is that I can &lt;a href="https://github.com/psake/psake/wiki/How-can-I-override-a-property-defined-in-my-psake-script%3F"&gt;override the properties&lt;/a&gt; from the teamcity command line by passing another $framework value as a parameter.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;./psake.ps1 -properties @{"framework"="3.5"}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Simple and efficient :)&lt;/p&gt;</description><link>http://alsagile.com/post/27403222324</link><guid>http://alsagile.com/post/27403222324</guid><pubDate>Tue, 17 Jul 2012 14:09:00 +0200</pubDate><category>psake</category><category>CI</category><category>TeamCity</category></item><item><title>Bits, Blocks &amp; Pixels: Some things beginners might not know about Sublime Text</title><description>&lt;a href="http://blog.alainmeier.com/post/27255145114/some-things-beginners-might-not-know-about-sublime-text"&gt;Bits, Blocks &amp; Pixels: Some things beginners might not know about Sublime Text&lt;/a&gt;: &lt;p&gt;Some really important shortcuts in SublimeText to improve your productivity.&lt;/p&gt;

&lt;p&gt;The one that is new for me is the last one, very useful indeed!&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Select all instances: You can select all instances using cmd + ctrl + G (Thanks gryghostvisuals)&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;a href="http://blog.alainmeier.com/post/27255145114/some-things-beginners-might-not-know-about-sublime-text" class="tumblr_blog"&gt;alainmeier&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I’m a big fan of &lt;a href="http://www.sublimetext.com/" target="_blank"&gt;Sublime Text&lt;/a&gt;. As with many Mac programmers, I started on &lt;a href="http://macromates.com/" target="_blank"&gt;TextMate&lt;/a&gt; and then migrated over once Sublime Text 2 was released. When I started, however, there were a lot of things that I didn’t know about ST, so I’ve compiled a list of basic things that are excellent time savers.&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://alsagile.com/post/27325448590</link><guid>http://alsagile.com/post/27325448590</guid><pubDate>Mon, 16 Jul 2012 12:59:08 +0200</pubDate></item><item><title>Running Solr as a windows service</title><description>&lt;p&gt;&lt;a href="http://lucene.apache.org/solr/"&gt;Solr&lt;/a&gt; is a very powerful search engine built on top of Lucene. If you read this article you are probably familiar with it already, so I will skip the introductions.&lt;/p&gt;

&lt;p&gt;One recurrent issue is that it is not the best fit to run it on a windows server. Or at least, it is not straight forward &lt;a href="http://stackoverflow.com/questions/2531038/how-to-run-solr-on-a-windows-server-so-it-starts-up-automatically"&gt;for&lt;/a&gt; &lt;a href="http://stackoverflow.com/questions/2531038/how-to-run-solr-on-a-windows-server-so-it-starts-up-automatically"&gt;everyone&lt;/a&gt; &lt;a href="http://stackoverflow.com/questions/9532337/running-jettysolr-on-windows-server"&gt;apparently&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I stumbled upon a &lt;a href="https://github.com/rupertbates/SolrWindowsService"&gt;small project&lt;/a&gt; (thanks &lt;a href="https://github.com/rupertbates"&gt;rupertbates&lt;/a&gt;) on github that is making this a piece of cake. I updated it and thought that might help others :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/serbrech/SolrWindowsService"&gt;https://github.com/serbrech/SolrWindowsService &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All you need to do is update the few settings in config file to match your environment :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;solrService&amp;gt;
&amp;lt;add key="JavaExecutable" value="C:\Program Files (x86)\Java\jre6\bin\java.exe" /&amp;gt;
&amp;lt;add key="WorkingDirectory" value="C:\Solr\apache-solr-4.0\example" /&amp;gt;
&amp;lt;add key="Solr.Home" value="solr" /&amp;gt;
&amp;lt;add key="CommandLineArgs" value="-Djava.util.logging.config.file=logging.properties" /&amp;gt;
&amp;lt;add key="ShowConsole" value="false" /&amp;gt;
&amp;lt;add key="Port" value="8983" /&amp;gt;
&amp;lt;add key="InstanceName" value="MyProjectName" /&amp;gt;
&amp;lt;add key="ClientSettingsProvider.ServiceUri" value="" /&amp;gt;
&amp;lt;/solrService&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;After compilation, run &lt;em&gt;Install.bat&lt;/em&gt; from the bin folder.&lt;/p&gt;

&lt;p&gt;That&amp;rsquo;s it. Solr is installed as a service on your windows machine.&lt;/p&gt;

&lt;p&gt;if you just want the executable, &lt;a href="http://dl.dropbox.com/u/2565028/SolrWindowsService.zip"&gt;here you go&lt;/a&gt;.&lt;/p&gt;</description><link>http://alsagile.com/post/25153448145</link><guid>http://alsagile.com/post/25153448145</guid><pubDate>Fri, 15 Jun 2012 13:23:00 +0200</pubDate><category>solr</category><category>github</category></item><item><title>Lambdas input parameter name</title><description>&lt;p&gt;I just saw an example of lanbda using &amp;ldquo;it&amp;rdquo; as the lambda input parameter name, and I found it quite nice. I never thought about this, nothing exceptional, just a nice touch in readability :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;collection.Where( it =&amp;gt; it.Name == "MyRelationship" );
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It stays concise, still keeps a meaning when you read it, and it stays short.&lt;/p&gt;

&lt;p&gt;By the way, this lambda was from an example in the &lt;a href="https://github.com/SepiaGroup/Neo4jRestNet"&gt;Neo4J Rest interface .net wrapper&lt;/a&gt; that popped up in the github &lt;a href="http://github-trends.oscardelben.com/"&gt;&amp;ldquo;C# Most Watched This Week&amp;rdquo;&lt;/a&gt; rss feed.&lt;/p&gt;

&lt;p&gt;Maybe something I will look into. Graph databases are still a mystery to me.&lt;/p&gt;</description><link>http://alsagile.com/post/25048787678</link><guid>http://alsagile.com/post/25048787678</guid><pubDate>Thu, 14 Jun 2012 00:16:00 +0200</pubDate><category>graph</category><category>neo4j</category><category>lambda</category><category>syntax</category></item><item><title>Designing software for multiple platforms is not about making them similar</title><description>&lt;p&gt;Github builds great software. They &lt;strong&gt;think it&lt;/strong&gt; through, &lt;strong&gt;design it&lt;/strong&gt; well, and they &lt;strong&gt;ship&lt;/strong&gt; good software.&lt;/p&gt;

&lt;p&gt;Recently they shared their experience about &lt;a href="https://github.com/blog/1151-designing-github-for-windows"&gt;how they designed the native windows github app&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://65.media.tumblr.com/tumblr_m5b6y1N2Fi1qg8w62o1_500.jpg" alt="Codercat from github" title="The coder octocat from github"/&gt;&lt;/p&gt;

&lt;p&gt;What I find very interesting here is the principal advantage they see in doing this.
The first idea you might have when attacking this problem is to make the UI look relatively similar so that your product keeps it&amp;rsquo;s &amp;ldquo;identity&amp;rdquo; in your users eyes. But here is what they say :&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&amp;ldquo;We specifically made the decision to write each application in a language native to the platform, and this has turned out to be hugely beneficial to us. Because of this separation we&amp;rsquo;ve been free to tackle the problems that are most pressing for each platform and work in the best possible tools instead of being constrained to the lowest common denominator.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Instead of making the difference of the platforms a problem, they turned it into an advantage. They don&amp;rsquo;t think about how to make them similar despite the platform differences, on the contrary. Building the apps differently the different platforms gives a better experience, more adapted for every users. I believe this is the right approach.&lt;/p&gt;

&lt;p&gt;Trying to make an app look and work the same on 2 different platforms might seem easier, or less complex from both the development side and the user&amp;rsquo;s side. But that would be ignoring the differences of &lt;em&gt;experiences&lt;/em&gt; that are expected on the different on mac and windows, and it can drag you down towards the lowest common denominator, particularly in terms of user experience.&lt;/p&gt;

&lt;p&gt;The last note that I really appreciate is the very last paragraph and sentence. I don&amp;rsquo;t think it needs much comments :&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&amp;ldquo;Design is often most important for the things that you don&amp;rsquo;t see.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://alsagile.com/post/24688024540</link><guid>http://alsagile.com/post/24688024540</guid><pubDate>Fri, 08 Jun 2012 19:33:36 +0200</pubDate><category>design</category><category>github</category></item><item><title>myNoSQL: Translate SQL to MongoDB MapReduce</title><description>&lt;a href="http://nosql.mypopescu.com/post/392418792/translate-sql-to-mongodb-mapreduce"&gt;myNoSQL: Translate SQL to MongoDB MapReduce&lt;/a&gt;: &lt;blockquote&gt;
&lt;p&gt;I keep hearing people complaining that MapReduce is not as easy as SQL. But there are others saying SQL is not easy to grok. I’ll keep myself away from this possible flame war and just point you out to this &lt;a href="http://rickosborne.org/download/SQL-to-MongoDB.pdf" rel="external nofollow" target="_blank"&gt;☞ SQL to MongoDB translation PDF&lt;/a&gt; put together by Rick Osborne and also his &lt;a href="http://rickosborne.org/blog/index.php/2010/02/08/playing-around-with-mongodb-and-mapreduce-functions/" rel="external" target="_blank"&gt;☞ post&lt;/a&gt;…&lt;/p&gt;&lt;/blockquote&gt;</description><link>http://alsagile.com/post/23728754981</link><guid>http://alsagile.com/post/23728754981</guid><pubDate>Fri, 25 May 2012 13:34:08 +0200</pubDate></item><item><title>The server is stable... Oops</title><description>&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/2593343"&gt;https://gist.github.com/2593343&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;It never crashes!&lt;/p&gt;</description><link>http://alsagile.com/post/22374533638</link><guid>http://alsagile.com/post/22374533638</guid><pubDate>Fri, 04 May 2012 10:42:00 +0200</pubDate><category>.net</category><category>oops</category></item><item><title>How I startup all my project services in multiple terminal tabs in one command</title><description>&lt;p&gt;[DISCLAIMER]&lt;br/&gt;&lt;img src="http://65.media.tumblr.com/tumblr_m31xya0nn01qg8w62o1_250.jpg"/&gt;&lt;br/&gt;
I am running snow leopard, and &lt;a href="http://totalterminal.binaryage.com/"&gt;TotalTerminal&lt;/a&gt; (because the slide down is awesome)&lt;br/&gt;
[/DISCLAIMER]&lt;/p&gt;

&lt;p&gt;It&amp;rsquo;s been some time now that I am playing and learning ruby, rails, and the tools around it to develop. 
On a project I work on, we start having a bunch of services to start to be ready to work. If you want to really see what is going on, you want each of them in a separate tab.&lt;br/&gt;
And so the dance starts:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Cmd + T  
cd &amp;lt;project&amp;gt;
[insert command to start service]  
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And the services to start are:&lt;br/&gt;
-mongod&lt;br/&gt;
-redis-server&lt;br/&gt;
-foreman&lt;br/&gt;
-passenger&lt;br/&gt;
-fork&lt;br/&gt;
-autotest&lt;/p&gt;

&lt;p&gt;I looked for a way to script this repetitve work, and found how to open a new tab in your terminal using shellscript.&lt;/p&gt;

&lt;p&gt;I edited it appropriately to pass it a command and Voilà :&lt;/p&gt;

&lt;div class="gist"&gt;&lt;a href="https://gist.github.com/2492064"&gt;https://gist.github.com/2492064&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;And it is now in my .bash_profile with a better alias.&lt;br/&gt;
If you have better way, or equivalent ones, please tell me, I am always happy to learn!&lt;/p&gt;</description><link>http://alsagile.com/post/21795518778</link><guid>http://alsagile.com/post/21795518778</guid><pubDate>Wed, 25 Apr 2012 21:27:00 +0200</pubDate><category>script rails</category></item><item><title>Trim your build on Silverlight projects!</title><description>&lt;p&gt;This post expose the problem from the current project and technology I work with. However, the general lesson behind it can be applied to any other project or technology.&lt;/p&gt;

&lt;p&gt;By curiosity, I checked the build time stats fromour Continuous Integration server (TeamCity) for our main Silverlight project. It&amp;rsquo;s big, and the compile time is a clearly pain on this platform.&lt;/p&gt;

&lt;h3&gt;Here is what I saw :&lt;/h3&gt;

&lt;p&gt;&lt;img src="http://66.media.tumblr.com/tumblr_m1ahcpOMc01qfqwml.png"/&gt;&lt;/p&gt;

&lt;p&gt;A clear drop happened. What did we do for the build time to drop by nearly 30 seconds?&lt;/p&gt;

&lt;p&gt;Looking at the history, what happened is that we cleaned up the styles from our solution. We use the Telerik suite of controls, and they come with a massive style library. Over time, we accumulated lots of them in our projects. some where not even used anymore. or styles from controls that we don&amp;rsquo;t use where hanging around.&lt;/p&gt;

&lt;p&gt;Yep. Parsing, compiling and packaging this file was adding 20 (TWENTY) seconds to the build time!&lt;/p&gt;

&lt;p&gt;Before: 1min 57sec (not that a few days before it was even above 2 min)
After: 1min 37sec&lt;/p&gt;

&lt;h3&gt;Let&amp;rsquo;s do the math&lt;/h3&gt;

&lt;p&gt;I bet we would get under 1 min build time if we would clean up further the styles. (note that 1min build is still really long on any other technology than Silverlight…)&lt;/p&gt;

&lt;p&gt;How many time/day do we build the client?
Let’s say 20 times/day/developer.
If we manage to trim 1min in total. (from the initial 2min to about 1 min), we would save 20min per day per developer. That&amp;rsquo;s 1h40/week/dev
Consider 3 developers working on that project, that’s &lt;b&gt;5 man hours per week&lt;/b&gt; lost waiting for compilation! &lt;b&gt;20 man hours&lt;/b&gt; per months on compilation! imagine if you have 20 developers working on that project!&lt;/p&gt;

&lt;p&gt;And we don’t consider the extra time lost because the developers change focus, go get a coffee or check their mail while waiting for the compiler.
I’m also pretty sure that Visual Studio would be very happy to have less files/code/xaml to handle and would hang much less.&lt;/p&gt;

&lt;p&gt;So how much is compile time worth working on? Why don&amp;rsquo;t you spend 5h getting that compile time down?&lt;/p&gt;</description><link>http://alsagile.com/post/19731792868</link><guid>http://alsagile.com/post/19731792868</guid><pubDate>Thu, 22 Mar 2012 15:25:00 +0100</pubDate><category>silverlight</category><category>continuous integration</category></item><item><title>This is how I want all my tools. I had lots of ideas for better...</title><description>&lt;iframe src="https://player.vimeo.com/video/36579366?title=0&amp;byline=0&amp;portrait=0" width="400" height="225" frameborder="0" title="Bret Victor - Inventing on Principle" webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;This is how I want all my tools. I had lots of ideas for better tools popping up in my head while watching this video. The kind of paradigms that he talks about are applicable to most of the creative processes. It’s really amazing to watch, whether you understand code or not.&lt;/p&gt;

&lt;p&gt;via &lt;a href="http://boingboing.net/2012/02/15/technology-interaction-and-eth.html"&gt;http://boingboing.net/2012/02/15/technology-interaction-and-eth.html&lt;/a&gt;&lt;/p&gt;</description><link>http://alsagile.com/post/17704567198</link><guid>http://alsagile.com/post/17704567198</guid><pubDate>Thu, 16 Feb 2012 09:32:34 +0100</pubDate></item><item><title>myNoSQL: Document Databases Compared: CouchDB, MongoDB, RavenDB</title><description>&lt;a href="http://nosql.mypopescu.com/post/978742866/document-databases-compared-couchdb-mongodb-ravendb"&gt;myNoSQL: Document Databases Compared: CouchDB, MongoDB, RavenDB&lt;/a&gt;: &lt;blockquote&gt;
&lt;p&gt;Brian Ritchie has two posts (&lt;a href="http://weblogs.asp.net/britchie/archive/2010/08/12/document-databases.aspx" rel="external" target="_blank"&gt;☞ here&lt;/a&gt; and &lt;a href="http://weblogs.asp.net/britchie/archive/2010/08/17/document-databases-compared-mongodb-couchdb-and-ravendb.aspx" rel="external" target="_blank"&gt;☞ here&lt;/a&gt;) covering three document databases: CouchDB, MongoDB, and RavenDB concluding with the matrix below:&lt;/p&gt; &lt;div id="" class="embedded"&gt;
&lt;a href="http://weblogs.asp.net/britchie/archive/2010/08/17/document-databases-compared-mongodb-couchdb-and-ravendb.aspx" rel="external nofollow" target="_blank"&gt;
&lt;img src="http://65.media.tumblr.com/tumblr_l7f33oSmzG1qappj8.png"/&gt;&lt;/a&gt;
&lt;/div&gt; &lt;p&gt;But before using this as a reference material there are a couple of corrections needed:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;They have some special characteristics…&lt;/p&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;</description><link>http://alsagile.com/post/17419690001</link><guid>http://alsagile.com/post/17419690001</guid><pubDate>Sat, 11 Feb 2012 11:50:28 +0100</pubDate></item><item><title>Git Is Simpler Than You Think</title><description>&lt;p&gt;&lt;a href="http://nfarina.com/post/9868516270/git-is-simpler" class="tumblr_blog"&gt;nfarina&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It was about one year ago that we switched to Git. Previously, we used Subversion, through the Mac app &lt;a href="http://versionsapp.com"&gt;Versions&lt;/a&gt;, which (rightly) holds an Apple Design Award.&lt;/p&gt;

&lt;p style="text-align:center;position:relative;left:-20px;"&gt;
    &lt;img src="http://cl.ly/1w3c282U1I34073u0W3D/screen2.png"/&gt;&lt;/p&gt;

&lt;p&gt;I made the executive decision to leave our comfy world of Versions because it seemed clear that Git was winning the Internet. There was much grumbling from my teammates, who were busy enough doing actual work thank you very much.&lt;/p&gt;

&lt;p&gt;But I pressed forward. We signed up for accounts on &lt;a href="http://github.com"&gt;Github&lt;/a&gt;. We learned how to type &lt;code&gt;'git push'&lt;/code&gt; and &lt;code&gt;'git pull'&lt;/code&gt;. We became more confident. Git is just like any other source control system! But it wasn’t long before one of our devs called me over to look at a…situation.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://nfarina.com/post/9868516270/git-is-simpler"&gt;Read More&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;</description><link>http://alsagile.com/post/9929253471</link><guid>http://alsagile.com/post/9929253471</guid><pubDate>Wed, 07 Sep 2011 22:54:39 +0200</pubDate><category>git</category></item><item><title>Silverlight unit testing - Test Not Initialized</title><description>&lt;p&gt;It has been a year now that I work on a silverlight project. As any respectful developer I write unit tests. But in silverlight, things are not all that easy when it comes to testing.&lt;/p&gt;

&lt;p&gt;First of all, the unit testing framework doesn’t come out of the box. Instead, you will find it in the &lt;a href="http://silverlight.codeplex.com," title="Silverlight Toolkit on Codeplex"&gt;Silverlight Toolkit&lt;/a&gt;. On the bright side, this allow a separate release cycle than the one from silverlight.&lt;/p&gt;

&lt;p&gt;Then, you might be aware that you need to run your silverlight tests in the browser, because the silverlight runtime can only run in the browser, or hosted by a wpf application since silverlight 4.&lt;br/&gt;
A very important part of unit testing is to have a fast feedback loop. I want to run my tests often, and therefore, I want them to run fast. Having to run them in the browser unfortunately doesn’t help it.&lt;/p&gt;

&lt;p&gt;Those are common complains from developers who write unit tests on a silverlight project.&lt;br/&gt;
But the issue I will expand is different.&lt;/p&gt;

&lt;h4&gt;TestInitialize Bug&lt;/h4&gt;

&lt;p&gt;In MsTest framework, if you mark a method with a [TestInitialize] attribute, it will run before each tests. As the attribute name suggest, this is useful to initialize the state of the system before running each tests of the fixture.&lt;br/&gt;
Here is the problem. if the initialization fails, I really want to see my test fail. But with the silverlight testing framework, if an exception is thrown in the testinitialize method, &lt;strong&gt;the test will not fail&lt;/strong&gt;. This can result in &lt;strong&gt;false positive&lt;/strong&gt;, and that’s an issue because I can’t trust my tests anymore.&lt;/p&gt;

&lt;p&gt;To work around it we have a simple &lt;a href="https://gist.github.com/1160978" title="Gist"&gt;base class&lt;/a&gt; that looks something like the following :&lt;/p&gt;

&lt;pre class="brush: csharp"&gt;public class TestBase
{
    private Exception _exception;

    [TestInitialize]
    public void TestInitialize()
    {
        try
        {
            Initialize();
        }
        catch (Exception exception)
        {
            _exception = exception;
        }
    }

    [TestMethod]
    public void InitializeTest()
    {
        if (_exception != null)
        {
            throw new InvalidOperationException("Failure running test setup", _exception);
        }
    }

    public virtual void Initialize() { }
}  
&lt;/pre&gt;

&lt;p&gt;So when I write a test fixture now, I don’t add a TestInitialize attribute above a method. Instead, I inherit from this base class and override the Initialize method. But this is obviously a dirty workaround. My tests still don’t fail. What I get is another test that tests the initialize method…
At least I have a failing test when an exception is thrown.&lt;/p&gt;

&lt;p&gt;If you don’t like this easy workaround, you might want to have a look at the &lt;a href="http://xunitcontrib.codeplex.com/"&gt;xunit.contrib project&lt;/a&gt;, or at &lt;a href="http://greenicicleblog.com/2010/04/27/nunit-for-silverlight-updated/"&gt;nunit for silverlight&lt;/a&gt;. These have other advantages that I will expand in another post.&lt;/p&gt;</description><link>http://alsagile.com/post/9217189577</link><guid>http://alsagile.com/post/9217189577</guid><pubDate>Sun, 21 Aug 2011 21:15:00 +0200</pubDate></item><item><title>ocourtois:

Une animation intéressante sur les multiples façons...</title><description>&lt;iframe width="400" height="225"  id="youtube_iframe" src="https://www.youtube.com/embed/O94kYyzqvTc?feature=oembed&amp;enablejsapi=1&amp;origin=http://safe.txmblr.com&amp;wmode=opaque" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://www.ocourtois.fr/post/6821627733" class="tumblr_blog"&gt;ocourtois&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Une animation intéressante sur les multiples façons de mesurer les retours sur investissement du design de l’expérience utilisateur (façon animation RSA). &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Toujours pas convaincus?&lt;/p&gt;</description><link>http://alsagile.com/post/6950118221</link><guid>http://alsagile.com/post/6950118221</guid><pubDate>Sun, 26 Jun 2011 23:30:00 +0200</pubDate></item></channel></rss>