billroper: (Default)
There are some approaches in programming that simply don't scale.

One of them, I am now reminded after running a bunch of timing tests, is reading large XML data using DOM. My only consolation is that I was not the one who decided that using DOM was a good idea.

I have suggested using a nice serial forward-only XML reader.

And that someone else can fix up the code to do so. :)
billroper: (Default)
I need to be reading and writing XML in both C++ and Java as I serialize and persist data objects. So I wrote an XMLArchive class on both sides of the divide that behaves pretty similarly in both environments within the limits of what the languages will allow.

I've been adding functionality to both sides of the great divide to try to fix up some of the test code that one of the other programmers wrote with an early version of the XMLArchive class. Today, I wrote a big batch of templated functions in C++ to match up with the generic methods in Java. I think this is going to work.

I'll find out shortly when I get a chance to test it. :)

Bit by Bit

Apr. 20th, 2016 11:41 pm
billroper: (Default)
I was wrong. My friend actually came back and put the fence posts into their holes while I was inside working and keeping track of the toilet installation. Now we just need to concrete them in place...

Meanwhile, I've been cleaning up some of my XML generation so that everything is reading and writing XML that looks like it was written with some set of guiding principles. The problem comes when you get to the point of XML documentation that says "Do it however suits you."

Well, yes, I can do that. I just want to avoid religious arguments once I set the format. :)

XML Hell

Oct. 29th, 2015 06:42 pm
billroper: (Default)
I'm currently being bedeviled by some interesting XML to parse. To wit:


<myObject>
<this value=fred>
</this>
<that value=barney>
</that>
</myObject>


Ok, you can parse this, but why would you want to? Shouldn't this be:


<myObject this=fred that=barney>
</myObject>


Or even:


<myObject this=fred that=barney />


It's like they were being paid by the character...
billroper: (Default)
I have been frantically coding this week to try to fix a problem with formula translation as we move from the old account numbering regime to an account naming regime, because a function that I had hacked together that depended on the specific format of the old account numbers no longer worked. I had been trying to produce a solution that would require reverse parsing the byte stream that results from parsing the formula text, but that became increasingly unwieldy -- actually, it was more just a matter of it was a lot of work -- so I set that aside and went to a simpler solution using the parser with a flag setting that told it to correct the formula text on the fly so I could store the fixed version.

I think that works, but something went wrong when I tried to test it. So I pulled up the trusty audit dialog in the Excel add-in version of our product to see what the formula was in the debugger.

It immediately failed.

What the--?

A bit of debugging later, I discovered that this time they had remembered to encode the string with the quotation marks on the way in, but not to decode it on the way out from the XML format.

To quote the late Casey Stengel, "Can't anybody here play this game?"

I have now coded the XML retrieval to use one of my utility functions that automatically decodes the string output. I had to write a new version of the function, because the one that I had used boost::shared_ptr, while the function I was working with had used std::auto_ptr, but that was a quick substitution.

I don't really care which one we use, but it would be nice if we made up our minds...

Now to see if this damned thing works...

Profile

billroper: (Default)
billroper

December 2025

S M T W T F S
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28293031   

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Dec. 28th, 2025 07:40 pm
Powered by Dreamwidth Studios