• Nhibernate Generics Lazy Loaded Collections

    Child objects not saved when added to a lazy loaded collection that is not initialized. See this post for more info.

  • JavaScript Prototype notes

    Prototype adds to the array class, amoung other things, which can break other javascript files, like fValidate.

    prototypify – running prototype code with legacy code – provides a work around and more explaination.

    really easy field validation with prototype – is a validation script based on prototype.

  • Ajax javascript issues.

    Javascript functions injected into the DOM using innerHTML will not work. So using something like:
    <br />mydiv.innerHTML = [html result from ajax method call];<br />&hellip;<br /><div id=&ldquo;mydiv&rdquo;><br /></div><br />
    make sure the [html result from ajax method call] doesn’t contain javascript, other then events (onclick, onblur, etc.).

  • Powershell Text Replace

    Search a text file line by line, replacing text using regex’s.
    <br />cat &lsquo;file.txt&rsquo; | foreach { $_ -replace &lsquo;find-text&rsquo;, &lsquo;replace-text&rsquo; }<br />

  • Ngen the powershell dll’s for faster startup

    In the Trenches » Some PowerShell scripts…: “Ngen the dlls and try it again. I think you’ll find it faster.

    cd $pshome
    dir *.dll | %{ ngen.exe $_.fullname}

    If ngen is not in your path, use:

    Jeffrey Snover
    Windows PowerShell Architect”

  • WIX: Skipping a dialog based on selected feature.

    To skip dialogs you will need to modify the wxs files for the dialogs around your dialog. You need to add click events to the next and back buttons to handle the different paths based on the selected features.

    <Publish Event=“NewDialog”
    <![CDATA[&FeatureID = 3 AND !FeatureID <> 3]]>

    You will also have to modify the WixUI_FeatureTree.wxs file to handle the newly created events. The default files can be copied from the WIX source.

    One thing to note is the odd syntax for getting the state properities of objects.
    &FeatureId is like FeatureId.ActionState
    !FeatureId is like FeatureId.InstalledState

    Inside the dialog…

    <Control Id=“Next” Type=“PushButton”
    X=“236” Y=“243” Width=“56” Height=“17”
    Default=“yes” Text=“$(loc.WixUINext)”>
    <Publish Event=“NewDialog”
    <![CDATA[&FeatureID = 3 AND !FeatureID <> 3]]>
    <Publish Event=“NewDialog”
    <![CDATA[NOT (&FeatureID = 3 AND !FeatureID <> 3)]]>


    Wix Tutorial

  • Two patterns that promote code reuse in ASP.NET

    Two patterns that promote code reuse in ASP.NET