See examples in System.mw
BuildHelp(source,/hdbfile,{rootkey,catkey,hflkey,tockey,ext,test,printout},$)
build or append help database file hdbfile::string:="" (without extension)
from a properly formatted source file,
which references help-page files with extension ext::string:=".mw",
using makehelp command
which is skipped if test::boolean is true.
The source file is parsed line by line with the following rules:
rootkey::string:="#root:" then the rest of the line defines the root name in the help-browser;catkey::string:="#cat:" then the rest of the line defines the category name;hflkey::string:="#hfl:" then the rest of the line defines the name of the help file and the next lines are treated as follows:tockey::string:="#toc:" it will be the TOC entry text otherwise the TOC entry will be equal to the topic name,# then the rest of the line defines the topic name and its aliases as comma-separated list (surrounding whitespaces are trimmed),ReadModules(filename,/prefix::string:="s_",$)::list(string)
returns list of modules as strings read from a text file.
The filename::string can be either full filename with path
or short filename with or without extension (the default extension is ".ini").
The command scans all module definitions and for each module "modulename"
assigns its string definition to the variable "prefix|modulename"
(existing names will be reassigned without a notice).
Module definition must strictly follow the rules:
ReadModules, do not start it with "\nmodule()".
If filename file does not exist,
ReadModules determines the file name fn and extension fx
and tries to read ModulesFolder|fn|fx and ModulesFolder|fn/fn|fx.AssignModule(moduledef)::module
parse module defined by moduledef::string (either string containing module definition or name of the module)
and initialize it by parsing a string containing module definition
and running :-ModuleInit(_rest) command if the module contain this procedure.
If module definition was not initialized, it calls ReadModules.
The main aim of AssignModule and ReadModules commands
is to create multiple copies of a module, that is not supported in Maple.ProcessSetupArgs(lsargs,variables,/constants,suffix,$)
process Setup arguments, where
lsargs::list of keywords or initializing equations for them exactly as in interface command;variables::list(name) known variables;constants::list(name):=[] known constants (cannot be changed);suffix::string:="" to avoid name conflicts, see examples.Check4Updates(/root,packages,{openlinks},$)
check for package updates at root::string:="http://zhugayevych.me/maple/" folder.
The list to check is given by packages::list(string):=["BasicTools","SSH","FiniteGroups","LatticeTools","MolMod","AstroTools"].
If openlinks::boolean is true, updatable packages are opened by Windows Explorer.TabulatedFunction(_rest)::module
support of tabulated functions. Exported module members:
:-XV::list([argument,value]) list of calculated values of the function;:-ModuleApply(x,dr,$)::[argument,value]
the tabulated version of the function, where
x is a float or any indexable object of floats (lists and Vectors works for sure) and
dr::positive:=defdr defines spatial the resolution:
if no tabulated points on the distance dr from x are found
then the function is calculated for x and the result is appended to XV;:-Remove(x,$) the nearest to x point will be removed from XV;:-Read(filename,/Fdim,convert,$)
append XV by data from file filename::string,
where Fdim::posint:=1 is the number of the function components
and convert::procedure:=(V->Vector[column](V)) converts the raw data to the format of XV entries;:Save(filename,{digits,overwrite},$)
save XV data to a file filename::string (empty string means terminal)
with digits::posint:=min(10,Digits-2) precision;:-ModuleInit(ForXVorFilename,defdr,/rhof,{Fdim},$)
initialize the module with _rest, where
ForXVorFilename is either function or XV list or datafile,
and rhof::procedure:=((x,y)->`if`( type(x,atomic), abs(x-y), evalf(sqrt(add(v^2,v=x-y))) )) is the metric function.Timing(/nleft,percentages,{nmin,timestep},$)
print progress and time left to finish the computations. Here:
nleft::integer:=nLeft number of computations cycles left;percentages::list(posint):=[] at which the progress is printed regardless of time (ignored if nleft<0);nmin::posint:=3 minimum number of cycles for estimating computation time;timestep::positive:=5 minimum separation in seconds between output.nmin as small as possible, i.e. 1 or 2.
For computations with random duration of cycles set nmin as large as possible,
but not too large because you will wait a long time for the first output.
Place Timing at the end of the computation cycle
and don't forget to run InitTiming before starting the computations.InitTiming(nleft::integer:=-1,{timestep::positive:=10},$)) initializes Timing