build missing HTML files for entries
Setup a simple topnav for missing HTML files for entries. Added `bin/gen-other-html.sh` to build entry HTML files from markdown other than README.md to index.html HTML files. Fixed duplicate link text in `2020/ferguson1/gameplay.md`. Improved `inc/md2html.cfg` to support building the missing HTML files for entries. Added `make gen_other_html` to top level Makefile. Added `make gen_other_html` to `make quick_www` and `make www`. Fixed inventory links for year level index.html files. Changed `bin/output-year-index.sh` VERSION from "1.0.1 2024-02-23" to "1.1 2024-02-27". Added missing lines in `manifest.numbers`. Update the affected `.entry.json` files. The manifest (in both `manifest.numbers` and the collection of manifests from of all entry `.entry.json` files) now match. Errors from `make verify_entry_files` will now abort both `make quick_www` and `make www` rules in the top level `Makefile`. Changed markdown files in manifest to have an _inventory_order_ of _2000000000_ so that the `index.html` file will usually appear at the start of the _Secondary files_ set for the "#inventory" section of an entry's `index.html` file. Changed compressed tar files (files that end in _.tar.bz2_) in manifest to have an _inventory_order_ of _100000_ so that these files will usually appear at the end of the _Primary files_ set for the "#inventory" section of an entry's `index.html` file. Added 'Jump to top` link above the _Primary files_ section. Changed `bin/output-index-inventory.sh` VERSION from "1.1.1 2024-02-23" to "1.2 2024-02-27". Updated HTML files to perform the above via `make www`.
This commit is contained in:
1 parent
7babf792e4
commit
9d3438fb88
718 files changed
+17515
-4084
No files matched your search
@@ -9,14 +9,6 @@
|
||||
{ "author_handle" : "Qiming_HOU" }
|
||||
],
|
||||
"manifest" : [
|
||||
{
|
||||
"file_path" : "index.html",
|
||||
"inventory_order" : 10,
|
||||
"OK_to_edit" : false,
|
||||
"display_as" : "html",
|
||||
"display_via_github" : false,
|
||||
"entry_text" : "entry home page"
|
||||
},
|
||||
{
|
||||
"file_path" : "hou.c",
|
||||
"inventory_order" : 20,
|
||||
@@ -121,6 +113,14 @@
|
||||
"display_via_github" : false,
|
||||
"entry_text" : "download entry source"
|
||||
},
|
||||
{
|
||||
"file_path" : "index.html",
|
||||
"inventory_order" : 2000000000,
|
||||
"OK_to_edit" : false,
|
||||
"display_as" : "html",
|
||||
"display_via_github" : false,
|
||||
"entry_text" : "entry home page"
|
||||
},
|
||||
{
|
||||
"file_path" : ".entry.json",
|
||||
"inventory_order" : 4294967295,
|
||||
@@ -159,7 +159,7 @@
|
||||
"OK_to_edit" : true,
|
||||
"display_as" : "markdown",
|
||||
"display_via_github" : true,
|
||||
"entry_text" : "hint document"
|
||||
"entry_text" : "markdown source for hint.html"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!-- START: two lines up starts content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!! DO NOT MODIFY THIS FILE - This file is generated by a tool !!! -->
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<!-- -->
|
||||
<!-- END: this line ends content from: inc/top.default.html -->
|
||||
<!-- -->
|
||||
<!-- The original markdown content was formed by the tool: bin/gen-other-html.sh -->
|
||||
<!-- The HTML was converted from markdown by the tool: bin/md2html.sh -->
|
||||
<!-- -->
|
||||
<!-- START: this line starts content from: inc/head.default.html -->
|
||||
|
||||
<head>
|
||||
<link rel="stylesheet" href="../../ioccc.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
<title>The International Obfuscated C Code Contest</title>
|
||||
<meta name="description" content="hint.md for 2012/hou">
|
||||
<meta name="keywords" content="IOCCC, 2012/hou, hint.md">
|
||||
</head>
|
||||
|
||||
<!-- END: this line ends content from: inc/head.default.html -->
|
||||
<!-- START: this line starts content from: inc/body.default.html -->
|
||||
|
||||
<body>
|
||||
|
||||
<!-- END: this line ends content from: inc/body.default.html -->
|
||||
<!-- START: this line starts content from: inc/header.default.html -->
|
||||
|
||||
<div class="header">
|
||||
<img src="../../png/ioccc.png" alt="IOCCC image by Matt Zucker" width=300 height=110>
|
||||
<h1>The International Obfuscated C Code Contest</h1>
|
||||
<h2>hint.md for 2012/hou</h2>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/header.default.html -->
|
||||
<!-- START: this line starts content from: inc/topnav.up2index.html -->
|
||||
|
||||
<div class="topnav">
|
||||
<a class="Left" href="index.html">↑ jump to index.html ↑</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/topnav.up2index.html -->
|
||||
<!-- START: this line starts content from: inc/begin-row.default.html -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-leftcolumn.default.html -->
|
||||
|
||||
<div class="leftcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/sidenav.default.html -->
|
||||
|
||||
<div class="sidenav">
|
||||
<a href="#content">Jump to contents</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="../../index.html">IOCCC Home</a>
|
||||
<a href="../../years.html">Winning Entries</a>
|
||||
<a href="../../authors.html">People who have won</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="../../news.html">IOCCC News</a>
|
||||
<a href="../../faq.html#submit">How to enter the IOCCC</a>
|
||||
<a href="../../faq.html">FAQ</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="../../bugs.html">Bugs & (mis)features</a>
|
||||
<a href="../../faq.html#fix_an_entry">Fixing IOCCC entries</a>
|
||||
<a href="../../faq.html#fix_web_site">Fixing the web site</a>
|
||||
<a href="../../faq.html#fix_author">Fixing author info</a>
|
||||
<a href="../../thanks-for-help.html">Thanks for the help</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="../../judges.html">The IOCCC Judges</a>
|
||||
<a href="../../contact.html">Contacting the IOCCC</a>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="sidenav">
|
||||
<a href="#top">Jump to top</a>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/sidenav.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-leftcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-leftcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/begin-rightcolumn.default.html -->
|
||||
|
||||
<div class="rightcolumn">
|
||||
|
||||
<!-- END: this line ends content from: inc/begin-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/before-content.default.html -->
|
||||
|
||||
<a name="content"></a>
|
||||
|
||||
<!-- END: this line ends content from: inc/before-content.default.html -->
|
||||
<!-- START: this line starts content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||||
|
||||
<h1 id="most-useful-obfuscation">Most useful obfuscation</h1>
|
||||
<p>Qiming Hou<br />
|
||||
<a href="mailto:hqm03ster@gmail.com"
|
||||
class="email">hqm03ster@gmail.com</a><br />
|
||||
<a href="http://www.houqiming.net"
|
||||
class="uri">http://www.houqiming.net</a></p>
|
||||
<h2 id="judges-comments">Judges’ comments:</h2>
|
||||
<h3 id="to-build">To build:</h3>
|
||||
<pre><code>make hou</code></pre>
|
||||
<h3 id="to-run">To run:</h3>
|
||||
<pre><code>./hou syntax-file file-to-process</code></pre>
|
||||
<h3 id="try-unix">Try (Unix):</h3>
|
||||
<p>The results are best viewed in a 80x25 console with ANSI colors.</p>
|
||||
<pre><code>less hou.c
|
||||
|
||||
./hou ansi.txt hou.c | less -r
|
||||
|
||||
./hou chk.txt hou.c | wc
|
||||
|
||||
./hou markdown.txt remarks.markdown > remarks.htm
|
||||
your-browser remarks.htm</code></pre>
|
||||
<h3 id="try-windows">Try (Windows):</h3>
|
||||
<pre><code>copy header.htm hou.htm /y
|
||||
hou html.txt hou.c >> hou.htm
|
||||
start hou.htm</code></pre>
|
||||
<h3 id="selected-judges-remarks">Selected Judges Remarks:</h3>
|
||||
<p>What a versatile entry! It can be used to check the size of IOCCC
|
||||
entries <em>and</em> to publish them as HTML.</p>
|
||||
<p>For extra credit: what is the meaning of the number 2321237?</p>
|
||||
<h2 id="authors-comments">Author’s comments:</h2>
|
||||
<h3 id="disclaimer">Disclaimer</h3>
|
||||
<p>The reviewer may have already noticed that the 2nd page of this
|
||||
program is a dense blob, which is discouraged by the contest rules. We
|
||||
wish to point out that a majority of state-of-art programming editors
|
||||
support syntax highlighting, which should be enabled when reading this
|
||||
entry. Anticipating that the reviewer’s preferred color setting may
|
||||
produce a suboptimal visual effect, a few syntax files are provided to
|
||||
highlight the source code under an author-provided setting, using the
|
||||
submitted program itself. Syntax highlighting would also visually
|
||||
improve the 3rd page.</p>
|
||||
<p>The code may throw a few warnings due to formatting constraints. The
|
||||
author did try to remove warnings under gcc and Visual Studio,
|
||||
though.</p>
|
||||
<p>The author does not own the original anime series where the embedded
|
||||
ASCII arts come from. For comparison, original non-ASCII art depictions
|
||||
of the relevant characters and objects can be found by googling the
|
||||
embedded text messages.</p>
|
||||
<h3 id="syntax-files">Syntax files</h3>
|
||||
<p>The syntax file consists of a number of rewriting rules. Each rule
|
||||
consists of a regular expression, a space, a format string, and a
|
||||
newline. All text matching the regular expression would be replaced by
|
||||
the format string. In case of a conflict, rules appearing earlier would
|
||||
take precedence. One can refer to the original text in the format string
|
||||
using “%s”. Other “%” characters in the format string must be escaped
|
||||
with another “%”. The space character can be used in the regular
|
||||
expression by escaping it with [] or ““.</p>
|
||||
<p>The following regular expression operators are supported:</p>
|
||||
<pre><code>() [] * + ? | ""</code></pre>
|
||||
<p>For example, one can use the following expression to match a certain
|
||||
declaration statement in hou.c:</p>
|
||||
<pre><code>"char"[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*(,[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*)*;</code></pre>
|
||||
<p>The regex engine is also algorithmically efficient. To illustrate the
|
||||
point, ansi.txt contains a pathological expression [2] that guarantees a
|
||||
hang for the competing Perl engine while matching itself. Try to compare
|
||||
these two engines:</p>
|
||||
<pre><code>./hou ansi.txt ansi.txt
|
||||
perl patho.pl < ansi.txt</code></pre>
|
||||
<p>Finally, there are a few limitations…</p>
|
||||
<ul>
|
||||
<li>The only escape sequence supported is and it doesn’t work in
|
||||
[].</li>
|
||||
<li>The maximum file/rule size is a linear function of the hard-coded
|
||||
constant M.</li>
|
||||
<li>Single-character matches at the end of file may be missed.</li>
|
||||
<li>The operator | doesn’t obey precedence rules and some extra ()s may
|
||||
be required.</li>
|
||||
<li>Incorrect syntax files are not tolerated.</li>
|
||||
<li>The program relies on ASCII.</li>
|
||||
</ul>
|
||||
<h3 id="why-obfuscated">Why obfuscated</h3>
|
||||
<p>The first layer of obfuscation comes from the challenge of embedding
|
||||
a large ASCII art in a dense blob. The entire art is composed using only
|
||||
keywords, strings and character constants. That results in a number of
|
||||
otherwise useless defines and quite a number of unconventionally written
|
||||
constants. While the preprocessor may remove the former, the later would
|
||||
remain regardless of beautification and preprocessing.</p>
|
||||
<p>The second layer of obfuscation comes from the need to squeeze a
|
||||
reasonably powerful regex engine into the remaining area that isn’t
|
||||
occupied by excessive keywords and useless constants. To achieve this,
|
||||
the regex compiler is written using the same threaded virtual machine
|
||||
[1] that parses the regex. Due to compiler limitations, the generated VM
|
||||
code also ends up obscured by a large amount of spaghetti branches and
|
||||
virtual thread creations. Finally, the VM in [1] is extended to track
|
||||
multiple expression matches for the actual formatting.</p>
|
||||
<p>As an extra tweak, the text message actually does something useful.
|
||||
Remove the “Make a contract with me” catch line and the program would
|
||||
cease to function.</p>
|
||||
<h3 id="references">References</h3>
|
||||
<p>[1] <a href="http://swtch.com/~rsc/regexp/regexp2.html">Russ Cox,
|
||||
Regular Expression Matching: the Virtual Machine Approach</a></p>
|
||||
<p>[2] <a href="http://swtch.com/~rsc/regexp/regexp1.html">Regular
|
||||
Expression Matching Can Be Simple And Fast (but is slow in Java, Perl,
|
||||
PHP, Python, Ruby, …)</a></p>
|
||||
<hr />
|
||||
<!--
|
||||
(c) Copyright 1984-2015, [Leo Broukhis, Simon Cooper, Landon Curt Noll][judges] - All rights reserved
|
||||
This work is licensed under a [Creative Commons Attribution-ShareAlike 3.0 Unported License][cc].
|
||||
|
||||
[judges]: http://www.ioccc.org/judges.html
|
||||
[cc]: http://creativecommons.org/licenses/by-sa/3.0/
|
||||
-->
|
||||
|
||||
<!-- END: this line ends content for HTML phase 21 by: bin/pandoc-wrapper.sh via bin/md2html.sh -->
|
||||
<!-- START: this line starts content from: inc/after-content.default.html -->
|
||||
|
||||
<!-- END: this line ends content from: inc/after-content.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-rightcolumn.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-rightcolumn.default.html -->
|
||||
<!-- START: this line starts content from: inc/end-row.default.html -->
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/end-row.default.html -->
|
||||
<!-- START: this line starts content from: inc/footer.default.html -->
|
||||
|
||||
<div class="footer">
|
||||
<hr>
|
||||
<h2>Coda</h2>
|
||||
<p><a href="https://validator.w3.org/nu/?doc=#">Nu HTML check this web page</a></p>
|
||||
<p><a href="#top">Jump to top</a> <a href="#content">Jump to Content</a> <a href="#inventory">Jump to Inventory</a></p>
|
||||
</div>
|
||||
|
||||
<!-- END: this line ends content from: inc/footer.default.html -->
|
||||
<!-- START: this line starts content from: inc/bottom.default.html -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- END: this line ends content from: inc/bottom.default.html -->
|
||||
+5
-4
@@ -227,7 +227,7 @@ 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>
|
||||
<aside id="footnotes" class="footnotes footnotes-end-of-document"
|
||||
<section id="footnotes" class="footnotes footnotes-end-of-document"
|
||||
role="doc-endnotes">
|
||||
<hr />
|
||||
<ol>
|
||||
@@ -243,7 +243,7 @@ href="#fnref2" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
|
||||
Cox, Regular Expression Matching: the Virtual Machine Approach</a><a
|
||||
href="#fnref3" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
|
||||
</ol>
|
||||
</aside>
|
||||
</section>
|
||||
|
||||
<!-- 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 -->
|
||||
@@ -252,9 +252,9 @@ href="#fnref3" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
|
||||
|
||||
<h1 id="inventory-for-2012hou"><a name="inventory"></a>Inventory for
|
||||
2012/hou</h1>
|
||||
<p><a href="#top">Jump to top</a></p>
|
||||
<h2 id="primary-files">Primary 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/2012/hou/hou.c">hou.c</a>
|
||||
- entry source</li>
|
||||
@@ -292,6 +292,7 @@ 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/2012/hou/.entry.json">.entry.json</a>
|
||||
- description of entry in JSON</li>
|
||||
@@ -304,7 +305,7 @@ href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2012/hou/README.m
|
||||
- markdown source for index.html</li>
|
||||
<li><a
|
||||
href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2012/hou/hint.md">hint.md</a>
|
||||
- hint document</li>
|
||||
- markdown source for hint.html</li>
|
||||
</ul>
|
||||
|
||||
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
|
||||
|
||||
Reference in new issue
Block a user