in

QuestMaster.NET

A Quest for the Perfect Program, and a Quest for Life

Life, Universe And Everything According To Dirk

We apologize for the inconvenience

März 2006 - Posts

  • ASP.NET 2.0 XHTML Validator Module

    I found a little gem thanks to Scott Hanselman: an ASP.NET 2.0 XHTML Validator Module. Just add a reference to your ASP.NET project, add a couple of lines to the web.config, and you have a free XHTML check in your application. It took me approximately 1 minute to add it to my QuestMaster Live application.  Very cool stuff.  Feature Request: configure the validator to check for XHTML Strict.

    Update: configuring the validator to check for XHTML Strict is possible by using Strict rather than Transitional in the Doctype declaration. Works wonders. Just a shame that ASP.NET 2.0 generates non-Strict markup: the hidden field containing the viewstate has a name attribute.

  • I am a Ravenclaw!

  • Site upgrade complete

    QuestMaster.NET is now running on ASP.NET 2.0!

  • Site maintenance

    I will upgrade the software of the website to run on .NET 2.0 in the near future. Occasional outages may occur.

  • Winter is over, Summer has started

    The astronomical winter ended one week ago, but the meteorological winter lasted until about Friday. Snow started falling during the astronomical autumn (i.e. before December 21st) in Vienna, and the last bits of snow and ice disappeared at the end of last week.  That officially makes it the longest winter in my life.

    After a weekend that in all but date was a typical April weekend, today is more like a summer day (i.e. hot).  According to the local wetter prognosis, we're back to April weather for the rest of the week.

  • Code Generation, ILMerge and Custom Build Tasks

    I finished creating a code generator for Dice, and I turned the thing into a custom build task for MSBuild so I can now include Xml files in my projects and generate code from them. I had to collect and improve the informations from a variety of sources, but that made the satisfaction and sense of achievement only greater.

    First, I created the code generator, using the CodeDOM model in .NET.  It requires a sort of top-down approach which is untypical for .NET programming: Visual Studio and Intellisense advocate a bottom-up approach, much to Charles Petzold's chagrin.  The inputs for the code generator come from data in an xml file, based on an xml schema. The intellisense in xml files with a known schema in Visual Studio 2005 rocks!

    Since the xml schema and associated code classes were in a different assembly than the code generator itself, I used ILMerge to pack those assemblies together. Maybe this wasn't strictly necessary, but I figured it would be easier to use build tasks that consist of one assembly only. I integrated the ILMerge step in the build process using Jomo Fisher's instructions. Worked like a breeze.

    Now came the more tricky part: adapting the project files to incorporate the new build task. I used the instructions in Dino Esposito's Cutting Edge article, but here I had to adapt and tweak. I ended up with several steps:

    Register the task in the appropriate project file:

    <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
        <UsingTask TaskName="QmlTask"   
            AssemblyFile="C:\Documents and Settings\dr\My Documents\<linebreak>
    Visual Studio 2005\Projects\QuestMaster\Tasks\DirkRombauts.QuestMaster.Sdk.dll" /> ... </Project>

    Add Target

    <Project>
    ...
       <Target Name="Qml2Code">
            <QmlTask Language="CS"
                FileName="%(Content.FullPath)" 
                OutputFileName="%(Content.FullPath).cs">
                <Output TaskParameter="OutputFileName" ItemName="Qml2Code"/>
            </QmlTask>
        </Target>
    ...
    </Project>

    Include Qml files as content

    <Content Include="yourfile.qml"/>

    Update CoreBuildDependsOn

    <PropertyGroup>
        <CoreBuildDependsOn>
            $(CoreBuildDependsOn);
            Qml2Code
        </CoreBuildDependsOn>
    </PropertyGroup>

    Last step

    Build the project, then add the newly generated yourfile.qml.cs to the project, then build the project again. I couldn't figure out how to automatically include the generated file, so I settled for this manual step. Not perfect but I'm willing to live with it for now.

    The next logical step in the QuestMaster SDK would be to create a custom project template to save me the hassle of adapting the project file by hand.

  • Windows Vista Delayed in part to 2007

    CNN tells us that Microsoft has chosen to delay the consumer version of Windows Vista to 2007.  The warning signs were there, because the Beta 2 has been delayed several times. Well, we've waited for so long, a couple more months won't make much of a difference. As long as they get it right when they ship.
  • Ich habe fertig!

    Ich habe fertig! Chef schlecht, wie flasche lehr! (*)

    My working relation with my boss reach an all-time low yesterday. Yesterday he sent me an email with information and a couple of tasks. I sent an email back asking for clarification on some points. He basically answered "it's all in the first email". At that point I exploded. This single-sentence management with the undertone "why don't you understand it after the first email" is symptomatic for my relation with my boss.

    I worked for the "small" boss for most of last year and I felt good and performed well. I've been working for the "big" boss for the past couple of weeks and my nerves are shot, my mood is on thunderstorm and I'm sleeping badly.

    I went to my boss and told him in no uncertain words what I think of this way of dealing with me.  I also informed him that if the situation does not change soon, I will find me another job. That was no threat, I was informing him of consequences. It was no threat, because I don't really care either way. If we find a solution and I continue to work (happily!) at Gritsoft, fine. If we do not, and I go to work for another company, that's fine too.

    (*) The (in)famous words of an Italian soccer coach after an abysmal match of his team from the German league. Except that he was talking about his players, not his boss.  Any attempt at translation would ruin the colorful linguistic incorrectness of his words.

  • GP of Malaysia

    This GP was (imo) nothing short of boring. Yes, there were some overtaking manouvres but they were all way to smooth - no wheel-to-wheel knife-between-the-teeth duels. All the excitement was in the first lap, where Kimi Räikönnen flew in the gravel trap after two corners. Is it just me, or is the McLaren's rear suspension too weak? Kimi's rear supsension broke during qualifying in Bahrain, and now it broke again after a light touch by Christian Klien.

    Winner of the day: Felipe Massa, who started from 21st position and finished just in front of Michael Schumacher. The whole world must have been watching if Felipe would (be ordered to) let him pass, but no such thing happened.

    Loser of the day: the Williams team who could not continue their great start to the season. Rosberg's engine blew, and Webber's hydraulics failed. A real shame, because starting from the second row they had good chances for a podium finish.

  • Code Generation

    Today I made my first explorations into the world of building a code generator. I took this decision after thinking long and hard about the concept of strongly typed dice in QuestMaster. A basic Die isn't too difficult to create, and configuring it is a matter of setting properties and adding sides.  But I wanted to have strongly typed dice, so I could say "CombatDie" instead of "Die that happens to contain three skull sides, two white shield sides and one black shield side".

    At first, I created strongly typed classes in code, by hand. After the CombatDie, HeavyWeaponsDie and LightWeaponsDie (including unit tests) this process was becoming just a wee bit tedious.  Wouldn't it be cool to have a simple Xml file with the descriptions and a magical process of creating code from it? CodeSmith would be an obvious candidate to provide the magical process, but: I want QuestMaster to be a platform, enabling other developers to create game extensions and dice for their own. Shipping CodeSmith with my code is sort of out of the question.

    So I had to create the magical process myself. Inspired by Dino Esposito's recent Cutting Edge column about custom build providers, and armed with a (small) reference on the CodeDOM model, I went to the task. After just one hour of setting up a project, unit test project and doing a bit of programming work, I was able to generate a file, a namespace statement, a using statement and the class declaration.  I guess it'll take a couple more hours to generate the constructor and the side properties. Then I'll need to figure out how to add xml comments to the code, and last but not least define the xml input format and parse it. Exciting!

  • Team Foundation Server ships today!

    Rob Caron tells us the joyful news: Team Foundation Server ships today, and will be available for download next week.  I'll really need to kick my boss's ass about this - he's been postponing a migration to TFS since august.
  • That Apollo 13 Feeling ...

    My computer at work suddenly switched off today at 10:51, and so did most other computers and all the lights in the room.  A fuse had blown - not one as it would seem but fuses all over the house. What followed was a frantic 45 minutes of switching on fuses, having them blow again, powering on appliances one by one to find the anomaly etc. I finally got enough of it and wired my setup to another socket which seems unaffected by the mayhem. As irony would have it, the power outtages stopped after that.  Hmm ... was my computer installation the cause?
  • Unit Tests and satellite assemblies in Visual Studio 2005 Team System

    I stumbled over an interesting phenomenon during the port of my C# NUnit unit tests to VB.NET VSTS unit tests: tests for localization of strings that ran fine with NUnit failed in VSTS.  To add insult to injury, retrieving the localized string in a Windows Forms application worked perfectly fine.  I started a thread on the VSTS Developers edition forum, and since found a thread on the VSTS Testers edition forum that describes the same issue.

    To cut a long story short: VSTS copies the dll files needed for unit tests to a separate directory. What it does not do is copying the satellite assemblies along. When retrieving a localized string, the resource manager can't load the satellite assembly and thus falls back on the default resource.  There's a bug report it, which tells us the behaviour was fixed in February 2006 and will appear in the next CTP (whenever that may be).

    In the meantime, here's the workaround (suggested in the Tester edition thread): add the "bin\Debug" directory as a deployment directory to your testconfiguration. That will make VSTS copy the contents of bin\Debug to the test run directory, including the directories containing the satellite assemblies.

  • GP of Bahrain

    One of my main religions started their celebrations again: this weekend featured the inaugural Grand Prix of the 2006 season.

    The (once again) new qualifying system: I like the first two parts because of the suspense of who is going to lose out. The final part was sort of boring.  The main problem I had was that it was not clear who was holding what position. The one-lap qualifying format had the distinct benefit that it was immediately clear what a driver's time is worth. It would be more informative to have the current positions shown all the time, and some sort of animation when positions change.  I'll see if I can post a message to the FIA with this request.

    The race: there were many overtaking maneuvers, yes, but it was a luke-warm event even so.  Although I'm happy to see Ferrari back on the front, they still have work to do: it was disappointing that Michael Schumacher managed only once to try to overtake Alonse in the 15 laps he was driving behind the Renault.

    Update:

    Winner of the Day: Niko Rosberg. A very impressive debut, with a fastest lap and a great race to seventh position after falling back to almost last position early in the race. Williams have a great engine with the Cosworth V8, maybe the should reconsider their plans about taking on Toyota next year.

    Loser of the Day: Juan-Pablo Montaya. He started from fifth position, and finished in fifth position. His team mate from Finland started from last place and finished third. This is bound to raise several questions.

  • A small step for mankind, but a giant leap for me

    In the beginning of the year, I read Framework Design Guidelines. A must-read for any developer working on a non-trivial or team project IMO. Not "just" for framework designers.

    The books Mantra "focus on usability, not only on maintainability" has already had some effects on my. I had factored and re-factored an interface for the DiceRoller part of my QuestMaster programs, ending up with a very elegant one-method interface that should be used as a constraint on generic collections.  The optimal implementation of this interface was using a static method, so I found myself writing comments in the style of "you should implement this interface's method explicitely and make it call a static method."  The writing of this comment raised a red flag in me.  I started over, with an explicit focus on usability - after all, I want QuestMaster to become a framework to develop not only Hero Quest games, but Space Crusade and Space Hulk games too.  My current design is much better I think. It takes about 10 times as much code but it's much more developer friendly.

    Another thing I got from the book is: a good programmer should be fluent in at least two programming languages.  Good, I know C++, C#, Java.  The book also says that knowing more than one C-style language doesn't count. Stang.  Combine this with the guidelines for API design: the top 5 usage scenarios should be illustrated with code snippets in at least two languages.

    So what better way to become fluent in a second language and test the usability of my code in a different language than to write my unit tests in Visual Basic.NET?

More Posts Next page »
Copyright Dirk Rombauts
Powered by Community Server (Non-Commercial Edition), by Telligent Systems