History of changes for major release of versions of MathPad MathPad 2.6.5 Changes New Capabilities: * Graphics can be pasted into the text window. * An updating date label can be added to the plot. * Improved handling of very large arrays. * Improved table formatting. Bug Fixes: * read() BYT1 format optional parameters now work. * Ylabel now properly positioned with axisbox on. * command-. during save dialog now does a cancel. * fixed crash on arrow key with no open window. * fixed crash on command-. during long plot redraw. * fixed crash on eval of empty file. * text window left margin problems reduced. --------------- Details, Details --------- -- The manual has been updated to include features of version 2.6.5. ----- Graphics in text -- MathPad now allows graphics to be pasted into the text of the worksheet. This is intended as a way of including sketches or diagrams that help explain and document the calculation. -- The graphics will only be visible when the file is viewed by MathPad. MathPad files can still be read by other text editors but the graphics will not be shown. The graphics are stored in the resource fork and they will be lost if the file is transfered to a non-mac file system. ----- Datelabel -- There is now a plot option to add an automatically updating date label in the upper right corner of the plot window. This is a convienient way of documenting when a particular plot was printed or saved. The option can be turned on or off via the plot control variable "Datelabel" or via a check box in the preferences dialog. ----- Large Arrays -- There has been a minor change to the memory management code for array assignments that should allow storing very large arrays (>100Mb). MathPad doesn't have any explicit size limit for arrays and under OS-X large amounts of memory can be allocated. There are still practical limits but that will depend on the particular system. -- The image command now allows very large arrays. Arrays with dimensions larger than 3000 are reduced to 3000 by undersampling. ----- Table Formatting -- The default formatting has been changed slightly to make it look a bit nicer in general. Table output is now right justified in a width of 8 spaces with tabs separating multiple columns. -- A special variable "Nspaces" has been added to allow changing the field width. Nspaces can be set to anything between -60 and +60. Negative numbers give left justified fields. There is a tab inserted between columns so that the table can be copied and pasted into a spreadsheet. -- A special variable "Tabwidth" has been added to allow changing the tab width in points from within the source text. This has the same effect as setting the tab width via the Preferences... dialog. ----- Minor Tweaks -- The Save As... dialog default location is now set to the original file path for the document. For new documents it is set to the path of the previously opened document if any. -- There is a WASTE bug that sometimes causes the text left margin to be lost. A partial work-around was added that reduces the occurrence of this problem. If it does happen, the margin can be restored by clicking the window resize box. -- Now allows "non breaking" option-space in text --------------------------------------------------------------------- MathPad 2.6.4 Changes New Capabilities: * Improved source file import * Improved data file import/export * Scrollwheel support * Higher Xsteps limit * Access to Xlo Xhi Ylo Yhi plot values * More label statements allowed * Option for plot axis box * New scripting event to hide windows * QTmovie XFun now creates a data fork movie for easier export Bug Fixes: * minimize to dock now expands back * read() of FLT4 data now works properly * fixed compatability problems with some print drivers --------------- Details, Details --------- The manual has been updated to include features of version 2.6.4. --- Source Files MathPad can now open generic unix text files if they are named with a .txt or .mp extension. OS-X sometimes creates files without any type information. These files are associated with an application by the extension. Adding the extension .mp will tell the Finder to treat the file as a MathPad document. Files created by MathPad will be recognized and do not need to use extensions. The .mp extension may be useful for files created by other applications or files that have been transferred from other systems. --- Data Files Some new capabilities have been added to the read() and write() functions. Please see the "datafiles" section of the manual for information. Two new binary data file types have been added. The INT4 type allows reading and writing 32-bit integers. The FLT8 type allows reading and writing 64-bit floating point. Three optional parameters have been added to read(). These allow for more efficient handling of large data files. The general read call is now: read(fname[,fmt,col,len,skip,intvl]) The write() function now allows an optional format parameter to directly specify the output file type. write(fname,array[,fmt]) The speed of a write() from an assigned array has been improved. ---- Xsteps Increasing Xsteps provides a more accurate plot of functions with steep slopes or discontinuities. The default has been increased to 400 and the limit has been increased to 30000. It is unlikely that values as large as 30K will be needed but with fast processors, calculating a larger number of points becomes more practical. ---- Xlo Xhi Ylo Yhi Plot control variables Xlo Xhi Ylo Yhi have been added. They can be used to provide initial axis limits for cases where the plot takes some time to draw. If these variables are used with autoranging, they set the initial axis. The axis will be redrawn to the actual range when the trace is complete. They can also be used to access the computed values for the trace after each plot statement. ---- Labels Previously the number of label plus slabel statements was limited to about 25. Now the number is essentially unlimited. However, the initial placement location will not change after about 50. ---- Axisbox There is now an option to have a box drawn around all four sides of the plot. It can be controlled by the Preferences dialog or by the special variable Axisbox = on. ---- AppleEvents A new custom event "hide" has been added. This event causes MathPad to supress showing windows. It may be useful for scripting MathPad as background only task. ---- QTmovie A new version of the QTmovie XFun creates a flattened data fork movie file. This format is easier to export to other systems and works with web browsers. Previously movie files had to be "flattened" by a separate utility program in order to be usable on a web server. ---- viewsurf A new version of the viewsurf XFun moves its SURFACE view window to the front after each call. This avoids problems where the window isn't visible because it gets buried behind other windows. ---- Printing Some changes have been made to the plot printing routines to improve compatibility with some printers. If you were having difficulty with scaling of printed plots, this version may improve things. The only noticeable difference to most users will be slightly thicker lines. ------------------------------------------------------- MathPad 2.6.3 Changes New capabilities: * OS-X native * Improved text editing * Improved data file import * Print option to control size of plot * Improved speed for some calculations This version is mainly an update to allow MathPad to run native under OS-X. It is a "Carbon" application and it can be run under OS 8 or 9 if Carbonlib is installed. The menus have been re-arranged slightly to be more OS-X style. XFuns for version 2.5 or earlier WILL NOT WORK. MathPad 2.6 uses WASTE text handling routines that bring some general improvements to text editing. The major changes are tabs, better undo support and no 32K size limit. Some changes have been made to allow easier import of data files created by other programs. * TEXT data files allow trailing whitespace * TEXT data files allow either unix or mac line terminators * A new file format 'BYT1' allows reading or writing individual bytes * Two optional parameters have been added to the read() function read(filename,format,cols) format -- overrides file type. "TEXT","INT2","FLT4" or "BYT1" cols -- overrides the file's dimension information A new "%#s" format for sprintf() has been added to allow an array of character values to be packed into a string. chars = {116,117,101,115} sprintf("%#s",chars):"tues" ---- Additions to the Preferences... dialog: Tab width -- Tabs can be used in MathPad documents. This option allows you to set the tab width in points. The default tab width is 36 which is 6 spaces in monaco 9-pt. Plot: Print as sized -- Checking this box causes the plot to print at the current plot window size instead of re-sizing to fit the page. Write file type: 'BYT1' -- Allows writing individual bytes. --------------------------------------------------------------- MathPad 2.5.2 Changes New capabilities: * Syntax coloring * Graphics export to formats such as JPEG * Direct control of plot trace color and markers * Text string manipulation * Edit menu item "Balance" helps match parens etc. * Function menu inserts example parameter names * Chained conditionals can be written as a < == != >= <= ) are now allowed in any expression. One effect of this is that the restriction against using parens in "when" or "while" conditions has been removed. MathPad now uses the C convention that any expression can be used as a boolean. Non-zero values mean true, 0 means false. The result of a comparison operator will be 0 for false and 1 for true. The == form of the equal comparison operator must usually be used to avoid confusion. a=2 a when 1=1:2; -- '=' as comparison is still allowed here a == 1+1:1; -- '==' is required here {1,2,3,4,5} == {5,4,3,2,1}:{0,0,1,0,0} {1,1,1,0,0} and {0,1,0,1}:{0,1,0,0,0} {1,1,1,0,0} or {0,1,0,1}:{1,1,1,1,?} ------ The reserved word "Radians" can be used to do trig calculations that are independent of the Degrees/Radians menu option choice. The value of Radians is 1 when radians are selected and 57.3 when degrees are selected. cos(pi*Radians):-1; -- -1 for either Degrees/Radians setting ------ The zoom box now sets the window to the current printer page aspect. This allows a sort of print preview so you can position labels appropriately for printout. Option zoom will expand the window to the full screen. ------ MathPad now supports minimal AppleEvents so it can be controlled by AppleScript etc. To provide a quick and dirty means of scripting batch plots, the PrintDocuments event will open the document, evaluate it and then print the plot. ------ Background processing has been changed to take smaller time slices. This means that running MathPad in the background should cause a less noticeable load on your system. Also the plot window now stays visible during background processing. In some cases it will defer updating until it finishes processing. ------ MathPad now automatically converts UNIX (LF) or PC (CRLF) line terminators to Mac (CR) format when it reads in a document. This makes it easier to handle text files from other machines or from web browsers that don't know how to save Mac text files. ------------------------------------------------------------------------ MathPad 2.3 Changes New capabilities: * The "newaxis" command allows multiple plots on one page. * Text font and size can be changed for the text or plot windows. * More markers for point plots. * Plot variables for controlling axis divisions. * Plot variables for axis labels. * Special file "defaults" can be used to set default options. * Allows "pi" or option-p. * Built in atan2(). * Improved speed for array assignments. * New XFun callbacks SetPlotPICT() GetVarString(). * An XFun for linear fitting is available. Bug Fixes: * Fixed bug in assign element. * Fixed bug in det(). * Change for quoted strings avoids variable name conflicts. New documentation: * The file "MathPad.doc" remains essentially the same but has been revised to update it for version 2.3. * The file "Plotting" has been added. * Examples and Xfuns have been updated slightly. ----------- Version 2.3 details --------- ---- The "newaxis" command can be used to put more than one set of axes on a page. The plot control variables can be changed with := following a "newaxis". Xmin=0; Xmax=2; Ymin=0; Ymax=2 plot X newaxis Xmin:=-1:; Ymax:=?: plot X^2 -- Plot control variables will inherit values from the previous strip unless you change them with :=. All changes to plot control variables must appear before the first plot statement for the new axis. The Xlabel and Ylabel variables can be changed by using := with a quoted string. To enable auto-ranging you can now "undefine" a variable with the syntax Ymin:=? -- Splitting and shrinking the plot for each new strip is annoying when re-evaluating the same file. To avoid this, it starts by assuming the same number of strips will be used as last time. You can override this by using the special variable "Ystrips" to tell it how many strips you will have. -- The default X origin for strips has been moved over so that for reasonably small Y axis labels, all the strips X axes will stay lined up. If a Y axis does need more space it will move over. To keep the alignment you can specify a Ylabel for each strip containing enough blanks to force alignment. -- Label statement default placement is in the upper left part of the page regardless of where they appeared in the text. They can still be moved via the mouse. The label placement coordinate system has changed slightly so existing documents may need their labels re-adjusted. Moveable label locations are based on the full page and will not change if the number of strips changes. -- A PICT pasted into the plot will be shown the same in all strips. (XFuns can put different PICTs in each strip). ---- MathPad 2.3 allows changing the text and/or plot font and size. The Edit menu will change the font or size of the top window. MathPad still does not have particularly sophisticated font handling. Fonts/sizes other than monaco 9 point may have some alignment problems. Resource STR# 129 can be edited to change the default fonts & sizes (used for documents with no saved font info). If you move a document with saved font info to a different system, any unknown fonts will revert to Chicago. ---- Point plots now cycle through 5 different symbols for different traces. This helps distinguish traces on BW monitors. ---- Special variables Xdiv and Ydiv were added to provide more control over plot axis tics. If these variables are used they override the automatic axis. They specify the distance between labeled tics in data units. The axis label format still assumes that "nice" divs (at most 2 digits of precision) will be used. This means that a div like .2 or .25 will work but a div of .234 will have rounded tic labels. ---- The special variables "Xlabel","Ylabel" and "Title" can now be used to add documentation to plots. The plot size is adjusted to make room for these labels if they are present. If newaxis is used Xlabel and Ylabel can be changed for each strip. Title is used only once at the top of the page. ---- MathPad now checks in its application folder for a file named "defaults". If one is found it is used as stationery for all new documents. This allows setting radians, numeric format, fonts window sizes etc. Create a MathPad document with whatever you want for defaults. (You will have to evaluate a plot to set plot window options). Normally you would delete all the text but default text is allowed. Save the file as "defaults" in MathPad's folder. If you prefer, you can use system 7 Finder to set the file's stationery flag. MathPad doesn't care but it might remind you of its special status. ---- The symbol "pi" can now be used as an alternative to the option-p character. This was done to allow plain text MathPad documents. ---- Despite the fact that atan2() isn't really a "basic" trig function, it is very useful. Making it built in allows it to handle the degree/radian switch correctly. MathPad does an extra check to avoid the -0 peculiarity of the SANE routines. MathPad will return +90 for atan2(sin(90),cos(90)). SANE routines would return -90. Since atan2() is now built in, any existing files with definitions for atan2() will have to have those definitions removed. --------------------------------------------------------------------------- MathPad 2.2 Changes New capabilities: * An "include" command allows definitions to be read from another file. * Externally compiled add-in functions. * Assignments to array elements. * Incremental evaluation. * The command "plotline" now also works for {x,y} arrays. * Plot option for adding grid lines. * Plot option for suppressing info line on printout. * The rand() function has been improved. * Extended keyboard support. * Hex input. * Handles data file aliases. * Enter Selection command for Find. * Page Setup information is now saved with the document. Bug Fixes: * MathPad now has an Apple registered creator signature code. * The semantics of expression list/when clause is more natural. * More error checking. * Several obscure minor bugs fixed. New documentation: * The file "MathPad.doc" remains essentially the same but has been revised to update it for version 2.2 * The file "Programming" has been added to give some extra hints about assignments and iteration. * The examples have been rearranged to take advantage of include files. Utility definitions have been made into small include files and separated from the examples that use them. * The "minimize" example has been changed slightly to make it compatible with version 2.2. * A new example "Poisson" and its associated include file "histogram" illustrate a use of the rand() function. The histogram include file illustrates assignment to array elements and provides a handy utility for statistical analysis. * A new example "root finder" gives a simple algorithm to search for roots of an equation. * A new example "RLC circuit" uses complex numbers to calculate the frequency response of a circuit. * The folder "xfun kit" contains examples and documentation on adding externally compiled functions to MathPad. One example Xfun implements a histogram function similar to the histogram include file. If you want to try it simply drag the "histogram" Xfun file into the folder containing the MathPad application. (If MathPad is already running you must quit and re-launch it to see the XFun). ---------- Version 2.2 details --------- ------ Creator change MathPad's creator signature has been changed to avoid a conflict with a program called MuPAD from the university of Paderborn Germany. The new signature has been registered with Apple so it will not need to be changed again. This change does cause some inconvenience. It means that if you double-click on an old MathPad document the Finder will not know that it should launch MathPad 2.2. Old documents can still be opened by drag and drop (or from within MathPad) and when they are saved their signature will be updated. If you want to round up all your old files and change them at once, there are several utilities that can change file type/creator info. MathPad's old signature is 'MPAD' its new one is 'MPad'. A small application called MathPad Converter is included in this distribution (Thanks to Dan Harasty for whipping up this app using MakeAutoTyper by Daniel Azuma). You can drag and drop a group of files or entire folders on this application and it will update the signature of any old MathPad docs it finds. To avoid confusion you should make sure you have removed all old versions of the MathPad application. If you have an old MathPad document in your Apple Menu Items folder, you should move it out of the folder, change its signature and then move it back in. ------- "when clause" change The semantics of comma separated expression lists has changed slightly. Most users will not notice this change but it is possible that some existing documents will not work under version 2.2 due to this change. In version 2.2 the value of the first true "when" clause will be used even if the value itself is undefined. Previous versions would continue processing in the case where the value was undefined. zz when 1=1,42:42.00 -- version 2.1 will give 42 if zz is undefined zz when 1=1,42:? zz? -- version 2.2 reports an error if zz is undefined In cases involving assignments it is sometimes desirable to have evaluation of a sequence continue even if a true when clause is encountered. In these cases a double comma can be used to specify that evaluation should continue. zz when 1=1,,42:42.00 -- version 2.2 will give 42 regardless of zz ------ New error checking A few new error checks have been added that may affect some working 2.1 documents. There is now a check to prevent confusion between a sum index variable and a global variable of the same name. term = 2*k-1 -- legal global use of sum index sum(term,k,1,4):16.000 k=2 -- illegal redefinition of k k:=2 -- illegal assignment to k If version 2.2 reports an error involving a sum index variable, simply change the name of the global or the index. Different calls to sum() can use the same variable name. It is only the conflict with globals that is a problem. ------ include Definitions in one file can now be shared by other files. A document containing the command include "filename" will open and read definitions from the specified file. The folder of the source document will be searched first and then the folder containing the MathPad application. Full or relative path names are allowed. You may want to make a folder containing your favorite include files and put it in MathPad's folder. Then any document can access them with a short relative path name. A window is opened for each included file. This file can be viewed and edited like any other MathPad document. Any changes made will be seen by the parent document when the parent is reevaluated. Include files should contain only definitions. They can contain other include commands. ------ Externally compiled functions MathPad XFun files placed in the same folder as the application will be added to the function menu. This allows programmers to add functions written in C and compiled as code resources. Items can also be added to MathPad's Help menu. See the folder "xfun kit" for more information. ------ Assignments to array elements Assignments to elements are now permitted in restricted cases. A single value can be assigned to an element of an array that has previously been initialized by assignment. A := {{1,2,3,4},{5,6,7,8}}: A[1,2] := 0: A:{{1,0,3,4},{5,6,7,8}} A[1] := {10,20,30,40} -- is not allowed because it is not a single value B = {1,2,3,4,5} B[2] := 0 -- is not allowed because B has not been assigned to ------- Incremental evaluation MathPad normally evaluates the entire document when the enter key is pressed. This allows you to edit anything anywhere in the text and have everything updated properly. Version 2.2 tries to take advantage of the fact that usually when text is added at the very end of the document no changes are needed in the part of the document that has already been evaluated. Version 2.2 will hold off on reevaluating text that has been successfully evaluated. This can be handy if you wish to examine a variable without having to reevaluate an entire plot or image. Any edit other than at the very end of the document will cause the entire document to be reevaluated on the next enter. If you wish to force reevaluation you can use command R instead of enter. One reason for this might be if you plot something using auto ranging and then later add specifications for Xmin etc. Also, if you hit enter without changing anything in the file it will reevaluate. ------- plotline The plotline command can now be used to connect the points for any array plot. For {x,y} plots the points are connected in the order that they appear in the array. An undefined point causes the pen to be lifted. The pen is put down when the next defined point is found. If a single defined point is surrounded by undefineds it will not be plotted. ------- New Plotting options The Options... dialog now has a check box to turn on grid lines for the plot. (The color of the grid lines can be changed with ResEdit by changing 'ppat' resource 128). The Options... dialog now has a check box to enable or suppress printing of the status line at the bottom of the plot. The default is to suppress the info line. The info line will always appear on the screen. This option only affects printout and copy to the clipboard. ------- rand() This function still uses the toolbox random number generator but it now uses 31 bits from randseed which gives it more than 10^9 possible values. The first time rand() is called after program startup the random number generator will be seeded with the current tick count. This means that rand() will give a different sequence each time a document is evaluated even if you quit and re-start MathPad. Calling rand(0) can still be used to start the sequence at a known place. ------- Extended keyboard The home, end, page-up and page-down keys on extended keyboards will duplicate the action of the scroll bars. The del key will duplicate the action of the delete key. ------- Hex input MathPad will now accept hexadecimal numbers as integer input. Hex numbers must be preceded by 0x as in 0xAF23. Hex input is treated as a bit pattern for a 32-bit signed integer. ------- Page Setup MathPad will now save page setup information with the document. Note that there is only one page setup saved per document so if you use a different setup for printing text and printing the plot only the last one used will be saved. ------- Bug fixes Here is a reasonably complete list of bugs in version 2.1.5 that have been fixed in version 2.2.7. * Sometimes crashed if command-period was hit just before start of plotting. * File names over 63 chars caused crash. Now limits names to 63 chars. * Clipping of offscale data by plotline was calculated incorrectly. * Image Z click information was incorrect for large (>32K element) images. * First plot info click sometimes resulted in drawing extra lines. * Plot click sometimes refused to find a point on dense array plots. * Paste into dialog fields did not work properly. * Arrow key scroll did not update scrollbars. * Extended keyboard "del" key caused invisible char. Now converts to delete. * Unterminated ~ comment sometimes inserted an invisible nul char. * Menu meta chars such as '(' in filename confused Windows menu. * Plot did not always perform 1st evaluation at Xmin. * Parametric plot stepped X by 1/nsteps rather than 1/(nsteps-1). * A[i]= whatnot; A:=1 gave improper definition for A. It is now illegal. * plot X; X:={1}; plot 2*X could cause erratic behavior. It is now illegal. * Xmin[i] = 1 dim[2]; plot X caused bug alert message. * F={1}; f(n)=F[n]; f(0) caused bug alert message. * table xpr, caused bug alert message. * Option space key confused parser. Now causes no input. * Sometimes printed text one char past end of buffer. * det() of all zero matrix reported an error. Now returns 0. * Stop sound forced PowerBooks to spin up disk on command period. * Some file open errors caused bug alert message. -------------------------------------------------------------------- MathPad 2.1 Changes New capabilities: * A new command "image" displays 2D arrays as grayscale or color images. See the file "Image.doc" for more details. * A new command "plotline" specifies line plots for 1D arrays. * Sub arrays can be selected using the syntax [lo:hi]. * The table command can now automatically print a 1D or 2D array. * The read and write functions have been improved and now support binary formats. See the file "Datafiles.doc" for more details. * Background computation. * PICTs can be pasted into the plot window. Bug Fixes: * det() no longer crashes for undefined arrays. * dim[] no longer crashes on a recursive dimension expression. * A while loop can now be stopped with command period. * The parser now correctly recovers from some "missing expression" syntax errors that had previously caused problems. * Scroll bar oddities fixed. * The read function now works on system 6 with or without Multifinder. Documentation changes: * The file "MathPad.doc" has been updated to include examples of version 2.1 features. * The files "Image.doc" and "Datafiles.doc" have been added. * A new example "Complex Roots" gives formulas for quadratic and cubic roots and shows using the image command to visualize a complex function. * The example "Navigation" now uses a PICT and has been changed to improve its speed. -------------------------------------------------------------- MathPad 2.0 Changes MathPad 2.0 keeps the same small memory requirement but adds several refinements and new capabilities since version 1.5. See the file "MathPad.doc" for details on how to use the new features. New capabilities: * Support for general purpose arrays allows calculations involving vectors, complex numbers, matrix algebra etc. * A built-in determinant function allows solutions of systems of equations. * Read and write functions allow import and export of large data sets. * Support for iteration allows more efficient implementation of some algorithms including numerical solution of differential equations. * The table command now allows multi column tables. * A random number function is now built-in . New plotting features: * The plot command can now plot points from an array * Support for parametric plots: x(t) vs. y(t) * Optional autoranging * A mouse click in the plot window now gives the coordinates of the nearest plotted point instead of re-evaluating the function. * Plot clicks show the trace number. * The "label" statement implements auto updating plot labels User interface refinements: * Multiple open documents are allowed. * A zoom box is implemented for the text and plot window. * The cursor switches to I-beam when in the text window. Convenience features: * An online help file can be opened as a separate window. * Long expressions can be continued on the next line by putting a return after an operator or a comma. * The Edit menu now has a text search "Find..." command. * An '=' at the end of a line is converted to a ':' (Beginning users often guess that '=' is used to ask for the answer). * Text after ':' is deleted before re-evaluation in more cases. (Editing sometimes leaves trailing results which are now cleaned up before re-evaluation). * Evaluation does not auto scroll the cursor into view unless there is an error. * The '#' character can be used to refer to the last result. * A less verbose error printout is used for unknowns. * The '~' character can be used to delimit multi-line comments Compatabillity issues: Documents made with MathPad 1.5 will probably work fine with 2.0. There are however, some differences that could cause confusion: * Assertions and multiple definitions of the same variable are no longer allowed. This feature was rarely used and became impractical with the addition of arrays. * The table command does not automatically include a column for N. To get equivalent behavior "table f(N)" would be re-written as "table N,f(N)". * Version 1.5 allowed square brackets [] for comments. They are now reserved for array indexing. Version 2.0 uses '~' for block comments. * Version 2.0 autoranges plots when no value is given for Xmin, Xmax, Ymin, and Ymax. Version 1.5 defaulted plot ranges to 0.0 to 1.0. * Built-in names for new functions could conflict with existing user variable names. New reserved names: det dim label rand read while write.