Category Archives: C#

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 »

WPF MVVM Thread annoyance

In WinForms one of the annoyances is that any GUI operation requires invoking GUI thread to do it. I wrote a blog article on a quick hack to bypass it. I was really hoping this limitation was gone in WPF, but alas… Lately I’ve been refactoring my IRC client to use a MVVM-like architecture. In MVVM ViewModel should… Read More »

MVVM (and my IRC client)

This post is a bit of a personal rant on whether or not to use MVVM. I’m comparing MVVM with my current architecture and try to look at a few pros and cons. Clearly MVVM is not optimal, but there might be parts to borrow. At the moment I’m doing some heavy refactoring of the IRC client I’m… Read More »

C# / .Net WinForms GUI Thread Invoke solution

In .Net WinForms (and WPF for that matter) only the main GUI thread is allowed to make any change to GUI. If you attempt to do so from another thread then Visual Studio MDA will let you know that you made a mistake. This is actually an improvement from VS2003 where nobody said anything, so your application would… Read More »

Embedding YouTube in WPF WebBrowser control

Embedding YouTube into your C# WPF application can be done by wrapping embedded YouTube in a WebBrowser object (Internet Explorer). There are a couple of things you need to do to make it work. Tested on Windows 7 Ultimate 64-bit in .Net 3.5 (VS 2010). Sample code can be found at the bottom. Add Mark of the Web… Read More »