Typo fixes and change 'download entry source' to 'download entry' as it's the tarball, not the source itself. Rebuilt .entry.json and index.html files for all entries.
315 lines
18 KiB
HTML
315 lines
18 KiB
HTML
<!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 -->
|
||
<!-- -->
|
||
<!-- This web page was formed via the tool: bin/readme2index.sh -->
|
||
<!-- -->
|
||
<!-- The content of main section of this web page came from: 2013/dlowe/README.md -->
|
||
<!-- -->
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2013/dlowe/README.md -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2013/dlowe/README.md -->
|
||
<!-- !!! Do not modify this web page, instead modify the file: 2013/dlowe/README.md -->
|
||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||
<!-- -->
|
||
<!-- Markdown content was converted into HTML via 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>2013/dlowe - Best sparkling utility</title>
|
||
<meta name="description" content="2013 IOCCC entry dlowe - Best sparkling utility">
|
||
<meta name="keywords" content="IOCCC, 2013, IOCCC 2013, IOCCC entry, dlowe, Best sparkling utility">
|
||
</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>2013/dlowe - Best sparkling utility</h2>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/header.default.html -->
|
||
<!-- START: this line starts content from: inc/topnav.mid.html -->
|
||
|
||
<div class="topnav">
|
||
<a class="Left" href="../cable3/index.html">← cable3</a>
|
||
<a class="Left" href="../index.html">↑ 2013 ↑</a>
|
||
<a class="Left" href="../endoh1/index.html">endoh1 →</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/temp-test-ioccc/2013/dlowe/dlowe.c">C code</a>
|
||
<a class="Right" href="https://github.com/ioccc-src/temp-test-ioccc/2013/dlowe/Makefile">Makefile</a>
|
||
<a class="Right" href="#inventory">Inventory</a>
|
||
</div>
|
||
|
||
<!-- END: this line ends content from: inc/topnav.mid.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>
|
||
<a href="../../location.html">Location of authors</a>
|
||
</div>
|
||
<hr>
|
||
<div class="sidenav">
|
||
<a href="../../news.html">IOCCC News</a>
|
||
<a href="../../status.html">Contest status</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 20 by: bin/output-index-author.sh via bin/md2html.sh -->
|
||
|
||
<!-- START: this line starts content generated by: bin/output-index-author.sh -->
|
||
|
||
<h2 id="author"><a name="author"></a>Author:</h2>
|
||
<ul>
|
||
<li>Name: <a href="../../authors.html#J_David_Lowe">J. David Lowe</a><br>
|
||
Location: <a href="../../location.html#US">US</a> - <em>United States of America</em> (<em>United States</em>)
|
||
<br><br></li>
|
||
</ul>
|
||
|
||
<!-- END: next line ends content generated by: bin/output-index-author.sh -->
|
||
|
||
<!-- END: this line ends content for HTML phase 20 by: bin/output-index-author.sh via bin/md2html.sh -->
|
||
<!-- 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>
|
||
<h3 id="bugs-and-misfeatures">Bugs and (Mis)features:</h3>
|
||
<p>The current status of this entry is:</p>
|
||
<pre><code>STATUS: INABIAF - please **DO NOT** fix</code></pre>
|
||
<p>For more detailed information see <a href="../../bugs.html#2013_dlowe">2013 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="pp">[</span><span class="ss">number...</span><span class="pp">]</span></span></code></pre></div>
|
||
<p>where <code>[number...]</code> is one or more number, space separated.</p>
|
||
<h2 id="try">Try:</h2>
|
||
<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">./try.sh</span></span></code></pre></div>
|
||
<p>What is different about the above if you do something like:</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="bu">echo</span> <span class="st">'IOCCC winning entry 2013/dlowe'</span> <span class="op">></span> ioccc.txt</span>
|
||
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./try.sh</span></span>
|
||
<span id="cb5-3"><a href="#cb5-3" aria-hidden="true" tabindex="-1"></a><span class="fu">rm</span> <span class="at">-f</span> ioccc.txt</span></code></pre></div>
|
||
<p>?</p>
|
||
<p>To make it simpler to see try showing just the different line like:</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">./diff.sh</span></span></code></pre></div>
|
||
<h2 id="judges-remarks">Judges’ remarks:</h2>
|
||
<p>We liked how this entry used Unicode, specifically UTF-8, in a somewhat
|
||
obfuscated way.</p>
|
||
<p>Also, why doesn’t it crash but instead produces a correct output when called
|
||
with one argument or when all arguments are equal?</p>
|
||
<p>For extra fun, compile and run <a href="fun.c">fun.c</a>:</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">#include </span><span class="im"><stdio.h></span></span>
|
||
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">()</span> <span class="op">{</span></span>
|
||
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">"</span><span class="sc">%d</span><span class="st"> </span><span class="sc">%d</span><span class="st"> </span><span class="sc">%d\n</span><span class="st">"</span><span class="op">,</span> <span class="op">(</span><span class="dt">int</span><span class="op">)(-</span><span class="fl">1.0</span><span class="op">/</span><span class="fl">0.0</span><span class="op">),</span> <span class="op">(</span><span class="dt">int</span><span class="op">)(</span><span class="fl">0.0</span><span class="op">/</span><span class="fl">0.0</span><span class="op">),</span> <span class="op">(</span><span class="dt">int</span><span class="op">)(</span><span class="fl">1.0</span><span class="op">/</span><span class="fl">0.0</span><span class="op">));</span></span>
|
||
<span id="cb7-4"><a href="#cb7-4" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
|
||
<p>with gcc and clang.</p>
|
||
<p>With GCC (4.7.2), we get</p>
|
||
<pre><code>-2147483648 -2147483648 -2147483648</code></pre>
|
||
<p>and with clang (3.3), we get</p>
|
||
<pre><code>-2147483648 0 2147483647</code></pre>
|
||
<p>and with Apple clang version 15.0.0 (clang-1500.0.40.1) in 2023, we get:</p>
|
||
<pre><code>1840985120 -2033041452 35979112</code></pre>
|
||
<p>Which one is correct? :)</p>
|
||
<p>NOTE: <code>make all</code> will compile <a href="fun.c">fun.c</a> but to provide a different compiler
|
||
you can do something like:</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="fu">make</span> CC=clang fun</span></code></pre></div>
|
||
<h2 id="authors-remarks">Author’s remarks:</h2>
|
||
<h3 id="sparkl">sparkl</h3>
|
||
<p>A tiny implementation of command-line
|
||
<a href="https://en.wikipedia.org/wiki/Sparkline">sparkline</a> data visualization.</p>
|
||
<h3 id="synopsis">Synopsis</h3>
|
||
<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">$</span> ./sparkl 0 1 2 3 4 5 6 7</span>
|
||
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a><span class="ex">▁▂▃▄▅▆▇▉</span></span>
|
||
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a></span>
|
||
<span id="cb12-4"><a href="#cb12-4" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> echo <span class="st">"sparkline of file lengths: </span><span class="va">$(</span><span class="fu">wc</span> <span class="at">-c</span> <span class="pp">*</span> <span class="kw">|</span> <span class="fu">awk</span> <span class="st">'{print $1}'</span> <span class="kw">|</span> <span class="fu">xargs</span> ./sparkl<span class="va">)</span><span class="st">"</span></span>
|
||
<span id="cb12-5"><a href="#cb12-5" aria-hidden="true" tabindex="-1"></a><span class="ex">sparkline</span> of file sizes: ▁▁▁▃▃▂▁▂▁▁▉</span></code></pre></div>
|
||
<p>NOTE: this has been provided in <a href="slflen.sh">slflen.sh</a> so you can try:</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">./slflen.sh</span></span></code></pre></div>
|
||
<p>instead (which <a href="try.sh">try.sh</a> also uses).</p>
|
||
<h3 id="description">Description</h3>
|
||
<p>This is a handy little tool for visualizing numeric series from the
|
||
command line, using sparklines. Pass it a numeric series as arguments, and
|
||
<code>sparkl</code> will display a sparkline graph, which you can use to very quickly get a
|
||
sense of the shape of your data.</p>
|
||
<h3 id="limitations">Limitations</h3>
|
||
<ul>
|
||
<li>Crashes with 0 arguments. It’d be trivial to fix, but adds a few bytes to the
|
||
code.</li>
|
||
<li>Produces bogus graphs when given > about 5000 arguments.</li>
|
||
<li>Only works if your terminal is UTF-8 and your font supports the 8 glyphs
|
||
used.</li>
|
||
<li>Produces a few harmless compiler warnings.</li>
|
||
</ul>
|
||
<h3 id="obfuscation">Obfuscation</h3>
|
||
<p>The code is very terse. I was torn between submitting this version, and a
|
||
one-line version compressed using a couple more <code>-D</code> flags.</p>
|
||
<p>Hand-rolled UTF-8 sequence, magic numbers (what’s that 7 for?), meaningless
|
||
variable names, reused variables, and so on.</p>
|
||
<h3 id="acknowledgements">Acknowledgements</h3>
|
||
<p>Edward Tufte invented sparklines (among other things.) Brilliant.</p>
|
||
<p>Zach Holman’s <a href="https://github.com/holman/spark">‘spark’ utility</a> was absolutely
|
||
an inspiration.</p>
|
||
<p>As I was writing up this description, I discovered I’m not the first person to
|
||
write an obfuscated C sparkline utility! Vicent Martí created
|
||
<a href="https://gist.github.com/vmg/1368661">this one</a> years (!) ago. (My
|
||
implementation is completely independent.)</p>
|
||
<!--
|
||
|
||
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
|
||
|
||
You are free to share and adapt this file under the terms of this license:
|
||
|
||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||
|
||
For more information, see:
|
||
|
||
https://creativecommons.org/licenses/by-sa/4.0/
|
||
|
||
-->
|
||
|
||
<!-- 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-2013dlowe"><a name="inventory"></a>Inventory for 2013/dlowe</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/2013/dlowe/dlowe.c">dlowe.c</a> - entry source</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2013/dlowe/Makefile">Makefile</a> - entry Makefile</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2013/dlowe/dlowe.orig.c">dlowe.orig.c</a> - original source</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2013/dlowe/diff.sh">diff.sh</a> - difference tool</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2013/dlowe/fun.c">fun.c</a> - compile and run for extra run</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2013/dlowe/slflen.sh">slflen.sh</a> - generate sparkline of file lengths</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2013/dlowe/try.sh">try.sh</a> - how to run</li>
|
||
<li><a href="2013_dlowe.tar.bz2">2013_dlowe.tar.bz2</a> - download entry</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/2013/dlowe/README.md">README.md</a> - markdown source for index.html</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2013/dlowe/.entry.json">.entry.json</a> - description of entry in JSON</li>
|
||
<li><a href="https://github.com/ioccc-src/temp-test-ioccc/blob/master/2013/dlowe/.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>
|
||
</ul>
|
||
|
||
<!-- END: next line ends content generated by: bin/output-index-inventory.sh -->
|
||
|
||
<!-- END: this line ends content for HTML phase 22 by: bin/output-index-inventory.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 -->
|
||
|
||
<!--
|
||
|
||
Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.
|
||
|
||
You are free to share and adapt this file under the terms of this license:
|
||
|
||
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
|
||
|
||
For more information, see:
|
||
|
||
https://creativecommons.org/licenses/by-sa/4.0/
|
||
|
||
-->
|
||
|
||
<div class="footer">
|
||
<h2>Copyright and CC BY-SA 4.0 License</h2>
|
||
<p>This file and web page is:</p>
|
||
<blockquote><b>Copyright © 1984-2024 by Landon Curt Noll. All Rights Reserved.</b></p></blockquote>
|
||
<p>You are free to share and adapt this file under the terms of this license:</p>
|
||
<blockquote><b>Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</b></blockquote>
|
||
<p>For more information, see:</p>
|
||
<blockquote><a
|
||
href="https://creativecommons.org/licenses/by-sa/4.0/">https://creativecommons.org/licenses/by-sa/4.0/</a></blockquote>
|
||
<h2>Coda</h2>
|
||
<p><a href="https://validator.w3.org/nu/?doc=https%3A%2F%2Fioccc-src.github.io%2Ftemp-test-ioccc%2F2013%2Fdlowe%2Findex.html">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 -->
|