System.Random and random sequences

Actually, this is .NET 101. Probably everyone who has worked with the Random class already knows this. However, last week we encountered a Heisenbug in one of our feature, and this blog post is just a reminder of how the Random class works. The bug: Our system is generating sample data files. In this specific … Continued

Math.Round() – Did you know this?

Our project is delivering calculation heavy software used by engineers. We are performing complex numeric operations, and it’s utterly crucial that our software is calculating correctly. Recently, one in our team just encountered that Math.Round() is behaving differently than what we have expected. When rounding decimals to integers, we expected Math.Round() to behave like this: … Continued

dotLESS compiler crashes after recycle

We’ve had intermittent weird problems with some of our pages on my project, in the end we managed to isolate the problem to being IF the site was just reset AND the first request goes to a page which contains a request parameter with a GUID value we would see these errors: http://screencast.com/t/s3UC4WMdillZ on that … Continued

Have you tried turning it off and on again…

When adding a dll-reference in visual studio you are actually *not* specifying whether the reference should have “copy local” set to true or false. (you can check this for yourself,  look for the <Private>true/false</Private> tag in the .csproj – file) VS defaults to copyLocal = true, whereas MsBuild defaults to copyLocal = false. (d’OH!) to … Continued

XmlSerializer causes memory leaks!

Okay, so now that I got your attention let me modify that statement to “XmlSerializer may cause memory leaks in your application if you use one of the non-standard constructors” the two “standard” constructors are XmlSerializer(Type someType) and XmlSerializer(Type someType, string someNamespace) but these are not the only constructors available on XmlSerializer (full list here: https://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.xmlserializer(v=vs.110).aspx ) … Continued

(t: () => T): () => T => () => t();

(Advanced Knockout computed properties meets Typescript compiler 1.3) We are currently changing a large javascript codebase into TypeScript to take part in that strongly typed goodness. The codebase is for a rather large durandal (knockout / require.js) SPA and in moving the code over we found that while the TypeScript compiler is happy to confirm … Continued

Debugging MSBuild (!!)

I’m in the process of adding Typescript my current project.   We use a customized version of the awesome TypeLite library (yay, open source!) to generate .d.ts files from some of our classes in our web project (view models which are sent up to the view/client) and these are used within typescript code so the … Continued

DLL – purgatory in .net

I’ve switched projects over the xmas holiday and have had to learn a lot of new stuff (which is awesome.)   I have also had to unlearn a couple of truths that I would have sworn was true. (which is humbling) I used to think that “project references are transitive, but file references are not … Continued

This just in: Forse is a Gazelle

Norwegian newspaper DN annually publishes a list of the business-“gazelles” of Norway. The criterion is to have four consecutive years of growth and have a sales turnover doubled in the course of those four years. This year Forse made the list as the 42. best in Akershus county out of 318 gazelles in total for … Continued

ELK, Azure and Docker – an update

A few weeks ago, I wrote a blogpost about Setting up ElasticSearch, Logstash and Kibana in Azure with Docker. Now a few weeks have gone, and we have made a few changes to the setup. We experienced that the setup was somehow unstable. Every morning, I would find Kibana not displaying any log events if … Continued