Sunday, January 20, 2013

Retrospective of day 1 - Warm Crocodile Conf

Its already 3 days ago I left the #WarmCrocConf and think its time to write my experience when the conference is still fresh in my mind.

The conference was all in all great, cozy and intense. I think that we were about 200 people, and that did the conference intimate, i think that was really great because it was easy to get a chance to talk to the speakers, and connect with other geeks after dinner. The only really thing that I can complain about was the amount of changes to schedules.

I talked with the cool guys working on AutoFixture, especial nikos aka  , and showed nikos an enriko aka  my AutoFixtureTS project (a typescript version of AutoFixture.) I think they thought it was interesting?.

Alot of stuff was going on at the conference and Eventifier  has collected tweets, slides and images.

Session retrospektiv:

Day 1

BREAKFAST  KEYNOTE - Growing effective agile teams by Roy Osherove
Roy Osherove (@RoyOsherove on twitter) is the Chief Scientist at Bouvet.no
He did er great job and inspired me and got me thinking - have I ben in the comfort zone to long?...  maybe, so now I'm actually making a list of what kind of avalanche I wan't to dig into.

Get the keynote slide

Grokking Git by seeing it - Enrico Campidoglio
I didn't really know what I would expect to learn in this session. I thought I knew the basic of GIT, I was terribly wrong, yes I knew the basic commands, but that was it :-)

He was really good to explain how GIT actually worked by showing it step by step.
Things I need to remember and dig into here is:

SeeGit => Realtime repository visualizer
Posh-GIT => A better GIT with powershell
GIT tutorial => Need to try this :-)

Enrico works at tretton37 and can be contacted through his blog or on Twitter @ecampidoglio

Tour de API - Anne-Sofie Nielsen
Anne-Sofie did a great talk about oAuth and how to use it with different API's. The presentation was in 3D, pretty cool, and a good outbreak from normal .PPT slides.
She also mention to be aware of API changes and how API keys works. This was something a colleague and I hasn't been aware of :-(
Anne-Sofie has 3rd degree black belt in karate and can be contacted on her blog or on Twitter @femalenerd get the slide

NuGet (Anti-)Patterns: Tales from the trenches - Xavier Decoster
Xavier talked about Package Version, Package Repositories and general Anti patterns.
Things I remembered her was:

Package Version
Use semantic version with NuGet and how NuGet version's defers from SemVer.

Package Repositories
Split package repositories by audience, by using different feeds, I will dig into MyGet.org to see if I can use it.

Xavier can be found at http://www.xavierdecoster.com and you can follow him on Twitter @xavierdecoster

Get the Slide

Unit Testing best practices and horrible mistakes -  Roy Osherove
Roy Talks allot and love to sing, he should definitely publish the songs on YouTube.
Top 5 best practices  I think he covered in his session

  1. Test only public's
    1. Testing a private makes your test more brittle
    2. Test-First leads to private members after refactoring, but they are all tested
  2. Test Only One Thing
    1. avoid multiple Asserts
    2. one mock per test
  3. Enforce test isolation
    1. No dependency between tests!
    2. Don't run a test from another test
  4. Separate unit from integration tests
  5. Naming a unit test
    1. use _ to describe the test

Get the slide


Taking the hippie bus to the enterprise - Mogens Heller Grabe
Great Session, really showed how simple you could use a service bus with Rebus, I have to integrate in several of my projects. A fun thing was I got an error in one project while attending the Rebus session that Rebus could have prevent from happened.
Find him on Twitter @mookid8000 Read his blog Get the slide Get the demos

Organize your chickens: NuGet for the enterprise - Xavier Decoster
We had a good discussion about Package Management, dependency hell and the NuGet eco system. Then we discussed MyGet vs. TeamCity as a pacakage server, and though we have TeamCity and TeamCity has some of the same features, it maybe make sense for me to use MyGet. I need to dig into this...

Get the slide

Sunday, January 13, 2013

Extension methods in TypeScript

/* 18/1 2013Update Remember Extension methods are code smell, so use it only where it really make sense.
Good blog post about Extension methods why its code smell http://www.daedtech.com/why-i-dont-like-c-extension-methods   
*/

When working with strings it’s likely that you’ve had to check if the string is null or empty, and
Thats no different in TypeScript.

I thougt of making an extension method for StringIsNullOrEmpty, but could not fine any documentation on this.

I know that TypeScript interfaces are open ended, so I extended the String interface like this

    interface String {
        StringIsNullOrEmpty: () => bool;
    }


Then I just need to found out how to inplement it, and used prototype for this.

    String.prototype.StringIsNullOrEmpty = () : bool{
        return this == null || this.length == 0;
    }


This works fine, but I'm not sure this is the correct way of doing this, so if you know a better way please leave a comment.

I have encapsulated the inteface and all my prototypes into a module called StringExtensions

module StringExtensions {
    interface String {
        StringIsNullOrEmpty: () => bool;
    }

    String.prototype.StringIsNullOrEmpty = () : bool{
        return this == null || this.length == 0;
    }
}


Here is a litle jasmine test.

describe("StringExtensions methods tests", () => {

    it("Given an empty string should return true", () => {

        // Fixture setup       

        var sut = "";

        // Exercise system               

        var expected = true;

        // Verify outcome

        expect(sut.StringIsNullOrEmpty()).toEqual(expected);

        // Teardown

    });   
});

Friday, January 11, 2013

TDD StringCalculator kata in TypeScript

Inspired by Roy Osherove StringCalculator http://osherove.com/tdd-kata-1/ and playing around with TypeScript, I tried to make my own version in TypeScript.

I have made this Kata 2 times in TypeScript, first time just to get the feeling, second time as a screencast, and thats the one I share with you.

I have written my tests Visual Studio 2012 with webessentials and used the jasmine test framework, and used Chutzpah as test runner.
Chutzpah supports both Qunit and jasmine testing framework.
Chutzpah uses the phantomJS headless browser to run your tests. Chutzpah also support for TeamCity (CI server) to automatically run your tests.



TypeScript StringCalculator Kata from Ronnie on Vimeo.


Wednesday, December 12, 2012

AutoFixture for TypeScript

Automate test fixture When doing TDD.

In .NET we have AutoFixture written by Mark Seemann.
It really helps me saving time and making my tests cleaner and faster.

For the last few month I have playing around with TypeScript, it's not perfect but really has potential.

I needed a new home project based on TypeScript, but needed and idea to what I would create.

So I have made a project on GitHub called AutoFixtureTS - http://ronniehegelund.github.com/AutoFixtureTS/

Im using Jasmine as Testing framework and has 73 tests and 73 passed :-)

Check it out, any feedback would be great!

Tuesday, September 7, 2010

uComponents is in the top 10 Best rated packages

uComponents is in the top 10 Best rated packages, and is still in beta wooot!....

uComponents is a collaborative project for creating components for Umbraco including data types, XSLT extensions, controls and more.

Currently uComponents consists of 17 data types, 3 very useful XSLT extension libraries, and some great utilities to make consistent data types.

I made a bunch of fixing and featureing to the uComponents last night so its really taking shape, only 6 issues left atm. :-)

So I think that we will make a final release very soon.

Though the code is top quality tested, we still need to do a lot of documentation

you can download uComponents here

Beta http://our.umbraco.org/projects/backoffice-extensions/ucomponents
Code http://ucomponents.codeplex.com/

Monday, April 6, 2009

Umbraco - moving servers

Umbraco is moving servers tonight, so the website is down atm, so I got this friendly message!..




If you re looking @23:10 Niels is still smiling, even though he made a little mistake late at night.

That's what I call "umbraco spirit"

Keep up the good work Niels, and thank for a great CMS!..

Friday, April 3, 2009

Test .NET solutions and SVN with powershell

Developer consultants are often working with several projects during each day, and between colleagues, and there is nothing wrong with that, as long that you have your projects in version control.

@ Ebita (where I work) we are using Subversion and Visual SVN for VS200x IDE and its working great.

Every time I have worked on a project I commit my changes, but to ensure that the projects still compiles in a fresh clean checkout, I check all the code out in a different folder and compiles the project.

This is a manual process "Click checkout,open solution in VS,Click Rebuild button,check for compilation errors"

I don't like manual processes, if it can be automated, why isnt it so?
I installed powershell on my new laptop a few days ago, and thought let me see how easy it can be done with that.

Here is the code

$svnProjectName = "test_svn_project"
$svnUserName = "foo"
$svnPassword = "bar"
$visualStudioSolutionName = "test.sln"
$CheckoutPath = "C:\test\testFolder"

"//////////////////////"

"Get project from svn"
"//////////////////////"
[diagnostics.process]::start("svn.exe","checkout svn://svn/$svnProjectName $CheckoutPath --username $svnUserName --password $svnPassword").WaitForExit()

"//////////////////////"
"Rebuild .NET..."
"//////////////////////"

c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msbuild.exe "$CheckoutPath\$visualStudioSolutionName" /t:Rebuild /p:Configuration=Release

"//////////////////////"
"Finsished test deleting project"
"//////////////////////"

rm $CheckoutPath -recurse -force

"//////////////////////"
" DONE "
"//////////////////////"


Happy shelling :-)