Finding The Odd One Out In C#

Finding The Odd One Out In C#

Solutions to the finding the odd one out problem are of interest when one must find missing matches in some dataset, for example when performing data quality analysis for missing event pairs.

This article describes and benchmarks three approaches for a simple variation of this problem and then a hybrid approach for optimal performance.

read more

Finding Binary Gaps In C#

Finding Binary Gaps In C#

Variations of the binary gap problem are a classic at coding challenge sites nowadays.

This easy-to-solve, not-so-obvious-to-master problem can highlight how a programmer is aware of binary manipulation and how it affects performance.

This article describes two solutions for a variation of this problem and how their performance stacks against each other.

read more

Increasing Message Throughput In Akka.NET Actor Systems

Increasing Message Throughput In Akka.NET Actor Systems

When you are building a real-time Actor System in Akka.NET, message throughput numbers will be one of your top engineering priorities. One wouldn’t be using a performance scalpel such as Akka.NET if speed wasn’t a main business concern. This article details four approaches you can use right now to improve the message processing and delivery throughput of your actor system.

read more

Version Tolerant Binary Serialization With Microsoft Bond In C#

Version Tolerant Binary Serialization With Microsoft Bond In C#

You’ve been there too. A month ago you wrapped up your first release. You were happy and went for a beer with your workmates. The next month things didn’t go so well. As you start integration testing again, you realize something has gone wrong. You dig down, and discover your app had serialized some useful data to disk not so long ago. Yet, as the new version does its thing, it crashes with a vengeance, when it tries to get that data back from the same place. As you sigh, and realize there won’t be any beer that night, you notice that those serialized bits of data have changed schema between deployments. You think - I do want the app to re-use that data without breaking… So how on Earth do I get around this?

read more

Bucketizing All The Things In C#

Bucketizing All The Things In C#

The Partition Problem is a very old conundrum in computer science. The usual question goes: given some buckets of some capacity, and some items of some size, how can I distribute the items by the buckets in an optimal manner?

The answer to this is more complex than it seems at first glance, as it depends on what you mean by some buckets and by optimal.

  • Do you know in advance how many buckets you have? Or their size?
  • Do you have to fill more buckets with fewer items or less buckets with more items?
  • Do you allow bucket overflow or enforce capacity?
  • Do you want the perfect distribution regardless of performance or is fast-and-furious good enough for you?

There are lots of ways of answering these questions and even more ways of implementing solutions for them, from simple greedy algorithms to more complex heuristics based ones.

Today I’ll get you started the basics for a simple and generic distribution algorithm based on a descending greedy approach, with a couple of variations:

read more