"We must seek our salvation in this world, because there is no other." Matt Young

News

Make a Sign, Win a Big Prize

07.03.2008 03:36:47 PM

Chris is running a contest to get a 1 year MSDN Premium Subscription for free. That's a $10,000 gift, my folks.

BTW, the reason he has this is because he's a MVP. Since I'm a MVP, yep, you guessed it, I have some of these too. I'm going to give away one of them at the first TCLangUG event next Thursday. The other two? I still don't know what I'm going to do with them...

PermaLink (0 comment(s))
Printer-Friendly Version

Parallel Extension and PI

07.03.2008 03:02:40 PM

Beautiful. My master's thesis was based on large-precision arithmetic and my proof-of-concept was calculating PI, so I've always had a soft spot for stuff like this. And it's using the Parallel Extensions framework along with a beautiful algorithm to calculate any digit of PI without calculating the others (this makes PI calculation in parallel very easy). I've known about that algorithm for a long time but it was cool to see an article actually explain how it works and how you code it up.

PermaLink (0 comment(s))
Printer-Friendly Version

Extension Method Site

07.03.2008 01:28:33 PM (Last Update: 07.03.2008 02:32:39 PM)

Interesting - there's a whole site dedicated to extension methods. And yes, they have an RSS feed.

PermaLink (1 comment(s))
Printer-Friendly Version

MSTest and MTAs

07.02.2008 01:36:27 PM (Last Update: 07.03.2008 09:15:44 AM)

This is a great post on getting MSTest to run the tests in an MTA. Frankly, I think this should've been the default, but that's just me.

PermaLink (2 comment(s))
Printer-Friendly Version

A Wonderful Statement About Children

07.02.2008 01:22:02 PM

As I was reading this point, this phrase completely jumped out at me (emphasis mine):

What I did to deserve the family I have escapes me. I don't know. Blessed by whomever does the blessing, I guess. I'm not sure how I got them, but I'm doing my best to be worthy of them now.

How true.

PermaLink (0 comment(s))
Printer-Friendly Version

Tell Me Why This Is Necessary

07.02.2008 09:27:47 AM (Last Update: 07.03.2008 06:25:51 AM)

I saw this line of code at the end of the code in a test method:

Assert.IsTrue(true);

It was really hard to hold down the vomit.

That's atrocious. Just what the hell is this there for? It's worthless - completely and utterly worthless.

Ugh.

PermaLink (4 comment(s))
Printer-Friendly Version

Great Discussion on Paint.NET 4.0

07.01.2008 11:41:02 PM

Read this. I like his comments on "starting from scratch":

Bear in mind that "from scratch" means that I started with a brand new, empty solution file in Visual Studio. It does not mean I’m throwing out all the current Paint.NET code. There are many places where I will be able to reuse vast amounts of it — rendering kernels, effects, math, algorithms, etc. The entire structure of the program will be different, however. If you demolish your old house to build a new one, you don’t throw out the grand piano in the living room too. It still has plenty of value.

I'm all for refactoring, but (depending on many factors) there may be times where a full rewrite is called for. But it's never really a "full rewrite". You're always going to reuse lots of what you did before; you're probably just going to reorganize it using better techniques and ideas that you've learned since the code base was started.

Paint.NET is a little gem in the .NET world - it's a great, free tool all in .NET with a good add-in story. I'm looking forward to downloading Paint.NET 4.0 (and this time I'll use the PayPal feature - it's been long overdue :) ).

PermaLink (0 comment(s))
Printer-Friendly Version

Adding Tasks for Dynamic Proxies 3.0

07.01.2008 11:14:29 PM

After having an IM conversation about dynamic proxies with Aaron (which started with this post), I decided to add some features to my library that were I've been mulling over in my head now for quite some time. You can see the upcoming feature list here (no, I don't have them tied to a release yet, I'll figure that out soon). Frankly, they shouldn't be a surprise - if anything, you should be surprised that my library doesn't have these features yet. But hey, I gotta keep myself busy.

One of the more "controversial" features I'm thinking of adding (and this will be the easiest to go on the chopping block if it's too much work) is to add a hooking mechanism based on lambda expressions. Right now, the proxy generation requires that the caller provide at least one object that implements IInvocationHandler to receive the before/after calls. Unfortunately, this is an "all" mechanism - that is, I hook everything I can. One possibility is to give the user a mechanism to limit this. That is, for the following class [1]:

public class Hooked
{
   public virtual void MethodOne() {}
   public virtual void MethodTwo() {}
   public virtual void MethodThree() {}
}

I could create a proxy like this:

Hooked hooked = Proxy.Create(new Hooked(), 
    new HookMappingCollection(
        new HookMapping(typeof(Hooked).GetMethod("MethodOne"), true, true),
        new HookMapping(typeof(Hooked).GetMethod("MethodTwo"), true, false)));

Now I'd only get the before/after calls for MethodOne(), and only a before call for MethodTwo(). MethodThree() would not be hooked.

The other idea was to let the caller provides delegates/lambdas to methods that matches the arguments of the target method to be hooked, plus some "extra" information that the before/after needs. Frankly, I'm too tired to think of how this might work, but this would provide a lean-and-mean way of hooking. IInvocationHandler feels very "late-bound" and having something more type-safe would be nicer.

Anyway, that is all for now. I have no idea when I'll get all of these features in, but I like revisiting this library now and then.

[1] Note that all of the code in this post is pseudo-code and probably has compilation errors :). I'm just trying to get ideas across.

PermaLink (0 comment(s))
Printer-Friendly Version

Page Last Modified: 01.08.2008 09:00:19 PM