Rants, rambles, news and notes from another geek

Geek Notes 2004-05-10

Today is the day my landscapers are supposed to finish the yard. We are so damn happy, you wouldn’t believe it. Our two year old daughter, Hadley, wants to spend all day out there and with just dirt and weeds, we weren’t really all that happy about it. Now it will be nice and green. (Assuming, of couse, that I can keep it alive on 15 minutes per zone, twice a week.)

Thinktecture Is...

now live.

Let the questioning begin. I have been expecting exactly what happened and consequently have been thinking about this post for a few days.

There is no way that I will be the only one to ask this question, but when a company forms with four German and Austrian Regional Directors*, some of whom are also MVPs**, do we now have a situation where one external consulting company holds too much power? Remember that RDs have access to more internal MS stuff than probably any other external group. Many RDs are also of various PACs (Partner Advisory Councils). And two of these guys are also MVPs.

If I owned a consulting company in Germany or Austria, I would be screaming foul. Sure, the RD and MVP recognitions are given to the person and not the company, but I don’t think MS ever envisioned this.

Now, that said I wish them nothing but the best. I wouldn’t be surprised if a few of them lost their RD status over this, but I wouldn’t wish that on them. They don’t compete in my market, so go out there and slay them.

Just don’t move to the Rocky Mountains and we’ll be cool… ok?

  • Ingo Rammer, Christian Nagel, Christian Weyer and Ralfs Westphal are all RDs according to the RD Search Site
    ** Christian Nagel and Christian Weyer are both MVPs according to the MVP Members Site

Fun With Reflection

I was just on IM helping Kris Syverstad and Bob Brumfield with a little reflection problem. Along the way I asked him why he hadn’t prototyped his problem in NUnit… I guess they didn’ t think of it.

Anyway, here is an NUnit test that demonstrates a couple of points that they were fighting:

  1. When referencing a nested type, you have to use the plus sign between the parent class and the nested type
  2. The Invoke code that Bob posted wasn’t related to the problem.
  3. The Enum.Parse code that Bob posted wasn’t related to the problem

Here’s the code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using System;
using System.Reflection;
using NUnit.Framework;

namespace NestedTypeReflectionTest
{
	public class Foo
	{
		public enum Bar
		{
			Zero, One, Two, Three
		}

		public Bar TheBar
		{
			get { return _theBar; }
			set { _theBar = value; }
		}

		private Bar _theBar = Bar.Zero;
	}


	[TestFixture]
	public class TheTest
	{
		private Assembly _assembly;

		[SetUp]
		public void Setup()
		{
			// For this example we will use GetExecutingAssembly() but you
			// could also use Assembly.LoadFrom().
			_assembly = Assembly.GetExecutingAssembly();
		}

		[Test(Description="This test shows that a period doesn't work for nested types.")]
		[ExpectedException( typeof(TypeLoadException) )]
		public void PeriodThrows()
		{
			System.Type t = _assembly.GetType( "NestedTypeReflectionTest.Foo.Bar",  true, false );
		}

		[Test(Description="This test shows that a plus-sign does work for nested types.")]
		public void PlusDoesnt()
		{
			System.Type t = _assembly.GetType( "NestedTypeReflectionTest.Foo+Bar",  true, false );
			Assert.IsTrue( t.IsEnum );
		}

		[Test(Description="This test shows using the type with Invoke.")]
		public void Invoke()
		{
			System.Type t = _assembly.GetType( "NestedTypeReflectionTest.Foo+Bar",  true, false );
			object aValue = Enum.Parse( t, "One" );

			Foo foo = new Foo();
			BindingFlags flags = BindingFlags.Public | BindingFlags.Instance |  BindingFlags.SetProperty;
			foo.GetType().InvokeMember( "TheBar", flags, null, foo, new object[] { aValue });

			Assert.AreEqual( Foo.Bar.One, foo.TheBar );
		}
	}
}

Geek Notes 2004-05-08

I mentioned a couple of days ago that our landscapers had started and I have to say I am completely amazed at how hard these guys are working. These guys have done in three days what would have taken me weeks, if not months to accomplish. As promised, I’ve been taking pics and will post the whole series on Monday or Tuesday when they are done.

  • To ReleaseComObject or Not - Sam Gentile posts some links about the various COM-to-.NET Interop challenges, specifically focusing on when and when not to call ReleaseComObject.
  • UML Stencils for Visio - Sometimes all you want to do is draw some UML, but the UML stencils that ship with Visio are a little “too smart”. Use these instead and you’ll be able to draw without all the other mess. [via Ingo Rammer]
  • Notepad2 - Ever wished Notepad had just a few more features, but didn’t really want a big ol’ slow programmer’s editor? You need Notepad2 by Florian Balmer. [via Scott Hanselman]
  • Diabetes: The Airplane Analogy - Scott told me this analogy at the MVP Summit and it is probably the clearest explaination of diabetes I have ever heard.
  • CLR Sessions at TechEd - Brad Abrams has posted the sessions that the CLR Team will be giving.
  • Analyzing Build Times - Kris Syverstad has a long build problem that is making his CI system behave badly.
  • P/Invoke Add-In for VS.NET - Now you don’t even have to visit the P/Invoke site to use the signatures defined there. Just right-click and choose “Insert P/Invoke Signatures…”

Secret AGENT Cartel?

Instead of German mafia (which isn’t fair because they aren’t all German), I think maybe we should call them

The Secret AGENT Cartel

Where AGENT is Austro-German-European .Net Technology

What do you think? ThinkTechture is just too hard to say. Secret AGENT Cartel is much better. :)

ThinkTecture

The German Tech Mafia, Ingo, Christian, Christian have been dropping hints for days about some big announcement involving four of them (who’s the fourth? could it be Clemens?).

Now it looks like they have a website up called ThinkTechture to hold whatever it is that they are working on. It has an RSS feed, so you can subscribe to one common place to see what they’re doing.

This better be worth it.

UPDATE: It looks like the fourth person may be Ralf Westphal.

Test Post Using Aylar Highlighter

I finished implementing Aylar Highlighter to get a nice code syntax highlighter for the blog. Pretty easy to do. I basically (but not exactly) followed the instructions here. (They are in spanish, but code is code.)

If it worked, this class should be pretty printed:

public class MyClass
{
&nbsp_place_holder; public MyClass()
&nbsp_place_holder; {
&nbsp_place_holder;&nbsp_place_holder;&nbsp_place_holder; // Do something
&nbsp_place_holder; }
}

UPDATE: It worked!

Geek Notes 2004-05-07

I’m almost done with my article about converting from dasBlog to .TEXT. So far the response from my readers has been almost universal joy regarding the change. I don’t think I dumped anyone’s RSS feed, I think most of the permalinks still work, and some people are reporting that it is a hell of a lot faster. It certainly feels that way to me. Excellent!

I just saw this post by Scott Hanselman where he mentions “the FreeTextBox CodeHightlightDefinitions.xml” and I’m wondering what that is and how I integrate it into FTB? I can’t seem to find any other information on it, and if it does source-code highlighting in FTB then I want it in my .TEXT blog.

UPDATE: The XML file Scott was talking about goes with Aylar Highlighter, the code coloring highlighter that apparently now comes integrated into dasBlog. It is now integrated into my .TEXT blog.

  • Funny Quotes from Keith Brown’s New Book - Julia apparently can read entire books online. I just can’t do it. But I’m glad she can, ‘cause she found some nice funny stuff in Keith’s new “A .NET Developer’s Guide to Windows Security”.
  • Mono Beta 1 - The beta is out. Some people like it, some people hate it. In general I hope for nothing but the best from this project. It just makes .NET that much stronger.
  • Testing Constraints w/ NUnit - John Lam has a nice little NUnit custom Assertion class that helps confirm that read-only and sealed constraints haven’t been modified. Cool.
  • Four New .NET Security Decks - Darrell Norton beat me to it again. I’ve used some earlier versons of these decks in presentations that I’ve done for the local MS office. Good stuff.
  • PAG Integration Patterns - “Integration Patterns introduces patterns in the context of the Global Bank integration scenario. This patterns catalog is organized to help you locate the right combination of patterns to apply when solving your integration problem. In addition, the guide introduces a visual model that describes a language of patterns and their relationships.”
  • #develop IDE Beta 1 - My favorite open-source IDE for .NET has reached the Beta 1 milestone (codename Fidalgo).

Content Rating Back On

Again, many thanks to Darrell Norton for telling me that my new content rating system didn’t work.

It turns out that the problem wasn’t with the content rating system but with my dasBlog2DotText content conversion tool. I didn’t escape the ‘<’ and ‘>’ characters when I moved them from dasBlog to .TEXT. I’m guessing that dasBlog did that on the way out while .TEXT does it on the way in… not sure.

Regardless, once I fixed the content in that article (and a few others) the whole thing started working again.

Thanks Darrell!