Anthrazit

885 Reputation

13 Badges

5 years, 317 days

MaplePrimes Activity


These are replies submitted by Anthrazit

@acer 

Is it possible to do that on existing tables too?

TableLayout.mw

I've filed a software change request on that one.

@Joe Riel 

One thing is when the call is in the embedded component, and I do agree that there should be as little code there as possible.

But the problem is pretty much the same when the call is indirect, where the buggy code is somewhere else.

It would be much better if Maple raised an exception - sorry, I didn't find that.

Modified code attached.

ProcNameWrong.mw

@Preben Alsholm 

Thanks for the tip.

Which more or less proves my point - the implementation of the max and min functions in Units:-Standard code is buggy. It should be rewritten to take into account that the values can become zero.

I'll file a bug report.

Yes, that's what I found out as well.

I think the reason is that the Simple version uses the "original" max and min functions, while the Standard version has a new implementation - which in this case, fails to do the job.

There would be a possibility to use the verify function in a way to go around the problem, but this requires a bit more coding. The reason behind the problem is that Maple loses units when coming to zero, as mentioned before. That should never happen.

verify( a, b, units( less_than ) ); # true

@acer 

I guess I have to take your code as given from higher spirits, because I don't understand a thing about what it is doing.

Just checked the results of xmldoc and xmldocA, and they seem absolute identical. Both are of type function.

[Edit]

I've found a more direct solution to the problem by using a different function which works.

numelems(GetChildByName(xmltree, "materials")) > 0

@tomleslie 

Thanks for the additional solution, nice to know.

@tomleslie 

The problem is that what if the string you search for exists at least twice, and you want the second one.

Found out by chance that my entry finally was accepted.

But that leads to a new question - how do I post updates?

I have to add that I have uploaded my workbook into 3 different groups - private, public and my companies. It seems that just one of them can be updated, I assume the last one that was uploaded to.

The other groups allow just to do a "publish a copy", which means, a new entry.

Would it be possible to do updates to the other groups as well - probably in the future?

Just got a reply from Maplesoft support, that the problem is due to a whitespace in the xml file.

Here's from the reply:

After reviewing this with our second level support team they confirmed that your XML document contained whitespace. It is this whitespace that Maple was interpreting as the first child.

We recommend using the CleanXML(..)​ function after importing an XML document. This removes content consisting only of whitespace, as well as XML comment structures from an XML tree data structure. The return value is a cleaned XML tree data structure.

Found also that one on the internet.

https://www.oracle.com/technical-resources/articles/wang-whitespace.html

As the code generated was formatted by Maple during writeout, there still might be a possible bug during the writeout.

See also: https://www.mapleprimes.com/questions/230385-XMLTools--File-Formatting

 

Confirmed bug by Maplesoft.

@Carl Love @itsme 

We have a bunch of software programs in our office, and NONE behaves like Maple in that way.

This behaviour is totally unacceptable from our side.

Some software programs like Office lock a file by the operating system, some others implement their own locking mechanism. The usual way is to create a .lck file in the same directory as the file itself, with the information about who locked the file and when.

https://www.mapleprimes.com/questions/230000-Multiuser-On-Maple-Workbook

@acer 

I admit that's a solution, but it's more a workaround actually.

E.g. you go around the XMLTools definition of the XMLProcessingInstructions and define your own.

I'd prefer if the WriteFile command either exports the XML in a more readable form, or has a switch to do so. All the code is already implemented in the Print functions.

@Mac Dude 

As far as I can see now, a file based approach seems to be most promising.

There are at least 2 packages available for Maple that look interesting - JSON and XML.

I've never used any of those formats myself in a self written program, but what do you think about using them? I've actually also looked into IFC, which is an exchange format for buildings, but this looks a bit complicated and there is no package available in Maple yet.

First 11 12 13 14 15 16 17 Page 13 of 19