add hack-a-round for language specified markdown code blocks
When language is specified in a markdown code block such as:
````
```c
printf("Hello, world!\n");
```
````
is used, the resulting HTML as produced by `pandoc(1)` combined
with our revised `ioccc.css` is not intent the code block well.
A temporary "_hack-a-round_" is to turn the "markdown code language
specifier" into an HTML comment. For example:
````
```<!---c-->
printf("Hello, world!\n");
```
````
This commits turns off existing markdown code language specifiers
for now, while preserving our ability to restore them in the future
when a better "_hack-a-round_" to the "markdown code language
specifier" problem is found.
The HTML impact if this "_hack-a-round_" is to produce HTML that
looks like this:
```
<pre class="<!---c-->"><code> .. </code></pre>
```
We might be able to create a complex set of classes for each markdown
code language (there won't be very many) in `ioccc.css`, or we might
find a more general CSS (or maybe `pandoc(1)`?) solution.
For now, this hack-a-round will have to do.
This commit is contained in:
1 parent
3919df50fb
commit
b66c79254a
700 files changed
+7052
-7056
No files matched your search
+12
-12
@@ -1,6 +1,6 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
make
|
||||
```
|
||||
|
||||
@@ -19,7 +19,7 @@ For more detailed information see [2011 dlowe bugs](../../bugs.html#2011_dlowe).
|
||||
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./dlowe -<n_iterations> corpus1/ [...] corpus0/ < start.net > trained.net
|
||||
```
|
||||
|
||||
@@ -27,7 +27,7 @@ NOTE: In the above command, the directory args MUST end in a `/`.
|
||||
|
||||
Then to use `trained.net`:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./dlowe file [file ...] < trained.net
|
||||
```
|
||||
|
||||
@@ -36,7 +36,7 @@ Then to use `trained.net`:
|
||||
|
||||
Try these pre-trained networks:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./try.sh
|
||||
```
|
||||
|
||||
@@ -44,7 +44,7 @@ NOTE: The `dlowe-aux-data/` directory, which [try.sh](try.sh) refers to, was
|
||||
created by:
|
||||
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
tar -jxf dlowe-aux-data.tar.bz2
|
||||
```
|
||||
|
||||
@@ -63,7 +63,7 @@ on the C code of entries that were supplied to the 20Th IOCCC.
|
||||
The `ioccc-winlose-trained.net` was trained using the
|
||||
[earlystop.pl](earlystop.pl) tool:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
rm -f ioccc-winlose-trained.net
|
||||
./earlystop.pl ioccc-winlose-trained.net ioccc_won_training/ ioccc_lost_training/ ioccc_won_test/ ioccc_lost_test/
|
||||
```
|
||||
@@ -101,7 +101,7 @@ The resulting `ioccc-winlose-trained.net` file was included in the
|
||||
The [dlowe.c](dlowe.c) was explicitly excluded from this trailing set, so this
|
||||
test is interesting:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./dlowe dlowe.c < dlowe-aux-data/ioccc-winlose-trained.net
|
||||
```
|
||||
|
||||
@@ -127,7 +127,7 @@ data sets on which to test:
|
||||
|
||||
We created the [english-trained.net](dlowe-aux-data/english-trained.net) as follows:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./dlowe -8000 dlowe-aux-data/english-1/ dlowe-aux-data/english-0/ < /dev/null > dlowe-aux-data/english-trained.net
|
||||
```
|
||||
|
||||
@@ -139,7 +139,7 @@ We created the [english-trained.net](dlowe-aux-data/english-trained.net) as foll
|
||||
|
||||
We created the [png-trained.net](dlowe-aux-data/png-trained.net) as follows:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./dlowe -8000 png-1/ png-0/ < /dev/null > dlowe-aux-data/png-trained.net
|
||||
```
|
||||
|
||||
@@ -151,7 +151,7 @@ We created the [png-trained.net](dlowe-aux-data/png-trained.net) as follows:
|
||||
|
||||
We created the [xor-trained.net](dlowe-aux-data/xor-trained.net) as follows:
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./dlowe -8000 dlowe-aux-data/xor-1/ dlowe-aux-data/xor-0/ < /dev/null > dlowe-aux-data/xor-trained.net
|
||||
```
|
||||
|
||||
@@ -189,7 +189,7 @@ The neurons' activation function is the logistic function `1 / (1 + e ^ -x)`.
|
||||
|
||||
### Classifying
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./dlowe file [file ...] < trained.net
|
||||
```
|
||||
|
||||
@@ -205,7 +205,7 @@ trained, but it's geared toward interpretation as a *probability* or a
|
||||
|
||||
### Training
|
||||
|
||||
```sh
|
||||
```<!---sh-->
|
||||
./dlowe -<n_iterations> corpus1/ [...] corpus0/ < start.net > end.net
|
||||
```
|
||||
|
||||
|
||||
+13
-13
@@ -141,23 +141,23 @@ Location: <a href="../../location.html#US">US</a> - <em>United States of America
|
||||
<!-- 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>
|
||||
<pre class="<!---sh-->"><code> make</code></pre>
|
||||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||||
<p>The current status of this entry is:</p>
|
||||
<pre><code> STATUS: missing or dead link - please provide them
|
||||
STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||||
<p>For more detailed information see <a href="../../bugs.html#2011_dlowe">2011 dlowe bugs</a>.</p>
|
||||
<h2 id="to-use">To use:</h2>
|
||||
<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">./dlowe</span> <span class="at">-</span><span class="op"><</span>n_iterations<span class="op">></span> corpus1/ <span class="pp">[</span><span class="ss">...</span><span class="pp">]</span> corpus0/ <span class="op"><</span> start.net <span class="op">></span> trained.net</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./dlowe -<n_iterations> corpus1/ [...] corpus0/ < start.net > trained.net</code></pre>
|
||||
<p>NOTE: In the above command, the directory args MUST end in a <code>/</code>.</p>
|
||||
<p>Then to use <code>trained.net</code>:</p>
|
||||
<div class="sourceCode" id="cb4"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./dlowe</span> file [file ...] <span class="op"><</span> trained.net</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./dlowe file [file ...] < trained.net</code></pre>
|
||||
<h2 id="try">Try:</h2>
|
||||
<p>Try these pre-trained networks:</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="ex">./try.sh</span></span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./try.sh</code></pre>
|
||||
<p>NOTE: The <code>dlowe-aux-data/</code> directory, which <a href="try.sh">try.sh</a> refers to, was
|
||||
created by:</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">tar</span> <span class="at">-jxf</span> dlowe-aux-data.tar.bz2</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> tar -jxf dlowe-aux-data.tar.bz2</code></pre>
|
||||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||||
<p>This entry is a ghoulish example of a brain (dead?) neural network classifier.
|
||||
It comes with a set of corpora for you to try.</p>
|
||||
@@ -166,8 +166,8 @@ It comes with a set of corpora for you to try.</p>
|
||||
on the C code of entries that were supplied to the 20Th IOCCC.</p>
|
||||
<p>The <code>ioccc-winlose-trained.net</code> was trained using the
|
||||
<a href="earlystop.pl">earlystop.pl</a> tool:</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="fu">rm</span> <span class="at">-f</span> ioccc-winlose-trained.net</span>
|
||||
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">./earlystop.pl</span> ioccc-winlose-trained.net ioccc_won_training/ ioccc_lost_training/ ioccc_won_test/ ioccc_lost_test/</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> rm -f ioccc-winlose-trained.net
|
||||
./earlystop.pl ioccc-winlose-trained.net ioccc_won_training/ ioccc_lost_training/ ioccc_won_test/ ioccc_lost_test/</code></pre>
|
||||
<p>where:</p>
|
||||
<ul>
|
||||
<li><p><code>ioccc_won_training/</code>
|
||||
@@ -191,7 +191,7 @@ that did not win were flushed to <code>/dev/null</code>.</p>
|
||||
<a href="dlowe-aux-data.tar.bz2">dlowe-aux-data.tar.bz2</a> tarball.</p>
|
||||
<p>The <a href="dlowe.c">dlowe.c</a> was explicitly excluded from this trailing set, so this
|
||||
test is interesting:</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">./dlowe</span> dlowe.c <span class="op"><</span> dlowe-aux-data/ioccc-winlose-trained.net</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./dlowe dlowe.c < dlowe-aux-data/ioccc-winlose-trained.net</code></pre>
|
||||
<p>NOTE: this is done in <a href="try.sh">try.sh</a>.</p>
|
||||
<p>The match of <a href="dlowe.c">dlowe.c</a> to the lose/win trailed network was:</p>
|
||||
<pre><code> dlowe.c 0.125108</code></pre>
|
||||
@@ -203,7 +203,7 @@ mean it will win or lose a future IOCCC. On the other hand … it just might!</p
|
||||
<p>While we cannot supply you with the losing IOCCC source code, the author did supply a number
|
||||
data sets on which to test:</p>
|
||||
<p>We created the <a href="dlowe-aux-data/english-trained.net">english-trained.net</a> as follows:</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">./dlowe</span> <span class="at">-8000</span> dlowe-aux-data/english-1/ dlowe-aux-data/english-0/ <span class="op"><</span> /dev/null <span class="op">></span> dlowe-aux-data/english-trained.net</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./dlowe -8000 dlowe-aux-data/english-1/ dlowe-aux-data/english-0/ < /dev/null > dlowe-aux-data/english-trained.net</code></pre>
|
||||
<ul>
|
||||
<li><p><a href="dlowe-aux-data/english-0/">dlowe-aux-data/english-0/</a>
|
||||
Non-English (French) text</p></li>
|
||||
@@ -211,7 +211,7 @@ Non-English (French) text</p></li>
|
||||
English (non-French) text</p></li>
|
||||
</ul>
|
||||
<p>We created the <a href="dlowe-aux-data/png-trained.net">png-trained.net</a> as follows:</p>
|
||||
<div class="sourceCode" id="cb12"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./dlowe</span> <span class="at">-8000</span> png-1/ png-0/ <span class="op"><</span> /dev/null <span class="op">></span> dlowe-aux-data/png-trained.net</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./dlowe -8000 png-1/ png-0/ < /dev/null > dlowe-aux-data/png-trained.net</code></pre>
|
||||
<ul>
|
||||
<li><p><a href="dlowe-aux-data/png-0/">dlowe-aux-data/png-0/</a>
|
||||
Non-png (gif) images</p></li>
|
||||
@@ -219,7 +219,7 @@ Non-png (gif) images</p></li>
|
||||
png (non-gif) images</p></li>
|
||||
</ul>
|
||||
<p>We created the <a href="dlowe-aux-data/xor-trained.net">xor-trained.net</a> as follows:</p>
|
||||
<div class="sourceCode" id="cb13"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./dlowe</span> <span class="at">-8000</span> dlowe-aux-data/xor-1/ dlowe-aux-data/xor-0/ <span class="op"><</span> /dev/null <span class="op">></span> dlowe-aux-data/xor-trained.net</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./dlowe -8000 dlowe-aux-data/xor-1/ dlowe-aux-data/xor-0/ < /dev/null > dlowe-aux-data/xor-trained.net</code></pre>
|
||||
<ul>
|
||||
<li><p><a href="dlowe-aux-data/xor-0/">dlowe-aux-data/xor-0</a>
|
||||
Data that XORs to 0</p></li>
|
||||
@@ -242,7 +242,7 @@ which can be trained, using on-line
|
||||
neuron.</p>
|
||||
<p>The neurons’ activation function is the logistic function <code>1 / (1 + e ^ -x)</code>.</p>
|
||||
<h3 id="classifying">Classifying</h3>
|
||||
<div class="sourceCode" id="cb14"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">./dlowe</span> file [file ...] <span class="op"><</span> trained.net</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./dlowe file [file ...] < trained.net</code></pre>
|
||||
<p>To classify files, one specifies a trained network (on <code>stdin</code>) and one or more
|
||||
files to classify. The program will output one line per successfully-classified
|
||||
file to <code>stderr</code>, with the filename and the classification: a number between 0
|
||||
@@ -251,7 +251,7 @@ and 1.</p>
|
||||
trained, but it’s geared toward interpretation as a <em>probability</em> or a
|
||||
<em>confidence</em>.</p>
|
||||
<h3 id="training">Training</h3>
|
||||
<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">./dlowe</span> <span class="at">-</span><span class="op"><</span>n_iterations<span class="op">></span> corpus1/ <span class="pp">[</span><span class="ss">...</span><span class="pp">]</span> corpus0/ <span class="op"><</span> start.net <span class="op">></span> end.net</span></code></pre></div>
|
||||
<pre class="<!---sh-->"><code> ./dlowe -<n_iterations> corpus1/ [...] corpus0/ < start.net > end.net</code></pre>
|
||||
<p><strong>NOTE</strong>: The directory args <strong>must end in a</strong> <code>/</code> for them to work.</p>
|
||||
<p>To train a network, one specifies a starting network (on <code>stdin</code>), two or more
|
||||
corpora (directories containing training data), and the number of training
|
||||
|
||||
Reference in new issue
Block a user