Category Archives: Uncategorized

Why C# multidimensional arrays are slow

In a previous blog post I detailed how you can speed up array access in certain cases. This time I’m taking a look at what is happening when we access arrays in .Net, and digging into why multidimensional arrays are slow. First a quick refresher on array types. Array This is just a standard array. But in the… Read More »

Automatic unlock QNAP volumes from network

Automatically unlock encrypted volumes in QNAP via network using a BASH-script in a Cron-job. This script will log on, list locked drives and unlock them. Data stored on the disks are encrypted, and you need a key do access the disks. The key is kept in memory, so if power is lost the disks are no longer unlocked.… Read More »

Recompress zip-files (PowerShell)

PowerShell script to recursively recompress ZIP-files with higher compression. Note that Deflate64 isn’t strictly zip standard afaik, but it works for most zip applications.

Code sharing between VS and Unity 3D

In my previous blog post I covered how I usually set up new .Net projects. The post covered both naming convention, .Net Standard and .Net Core. In this post I will show a four ways you can share code between .Net projects and Unity 3D projects. There are several good reasons why you would like to do this.… Read More »

Automatic class generator for CsvHelper

CsvHelper helps in reading CSV files. But creating the model and mapper classes can be a bit time consuming. On this page you can generate the classes. Just fill inn the fields below with the header for your CSV file. It will generate the model and a mapper class. Code sample to use classes generated:

Name: Header:… Read More »

IIS redirect HTTP to HTTPS but allow Let’s Encrypt

Let’s Encrypt makes it easy for everyone to use HTTPS. The Windows client letsencrypt-win-simple simplifies installing and updating certificate in IIS. Using IIS URL Rewrite function you can allow Let’s Encrypt certificate retrieval/renewal and redirect all visitors to HTTPS URL of site.


Template replacement engine

Using Regex as a template engine is an efficient way to replace strings in a template. Regex replace method supports executing a method upon match. We can populate a dictionary and make a lookup on all matches. This way we do the replacement in a single pass, rather than executing multiple .Replace(). Since dictionaries can be made case insensitive we have… Read More »

Investigating Unity hang on second run (multi-threading)

Background he problem of Unity hangs on second run may have multiple causes and can sometimes be difficult to debug. When searching for an answer I see many with the same problem. I am therefore sharing a my debugging process in hope that it can help others solve their own problem. The problem Unity has had a problem… Read More »

ASP.Net 5 Areas

Visual Studio 2015 with ASP.Net 5 doesn’t support Areas in the GUI editor. Hopefully that will come, but until then here is a simple workaround. Create folder structure In the root of your project (not wwwroot) create the folder structure for Areas manually. In this example I created an area named “Foobar”. Edit Startup.cs to add routes for… Read More »

Image sizes of GIF, PNG, and JPEG after compression

When working with storage and network it is sometimes useful to know the estimated size of image. Should it be stored in SQL/NoSQL, locally, to CDN? Quite a few times have I tried to get a quick answer by Google, but its not that easy. So today I figured I’d write up a quick app, convert an image… Read More »