• I have been working on a modal dialog that would alter the scrolling of a browser window. Essentially I have a page with a lot of content causing vertical scroll. I have a modal dialog that should pop up that also contains enough content to create vertical scrolling. The goal here is to make the browser scroll on the background content until the model is shown, and then it would switch to scrolling on the modal content.
    approx. 2 minutes. Software    js
  • I was trying to use NUnit the other day with Xna and sadly my first test wouldn’t pass with this exception: MyApp.Core.Tests.PlayerTests (TestFixtureSetUp): SetUp : System.BadImageFormatException : Could not load file or assembly ‘MyApp.Core, Version=, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. An attempt was made to load a program with an incorrect format. The quick fix is to use the x86 version of the application nunit-x86.exe and all is well.
    approx. 1 minutes. Software    csharp js
  • I ran into an issue where I was doing Asp.Net Mvc validation on one of my forms. I wanted it so that three things were required only if a checkbox was checked. I know that out of the box this isn’t supported so I googled around until I found this article: http://blogs.msdn.com/b/simonince/archive/2011/02/04/conditional-validation-in-asp-net-mvc-3.aspx The article goes over conditional validation with a custom validator and some extension code so that it works client side.
    approx. 3 minutes. Software    csharp js
  • Clean JavaScript - Utilities

    There are many different methods of creating clean Javascript. This post is just a simple way that I prefer to do it. This is a Sac Rate Calculator that I wrote in JavaScript: // Namespace to DevelopLive DevelopLive = window.DevelopLive || {}; // Define Dive DevelopLive.Dive = window.DevelopLive.Dive || {}; (function () { $self = DevelopLive.Dive; $self.calcSac = function(psiIn, psiOut, time, depth, tankVolume, tankWorkingPsi) { // calculate DAC var dac = (psiIn - psiOut) / time, // calculate SAC sac = dac / ((depth / 33) + 1), // calculate RMV rmv = sac * tankVolume / tankWorkingPsi; // return return rmv; } }()); Simply, I am creating a namespace and definition then defining a self-calling function.
    approx. 2 minutes. Software    js