Windows Server 2008 install troubles

I wanted to re-purpose an old computer I built into a web server using Windows Server 2008. I got an error message saying “Required cd/dvd drive device driver is missing.” I found it funny since I had to use the DVD driver to get to this point.

If you do a Google search on this topic, you will notice a lot of frustrated installers who have a similar problem and no solution. One solution I kept reading was to switch the DVD jumpers from master to slave. I wasn’t expecting this to work, but to my surprise, I got to the cd key screen.

Hope this helps someone trying to install Windows!

TrueIfAll and TrueIfAny Functions for Javascript Arrays

I’m primarily a .NET programmer and therefore, I’ve become very familiar with LINQ.  I recently needed a trueIfAny function on a few javascript arrays, much like the All<> and Any<> functions in LINQ.   I am aware of LINQ to Javascript which does implement those functions, but I just needed something simple.

Fortunately, it’s very easy to extend functionality of objects thanks to prototype.  Here is the code I wrote to accomplish the task of creating a trueIfAll and trueIfAny function:

if (Array.prototype.trueIfAny == null) {
    Array.prototype.trueIfAny = function (conditionCheck) {
        for (var i = 0; i < this.length; i++) {
            if (conditionCheck(this[i])) {
                return true;
            }
        }
        return false;
    }
}

if (Array.prototype.trueIfAll == null) {
    Array.prototype.trueIfAll = function (conditionCheck) {
        for (var i = 0; i < this.length; i++) {
            if (!conditionCheck(this[i])) {
                return false;
            }
        }
        return true;
    }
}

And to use it:

if(myArr.trueIfAny(function(ele) { return ele.Toggle; }))
{
//Run if any records are true
}

if(myArr.trueIfAll(function(ele) { return ele.Toggle; }))
{
//Run if all records are true
}

The trueIfAll and trueIfAny functions iterate through the array, calling the passed in function (conditionCheck) each time. The passed in function accepts one parameter and needs to return boolean. The parameter is the element produced by the iteration.

In the case of trueIfAll, if the passed in function ever returns false, trueIfAll will return false. In the case of trueIfAny, if the passed in function ever returns true even once, trueIfAny returns true.

Hope this helps someone!