Files
ioccc/2011/borsanyi
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
..
2023-07-06 21:49:38 -07:00
2020-12-30 16:57:03 -08:00
2020-12-30 16:57:03 -08:00
2020-12-30 16:57:03 -08:00
2024-02-17 08:09:32 -08:00

To build:

    make

Bugs and (Mis)features:

The current status of this entry is:

STATUS: INABIAF - please DO NOT fix

For more detailed information see 2011/borsanyi in bugs.html.

To use:

    ./borsanyi < some_data_file

Try:

    ./try.sh

Judges' remarks:

This is a nice quick histogram plotter. A useful utility when you need to look at the distribution of some data.

Challenges:

You can modify the number of histogram bins and the scaling of the histogram by editing the source. Try to find them!

If you look at the source you will notice that the usual array of histogram bins is missing. The source contains no arrays and it does not use malloc(3) or alloca(3). How does it build the histogram?

While the input does not need to be sorted, the histogram output is sorted. How does it put the data into buckets? Why does it fork(2) 22 times?

Author's remarks:

This small piece of program is meant to be a useful tool, when there are some data around and you need a quick glance at the histogram. I am all too often logged in to a remote machine with slow X connection, and a terminal-based program would be of great help.

Limitations

  • I optimized the output for the data I had around, you might want to adjust for your needs. For a great excess of data points the program will crash (depending on the available stack).
  • Giving too few (distinct) points can also cause crash (or division by zero).
  • The program expects plain numbers separated by white spaces.
  • ASCII is assumed.
  • Some POSIX-like system is assumed (fork() and wait(NULL) are used).
  • Do not give any arguments to the program.
  • Could rounding errors cause the omission of the highest bin? There might be empty bins at the edges.

Obfuscation

  • The program follows a rather unconventional approach to the task of histogram building. The usual array of integers (for the histogram bins) is missing entirely. The data are read once, the range is determined, but the data points are not put in any array. Yet they are remembered, and each of them is put into its own bin afterwards. But where are the bins?
  • I tried to use as few keywords as possible, hence there are no loops.
  • Multi-process approach for optimal use of resources.
  • Some bin size obfuscation.