{VERSION 5 0 "IBM INTEL NT" "5.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 "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 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 "" 1 18 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 }{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 "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 4 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 2" -1 4 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 8 2 1 0 1 0 2 2 0 1 }{PSTYLE "Warning" -1 7 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 2 2 2 2 2 1 1 1 3 1 } 1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Error" -1 8 1 {CSTYLE "" -1 -1 " Courier" 1 10 255 0 255 1 2 2 2 2 2 1 1 1 3 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Maple Output" -1 11 1 {CSTYLE "" -1 -1 "Times" 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 "Maple Plot" -1 13 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 "Normal" -1 256 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 }} {SECT 0 {EXCHG {PARA 256 "" 0 "" {TEXT -1 0 "" }}{PARA 256 "" 0 "" {TEXT 256 13 "Using Maplets" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 31 "Fi rst load the Maplets package." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "wi th(Maplets[Elements]):\nwith(StringTools):\nwith(plots):" }}{PARA 7 " " 1 "" {TEXT -1 58 "Warning, the assigned name Group now has a global \+ binding\n" }}{PARA 7 "" 1 "" {TEXT -1 50 "Warning, the name changecoor ds has been redefined\n" }}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 13 "Basic Maplets" }}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 14 "Dialogue Boxes" }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 54 "First define a Maplet using the In putDialog framework." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 189 "with(Maple ts[Elements]):\ngetInt:=Maplet(\n InputDialog['ID1'](\"Enter an inte ger\",\n 'onapprove'=Shutdown(['ID1']),\n 'oncancel'=Shutdow n()\n )\n):\nresult:=Maplets[Display](getInt);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%'resultG7#Q!6\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 69 "To access the string, reference the first element of the list. i.e ., " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "valStr:=result[1];\n" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%'valStrGQ#106\"" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 64 "To get the actual value of the string use the pars e( ) function " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "parse(valStr);\nt ype(%,integer);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"#5" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#%%trueG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "?InputDialog" }}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 7 "Plotter" } }{EXCHG {PARA 0 "" 0 "" {TEXT -1 41 "USe a Plotter to create simple 2- D plots." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 229 "mjs2d := Maplet([\n \+ [\"Enter a function of 'x':\", \n TextField['TF']() ],\n [Plotter ['PL']( plot(undefined, x = 0..10) ) ],\n [Button(\"Plot\", Evaluate ('PL' = 'plot('TF', x = 0..10)') ), Button(\"OK\", Shutdown(['TF'] ))]\n]):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "Maplets[Display ](mjs2d);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7#Q)x*sin(x)6\"" }}}} {SECT 0 {PARA 4 "" 0 "" {TEXT -1 10 "Drop Boxes" }}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 300 "beerList:=[\"Labatts\",\"Moosehead\",\"Brador \",\"Molson\"]:\npickBeerBox := Maplet([\n [\"Pick your favorite Can adian beer: \",\n DropDownBox['DDB1']( \n sort(beerList, le xorder) \n )],\n [Button(\"OK\", Shutdown(['DDB1'])), \n B utton(\"Cancel\", Shutdown()) ]\n]):\nMaplets[Display](pickBeerBox);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7#Q'Brador6\"" }}}}{SECT 0 {PARA 4 " " 0 "" {TEXT -1 7 "Sliders" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 281 "with(Maplets[Elements]):\nmjsSlider:= Maplet([\n [\"Select a va lue: \", \n Slider['SL'](0..100, 10, \n 'showticks', 'majorticks '=20, \n 'minorticks'=10, 'snapticks'=false)],\n [Button(\"OK\", \+ Shutdown(['SL'])), \n Button(\"Cancel\", Shutdown())]\n]):\nMaplets [Display](mjsSlider);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7#Q#106\"" }} }}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 21 "Custom File Dialogues" }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 69 "First define a procedure which cal ls a Maplet that uses the built-in " }{TEXT 257 10 "FileDialog" } {TEXT -1 81 " method. The string parameter passed to the Maplet sets t he title for the window." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 329 "aosGet File:= (filterStr::string)->\nMaplets[Display](\n Maplet(FileDialo g['FD'](\n 'title' = cat(\"Get a \", filterStr,\" File\"),\n \+ 'filefilter' = filterStr, \n 'filterdescription' = c at(filterStr,\" Files\"),\n 'onapprove' = Shutdown(['FD']),\n 'oncancel' = Shutdown()\n )\n )\n): " }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 122 "Now call the procedure with a par ticular string and then read the entire contents of the file using the readbytes command." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 98 "filePath:=ao sGetFile(\"html\")[1]:\nfileContent:=readbytes(filePath,TEXT,infinity) :\nfclose(filePath):" }}{PARA 8 "" 1 "" {TEXT -1 34 "Error, invalid su bscript selector\n" }}{PARA 8 "" 1 "" {TEXT -1 55 "Error, (in readbyte s) file or directory does not exist\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 56 "Echo the file path and content to the screen as follows: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "filePath;\nfileContent;" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#Q7C:\\aos\\html\\basic.html6\"" }} {PARA 12 "" 1 "" {XPPMATH 20 "6#Qb_l~~~~~~|+~~~~~~
|+~~~~~~ ~~~~~~|+~~~~~~~~~~~~~~~~~~Hello~world,~please|+~~~ ~~~~~~~~~~~~~~~|+~~~~~~~~~~~ ~~~~~~~~~~~~~send~me~mail|+~~~~~~~~~~~~~~~~~~!|+~~~~~~~~~~~~
|+ ~~~~~~|+~~~~~~|+6\"" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 16 "Function Plotter" }}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 27 "A Simp le Plotting Procedure" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 179 "Define a procedure which accepts an algebraic function of the variable 'x' and a string. The function is plotted along with a title and options, whi ch includes the input function." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 162 "simplePlot:=proc(fx::algebraic,tStr::string)\n plot(fx,x=0..10,axes= boxed,\n labels=[\"x\",\"f(x)\"],\n title=cat(tStr,\"\\n\",con vert(simplify(fx),string))):\nend:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 79 "A typical call to the function will produce output similar to t hat shown below:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "simplePlot(x*co s(x),\"My Title\");" }}{PARA 13 "" 1 "" {GLPLOT2D 503 265 265 {PLOTDATA 2 "6'-%'CURVESG6$7io7$$\"\"!F)F(7$$\"3emmm;arz@!#=$\"3(G%[SK #R\"G@F-7$$\"3[LL$e9ui2%F-$\"373*HnW!GUPF-7$$\"3nmmm\"z_\"4iF-$\"3!)>g H*[\">]]F-7$$\"39ommT&phN)F-$\"3c;\"p7y^Yg&F-7$$\"3KLLe*=)H\\5!#<$\"3h =qh)[!RF_F-7$$\"3smm\"z/3uC\"FB$\"3'\\)[\"p0ES'RF-7$$\"3!****\\7LRDX\" FB$\"36gr&4^GPr\"F-7$$\"3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