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 … 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 … 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 … 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 … 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 … 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 … Read more

.Net tools to use: Nini

http://nini.sourceforge.net/ Nini   Description An uncommonly powerful .NET configuration library. Use this for reading web.config (instead of .Net built-in System.Configuration…) and any other .ini-file or .xml-file containing configuration. Difficulty 2 lines to read (usually called at page_load or similar). Sample usage: [sourcecode language=”csharp”] // Set up our config source as web.config or app.config internal static … Read more

Pure C# support

ScriptEngine supports both LSL and C# within the same script. Mainly this means that you can write LSL, but when you want you can use C# code. For example instead of using llToLower(mystring) you can use mystring.ToLower(), instead of llStringLength(mystring) you can use mystring.Length(). But to make sure that we support pure C# code, I’ve … Read more