Skip to main content

Posts

F# 4.5–The ‘match!’ keyword

F# 4.5 introduces the match! keyword which allows you to inline a call to another computation expression and pattern match on its result. Let’s have an example. Here is the code I had to write before F# 4.5: Notice that I have to bind the result of callServiceAsync before I can pattern match on it. Now let’s see how we can simplify this using the ‘match!’ keyword: When calling a computation expression with match! , it will realize the result of the call like let! . This is often used when calling a computation expression where the result is an optional .

Service Fabric Troubleshooting guides

“With great power comes great responsibility.” Although this quote had nothing to do with Service Fabric, it could be applicable there as well. Service Fabric brings the power of PaaS close to you, unfortunately it does come with its own set of problems and difficulties. And once you get stuck there isn’t much information out there to help you find a solution (ask me how I know). One of the resources that helped me a lot were the Service Fabric Troubleshooting guides , these are the same guides used by the Azure Customer Support Services and Product Group Site Reliability Engineers. It’s a combination of guides, troubleshooting tips and scripts that can help you find the root cause of your Service Fabric related problems. A must have for every Service Fabric administrator(and developer).

ASP.NET Web API–Batch requests

Did you know that ASP.NET Web API allows you to batch requests? Batching packs several API requests together and send them in one HTTP request. The responses will be grouped in one single HTTP response as well. There isn’t much you need to do to configure this on the server, just add a specific route to your route table with batching enabled: The important things to notice are the following: The DefaultHttpBatchHandler executes each request sequentially, but in case you don’t have any dependency between requests, you can set a property to make execution non-sequential. The MapHttpBatchRoute route template can contain parameters. So, in case you create your own batch handler, you can pass in parameters to it. If you don’t need the sequential behavior you can create your own HttpBatchHandler and override the execution order property: That’s all that is required to enable batching on the server. Let’s now see how to use this on the client: This is a little known fea...

Error when building Reporting Services project

After opening an ‘old’ Reporting Services project, we got the following exception message when we tried to build the report: Custom parameter layout was detected in the report. SQL Server 2014 Reporting Services and earlier do not support custom parameter layout. Either reduce the error level to a value less than 3 or change the TargetServerVersion to a version that supports custom parameter layout. To fix this error, you have to go to the Report properties: Right click on your Reporting Services Project , and choose Properties . Change the TargetServerVersion to SQL Server 2016 or later

Postman–Generate code from your requests

One nice feature I discovered recently in Postman is the ability to generate code from your API requests. Here are the steps: Open Postman Select a collection and click on a specific request Click on Code on the right. The generate code snippets window is loaded. Choose the language you want to use and click Copy to clipboard If you are using C#, the code snippets are generated using the RestSharp library

Postman–Import OpenAPI specification for your API

Postman makes it easy to create a collection of requests based on your OpenAPI specification. So if you are using Swagger (through Swashbuckle in .NET) importing your API specification is just a few steps: Open Postman Click on the ' Import ' button in the top left corner. The import window is loaded. Select the import from link option and paste the url of your swagger documentation file. Click on Import. A new collection is generated and available:

The Implicit bias

Everyone’s opinion is influenced by education, media, earlier experiences, … Do you want to know how biased you are? Try some of the tests on Project Implicit : The Implicit Association Test (IAT)may be especially interesting because it can reveal that you have an implicit attitude that you did not know about. More information on https://www.projectimplicit.net/index.html .