Files
ioccc/2011/akari
Landon Curt Noll 0fa01fd744 add title and abstract to .entry.json and index.html files
We add an initial "_title_" and "_abstract_" to all entry `.entry.json` files.

The `bin/csv2entry.sh` tool reads the `summary.csv` file and
loads the "_title_" and "_abstract_" to entry `.entry.json` files.

Changed `bin/csv2entry.sh` VERSION from "1.3 2024-09-23"
to "1.4 2024-09-27".

Perform `make csv2entry` to perform the above and test under macOS.

The `bin/cvt-submission.sh` tool adds "_title_" and "_abstract_" to the
.entry.json based on the `.info.json` file.

Changed `bin/cvt-submission.sh` VERSION from "1.2 2024-09-23"
to "1.3 2024-09-27".

The `bin/entry2csv.sh` tool forms the `summary.csv` file
based on the "_title_" and "_abstract_" fields found in .entry.json files.

Changed `bin/entry2csv.sh` VERSION from "1.3 2024-09-23"
to "1.4 2024-09-27".

Perform `make entry2csv` to perform the above and test under macOS.

Added `-H` and `header=with-header-3` to the `bin/md2html.cfg`
for the configuration entry for `[12][0-9][0-9][0-9]/*/README.md`.

Changed `bin/md2html.sh` VERSION from "1.6 2024-08-17"
to "1.7 2024-09-27".

All entry `index.html` files now list the "_abstract_" in a new
`<h3>abstract</h3>` header.

Changed `bin/subst.entry-index.sh` VERSION from "1.6 2024-09-23"
to "1.7 2024-09-27".

Removed `summary.csv`.

Added `summary.csv` and `summary.numbers` to `.gitignore`.
Sorted the result with `bin/sgi.sh`.

Perform `make quick_www` to perform the above and test under macOS.

Perform `make www` to perform the above and test under macOS.
2024-09-27 23:40:45 -07:00
..
2020-12-30 16:57:03 -08:00
2023-07-06 21:49:38 -07:00
2020-12-30 16:57:03 -08:00
2024-02-17 08:16:02 -08:00

To build:

    make

To use:

    ./akari [ input_file | - ] [ output_file | - ]  [even]

Try:

    ./try.sh

Judges' remarks:

Akari is an image downsampling utility that accepts 3 input formats:

  • PGM (netpbm greyscale image. Akari only accepts PGM files with the header: P5 <width> <height> 255. Images with extra comments such as the ones produced by GIMP will not be parsed properly.

  • PPM (netpbm RGB image). Only PPM files with the header P6 <width> <height> 255 are accepted.

  • ASCII art (with end of lines in LF bytes only, not CR-LF!)

Anything that is not parsable as PGM or PPM will be downsampled as ASCII art.

Author's remarks:

Akari is an image downsampling utility. She accepts up to 3 arguments:

The first argument is the input image. If it's - or unspecified, Akari will read from stdin.

The second argument is the output image. If it's - or unspecified, Akari will write to stdout.

The third argument, if specified, causes Akari to keep even pixels on even scanlines. By default Akari will keep odd pixels on odd scanlines.

Examples:

    gcc akari.c -o akari
    ./akari < example.ppm > odd_output.ppm
    ./akari - - even < example.ppm > even_output.ppm
    ./akari example.ppm odd_output.ppm

Akari accepts 3 input formats:

  • PGM (netpbm greyscale image. Akari only accepts PGM files with the header: P5 <width> <height> 255. Images with extra comments such as the ones produced by GIMP will not be parsed properly. PPM (netpbm RGB image). Only PPM files with the header P6 <width> <height> 255 are accepted.
  • ASCII art (with end of lines in LF bytes only, not CR-LF)

This is useful for decoding some curiously interlaced images, such as the included example.ppm.

Anything that is not parsable as PGM or PPM will be downsampled as ASCII art. Since the source code is formatted as ASCII art, it's only natural to try:

    ./akari akari.c akari2.c

akari2.c is also a valid C program, and accepts up to 1 argument. By default, this second program reads text from stdin and writes expanded output to stdout. If the extra argument is specified, the output text will also pass through a rot13 filter.

    gcc akari2.c -o akari2
    ./akari2 < input.txt > expanded_output.txt
    ./akari2 rot13 < input.txt > expanded_and_rot13_output.txt

You can combine the two programs together to have just a regular rot13 filter:

    ./akari2 rot13 < input.txt | ./akari > rot13.txt

Of course, we wouldn't stop with just 2 programs, you can downsample the source again and get yet another C program:

    ./akari < akari.c | ./akari > akari3.c

We must go deeper:

    ./akari < akari.c | ./akari | ./akari > akari4.c

akari3.c and akari4.c are still (mostly valid) C programs. gcc -Wall will output a few warnings, but still produce output executables. The output executables each print a message to stdout.

It takes quite a bit of skill and obfuscation to interleave a C program 4 levels deep, it's much easier to interleave something like a brainf#$% program in a C program, for example. For comparison, a brainf#$% program is embedded inside akari.c.