force use of pandoc version >= 3.1.12.2

The `bin/pandoc-wrapper.sh` tool will verify that the ssytem
has a recent enough version of `pandoc(1)`.

We explain why we insist on `pandoc(1)`. version >= 3.1.12.2
in comments where the $PANDOC_MIN_VERSION is set.

Added `--wrap=preserve` as a default argument to `pandoc(1)`.
While this change will impact every HTML file generated,
we believe this will improve the ability of someone to look
at the generated HTML and correlate with the original markdown.

Changed `bin/pandoc-wrapper.sh` VERSION from "1.4.2 2024-03-17"
to "1.4.3 2024-03-18".

Performed `make www` to achieve all of the above and to generate
HTML using the new  `--wrap=preserve` `pandoc(1)` mode.
This commit is contained in:
Landon Curt Noll committed 2024-03-18 01:26:39 -07:00
1 parent 9eb7a54e9f
commit b0b212acb1
402 files changed
+37061 -55132

No files matched your search

+101 -148
View File
@@ -129,9 +129,9 @@
<h2 id="author"><a name="author"></a>Author:</h2>
<ul>
<li>Name: <a href="../../authors.html#Jens_Schweikhardt">Jens
Schweikhardt</a><br> Location: <a href="../../location.html#DE">DE</a> -
<em>Federal Republic of Germany</em> (<em>Germany</em>) <br><br></li>
<li>Name: <a href="../../authors.html#Jens_Schweikhardt">Jens Schweikhardt</a><br>
Location: <a href="../../location.html#DE">DE</a> - <em>Federal Republic of Germany</em> (<em>Germany</em>)
<br><br></li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
@@ -150,16 +150,15 @@ Schweikhardt</a><br> Location: <a href="../../location.html#DE">DE</a> -
<span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./yarng</span></span>
<span id="cb4-4"><a href="#cb4-4" aria-hidden="true" tabindex="-1"></a><span class="co"># watch what it does</span></span></code></pre></div>
<p>What is the difference between what is in the script and running
<code>yarng</code> without an arg?</p>
<p>What is the difference between what is in the script and running <code>yarng</code> without
an arg?</p>
<h2 id="judges-remarks">Judges’ remarks:</h2>
<p>Run the program with a small argument, like 5 or 10, several times.
Are the results different? Why?</p>
<p>Run the program with a small argument, like 5 or 10, several times. Are the
results different? Why?</p>
<h3 id="historical-remarks">Historical remarks:</h3>
<p>At the time of judging, some non-gcc compilers that were not fully
ANSI standard did not compile this entry correctly. Also at that time,
some gcc and egcs implementations ran into a problem when building the
entry. Doing:</p>
<p>At the time of judging, some non-gcc compilers that were not fully ANSI standard
did not compile this entry correctly. Also at that time, some gcc and egcs
implementations ran into a problem when building the entry. Doing:</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> schweikh2</span></code></pre></div>
<p>often produced an error of the form:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="fu">gcc</span> <span class="at">-ansi</span> schweikh2.alt.c <span class="at">-o</span> schweikh2.alt</span>
@@ -171,35 +170,30 @@ entry. Doing:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#line 10 ONE(O(1,1,2,6,0,6))</span></span></code></pre></div>
<p>turned into the line:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="pp"># 9 &quot;01\012&quot;</span></span></code></pre></div>
<p>(note, though, how that line is on line 11) which caused gcc to give
to the assembler the following two lines:</p>
<div class="sourceCode" id="cb9"><pre
class="sourceCode asm"><code class="sourceCode fasm"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>.stabs <span class="st">&quot;schweikh2.c</span></span>
<p>(note, though, how that line is on line 11) which caused gcc to give to the
assembler the following two lines:</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode asm"><code class="sourceCode fasm"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>.stabs <span class="st">&quot;schweikh2.c</span></span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a>&quot;,132,0,0,Ltext1</span></code></pre></div>
<p>and the lone <code>"</code> after the <code>#.file</code> line
resulted in an assembly syntax error.</p>
<p>and the lone <code>"</code> after the <code>#.file</code> line resulted in an assembly syntax error.</p>
<p>In some cases one had to compile using <code>gcc -g</code>:</p>
<div class="sourceCode" id="cb10"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> schweikh2 CFLAGS=-g</span></code></pre></div>
<div class="sourceCode" id="cb10"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span> schweikh2 CFLAGS=-g</span></code></pre></div>
<p>to trigger this error.</p>
<p>With the proper text beyond the <code>\012</code>, it was even
possible to have all kinds of fun adding inline assembly via
<code>#line</code> directives. :-)</p>
<p>With the proper text beyond the <code>\012</code>, it was even possible to have all kinds
of fun adding inline assembly via <code>#line</code> directives. :-)</p>
<h4 id="for-extra-fun-and-credit">For extra fun and credit:</h4>
<p>If your compiler had this bug, you could transform the line in the C
program to inject assembly instructions in such a way that the program
would compile.</p>
<p>If you were able to do that, you could have tried adding assembly
instructions so that it will compile, execute and do something
interesting (or uninteresting, for that matter :-) ).</p>
<p>If you succeeded in doing that (especially on FreeBSD, Linux or
SunOS/Solaris), you could have emailed the author for a free pat on the
back (and maybe you still can :-) ).</p>
<p>If your compiler had this bug, you could transform the line in the C program to
inject assembly instructions in such a way that the program would compile.</p>
<p>If you were able to do that, you could have tried adding assembly instructions
so that it will compile, execute and do something interesting (or uninteresting,
for that matter :-) ).</p>
<p>If you succeeded in doing that (especially on FreeBSD, Linux or SunOS/Solaris),
you could have emailed the author for a free pat on the back (and maybe you
still can :-) ).</p>
<p>Because of this bug, the code was changed to be instead:</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#line 10 &quot;01\015&quot;</span></span></code></pre></div>
<p>However in 2023 it was observed that <em>it is gcc</em> (at least
some versions?) that has a problem with the compilation of the
<em>modified</em> program, giving an internal compiler error:</p>
<p>However in 2023 it was observed that <em>it is gcc</em> (at least some versions?) that
has a problem with the compilation of the <em>modified</em> program, giving an internal
compiler error:</p>
<pre><code>:10:16: warning: type defaults to &#39;int&#39; in declaration of &#39;zero&#39; [-Wimplicit-int]
: In function &#39;main&#39;:
:12:1: warning: missing terminating &quot; character
@@ -211,8 +205,8 @@ some versions?) that has a problem with the compilation of the
<p>and now it works with both clang and gcc.</p>
<h2 id="authors-remarks">Author’s remarks:</h2>
<h3 id="what-this-program-does">What this program does</h3>
<p>My entry is a <code>yarng</code>, which stands for, you guessed it,
yet another random number generator, and is pronounced ‘yawn’ due to its
<p>My entry is a <code>yarng</code>, which stands for, you guessed it, yet another
random number generator, and is pronounced ‘yawn’ due to its
incredible speed. Seriously, it exploits the randomness of quantum
mechanical events that build up the hardware as well as some other
non-deterministic factors. Here’s how it works:</p>
@@ -223,146 +217,105 @@ non-deterministic factors. Here’s how it works:</p>
<li>while some other counter is not zero, go to step (1)</li>
<li>exit</li>
</ol>
<p>The <code>yarng</code> therefore produces output at a rate of 1 baud.
The number of bits may be specified by an argument and defaults either
to <code>UINT_MAX</code> (least likely) or <code>UINT_MAX+1</code> (most
likely). Extra credit: why the different values? How long would you need
for an empirical test?</p>
<p>The <code>yarng</code> therefore produces output at a rate of 1 baud. The number of
bits may be specified by an argument and defaults either to <code>UINT_MAX</code>
(least likely) or <code>UINT_MAX+1</code> (most likely). Extra credit: why the
different values? How long would you need for an empirical test?</p>
<p>For example:</p>
<div class="sourceCode" id="cb15"><pre
class="sourceCode sh"><code class="sourceCode bash"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> ./yarng 32</span>
<div class="sourceCode" id="cb15"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> ./yarng 32</span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a><span class="ex">10111001010101110110010101001111</span></span>
<span id="cb15-3"><a href="#cb15-3" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> ./yarng 5</span>
<span id="cb15-4"><a href="#cb15-4" aria-hidden="true" tabindex="-1"></a><span class="ex">10011</span></span></code></pre></div>
<h3 id="why-i-think-this-is-obfuscated">Why I think this is
obfuscated</h3>
<h3 id="why-i-think-this-is-obfuscated">Why I think this is obfuscated</h3>
<ul>
<li><p>Ever seen a ‘do for … while’ loop?</p></li>
<li><p>I avoided <code>int</code> like the plague. Instead I used
storage class specifiers (<code>register</code>, <code>auto</code>) to
get implicit <code>int</code>. The Standard allows implicit
<code>int</code> even in casts as you can see in
<code>(void(*)(register))main</code>. Where implicit <code>int</code> is
impossible, like in the <code>int main</code> declaration I have
<code>int</code> split across two lines. All indent programs I use
insert space at the beginning of the continuation line and thereby
introduce a syntax error.</p></li>
<li><p><code>main()</code> (ab)used as a signal handler. Shocking. Yeah,
this leads to undefined behaviour. I have yet to see a system where it
does not work. If it doesn’t work for you, I’d appreciate if you mail me
about it. Uh-oh, Schweikh did it, uttered “Works for me”. Don’t quote me
on that!</p></li>
<li><p>Even if you know how the program works, you just can’t predict
the output.</p></li>
<li><p>Chained use of token pasting operators <code>##</code> with
shuffled arguments.</p></li>
<li><p>So you think you can’t assign to <code>__LINE__</code> and
<code>__FILE__</code>? Not so. The <code>#line</code> preprocessor
directive does the trick. But saying <code>#line 10 "01\n"</code> is a
little lame and I came up with
<code>??=line 10 ONE(O(1,1,2,6,0,6))</code>.</p></li>
<li><p><code>__LINE__</code> is used as the signal number argument to
<code>signal()</code>. If indenting or other editing changes the number
of lines the program is likely to be killed after one second… Thanks to
POSIX for specifying <code>SIGALRM</code> as <code>14</code>. You’re SOL
if your system does not conform. Get a real OS.</p></li>
<li><p>All strings (or characters) needed are crammed into
<code>__FILE__</code> using octal notation and then extracted using
pointer + offset notation.</p></li>
<li><p>Use of a <code>#</code> (null) preprocessor directive (hidden as
a <code>%:</code> digraph) Delete this line and prepare for a core
dump.</p></li>
<li><p>Identifiers reused with different capitalization:
<code>one</code>, <code>One</code>, <code>ONE</code>, <code>zero</code>,
<code>Zero</code>. <code>ONE</code> is particularly nasty because it
appears as a macro taking an arg and as a plain identifier in
<code>main</code>’s parameters. The rule is that whenever
<code>ONE</code> is followed by <code>(</code> it must be the
macro.</p></li>
<li><p>A quote from Kernighan and Plauger, <em>The Elements of
Programming Style</em>, 2nd Ed., page 21:
<code>"A useful way to decide if some piece of code is clear or not is the 'telephone test.' If someone could understand your code when read aloud over the telephone, it's clear enough. If not then it needs rewriting."</code>
Now try the telephone test for ‘one = zero = atoi
(ONE[zero-1])’.</p></li>
<li><p>Don’t you love the aesthetics of symmetry:
<code>write (1, 1+__FILE__+1, 1)</code> (telephone test this as well; is
it 1, One, ONE, one? Maybe won?).</p></li>
<li><p>I avoided <code>int</code> like the plague. Instead I used storage class specifiers
(<code>register</code>, <code>auto</code>) to get implicit <code>int</code>. The Standard allows implicit <code>int</code> even in
casts as you can see in <code>(void(*)(register))main</code>. Where implicit <code>int</code> is
impossible, like in the <code>int main</code> declaration I have <code>int</code> split across two
lines. All indent programs I use insert space at the beginning of the
continuation line and thereby introduce a syntax error.</p></li>
<li><p><code>main()</code> (ab)used as a signal handler. Shocking. Yeah, this leads to undefined
behaviour. I have yet to see a system where it does not work. If it doesn’t work
for you, I’d appreciate if you mail me about it. Uh-oh, Schweikh did it,
uttered “Works for me”. Don’t quote me on that!</p></li>
<li><p>Even if you know how the program works, you just can’t predict the output.</p></li>
<li><p>Chained use of token pasting operators <code>##</code> with shuffled arguments.</p></li>
<li><p>So you think you can’t assign to <code>__LINE__</code> and <code>__FILE__</code>? Not so. The <code>#line</code>
preprocessor directive does the trick. But saying <code>#line 10 "01\n"</code> is a little
lame and I came up with <code>??=line 10 ONE(O(1,1,2,6,0,6))</code>.</p></li>
<li><p><code>__LINE__</code> is used as the signal number argument to <code>signal()</code>. If indenting or
other editing changes the number of lines the program is likely to be killed
after one second… Thanks to POSIX for specifying <code>SIGALRM</code> as <code>14</code>. You’re SOL if
your system does not conform. Get a real OS.</p></li>
<li><p>All strings (or characters) needed are crammed into <code>__FILE__</code> using octal
notation and then extracted using pointer + offset notation.</p></li>
<li><p>Use of a <code>#</code> (null) preprocessor directive (hidden as a <code>%:</code> digraph) Delete
this line and prepare for a core dump.</p></li>
<li><p>Identifiers reused with different capitalization: <code>one</code>, <code>One</code>, <code>ONE</code>, <code>zero</code>,
<code>Zero</code>. <code>ONE</code> is particularly nasty because it appears as a macro taking an arg
and as a plain identifier in <code>main</code>’s parameters. The rule is that whenever
<code>ONE</code> is followed by <code>(</code> it must be the macro.</p></li>
<li><p>A quote from Kernighan and Plauger, <em>The Elements of Programming Style</em>, 2nd
Ed., page 21: <code>"A useful way to decide if some piece of code is clear or not is the 'telephone test.' If someone could understand your code when read aloud over the telephone, it's clear enough. If not then it needs rewriting."</code> Now try
the telephone test for ‘one = zero = atoi (ONE[zero-1])’.</p></li>
<li><p>Don’t you love the aesthetics of symmetry: <code>write (1, 1+__FILE__+1, 1)</code>
(telephone test this as well; is it 1, One, ONE, one? Maybe won?).</p></li>
</ul>
<h3 id="where-does-the-randomness-come-from">Where does the randomness
come from?</h3>
<h3 id="where-does-the-randomness-come-from">Where does the randomness come from?</h3>
<p>Each bit obviously depends on the number of times the loop body is
executed between two calls of the signal handler. But what determines
this number?</p>
<ul>
<li>The accuracy of the clock driving the CPU.</li>
<li>The accuracy of the clock driving the timer responsible for alarm
signals.</li>
<li>On multitasking OSes: The total time the process is scheduled to run
between successive invocations of the signal handler.</li>
<li>The accuracy of the clock driving the timer responsible for alarm signals.</li>
<li>On multitasking OSes: The total time the process is scheduled to run between
successive invocations of the signal handler.</li>
</ul>
<p>How about the randomness of the <code>yarng</code>? To measure these
properties I counted the number of bit sequences and compared them to
what I would expect from a generator with uniform distribution (all
sequences equally likely to occur).</p>
<p>It is interesting to note that <code>yarng</code>’s maximum
deviations are less than or equal to <code>rand(3)</code>’s. Randomness
however tends to degrade under high load averages on my system (Linux).
This could be avoided by allowing the process one second of execution
time instead of wall clock time (using the <code>SIGVTALRM</code> sent
by the virtual timer instead of <code>SIGALRM</code>).</p>
<p>I’m not surprised. <code>Yarng</code> in the end depends on
fluctuations of the electrical field and the heat distribution in the
oscillators, the implementation and state of the scheduling algorithm,
the system load, number and temporal distribution of asynchronous events
and last but not least the phase of the moon. God <em>does</em> play
dice. Type <code>yarng</code> and watch Him roll.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0
License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights
Reserved. You are free to share and adapt this file under the terms of
this license:</p>
<p>How about the randomness of the <code>yarng</code>? To measure these properties I
counted the number of bit sequences and compared them to what I would
expect from a generator with uniform distribution (all sequences
equally likely to occur).</p>
<p>It is interesting to note that <code>yarng</code>’s maximum deviations are less
than or equal to <code>rand(3)</code>’s. Randomness however tends to degrade under
high load averages on my system (Linux). This could be avoided by
allowing the process one second of execution time instead of wall
clock time (using the <code>SIGVTALRM</code> sent by the virtual timer
instead of <code>SIGALRM</code>).</p>
<p>I’m not surprised. <code>Yarng</code> in the end depends on fluctuations of the
electrical field and the heat distribution in the oscillators, the
implementation and state of the scheduling algorithm, the system
load, number and temporal distribution of asynchronous events and
last but not least the phase of the moon. God <em>does</em> play dice.
Type <code>yarng</code> and watch Him roll.</p>
<h2 id="copyright-and-cc-by-sa-4.0-license">Copyright and CC BY-SA 4.0 License:</h2>
<p>This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved.
You are free to share and adapt this file under the terms of this license:</p>
<pre><code>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</code></pre>
<p>For more information, see:
https://creativecommons.org/licenses/by-sa/4.0/</p>
<p>For more information, see: https://creativecommons.org/licenses/by-sa/4.0/</p>
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
<!-- START: this line starts content for HTML phase 22 by: bin/output-index-inventory.sh via bin/md2html.sh -->
<!-- START: this line starts content generated by: bin/output-index-inventory.sh -->
<h1 id="inventory-for-1998schweikh2"><a name="inventory"></a>Inventory
for 1998/schweikh2</h1>
<h1 id="inventory-for-1998schweikh2"><a name="inventory"></a>Inventory for 1998/schweikh2</h1>
<p><a href="#top">Jump to top</a></p>
<h2 id="primary-files">Primary files</h2>
<ul>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1998/schweikh2/schweikh2.c">schweikh2.c</a>
- entry source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1998/schweikh2/Makefile">Makefile</a>
- entry Makefile</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1998/schweikh2/schweikh2.orig.c">schweikh2.orig.c</a>
- original source</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1998/schweikh2/try.sh">try.sh</a>
- how to run</li>
<li><a href="1998_schweikh2.tar.bz2">1998_schweikh2.tar.bz2</a> -
download entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1998/schweikh2/schweikh2.c">schweikh2.c</a> - entry source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1998/schweikh2/Makefile">Makefile</a> - entry Makefile</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1998/schweikh2/schweikh2.orig.c">schweikh2.orig.c</a> - original source</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1998/schweikh2/try.sh">try.sh</a> - how to run</li>
<li><a href="1998_schweikh2.tar.bz2">1998_schweikh2.tar.bz2</a> - download entry source</li>
</ul>
<h2 id="secondary-files">Secondary files</h2>
<ul>
<li><a href="index.html">index.html</a> - entry home page</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1998/schweikh2/.entry.json">.entry.json</a>
- description of entry in JSON</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1998/schweikh2/.gitignore">.gitignore</a>
- list of files that should not be committed under git</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1998/schweikh2/.entry.json">.entry.json</a> - description of entry in JSON</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1998/schweikh2/.gitignore">.gitignore</a> - list of files that should not be committed under git</li>
<li><a href=".path">.path</a> - directory path from top directory</li>
<li><a
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1998/schweikh2/README.md">README.md</a>
- markdown source for index.html</li>
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/1998/schweikh2/README.md">README.md</a> - markdown source for index.html</li>
</ul>
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->