...is that everything is your fault. Everything. It's not the user's fault, because you should be validating that input. It's not the computer's fault, because they are only capable of logical following of instructions. You're the one telling it to make the error, whether you think so or not.
There is this difficult to kill bug coming up in Avari. I have three lines of code. Looks something like this:
printToLog("User says: " + phrase);
otherFrame.location = "avari.php?userphrase="+phrase;
printToLog("Question recognized: " + phrase);
So the first line does what it's supposed to, but the third line never executes. Obviously there's something wrong with that middle PHP file. But even if there is, Javascript should continue executing. It's not waiting on PHP to return for it to do anything. That third line should still happen.
And worst of all, this only happens sometimes. I can't replicate this. It happens when people come up and try to talk to Avari but never when we're sitting there testing it with all our debugging statements in place. How does that even happen?!?
It frustrates me. A lot of times when there are deep errors like this the answer comes to me in some kind of insight while I'm sleeping or something. Not this time. I have no ideas. I've checked everything as well as I possibly can. There has to be something else interfering with the process.
The best I can think of is a workaround. Call a function to wait for 3 seconds, then call the PHP function. If the character isn't speaking after those 3 seconds are up, something is wrong; refresh the entire page and hope that that fixes it. I hate hacks like that, but it's the only thing I can think of. I'm not sure that PHP and Javascript were meant to handle such complexities.
In other news, there are two weeks left now and things are even crazier. The kind of crazy that leaves clothes and coffee cups littered all over the apartment and a box of Frosted Flakes by my desk that I eat straight out of. It'll be okay, though. Things are almost over. There's much to be done, but I'm fairly confident that I can handle it from this point.
Victoria & I went to West Virginia this weekend to check out what she'll be doing this summer at Global Outreach, a missions organization that my friends Kevin & Emily are at. It was pretty exciting. I have a lot of pictures and stories. Ask me sometime. But as for now, I must study for this 11:00 physics test, get dressed, prepare for the ACM meeting, and get my things together for research...
Wednesday, April 16, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment