Category Archives: C#

Async/await HTTP server in C#

Since there has been a bit of interest for the code below I mocked together another version: Kernel.HttpServer.zip Background Ok, so there are already alternatives for web servers in C#. Some of them are very feature rich. http://cassinidev.codeplex.com/ http://webserver.codeplex.com/ http://www.codeproject.com/Articles/137979/Simple-HTTP-Server-in-C http://www.codeproject.com/Articles/1505/Create-your-own-Web-Server-using-C http://kayakhttp.com/ http://mikehadlow.blogspot.no/2006/07/playing-with-httpsys.html http://ultidev.com/products/cassini/ http://lmgtfy.com/?q=c%23+webserver But I wanted to play around with TPL and async/await a bit so I… Read More »

Locating config file from .dll in both Desktop and Web applications

I’m using Nini for most my config needs. Nini is a .Net library for reading/writing/merging all kinds of config files. It provides a good API with type conversion, default values, etc. To be able to access both app.config and web.config using Nini in .dll files included in test projects, desktop applications, services, web applications, webservices, etc I’ve put… Read More »

Unsafe kernel32-mapped memory Bitmap WPF

Okay, its vacation time so I thought I’d take time from vacation (and from reading news about the terror attacks in Oslo that happened a few miles from here) to do a little post. This time is an unsafe kernel32 memory mapped bitmap image I’m constantly improving upon. I do a lot of DSP-related stuff and the best… Read More »

ArrayBuilderQueue

… is that the right name? It basically works like a combination of the StringBuilder and Queue objects. You enqueue arrays of T, and you dequeue custom sized chunks of the array. What makes it nice is that I’ve optimized memory usage so it never creates any temp arrays internally except the one returned to you when you… Read More »

Early alpha release: Kinect C# Starter Kit

NOTE: Microsoft has released Kinect SDK since this article was written. You probably want that instead of this. :) Much of the stuff I’m doing with Kinect involves two input pictures and one output I figured I’d make a platform to make it easy to test new stuff. The main idea is that I can add multiple modules… Read More »

Kinect

Yesterday I bought a Kinect and hooked it up to my PC. After a couple of hours of compiling drivers and finally realizing I had to switch USB ports for the camera to work I could start writing code. I used the CLNUIDeviceTest as a base since it already had the lines of code required to pull the… Read More »

Compression algorithm

Found an article from May 2007 that haven’t been posted. About time I guess. :) Every now and then I get a bright idea about a new compression algorithm I have to test. Here are results from my latest idea: Debug checksum: 418 Original data: Tedd! Original data length: 5 Compressed data length: 7 Result (non-binary): 418,5,295700136 Time… Read More »

C# Image Analysis (“auto-gaming”) – with source

For the past couple of weeks I have been playing Age of Conan with Sara. I am Weathor, Aquilonian Priest of Mitra. MWAHAHA. :) As always I’m looking for something to tinker with. Just playing the game is not that fun. I’ve been searching for addons for AoC, but I can’t find anything useful. Basically they don’t support… Read More »