Type casting with extension methods

Once in a while I need to convert one object from one type to another because they represent slightly different views of the same data but they do not share a common parent. An example would be an object used internally representing some complex state for something (let us call it FooComplex) and someting simple…

0

Task-based Asynchronous Pattern – WhenRandom

I couldn’t resist to create a method to deal with a scenario even less common than WhenSome. The crazy scenario here is that you have N tasks of type Task<T> and you want to return when a random task completes. The easiest way to do this is to just pick a random task and wait…

0

How Spotify Works

While I wish I could write a long article on how Spotify works technically this is not what I want to tell you about today. Nor will I tell you how I would build Spotify if I had to, but that would be an interesting blog post. But today I want to tell you about…

1

HTTP Keep-Alive is not always your friend – but math is!

In HTTP 1.1 connections are reused by default. This means that if you make two HTTP requests after each other you can do it over the same TCP connection. This saves you the overhead of setting up a new TCP connection. This is even more important if you’re using HTTPS since the SSL handshake to…

1

The tale of an UnobservedTaskException

Last week I helped a colleague who was experiencing UnobservedTaskExceptions I his code. The problem was essentially that the code started several tasks and then in a loop checked each one if it was faulted or not. If a task was faulted the method threw an exception. This meant that if two tasks faulted in…

0

Lean processes explained with LEGO

I read this interesting article that illustrated the difference between processes optimized for flow efficiency versus resource efficiency. Maybe not obvious in that article why flow is cheaper (or same) cost as resource optimized but if we assume customer satisfaction is a great asset I think it is obvious which process is preferably from a customer…

1

How Do Software Engineers Understand Code Changes?

Some researchers from MSR have published a paper on how do software engineers understand code changes. To me there are no surprises, especially since I participated in the survey the paper is based on (I think I’m quoted too actually). The bottom line is that developers spend a lot of time trying to understand previous code…

1

XCOM interactive trailer

I loved the original XCOM game (and terror from the deep was OK). Will definitely play this new game when it releases next week. They did something interesting for their recent trailer; an interactive trailer where you actually get to change how the flow goes. [View:https://www.youtube.com/watch?v=93M_fLmmecU]

0

Task-based Asynchronous Pattern – WhenAllOrErrorBatched

This is a variant of WhenAllorError that a colleague asked me about. His scenario was that he had a lot of tasks to complete but since they all involved making HTTP requests to other servers he did not want to start them all at once but rather start a few and then as they completed…

0