I am a Softie

Microsoft logo

Softie is internal slang for Microsoft employee.

For a couple of years I have had my own company Avior together with my partner. We had fun times and difficult times, but we did what we loved – developed software. Late September I started talking with Microsoft Denmark about the position as technical evangelist. At first I was reluctant as I was afraid to lose my technical competence and leaving my own company, but I was intrigued. I finally agreed to leave Avior and join Microsoft after a couple of conversations with current and previously Microsoft employees – they all spoke fondly about Microsoft – if I could cope with the politics and ceremony.

What is the job of a technical evangelist?

An evangelist advocates the evangelium, which means ‘good news’. All Latin, nothing religious – but in my case just technical :)

It is about connecting people who have problems with a product, technology and knowledge needed in order for them to succeed. In my mind, it is all about authentic content, communication, and community. I wish to spread knowledge and help other developers while keeping my integrity.

Current status

Now 3 months in, I find myself at home at Microsoft, but I still feel like a n00b. There are so many people and internal processes that I need to familiarize myself with that I sometimes feel dizzy and do not feel that I am contributing enough.

Challenges

I am catching up on the Windows 8, Windows Phone 8 and Azure – which is the new stuff at Microsoft. It is a lot of ground to cover, so I do no longer fear for my technical competencies as I am spending much time studying and helping customers with technical issues.

I wish to engage the community more in the New Year, so I am busy planning talks and the Danish Developer Conference.

One request for you – let me know how I am doing, please.

Merry Christmas and happy New Year.

Instrumentation presentation at Campus Days 2013

Campus Days 2013 logoI was fun to present today at Campus Days 2013 in Copenhagen, Denmark. The talk was about how to instrument software by using frameworks like TraceSource, EventSource, Event Tracing for Windows and how to perform post-mortem debugging via Visual Studio and PerfView.

Here is a great resource for enabling diagnostics in Azure.

Automatic Retry and Circuit Breaker made easy

Polly library logoIf you do not know Polly, you are missing out! I did not know about it until a couple of days ago and you properly never heard about it either, as this wonderful little library only has 63 downloads on NuGet at the time of writing.

Polly is an easy to use retry and circuit breaker pattern implementation for .Net – let me show you.
Start by specifying the policy – what should happen when an exception thrown:

  var policy = Policy
    .Handle<SqlException(e => e.Number == 1205) // Handling deadlock victim
    .Or<OtherException>()
    .Retry(3, (exception, retyCount, context) =>
    {
      // Log...
    });

The above policy specifies a SqlExeption with number 1205 or OtherException should be retried three times – if it still fails log and bobble the original exception up the call stack.

  var result = policy.Execute(() => FetchData(p1, p2));

It is also possible to specify the time between retries – e.g. exponential back off:

  var policy = Policy
    .Handle<MyException>()
    .WaitAndRetry(5, retryAttempt =>
      TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)
    );

Or the circuit breaker safeguarding against the same error occurs again and again if an external system is temporarily unavailable:

  var policy = Policy
    .Handle<TimeoutException>()
    .CircuitBreaker(2, TimeSpan.FromMinutes(1));

Go get it – I’m already using it :)

Accessing HTTP Request from ASP.NET Web API

Do you need access to the bare HTTP request in ASP.NET Web API to access custom header etc.? Then add the HttpRequestMessage:

public class CalculatorController : ApiController
{
  public int Add(HttpRequestMessage requestMessage, int x, int y)
  {
    var accessToken = requestMessage.Headers.Authorization.Parameter;
    // use the HTTP header

    return x + y;
  }
}

The HttpRequestMessage is automatically bound to the controller action, so you can still execute the action like http://localhost/calculator/add?x=3&y=2

Simple and easy.

GOTO Aarhus 2012 – Tuesday

The morning keynote by Scott Hanselman was about the true power of JavaScript. He argued that JavaScript in the browser is a full operating system running as a virtual machine within the browser – so we should treat it so. Don’t use Java Applets, Flash, Flex or Silverlight as it just another (slow) abstraction upon an already powerfull engine – the browser. It was a great talk leading up to the pre-release of TypeScript.

I followed a couple of sessions the continuous delivery by Sam Newman, Michael T. Nygard (author of Release It) and Jez Humble (author of Continuous Delivery).
Continuous Integration is a prerequisite of Continuous Delivery, but many still don’t use apply Continuous Integration to their solution, with daily incremental check-ins, automated build and unit tests.

To simplify Continuous Delivery, everything must be automated. To ease the task of automation, things must be simplified. To simplify, start by decomposing the system into manageable pieces, so each can be deployed separately. How?
Decompose the system into disconnected services makes it easier to deploy a subset of the system. This limits the impact of a deployment. It even makes it possible to mitigate the risk further by making small incremental changes by only deploying one subsystem at the time.

These services have to be structured as application silos and share nothing, not even the database schema.

By automating and decomposing your system into disconnected application silo services you too can do Continuous Delivery.
After the conference the GOTO Aarhus guys had joint up with the local community and user groups to hos open sessions. I attended the ANUG (Aarhus .NET User Group) session with Anders Hejlsberg. He presented the brand new TypeScript – a superset of JavaScript that compiles into plain JavaScript and runs in any browser (similar concept as CoffeeScript). It has great tooling support in Visual Studio with intelliSense and static verification.

I’m looking forward to the last day of the conference tomorrow.

GOTO Aarhus 2012 – Monday

The day started with a keynote from @Falkvinge from the Pirate Party. I wasn’t expecting much from this keynote, but I was pleasantly surprised. First of all, I assumed that I knew quite a bit about the Pirate Party – I was wrong! Facts: the Pirate Party is present in 150 countries and has 2 European Union parliament members. These guys are serious and not just a protest party wanting to legalize sharing copyrighted material. They are fighting the problems with limiting access to knowledge and ideas. They are emphasizing that exclusive right like patents, copyright and subsidizing are counterproductive. That’s so true! @Falkvinge disrupted my brain – that’s great, because that is why I’m here!

Next up was great presentation of graph databases by Jim Webber – fast speaking provocative British architect from Neo4J. He (re)spiked my interest in ‘other’ databases and stressed that each type of database like relational, object, key-value stores, document,  graph etc. databases each fit their problem domain. So you shouldn’t just pick RavenDB because it is the new hot think in .Net sphere (or because Ayende aka Oren Eini says so). I will definitely take a look Net4J with the .Net client library Neo4jClient . Another great point from Jim Webber was; ACID does scale (though many claims otherwise), but he stressed it was distributed ACID with 2PC that doesn’t scale.

From then on I attended a couple of unfortunate sessions (not worth mentioning). Now it is time for the conference party where the beer is sponsored by Atlassian.

GOTO Aarhus 2012 Schedule

Soon I’ll be joining a bunch of great people from the Danish developer community and abroad at this year GOTO Conference in Aarhus next week.

I’ve been looking at the conference schedule trying to create my schedule… the line-up of international fame speakers are impressive, but I’ll go for the odd sessions to expand my horizon. During breaks I’ll discuss and share ideas with my fellow attendees – I might even skip sessions for interesting discussions in the hallways.

Here is my tentative schedule:

See you at GOTO Aarhus 2012?

Are you going to GOTO Aarhus 2012 conference October 1-3 in Aarhus, Denmark?

The conference is covers diverse software development topics like big data, augmented data, agile perspectives, JavaScript, UX, continuous delivery, mobile, cloud, languages, NoSQL, scale … so this is not a vendor specific conference where the newest technology is presented.

I prefer conferences where I get inspired… a conference where all the participants; speakers and fellow participants plant seeds in my head for new ideas and alternative approaches to solving problems.

That’s why I’m going to the GOTO Aarhus conference.

Blog post from 10000 meters in the Air

While writing and posting this post I’m currently flying from Copenhagen, Denmark to London, United Kingdom over the North Sea with Norwegian airlines using the free online Wi-Fi connection onboard. The Internet connection is slow, but that’s expected as the traffic is routed through satellites and the fact that I share the connection with the 250 or so other passengers; all trying to access Facebook :-)

A ping request to Google.com show that a roundtrip takes around 800 ms with some fluctuations into the 1200 ms

Pinging google.com [173.194.70.113] with 32 bytes of data:
Reply from 173.194.70.113: bytes=32 time=681ms TTL=43
Reply from 173.194.70.113: bytes=32 time=869ms TTL=43
Reply from 173.194.70.113: bytes=32 time=705ms TTL=43
Reply from 173.194.70.113: bytes=32 time=750ms TTL=43

An Internet connection speed test reveals my upload was around 400 Kbit/s download and 15 Kbit/s upload.

A trace route didn’t disclose much information; therefore not included in this blog post.

The Internet connection is very unreliable making it impossible to work, but IM and light sites are browsable. Internet on a flight is a welcome initiative making it more pleasant to fly.

I just hope the competitors will do the same and the quality of the connection will improve.