(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 4.0, MathReader 4.0, or any compatible application. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 151154, 2883]*) (*NotebookOutlinePosition[ 152238, 2923]*) (* CellTagsIndexPosition[ 152194, 2919]*) (*WindowFrame->Palette*) Notebook[{ Cell[BoxData[GridBox[{ { ButtonBox[ StyleBox["Help", "Subsection", ShowStringCharacters->True, FontColor->RGBColor[0, 0.500008, 0]], ButtonFunction:>CompoundExpression[ NotebookPut[ Notebook[ { Cell[ CellGroupData[ { Cell[ TextData[ {"ButtonTools 2.0.4 ", ButtonBox[ "(Mertig Research & Consulting)", ButtonData :> { URL[ "http://www.mertig.com"], None}, ButtonStyle -> "Hyperlink"]}], "Subtitle"], Cell[ CellGroupData[ { Cell[ "Tools for manipulating Notebooks and the Front \ End", "Section 1"], Cell[ TextData[ { "This version should be used only with ", StyleBox[ "Mathematica", FontSlant -> "Italic"], " 4.0, though some buttons will also work in \ 3.0."}], "Text"]}, Closed]], Cell[ CellGroupData[ { Cell[ "Legal notice and Credits", "Section 1"], Cell[ "For the moment all Butons of ButtonTools are \ free software. You may use and redistribute, but not sell it.\nIf you find \ any problems you may write me an email but I may ignore you (unless you pay \ for my time \[HappySmiley]).", "Text"], Cell[ " THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND \ CONTRIBUTORS \"AS IS\" AND\n ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, \ BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS \ FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR \ CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, \ EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, \ PROCUREMENT OF SUBSTITUTE GOODS\n OR SERVICES; LOSS OF USE, DATA, OR \ PROFITS; OR BUSINESS INTERRUPTION)\n HOWEVER CAUSED AND ON ANY THEORY OF \ LIABILITY, WHETHER IN CONTRACT, STRICT\n LIABILITY, OR TORT (INCLUDING \ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n OUT OF THE USE OF THIS \ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n", "Text"], Cell[ TextData[ { "Credits: \n\nJURL is based on the \ NotebookOpenURL and the GetURL function from J/Link as described in section \ 1.3.3 of the J/Link manual by Todd Gayley to be found at ", ButtonBox[ "http://www.wolfram.com/solutions/mathlink/\ jlink", ButtonData :> { URL[ "http://www.wolfram.com/solutions/mathlink/\ jlink"], None}, ButtonStyle -> "Hyperlink"], ".\n\nThe FrontEnd dialog in BRP is based on \ a program by John Novak."}], "Commentary"]}, Closed]], Cell[ CellGroupData[ { Cell[ "October 27 2000, Rolf Mertig", "Section 1"], Cell[ TextData[ { "These buttons were developed over the last \ year for working quicker with the ", StyleBox[ "Mathematica", FontSlant -> "Italic"], " front end and for producing buttons with \ functional (side) effects quick and easy.\nWhile most buttons do work in ", StyleBox[ "Mathematica", FontSlant -> "Italic"], " 3.0 it is advised (at least on X) to use ", StyleBox[ "Mathematica", FontSlant -> "Italic"], " 4."}], "Text"], Cell[ TextData[ {"All buttons except ", Cell[ BoxData[ StyleBox[ ButtonBox[ StyleBox[ "BRP", "Section", FontColor -> GrayLevel[ 1]], ButtonEvaluator -> None, Background -> RGBColor[ 0.20000000000000001, 0.40000000000000002, 0]], FontColor -> RGBColor[ 0, 0, 1]]], ShowGroupOpenCloseIcon -> True], ", ", Cell[ BoxData[ ButtonBox[ StyleBox[ "CN", "Subsubsection"], Background -> RGBColor[ 0, 0.80000000000000004, 0.90000800000000003]]], ShowGroupOpenCloseIcon -> True], ", ", Cell[ BoxData[ ButtonBox[ StyleBox[ "Q", FontFamily -> "Helvetica", FontWeight -> "Bold", FontColor -> GrayLevel[ 1]], ButtonFunction :> Quit[ ], ButtonEvaluator -> Automatic, Background -> GrayLevel[ 0]]], CellMargins -> {{Inherited, Inherited}, {7, Inherited}}, PageBreakAbove -> True, LineSpacing -> {1.25, 0}, ScriptMinSize -> 9, CounterIncrements -> "Text", StyleMenuListing -> None, FontFamily -> "Courier"], " and ", Cell[ BoxData[ ButtonBox[ StyleBox[ "GV", "Subsubsection", ShowStringCharacters -> True, FontColor -> RGBColor[ 0, 0.50000800000000001, 0]], ButtonFunction :> Module[ {}, CompoundExpression[ If[ Not[ MatchQ[ NotebookInformation[ System`Private`$\ GlobalValueDisplayNotebook], { BlankSequence[ Rule]}]], Set[ System`Private`$\ GlobalValueDisplayNotebook, NotebookPut[ Notebook[ {}, WindowTitle -> "Values", WindowMargins -> {{0, Automatic}, {0, Automatic}}, WindowSize -> {250, 444}]]], SetSelectedNotebook[ System`Private`$\ GlobalValueDisplayNotebook]], SelectionMove[ System`Private`$\ GlobalValueDisplayNotebook, All, Notebook], NotebookWrite[ System`Private`$\ GlobalValueDisplayNotebook, Prepend[ Map[ Cell[ BoxData[ StringJoin[ "? ", #]], "Input", GeneratedCell -> False]&, Select[ Names[ "Global`*"], UnsameQ[ Function[ {y}, { Apply[ DefaultValues, y], Apply[ NValues, y], Apply[ SubValues, y], Apply[ DownValues, y], Apply[ OwnValues, y], Apply[ UpValues, y], Apply[ FormatValues, y]}][ ToExpression[ #, StandardForm, Hold]], {{}, {}, {}, {}, {}, {}, \ {}}]&]], Cell[ TextData[ "variables with values:"], "Text"]], After]]], ButtonEvaluator -> Automatic]], GeneratedCell -> True], " work on the selected notebook. I.e., first \ click on the notebook you want to act on with the button."}], "Text"], Cell[ TextData[ { Cell[ BoxData[ ButtonBox[ StyleBox[ "JURL", "Subsection", ShowStringCharacters -> True, FontFamily -> "Helvetica", FontWeight -> "Bold", FontColor -> RGBColor[ 0, 0.40000000000000002, 1]], Background -> GrayLevel[ 1]]], ShowGroupOpenCloseIcon -> True], " and ", Cell[ BoxData[ ButtonBox[ "URL", ButtonEvaluator -> Automatic]], NotebookDefault, CellTags -> "GeneratedButtonBoxURL"], " work on a selected string (in a Text or \ similar non-math cell). The resulting hyperlink from appliation of the ", Cell[ BoxData[ RowBox[ { ButtonBox[ StyleBox[ "JURL", "Subsection", ShowStringCharacters -> True, FontFamily -> "Helvetica", FontWeight -> "Bold", FontColor -> RGBColor[ 0, 0.40000000000000002, 1]], Background -> GrayLevel[ 1]], " "}]]], " button will only work if J/Link (see ", ButtonBox[ "http://www.wolfram.com/solutions/mathlink/\ jlink", ButtonData :> { URL[ "http://www.wolfram.com/solutions/mathlink/\ jlink"], None}, ButtonStyle -> "Hyperlink"], " ) is properly installed."}], "Text"], Cell[ "Notice: most buttons below are \"crippled\" \ (i.e. the ButtonFunction settings removed) in order to save space.", "Commentary"]}, Open]], Cell[ CellGroupData[ { Cell[ BoxData[ ButtonBox[ StyleBox[ "JURL", "Subsection", ShowStringCharacters -> True, FontFamily -> "Helvetica", FontWeight -> "Bold", FontColor -> RGBColor[ 0, 0.40000000000000002, 1]], Background -> GrayLevel[ 1]]], "Section", ShowGroupOpenCloseIcon -> True], Cell[ TextData[ Cell[ BoxData[ ButtonBox[ StyleBox[ "JURL", "Subsection", ShowStringCharacters -> True, FontFamily -> "Helvetica", FontWeight -> "Bold", FontColor -> RGBColor[ 0, 0.40000000000000002, 1]], Background -> GrayLevel[ 1]]], ShowGroupOpenCloseIcon -> True]], "Text"], Cell[ TextData[ { "Credits: JURL is based on the \ NotebookOpenURL and the GetURL function from J/Link as described in section \ 1.3.3 of the J/Link manual by Todd Gayley to be found at ", ButtonBox[ "http://www.wolfram.com/solutions/mathlink/\ jlink", ButtonData :> { URL[ "http://www.wolfram.com/solutions/mathlink/\ jlink"], None}, ButtonStyle -> "Hyperlink"], "."}], "Commentary"], Cell[ TextData[ {"Select a URL to a ", StyleBox[ "Mathematica", FontSlant -> "Italic"], " notebook or .m file in a text cell, e.g.:\n\ http://www.feyncalc.com/Contract/Contract.nb\nThen click on the ", Cell[ BoxData[ ButtonBox[ StyleBox[ "JURL", "Subsection", ShowStringCharacters -> True, FontFamily -> "Helvetica", FontWeight -> "Bold", FontColor -> RGBColor[ 0, 0.40000000000000002, 1]], Background -> GrayLevel[ 1]]], ShowGroupOpenCloseIcon -> True], "button.\nThis produces a hyperlink which \ when clicked on will fetch the notebook Contract.nb with the help of J/Link, \ which has to be properly installed, see, e.g., : ", ButtonBox[ "http://www.wolfram.com/solutions/mathlink/\ jlink", ButtonData :> { URL[ "http://www.wolfram.com/solutions/mathlink/\ jlink"], None}, ButtonStyle -> "Hyperlink"], ", save the notebook to the directory as \ specified by the ", StyleBox[ "Mathematica", FontSlant -> "Italic"], " global variable $TemporaryPrefix (i.e., \ /tmp/ for Unix and C:\\TEMP\\ for Windows)"}], "Text"]}, Closed]], Cell[ CellGroupData[ { Cell[ TextData[ Cell[ BoxData[ ButtonBox[ "URL", ButtonEvaluator -> Automatic]]]], "Section", ShowGroupOpenCloseIcon -> True], Cell[ TextData[ { "Select a URL of the form \ http://www.mertig.com or rolf@mertig.com or ftp://ftp.nluug.nl in a text \ cell, then click on the ", Cell[ BoxData[ ButtonBox[ "URL", ButtonEvaluator -> Automatic]]], " button. This will produce a hyperlink of \ the form: \n\nCell[TextData[ButtonBox[\"http://www.mertig.com\",\n \ ButtonData:>{\n URL[ \"http://www.mertig.com\"], None},\n \ ButtonStyle->\"Hyperlink\"]], \"Text\",\n GeneratedCell->True]\n"}], "Text"]}, Closed]], Cell[ CellGroupData[ { Cell[ BoxData[ StyleBox[ ButtonBox[ StyleBox[ "BRP", "Section", FontColor -> GrayLevel[ 1]], ButtonEvaluator -> None, Background -> RGBColor[ 0.20000000000000001, 0.40000000000000002, 0]], FontColor -> RGBColor[ 0, 0, 1]]], "Section", ShowGroupOpenCloseIcon -> True], Cell[ "This button initializes the BRP[ expr ] \ function. BRP[expr] can be used as a break point in programs. It will open a \ new notebook window with the value of anyexpression in it. The flow of the \ program is interrupted, until the OK button in the new notebook is pressed.", "Text"], Cell[ "Furthermore the following symbols are colored \ when a cell is converted to StandardForm (i.e., there are MakeBoxes rules on \ those symbols).", "Text"], Cell[ TextData[ { StyleBox[ "*Notebook*", FontColor -> RGBColor[ 0.20000000000000001, 0, 1]], StyleBox[ " *Select*", FontColor -> RGBColor[ 1, 0.40000000000000002, 0]], StyleBox[ " *Cell*", FontColor -> RGBColor[ 0.40000000000000002, 0.59999999999999998, 0]], StyleBox[ "\nDo", FontSize -> 18, FontColor -> RGBColor[ 0, 0.40000000000000002, 0]], StyleBox[ ", ", FontColor -> RGBColor[ 0, 0.40000000000000002, 0]], StyleBox[ "Block", FontSize -> 18, FontColor -> RGBColor[ 0, 0.40000000000000002, 0]], StyleBox[ ", ", FontColor -> RGBColor[ 0, 0.40000000000000002, 0]], StyleBox[ "Module", FontSize -> 18, FontColor -> RGBColor[ 0, 0.40000000000000002, 0]], StyleBox[ "\nFrontEndExecute BrowserCategory \ TaggingRules", FontSize -> 18, FontSlant -> "Italic", FontColor -> RGBColor[ 0.59999999999999998, 0.80000000000000004, 0.100008]]}], "Text"]}, Closed]], Cell[ CellGroupData[ { Cell[ BoxData[ ButtonBox[ "PG"]], "Section", ShowGroupOpenCloseIcon -> True], Cell[ "\"Program Generator\" : All Cells of type \ \"Program\" in a section are exported to an ASCII file with the name of the \ section heading.\nE.g.: Save the notebook which you get by executing", "Text"], Cell[ "NotebookPut[Notebook[{Cell[\"test.ssc\", \ \"Section\"], \n Cell[\"testfun <- function(x) print(2*x)\", \ \"Program\"]}]];", "Input"], Cell[ "Click on it with the PG button which will write \ a file test.ssc to the same directory where the notebook is stored.", "Text"]}, Closed]], Cell[ CellGroupData[ { Cell[ BoxData[ ButtonBox[ "SD"]], "Section", ShowGroupOpenCloseIcon -> True], Cell[ "Click on a notebook. Hitting SD will change the \ kernel directory (Directory[]) to the directory where the notebook is saved.", "Text"]}, Closed]], Cell[ CellGroupData[ { Cell[ BoxData[ ButtonBox[ StyleBox[ "F2B", "Subsection", ShowStringCharacters -> True, FontColor -> RGBColor[ 0, 0.20000000000000001, 0.80000000000000004]], Background -> RGBColor[ 1, 0.70000799999999996, 0]]], "Section", ShowGroupOpenCloseIcon -> True], Cell[ "Function to Button. This is useful to generate \ buttons with special ButtonFunction settings from a notebook.", "Text"], Cell[ "Create a Subsubsction Cell and place a function \ (e.g. NotebookCreate[]) in an input cell.", "Text"], Cell[ CellGroupData[ { Cell[ "name", "Subsubsection"], Cell[ BoxData[ RowBox[ {"NotebookCreate", "[", "]"}]], "Input"], Cell[ TextData[ { "Select the cells (or inside the Cell \ group) and click on", Cell[ BoxData[ ButtonBox[ StyleBox[ "F2B", "Subsection", ShowStringCharacters -> True, FontColor -> RGBColor[ 0, 0.20000000000000001, 0.80000000000000004]], Background -> RGBColor[ 1, 0.70000799999999996, 0]]], ShowGroupOpenCloseIcon -> True], ". This will create a cell:"}], "Text"], Cell[ BoxData[ ButtonBox[ "name", ButtonFunction :> NotebookCreate[ ], ButtonEvaluator -> Automatic]], NotebookDefault, GeneratedCell -> True], Cell[ "which looks unformatted like:\nCell[BoxData[\ \n ButtonBox[\"name\",\n ButtonFunction:>NotebookCreate[ ],\n \ ButtonEvaluator->Automatic]], NotebookDefault,\n GeneratedCell->True]", "Text"], Cell[ TextData[ { "Furthermore a button is automatically \ created from this cell.\nTo compose several of these buttons into a palette \ copy the created cells in a notebook an click on ", Cell[ BoxData[ ButtonBox[ StyleBox[ "HP", "Subsubsection", ShowStringCharacters -> True, FontColor -> RGBColor[ 0.59999999999999998, 0, 0.20000000000000001]]]], GeneratedCell -> True], " (horizontal palette) or ", Cell[ BoxData[ ButtonBox[ StyleBox[ "VP", "Subsubsection", ShowStringCharacters -> True, FontColor -> RGBColor[ 0.59999999999999998, 0, 0.20000000000000001]]]], GeneratedCell -> True], " (vertical palette)."}], "Text"]}, Closed]]}, Closed]], Cell[ CellGroupData[ { Cell[ BoxData[ StyleBox[ ButtonBox[ StyleBox[ "CN", "Subsection", ShowStringCharacters -> True], ButtonEvaluator -> Automatic, Background -> RGBColor[ 0.40000000000000002, 0.59999999999999998, 1]], Background -> RGBColor[ 0.40000000000000002, 0.59999999999999998, 1]]], "Section", ShowGroupOpenCloseIcon -> True], Cell[ TextData[ { "Clear notebooks, i.e., close all Untitled- \ notebooks. (This will not work in ", StyleBox[ "Mathematica", FontSlant -> "Italic"], " 3.0 version for X)."}], "Text"]}, Closed]], Cell[ CellGroupData[ { Cell[ BoxData[ ButtonBox[ "CP", ButtonFunction :> CompoundExpression[ NotebookPut[ NotebookGet[ InputNotebook[ ]]]], ButtonEvaluator -> Automatic]], "Section", ShowGroupOpenCloseIcon -> True], Cell[ TextData[ { "Notebook copy; i.e., make an identical copy \ of the selected notebook (up to the Windows title). (Since there is a bug in \ the X-version of ", StyleBox[ "Mathematica", FontSlant -> "Italic"], " the WindowMargins are not the same; on \ other platforms the copied notebook will be placed exactly on top of the \ selected notebook)."}], "Text"]}, Closed]], Cell[ CellGroupData[ { Cell[ BoxData[ RowBox[ { ButtonBox[ StyleBox[ "HP", "Subsubsection", ShowStringCharacters -> True, FontColor -> RGBColor[ 0.59999999999999998, 0, 0.20000000000000001]]], ",", " ", ButtonBox[ StyleBox[ "VP", "Subsubsection", ShowStringCharacters -> True, FontColor -> RGBColor[ 0.59999999999999998, 0, 0.20000000000000001]]]}]], "Section", ShowGroupOpenCloseIcon -> True], Cell[ "Create horizontal and vertical palettes.", "Text"], Cell[ TextData[ {"See notes in", Cell[ BoxData[ ButtonBox[ StyleBox[ "F2B", "Subsection", ShowStringCharacters -> True, FontColor -> RGBColor[ 0, 0.20000000000000001, 0.80000000000000004]], Background -> RGBColor[ 1, 0.70000799999999996, 0]]], ShowGroupOpenCloseIcon -> True]}], "Text"]}, Closed]], Cell[ CellGroupData[ { Cell[ BoxData[ ButtonBox[ StyleBox[ RowBox[ {"150", "%"}], "Subsubsection"], ButtonFunction :> CompoundExpression[ FrontEndExecute[ { FrontEndToken[ InputNotebook[ ], "Magnification", "1.5"]}], Null], ButtonEvaluator -> Automatic]], "Section", ShowGroupOpenCloseIcon -> True], Cell[ "Change the magnification of the selected \ notebook. (This saves at least one click on most platforms ..., and since (at \ least for me) this is a FOC (frequently occuring click) it is worthwile \ having).", "Text"]}, Closed]], Cell[ CellGroupData[ { Cell[ BoxData[ ButtonBox[ StyleBox[ "Cl", FontFamily -> "Helvetica", FontWeight -> "Bold", FontColor -> GrayLevel[ 1]], ButtonFunction :> CompoundExpression[ NotebookClose[ InputNotebook[ ]]], ButtonEvaluator -> Automatic, Background -> RGBColor[ 0.80000000000000004, 0, 0]]], "Section", ShowGroupOpenCloseIcon -> True], Cell[ TextData[ {"This close the selected notebook ", StyleBox[ "without", FontSlant -> "Italic"], " asking. Therefore, be sure to have clicked \ on the right notebook to close ..."}], "Text"]}, Closed]], Cell[ CellGroupData[ { Cell[ BoxData[ ButtonBox[ StyleBox[ "Qu", "Subsection", ShowStringCharacters -> True, FontFamily -> "Helvetica", FontWeight -> "Bold", FontColor -> GrayLevel[ 0]], ButtonFunction :> CompoundExpression[ Quit[ ]], ButtonEvaluator -> Automatic, Background -> GrayLevel[ 1]]], "Section", ShowGroupOpenCloseIcon -> True], Cell[ "This quits the kernel.", "Text"]}, Closed]], Cell[ CellGroupData[ { Cell[ BoxData[ ButtonBox[ "ZWT", ButtonFunction :> CompoundExpression[ SelectionMove[ InputNotebook[ ], All, Cell], SetOptions[ NotebookSelection[ InputNotebook[ ]], ZeroWidthTimes -> Not[ Part[ Options[ NotebookSelection[ InputNotebook[ ]], ZeroWidthTimes], 1, 2]]]], ButtonEvaluator -> Automatic]], "Section", ShowGroupOpenCloseIcon -> True], Cell[ "This will set the option ZeroWithTimes -> True \ on the selected Cell(s). This is extremely useful when you want to get the \ spacing right in inline cells. The reason is that RowBox has a very \ inconvenient and undesirable default of putting multiplication spaces between \ its elements, which is in general of course nonsense.", "Text"]}, Closed]], Cell[ CellGroupData[ { Cell[ BoxData[ ButtonBox[ "ENB", ButtonFunction :> CompoundExpression[ SelectionMove[ InputNotebook[ ], Before, Notebook], SelectionMove[ InputNotebook[ ], All, Notebook], SelectionEvaluate[ InputNotebook[ ]], SelectionMove[ InputNotebook[ ], After, Notebook]], ButtonEvaluator -> Automatic]], "Section", ShowGroupOpenCloseIcon -> True], Cell[ "This evaluates the whole notebook. (functionally \ the same as using the Kernel / Evaluation / Evaluate Notebook menu item).", "Text"]}, Closed]], Cell[ CellGroupData[ { Cell[ BoxData[ ButtonBox[ "cd", Background -> RGBColor[ 0.40000000000000002, 0.59999999999999998, 1]]], "Section", ShowGroupOpenCloseIcon -> True], Cell[ "Change kernel directories from notebook.", "Text"], Cell[ TextData[ { "Create a palette with all subdirectories as \ seen from the kernel (Directory[]) listed below the current directory \ (clicking on the top-most green button will move one directory up). The \ palette created should only be used in the current session (i.e., the buttons \ rely on a temporary functions defined in the ", Cell[ BoxData[ ButtonBox[ "cd", Background -> RGBColor[ 0.40000000000000002, 0.59999999999999998, 1]]], ShowGroupOpenCloseIcon -> True], " )."}], "Text"]}, Closed]], Cell[ CellGroupData[ { Cell[ BoxData[ ButtonBox[ RowBox[ {"*", RowBox[ {".", "nb"}]}]]], "Section", ShowGroupOpenCloseIcon -> True], Cell[ "Paste a palette at the insertion point \ consisting of all notebooks (files with file extension .nb) in the current \ kernel directory. Clicking on any of the buttons of the palette will open the \ notebook.", "Text"]}, Closed]], Cell[ CellGroupData[ { Cell[ BoxData[ ButtonBox[ RowBox[ {"*", RowBox[ {".", "m"}]}]]], "Section", ShowGroupOpenCloseIcon -> True], Cell[ "Paste a palette at the insertion point \ consisting of all .m files in the current kernel directory. Clicking on any \ of the buttons of the palette will open the file in a notebook.", "Text"]}, Closed]], Cell[ CellGroupData[ { Cell[ BoxData[ ButtonBox[ RowBox[ {"<<", "*.m"}]]], "Section", ShowGroupOpenCloseIcon -> True], Cell[ "Paste a palette at the insertion point \ consisting of all .m files in the current kernel directory. Clicking on any \ of the buttons of the palette will load the file. This can be used to load \ Add-On packages.", "Text"]}, Closed]], Cell[ CellGroupData[ { Cell[ BoxData[ ButtonBox[ "*"]], "Section", ShowGroupOpenCloseIcon -> True], Cell[ "Paste a palette at the insertion point \ consisting of all files in the current kernel directory. Clicking on any of \ the buttons of the palette will open the file in a notebook.", "Text"]}, Closed]], Cell[ CellGroupData[ { Cell[ BoxData[ ButtonBox[ StyleBox[ "GV", "Subsubsection", ShowStringCharacters -> True, FontColor -> RGBColor[ 0, 0.50000800000000001, 0]]]], "Section", ShowGroupOpenCloseIcon -> True], Cell[ "This creates a palette with all variables in \ the Global` context which have a value (or function definition). In order to \ see the value evaluate the relevant cell.", "Text"]}, Closed]]}, Open]]}, FrontEndVersion -> "4.0 for X", ScreenRectangle -> {{0, 1024}, {0, 768}}, WindowToolbars -> "EditBar", WindowSize -> {807, 654}, WindowMargins -> {{Automatic, 34}, {4, Automatic}}, Magnification -> 1, StyleDefinitions -> "Report.nb"]]], ButtonEvaluator->Automatic], ButtonBox[ StyleBox["JURL", "Subsection", ShowStringCharacters->True, FontFamily->"Helvetica", FontWeight->"Bold", FontColor->RGBColor[0, 0.4, 1]], ButtonFunction:>CompoundExpression[ Module[ {r, nr, r2, r3, r4}, CompoundExpression[ Set[ r, NotebookRead[ InputNotebook[ ]]], If[ Or[ StringMatchQ[ r, "http:/*.m", IgnoreCase -> True], StringMatchQ[ r, "http:/*.nb", IgnoreCase -> True]], CompoundExpression[ Set[ nr, ButtonBox[ r, ButtonEvaluator -> Automatic, ButtonStyle -> "Hyperlink", ButtonNote -> StringJoin[ "Open ", r], With[ { Set[ rr, r]}, ButtonFunction :> CompoundExpression[ Off[ MessageName[ General, "spell1"]], Off[ MessageName[ Get, "noopen"]], Off[ MessageName[ Needs, "nocont"]], Set[ System`Private`checkifjlinkisthere, Needs[ "JLink`"]], If[ SameQ[ System`Private`checkifjlinkisthere, \ $Failed], NotebookPut[ Notebook[ { Cell[ TextData[ { "Please install J/Link. See: ", ButtonBox[ "http://www.wolfram.com/solutions/\ mathlink/jlink", ButtonData :> { URL[ "http://www.wolfram.com/solutions/\ mathlink/jlink"], None}, ButtonStyle -> "Hyperlink"]}], "Subtitle"]}, WindowSize -> {677, 192}, WindowMargins -> {{Automatic, 195}, { Automatic, 118}}, StyleDefinitions -> "NaturalColor.nb"]], CompoundExpression[ On[ MessageName[ Get, "noopen"]], On[ MessageName[ Needs, "nocont"]], SetDelayed[ JLink`OpenRemoteFileAsNotebook[ Pattern[ url, Blank[ String]]], Module[ {rf}, CompoundExpression[ Set[ rf, JLink`RetrieveRemoteFile[ url]], NotebookOpen[ rf]]]], SetDelayed[ JLink`RetrieveRemoteFile[ Pattern[ url, Blank[ String]]], JLink`JavaBlock[ Module[ {u, stream, numRead, outFile, buf, fn, dir}, CompoundExpression[ JLink`InstallJava[ ], Set[ fn, Apply[ StringJoin, Last[ Split[ Characters[ url], And[ UnsameQ[ #, "/"], UnsameQ[ #2, "/"]]&]]]], Set[ outFile, OpenWrite[ StringJoin[ DirectoryName[ StringJoin[ $TemporaryPrefix, "42"]], fn], DOSTextFormat -> False]], Set[ u, JLink`JavaNew[ "java.net.URL", url]], Set[ stream, u[ openStream[ ]]], If[ SameQ[ stream, $Failed], Return[ $Failed]], Set[ buf, JLink`JavaNew[ "[B", 5000]], While[ Greater[ Set[ numRead, stream[ read[ buf]]], 0], WriteString[ outFile, FromCharacterCode[ Take[ JLink`Val[ buf], numRead]]]], stream[ close[ ]], Close[ outFile]]]]], Null]], JLink`OpenRemoteFileAsNotebook[ rr], Null]]]], SetOptions[ NotebookSelection[ InputNotebook[ ]], TaggingRules -> "wwwtag"], Set[ r2, NotebookRead[ InputNotebook[ ]]], SelectionMove[ InputNotebook[ ], All, Cell], Set[ r3, NotebookRead[ InputNotebook[ ]]], Set[ r4, ReplaceAll[ r3, StyleBox[ Pattern[ s, Blank[ ]], TaggingRules :> "wwwtag"] :> nr]], NotebookWrite[ InputNotebook[ ], r4]]]]]], ButtonEvaluator->Automatic, Background->GrayLevel[1]], ButtonBox["URL", ButtonFunction:>CompoundExpression[ Module[ {r, nr, r2, r3, r4}, CompoundExpression[ Set[ r, NotebookRead[ InputNotebook[ ]]], If[ StringQ[ r], CompoundExpression[ If[ StringMatchQ[ r, "*\\@*.*"], Set[ m, True]], If[ Or[ m, StringMatchQ[ r, "*:*.*", IgnoreCase -> True]], CompoundExpression[ Set[ nr, ButtonBox[ r, ButtonData -> { URL[ StringJoin[ If[ m, "mailto:", ""], r]], None}, ButtonStyle -> "Hyperlink"]], SetOptions[ NotebookSelection[ InputNotebook[ ]], TaggingRules -> "wwwtag"], Set[ r2, NotebookRead[ InputNotebook[ ]]], SelectionMove[ InputNotebook[ ], All, Cell], Set[ r3, NotebookRead[ InputNotebook[ ]]], Set[ r4, ReplaceAll[ r3, StyleBox[ Pattern[ s, Blank[ ]], TaggingRules :> "wwwtag"] :> nr]], NotebookWrite[ InputNotebook[ ], r4]]]]]]]], ButtonEvaluator->Automatic], ButtonBox[\(\(\ \)\(PG\)\), ButtonFunction:>Module[ { Set[ spcodestyle, "Program"]}, CompoundExpression[ Set[ opened, {}], SetDelayed[ fixstring[ Pattern[ z, Blank[ String]]], FixedPoint[ StringReplace[ #, {" " -> "", "\n" -> "", "\t" -> "", ":" :> ""}]&, z]], SetDelayed[ strrep[ Pattern[ z, Blank[ ]]], ReplaceAll[ z, Pattern[ s, Blank[ String]] :> StringReplace[ s, {"\[Rule]" -> "->", "\[Null]" -> "", "\[LeftArrow]" -> "<-"}]]], SetDelayed[ openwrite[ Pattern[ z, Blank[ String]]], CompoundExpression[ Set[ op, OpenWrite[ z, PageWidth -> Infinity]], AppendTo[ opened, op], op]], SetDelayed[ closeit, Map[ Close, opened]], SetDelayed[ makestring[ Cell[ TextData[ Pattern[ t1, Blank[ List]]], BlankNullSequence[ ]], Cell[ TextData[ Pattern[ t2, Blank[ List]]], BlankNullSequence[ ]], Pattern[ c, BlankNullSequence[ ]]], makestring[ Cell[ TextData[ Join[ t1, {"\n"}, t2]]], c]], SetDelayed[ makestring[ Pattern[ s, Blank[ String]]], s], SetDelayed[ makestring[ Cell[ TextData[ Pattern[ t, Blank[ ]]], BlankNullSequence[ ]]], makestring[ TextData[ t]]], SetDelayed[ makestring[ TextData[ { Pattern[ s, BlankSequence[ ]]}]], makestring2[ strrep[ ReplaceRepeated[ {s}, {Cell[ BlankSequence[ ]] :> Sequence[ ], ButtonBox[ Pattern[ b, Blank[ ]], BlankSequence[ ]] :> b, StyleBox[ Pattern[ a, Blank[ ]], BlankNullSequence[ ]] :> a}]]]], SetDelayed[ makestring2[ { Pattern[ st, BlankSequence[ String]]}], StringJoin[ st]], SetDirectory[ ReplaceAll[ ReplaceAll[ ReplaceAll[ "FileName", NotebookInformation[ InputNotebook[ ]]], FrontEnd`FileName[ Pattern[ d, Blank[ ]], BlankSequence[ ]] :> ToFileName[ d]], "FileName" -> $Failed]], Set[ tmp1, ReplaceRepeated[ NotebookGet[ InputNotebook[ ]], Cell[ CellGroupData[ { Pattern[ a, BlankSequence[ ]]}, Blank[ ]]] :> a]], Set[ tmp2, ReplaceAll[ ReplaceAll[ ReplaceAll[ ReplaceAll[ ReplaceAll[ ReplaceAll[ Part[ tmp1, 1], Cell[ Pattern[ a, Blank[ ]], Pattern[ b, Blank[ ]], BlankSequence[ ]] :> Cell[ a, b]], {Cell[ TextData[ StyleBox[ Pattern[ a, Blank[ String]], BlankNullSequence[ ]]], Pattern[ st, Blank[ ]], BlankNullSequence[ ]] :> Cell[ TextData[ {a}], st], Cell[ Blank[ ], "Subsection", BlankNullSequence[ ]] :> Cell[ TextData[ {"\n"}], spcodestyle]}], Cell[ Pattern[ x, Blank[ ]], Pattern[ st, Blank[ String]], BlankNullSequence[ ]] :> Condition[ Sequence[ ], Not[ MemberQ[ {"Section", spcodestyle}, st]]]], Cell[ Pattern[ s, Blank[ ]], "Section", BlankSequence[ ]] :> Cell[ s, "Section"]], Cell[ TextData[ { BlankNullSequence[ ], Pattern[ s, Blank[ String]]}], "Section"] :> Cell[ s, "Section"]], Cell[ Pattern[ s, Blank[ String]], "Section"] :> Cell[ fixstring[ s], "Section"]]], Set[ tete, tmp2], If[ FreeQ[ tmp2, Cell[ Blank[ ], "Section", BlankNullSequence[ ]]], PrependTo[ tmp2, Cell[ "Script.ssc", "Section"]]], Set[ tmp2b, ReplaceAll[ tmp2, Cell[ Pattern[ s, Blank[ String]], spcodestyle, BlankNullSequence[ ]] :> Cell[ TextData[ {s}], spcodestyle]]], Set[ tmp3, Split[ tmp2b, And[ UnsameQ[ Part[ #, 2], "Section"], UnsameQ[ Part[ #2, 2], "Section"]]&]], closeit, Set[ tbl, Table[ Hold[ WriteString][ openwrite[ makestring[ Part[ tmp3, i, 1, 1]]], makestring[ Apply[ Sequence, Part[ tmp3, Plus[ i, 1]]]]], {i, 1, Plus[ Length[ tmp3], -1], 2}]], ReleaseHold[ tbl], closeit, Null]], ButtonEvaluator->Automatic], ButtonBox["SD", ButtonFunction:>SetDirectory[ ReplaceAll[ ReplaceAll[ ReplaceAll[ "FileName", NotebookInformation[ InputNotebook[ ]]], FrontEnd`FileName[ Pattern[ d, Blank[ ]], BlankSequence[ ]] :> ToFileName[ d]], "FileName" -> $Failed]], ButtonEvaluator->Automatic], ButtonBox[ StyleBox["F2B", "Subsection", ShowStringCharacters->True, FontColor->RGBColor[0, 0.2, 0.8]], ButtonFunction:>CompoundExpression[ CompoundExpression[ Set[ ButtonTools`F2B, Function[ {nb}, Module[ {backgr, busu, butbox, buttontitle, bts, f, funhead, holdSequence, NBMessage, newcell, nf, r, readit, text, writeit}, CompoundExpression[ Set[ r, NotebookRead[ nb]], Set[ MessageName[ FunctionToButton, "errorbox"], "ErrorBox encountered. Change the source cell to \ InputForm,then to StandardForm and try again"], SetDelayed[ NBMessage[ "errorBox"], Module[ {mnb}, CompoundExpression[ Set[ mnb, NotebookPut[ Notebook[ { Cell[ BoxData[ "Message[FunctionToButton::errorbox]"]\ , "Input", CellOpen -> False]}, WindowElements -> {"MagnificationPopUp", "VerticalScrollBar"}, WindowMargins -> {{5, Automatic}, { Automatic, 5}}, WindowSize -> {580, 270}, Magnification -> 2, Background -> RGBColor[ 0.90000000000000002, 0.90000000000000002, 0.69999999999999996], ShowCellBracket -> False]]], SelectionMove[ mnb, All, Notebook], SelectionEvaluate[ mnb], NotebookWrite[ mnb, Cell[ BoxData[ ButtonBox[ StyleBox[ "Close", "Subtitle"], ButtonFunction :> NotebookClose[ ButtonNotebook[ ]], ButtonEvaluator :> Automatic]], NotebookDefault, TextAlignment -> Center, Active -> True]], SetSelectedNotebook[ mnb], Null]]], If[ Not[ MatchQ[ r, Cell[ CellGroupData[ BlankSequence[ ]]]]], CompoundExpression[ SelectionMove[ nb, All, CellGroup], Set[ readit, NotebookRead[ nb]]], Set[ readit, r]], If[ Not[ MatchQ[ readit, Cell[ CellGroupData[ BlankSequence[ ], Blank[ ]]]]], NBMessage[ "Please select a Cell group"], CompoundExpression[ Set[ r, ReplaceAll[ Flatten[ {readit}], Cell[ Pattern[ es, Blank[ String]], "Input", Pattern[ rest, BlankNullSequence[ ]]] :> Cell[ BoxData[ es], "Input", rest]]], Set[ r, ReplaceRepeated[ r, Cell[ CellGroupData[ { Pattern[ cels, BlankSequence[ Cell]]}, Blank[ ]]] :> cels]], If[ MatchQ[ Part[ r, 1], Cell[ TextData[ Pattern[ a, Blank[ ]]], Condition[ Pattern[ style, Blank[ ]], UnsameQ[ style, "Input"]], BlankNullSequence[ ]]], CompoundExpression[ Set[ text, RowBox[ Flatten[ { Part[ r, 1, 1, 1]}]]], If[ MatchQ[ Part[ r, 1, 1, 1], StyleBox[ Blank[ String], BlankSequence[ ]]], Set[ buttontitle, Replace[ Part[ r, 1, 1, 1], StyleBox[ Pattern[ a, Blank[ ]], Pattern[ b, BlankSequence[ ]]] -> StyleBox[ StyleBox[ a, Part[ r, 1, 2], ShowStringCharacters -> True], b, ShowStringCharacters -> True]]], Set[ buttontitle, StyleBox[ text, Part[ r, 1, 2], ShowStringCharacters -> True]]]]], If[ MatchQ[ Part[ r, 1], Cell[ Pattern[ es, Blank[ String]], Condition[ Pattern[ style, Blank[ ]], UnsameQ[ style, "Input"]], BlankNullSequence[ ]]], If[ StringMatchQ[ Part[ r, 1, 1], "*\"*"], Set[ buttontitle, StyleBox[ Part[ r, 1, 1], ShowStringCharacters -> True]], Set[ buttontitle, Part[ r, 1, 1]]]], Set[ r, ReplaceAll[ ReplaceAll[ ReplaceAll[ r, Cell[ Pattern[ a, Blank[ ]], Condition[ Pattern[ b, Blank[ ]], UnsameQ[ b, "Input"]], BlankNullSequence[ ]] :> Sequence[ ]], Cell[ Blank[ ], "Input", BlankNullSequence[ ], Evaluatable -> False, BlankNullSequence[ ]] :> Sequence[ ]], TextData -> BoxData]], If[ MatchQ[ Part[ r, 1], Cell[ BoxData[ Blank[ ]], "Input", BlankNullSequence[ ]]], CompoundExpression[ Set[ f, MakeExpression[ Part[ r, 1, 1], StandardForm]], Do[ If[ MatchQ[ Set[ nf, ReplaceAll[ MakeExpression[ Part[ r, j, 1], StandardForm], HoldComplete[ CompoundExpression[ Pattern[ a, Blank[ ]], BlankSequence[ ]]] -> HoldComplete[ a]]], HoldComplete[ SetDelayed[ Blank[ ][ BlankSequence[ ]], Blank[ ]]]], Return[ Set[ funhead, Extract[ nf, {1, 1, 0}]]]], {j, Length[ r]}]]], If[ Not[ ValueQ[ funhead]], Set[ funhead, "function"]], If[ Not[ ValueQ[ buttontitle]], Set[ buttontitle, funhead]], Set[ f, Prepend[ Table[ MakeExpression[ Part[ r, i, 1], StandardForm], {i, 2, Length[ r]}], f]], If[ And[ Not[ FreeQ[ f, ErrorBox[ BlankSequence[ ]]]], FreeQ[ f, HoldPattern[ ErrorBox[ Blank[ BlankSequence]]]]], NBMessage[ "errorBox"]], Set[ backgr, Apply[ Sequence, Cases[ buttontitle, HoldPattern[ Background -> Blank[ ]], -1]]], Set[ buttontitle, ReplaceAll[ buttontitle, (Background -> Blank[ ]) :> Sequence[ ]]], Set[ butbox, ReplaceAll[ ReplaceAll[ ButtonBox[ buttontitle, Apply[ RuleDelayed, {ButtonFunction, Hold[ CompoundExpression][ Apply[ Sequence, f]]}], backgr, ButtonEvaluator -> Automatic], {Hold[ CompoundExpression] :> CompoundExpression, HoldComplete[ Pattern[ z, Blank[ ]]] :> z}], Apply[ Hold, {funhead}] -> funhead]], Set[ butbox, ReplaceRepeated[ butbox, {HoldPattern[ CompoundExpression[ Pattern[ a, BlankNullSequence[ ]], Null, Pattern[ b, BlankNullSequence[ ]]]] :> CompoundExpression[ a, b], HoldPattern[ CompoundExpression[ Pattern[ a, BlankNullSequence[ ]], Pattern[ b, BlankSequence[ ]], Pattern[ c, BlankNullSequence[ ]]]] :> CompoundExpression[ a, b, c]}]], Set[ butbox, ReplaceAll[ butbox, HoldPattern[ Pattern[ a, Blank[ ]]] :> a]], Set[ bts, ReplaceRepeated[ buttontitle, StyleBox[ Pattern[ a, Blank[ ]], BlankNullSequence[ ]] :> a]], Set[ writeit, ReplaceAll[ readit, Cell[ BlankSequence[ ], CellTags -> StringJoin[ "GeneratedButtonBox", bts], BlankNullSequence[ ]] :> Sequence[ ]]], If[ Not[ StringQ[ bts]], Set[ bts, "BU"]], Set[ newcell, Cell[ BoxData[ butbox], "NotebookDefault", CellTags -> StringJoin[ "GeneratedButtonBox", bts]]], Set[ writeit, ReplaceAll[ writeit, Cell[ CellGroupData[ { Pattern[ c, BlankSequence[ ]]}, Pattern[ oc, Blank[ ]]]] :> Cell[ CellGroupData[ {c, newcell}, oc]]]], NotebookWrite[ nb, writeit], NotebookFind[ nb, StringJoin[ "GeneratedButtonBox", bts], All, CellTags], If[ UnsameQ[ buttontitle, "Action"], CompoundExpression[ FrontEndExecute[ { FrontEnd`FrontEndToken[ nb, "GeneratePalette"]}], Null]], FrontEndExecute[ FrontEnd`SetSelectedNotebook[ nb]]]]]]]], Null], ButtonTools`F2B[ InputNotebook[ ]]], ButtonEvaluator->Automatic, Background->RGBColor[1, 0.700008, 0]], ButtonBox[ StyleBox["CN", "Subsection", ShowStringCharacters->True], ButtonFunction:>CompoundExpression[ CompoundExpression[ Set[ ButtonTools`CN, Map[ NotebookClose, Select[ Notebooks[ ], FreeQ[ NotebookInformation[ #], "FileName"]&]]], Null], ButtonTools`CN], ButtonEvaluator->Automatic, Background->RGBColor[0.4, 0.6, 1]], ButtonBox["CP", ButtonFunction:>CompoundExpression[ NotebookPut[ NotebookGet[ InputNotebook[ ]]]], ButtonEvaluator->Automatic], ButtonBox[ StyleBox["HP", "Subsection", ShowStringCharacters->True, FontColor->RGBColor[0.6, 0, 0.2]], ButtonFunction:>CompoundExpression[ CompoundExpression[ NotebookFind[ InputNotebook[ ], "NotebookDefault", All, CellStyle], Null], SelectionMove[ NotebookPut[ Notebook[ { Cell[ BoxData[ GridBox[ Transpose[ ReplaceAll[ Select[ NotebookRead[ InputNotebook[ ]], Not[ FreeQ[ #, ButtonBox]]&], Cell[ BoxData[ Pattern[ a, Blank[ ]]], BlankSequence[ ]] :> {a}]], RowSpacings -> 0, ColumnSpacings -> 0]], "NotebookDefault"]}]], All, Notebook], FrontEndExecute[ { FrontEndToken[ FrontEnd`SelectedNotebook[ ], "GeneratePalette"]}]], ButtonEvaluator->Automatic], ButtonBox[ StyleBox["VP", "Subsubsection", ShowStringCharacters->True, FontColor->RGBColor[0.6, 0, 0.2]], ButtonFunction:>CompoundExpression[ CompoundExpression[ NotebookFind[ InputNotebook[ ], "NotebookDefault", All, CellStyle], Null], SelectionMove[ NotebookPut[ Notebook[ { Cell[ BoxData[ GridBox[ ReplaceAll[ Select[ NotebookRead[ InputNotebook[ ]], Not[ FreeQ[ #, ButtonBox]]&], Cell[ BoxData[ Pattern[ a, Blank[ ]]], BlankSequence[ ]] :> {a}], RowSpacings -> 0, ColumnSpacings -> 0]], "NotebookDefault"]}]], All, Notebook], FrontEndExecute[ { FrontEndToken[ FrontEnd`SelectedNotebook[ ], "GeneratePalette"]}]], ButtonEvaluator->Automatic], ButtonBox[\(150 %\), ButtonFunction:>FrontEndExecute[ { FrontEndToken[ InputNotebook[ ], "Magnification", "1.5"]}], ButtonEvaluator->Automatic], ButtonBox[ StyleBox["Cl", "Subsection", ShowStringCharacters->True, FontColor->RGBColor[0.699992, 0, 0]], ButtonFunction:>CompoundExpression[ NotebookClose[ InputNotebook[ ]]], ButtonEvaluator->Automatic], ButtonBox[ StyleBox["Q", "Subsection", ShowStringCharacters->True, FontFamily->"Helvetica", FontWeight->"Bold", FontColor->GrayLevel[0]], ButtonFunction:>CompoundExpression[ Quit[ ]], ButtonEvaluator->Automatic, Background->GrayLevel[1]], ButtonBox["ZWT", ButtonFunction:>CompoundExpression[ SelectionMove[ InputNotebook[ ], All, Cell], SetOptions[ NotebookSelection[ InputNotebook[ ]], ZeroWidthTimes -> Not[ Part[ Options[ NotebookSelection[ InputNotebook[ ]], ZeroWidthTimes], 1, 2]]]], ButtonEvaluator->Automatic], ButtonBox["ENB", ButtonFunction:>CompoundExpression[ CompoundExpression[ SelectionMove[ InputNotebook[ ], Before, Notebook], Null], CompoundExpression[ SelectionMove[ InputNotebook[ ], All, Notebook], Null], CompoundExpression[ SelectionEvaluate[ InputNotebook[ ]], Null], SelectionMove[ InputNotebook[ ], After, Notebook]], ButtonEvaluator->Automatic], ButtonBox[ StyleBox["cd", "Subsection", ShowStringCharacters->True], ButtonFunction:>CompoundExpression[ CompoundExpression[ Module[ {}, CompoundExpression[ SetDelayed[ System`Private`dir`PastePalette[ BlankNullSequence[ ]], CompoundExpression[ SelectionMove[ InputNotebook[ ], All, Cell], NotebookWrite[ InputNotebook[ ], Cell[ BoxData[ System`Private`dir`ListDirectories[ ]], "Text", Active -> True]], SelectionMove[ InputNotebook[ ], Previous, Cell]]], Set[ Options[ System`Private`dir`ListDirectories], { ExcludeDirectories -> {".*"}, PrologButtons :> { ButtonBox[ StringJoin[ "\[UpArrow] ", System`Private`dir`LastDirectory[ Directory[ ]]], ButtonFunction :> CompoundExpression[ SetDirectory[ ParentDirectory[ ]], System`Private`dir`PastePalette[ ]], ButtonEvaluator -> Automatic, Background -> RGBColor[ 0.40000000000000002, 0.59999999999999998, 0]]}}], SetDelayed[ System`Private`dir`LastDirectory[ Pattern[ s, Blank[ String]]], Catch[ CompoundExpression[ If[ SameQ[ $OperatingSystem, "MacOS"], If[ SameQ[ ParentDirectory[ ], s], Throw[ s]]], If[ Equal[ Directory[ ], ParentDirectory[ ]], s, Module[ { Set[ t, StringTake[ s, -1]], Set[ j, 1], n}, CompoundExpression[ While[ Less[ j, StringLength[ s]], CompoundExpression[ Increment[ j], Set[ n, StringTake[ s, { Times[ -1, j], Times[ -1, j]}]], If[ StringMatchQ[ n, $PathnameSeparator], Return[ t], Set[ t, StringJoin[ n, t]]]]], Null]]]]]], SetDelayed[ System`Private`dir`ListDirectories[ Pattern[ opts, BlankNullSequence[ Rule]]], Module[ {dirs, dirs2, exclude, gridboxops, macfix, InputttNotebook, prologbuttons}, CompoundExpression[ If[ UnsameQ[ $OperatingSystem, "MacOS"], Set[ dirs, Select[ FileNames[ "*", "*", 0], SameQ[ FileType[ #], Directory]&]], CompoundExpression[ Set[ dirs, Select[ FileNames[ "*", "*", 0], Or[ SameQ[ FileType[ #], Directory], And[ SameQ[ FileType[ #], None], Not[ StringMatchQ[ #, "*.*"]]]]&]], Set[ dirs, ReplaceAll[ dirs, Pattern[ s, Blank[ String]] :> StringDrop[ s, 1]]]]], Set[ exclude, ReplaceAll[ ReplaceAll[ ExcludeDirectories, {opts}], Options[ System`Private`dir`ListDirectories]]], Do[ Set[ dirs, Select[ dirs, Not[ StringMatchQ[ #, Part[ exclude, i]]]&]], {i, Length[ exclude]}], Set[ prologbuttons, ReplaceAll[ ReplaceAll[ PrologButtons, {opts}], Options[ System`Private`dir`ListDirectories]]], Set[ prologbuttons, ReplaceAll[ Map[ List, Flatten[ {prologbuttons}]], HoldPattern[ ParentDirectory[ ]] -> ParentDirectory[ ]]], Set[ gridboxops, Sequence[ RowSpacings -> 0, ColumnAlignments -> {Left}]], SetDelayed[ macfix[ Pattern[ s, Blank[ String]]], If[ SameQ[ $OperatingSystem, "Ma\.1acOS"], StringReplace[ s, "::" -> ":"], s]], Set[ dirs2, ReplaceAll[ ReplaceAll[ ReplaceAll[ ReplaceAll[ GridBox[ Join[ prologbuttons, Map[ { ButtonBox[ #, ButtonFunction -> Hold[ CompoundExpression][ Hold[ SetDirectory][ macfix[ StringJoin[ Directory[ ], $PathnameSeparator, \ #]]], Hold[ SelectionMove][ InputttNotebook[ ], All, ButtonCell], Hold[ NotebookWrite][ InputttNotebook[ ], Cell[ BoxData[ Hold[ System`Private`dir`ListDirectories][ \ ]], "Text", Active -> True, ZeroWidthTimes -> True], All]], ButtonEvaluator -> Automatic]}&, dirs]], gridboxops], ( ButtonFunction -> Pattern[ b, Blank[ ]]) -> (ButtonFunction :> b)], Hold[ CompoundExpression] :> CompoundExpression], Hold[ Pattern[ a, Blank[ ]]] :> a], InputttNotebook -> InputNotebook]], dirs2]]], System`Private`dir`PastePalette[ ]]]]], ButtonEvaluator->Automatic, Background->RGBColor[0.4, 0.6, 1]], ButtonBox[\(\(*\)\(\(.\)\(nb\)\)\), ButtonFunction:>CompoundExpression[ Module[ {}, CompoundExpression[ Set[ Options[ System`Private`dir`ListFilenames], { ExcludeFilenames -> {}, RestrictFileNames -> "*.nb"}], SetDelayed[ System`Private`dir`PasteFilePalette[ BlankNullSequence[ ]], CompoundExpression[ SelectionMove[ InputNotebook[ ], All, Cell], NotebookWrite[ InputNotebook[ ], Cell[ BoxData[ System`Private`dir`ListFilenames[ ]], "Text", Active -> True, ZeroWidthTimes -> False]], SelectionMove[ InputNotebook[ ], Previous, Cell]]], SetDelayed[ System`Private`dir`ListFilenames[ Pattern[ opts, BlankNullSequence[ Rules]]], Module[ {exclude, fils, fils2, gridboxops, macfix, restrict}, CompoundExpression[ Set[ fils, Select[ FileNames[ "*", "*", 0], SameQ[ FileType[ #], File]&]], If[ SameQ[ $OperatingSystem, "MacOS"], Set[ fils, ReplaceAll[ fils, Pattern[ s, Blank[ String]] :> If[ StringMatchQ[ s, ":*"], StringDrop[ s, 1], s]]]], Set[ exclude, ReplaceAll[ ReplaceAll[ ExcludeFilenames, {opts}], Options[ System`Private`dir`ListFilenames]]], Do[ Set[ fils, Select[ fils, Not[ StringMatchQ[ #, Part[ exclude, i]]]&]], {i, Length[ exclude]}], Set[ restrict, ReplaceAll[ ReplaceAll[ RestrictFileNames, {opts}], Options[ System`Private`dir`ListFilenames]]], If[ StringQ[ restrict], Set[ fils, Select[ fils, StringMatchQ[ #, restrict, IgnoreCase -> True]&]]], Set[ gridboxops, Sequence[ RowSpacings -> 0, ColumnAlignments -> {Left}]], SetDelayed[ macfix[ Pattern[ s, Blank[ String]]], If[ SameQ[ $OperatingSystem, "MacOS"], StringReplace[ s, "::" -> ":"], s]], If[ SameQ[ fils, {}], Set[ fils2, "no files found"], CompoundExpression[ Set[ fils2, ReplaceAll[ ReplaceAll[ ReplaceAll[ ReplaceAll[ GridBox[ Map[ { ButtonBox[ #, ButtonFunction -> Hold[ NotebookOpen][ macfix[ StringJoin[ Directory[ ], $PathnameSeparator, \ #]]], ButtonEvaluator -> Automatic]}&, fils], gridboxops], (ButtonFunction -> Pattern[ b, Blank[ ]]) -> (ButtonFunction :> b)], Hold[ CompoundExpression] :> CompoundExpression], Hold[ Pattern[ a, Blank[ ]]] :> a], InputttNotebook -> InputNotebook]], fils2]]]]], System`Private`dir`PasteFilePalette[ ]]]], ButtonEvaluator->Automatic], ButtonBox[\(\(*\)\(\(.\)\(m\)\)\), ButtonFunction:>CompoundExpression[ Module[ {}, CompoundExpression[ SetDelayed[ System`Private`dir`PasteFilePalette[ BlankNullSequence[ ]], CompoundExpression[ SelectionMove[ InputNotebook[ ], All, Cell], NotebookWrite[ InputNotebook[ ], Cell[ BoxData[ System`Private`dir`ListFilenames[ ]], "Text", Active -> True, ZeroWidthTimes -> False]], SelectionMove[ InputNotebook[ ], Previous, Cell]]], Set[ Options[ System`Private`dir`ListFilenames], { ExcludeFilenames -> {}, RestrictFileNames -> "*.m"}], SetDelayed[ System`Private`dir`ListFilenames[ Pattern[ opts, BlankNullSequence[ Rules]]], Module[ {exclude, fils, fils2, gridboxops, macfix, restrict}, CompoundExpression[ Set[ fils, Select[ FileNames[ "*", "*", 0], SameQ[ FileType[ #], File]&]], If[ SameQ[ $OperatingSystem, "MacOS"], Set[ fils, ReplaceAll[ fils, Pattern[ s, Blank[ String]] :> If[ StringMatchQ[ s, ":*"], StringDrop[ s, 1], s]]]], Set[ exclude, ReplaceAll[ ReplaceAll[ ExcludeFilenames, {opts}], Options[ System`Private`dir`ListFilenames]]], Do[ Set[ fils, Select[ fils, Not[ StringMatchQ[ #, Part[ exclude, i]]]&]], {i, Length[ exclude]}], Set[ restrict, ReplaceAll[ ReplaceAll[ RestrictFileNames, {opts}], Options[ System`Private`dir`ListFilenames]]], If[ StringQ[ restrict], Set[ fils, Select[ fils, StringMatchQ[ #, restrict, IgnoreCase -> True]&]]], Set[ gridboxops, Sequence[ RowSpacings -> 0, ColumnAlignments -> {Left}]], SetDelayed[ macfix[ Pattern[ s, Blank[ String]]], If[ SameQ[ $OperatingSystem, "MacOS"], StringReplace[ s, "::" -> ":"], s]], If[ SameQ[ fils, {}], Set[ fils2, "no files found"], CompoundExpression[ Set[ fils2, ReplaceAll[ ReplaceAll[ ReplaceAll[ ReplaceAll[ GridBox[ Map[ { ButtonBox[ #, ButtonFunction -> Hold[ NotebookOpen][ macfix[ StringJoin[ Directory[ ], $PathnameSeparator, \ #]]], ButtonEvaluator -> Automatic]}&, fils], gridboxops], (ButtonFunction -> Pattern[ b, Blank[ ]]) -> (ButtonFunction :> b)], Hold[ CompoundExpression] :> CompoundExpression], Hold[ Pattern[ a, Blank[ ]]] :> a], InputttNotebook -> InputNotebook]], fils2]]]]], System`Private`dir`PasteFilePalette[ ]]]], ButtonEvaluator->Automatic], ButtonBox[\(<< *.m\), ButtonFunction:>CompoundExpression[ Module[ {}, CompoundExpression[ SetDelayed[ System`Private`dir`PasteFilePalette[ BlankNullSequence[ ]], CompoundExpression[ SelectionMove[ InputNotebook[ ], All, Cell], NotebookWrite[ InputNotebook[ ], Cell[ BoxData[ System`Private`dir`ListFilenames[ ]], "Text", Active -> True, ZeroWidthTimes -> False]], SelectionMove[ InputNotebook[ ], Previous, Cell]]], Set[ Options[ System`Private`dir`ListFilenames], { ExcludeFilenames -> {}, RestrictFileNames -> "*.m"}], SetDelayed[ System`Private`dir`ListFilenames[ Pattern[ opts, BlankNullSequence[ Rules]]], Module[ {exclude, fils, fils2, gridboxops, macfix, restrict}, CompoundExpression[ Set[ fils, Select[ FileNames[ "*", "*", 0], SameQ[ FileType[ #], File]&]], If[ SameQ[ $OperatingSystem, "MacOS"], Set[ fils, ReplaceAll[ fils, Pattern[ s, Blank[ String]] :> If[ StringMatchQ[ s, ":*"], StringDrop[ s, 1], s]]]], Set[ exclude, ReplaceAll[ ReplaceAll[ ExcludeFilenames, {opts}], Options[ System`Private`dir`ListFilenames]]], Do[ Set[ fils, Select[ fils, Not[ StringMatchQ[ #, Part[ exclude, i]]]&]], {i, Length[ exclude]}], Set[ restrict, ReplaceAll[ ReplaceAll[ RestrictFileNames, {opts}], Options[ System`Private`dir`ListFilenames]]], If[ StringQ[ restrict], Set[ fils, Select[ fils, StringMatchQ[ #, restrict, IgnoreCase -> True]&]]], Set[ gridboxops, Sequence[ RowSpacings -> 0, ColumnAlignments -> {Left}]], SetDelayed[ macfix[ Pattern[ s, Blank[ String]]], If[ SameQ[ $OperatingSystem, "MacOS"], StringReplace[ s, "::" -> ":"], s]], If[ SameQ[ fils, {}], Set[ fils2, "no files found"], CompoundExpression[ Set[ fils2, ReplaceAll[ ReplaceAll[ ReplaceAll[ ReplaceAll[ GridBox[ Map[ { ButtonBox[ StringJoin[ "<<", #], ButtonFunction -> Hold[ Get][ macfix[ StringJoin[ Directory[ ], $PathnameSeparator, \ #]]], ButtonEvaluator -> Automatic]}&, fils], gridboxops], (ButtonFunction -> Pattern[ b, Blank[ ]]) -> (ButtonFunction :> b)], Hold[ CompoundExpression] :> CompoundExpression], Hold[ Pattern[ a, Blank[ ]]] :> a], InputttNotebook -> InputNotebook]], fils2]]]]], System`Private`dir`PasteFilePalette[ ]]]], ButtonEvaluator->Automatic], ButtonBox[\(\(*\)\(\(.\)\(m\)\)\), ButtonFunction:>Module[ {}, CompoundExpression[ SetDelayed[ System`Private`dir`PasteFilePalette[ BlankNullSequence[ ]], CompoundExpression[ SelectionMove[ InputNotebook[ ], All, Cell], NotebookWrite[ InputNotebook[ ], Cell[ BoxData[ System`Private`dir`ListFilenames[ ]], "Text", Active -> True, ZeroWidthTimes -> True]], SelectionMove[ InputNotebook[ ], Previous, Cell]]], Set[ Options[ System`Private`dir`ListFilenames], { ExcludeFilenames -> {}, RestrictFileNames -> "*.m"}], SetDelayed[ System`Private`dir`ListFilenames[ Pattern[ opts, BlankNullSequence[ Rules]]], Module[ {exclude, fils, fils2, gridboxops, macfix, restrict}, CompoundExpression[ Set[ fils, Select[ FileNames[ "*", "*", 0], SameQ[ FileType[ #], File]&]], If[ SameQ[ $OperatingSystem, "MacOS"], Set[ fils, ReplaceAll[ fils, Pattern[ s, Blank[ String]] :> If[ StringMatchQ[ s, ":*"], StringDrop[ s, 1], s]]]], Set[ exclude, ReplaceAll[ ReplaceAll[ ExcludeFilenames, {opts}], Options[ System`Private`dir`ListFilenames]]], Do[ Set[ fils, Select[ fils, Not[ StringMatchQ[ #, Part[ exclude, i]]]&]], {i, Length[ exclude]}], Set[ restrict, ReplaceAll[ ReplaceAll[ RestrictFileNames, {opts}], Options[ System`Private`dir`ListFilenames]]], If[ StringQ[ restrict], Set[ fils, Select[ fils, StringMatchQ[ #, restrict, IgnoreCase -> True]&]]], Set[ gridboxops, Sequence[ RowSpacings -> 0, ColumnAlignments -> {Left}]], SetDelayed[ macfix[ Pattern[ s, Blank[ String]]], If[ SameQ[ $OperatingSystem, "MacOS"], StringReplace[ s, "::" -> ":"], s]], If[ SameQ[ fils, {}], Set[ fils2, "no files found"], CompoundExpression[ Set[ fils2, ReplaceAll[ ReplaceAll[ ReplaceAll[ ReplaceAll[ GridBox[ Map[ { ButtonBox[ #, ButtonFunction -> Hold[ NotebookOpen][ macfix[ StringJoin[ Directory[ ], $PathnameSeparator, \ #]]], ButtonEvaluator -> Automatic]}&, fils], gridboxops], (ButtonFunction -> Pattern[ b, Blank[ ]]) -> (ButtonFunction :> b)], Hold[ CompoundExpression] :> CompoundExpression], Hold[ Pattern[ a, Blank[ ]]] :> a], InputttNotebook -> InputNotebook]], fils2]]]]], System`Private`dir`PasteFilePalette[ ]]], ButtonEvaluator->Automatic], ButtonBox["*", ButtonFunction:>Module[ {}, CompoundExpression[ SetDelayed[ System`Private`dir`PasteFilePalette[ BlankNullSequence[ ]], CompoundExpression[ SelectionMove[ InputNotebook[ ], All, Cell], NotebookWrite[ InputNotebook[ ], Cell[ BoxData[ System`Private`dir`ListFilenames[ ]], "Text", Active -> True, ZeroWidthTimes -> True]], SelectionMove[ InputNotebook[ ], Previous, Cell]]], Set[ Options[ System`Private`dir`ListFilenames], { ExcludeFilenames -> {}, RestrictFileNames -> "*"}], SetDelayed[ System`Private`dir`ListFilenames[ Pattern[ opts, BlankNullSequence[ Rules]]], Module[ {exclude, fils, fils2, gridboxops, macfix, restrict}, CompoundExpression[ Set[ fils, Select[ FileNames[ "*", "*", 0], SameQ[ FileType[ #], File]&]], If[ SameQ[ $OperatingSystem, "MacOS"], Set[ fils, ReplaceAll[ fils, Pattern[ s, Blank[ String]] :> If[ StringMatchQ[ s, ":*"], StringDrop[ s, 1], s]]]], Set[ exclude, ReplaceAll[ ReplaceAll[ ExcludeFilenames, {opts}], Options[ System`Private`dir`ListFilenames]]], Do[ Set[ fils, Select[ fils, Not[ StringMatchQ[ #, Part[ exclude, i]]]&]], {i, Length[ exclude]}], Set[ restrict, ReplaceAll[ ReplaceAll[ RestrictFileNames, {opts}], Options[ System`Private`dir`ListFilenames]]], If[ StringQ[ restrict], Set[ fils, Select[ fils, StringMatchQ[ #, restrict, IgnoreCase -> True]&]]], Set[ gridboxops, Sequence[ RowSpacings -> 0, ColumnAlignments -> {Left}]], SetDelayed[ macfix[ Pattern[ s, Blank[ String]]], If[ SameQ[ $OperatingSystem, "MacOS"], StringReplace[ s, "::" -> ":"], s]], If[ SameQ[ fils, {}], Set[ fils2, "no files found"], CompoundExpression[ Set[ fils2, ReplaceAll[ ReplaceAll[ ReplaceAll[ ReplaceAll[ GridBox[ Map[ { ButtonBox[ #, ButtonFunction -> Hold[ NotebookOpen][ macfix[ StringJoin[ Directory[ ], $PathnameSeparator, \ #]]], ButtonEvaluator -> Automatic]}&, fils], gridboxops], (ButtonFunction -> Pattern[ b, Blank[ ]]) -> (ButtonFunction :> b)], Hold[ CompoundExpression] :> CompoundExpression], Hold[ Pattern[ a, Blank[ ]]] :> a], InputttNotebook -> InputNotebook]], fils2]]]]], System`Private`dir`PasteFilePalette[ ]]], ButtonEvaluator->Automatic], ButtonBox[ StyleBox["GV", "Subsection", ShowStringCharacters->True, FontColor->RGBColor[0, 0.500008, 0]], ButtonFunction:>CompoundExpression[ Module[ StyleBox[ "GV", "Subsection", ShowStringCharacters -> True, FontColor -> RGBColor[ 0, 0.50000800000000001, 0]], ButtonFunction :> Module[ {}, CompoundExpression[ If[ Not[ MatchQ[ NotebookInformation[ System`Private`$GlobalValueDisplayNotebook], { BlankSequence[ Rule]}]], Set[ System`Private`$GlobalValueDisplayNotebook, NotebookPut[ Notebook[ {}, WindowTitle -> "Values", WindowMargins -> {{0, Automatic}, {0, Automatic}}, WindowSize -> {250, 444}]]], SetSelectedNotebook[ System`Private`$GlobalValueDisplayNotebook]], SelectionMove[ System`Private`$GlobalValueDisplayNotebook, All, Notebook], NotebookWrite[ System`Private`$GlobalValueDisplayNotebook, Prepend[ Map[ Cell[ BoxData[ StringJoin[ "? ", #]], "Input", GeneratedCell -> False]&, Select[ Names[ "Global`*"], UnsameQ[ Function[ {y}, { Apply[ DefaultValues, y], Apply[ NValues, y], Apply[ SubValues, y], Apply[ DownValues, y], Apply[ OwnValues, y], Apply[ UpValues, y], Apply[ FormatValues, y]}][ ToExpression[ #, StandardForm, Hold]], {{}, {}, {}, {}, {}, {}, {}}]&]], Cell[ TextData[ "variables with values:"], "Text"]], After]]], ButtonEvaluator -> Automatic]], ButtonEvaluator->Automatic], StyleBox[ ButtonBox[ StyleBox["BRP", "Section", TaggingRules:>{"InitializationNotebook" -> Notebook[ { Cell[ BoxData[ StyleBox[ ButtonBox[ StyleBox[ "start", "Section", FontColor -> GrayLevel[ 1.0]], ButtonFunction :> CompoundExpression[ Null], ButtonEvaluator -> Automatic, Background -> RGBColor[ 0.20000000000000001, 0.40000000000000002, 0.0]], FontColor -> RGBColor[ 0.0, 0.0, 1.0]]], "NotebookDefault"], Cell[ TextData[ StyleBox[ "start", FontColor -> RGBColor[ 0.100008, 0.40000000000000002, 0.300008]]], "Section"], Cell[ BoxData[ RowBox[ { RowBox[ {"Remove", "@@", RowBox[ {"Flatten", "[", RowBox[ {"Names", "/@", RowBox[ {"{", RowBox[ {"\"Global`DD\"", ",", "\"Global`CC\"", ",", "\"Global`BRP\""}], "}"}]}], "]"}]}], ";"}]], "Input"], Cell[ BoxData[ RowBox[ { RowBox[ { RowBox[ {"System`DD", "::", "\"usage\""}], "=", "\"DD is a debug variable in the global context. \ Its only properties are Attributes HoldAllComplete and MakeBoxes \ rules.\""}], ";"}]], "Input", GeneratedCell -> True], Cell[ BoxData[ RowBox[ { RowBox[ { RowBox[ {"System`CC", "::", "\"usage\""}], "=", "\"CC[string] is a comment.\""}], ";"}]], "Input"], Cell[ BoxData[ RowBox[ { RowBox[ {"MakeBoxes", "[", RowBox[ { RowBox[ {"System`DD", "[", "any__", "]"}], ",", "StandardForm"}], "]"}], ":=", RowBox[ {"StyleBox", "[", RowBox[ { RowBox[ {"RowBox", "[", RowBox[ {"{", RowBox[ {"\"DD\"", ",", "\"[\"", ",", RowBox[ {"MakeBoxes", "[", RowBox[ {"any", ",", "StandardForm"}], "]"}], ",", "\"]\""}], "}"}], "]"}], ",", "\n", " ", RowBox[ {"FontSize", "->", "16"}], ",", "\n", " ", RowBox[ {"FontWeight", "->", "\"Bold\""}], ",", "\n", " ", RowBox[ {"FontColor", "->", RowBox[ {"RGBColor", "[", RowBox[ {"0", ",", "0", ",", "1"}], " ", "]"}]}]}], "]"}]}]], "Input"], Cell[ BoxData[ RowBox[ { RowBox[ {"MakeBoxes", "[", RowBox[ { RowBox[ {"System`CC", "[", "any_String", "]"}], ",", "StandardForm"}], "]"}], ":=", RowBox[ {"InterpretationBox", "@@", RowBox[ {"{", RowBox[ { RowBox[ {"StyleBox", "[", RowBox[ { RowBox[ {"RowBox", "[", RowBox[ {"{", RowBox[ {"\"(\"", ",", "\"*\"", ",", "any", ",", "\"*\"", ",", "\")\""}], "}"}], "]"}], ",", RowBox[ {"FontColor", "\[Rule]", RowBox[ {"RGBColor", "[", RowBox[ {"0", ",", "0.6", ",", "0"}], "]"}]}]}], "]"}], ",", RowBox[ {"System`CC", "[", "any", "]"}]}], "}"}]}]}]], "Input"], Cell[ BoxData[ RowBox[ { RowBox[ { RowBox[ {"System`BRP", "::", "\"usage\""}], "=", "\"BRP[anycomment] sets a break point.\""}], ";"}]], "Input"], Cell[ BoxData[ RowBox[ { RowBox[ {"Begin", "[", "\"System`Private`\"", "]"}], ";"}]], "Input"], Cell[ BoxData[ RowBox[ { RowBox[ { RowBox[ {"MakeBoxes", "[", RowBox[ { RowBox[ {"System`BRP", "[", "any__", "]"}], ",", "StandardForm"}], "]"}], ":=", RowBox[ {"StyleBox", "[", RowBox[ { RowBox[ {"RowBox", "[", RowBox[ {"{", RowBox[ {"\"BRP\"", ",", "\"[\"", ",", RowBox[ {"MakeBoxes", "[", RowBox[ {"any", ",", "StandardForm"}], "]"}], ",", "\"]\""}], "}"}], "]"}], ",", "\n", " ", RowBox[ {"FontSize", "->", "18"}], ",", "\n", " ", RowBox[ {"FontWeight", "->", "\"Bold\""}], ",", "\n", " ", RowBox[ {"FontColor", "->", RowBox[ {"RGBColor", "[", RowBox[ {"1", ",", " ", "0", ",", " ", "0"}], "]"}]}]}], "]"}]}], ";"}]], "Input"], Cell[ BoxData[ RowBox[ { RowBox[ {"SetAttributes", "[", RowBox[ {"BRP", ",", "ReadProtected"}], "]"}], ";"}]], "Input"], Cell[ "BRP[anything_] := Block[{FEInput, CancelButton, \ CancelButtonText, DialogNotebookOptions, OKButtonText, PrologText, \n \ PrologTextStyle, allowedops, myOptionQ}, MakeBoxes[Prompt[s_String], fmt_] := \ \n InterpretationBox[StyleBox[s, Rule[ShowStringCharacters, False]], \ Prompt, Rule[Editable, False]]\n ; Options[FEInput] = {CancelButton -> \ True, CancelButtonText -> \n StyleBox[\"Cancel\", Rule[FontWeight, \ \"Bold\"], Rule[FontSize, 18]]\n , PrologText -> None, PrologTextStyle \ -> \"Text\", WindowTitle -> \"Local FrontEnd Input\", \n TimeConstraint \ -> Infinity, DialogNotebookOptions -> {WindowSize -> {320, 285}, \n \ WindowElements -> {\"VerticalScrollBar\"}, ShowCellBracket -> False, \ Magnification -> 2., \n StyleDefinitions -> \"Default.nb\", Deletable \ -> False}, OKButtonText -> \n StyleBox[\"OK\", Rule[FontWeight, \ \"Bold\"], Rule[FontSize, 24]]\n }; SetAttributes[FEInput, HoldAll]; \ allowedops = First /@ Options[FEInput]; \n myOptionQ[z_ -> _] := \ MemberQ[allowedops, z]; myOptionQ[z_] := False; \n FEInput[Prompt[s_], \ any_ /; !myOptionQ[any], opts___] := FEInput[{Prompt[s], any}, opts]; \n \ FEInput[Prompt[s_], opts___] := FEInput[{Prompt[s]}, opts] /; {opts} === {} \ || \n Union[myOptionQ /@ {opts}] === {True}; FEInput[opts___] := \ FEInput[{Prompt}, opts] /; \n {opts} === {} || Union[myOptionQ /@ \ {opts}] === {True}; \n FEInput[msgs___List, mslast_ /; \ !myOptionQ[mslast], opts___] := \n Block[{inival, val, nbin, nbwatch, \ intime, comment, commentstyle, waittime, ono, windowtitle, readin, msg}, \n \ msg = {msgs, mslast}; waittime = TimeConstraint /. {opts} /. \ Options[FEInput]; \n windowtitle = WindowTitle /. {opts} /. \ Options[FEInput]; comment = PrologText /. {opts} /. Options[FEInput]; \n \ commentstyle = PrologTextStyle /. {opts} /. Options[FEInput]; ono = \ InputNotebook[]; \n nbwatch = NotebookPut[Notebook[{}, Visible -> \ False]]; \n nbin = NotebookPut[Notebook[(If[comment =!= None, \ Prepend[#1, Cell[comment, commentstyle, Selectable -> \n \ False]], #1] & )[Join[Table[Cell[BoxData[If[MatchQ[msg[[jj]], {_, _}], \n \ With[{prom = Extract[msg, {jj, 1}], inival = Extract[msg, {jj, \ 2}]}, MakeBoxes[prom*inival, \n StandardForm]], With[{prom = \ msg[[jj,1]]}, MakeBoxes[prom, StandardForm]]]], \"Input\", \n \ CellFrame -> True, Background -> GrayLevel[1], CellTags -> \"GetThisCell\", \ CellMargins -> {{2, 2}, \n {2, 2}}], {jj, Length[msg]}], \ {(Cell[BoxData[GridBox[{{RowBox[{ButtonBox[OKButtonText /. {opts} /. \n \ Options[FEInput], ButtonFunction :> NotebookWrite[#1, \" \ \"], ButtonMargins -> 10, \n ButtonFrame -> \"DialogBox\ \"], \" \", If[CancelButton /. {opts} /. Options[\n \ FEInput], ButtonBox[CancelButtonText /. {opts} /. \ Options[FEInput], ButtonFunction :> \n \ NotebookWrite[#1, \"$Failed\"], ButtonMargins -> 10, ButtonFrame -> \ \"DialogBox\"], \n \" \"]}]}}]], NotebookDefault, \ Active -> True, CellMargins -> {{2, 2}, {2, 2}}, \n \ TextAlignment -> \"Center\"] & )[nbwatch]}]], Sequence @@ \ (DialogNotebookOptions /. {opts} /. \n Options[FEInput]), \ WindowTitle -> windowtitle, Visible -> False]]; intime = AbsoluteTime[]; \n \ SetSelectedNotebook[nbin]; SetOptions[nbin, Sequence @@ \ (DialogNotebookOptions /. {opts} /. \n Options[FEInput])]; \ NotebookFind[nbin, \"GetThisCell\", All, CellTags]; \n \ SelectionMove[nbin, All, CellContents]; readin = NotebookRead[nbin]; \ If[FreeQ[readin, \" \[Placeholder]\"], \n SelectionMove[nbin, Before, \ CellContents]; Which[ !FreeQ[readin, \"maybenot True\"], \n \ NotebookFind[nbin, \"True\"], !FreeQ[readin, \"False\"], NotebookFind[nbin, \ \"maybenot False\"], True, \n SelectionMove[nbin, After, \ CellContents]], NotebookFind[nbin, \" \[Placeholder]\"]]; \n \ SetOptions[nbin, Visible -> True]; While[First[NotebookGet[nbwatch]] === {}, \ \n If[AbsoluteTime[] - intime > waittime, NotebookWrite[nbwatch, \ \"$Failed\"]]]; \n val = First[First[First[NotebookGet[nbwatch]]]]; \ If[Head[val] === BoxData, val = First[val]]; \n NotebookClose[nbwatch]; \ SetSelectedNotebook[ono]; If[val === \"$Failed\", If[Length[{msgs}] === 0, \n \ If[Head[mslast] === Prompt, val = Null, val = mslast], If[Union[Head \ /@ First[msg]] === {Prompt}, \n val = Table[Null, \ {Length[msg[[1]]]}], val = First[msg]]], \n val = ToExpression /@ \ First /@ Cases[NotebookGet[nbin], Cell[data_, opts1___, CellTags -> \ \"GetThisCell\", \n opts2___] -> data, {1, Infinity}]; \ If[Length[val] === 1, val = First[val]]]; NotebookClose[nbin]; \n \ If[Head[val] === Notebook, Null, val /. {Prompt :> 1, HoldForm[_] :> 1}]]; \n \ FEInput[{Prompt[\"\"], anything}, WindowTitle -> \"Break point \", \ DialogNotebookOptions -> \n {WindowSize -> {333.*GoldenRatio, 333}, \ WindowElements -> {\"VerticalScrollBar\"}, ShowCellBracket -> False, \n \ Magnification -> 2., StyleDefinitions -> \"Default.nb\", Deletable -> False, \ Background -> Hue[0.1]}]]", "Input"], Cell[ BoxData[ RowBox[ { RowBox[ {"End", "[", "]"}], ";"}]], "Input"], Cell[ BoxData[ RowBox[ { RowBox[ { RowBox[ { RowBox[ {"(", RowBox[ { RowBox[ { RowBox[ {"Hold", "[", "SetDelayed", "]"}], "[", RowBox[ { RowBox[ { RowBox[ {"Hold", "[", "MakeBoxes", "]"}], "[", RowBox[ {"#1", ",", "StandardForm"}], "]"}], ",", RowBox[ {"StyleBox", "[", RowBox[ {"#1", ",", RowBox[ {"FontWeight", "\[Rule]", "\"Bold\""}], ",", RowBox[ {"FontColor", "\[Rule]", RowBox[ {"RGBColor", "[", RowBox[ {"0.2", ",", "0", ",", "1"}], "]"}]}]}], "]"}]}], "]"}], "&"}], ")"}], "/@", RowBox[ {"ToExpression", "/@", RowBox[ {"Drop", "[", RowBox[ { RowBox[ {"Names", "[", "\"*Notebook*\"", "]"}], ",", RowBox[ {"-", "1"}]}], "]"}]}]}], "/.", RowBox[ {"{", RowBox[ { RowBox[ { RowBox[ {"Hold", "[", "SetDelayed", "]"}], "\[RuleDelayed]", "SetDelayed"}], ",", RowBox[ { RowBox[ {"Hold", "[", "MakeBoxes", "]"}], "\[RuleDelayed]", "MakeBoxes"}]}], "}"}]}], ";", RowBox[ { RowBox[ { RowBox[ {"(", RowBox[ { RowBox[ { RowBox[ {"Hold", "[", "SetDelayed", "]"}], "[", RowBox[ { RowBox[ { RowBox[ {"Hold", "[", "MakeBoxes", "]"}], "[", RowBox[ {"#1", ",", "StandardForm"}], "]"}], ",", RowBox[ {"StyleBox", "[", RowBox[ {"#1", ",", RowBox[ {"FontWeight", "\[Rule]", "\"Bold\""}], ",", RowBox[ {"FontColor", "\[Rule]", RowBox[ {"RGBColor", "[", RowBox[ {"1", ",", "0.4", ",", "0"}], "]"}]}]}], "]"}]}], "]"}], "&"}], ")"}], "/@", RowBox[ {"ToExpression", "/@", RowBox[ {"Complement", "[", RowBox[ { RowBox[ {"Names", "[", "\"*Select*\"", "]"}], ",", RowBox[ {"{", RowBox[ {"\"Select\"", ",", "\"Selectable\""}], "}"}]}], "]"}]}]}], "/.", RowBox[ {"{", RowBox[ { RowBox[ { RowBox[ {"Hold", "[", "SetDelayed", "]"}], "\[RuleDelayed]", "SetDelayed"}], ",", RowBox[ { RowBox[ {"Hold", "[", "MakeBoxes", "]"}], "\[RuleDelayed]", "MakeBoxes"}]}], "}"}]}], ";", RowBox[ { RowBox[ { RowBox[ {"(", RowBox[ { RowBox[ { RowBox[ {"Hold", "[", "SetDelayed", "]"}], "[", RowBox[ { RowBox[ { RowBox[ {"Hold", "[", "MakeBoxes", "]"}], "[", RowBox[ {"#1", ",", "StandardForm"}], "]"}], ",", RowBox[ {"StyleBox", "[", RowBox[ {"#1", ",", RowBox[ {"FontWeight", "\[Rule]", "\"Bold\""}], ",", RowBox[ {"FontColor", "\[Rule]", RowBox[ {"RGBColor", "[", RowBox[ {"0.4", ",", "0.6", ",", "0"}], "]"}]}]}], "]"}]}], "]"}], "&"}], ")"}], "/@", RowBox[ {"ToExpression", "/@", RowBox[ {"Names", "[", "\"*Cell*\"", "]"}]}]}], "/.", RowBox[ {"{", RowBox[ { RowBox[ { RowBox[ {"Hold", "[", "SetDelayed", "]"}], "\[RuleDelayed]", "SetDelayed"}], ",", RowBox[ { RowBox[ {"Hold", "[", "MakeBoxes", "]"}], "\[RuleDelayed]", "MakeBoxes"}]}], "}"}]}], ";", RowBox[ { RowBox[ {"MakeBoxes", "[", RowBox[ {"Do", ",", "StandardForm"}], "]"}], ":=", RowBox[ {"StyleBox", "[", RowBox[ {"\"Do\"", ",", RowBox[ {"FontWeight", "\[Rule]", "\"Bold\""}], ",", RowBox[ {"FontColor", "\[Rule]", RowBox[ {"RGBColor", "[", RowBox[ {"0", ",", "0.4", ",", "0"}], "]"}]}]}], "]"}]}], ";", RowBox[ { RowBox[ {"MakeBoxes", "[", RowBox[ {"Block", ",", "StandardForm"}], "]"}], ":=", RowBox[ {"StyleBox", "[", RowBox[ {"\"Block\"", ",", RowBox[ {"FontWeight", "\[Rule]", "\"Bold\""}], ",", RowBox[ {"FontSize", "\[Rule]", "18"}], ",", RowBox[ {"FontColor", "\[Rule]", RowBox[ {"RGBColor", "[", RowBox[ {"0", ",", "0.4", ",", "0"}], "]"}]}]}], "]"}]}], ";", RowBox[ { RowBox[ {"MakeBoxes", "[", RowBox[ {"Module", ",", "StandardForm"}], "]"}], ":=", RowBox[ {"StyleBox", "[", RowBox[ {"\"Module\"", ",", RowBox[ {"FontWeight", "\[Rule]", "\"Bold\""}], ",", RowBox[ {"FontSize", "\[Rule]", "18"}], ",", RowBox[ {"FontColor", "\[Rule]", RowBox[ {"RGBColor", "[", RowBox[ {"0", ",", "0.4", ",", "0"}], "]"}]}]}], "]"}]}], ";", RowBox[ { RowBox[ {"MakeBoxes", "[", RowBox[ {"FrontEndExecute", ",", "StandardForm"}], "]"}], ":=", RowBox[ {"StyleBox", "[", RowBox[ {"\"FrontEndExecute\"", ",", RowBox[ {"FontSize", "\[Rule]", "18"}], ",", RowBox[ {"FontSlant", "\[Rule]", "\"Italic\""}], ",", RowBox[ {"FontColor", "\[Rule]", RowBox[ {"RGBColor", "[", RowBox[ {"0.6", ",", "0.8", ",", "0.100008"}], "]"}]}]}], "]"}]}], ";", RowBox[ { RowBox[ {"MakeBoxes", "[", RowBox[ {"BrowserCategory", ",", "StandardForm"}], "]"}], ":=", RowBox[ {"StyleBox", "[", RowBox[ {"\"BrowserCategory\"", ",", RowBox[ {"FontSize", "\[Rule]", "18"}], ",", RowBox[ {"FontSlant", "\[Rule]", "\"Italic\""}], ",", RowBox[ {"FontColor", "\[Rule]", RowBox[ {"RGBColor", "[", RowBox[ {"0.6", ",", "0.8", ",", "0.100008"}], "]"}]}]}], "]"}]}], ";", RowBox[ { RowBox[ {"MakeBoxes", "[", RowBox[ {"TaggingRules", ",", "StandardForm"}], "]"}], ":=", RowBox[ {"StyleBox", "[", RowBox[ {"\"TaggingRules\"", ",", RowBox[ {"FontSize", "\[Rule]", "18"}], ",", RowBox[ {"FontSlant", "\[Rule]", "\"Italic\""}], ",", RowBox[ {"FontColor", "\[Rule]", RowBox[ {"RGBColor", "[", RowBox[ {"0.6", ",", "0.8", ",", "0.100008"}], "]"}]}]}], "]"}]}], ";"}]], "Input", GeneratedCell -> True], Cell[ BoxData[ RowBox[ { RowBox[ {"$Line", "=", "0"}], ";"}]], "Input"]}, FrontEndVersion -> "3.5 for Microsoft Windows", ScreenRectangle -> {{0.0, 1152.0}, {0.0, 808.0}}, CellGrouping -> Manual, WindowSize -> {898.0, 747.0}, WindowMargins -> {{87.0, Automatic}, {-203.0, Automatic}}, Magnification -> 1.0]}, FontColor->GrayLevel[1]], ButtonFunction:>CompoundExpression[ CompoundExpression[ Set[ K[ "t0"], AbsoluteTime[ ]], SelectionMove[ ButtonNotebook[ ], All, ButtonCell], Set[ K[ "filename"], ReplaceAll[ "FileName", NotebookInformation[ ButtonNotebook[ ]]]], If[ UnsameQ[ System`Private`start`AlreadyInitialized[ K[ "filename"]], True], CompoundExpression[ Set[ save$Line, $Line], Set[ save$HistoryLength, $HistoryLength], Set[ $HistoryLength, 0], Set[ K[ "buno"], NotebookRead[ ButtonNotebook[ ]]], SetDelayed[ System`Private`start`EvaluateNotebookAndCloseIt[ Notebook[ { Pattern[ x, BlankSequence[ Cell]]}, Pattern[ y, BlankNullSequence[ ]]]], Block[ { Set[ temporaryNotebook, NotebookCreate[ Visible -> If[ SameQ[ $NotebookVisible, True], True, False]]]}, CompoundExpression[ NotebookWrite[ temporaryNotebook, ReplaceAll[ {x, ReplaceAll[ If[ SameQ[ $NotebookVisible, True], Hold[ Sequence][ ], Cell[ BoxData[ RowBox[ { RowBox[ {"NotebookClose", "[", RowBox[ {"EvaluationNotebook", "[", "]"}], "]"}], ";"}]], "Input"]], Hold[ Sequence] -> Sequence]}, {( InitializationCell -> True) :> ( InitializationCell -> False)}]], FrontEndExecute[ { FrontEnd`FrontEndToken[ temporaryNotebook, "EvaluateNotebook"]}]]]], Times[ CompoundExpression[ Set[ K[ "bu"], ReplaceAll[ Cases[ K[ "buno"], HoldPattern[ TaggingRules :> {"InitializationNotebook" -> Blank[ Notebook]}], -1], { Pattern[ a, Blank[ ]], BlankNullSequence[ ]} :> a]], Null], Set[ K[ "tag"], ReplaceAll[ TaggingRules, K[ "bu"]]]], System`Private`start`EvaluateNotebookAndCloseIt[ ReplaceAll[ "InitializationNotebook", K[ "tag"]]], Set[ System`Private`start`AlreadyInitialized[ K[ "filename"]], True], Set[ $Line, save$Line], Clear[ save$Line], Set[ $HistoryLength, save$HistoryLength], Clear[ save$HistoryLength], Null]], Set[ K[ "t"], IntegerPart[ Plus[ AbsoluteTime[ ], Times[ -1, K[ "t0"]]]]]], Null, CompoundExpression[ Null]], ButtonEvaluator->Automatic, Background->RGBColor[0.2, 0.4, 0]], FontColor->RGBColor[0, 0, 1]]} }, RowSpacings->0, ColumnSpacings->0]], NotebookDefault, PageBreakAbove->True] }, FrontEndVersion->"4.0 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 695}}, ClosingAutoSave->True, Editable->False, WindowToolbars->{}, PageWidth->854, WindowSize->{Fit, Fit}, WindowMargins->{{110, Automatic}, {Automatic, 72}}, WindowFrame->"Palette", WindowElements->{}, WindowFrameElements->"CloseBox", WindowClickSelect->False, ScrollingOptions->{"PagewiseScrolling"->True}, ShowCellBracket->False, CellMargins->{{0, 0}, {Inherited, 0}}, Active->True, CellOpen->True, ShowCellLabel->False, ShowCellTags->False, ImageMargins->{{0, Inherited}, {Inherited, 0}}, Magnification->1 ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1718, 49, 149432, 2832, 29, NotebookDefault, PageBreakAbove->True] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)