Tuesday, June 26, 2007

My friend and I were talking yesterday about what we were doing at work. Here is what his day would look like if we coded it up. I won't do mine because it is even more boring, imho :).


class dayAtWork {

var $doc = new FakeXsdClass("bigFreakingXsd.xsd");
var $cleanDoc = new FakeXsdClass("cleanedBigFreakingXsd.xsd");

function dayAtWork() {
$this->bootupLaptop();
for($time = strtotime("now");
$time <= strtotime("now + 8 hours");
$time = strtotime("now")) {
$this->copyFromXSDIfNeeded();
}
}


function bootupLaptop() {
sleep(15 * 1000 * 60) // Sleep for 15 minutes
}


function copyFromXSDIfNeeded() {
$bNeeded = $this->isTagInNoNoList();

if(!$bNeeded) {
$this->deleteCurrentTag();
} else {
$this->copyTag();
}

$this->doc->gotoNextTag();
}

function deleteCurrentTag() {
$this->doc->deleteTag();
}

function copyTag() {
$this->cleanDoc->insertTag($this->doc->currentTag());
}
}


Disclaimer: I just wrote this here and it is psuedo code so it isn't perfect so any code-gripes you can keep to yourself :P.

0 Comments:

Post a Comment

<< Home