Investigating Unity hang on second run (multi-threading)

Background The 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… Read More »

Performance of different array types in C#

Quick test of performance of different ways to access arrays in .Net. The test creates 3 levels of arrays of 100 Int32. 100^3 Int32 = 4.000.000 bytes. It then updates every one of them 10.000 times, a total of integer writes. Test rig spec I7 3770K @ 4.2GHz, 8MB L3 cache 32GB dual channel DDR3 at 933MHz (XPM-1866) Intel z77… Read More »

C# regex for matching e-mail adresses

Regex for matching e-mail in C#. Came across which has a horrible example, so ended up making my own loosely based on that. It leaves much to be desired, but will cover most use cases well enough.

ASP.Net 5 Identity Framework 3.0 manually adding users

Identity Framework 3 is in release candidate along with ASP.Net 5. The problem I set up a web project in ASP.Net 5 and created a controller for user import. It’s just some simple code that attempts to add multiple users. Adding a single user works great, but if I attempt to perform multiple operations in… 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… Read More »

Better text console for C#

I recently discovered how slow Console.MoveBufferArea actually is. I used it for writing NLog output to a console and discovered that at times of high output it became dead slow. I could at times see it flicker and update line for line while the whole machine temporarily came to a crawl. As I searched the… Read More »

Optimizing RDP for casual use

Optimizing RDP client/server for casual use. Make it use less bandwidth. Get higher throughput and adaptive transfers. Revisit Back in 2011 I wrote a blog post on optimizing RDP in Windows 7. I’ve been thinking of updating that post for some time, and now finally got around to it. Background Since sometime around 2000 I… Read More »

HTML5: Drop-in prerender and prefetch script

Reading about prefetch and prerender, and especially Chromes prerender, got me thinking that this could to some extent be automated. My blog has become increasingly slow and I though that this would work as a simple quick-fix. This script relies on jQuery. Prefetch At startup (document ready) it will find any a-links tagged as “prefetch”… Read More »

Legacy app: Net-Chat 2.0a (Quick Basic 4.5, DOS)

Recently got some old tapes recovered. There I found an old chat program I wrote in QB45 in 1996 (I was 16 years old). I installed Windows XP under Hyper-V to test it out since Windows 8 doesn’t run 16-bit DOS programs. But I wanted to have the executable work on my computer so I… Read More »