Ellis Morning

Apr 2015

Open And Shut

by in CodeSOD on

Our anonymous friend writes: I was tasked with figuring out why invalid XML was being output by a homegrown XML parser.  As I looked into the code, I found the way this code handles writing out XML files…

Yes, it really does open and close the file handle for every xwrite call.  This means that it opens and closes it 3 times PER TAG when writing out the XML.


Failure is OK

by in Feature Articles on

Roland was working on code that implemented HTTP service methods. The 'status' variable held one of those pass-it-everywhere objects that were sometimes called 'RunData'. It contained the request, response, security context, and other needed information. When JavaScript sent an asynchronous HTTP request, one of the service methods performed some backend magic and returned a JSON object with the appropriate data.

Teton Dam failure