improved indentation and whitespace for markdown code blocks
All code blocks in markdown have been intended by at least 4 spaces. We add `--tab-stop=8` to all `pandoc(1)` executions in order to set a better tab stop indentation, especially for tab intended code blocks. Changed `bin/pandoc-wrapper.sh` VERSION from "1.5.3 2024-03-26" to "1.6 2024-03-31". Fixed `1991/brnstnd/sorta.README.md` so that the sorta code is code blocks. Removed unneeded paragraph group in copyright in `inc/footer.default.html`. Fixed excess whitespace after list Author on entry `index.html` page. Changed `bin/output-index-author.sh` VERSION from "1.5.2 2024-03-26" to "1.6 2024-03-31". Performed `make www` to perform the above and test under macOS. TODO: Fix the problem of the initial line of code being extra intended. TODO: Fix excess whitespace around code that is inline.
This commit is contained in:
1 parent
b84c27ce02
commit
a996f8d2b8
734 files changed
+16723
-16963
No files matched your search
+13
-13
@@ -1,14 +1,14 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make
|
||||
make
|
||||
```
|
||||
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
./bmeyer
|
||||
./bmeyer
|
||||
```
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ make
|
||||
In a video window (white text on black background):
|
||||
|
||||
```sh
|
||||
./try.sh
|
||||
./try.sh
|
||||
```
|
||||
|
||||
The script will suggest you compare the output of the program with images,
|
||||
@@ -32,8 +32,8 @@ dashed argument) for compression and decompression! You've been warned.
|
||||
The author recommended on linux/x86, glibc 2.0, libc4/5:
|
||||
|
||||
```make
|
||||
bmeyer: bmeyer.c
|
||||
CC -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm
|
||||
bmeyer: bmeyer.c
|
||||
CC -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm
|
||||
```
|
||||
|
||||
However many compilers use `-O3` as the maximum level for `-O` optimization.
|
||||
@@ -41,8 +41,8 @@ However many compilers use `-O3` as the maximum level for `-O` optimization.
|
||||
And on linux/x86, glibc 2.1:
|
||||
|
||||
```make
|
||||
bmeyer: bmeyer.c
|
||||
gcc -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' $? -o $@ -lm
|
||||
bmeyer: bmeyer.c
|
||||
gcc -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' $? -o $@ -lm
|
||||
```
|
||||
|
||||
Compile with the maximum possible optimization on your system.
|
||||
@@ -81,13 +81,13 @@ ASCII .PGM, depending on what format it was compressed from. For
|
||||
example:
|
||||
|
||||
```sh
|
||||
./glicbawls < michael.pgm > michael.glic
|
||||
./glicbawls < michael.pgm > michael.glic
|
||||
```
|
||||
|
||||
and then
|
||||
|
||||
```sh
|
||||
./glicbawls < michael.glic > michael.decoded.pgm
|
||||
./glicbawls < michael.glic > michael.decoded.pgm
|
||||
```
|
||||
|
||||
As it turns out, `glicbawls` compresses greyscale images (or, more
|
||||
@@ -105,7 +105,7 @@ more than 80 columns, and tell `glicbawls` about it by giving the
|
||||
number of columns as an argument. For example
|
||||
|
||||
```sh
|
||||
./glicbawls 260 <lavabus.pgm >lavabus.glic
|
||||
./glicbawls 260 <lavabus.pgm >lavabus.glic
|
||||
```
|
||||
|
||||
will allow `glicbawls` to use up to 260 columns, which makes things
|
||||
@@ -123,21 +123,21 @@ give the maximum allowed error as an argument, with a dash (`-`)
|
||||
before it. For example:
|
||||
|
||||
```sh
|
||||
./glicbawls -2 < graph.pgm > graph.2.glic
|
||||
./glicbawls -2 < graph.pgm > graph.2.glic
|
||||
```
|
||||
|
||||
will compress in a way that allows decompression with a maximum
|
||||
error of two. You can combine both types of arguments, i.e.:
|
||||
|
||||
```sh
|
||||
./glicbawls -3 180 < graph.pgm >graph.3.glic
|
||||
./glicbawls -3 180 < graph.pgm >graph.3.glic
|
||||
```
|
||||
|
||||
will compress with a maximum error of 3, using a 180 column
|
||||
terminal for the progress display, and:
|
||||
|
||||
```sh
|
||||
./glicbawls -3 180 < graph.3.glic > graph.3maxerr.pgm
|
||||
./glicbawls -3 180 < graph.3.glic > graph.3maxerr.pgm
|
||||
```
|
||||
|
||||
will decompress the result on such a terminal.
|
||||
|
||||
+14
-15
@@ -132,8 +132,7 @@
|
||||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||||
<ul>
|
||||
<li>Name: <a href="../../authors.html#Bernd_Meyer">Bernd Meyer</a><br>
|
||||
Location: <a href="../../location.html#AU">AU</a> - <em>Commonwealth of Australia</em> (<em>Australia</em>)
|
||||
<br><br></li>
|
||||
Location: <a href="../../location.html#AU">AU</a> - <em>Commonwealth of Australia</em> (<em>Australia</em>)</li>
|
||||
</ul>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
|
||||
@@ -142,24 +141,24 @@ Location: <a href="../../location.html#AU">AU</a> - <em>Commonwealth of Australi
|
||||
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||||
|
||||
<h2 id="to-build">To build:</h2>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span></code></pre></div>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="fu">make</span></span></code></pre></div>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./bmeyer</span></span></code></pre></div>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./bmeyer</span></span></code></pre></div>
|
||||
<h2 id="try">Try:</h2>
|
||||
<p>In a video window (white text on black background):</p>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span></code></pre></div>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./try.sh</span></span></code></pre></div>
|
||||
<p>The script will suggest you compare the output of the program with images,
|
||||
prompting you to press any key to continue so that you may do so.</p>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>Don’t even think of supplying different compression factors (the
|
||||
dashed argument) for compression and decompression! You’ve been warned.</p>
|
||||
<p>The author recommended on linux/x86, glibc 2.0, libc4/5:</p>
|
||||
<pre class="make"><code>bmeyer: bmeyer.c
|
||||
CC -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm</code></pre>
|
||||
<pre class="make"><code> bmeyer: bmeyer.c
|
||||
CC -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm</code></pre>
|
||||
<p>However many compilers use <code>-O3</code> as the maximum level for <code>-O</code> optimization.</p>
|
||||
<p>And on linux/x86, glibc 2.1:</p>
|
||||
<pre class="make"><code>bmeyer: bmeyer.c
|
||||
gcc -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' $? -o $@ -lm</code></pre>
|
||||
<pre class="make"><code> bmeyer: bmeyer.c
|
||||
gcc -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' $? -o $@ -lm</code></pre>
|
||||
<p>Compile with the maximum possible optimization on your system.
|
||||
If your system has 80-bit internal representation of floating
|
||||
point values (x86, some Motorola processors) and you want the
|
||||
@@ -185,9 +184,9 @@ output a compressed version to stdout. Feed it a compressed file
|
||||
on stdin, and it will decompress it to stdout — as either raw or
|
||||
ASCII .PGM, depending on what format it was compressed from. For
|
||||
example:</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="ex">./glicbawls</span> <span class="op"><</span> michael.pgm <span class="op">></span> michael.glic</span></code></pre></div>
|
||||
<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="ex">./glicbawls</span> <span class="op"><</span> michael.pgm <span class="op">></span> michael.glic</span></code></pre></div>
|
||||
<p>and then</p>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./glicbawls</span> <span class="op"><</span> michael.glic <span class="op">></span> michael.decoded.pgm</span></code></pre></div>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./glicbawls</span> <span class="op"><</span> michael.glic <span class="op">></span> michael.decoded.pgm</span></code></pre></div>
|
||||
<p>As it turns out, <code>glicbawls</code> compresses greyscale images (or, more
|
||||
precisely, “natural” greyscale images) better than any other
|
||||
program I am aware of (with the exception of the not-yet-published
|
||||
@@ -200,7 +199,7 @@ have trouble recognizing the image, try squinting at it ;-).</p>
|
||||
<p>If you still have trouble, simply use a terminal or xterm with
|
||||
more than 80 columns, and tell <code>glicbawls</code> about it by giving the
|
||||
number of columns as an argument. For example</p>
|
||||
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./glicbawls</span> 260 <span class="op"><</span>lavabus.pgm <span class="op">></span>lavabus.glic</span></code></pre></div>
|
||||
<div class="sourceCode" id="cb8"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./glicbawls</span> 260 <span class="op"><</span>lavabus.pgm <span class="op">></span>lavabus.glic</span></code></pre></div>
|
||||
<p>will allow <code>glicbawls</code> to use up to 260 columns, which makes things
|
||||
much more recognizable.</p>
|
||||
<p>Still running out of space? Need to compress those images just a
|
||||
@@ -213,13 +212,13 @@ error of 2 is allowed, an original pixel value of 37 could be
|
||||
decoded as 35, 36, 37, 38 or 39. In order to use this mode, simply
|
||||
give the maximum allowed error as an argument, with a dash (<code>-</code>)
|
||||
before it. For example:</p>
|
||||
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./glicbawls</span> <span class="at">-2</span> <span class="op"><</span> graph.pgm <span class="op">></span> graph.2.glic</span></code></pre></div>
|
||||
<div class="sourceCode" id="cb9"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./glicbawls</span> <span class="at">-2</span> <span class="op"><</span> graph.pgm <span class="op">></span> graph.2.glic</span></code></pre></div>
|
||||
<p>will compress in a way that allows decompression with a maximum
|
||||
error of two. You can combine both types of arguments, i.e.:</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="ex">./glicbawls</span> <span class="at">-3</span> 180 <span class="op"><</span> graph.pgm <span class="op">></span>graph.3.glic</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="ex">./glicbawls</span> <span class="at">-3</span> 180 <span class="op"><</span> graph.pgm <span class="op">></span>graph.3.glic</span></code></pre></div>
|
||||
<p>will compress with a maximum error of 3, using a 180 column
|
||||
terminal for the progress display, and:</p>
|
||||
<div class="sourceCode" id="cb11"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./glicbawls</span> <span class="at">-3</span> 180 <span class="op"><</span> graph.3.glic <span class="op">></span> graph.3maxerr.pgm</span></code></pre></div>
|
||||
<div class="sourceCode" id="cb11"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./glicbawls</span> <span class="at">-3</span> 180 <span class="op"><</span> graph.3.glic <span class="op">></span> graph.3maxerr.pgm</span></code></pre></div>
|
||||
<p>will decompress the result on such a terminal.</p>
|
||||
<p>But wait, there is more — you can also feed <code>glicbawls</code> .PPM files
|
||||
(i.e. colour images), raw or ASCII, your choice. <code>glicbawls</code> will
|
||||
|
||||
Reference in new issue
Block a user