The coding contest got started about an hour ago - people have been filtering in and sitting down to try it out. Here's the contest (or download the description and example file here):
Christopher Columbus (not having been told that XP is better than CMM) has spent much time
preparing detailed "plan what I'll do then I'll do what I planned - tables of data for his trading venture
to China. Unfortunately an inept assistant has got the schema wrong in his spreadsheets. Several values
that Christopher wants to display as column headings have instead been entered as row cells under
more general column headings. For example, Christopher is looking at a table like
Trade Place Month For Amount
======================================
Gold Peking April silk 50
Gems Canton April spice 175
Gold Peking May tea 20
...
and thinking that to make his points it should look like
April May ...
Trade Place For Amount For Amount
=======================================
Gold Peking silk 50 tea 20
Gems Canton spice 175 ...
or maybe like
Canton Peking ...
Trade Month For Amount Month For Amount
================================================
Gems April spice 175
Gold April-May silk,tea 70
...
Christopher's web presentation to the queen of Spain is due in a little over 4 hours. If you can provide a
model layer and web widget app that lets him redisplay these tables, you can win a lucrative market in
China (or any other place Christopher bumps into en route).
Detailed Technical Spec.
The input is a file of data: values are delimited by tabs, rows by crs. (Values have no internal tabs or crs.)
Each file's first line is of tab-delimited column names. The user selects a given file to operate on via the
web app, which displays its contents in tabular form.
Via the web UI, the user identifies:
Key columns: each unique combination of values in these columns will be a single row in the redisplayed
table.
Conversion column: this column heading will disappear in the redisplayed table. Instead, the unique
values in it will become additional hierarchic column headings, one per set of subcolumns.
Subcolumns: a set of columns on the current table that will reappear under each conversion column
value.
Data types: number, date, string.
When the rearrangement causes values from several cells in the original table to be displayed in one cell
in the new table then the default is that numbers are summed, dates become a time interval and strings
are concatenated with comma separator and with identical values becoming just one value.
(In particular cases, Christopher may decide he wants numbers to be averaged, or shown as the highest
or lowest, instead of summed. He may decide he wants dates to be shown as the earliest or latest
instead of a range. He may decide he wants a different string concatenator than comma. He may decide
that dates or numbers should be shown concatenated as if they were strings. He may decide that strings
should be shown as the first value and an elipsis. If your app could let him do any of
these, it would impress him more.)
[Locale display issues are not part of the task]
Column order: Christopher wants the added columns listed in the right order. Sometimes the rule for this
order will be simple (earliest to latest, alphabetical order, etc.). Sometimes it will be an unusual rule (first
months in each quarter, then middle months in each quarter, then last months in each quarter).
Occasionally, it will be 'all starting with this, then all containing that, then all the rest in
alphabetical order'. And sometimes it will just be 'this one, then these three,
then that one, then all those'.
The table is redisplayed according to the above choices. The new table is written to a file (in
tab-and-cr-delimited format, with column names in the first lines) if the user requests it.
That is the functional spec. Ease of use is also important. Other quality spec points are:
Christopher is trying to impress royalty. The better your widget looks, the better he will like it.
Christopher is a ditherer. He will sometimes get half-way through rearranging a table, then back up a
step or two and go forward again with different choices. He'll like your app better if
that's easy for him to do.
It should not take forever to run. If two apps are comparable in function and look then faster is better.
Other remarks
You've been given an example file to work on. Christopher has other files, too secret to
show you now, that he wants your app to work on as well. They could have many unique unmemorable
code words in the conversion column and in other columns.
You can grab the sample file here.
Oh, you have to be physically present in the Crystal Ballroom at the Sierra Grand to officially compete :)
Technorati Tags:
smalltalk, smalltalk solutions