How to import Python extension modules in Azure Functions

An awesome feature of Azure Functions is its ability to run a wide range of languages, C#, F#, Node.js, Python, PHP, batch, bash, Java, or any executable. So when I wanted to do a bit of work with the Google Eddystone beacon format it was a natural fit as I just needed to quickly run a few Python methods - given the example code Google provides is in Python. [Read More]

Optional arguments in C# interfaces

Optional arguments are a nice feature in C# that have been around for a while now, they were introduced back in 2010 with C# 4. They are often mentioned in the same breath as named arguments but are two completely different concepts. The great thing with development is that there’s always something new to learn, this week it for me it was the behaviour of optional arguments on interfaces that don’t match the optional argument on the implementing class even though the feature has been around for what? [Read More]
csharp 

Running Go on Azure App Services

At first I thought I was going to have to go something tricky - Wade Wegner has a great write up of one method here, but it turns Azure App Services have now added native Go support so we don’t need to set up Go on the server any more. The versions currently supported on the Azure App Service platform are 64bit Go 1.4.2 and Go 1.5.1 and it turns out to be super simple to get going. [Read More]
go  guide  azure 

Getting started with Go on Windows

I’m giving this Go-lang thing a whirl, turns out it’s dead easy to set up on Windows. First download and install Git if you don’t have it already - when using Go you’ll user a lot of open source! Next download and install the latest 64-bit Go MSI distributable from https://golang.org/dl. Run that hit next, next, next and let it set up all the defaults. Once that’s done open up the CMD and type go version if everything is running you should get something like go version go1. [Read More]
go  guide 

Creating custom Knockout bindings in TypeScript

In Javascript you create a custom knockout.js binding like this //Initialise the binding to the value in the input ko.bindingHandlers.initValue = { init: function (element, valueAccessor) { valueAccessor()($(element).val()); } }; But in TypeScript you’ll get the error Property 'initValue' does not exist on type 'KnockoutBindingHandlers'. Just create a {something}.d.ts definition file for your custom bindings, something like knockout.bindings.d.ts and provide a definition for your binding. interface KnockoutBindingHandlers { initValue: KnockoutBindingHandler; } Now it will transpile correctly. [Read More]

Func<T> vs. Expression<Func<T>> in LINQ

Linq is fantastic in that it provides a consistent syntax to query all sorts of data from in-memory collections, SQL databases, XML files, even external APIs. One of it’s strengths is that you can write a Linq provider for any data source the you want to support. Most people know about the “not obvious until it’s obvious” difference between IEnumerable<T> and IQueryable<T> - one represents an in-memory collection and one represents a query which will be executed at some point against a data source. [Read More]
csharp  linq 

GUIDs Part 3: GUID one

The ultimate test to be sure you understand a concept is to try and teach it to someone. The way to understand a concept enough to teach it to someone is to implement it. I didn’t exactly just sit down one afternoon and decide to write a [few blog posts] about GUIDs because I know everything about them. It actually all started with a few weeks earlier wanting to understand the mechanics behind the identifier. [Read More]
guid  guide 

Sorting IQueryables using strings and reflection

Wouldn’t it be great to be able to specify the property to order on at runtime for a LINQ query? I.e. items = items.OrderBy("SomeProperty"); rather than items = items.OrderBy(s => s.SomeProperty); How to dynamically sort an IQueryable Later on in this post we’ll go into depth on how to implement an extension method from first principles to do just that but if you just want to quickly use a string to sort an IQueryable right away- go ahead and install Dynamic LINQ. [Read More]
linq  guide  csharp 

Reactive Extensions .NET: Implementing the circuit breaker pattern

This article assumes you’re familiar with both reactive extensions and the circuit breaker pattern, although we’re focusing on .NET reactive extensions have been implemented in lots of different languages so the same principles apply. Microservices are great but they can be a little temperamental at times because there can be a lot of moving parts to service one request. This isn’t all bad as the server can often tackle each moving part in parallel speeding up the response the client gets. [Read More]
csharp  rx 

GUIDs part 2: GUID as gold

How are GUIDs unique with out a central watch dog? They do it through the algorithm that generates them. The specification lists 5 different ways you can end up with a unique identifier, if and only if you follow the instructions. The specification can’t prevent someone from choosing the same GUID as you on purpose (a watchdog might be able to) but it does prevent them accidentally generating the same GUID as you if they’re following it. [Read More]
guid  guide