{VERSION 6 0 "IBM INTEL NT" "6.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "Hyperlink" -1 17 "" 0 1 0 128 128 1 2 0 1 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 266 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 268 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 269 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 270 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 271 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 272 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 273 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 274 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 275 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 276 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 277 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 278 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 279 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 280 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 281 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 282 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 283 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 284 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 285 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 286 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 287 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 288 "" 1 10 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 289 "" 1 10 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 290 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 291 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 292 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Maple Output" -1 11 1 {CSTYLE "" -1 -1 "Ti mes" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 3 0 0 0 0 1 0 1 0 2 2 0 1 } {PSTYLE "Maple Output" -1 12 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 3 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Bullet Item " -1 15 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 } 1 1 0 0 3 3 1 0 1 0 2 2 15 2 }{PSTYLE "Normal" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 14 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 257 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 2" -1 258 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 4 4 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 257 "" 0 "" {TEXT 274 82 "\"code_support' for CLI FFORD, Bigebra, Octonion, GTP, Cliplus, Octonion in Maple 11" }{TEXT -1 242 "\n\n`Copyright 1995-2008 by Rafal Ablamowicz (*) and Bertfried Fauser ($)\n\n(*) Department of Mathematics, Box 5054\n Tennessee Technological University, Cookeville, TN 38505\n Tel: USA (931) 3 72-3569, fax: USA (931) 372-6353\n E-mail: " }{URLLINK 17 "rablamo wicz@tntech.edu" 4 "mailto:rablamowicz@tntech.edu" "" }{TEXT -1 16 " \+ \n URL: " }{URLLINK 17 "http://math.tntech.edu/rafal/Cliff8/" 4 "http://math.tntech.edu/rafal/Cliff8/" "" }{TEXT -1 101 "\n\n($) Uni versit\"at Konstanz, Fachbereich Physik, Fach M678\n 78457 Konstan z, Germany\n E-mail: " }{URLLINK 17 "Bertfried.Fauser@uni-konstanz .de" 4 "mailto:Bertfried.Fauser@uni-konstanz.de" "" }{TEXT -1 11 "\n \+ URL: " }{URLLINK 17 "http://kaluza.physik.uni-konstanz.de/~fauser/ " 4 "http://kaluza.physik.uni-konstanz.de/~fauser/" "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "restart:\n#with(code_support);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 174 "This help page shows various commands and their code of \+ the supplementary package \"code_support\" that can be used to manipul ate help pages for various packages, for example, " }{HYPERLNK 17 "CLI FFORD" 2 "Clifford,intro" "" }{TEXT -1 32 ". \n\nThis package enables \+ one to:" }}{PARA 0 "" 0 "" {TEXT -1 100 "\n- copy Maple worksheets fr om one directory to another and make certain string replacements usin g " }{TEXT 277 16 "change_helpfiles" }{TEXT -1 34 ",\n- change worksh eet names using " }{TEXT 278 11 "change_name" }{TEXT -1 1 "," }}{PARA 0 "" 0 "" {TEXT -1 50 "- copy files from one directory to another usi ng " }{TEXT 275 9 "copy_file" }{TEXT -1 42 ",\n- read a Maple workshe et as text using " }{TEXT 279 8 "get_TEXT" }{TEXT -1 1 "," }}{PARA 0 " " 0 "" {TEXT -1 84 "- read and return names of Maple worksheets locat ed in a specified directory using " }{TEXT 276 7 "get_dir" }{TEXT -1 1 "," }}{PARA 0 "" 0 "" {TEXT -1 126 "- take a list of file names wit h help topics and insert them automatically into Maple browser and HDB database entries using " }{TEXT 280 16 "insert_helppages" }{TEXT -1 54 ",\n- make an automatic list of data entries needed by " }{TEXT 285 16 "insert_helppages" }{TEXT -1 7 " using " }{TEXT 281 8 "makeLIST " }{TEXT -1 46 ",\n- modify a list of data entries created by " } {TEXT 286 8 "makeLIST" }{TEXT -1 7 " using " }{TEXT 282 10 "modifyLIST " }{TEXT -1 55 ",\n- replace certain strings in Maple worksheets usin g " }{TEXT 283 15 "replace_in_file" }{TEXT -1 55 ",\n- split file nam es into a sequence of strings using " }{TEXT 284 5 "split" }{TEXT -1 1 "," }}{PARA 0 "" 0 "" {TEXT -1 62 "- convert directory names listed as symbols to strings using " }{TEXT 290 34 "`convert/symbol_dir_to_s tring_dir`" }{TEXT -1 1 "," }}{PARA 0 "" 0 "" {TEXT -1 77 "- convert \+ back directory name from a string format to a symbol format using " } {TEXT 291 34 "`convert/string_dir_to_symbol_dir`" }{TEXT -1 51 ".\n\nF or examples how these commands can be used see " }{HYPERLNK 17 "exampl es of code_support" 2 "code_support,examples" "" }{TEXT -1 1 "." }} {PARA 0 "" 0 "" {TEXT -1 27 "\nCookeville, June 19, 1008\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 506 "################################## ###############################################\n### It is assumed tha t directories can be entered either as strings:\n### (a) In Windows: \+ \"C:\\\\Maple11\\\\Clifford\\\\Help_11_New\\\\\"\n### (b) In Linux: \+ \"/home/fauser/BIG_ALL/P11/Clifford/Help_11_New/\"\n###\n### or as \+ symbols:\n### (c) In Windows: `D:\\\\Bigebra/Help_Bigebra/`\n### (d) In Linux: `/home/fauser/BIG_ALL/Help_Bigebra/`\n################# ################################################################ \+ \010 \n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 241 "code_support:=module()\nexp ort split,copy_file,get_dir,change_name,replace_in_file,change_helpfil es,get_TEXT,\n makeLIST,modifyLIST,insert_helppages,NamesInLibra ry; \nlocal setup;\noption package, load=setup:\n##################### ########\n" }}{PARA 0 "" 0 "" {TEXT -1 13 "1. Procedure " }{TEXT 292 14 "NamesInLibrary" }{TEXT -1 101 " gives names of programs stored in \+ the library specified as the argument. It gives names as strings.\n" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 443 "NamesInLibrary:=proc(lib) local e ,L,Lnew;\n###############################################\noptions `Co pyright (c) 2002-2008 by Rafal Ablamowicz and Bertfried Fauser. All ri ghts reserved.`;\ndescription `Last revised: December 20, 2007`;\n#### ###########################################\n L:=march('list',lib):\n Lnew:=[]:\n for e in L do \n if SearchText(\":\",e[1],1..1)=0 th en Lnew:=[op(Lnew),e[1]] end if; \n end do:\nop(sort(Lnew));\nend pro c:\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "" 0 "" {TEXT -1 13 "2. Procedure " }{TEXT 264 5 "split" }{TEXT -1 188 " takes chara cter pattern \"pat\" and splits a string into a sequence of substrings remained after removing \"pat\" from the string. If the pattern does \+ not match, the string is returned back.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 569 "split:=proc(pat,str) local a_seq,a1,x,pos,len,n;\n## #############################################\noptions `Copyright (c) \+ 2002-2008 by Rafal Ablamowicz and Bertfried Fauser. All rights reserve d.`;\ndescription `Last revised: December 20, 2007`;\n################ ###############################\n a_seq:=NULL;\n a1:=str;\n len:=le ngth(a1);\n pos:=1;\n while(SearchText(pat,a1,pos..len) <>0) do\n \+ n:=SearchText(pat,a1,pos..len);\n x:=substring(a1,pos..n-1);\n \+ a_seq:=a_seq,x;\n a1:=substring(a1,n+length(pat)..len);\n len:=l ength(a1);\n od:\n a_seq:=a_seq,a1;\nend:\n" }}{PARA 0 "" 0 "" {TEXT -1 13 "3. Procedure " }{TEXT 257 9 "copy_file" }{TEXT -1 262 " c opies a single file named 'in_file' and located in the directory 'path ' as another file called 'out_file' to the same directory.\nThe path c an be specified as a symbol, e.g., as `D:\\\\Bigebra/Help_Bigebra/` or as a \"string\", e.g., \"D:\\\\Bigebra\\\\Help_Bigebra\\\\\".\n" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 1262 "copy_file:=proc(path::\{string,sy mbol\},in_file::\{string,symbol\},out_file::\{string,symbol\}) \n \+ local OUT,line,n_lines,Text,path1,in_file1,out_file1;\n######### ######################################\n options `Copyright (c) 2002- 2008 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved.`; \n description `Last revised: December 20, 2007`;\n################## #############################\nif type(path,symbol) then\n path1:=pa th;\nelse\n path1:=convert(path,string_dir_to_symbol_dir);\nend if; \n###############################################\nif type(in_file,sym bol) then\n in_file1:=in_file;\nelse\n in_file1:=convert(in_file,n ame);\nend if:\n###############################################\nif ty pe(out_file,symbol) then\n out_file1:=out_file;\nelse\n out_file1: =convert(out_file,name);\nend if:\n################################### ############\n n_lines:=0;\n Text:=[];\n OUT:=fopen(cat(path1,out_f ile1),WRITE,TEXT);\n while true do\n line:=readline(cat(path1,in_f ile1)); \n if line = 0 then break end if:\n Text:=[op(Text),line ];\n writeline(OUT,line);\n n_lines:=n_lines+1;\n end do:\n cl ose(OUT);\nprintf(\"file %s containing %d lines has been copied as fil e %s in the directory %s\\n\",in_file1,n_lines,out_file1,path1);\n re turn;\nend proc:\n" }}{PARA 0 "" 0 "" {TEXT -1 13 "4. Procedure " } {TEXT 258 7 "get_dir" }{TEXT -1 260 " fetches the *.mws files from a d irectory given as an argument and returns file names in a list of stri ngs. Note that the directory can be specified as a \"string\", for exa mple, \"C:\\\\Maple10\\\\P10\\\\test1\\\\\", or as `symbol`, for examp le, `C:\\\\Maple10/P10/test1`.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1247 "get_dir:=proc(dir::\{string,symbol\}) local wc_line,out_list,dir 1;\n###############################################\n options `Copyri ght (c) 2002-2008 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved.`;\n description `Last revised: December 20, 2007`;\n###### #########################################\nif type(dir,symbol) then\n \+ dir1:=convert(dir,symbol_dir_to_string_dir): \nelse\n dir1:=dir:\n end if;\n###############################################\nout_list:=ss ystem(cat(\"dir \",dir1));\nif out_list[1] <> 0 then error \"Could not read the directory\" end if:\n#####################################\n wc_line:=proc(line::string)\n local c,nw,out,List,item:\n nw := 0;\n out := true;\n List:=[]:\n item:=\"\":\n for c in line do\n if c = \" \" or c = \"\\t\" or c = \"\\n\" then\n out := true;\n \+ if SearchText(`.mws`,item)<>0 then\n List:=[op(List),item]; \n end if:\n item:=\"\";\n elif out then\n out := fa lse;\n nw:=nw+1;\n item:=eval(cat(item,c));\n else\n \+ item:=eval(cat(item,c));\n end if:\n end do:\n if length(item) < > 0 and SearchText(`.mws`,item)<> 0 then \n List:=[op(List),item]; \n end if:\n return List \nend proc:\n############################# ##############\nreturn wc_line(out_list[2])\nend proc:\n" }}{PARA 0 " " 0 "" {TEXT -1 13 "5. Procedure " }{TEXT 259 11 "change_name" }{TEXT -1 355 " changes a name of a file \"filename\" specified as a string b y replacing a substring \"substrout\" with a new substring \"substrin \". It returns the name of the new file as a string. If the string \"s ubstrout\" is not found in the \"filename\" then it is appended to the name of the file before \".mws\" extension. Note that \"substrout\" c ould be an empty string \"\".\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1079 "change_name:=proc(filename::string,substrout::string,substrin::s tring) local N,fileext,filenamenew,n,nout,nb;\n####################### ########################\noptions `Copyright (c) 2002-2008 by Rafal Ab lamowicz and Bertfried Fauser. All rights reserved.`;\ndescription `La st revised: December 20, 2007`;\n##################################### ##########\nN:=length(filename); ###length of the whole string\nnout:=length(substrout); ###length of the string t o be removed\nn:=SearchText(substrout,filename); ###location of the s tring to be removed\n#return n,nout,N;\nif n+nout-1 " 0 "" {MPLTEXT 1 0 2576 "replace_in_file:=proc(in_file::\{ string,name\},out_file::\{string,name\},pat_list::list(string),rep_lis t::list(string)) \n local N1,Np,OUT,i,j,pattern,replac e_string,pos,str1,str2,line,n_repl,Text,repflag;\n#################### ###########################\noptions `Copyright (c) 2002-2008 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved.`;\ndescription \+ `Last revised: December 20, 2007`;\n################################## #############\nif nops(pat_list) <> nops(rep_list) then \n error \" Need two lists of equal length, or two blank lists if no replacements \+ are to be made!\" \nend if:\n######################################### ######\nif member(\"\",pat_list) then\n error \"first list cannot co ntain an empty string\"\nend if;\n#################################### ###########\nif evalb(nops(pat_list)>0 and pat_list<>rep_list) then\n \+ n_repl:=[seq(0,i=1..nops(pat_list))]; \n repflag:=true;\nelse \+ \n n_repl:=[];\n repflag:=false;\nend if;\n################### ############\n##Reading file in first \n############################# ##\nText:=[];\nwhile true do \n line:=readline(`in_file`);\n if line = 0 then break end if:\n Text:=[op(Text),line];\nend do:\n########## #####################\n##Make replacements if needed:\n############### ################\nif repflag then\n for i from 1 to nops(Text)-1 do\n for j from 1 to nops(pat_list) do\n pattern:=pat_list[j];\n \+ replace_string:=rep_list[j];\n if not evalb(pattern=replace_s tring) then\n Np:=length(pattern);\n if abs(Np - lengt h(replace_string)) > 5 then\n error \"Strings %1 and %2 oug ht to be of the same length or within 5 characters\", pattern,replace_ string\n end if: \n while true do\n N1:=leng th(Text[i]);\n line:=cat(Text[i],Text[i+1]);\n pos :=SearchText(pattern,line,1..length(line));\n #\n \+ if pos = 0 then break end if:\n #\n n_repl:=subsop (j=n_repl[j]+1,n_repl);\n str1:=line[1..pos-1];\n \+ if pos+Np <= length(line) then \n str2:=line[pos+N p..-1];\n else \n str2:=\"\";\n end i f:\n line:=cat(str1,replace_string,str2); \n Tex t:=subsop(i=line[1..N1],Text);\n Text:=subsop(i+1=line[N1+1. .-1],Text);\n end do:\n end if;\n end do:\n end do:\n end if;\n#####################\n##Write new file with or without repla cements:\n#####################\nOUT:=fopen(out_file,WRITE,TEXT);\nfor i from 1 to nops(Text) do\n writeline(OUT,Text[i]); \nend do:\nclo se(OUT);\nreturn n_repl;\nend proc:\n " }}{PARA 0 "" 0 "" {TEXT -1 13 "7. Procedure " }{TEXT 261 16 "change_helpfiles" }{TEXT -1 770 " automatically copies all Maple help pages *.mws from \"dir_in\" speci fied as string, for example, \"C:\\\\Maple10\\\\P10\\\\test1\\\\\", to a different directory \"dir_out\" also specified as a string, for exa mple, \"C:\\\\Maple10\\\\P10\\\\test2\\\\\". It can replace string pat terns specified as a list 'pat_list' of strings with strings listed in a list 'rep_list'. Both lists must be of equal length, or they can be empty. If the lists are empty, no replacements are made. This procedu re uses optional 5th and 6th argument, each of type \"string\". When u sed, the substring specified as the 5th argument in the name of the fi le currently processed is replaced with string entered as the last 6th argument. This way, replacements can be made at the same time that th e file names are changed.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 2090 "ch ange_helpfiles:=proc(dir_in::\{string,name\},dir_out::\{string,name\}, pat_list::list(\{string,name\}),rep_list::list(\{string,name\}))\n \+ local dir1,dir2,N,dir_list,fileold,filenew,changenamefla g,makerepflag,file:\n###############################################\n options `Copyright (c) 2002-2008 by Rafal Ablamowicz and Bertfried Fau ser. All rights reserved.`;\ndescription `Last revised: December 20, 2 007`;\n###############################################\ndir1,dir2:=dir _in,dir_out;\n########################################\nif nops(pat_li st)<>nops(rep_list) then\n error \"pattern and replacement lists mus t be of equal length\"\nend if;\n##################################### ###\nif nops(pat_list)>0 then makerepflag:=true else makerepflag:=fals e end if:\n########################################\nchangenameflag:=f alse:\nif nargs=6 then\n if not type(args[5],string) or not type(a rgs[6],string) then\n error \"arguments 5 and 6, when used, mus t be strings, e.g., %1 and %2\",\"_M5\",\"_M6\"\n end if;\nchangen ameflag:=true:\nend if:\n########################################\ndir _list:=get_dir(dir1);\n########################################\nfor f ile in dir_list do\nfileold:=file:\nif changenameflag then filenew:=ch ange_name(fileold,args[5],args[6])\n else filene w:=file\nend if; \nN:=replace_in_file(cat(dir1,fileold),cat(dir2,fi lenew),pat_list,rep_list):\nmakerepflag:=evalb(pat_list<>rep_list):\ni f makerepflag and changenameflag then\n printf(\"processing file %s \+ renamed as %s with replacement(s): %a\\n\",fileold,filenew,N)\nelif ma kerepflag and not changenameflag then\n printf(\"processing file %s \+ without renaming but with replacement(s): %a\\n\",fileold,N);\nelif no t makerepflag and changenameflag then\n printf(\"processing file %s \+ renamed as %s without replacements\\n\",fileold,filenew)\nelse\nprintf (\"processing file %s without renaming and without replacements - just copying\\n\",fileold,filenew)\nend if;\nend do:\nprintf(\"*********** ************\\n\");\nprintf(\"finished processing %d files\\n\",nops(d ir_list));\nprintf(\"***********************\\n\");\nNULL \nend proc: \n" }}{PARA 0 "" 0 "" {TEXT -1 13 "8. Procedure " }{TEXT 262 8 "get_TE XT" }{TEXT -1 97 " reads a file \"FILE\" and puts it into a TEXT(line 1,line2,...) format needed by INTERFACE_HELP. \n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 540 "get_TEXT:=proc(FILE) local textobject,line;\n####### ########################################\noptions `Copyright (c) 2002- 2008 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved.`; \ndescription `Last revised: December 20, 2007`;\n#################### ###########################\n textobject := NULL; \n line := readlin e(FILE); \n while line <> 0 do \n if length(line) <= 10 then \n \+ line := ``||line||` `: \n fi;\n textobject := textobject, \+ line:\n line := readline(FILE):\n od; \n textobject := TEXT(texto bject):\nend:\n" }}{PARA 0 "" 0 "" {TEXT -1 13 "9. Procedure " }{TEXT 265 8 "makeLIST" }{TEXT -1 40 " makes a list of data entries needed by " }{TEXT 266 16 "insert_helppages" }{TEXT -1 154 " to insert help pag es into the HDB and the browser. In particular, it automatically creat es a list of aliases that later can be modified by the procedure " } {TEXT 271 10 "modifyLIST" }{TEXT -1 537 ". It takes four arguments:\n \nmodulename - name of the module as a `symbol`\nparent - the name of \+ the Parent as a `symbol`\ngrandparent - the name of the GrandParent as `symbol`\nLDIR - it is either a list of strings with topic entries su ch as, for example, [\"&cco\",\"&cco_d\"], or a directory where *._M11 .mws files are stored\nversion - it is a string that gives the current version of Maple, e.g., \"M11\". It is expected that the file names * ._M11.mws will contain the same string. If not, error message is retur ned and the process is stopped\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 2880 "makeLIST:=proc(modname::\{symbol,name\},parent::\{symbol,name\}, grandparent::\{symbol,name\},LDIR::\{list(string),name,string\},versio n::string) \n local modulename,mainmodulepage,i,N,L,data string,dataentry,Toplevel,stringlist,mem; global typesLIST,convertsLIS T;\n###############################################\noptions `Copyrigh t (c) 2002-2008 by Rafal Ablamowicz and Bertfried Fauser. All rights r eserved.`;\ndescription `Last revised: December 20, 2007`;\n########## #####################################\nif not assigned(typesLIST) then error \"global variable `typesLIST` has not been assigned a list\" en d if;\nif not assigned(convertsLIST) then error \"global variable `con vertsLIST` has not been assigned a list\" end if;\nif nops(typesLIST)> 0 then\n if not type(typesLIST,list(string)) then\n error \"glo bal list `typesLIST` must be either empty or it must contain strings\" \n end if\nend if;\nif nops(convertsLIST)>0 then\n if not type(con vertsLIST,list(string)) then\n error \"global list `convertsLIST` must be either empty or it must contain strings\"\n end if\nend if; \n###############################################\nif type(LDIR,\{name ,string\}) then\n stringlist:=get_dir(LDIR);\n###################### #######################\n for datastring in stringlist do\n if evalb(SearchText(version,datastring)=0) then\n error \"filen ame %1 in the directory %2 does not match Maple version %3 - process i s aborted!!!\",datastring,LDIR,version;\n end if;\n end do:\n# ############################################ \n stringlist:=map(c hange_name,stringlist,cat(\"_\",version,\".mws\"),\"\");\n############ #################################\n ###########modify by adding \"ty pe\"\n if nops(typesLIST)>0 then\n for i from 1 to nops(stringl ist) do\n mem:=stringlist[i]: \n if member(mem,types LIST) then \n stringlist:=subsop(i=cat(\"type\",\",\",mem) ,stringlist);\n end if;\n end do;\n end if;\n ###### #####modify by adding \"convert\"\n if nops(convertsLIST)>0 then\n \+ for i from 1 to nops(stringlist) do\n mem:=stringlist[i]: \n if member(mem,convertsLIST) then \n stringlis t:=subsop(i=cat(\"convert\",\",\",mem),stringlist);\n end if; \n end do;\n end if;\n######################################### ####\nelse\n stringlist:=LDIR;\nend if:\n########################### ##################\nmodulename,mainmodulepage:=split(`,`,Parent);\nmod ulename:=modname;\n#############################################\nL:=[ ]:\nfor datastring in stringlist do\n if convert(datastring,name)=m ainmodulepage then\n Toplevel:=grandparent\n else\n Top level:=parent\n end if;\n dataentry:=convert(datastring,name);\n L:=[op(L),[cat(modulename,`,`,convert(dataentry,name)),\n \+ Toplevel,\n [cat(convert(modulename,string),\",\",d atastring),datastring]]]\nend do;\nreturn L;\nend proc:" }}{PARA 0 "" 0 "" {TEXT -1 14 "10. Procedure " }{TEXT 267 10 "modifyLIST" }{TEXT -1 84 " can be used to replace \"aliases\" that are automatically gene rated by the procedure " }{TEXT 268 8 "makeLIST" }{TEXT -1 232 " for e ach help topic to be inserted into the browser. In the data entry for \+ each help topic, the third entry is a list of aliases [\"alias1\",\"al ias2\",...]. This list is then replaced with the third argument of typ e 'list(string)' to " }{TEXT 269 11 "modifyLIST " }{TEXT -1 83 "and th e procedure returns a new complete list. The original list remains unc hanged." }{TEXT 270 1 "\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 628 "modif yLIST:=proc(Lp::listlist,topic::symbol,newaliases::list(string)) local item,flag,i,newentryp,L,newitem;\n################################### ############\noptions `Copyright (c) 2002-2008 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved.`;\ndescription `Last revised: \+ December 20, 2007`;\n###############################################\n L:=Lp:\nflag:=false:\nfor i from 1 to nops(L) while not flag do\n f lag:=evalb(op(1,L[i])=topic);\nend do;\nif flag=false then \n error \+ \"topic %1 has not been found in the entered list\",topic;\nend if;\nn ewitem:=subsop(3=newaliases,L[i-1]);\nreturn subsop(i-1=newitem,L); \n end proc:\n" }}{PARA 0 "" 0 "" {TEXT -1 14 "11. Procedure " }{TEXT 263 17 "insert_help pages" }{TEXT -1 108 " takes a list of file names \+ with help topics and inserts them into Maple browser and HDB Database \+ entries. \n" }}{PARA 15 "" 0 "" {TEXT -1 219 "This procedure puts the \+ below listed help pages into a maple.hdb help-page-database. These are the official help pages for the CLIFFORD, Bigebra, Cliplus, GTP, Octo nion modules. It uses the following global path names:\n" }}{PARA 15 " " 0 "" {TEXT -1 234 "HDB_LIB_PATH : The path to a directory in the Ma ple search path (not the path of the Maple.hdb database in .../lib Thi s pathname is here taken from libname, and has to be added to libname \+ in any case to be able to use the help pages." }}{PARA 15 "" 0 "" {TEXT -1 49 "HELP_FILE_PATH : The location of the help pages. " }} {PARA 15 "" 0 "" {TEXT -1 100 "BROWSER_PATH: The location in the Mapl e Help Page Browser at which the Package should be 'mounted'." }} {PARA 15 "" 0 "" {TEXT -1 42 "Parent: The Package name or any help top ic" }}{PARA 15 "" 0 "" {TEXT -1 66 "GrandParent: The Clifford package, (location in the Help Browser)\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 2638 "insert_helppages:=proc(LIST) local Text,delim,x,lst,name,topic,b rowser_path,File,MODULE; global HDB_LIB_PATH, HELP_FILE_PATH, BROWSER_ PATH;\n###############################################\noptions `Copyr ight (c) 2002-2008 by Rafal Ablamowicz and Bertfried Fauser. All right s reserved.`;\ndescription `Last revised: December 20, 2007`;\n####### ########################################\nfor x in LIST do\n#printf(\" Inserting topic %s and reading file:\",x[1]);\n if (SearchText(`/`, x[1],1..length(x[1])) <> 0 ) then\n lst:=[split(`/`,x[1])];\n \+ name :=lst[-1..-1];\n topic := ``;\n delim := ``; \n \+ while(lst <> []) do\n topic := cat(topic,cat(delim,lst[1]));\n \+ lst:=lst[2..-1];\n delim:=`,`;\n od; \n browse r_path:=cat(BROWSER_PATH,x[1]);\n elif (SearchText(`,`,x[1],1..leng th(x[1])) <> 0 ) then\n lst:=[split(`,`,x[1])];\n name :=lst [-1..-1];\n topic:=x[1];\n browser_path:=BROWSER_PATH;\n \+ delim:=``;\n while(lst <> []) do\n browser_path:=cat(bro wser_path,cat(delim,lst[1]));\n lst:=lst[2..-1];\n delim :=`/`;\n od; \n else\n topic:=x[1];\n name :=x[1];\n browser_path:=cat(BROWSER_PATH,topic);\n fi;\n name:=op(na me);\n############################################\nif nargs=1 then \+ \n File:=cat(HELP_FILE_PATH,cat(name,\".mws\")):\nelif nargs=2 then \n if not type(args[2],string) then \n error \"second optional \+ argument must be a string giving Maple version included in file names, e.g. %1\",\"M6\"\n else \n File:=cat(HELP_FILE_PATH,cat(name,\"_ \",args[2],\".mws\")):\n end if;\nend if;\n######################### ###################\n###HELP_FILE = cat(HELP_FILE_PATH,cat(name,\".m ws\")),\n############################################\n MODULE[x[1] ]:=table( [\n NAME = name,\n PARENT = x[2],\n TOPIC \+ = topic,\n HELP_FILE = File,\n ALIASES= x[3],\n ACTIV E = `true`,\n BROWSER_LOC = browser_path,\n LIB = HD B_LIB_PATH\n ]);\n ##\n ## get TEXT\n printf(\"Trying to r ead file %s...\\n\",File); ###for testing\n Text:=get_TEXT(File); \+ \n ##\n ## put into DB\n######################################## ############\nprintf(\"Success... inserting topic %s from the file:\", x[1]);\nprint(MODULE[x[1]][HELP_FILE]);\nprint(INTERFACE_HELP('insert' ,'topic'=topic,'text'=Text,helpfile=HDB_LIB_PATH,'aliases'=x[3],'activ e'=false) );\nprint(INTERFACE_HELP('insert','topic'=topic,'browser'=br owser_path,helpfile=HDB_LIB_PATH) );\nod:\nprintf(\"****************** *****\\n\");\nprintf(\"Finished inserting %d file topics into the HDB \+ and Browser\\n\",nops(LIST));\nprintf(\"***********************\\n\"); \nNULL \n \nend:\n" }}{PARA 0 "" 0 "" {TEXT -1 13 "1. Procedure " } {TEXT 272 5 "setup" }{TEXT -1 16 " for the module " }{TEXT 273 12 "cod e_support" }{TEXT -1 128 " defines two conversion functions that conve rt directory names from \"string\" form to `name` (or `symbol`) form, \+ and vice versa.\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 1603 "setup:=proc( ) global `convert/string_dir_to_symbol_dir`,`convert/symbol_dir_to_str ing_dir`;\n###############################################\noptions `C opyright (c) 2002-2008 by Rafal Ablamowicz and Bertfried Fauser. All r ights reserved.`;\ndescription `Last revised: December 20, 2007`;\n### ############################################\n`convert/symbol_dir_to_s tring_dir`:=proc(dir::\{symbol,string\}) local T,i,dir1,linuxflag;\nif type(dir,string) then return dir end if;\nlinuxflag:=evalb(SearchText (`\\\\`,dir)=0);\nif linuxflag then return convert(dir,string) end if; \nT:=remove(member,[split(\"/\",convert(dir,string))],\{\"\"\});\ndir1 :=cat(T[1],\"\\\\\"):\nif nops(T) >1 then\n for i from 2 to nops( T) do dir1:=cat(dir1,T[i],\"\\\\\") end do:\nend if;\nreturn dir1;\nen d proc:\n###############################################\n`convert/str ing_dir_to_symbol_dir`:=proc(dir::\{symbol,string\}) local T,i,dir1,li nuxflag;\nif type(dir,symbol) then return dir end if;\nlinuxflag:=eval b(SearchText(`\\\\`,dir)=0);\nif linuxflag then return convert(dir,sym bol) end if;\nT:=remove(member,[split(\"\\\\\",convert(dir,string))], \{\"\"\});\ndir1:=cat(T[1],\"\\\\\",T[2],\"\\\\\"):\nif nops(T)>2 then \n for i from 3 to nops(T) do dir1:=cat(dir1,T[i],\"/\") end do: \nend if;\nreturn convert(dir1,name);\nend proc:\n#################### ###########################\nprint(``);\nprint(`Module code_cupport ve r. 1.03 for CLIFFORD et al. for Maple 11`);\nprint(`Copyright (c) 2002 -2008 by Rafal Ablamowicz and Bertfried Fauser. All rights reserved.`) ;\nprint(`Last revised: December 20, 2007`);\nprint(``);\n############ ###################################\nend proc:\nend module:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 11 "libname[1];" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#Q7C: \\Maple11/Cliffordlib6\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "savelib(code_support);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 " with(LibraryTools);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#72%1ActivationM oduleG%1AddFromDirectoryG%'AuthorG%'BrowseG%3BuildFromDirectoryG%/Conv ertVersionG%'CreateG%'DeleteG%,FindLibraryG%,PrefixMatchG%)PriorityG%% SaveG%-ShowContentsG%*TimestampG%4UpdateFromDirectoryG%*WriteModeG" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "ShowContents(libname[1]);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#7;7&Q*Bigebra.m6\"7(\"%2?\"#7\"#?\" \")\"#\"#\\\"'o2J\"$x$7&Q/code_support.mF &7(F2F3F<\"#AF<\"#C\"(wx4\"\"$*[7&Q)Define.mF&7(F(F)F*F+\"#9\"#d\"'>P? \"$$[7&Q>P.mF&7(F(F)F*F+\"#`\"#@\"'sqC\"$\"G7&Q&GfG.mF&7(F2\"\"$\"\" (F4\"#=F5\"'Awt\"%[87&Q+matcompL.mF&7(F(F)F*F+\"#8FJ\"')zi'\"&=X(7&Q+m atquatR.mF&Fin\"'S7u\"&I?#7&Q+matrealR.mF&Fin\"'^rU\"'Wj67&Q+Octonion. mF&7(F(F)F*F+FK\"\"%\"'X7m\"$P%7&Q,RJgrobner.mF&7(F(F)F*F+\"#f\"#]\"'h **f\"%]57&Q5SINGULARPLURALlink.mF&7(F2F4\"#:\"#;\"#SFD\"'or@\"$-$7&Q+S churFkt.mF&7(F2F3F_AlternatingGroup_rem_ta ble.mF&7(F2F3FepF,F^qF5\"(o$45\"%@77&Q:_FiniteGroups_rem_table.mF&Fcq \"(A5,\"\"%'H#7&Q6_Reynolds_rem_table.mF&Fcq\"(*e55\"$L%7&Q<_Symmetric Group_rem_table.mF&Fcq\"(%325\"%%G#7&QA_generateGinvariants_rem_table. mF&Fcq\"(=L,\"\"$#>7&Q<_implicitbezierpolynomial.mF&7(F(F)F*\"\"*\"\"! FR\"'xVD\"&@7\"7&Q+matcompR.mF&Fin\"'.\"G$\"&^M(7&Q+matquatL.mF&Fin\"' -&o#\"&9@#7&Q+matrealL.mF&Fin\"&')f\"\"'9k67&Q%SP.mF&7(F(F)F*Fir\"#I\" #G\"'UkK\"%867&Q&TNB.mF&7(F2FXF]tF,\"#HFep\"'t%3%\"$,)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "restart:with(code_support);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%!G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%inModule~code_c upport~ver.~1.03~for~CLIFFORD~et~al.~for~Maple~11G" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#%apCopyright~(c)~2002-2008~by~Rafal~Ablamowicz~and~Be rtfried~Fauser.~All~rights~reserved.G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%@Last~revised:~December~20,~2007G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%!G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7-%/NamesInLibraryG%1change_ helpfilesG%,change_nameG%*copy_fileG%)get_TEXTG%(get_dirG%1insert_help pagesG%)makeLISTG%+modifyLISTG%0replace_in_fileG%&splitG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "NamesInLibrary(libname[1]);" }} {PARA 12 "" 1 "" {XPPMATH 20 "6;Q*Bigebra.m6\"Q+Clifford.mF$Q*Cliplus. mF$Q)Define.mF$Q>P.mF$Q&GfG.mF$Q+Octonion.mF$Q,RJgrobner.mF$Q5SINGUL ARPLURALlink.mF$Q%SP.mF$Q+SchurFkt.mF$Q&TNB.mF$Q>_AlternatingGroup_rem _table.mF$Q:_FiniteGroups_rem_table.mF$Q6_Reynolds_rem_table.mF$Q<_Sym metricGroup_rem_table.mF$QA_generateGinvariants_rem_table.mF$Q<_implic itbezierpolynomial.mF$Q/code_support.mF$Q+matcompL.mF$Q+matcompR.mF$Q+ matquatL.mF$Q+matquatR.mF$Q+matrealL.mF$Q+matrealR.mF$" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 0 {PARA 0 "" 0 "" {TEXT 287 9 "See Also:" }{TEXT 288 1 " " }{HYPERLNK 17 "code_support, exampl es" 2 "code_support,examples" "" }{TEXT 289 1 "\n" }{TEXT -1 0 "" }} {PARA 258 "" 0 "" {TEXT -1 122 "(c) Copyright 2002-2008, by Rafal Abla mowicz & Bertfried Fauser, all rights reserved.\nLast modified: June 1 9, 2008, RA/BF." }}}}{MARK "16 1 0" 114 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }