Incase anybody else out there is encountering the annoying Visual Studio 2008 bug where compiling a solution results in Error C2471 (can’t update debug database)… here’s the fix: http://code.msdn.microsoft.com/KB946040
For the longest time I chalked it up to my anti-virus software obtaining a lock on the file and not letting go of it. As it turns out, its a bug in VS2008.
Other than the title of a crappy Staind song… it has been a while indeed. My WP install has been pretty horked for the last few months so I haven’t bothered updating. I’ll take this opportunity (now that I’ve reinstalled WP completely and restored from backup) to fill anybody reading in on what I’ve been doing over the last ~6 months.
To sum it up… I have been working my rocks off. Incase you haven’t read my LinkedIn profile, I’m working as a serious game software developer at a research company that primarily focuses on US Army dismounted infantry simulators. We have a demo coming up in September so we’re all pretty strapped for time while trying to make this demo as clean and bug-free as possible.
So I’ve been doing a LOT of Javascript programming in the last few days and I ran into a few limitations of the language or constructs within the language. For example, certain versions of IE do not support the Array.indexOf() method. Another problem I ran into is that the Javascript language does not contain a method for performing deep copies on objects. So after some Googling I found a few ways around the aforementioned problems. The first one (indexOf) is as follows:
The above code will add the ‘findObject’ method to your Array objects. Then you can use that instead of indexOf() and be guaranteed that it will work regardless if the browser supports indexOf or not.
The second one (deep copying) can be circumvented by creating a helper method which will perform the copy for you:
if (typeof(oldObject) == “object”)
for (prop in oldObject)
// for array use private method getCloneOfArray
if ((typeof(oldObject[prop]) == “object”) &&
(oldObject[prop]).__isArray)
tempClone[prop] = this.getCloneOfArray(oldObject[prop]);
// for object make recursive call to getCloneOfObject
else if (typeof(oldObject[prop]) == “object”)
tempClone[prop] = this.getCloneOfObject(oldObject[prop]);
// normal (non-object type) members
else
tempClone[prop] = oldObject[prop];
return tempClone;
},
//private method (to copy array of objects) – getCloneOfObject will use this internally
getCloneOfArray: function(oldArray) {
var tempClone = [];
for (var arrIndex = 0; arrIndex <= oldArray.length; arrIndex++)
if (typeof(oldArray[arrIndex]) == “object”)
tempClone.push(this.getCloneOfObject(oldArray[arrIndex]));
else
tempClone.push(oldArray[arrIndex]);
return tempClone;
}
};
Just thought I’d share those with everyone. Credit for the majority of the deep copy code goes to http://blog.pramatiservices.com/deep-copy-in-javascript/ and credit for the findObject code goes to someone other than me, but I didn’t bookmark the link so I can’t find it again. Sorry
I just thought I re-post this incase anybody stumbled upon my blog before they landed on the Microsoft page that had the fix for IDE crashes. I experienced this only one time when I was moving/undocking windows.
Enjoy.
I recently wrote up a template engine tool called Templatize. It started as a tool for my girlfriend so she could quickly generate HTML pages from CSV rows for use on eBay, but then quickly grew into a more robust template tool.
Basically it takes a set of input data, containing multiple entities (rows), each with multiple properties (columns), formatted from some type of delimited text file. Then it takes in a master template file and spits out multiple “data-injected” versions of that template.
View the full page here.