<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>VibrantCode</title>
  <link rel="alternate" type="text/html" href="http://blog.andrewnurse.net/" />
  <link rel="self" href="http://blog.andrewnurse.net/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2009-05-28T00:01:45.3133216-07:00</updated>
  <author>
    <name>Andrew Nurse</name>
  </author>
  <subtitle>Oooh...pretty code</subtitle>
  <id>http://blog.andrewnurse.net/</id>
  <generator uri="http://www.dasblog.net" version="2.0.7180.0">DasBlog</generator>
  <entry>
    <title>A quick update on MaVeriCk</title>
    <link rel="alternate" type="text/html" href="http://blog.andrewnurse.net/2009/05/28/AQuickUpdateOnMaVeriCk.aspx" />
    <id>http://blog.andrewnurse.net/PermaLink,guid,61765d17-dcae-4b34-9ade-197236415c89.aspx</id>
    <published>2009-05-28T00:01:45.3133216-07:00</published>
    <updated>2009-05-28T00:01:45.3133216-07:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">I've been busy with some, paid (and therefore
higher priority ;) ), work for the past week or so, which has meant I haven't had
time to write up my Module Development in Maverick blog post.  I'll try to get
that out next week.  In the mean time, you can pretty much just take the source
(available here: http://github.com/anurse/Maverick) and start playing.  Creating
a new module is as simple as copying one of the existing folders in the "Source/Web/Maverick.Web/Modules"
folder, renaming it, and editing the "Module Application" class inside.  There's
no registration necessary (thanks to <a href="http://mef.codeplex.com">MEF</a>).<br /><br />
Have fun, feel free to post questions, and I'll talk to you next week!<br /><p></p><img width="0" height="0" src="http://blog.andrewnurse.net/aggbug.ashx?id=61765d17-dcae-4b34-9ade-197236415c89" /></div>
    </content>
  </entry>
  <entry>
    <title>MaVeriCk &amp;ndash; An Open-Source CMS written in ASP.Net MVC</title>
    <link rel="alternate" type="text/html" href="http://blog.andrewnurse.net/2009/05/19/MaVeriCkNdashAnOpenSourceCMSWrittenInASPNetMVC.aspx" />
    <id>http://blog.andrewnurse.net/PermaLink,guid,2ce5897b-450f-45e6-b5b7-b3c11bd2b029.aspx</id>
    <published>2009-05-19T15:07:13.1410366-07:00</published>
    <updated>2009-05-19T15:07:50.4066616-07:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
This is a big post, I know, but I think it’ll be worth it.  If you don’t have
time to read it all, I organized it by importance, so the important stuff is at the
top anyway :).
</p>
        <p>
I’ve been hinting for a while that I’ve been working on a secret side project using
ASP.Net MVC that was sort-of related to DotNetNuke.  Well, it’s finally time
for me to put some code out there :).  Today, I published a source code package
containing version 0.1 of MaVeriCk, a Content Management System written in ASP.Net
MVC.  I’ll explain what it is and how to get started in this blog post.
</p>
        <p>
          <strong>
            <u>Warning</u>
          </strong>: MaVeriCk is <strong>nowhere near finished</strong>,
and very much an <strong><u><em>alpha</em></u></strong> (maybe even a pre-alpha ;). 
Major features are completely missing (such as user management, and any useful modules,
see below for details)
</p>
        <p>
          <strong>
            <u>Disclaimer</u>
          </strong>: This project has <strong>NO RELATION</strong> to
the DotNetNuke project.  While I am a DNN Core Team member, this is purely a
personal side-project.  DotNetNuke has inspired some of the things I’ve done
in MaVeriCk, but that’s the extent of the connection between the two.
</p>
        <h2>What is MaVeriCk?
</h2>
        <p>
Maverick is an open-source Content Management System in the style of *Nuke applications
such as <a href="http://www.dotnetnuke.com">DotNetNuke</a>.  For the rest of
this post, I’m going to assume you’re fairly familiar with that style of application. 
Basically, users create pages and drop little widgets (or “Modules”) onto those pages
to provide features like a Blog, Message Board, or even just a block of HTML.
</p>
        <h2>Where (and how) do I get it?
</h2>
        <p>
The project is hosted on GitHub (<a title="http://github.com/anurse/MaVeriCk/" href="http://github.com/anurse/MaVeriCk/">http://github.com/anurse/MaVeriCk/</a>)
so you can feel free to clone the repository and hack away there.  Alternatively,
if you either don’t have Git or don’t want to bother with getting the whole repository,
you can download version 0.1.0, from the downloads section: <a title="http://github.com/anurse/MaVeriCk/downloads" href="http://github.com/anurse/MaVeriCk/downloads">http://github.com/anurse/MaVeriCk/downloads</a>. 
Also on the downloads page are the release notes for this version which include a
full installation guide.  Unfortunately, there is no automated installation system,
but the steps are quite straightforward if you’re familiar with ASP.Net.
</p>
        <p>
Feel free to post comments on this blog, or send me email at: andrew AT andrewnurse
DOT net 
</p>
        <p>
(After all, I’m just a junior programmer just out of college and don’t purport to
be an expert in the various development patterns and architectures, so if you think
something doesn’t look right, please let me know!)
</p>
        <h2>
        </h2>
        <h2>How does it work?
</h2>
        <p>
The rest of this post will be a, very short, introduction to the Module Framework
provided by Maverick.  I’ll be posting much more detailed information about the
guts of Maverick later on, this is just a taste.  Feel free to send me email
(see above) if you have questions about the rest of the architecture, and don’t be
afraid to dive into the code!
</p>
        <p>
Let’s start by taking a look at a MaVeriCk page:
</p>
        <p>
          <a href="http://blog.andrewnurse.net/content/binary/WindowsLiveWriter/MaVeriCkAnOpenSourceCMSwritteninA.NetMVC_C828/image_2.png">
            <img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blog.andrewnurse.net/content/binary/WindowsLiveWriter/MaVeriCkAnOpenSourceCMSwritteninA.NetMVC_C828/image_thumb.png" width="621" height="323" />
          </a>
        </p>
        <p>
Here, we see a page with two modules.  The first module is an instance of the
“Current Time” Module Application, the second is an instance of the “Claim Dumper”
Module Application.  A Module Application is an MVC Application, with its own
Controllers and Views, which handles requests for a particular type of module. 
If you’re familiar with DNN, the “Module Application” is analogous to the “Module
Definition” concept in DNN.
</p>
        <p>
Here’s a look at the code for the Current Time Module Application:
</p>
        <pre class="csharp" name="code">[Export(typeof(ModuleApplication))]
[ModuleApplication(ApplicationId, ApplicationName, "1.0.0.0", "Displays the Current Time", "Maverick", "~/Modules/CurrentTime/Content/Images/Icon.png")]
public class CurrentTimeModuleApplication : ModuleApplication {
    private const string ApplicationId = "A1FE2A31-0BC9-4B12-9B81-3B75C098EB33";
    private const string ApplicationName = "Current Time";

    protected override string FolderPath {
        get { return "CurrentTime"; }
    }

    protected internal override void Init(MaverickApplication application) {
        base.Init(application);
        RegisterRoutes(Routes);
    }

    private static void RegisterRoutes(RouteCollection routes) {
        routes.RegisterDefaultRoute("Maverick.Web.Modules.CurrentTime.Controllers");
    }
}</pre>
        <p>
Compare this with the Global.asax file with an MVC app, and you’ll find it’s very
similar.  The “Init” method is equivalent to “Application_Start” and is called
the first time the Module Application is run during the current ASP.Net Application’s
lifetime.  Just as you would in an MVC ‘Application_Start’ method, the Current
Time Application registers routes into a route table for this module application. 
In this case, the module is using a helper that Maverick provides to register the
default route, but if we take a look at that helper, the only difference between the
standard MVC route and this route is that we require that the namespace containing
the Controllers is specified:
</p>
        <pre class="csharp" name="code">public static void RegisterDefaultRoute(this RouteCollection routes, string routeName, string defaultController, string defaultAction, string defaultId, string[] namespaces) {
    routes.MapRoute(
        routeName,
        "{controller}/{action}/{id}",
        new {controller = defaultController, action = defaultAction, id = defaultId},
        namespaces
        );
}</pre>
        <p>
(<strong>Note</strong>: there are various overrides to this method, including the
one you see used by the CurrentTimeModuleApplication class above)
</p>
        <p>
Routing in Maverick is a little more complex than in standard MVC applications. 
I’ll go into more details on it later, but the gist of it is that a portion of the
URL for a request is handled by Maverick, and the rest (if any) goes to one of the
modules on the page (called the “Active” or “Selected” module).  All the other
modules (referred to as “Passive” modules) get an empty URL, and their default route
is run.
</p>
        <p>
From there on, a module is surprisingly similar to an MVC application.  It has
Controllers and Views, just like an MVC app.  The big difference is that, in
most cases, the ActionResult returned by a Controller does not represent the whole
page, just a fragment of it.  Maverick collects all the ActionResults for a page
and then renders them out one-by-one in the correct location.  Of course there
are exceptions (for example, if a Module returns a FileResult or a RedirectResult),
but that’s the core of it.
</p>
        <h2>
        </h2>
        <p>
        </p>
        <p>
        </p>
        <h2>Missing Features
</h2>
        <p>
Maverick is in an early preview state at the moment.  There is a powerful authentication
model available (or “Identity” model, as I call it), but at the moment, there’s only
a very simple “Debug” implementation of it (which just automatically logs you in as
an Administrator).  I have a prototype system which uses the Azure Access Control
Service in the code, but it is not active by default (I’ll post more about that later).
</p>
        <p>
Maverick does not really include any useful modules, so you’re on your own there. 
Module development is relatively simple, and will be the focus of another blog post. 
Feel free to check out the other modules for more info.  The only major component
of Module Development not covered in the provided sample modules is data storage. 
Maverick does have a system for modules to store data in the Maverick Database, but
none of the built in modules do that.
</p>
        <p>
There is a very rudimentary Theming system in place to allow you to create your own
templates for the site (similar to DNN Skins).
</p>
        <p>
Despite being touted as a Content Management System, Maverick doesn’t actually contain
any Content Management features :), no Workflow, no Versioning, no Content Approval. 
However, those features are planned for the future.
</p>
        <p>
If you have any other suggestions, please let me know!
</p>
        <img width="0" height="0" src="http://blog.andrewnurse.net/aggbug.ashx?id=2ce5897b-450f-45e6-b5b7-b3c11bd2b029" />
      </div>
    </content>
  </entry>
  <entry>
    <title>DotNetNuke Reports Module 5.1 enters the Release Tracker</title>
    <link rel="alternate" type="text/html" href="http://blog.andrewnurse.net/2009/05/02/DotNetNukeReportsModule51EntersTheReleaseTracker.aspx" />
    <id>http://blog.andrewnurse.net/PermaLink,guid,dd40ca99-dace-4174-a7d7-5ec9289b2741.aspx</id>
    <published>2009-05-01T18:45:49.5486947-07:00</published>
    <updated>2009-05-01T18:45:49.5486947-07:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
It took almost a week longer than I said it would, but it’s finally done.  Version
5.1 of the DotNetNuke Reports Module is in the DotNetNuke Project Release Tracker. 
I’ll post some more info over the next week, but for now, here are the release notes:
</p>
        <h3>Reports Module 5.1 for DotNetNuke 5.0.1
</h3>
        <p>
Required DotNetNuke Version: 5.0.1 or above
</p>
        <p>
The following issues have been resolved in this release of the Reports Module
</p>
        <ul>
          <li>
            <a href="http://support.dotnetnuke.com/issue/ViewIssue.aspx?id=9801&amp;PROJID=36">RPT-9810:
Simple URL Parameter system</a> - A simple URL parameter system has been added which
allows users to provide a list of QueryString parameters which will be added to the
query. The parameter names are in the following format: @url_[QueryString Parameter
Name]. Only the parameters specified in the "Allowed URL Parameters" section
will be added. 
</li>
          <li>
            <a href="http://support.dotnetnuke.com/issue/ViewIssue.aspx?id=5953&amp;PROJID=36">RPT-5953:
XSLT Extension Objects</a> - CLR objects can now be provided to the XSLT Visualizer
to use as XSLT Extension Objects. These objects must have a parameter-less constructor
and MAY (but are not required to) implement the IXsltExtensionObject interface (found
in DotNetNuke.Modules.Reports.dll) in order to receive additional context information. 
</li>
          <li>
            <a href="http://support.dotnetnuke.com/issue/ViewIssue.aspx?id=7025&amp;PROJID=36">RPT-7025:
Search Indexing fails due to an exception</a> - When there is an error in a Data Source,
that exception is also thrown by the Search Indexer. Since Reports Module Exceptions
were localized, through the Message property, when the Scheduler caught the exception
thrown by the module, it would attempt to localize the text and fail (since there
is no HttpContext). This has been corrected so that Data Source errors are no longer
masked. 
</li>
          <li>
            <a href="http://support.dotnetnuke.com/issue/ViewIssue.aspx?id=9543&amp;PROJID=36">RPT-9543:
Exception thrown when opening "Manage Add-Ins" page on DNN 5.0</a> - The
DotNetNuke Extensions Installer API was moved to a different namespace in 5.0. The
Reports module has been updated to reflect this change. 
</li>
          <li>
            <a href="http://support.dotnetnuke.com/issue/ViewIssue.aspx?id=8145&amp;PROJID=36">RPT-8145:
Reports Module does not release file handle</a> - The HTML Visualizer was opening
a StreamReader and using ReadToEnd to load the contents, but not closing the StreamReader.
It has been corrected to use System.IO.File.ReadAllText. A similar issue in the XSLT
Visualizer was discovered and resolved the same way 
</li>
          <li>
            <a href="http://support.dotnetnuke.com/issue/ViewIssue.aspx?id=7237&amp;PROJID=36">RPT-7237:
Show Info Pane working incorrectly</a> - The "Show Info Pane", "Show
Controls", and "Auto Run Report" settings were not being updated if
the user is not a Super User, despite the fact that these settings are visible to
non-Super Users. This has been corrected in the 5.1 release. 
</li>
          <li>
            <a href="http://support.dotnetnuke.com/issue/ViewIssue.aspx?id=7236&amp;PROJID=36">RPT-7236:
Critical error when no file name entered for HTML Template Visualizer setting</a> -
The HTML Visualizer allowed users to leave the Template file field empty, causing
a Critical Error on the view page. The view page has been corrected to avoid causing
this error. A similar issue with the XSLT Visualizer has also been corrected 
</li>
          <li>
            <a href="http://support.dotnetnuke.com/issue/ViewIssue.aspx?id=7238&amp;PROJID=36">RPT-7238:
Show Header field cannot be unchecked</a> - A bug prevented the ShowHeader option
from being deselected in the Grid Visualizer. 
</li>
        </ul>
        <p>
Also included is an update for the UDT Data Source for the Reports Module, here are
the release notes:
</p>
        <h3>Forms and Lists Data Source for DotNetNuke Reports 1.1.0 - Release Notes
</h3>
This is a minor update to the User Defined Table Data Source for the DotNetNuke Reports
Module. It has been renamed to the Forms and List Data Source, to match the new project
name. Only one minor change is included: The stored procedure used to retrieve the
list of Forms and List modules has been removed and replaced with (safe) dynamic SQL
to reduce installation overhead. <strong>Requires DotNetNuke Reports 5.0 or above.</strong><p>
Track the progress of the module through the DotNetNuke Release process here: <a title="http://www.dotnetnuke.com/Development/ReleaseManagement/ProjectReleaseTracking/tabid/997/ctl/History/mid/3337/ItemID/394/Default.aspx" href="http://www.dotnetnuke.com/Development/ReleaseManagement/ProjectReleaseTracking/tabid/997/ctl/History/mid/3337/ItemID/394/Default.aspx">http://www.dotnetnuke.com/Development/ReleaseManagement/ProjectReleaseTracking/tabid/997/ctl/History/mid/3337/ItemID/394/Default.aspx</a></p><img width="0" height="0" src="http://blog.andrewnurse.net/aggbug.ashx?id=dd40ca99-dace-4174-a7d7-5ec9289b2741" /></div>
    </content>
  </entry>
  <entry>
    <title>School is done!  On to Reports, and something else ;)</title>
    <link rel="alternate" type="text/html" href="http://blog.andrewnurse.net/2009/04/21/SchoolIsDoneOnToReportsAndSomethingElse.aspx" />
    <id>http://blog.andrewnurse.net/PermaLink,guid,cf83b2ef-bb7e-4129-9412-e3d5fc6ad0d2.aspx</id>
    <published>2009-04-21T15:22:14.15-07:00</published>
    <updated>2009-04-21T15:25:14.4806219-07:00</updated>
    <category term="DNN" label="DNN" scheme="http://blog.andrewnurse.net/CategoryView,category,DNN.aspx" />
    <category term="MaVeriCk" label="MaVeriCk" scheme="http://blog.andrewnurse.net/CategoryView,category,MaVeriCk.aspx" />
    <category term="MVC" label="MVC" scheme="http://blog.andrewnurse.net/CategoryView,category,MVC.aspx" />
    <category term="Reports Module" label="Reports Module" scheme="http://blog.andrewnurse.net/CategoryView,category,Reports%2BModule.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">Well, it's official.  Assuming I pass
the two courses I haven't received grades from, I completed my final day of continuous
education (well, except for the summer breaks/internships) for 18 straight years (K-12
+ 5 years of post-secondary) today.  I've already got marks for 3 of the 5 courses
I took this year, and they were pretty good (couple of A's and a B).  This semester
has been a bit of a strange one, since I had only one computing science course and
it was a "Writing for Computer Scientists" course which involved no programming! (Despite
that, it was one of my favorite courses this semester :D).  I took introductory
courses in Communications, Linguistics and Nutrition as well as a intro to the Physics
of Sound and Music entitled "Logarithm and Blues" taught by a two-man team of a musician
and a physicist (sorry "Writing for Computing Scientists", this one takes the top
slot this semester :)).<br /><br />
Now that I'm finished school, probably for a while (still eying a part-time masters
at University of Washington when I've been at Microsoft for a while), I can settle
down and finish up a few side-projects and some DNN Reports work.  Reports Module
version 5.1 is finished from a code perspective and contains a number of bugfixes
(details to come) as well as two new features:<br /><ul><li>
XSLT Extension Objects - The XSLT Visualizer now allows you to provide a list of .Net
Types which are constructed at runtime and mapped into the XSLT file as XML namespaces.</li><li>
Experimental and mostly hacky support for QueryString parameters in Report Queries
- A number of people have been asking for this, and it's a relatively simple feature
in the Reports Module architecture.  On the settings page, you can provide a
comma-separated list of QueryString parameters which will be passed to the Report
Query.  The parameters are prefixed with "url_" in the query to distinguish them
from the existing parameters.  NOTE: Don't forget that many Databases use still
another prefix, such as SQL Server ("@"), so for example, the full name of the SQL
Server parameter mapped to "foobar" QueryString parameter is "@url_foobar". 
This is only a stopgap solution to allow for some linking into Reports with parameters,
so expect the next version to include a more detailed system (<b>which <i><u>may</u></i> include
breaking changes which <u><i>will </i></u>require that you update your queries</b>).
I'll do my best to support an upgrade path, but no promises, so <i><u><b>use at your
own risk</b></u></i></li></ul>
I just need to do some testing and then I'll put 5.1 into the release process. 
I expect to do that this week, so depending on how long it takes the diligent reviewers
in the release process to make sure that the new version won't obliterate your existing
site (and believe me, you don't want to rush that!), it should be out very soon!<br /><br />
Moving on to a new project...  I've been hinting to some of the people in the
internal project forums at DotNetNuke that I've been working on a top-secret project
involving MVC.  (This is a pure side-project, not part of the DNN Project at
all).  I'm very close to releasing something which, I think, is pretty cool. 
I'll keep the secret for now, but let's say this: I've been working on/with DotNetNuke
for a few years, and I've a huge fan of ASP.Net MVC.  I've learned a lot from
DNN and I think MVC users can benefit from some of that experience ;).  I'm <i>hoping</i> to
have something ready on this secret project, which I call "MaVeriCk", in the next
week or two (but Reports 5.1 is my priority at the moment).<br /><br />
Hope that teased you just enough to stay tuned :P<br /><p></p><img width="0" height="0" src="http://blog.andrewnurse.net/aggbug.ashx?id=cf83b2ef-bb7e-4129-9412-e3d5fc6ad0d2" /></div>
    </content>
  </entry>
  <entry>
    <title>I&amp;rsquo;m still here&amp;hellip; just cramming&amp;hellip; and working</title>
    <link rel="alternate" type="text/html" href="http://blog.andrewnurse.net/2009/04/10/IrsquomStillHerehellipJustCramminghellipAndWorking.aspx" />
    <id>http://blog.andrewnurse.net/PermaLink,guid,9425e19f-3119-4880-9f2f-cd5b5c445825.aspx</id>
    <published>2009-04-10T14:42:49.2050867-07:00</published>
    <updated>2009-04-10T14:43:11.7209999-07:00</updated>
    <category term="Cool Software" label="Cool Software" scheme="http://blog.andrewnurse.net/CategoryView,category,Cool%2BSoftware.aspx" />
    <category term="DNN" label="DNN" scheme="http://blog.andrewnurse.net/CategoryView,category,DNN.aspx" />
    <category term="MVC" label="MVC" scheme="http://blog.andrewnurse.net/CategoryView,category,MVC.aspx" />
    <category term="Reports Module" label="Reports Module" scheme="http://blog.andrewnurse.net/CategoryView,category,Reports%2BModule.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Hello avid readers!  It’s been over a week since I blogged, I know, but I’ve
been cramming for exams.  The CMPT 376 assignment I mentioned a while ago has
finished, so I’m no longer required to blog for grades.  Having said that, after
exams, I plan to keep blogging, so keep watching the feed :).
</p>
        <p>
Just to tease you a bit: I’ve got a cool little ASP.Net MVC side-project well underway
that I’m just dying to show off on the blog, so stick around :P
</p>
        <p>
Also, to the Reports Module users out there, 5.1 is very close to being finished. 
There may be a surprise new feature in there too.  Details to follow later :D.
</p>
        <img width="0" height="0" src="http://blog.andrewnurse.net/aggbug.ashx?id=9425e19f-3119-4880-9f2f-cd5b5c445825" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Quantum Computing in .Net &amp;ldquo;Looflirpa&amp;rdquo;</title>
    <link rel="alternate" type="text/html" href="http://blog.andrewnurse.net/2009/04/01/QuantumComputingInNetLdquoLooflirpardquo.aspx" />
    <id>http://blog.andrewnurse.net/PermaLink,guid,027622e1-c0f4-4cb2-b75c-f990ef7d3ac4.aspx</id>
    <published>2009-04-01T02:29:47.5145927-07:00</published>
    <updated>2009-04-01T02:59:10.2090299-07:00</updated>
    <category term="CMPT 376" label="CMPT 376" scheme="http://blog.andrewnurse.net/CategoryView,category,CMPT%2B376.aspx" />
    <category term="Cool Software" label="Cool Software" scheme="http://blog.andrewnurse.net/CategoryView,category,Cool%2BSoftware.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Microsoft is really taking major strides in terms of improving the programming experience
for developers on all current and <strong>future</strong> computing platforms. 
That’s why, earlier today, Microsoft released a beta of the new “System.QuantumEntanglement”
library.  This library, being considered for integration with .Net 4.1 (which,
my sources say, is codenamed “Looflirpa”), provides features for developers working
on quantum computers.  I won’t go in to too much detail, but this essentially
means working in an environment where objects can be in many different states (possibly
an infinite number) and where observation may change the state of an object. 
Microsoft has proposed a few options, but I have some additional ideas.
</p>
        <h2>Microsoft’s Proposal
</h2>
        <p>
          <a href="http://weblogs.asp.net/leftslipper/" target="_blank">Eilon Lipton</a>, of
the ASP.Net MVC team, <a href="http://weblogs.asp.net/leftslipper/archive/2009/04/01/the-string-or-the-cat-a-new-net-framework-library.aspx" target="_blank">is
proposing a number of new additions to the .Net BCL in 4.1</a>.  The first, is
a class called “StringOr&lt;T&gt;” which has the following API:
</p>
        <pre class="csharp" name="code">namespace System.QuantumEntanglement {
    public class StringOr&lt;TOther&gt; {
        public StringOr(string stringValue, TOther otherValue);

        public string StringValue { get; }
        public TOther OtherValue { get; }
    }
}</pre>
        <p>
This class is used to encapsulate a value which may be a string, but may be another
value.  This is a common user-input scenario, since almost all user input arrives
as strings, but will usually be converted to another data type.  He also proposes
a more general class called “SchrodingOr&lt;TDead, TAlive&gt;”
</p>
        <pre class="csharp" name="code">namespace System.QuantumEntanglement {
    public class SchrodingOr&lt;TDead, TAlive&gt; {
        public SchrodingOr(TDead dead, TAlive alive);

        public TAlive Alive { get; }
        public TDead Dead { get; }
    }
}</pre>
        <p>
This generalizes StringOr&lt;T&gt; to support any two types.  
</p>
        <p>
Eilon’s not the only one talking about this, <a href="http://www.hanselman.com/blog/NET41PreviewNewBaseClassLibraryBCLExtensionMethodsRFC.aspx" target="_blank">Scott
Hanselman</a> (well known Microsoft blogger), and <a href="http://blog.wekeroad.com/blog/cool-extension-methods-for-new-stringor/" target="_blank">Rob
Conery</a> (Author of the .Net Object-Relational Mapper: SubSonic) have also posted
on this topic.  So I figured I’d add my comments to the blogosphere.
</p>
        <p>
StringOr and SchrodingOr are great starts, but what if we need to represent objects
which may be in 2 states? What about 3 states? Infinite states?  That’s where
my proposals come in.  I propose the following additions to Eilon’s library:
</p>
        <h2>Generalizing SchrodingOr
</h2>
        <p>
The first is SchrodingOr&lt;T1, T2, T3, T4, T5, … , T<em>n</em>&gt; (for infinite <em>n</em>). 
This allows the developer to represent objects in as many states as they want.  
</p>
        <h2>C# 5.0 Compiler Support
</h2>
        <p>
I’m also proposing the following language syntax to help developers work with these
types.  Similar to the way the C# compiler converts “int?” to “Nullable&lt;int&gt;”
(which would now be replaced with “SchrodingOr&lt;int, Void&gt;” as it more accurately
represents the concept of a type which may or may not have a value), the new syntax
takes the following:
</p>
        <pre class="csharp" name="code">int?string?bool?DateTime? foo = GetUserInput(...);</pre>
        <p>
And produces output code which looks like this:
</p>
        <pre class="csharp" name="code">SchrodingOr&lt;int, DateTime, bool, string&gt; foo = GetUserInput(...);</pre>
        <p>
Then, we can defer observation until a later time, using the AsA&lt;T&gt;/AsAn&lt;T&gt;
method (since Eilon's Alive and Dead properties no longer work in an infinite state
environment). If we just want to observe the type and then make a decision, we can
use IsA&lt;T&gt;/IsAn&lt;T&gt; methods (of course, both are required, just in case
the type starts with a vowel), which returns a boolean indicating if the object is
of the type <em>T</em>. For example:
</p>
        <pre class="csharp" name="code">if(foo.IsA&lt;string&gt;()) { return foo.AsA&lt;string;&gt;; }</pre>
        <h2>
        </h2>
        <h2>Probabilistic Observation
</h2>
        <p>
Sometimes, we may want to observe an object only if there is a high probability of
it being in the right state, to avoid additional quantum variations. To do this, we
can use the CouldBeA&lt;T&gt;/CouldBeA&lt;T&gt; methods. These can, optionally, accept
a probability threshold beyond which a object is considered in the right state.
</p>
        <h2>Quantum Snapshots
</h2>
        <p>
Unfortunately, in between a call to IsA/An/CouldBeA/An and AsA/An, the state of the
object may change.  So, we may wish to observe an object and record the state
of the object at the time of observation.  Since in observing the object we may
change its state, our observations must be recorded in “Snapshots”.  The snapshot
is an instance of QuantumSnapshotOf&lt;TSchrodingOr&gt; (where <em>TSchrodingOr</em> must
be one of the SchrodingOr&lt;T1, ..., T<em>n</em>&gt; types), and has a property "Taken",
which is a DateTimeOffset (after all, we need precise timing here) containing the
exact time that the snapshot was taken. 
</p>
        <p>
Here’s an example combining Probabilistic Observation and Snapshots:
</p>
        <pre class="csharp" name="code">if(foo.CouldBeA&lt;string&gt;()) {
	QuantumSnapshotOf&lt;SchrodingOr&lt;int, string&gt;&gt; snapshot = foo.Observe();
	if(snapshot.Taken.Day == 1 &amp;&amp; snapshot.Taken.Month == 4) {
		throw new UnreliableObservationException(snapshot, "The data is unreliable");
	}
	return snapshot.AsA&lt;string&gt;();
}</pre>
        <h2>Summary
</h2>
        <p>
I think this is really interesting, forward-thinking, stuff from Microsoft. Eilon
has done some fantastic work getting the ball rolling, and its up to us to give our
feedback! Microsoft has created a section on MSDN for discussion on these new features: <a href="http://en.wikipedia.org/wiki/April_Fool%27s_Day" target="_blank">http://msdn.microsoft.com/en-US/QuantumEntanglement/Default.aspx</a></p>
        <img width="0" height="0" src="http://blog.andrewnurse.net/aggbug.ashx?id=027622e1-c0f4-4cb2-b75c-f990ef7d3ac4" />
      </div>
    </content>
  </entry>
  <entry>
    <title>DotNetNuke on IgniteIT</title>
    <link rel="alternate" type="text/html" href="http://blog.andrewnurse.net/2009/03/30/DotNetNukeOnIgniteIT.aspx" />
    <id>http://blog.andrewnurse.net/PermaLink,guid,4159504d-84ed-4198-abca-2e14bceecd83.aspx</id>
    <published>2009-03-29T23:47:18.2164659-07:00</published>
    <updated>2009-03-30T09:33:20.7290511-07:00</updated>
    <category term="CMPT 376" label="CMPT 376" scheme="http://blog.andrewnurse.net/CategoryView,category,CMPT%2B376.aspx" />
    <category term="DNN" label="DNN" scheme="http://blog.andrewnurse.net/CategoryView,category,DNN.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Did you know that the largest open-source project on the Microsoft platform was started
in Vancouver, Canada?  It’s true!  DotNetNuke is the largest Open-Source
community in the .Net by downloads (at least).  Since moving to CodePlex (Microsoft’s
Open-Source hosting platform) in January 2009, DNN has been downloaded over 180,000
times (at time of writing).  This makes it second only to a World Of Warcraft
Add-On development studio which has been on CodePlex since Sept 2007 (at least that
was the earliest check-in I could find).  Adding that to the all-time download
score on SourceForge (the project’s previous host) of <strong>4.3 Million downloads</strong>,
and you’ve got the the largest .Net open-source project (and one which I am proud
to <a href="http://www.dotnetnuke.com/Products/Development/Forge/ModuleReports/tabid/970/Default.aspx" target="_blank">contribute
to</a>)!
</p>
        <p>
And here’s the great part for us Canucks, DotNetNuke was created right here (by “here”,
I mean where I live :P) in Vancouver!
</p>
        <p>
Microsoft Canada is running a contest called the “Ignite It” award to honour Canadian
developers and IT professionals.  DotNetNuke is nominated in the Developer category,
and we’re looking for your votes!  There’s only 2 days left, and we’re in the
top 5 (which will go on to be judged).  Still, we’d like to be up at number one
before voting ends, so here comes the shameless plug :P.  Here’s the deal: You
can vote once per Windows Live account per day (though there aren’t many days left
:( ).  It only takes a second to vote, and I’ve even created a TinyURL to share
with your friends: <a href="http://tinyurl.com/dnnigniteit">http://tinyurl.com/dnnigniteit</a></p>
        <p>
Let’s push DNN into the top spot!
</p>
        <img width="0" height="0" src="http://blog.andrewnurse.net/aggbug.ashx?id=4159504d-84ed-4198-abca-2e14bceecd83" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Windows Live Writer &amp;ndash; After 2 Months</title>
    <link rel="alternate" type="text/html" href="http://blog.andrewnurse.net/2009/03/27/WindowsLiveWriterNdashAfter2Months.aspx" />
    <id>http://blog.andrewnurse.net/PermaLink,guid,b3dcd5f0-45b9-4454-bd29-604311e3166a.aspx</id>
    <published>2009-03-27T00:39:23.8698795-07:00</published>
    <updated>2009-03-30T09:33:46.5731319-07:00</updated>
    <category term="CMPT 376" label="CMPT 376" scheme="http://blog.andrewnurse.net/CategoryView,category,CMPT%2B376.aspx" />
    <category term="Cool Software" label="Cool Software" scheme="http://blog.andrewnurse.net/CategoryView,category,Cool%2BSoftware.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Back in January, I started <a href="http://blog.andrewnurse.net/2009/01/08/WritingABlogForFunAndProfithellipIMeanGrades.aspx" target="_blank">blogging
more frequently due to a course I was taking</a>.  As part of that, I started
using Windows Live Writer to write all my blog posts.  I use the <a href="http://www.dasblog.info/" target="_blank">DasBlog</a> engine
to power my blog, and it supports one of the many blogging APIs that Windows Live
Writer uses (I believe it’s MetaWeblog).  So, I hooked it up to my blog, and
everything just worked!
</p>
        <p>
My favorite feature is the ability to create and save drafts and then publish them
on demand.  I have inspiration at the strangest times, and often in large batches,
so I end up with a couple ideas of things to blog in a day, and no ideas the next
day.  So, I just create a bunch of drafts, get them ready to publish and then
publish them over a longer period of time (like say… a day :P).  For example,
I wrote this post 5 minutes after the previous post, but I thought it might overload
my readers to post it immediately :).  So, I save a draft and post it a bit later
(when I don’t have anything to blog about :D).
</p>
        <p>
If you have a blog, and it supports one of the blogging APIs, and you’re running on
Windows, you really should try Windows Live Writer!
</p>
        <img width="0" height="0" src="http://blog.andrewnurse.net/aggbug.ashx?id=b3dcd5f0-45b9-4454-bd29-604311e3166a" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Virtually &amp;ldquo;Attending&amp;rdquo; MIX09</title>
    <link rel="alternate" type="text/html" href="http://blog.andrewnurse.net/2009/03/24/VirtuallyLdquoAttendingrdquoMIX09.aspx" />
    <id>http://blog.andrewnurse.net/PermaLink,guid,8c924228-f23a-4565-95f7-334eb0b4e338.aspx</id>
    <published>2009-03-23T23:10:38.7829755-07:00</published>
    <updated>2009-03-23T23:32:48.3937443-07:00</updated>
    <category term="CMPT 376" label="CMPT 376" scheme="http://blog.andrewnurse.net/CategoryView,category,CMPT%2B376.aspx" />
    <category term="MVC" label="MVC" scheme="http://blog.andrewnurse.net/CategoryView,category,MVC.aspx" />
    <category term="Silverlight" label="Silverlight" scheme="http://blog.andrewnurse.net/CategoryView,category,Silverlight.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Microsoft’s MIX Web Development conference was held in Las Vegas last week and while
I would have loved to go, the cost and scheduling just made it impossible :(. 
Despite that, I’ve been spending the past few days “attending” MIX virtually! 
Microsoft posts high quality WMV versions of the talks on the <a href="https://content.visitmix.com/2009/Sessions/" target="_blank">MIX
website</a>, perfect for catching up on the sessions.  With my Media Center PC
hooked up through my Xbox 360, I can browse through my rapidly growing collection
of talks and watch them at my leisure.  It’s almost like being there!  A
couple of my recommendations are below:
</p>
        <ul>
          <li>
            <a href="http://videos.visitmix.com/MIX09/KEY01" target="_blank">Day One Keynote</a> –
I haven’t had a chance to watch this yet, but it already has two things going for
it.  Bill Buxton talking about User Experiences and a live <a href="http://www.dotnetnuke.com/" target="_blank">DotNetNuke</a> installation
using the <a href="http://www.microsoft.com/web" target="_blank">Microsoft Web Platform
Installer 2.0 Beta</a>. 
</li>
          <li>
            <a href="http://videos.visitmix.com/MIX09/T50F" target="_blank">ASP.Net MVC: America’s
Next Top Model View Controller Framework</a> – I love ASP.Net MVC, and this is a great
intro.  Of course, I may be biased since I worked on the team last summer. BTW,
version 1.0 was released last Wednesday, and a large chunk of the AJAX stuff is my
code (my code is actually in a released Microsoft product! w00t!) 
</li>
          <li>
            <a href="http://videos.visitmix.com/MIX09/T44F" target="_blank">Microsoft ASP.NET
Model View Controller (MVC): Ninja on Fire Black Belt Tips</a> – If the previous talk
was MVC 101, this is MVC 201 :P.  Though I have to be honest, I haven’t actually
watched this one yet.  I’m sure its chock full of useful MVC tricks though! 
</li>
          <li>
            <a href="http://videos.visitmix.com/MIX09/T49F" target="_blank">File|New -&gt; Company:
Creating NerdDinner.com with Microsoft ASP.NET Model View Controller (MVC)</a> – I
know, yet another MVC talk, but if you’re more of a “get to the code” type of programmer,
this may be your style.  Plus, Scott Hanselman is an excellent presenter. 
</li>
          <li>
            <a href="http://videos.visitmix.com/MIX09/T79M" target="_blank">How'd they do it?
Real App. Real Code. Two Weeks. Nothing but .NET</a> – Another Scott Hanselman talk,
this one only 20mins long.  You hear people talk about “Rapid Application Development”
but in this talk Scott shows off a concrete example of a 2 week project that forms
part of the Adidas Motorsports portal. 
</li>
          <li>
            <a href="http://videos.visitmix.com/MIX09/T45F" target="_blank">Building Out of Browser
Experiences with Microsoft Silverlight 3</a> – This is another one I haven’t actually
watched yet but intrigued me.  With Silverlight 3, Microsoft is positioning itself
to take on both Adobe Flash and AIR. 
</li>
        </ul>
        <p>
That’s by no means a complete list of great talks, just my first impressions based
on the first few I’ve watched and the abstracts that interested me on the list. 
Feel free to post your own favourites in the comments!
</p>
        <img width="0" height="0" src="http://blog.andrewnurse.net/aggbug.ashx?id=8c924228-f23a-4565-95f7-334eb0b4e338" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Final Few Weeks of School&amp;hellip;</title>
    <link rel="alternate" type="text/html" href="http://blog.andrewnurse.net/2009/03/18/FinalFewWeeksOfSchoolhellip.aspx" />
    <id>http://blog.andrewnurse.net/PermaLink,guid,888ffe74-6429-4434-a11a-32cd610c37ca.aspx</id>
    <published>2009-03-18T11:42:52.7697231-07:00</published>
    <updated>2009-03-18T11:42:52.7697231-07:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I was taking a look at a calendar on Monday and realized something… I only have a
few more weeks of school left!  I don’t graduate until June, but classes finish
on April 6th.  As a result, my workload has been growing exponentially :P, so
I’m putting my side-projects on hold.  The only exception is my work on version
5.1 of the DotNetNuke Reports Module, which is coming along quickly and should be
finished soon.
</p>
        <p>
I went straight from high-school to university, so its been a non-stop 16 years of
school.  So, it’s going to be a little bit strange when I graduate and actually
enter the workforce full-time :).  Still, I’ve got an awesome job to go to, so
I’m still pretty excited.
</p>
        <p>
I have to keep blogging for my CMPT 376 (Writing) course, so I’ll keep doing that,
but I’m putting pretty much everything else (including “Duh,” my toy programming language)
on hold for a couple of weeks.  I’ll have a bit more time after classes end :).
</p>
        <img width="0" height="0" src="http://blog.andrewnurse.net/aggbug.ashx?id=888ffe74-6429-4434-a11a-32cd610c37ca" />
      </div>
    </content>
  </entry>
</feed>