GPU Programmer

50 Reputation

3 Badges

14 years, 152 days

MaplePrimes Activity


These are questions asked by GPU Programmer

I can export a worksheet (to many different formats), but the normal way of doing this requires a human in the loop and several mouse operations.

Is there a way to automate this?

I have on the order of 100 different worksheets and would like to capture them in an archival format (e.g., PDF).

The loglogplot procedure in the plots package labels the axes using "10 to the power notation" that looks like what you would see in LaTeX from the expresion "10^{-4}".

I"m at a loss about how to do the same.  If I try typesest(10^(-4)) the argument is converted to a rational before typeset gets the argument and the result is something equivlent to LaTeX's "\frac{1}{10000}".

Example:

    loglogplot(x, x = 0.1*10^(-5) .. 10, title = typeset(10^(-4)));

produces:

    

I want to read file dates (for data files) from inside Maple.  Specifically, I want to automate the comparison of access dates.

I thought I'd done this in the past, but my attempt to recreate it has led me to think that I am remembering incorrectly.

Is there a way of doing this?

I don't deeply care about portability (I'm working on Windows 10 and that would be good enough), but since I'm asking the question please comment on the easiest way to make this portable.

I am aware that by default Windows 10 doesn't update the access date.  On the machines I care about, I have changed the configuration so Windows is updating the access date (often enough for my purposes).  I have PowerShell scripts that work correctly.

I am creating a largish package (i.e., for use by others with the “with” command).

Most of the exported procedures have some derivations associated with the code.  This is at least a partial reason for using Maple.  So, I had organized a worksheet so that each exported procedure has its own section that included pre-coding derivations, the procedure, and some post-coding validation of the code (serious testing is done elsewhere).  At the end of the worksheet I had a section that built the module and saved it to the appropriate library.  If I execute the worksheet it runs through everything and builds a new version of the library containing the package.

Getting these exported procedures to bind to a local helper procedure that is shared among several exported procedures was a bit tricky.  The way I ended up doing it is illustrated in the attached worksheet.

From a life cycle perspective is there a better way to think about this?
 

restart

with(InertForm)

[Display, FromMathContainer, MakeInert, NoSimpl, Parse, SameStructure, ToMathContainer, ToMathML, Typeset, Value]

(1)

DistWorkSheet := proc (A, B) F(A[1]-B[1])+F(A[2]-B[2]) end proc

proc (A, B) F(A[1]-B[1])+F(A[2]-B[2]) end proc

(2)

"Test:=module()"

"  export Dist"

_local(Sqr)

"  option package;"

NULL

Sqr := proc (A) A*A end proc

 

Dist := eval(subs(F = eval(Sqr), eval(DistWorkSheet)))

"end module"

_m2052587788544

(3)

eval(Test:-Dist)

proc (A, B) (proc (A) A*A end proc)(A[1]-B[1])+(proc (A) A*A end proc)(A[2]-B[2]) end proc

(4)

Test:-Dist([0, 0], [1, 1])

2

(5)

NULL


 

Download PackageBuild.mw

Page 1 of 1