Barron of Blog Wife, Libby, and the Pursuit of Happiness

14Mar/100

Happy Pi Day

Happy Pi Day!

Filed under: geek, math, piday No Comments
10Jan/100

Lego Universe

Lego is releasing a MMOG called "Lego Universe". Based on this trailer, it's going to rock your blocks off!

Filed under: games, geek, videos No Comments
18Dec/090

Star Wars: In Concert


This is the beginning of the second half of "Star Wars: In Concert". It's dark, but at the end it's me and Mike V. looking into the camera and going "Oooooo" in excitement. Yeah - we're dorks. But the show was awesome; Anthony "C3PO" Daniels was the MC for the concert and did a superb job.

Filed under: geek, videos No Comments
9Dec/094

Debugging Objects in Javascript

There are a lot of good JavaScript debugging tools available out there; FireBug for Firefox comes to mind as one of the best. But when when developing web applications across multiple browsers, particularly browsers like IE which have limited built-in debugging functionality, it's handy to have a function that can be called to debug a specific object on the page.

Here is a JavaScript function that I wrote several years ago. It's a bit of a kludge - I'm sure there is a more elegant approach - but having it available to quickly inspect a single element has saved more than a few hours of painful development:

function debugObject(elem, recurseIntoObjects, elemPropertyName) {
	var mesg = "";
	if ((elem == undefined) || (elem == null)) {
		alert("Passed element is not valid: "+elem);
		return;
	}
	for (var i in elem) {
		if ((i == undefined) || (i == null) || (typeof elem[i] == 'function') || (typeof elem[i] == 'undefined') || (elem[i] == null)) {
			continue;
		}
		if (recurseIntoObjects && typeof elem[i] == 'object') {
			if ((elemPropertyName != undefined) && (elem[i][elemPropertyName] != 'undefined')) {
				mesg += i+": "+elem[i][elemPropertyName]+"\n";
			}
			else {
				var elements = "";
				var elementCount = 0;
				for (var j in elem[i]) {
					if ((j == undefined) || (j == null) || (typeof elem[i][j] == 'function') || (typeof elem[i][j] == 'undefined') || (elem[i][j] == null)) {
						continue;
					}
					if (elementCount != 0) {
						elements += ", ";
					}
					elements += elem[i][j];
					elementCount++;
				}
				mesg += i+"["+elementCount+"]: "+elements+"\n";
			}
		}
		else {
			mesg += i+": "+elem[i]+"\n";
		}
	}
	alert(mesg);
	return mesg;
}
Filed under: dev, geek 4 Comments
27Oct/090

CSI: Hilarious

I know CSI is just a wee bit over the top (see zoom example), but this is just too funny (being the programmer that I am):