Skip to content

Commit

Permalink
Couple of issues solved.
Browse files Browse the repository at this point in the history
  • Loading branch information
aplteam committed May 8, 2018
1 parent d4e9369 commit 6cd9988
Show file tree
Hide file tree
Showing 23 changed files with 361 additions and 47 deletions.
2 changes: 1 addition & 1 deletion HTML/01-Introduction.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ <h2>Acknowledgements</h2>
<p><strong>Footnotes</strong></p>
<ol>
<li id="fnref1"><p>Perhaps one day you would like it to ship on multiple platforms. Perhaps one day we’ll write that book too. Meanwhile, Microsoft Windows.</p><p>You will however find that whenever possible we keep the code platform independent. If we use platform-dependent utilities we mention it and explain why; we might also mention alternatives available on other platforms.</p><a href="#fnref1" class="footnote_anchor"></a>
<li id="fnref2"><p><em>APLTree</em> is the name of an open-source library that offers robust, tested and well documented solutions to many everyday problems you face when addressing the tasks discussed in this book.</p><p>We will use this library extensively and discuss it in detail. More at the source:<br><a href="https://aplteam.github.io/apltree" class="external_link">https://aplteam.github.io/apltree</a>. You can also search for “apltree” on <a href="https://github.com" class="external_link">GitHub</a>.</p><a href="#fnref2" class="footnote_anchor"></a>
<li id="fnref2"><p><em>APLTree</em> is the name of an open-source library that offers robust, tested and well documented solutions to many everyday problems you face when addressing the tasks discussed in this book.</p><p>We will use this library extensively and discuss it in detail. More at the source:<br><a href="https://github.com/aplteam/apltree/wiki/Members" class="external_link">https://github.com/aplteam/apltree/wiki/Members</a>. You can also search for “apltree” on <a href="https://github.com" class="external_link">GitHub</a>.</p><a href="#fnref2" class="footnote_anchor"></a>
<li id="fnref3"><p>These days seasoned programmers often have strong opinions about whether to use an object-oriented approach or a functional approach, or to mix them both.</p><p>We have seen friendships broken on these issues. In this book we take a mixed approach.</p><a href="#fnref3" class="footnote_anchor"></a>
</ol>
</div>
Expand Down
2 changes: 1 addition & 1 deletion HTML/02-Structure.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ <h3>How to organise the code</h3>
<div class="leanpub">
<img src="https://download.aplwiki.com/LeanPub/Images/information.png" alt="Information">
<div>
<p>The APLTree library is an open-source project hosted on <a href="https://github.com" class="external_link">GitHub</a>. It offers solutions for many every-day problems a Dyalog APL programmer might run into. In the Cookbook we will use many of its members. For details see <a href="https://aplteam.github.io/apltree" class="external_link">https://aplteam.github.io/apltree</a>.</p>
<p>The APLTree library is an open-source project hosted on <a href="https://github.com" class="external_link">GitHub</a>. It offers solutions for many every-day problems a Dyalog APL programmer might run into. In the Cookbook we will use many of its members. For details see <a href="https://github.com/aplteam/apltree/wiki" class="external_link">https://github.com/aplteam/apltree/wiki</a>.</p>
</div>
</div>

Expand Down
13 changes: 11 additions & 2 deletions HTML/03-Packaging.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,17 @@ <h1>3. Package MyApp as an executable</h1>
<h2>Output to the session log</h2>
</a>
</div>
<p>In a runtime interpreter or an <abbr title="Executable file with the extension 'exe'">EXE</abbr>, there is no APL session, and output to the session which would have been visible in a development system will simply disappear. If we want to see this output, we need to write it to a log file.</p>
<p>But how do we find out where we need to make changes? We recommend you think about this from the start, and ensure that all <em>intentional</em> output goes through a log function, or at least use an explicit <code>⎕←</code> so that output can easily be identified in the source.</p>
<p>In a runtime interpreter or an <abbr title="Executable file with the extension 'exe'">EXE</abbr>, there is no APL session, and output to the session which would have been visible in a development system will simply disappear.</p>

<div class="leanpub">
<img src="https://download.aplwiki.com/LeanPub/Images/information.png" alt="Information">
<div>
<p>Note that output assigned to <code></code> or <code></code> does not stop the runtime executable.</p>
<p>However, when the result of a function is neither consumed by another function nor assigned to a variable then you will see the message “This Dyalog APL runtime application has attempted to use the APL session and therefore be closed.”, and that will be the end of it.</p>
</div>
</div>

<p>If we want to see this output, we need to write it to a log file. But how do we find out where we need to make changes? We recommend you think about this from the start, and ensure that all <em>intentional</em> output goes through a log function, or at least use an explicit <code>⎕←</code> so that output can easily be identified in the source.</p>

<div class="leanpub_A">
<h3>Unwanted output to the session</h3>
Expand Down
14 changes: 11 additions & 3 deletions HTML/10-Make.html
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ <h2>Make the application</h2>
<div class="leanpub_A">
<h3>More complex scenarios</h3>
<p>In a more complex application than ours you might prefer a different approach. Using an <abbr title="File with the extension 'ini' containing configuration data">INI</abbr> file for this is not a bad idea: it gives you scope to define more than just the modules to be loaded, and some code to execute.</p>
<p>Also, if you have not one butseveral applications to support, it is useful to implement your own generalised user command like <code>]runmake</code>.</p>
<p>Also, if you have not one but several applications to support, it is useful to implement your own generalised user command like <code>]runmake</code>.</p>
</div>

<p><code>Execute</code>, <code>Tester</code> and <code>Tests</code> have no place in the finished application, nor do we need the test helpers either.</p>
Expand Down Expand Up @@ -411,7 +411,7 @@ <h3>Exporting</h3>
details,←⊂'ProductVersion'(2⊃##.MyApp.Version)
details,←⊂'LegalCopyright' 'Dyalog Ltd 2018'
details,←⊂'ProductName' 'MyApp'
details,←⊂'FileVersion' '1.2.3.4'
details,←⊂'FileVersion' (2⊃##.MyApp.Version)
details←↑details
success←try←0
fn←DESTINATION,'\',exeName ⍝ filename
Expand All @@ -432,8 +432,16 @@ <h3>Exporting</h3>
<p><code>Export</code> automates what we’ve done so far by calling the <em>Export</em> command from the <em>File</em> menu. If the <em>Bind</em> method fails, it retries up to 50 times before giving up.</p>
<p>From experience we know that, with the OS, the machine, the network, the filesystem and who knows what else, the command can fail several times before finally succeeding.</p>

<div class="leanpub">
<img src="https://download.aplwiki.com/LeanPub/Images/information.png" alt="Information">
<div>
<p>Why is there a “ProductVersion” and a “FileVersion”? No idea! On Stack Overflow this was discussed more than once, and it seems that there are very few cases were it might make sense to have them <strong>not</strong> in sync.</p>
<p>But “FileVersion” is the more important one: the Inno installer for example (see <a href="./16-Creating-SetUp.exe.html" class="external_link">chapter 16 “Creating SetUp.exe”</a>) compares the “FileVersion” of an already installed version with the possibly new version, and if they are not different then it won't overwrite the <abbr title="Executable file with the extension 'exe'">EXE</abbr> - you don't want that!</p>
</div>
</div>

<div class="leanpub_A">
<h3>The <em>Bind</em> method</h3>
<h3>The <code>Bind</code> method</h3>
<p>Note that for the <code>Bind</code> method to work as discussed in this chapter you must use at least version 16.0.31811.0 of Dyalog. Before that <code>Bind</code> was not an official method and did not support the <code>details</code>.</p>
</div>

Expand Down
3 changes: 2 additions & 1 deletion HTML/11-Providing-help.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ <h1>11. Providing help</h1>
</a>
</div>
<p>Users expect applications to provide help in one way or another. One option is to provide the help as a hypertext system. Under Windows, <abbr title="Executable file with the extension 'chm' that contains Windows Help(Compiled Help)">CHM</abbr> files are the standard way to provide such help. There are powerful applications available that can assist you in providing help; HelpAndManual [<a href="#fnref1" class="footnote_link"><sup>1</sup></a>] is just an example.</p>
<p>However, we take a different approach here: rather than using any third-party software we use <code>Markdown2Help</code> from the APLTree library. That allows us to create a help system that:</p>
<p>However, we take a different approach here: rather than using any third-party software we use <code>Markdown2Help</code> from the APL_cation [<a href="#fnref2" class="footnote_link"><sup>2</sup></a>] project. That allows us to create a help system that:</p>
<ul>
<li>offers pretty much the same functionality as <abbr title="Executable file with the extension 'chm' that contains Windows Help(Compiled Help)">CHM</abbr>.</li>
<li>allows us to keep the Help close to the code.</li>
Expand Down Expand Up @@ -478,6 +478,7 @@ <h2>Enhancing Make.dyapp and Make.dyalog</h2>
<p><strong>Footnotes</strong></p>
<ol>
<li id="fnref1"><p><a href="http://www.helpandmanual.com/" class="external_link">http://www.helpandmanual.com/</a></p><a href="#fnref1" class="footnote_anchor"></a>
<li id="fnref2"><p><a href="https://github.com/aplteam/apltree/wiki/Members" class="external_link">https://github.com/aplteam/apltree/wiki/Members</a></p><a href="#fnref2" class="footnote_anchor"></a>
</ol>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion HTML/12-Scheduled-Tasks.html
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ <h3>Binding MyAPP with the Dyalog development EXE</h3>
</a>
</div>
<p>If for some reason you’ve created <code>MyApp.exe</code> by binding the application to the development version of Dyalog rather than the runtime (you can do this by providing a 0 as left argument to the <code>MakeExport</code> function) then you might run into a problem. Our code notices whether it is running under a development <abbr title="Executable file with the extension 'exe'">EXE</abbr> or a runtime <abbr title="Executable file with the extension 'exe'">EXE</abbr>. Error trapping will be inactive (unless it is enforced via the <abbr title="File with the extension 'ini' containing configuration data">INI</abbr>) and <code>⎕OFF</code> won’t be executed; instead it would execute <code></code> and hang around but without you being able to see the session.</p>
<p>So don’t do this. Because you have Ride, the development version has no advantages over the runtime <abbr title="Executable file with the extension 'exe'">EXE</abbr> anyway.</p>
<p>So don’t do this. Because you have Ride at your disposal the development version has no advantages over the runtime <abbr title="Executable file with the extension 'exe'">EXE</abbr> anyway.</p>
<div class="h_tag">
<a href="#Your-application-doesnt-do-what-its-supposed-to-do" id="Your-application-doesnt-do-what-its-supposed-to-do" class="autoheader_anchor">
<h3>Your application doesn’t do what it’s supposed to do</h3>
Expand Down
52 changes: 52 additions & 0 deletions HTML/16-Creating-SetUp.exe.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ <h3>Misc</h3>
<li><a href="#tasks">The section [Tasks]</a></li>
<li><a href="#code">The section [Code]</a></li>
</ul></li>
<li><a href="#Potential-problems">Potential problems</a>
<ul>
<li><a href="#Updating-an-already-installed-version">Updating an already installed version</a>
<ul>
<li><a href="#Files-that-are-not-needed-any-longer">Files that are not needed any longer</a></li>
<li><a href="#The-EXE">The EXE</a></li>
</ul></li>
<li><a href="#Analyzing-problems">Analyzing problems</a></li>
</ul></li>
<li><a href="#Conclusion">Conclusion</a>
</ul>
</div>
Expand Down Expand Up @@ -466,6 +475,49 @@ <h3>The section [Code]</h3>
</div>
<p>Inno comes with a built-in script language that allows you to do pretty much whatever you like. However, scripting is beyond the scope of this chapter.</p>
<div class="h_tag">
<a href="#Potential-problems" id="Potential-problems" class="autoheader_anchor">
<h2>Potential problems</h2>
</a>
</div>
<div class="h_tag">
<a href="#Updating-an-already-installed-version" id="Updating-an-already-installed-version" class="autoheader_anchor">
<h3>Updating an already installed version</h3>
</a>
</div>
<p>There is no need to take action - Inno will handle this automatically for you. There is however one exception and one pitfall:</p>
<div class="h_tag">
<a href="#Files-that-are-not-needed-any-longer" id="Files-that-are-not-needed-any-longer" class="autoheader_anchor">
<h4>Files that are not needed any longer</h4>
</a>
</div>
<p>Inno won't (can't) delete those automatically. This is the recommended way to delete files:</p>
<pre><code>[InstallDelete]
Type: files; Name: {app}\foo.bar
Type: files; Name: {app}\baz\quux.txt</code></pre>
<p>Although wildcards are supported they should never be used because you may well delete user files.</p>
<div class="h_tag">
<a href="#The-EXE" id="The-EXE" class="autoheader_anchor">
<h4>The EXE</h4>
</a>
</div>
<p>When an <abbr title="Executable file with the extension 'exe'">EXE</abbr> is part of the installation Inno compares the “FileVersion” of what's already installed with the one that is about to be installed. It they match Inno won't take any action. That means that if you forget to set the “FileVersion” (see <a href="./10-Make.html#Exporting" class="external_link">chapter 10: “Make: Export”</a>) when creating the stand-alone <abbr title="Executable file with the extension 'exe'">EXE</abbr> then it will always be 0.0.0.0, so they won't ever differ, and the first installed <abbr title="Executable file with the extension 'exe'">EXE</abbr> will never be replaced!</p>
<div class="h_tag">
<a href="#Analyzing-problems" id="Analyzing-problems" class="autoheader_anchor">
<h3>Analyzing problems</h3>
</a>
</div>
<p>A problem like the aforementioned one won't cause an error message; you just don't get the new <abbr title="Executable file with the extension 'exe'">EXE</abbr> installed. Assuming that you have been careful enough to realize that there is a problem, how to get to the bottom of it?</p>
<p>If the installer does not behave as expected add <code>/LOG={filename}</code> to it. Then Inno will report all actions and even conclusions to that file.</p>
<p>In the above scenario you would find something similiar to this in the log file:</p>
<pre><code>2018-05-08 06:26:30.826 -- File entry --
2018-05-08 06:26:30.827 Dest filename: C:\Program Files (x86)\..\Foo.exe
2018-05-08 06:26:30.827 Time stamp of our file: 2018-05-07 13:07:26.000
2018-05-08 06:26:30.827 Dest file exists.
2018-05-08 06:26:30.827 Time stamp of existing file: 2018-05-07 12:51:24.000
2018-05-08 06:26:30.827 Version of our file: 0.0.0.0
2018-05-08 06:26:30.832 Version of existing file: 0.0.0.0
2018-05-08 06:26:30.832 Same version. Skipping.</code></pre>
<div class="h_tag">
<a href="#Conclusion" id="Conclusion" class="autoheader_anchor">
<h2>Conclusion</h2>
</a>
Expand Down
81 changes: 74 additions & 7 deletions HTML/17-Regular-Expressions.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,68 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<title>RegEx</title>
<link href="file:///C:/Program Files (x86)/APL Team Ltd/Meddy/CSS/MarkAPL_screen.css" rel="stylesheet" media="screen">
<link href="file:///C:/Program Files (x86)/APL Team Ltd/Meddy/CSS/MarkAPL_print.css" rel="stylesheet" media="print">
<meta name="author" content="kai">
<link href="./CSS/BlackOnWhite_screen.css" rel="stylesheet" media="screen">
<link href="./CSS/Cookbook_Chapter_screen.css" rel="stylesheet" media="screen">
<link href="./CSS/snap.css" rel="stylesheet" media="screen">
<link href="./CSS/BlackOnWhite_print.css" rel="stylesheet" media="print">
<link href="./CSS/Cookbook_Chapter_print.css" rel="stylesheet" media="print">
<script src="./JavaScript/snap.js"></script>
</head>
<body>
<nav id="main_nav_no_collapse">
<div class="snap-drawers">
<div class="snap-drawer snap-drawer-left">
<div class="h_tag">
<h3>Chapters</h3>
</div>
<ol>
<li><a href="./01-Introduction.html" class="external_link">Introduction</a></li>
<li><a href="./02-Structure.html" class="external_link">Structure</a></li>
<li><a href="./03-Packaging.html" class="external_link">Packaging</a></li>
<li><a href="./04-Logging%20.html" class="external_link">Logging </a></li>
<li><a href="./05-Configuration.html" class="external_link">Configuration</a></li>
<li><a href="./06-Debugging-EXEs.html" class="external_link">Debugging EXEs</a></li>
<li><a href="./07-Handling-errors.html" class="external_link">Handling errors</a></li>
<li><a href="./08-Testing.html" class="external_link">Testing</a></li>
<li><a href="./09-Documentation.html" class="external_link">Documentation</a></li>
<li><a href="./10-Make.html" class="external_link">Make</a></li>
<li><a href="./11-Providing-help.html" class="external_link">Providing help</a></li>
<li><a href="./12-Scheduled-Tasks.html" class="external_link">Scheduled Tasks</a></li>
<li><a href="./13-Windows-Services.html" class="external_link">Windows Services</a></li>
<li><a href="./14-Windows-Event-Log.html" class="external_link">Windows Event Log</a></li>
<li><a href="./15-Windows-Registry.html" class="external_link">Windows Registry</a></li>
<li><a href="./16-Creating-SetUp.exe.html" class="external_link">Creating SetUp.exe</a></li>
<li><a href="./17-Regular-Expressions.html" class="external_link">Regular Expressions</a></li>
<li><a href="./18-Acre.html" class="external_link">Acre</a></li>
<li><a href="./19-GUI.html" class="external_link">GUI</a></li>
<li><a href="./20-Git.html" class="external_link">Git</a></li>
</ol>
<div class="h_tag">
<h3>Appendices</h3>
</div>
<ol>
<li><a href="./Appendix-01_Windows-environment-vars.html" class="external_link">Windows environment vars</a></li>
<li><a href="./Appendix-02_User-commands.html" class="external_link">User commands</a></li>
<li><a href="./Appendix-03_aplcores-&-WS-integrity.html" class="external_link">aplcores & WS integrity</a></li>
<li><a href="./Appendix-04_Development-environment.html" class="external_link">Development environment</a></li>
<li><a href="./Appendix-05_Special-characters.html" class="external_link">Special characters</a></li>
</ol>
<div class="h_tag">
<h3>Misc</h3>
</div>
<ul>
<li><a href="16-Creating-SetUp.exe.html">Previous chapter</a></li>
<li><a href="18-Acre.html">Next chapter</a></li>
<li><a href="./Dyalog_Cookbook.html" class="external_link" alt="All chapters, for printing" title="All chapters, for printing">Single document<br></a></li>
</ul>
</div>
</div>
<div id="mainmenu">
<a href=# style="color:black;"><p><span id="mainmenu_match"></span></p></a>
<p><span id="mainmenu_title">The Dyalog Cookbook</span></p>
<nav id="main_nav">
<input type="checkbox" id="hide_toc">
<label id="hide_toc_label" for="hide_toc"></label>
<div class="toc-container">
<h3>Table of contents</h3>
<ul>
<li><a href="#Start-here">Start here</a></li>
<li><a href="#What-you-can-expect">What you can expect</a></li>
Expand Down Expand Up @@ -62,9 +116,12 @@ <h3>Table of contents</h3>
</ul>
</div>
</nav>
</div>
<div id="content" class="snap-content">
<div id="cookbook_content">
<div class="h_tag">
<a href="#Regular-expressions-with-Dyalog" id="Regular-expressions-with-Dyalog" class="autoheader_anchor">
<h1>Regular expressions with Dyalog</h1>
<a href="#17-Regular-expressions-with-Dyalog" id="17-Regular-expressions-with-Dyalog" class="autoheader_anchor">
<h1>17. Regular expressions with Dyalog</h1>
</a>
</div>
<div class="h_tag">
Expand Down Expand Up @@ -1035,5 +1092,15 @@ <h3>Helpful stuff</h3>
<dd><p class="first_dd">The aforementioned website comes with detailed book reviews:</p></dd>
<dd><p><a href="https://www.regular-expressions.info/hipowls.html" class="external_link">https://www.regular-expressions.info/hipowls.html</a></p></dd>
</dl>
</div>
</div>
<script>
var snapper = new Snap({
element: document.getElementById('content')
});
document.getElementById('mainmenu_match').onclick = function(){
snapper.state().state==='closed'?snapper.open('left'):snapper.close();
}
</script>
</body>
</html>
Loading

0 comments on commit 6cd9988

Please sign in to comment.