Announcing the first JCWren programming challenge! (an idea
shamelessly stolen from amelinda)
Write some code, win a perlmonks.org T-shirt, become
famous1.
The idea:
To have a monthly contest for programming projects
demonstrating some degree of skill, but within the ability of an average monk.
Projects should take at least a few hours to complete, but shouldn't require
skipping work for 3 days. Prizes are fiananced out of my pocket, and are
(currently) in no way related to EDC, other than using them as a source for
merchandise (and they ARE the only ones with PerlMonks T-Shirts).
The challenge:
Implement a Perl program that will read the file
http://headlinenews.cnn.com/QUICKNEWS/virtual/swf.headline.txt
and generate a web page with a 3 column table, the left column with the state
name, the middle column with a date/time stamp, and the right column with the
headline. The script should be able to be run from the cron (*nix) or at
(Windows) scheduler. As new headlines for each state are encountered, they
should be timestamped and added to a database (flat file, using the CPAN module
of your choice. Not mySQL, postGRES, or any other potentially non-portable
database). The webpage should be generated when the script is run, and as such
is considered static. The page should contain a META tag to attempt an
auto-refresh. Above the table should be a list of all states that headlines
have been encountered for, and a HREF tag to that table entry (states with no
headlines should not have an active link). Required command line options are:
- A parameter specifies the refresh interval for the META tag
(default is 10 minutes).
- A parameter to specify the output path and filename (default is
index.html in the current directory).
- A parameter to specify (in minutes) the time before an entry is
aged out of the database (default is 24 hours).
- An option to clear any existing database.
Sample output:
Alabama | Alaska | Georgia | Florida |
Iowa | Kentucky | Michigan | Remaining States
Georgia |
2000/11/28 17:22 |
Major earthquake occurs on little known fault line between Atlanta
and Macon. Trailer parks considered responsible. |
Georgia |
2000/11/28 19:44 |
Lake Sidney Lanier, a major recreational lake, is at a record low.
Many boats now high and dry. |
Michigan |
2000/11/28 17:22 |
Tim Vroom, local hero and humanitarian, takes www.perlmonks.org
commercial, makes millions. |
Note that some state names contain spaces, and should not break. The
date/time stamp should also not break on a space. Extra points2 for
a command line switch that allows font name specification for the text, and
uses them correctly for all text on the page.
The rules:
- Contest starts 2000/12/01 00:00 EST, and ends 2000/12/08 23:59 EST
(unless #2).
- Contest ends on first entry that passes contest criteria rules.
- By submitting an entry, you agree the criteria has been adequately
defined, and is non-contestable.
- Entries must be submitted to jcwren@jcwren.com (tar or zip, please)
- Winning entry will be notified by /msg.
- Entries must run on both Windows and Unix.
- Entries must run under Perl 5.005_05 and below.
- All platform indepedant CPAN modules are fair game.
- Code must contain functioning 'use strict' and -w.
- Output HTML must be legal HTML, and pass common HTML checkers.
- Winning code will be posted to the Code Catacombs (by the author).
- Saint level monks (as of 2000/12/01) are not eligible for contest
prizes.
- Multiple people may work on a submitted entry, but only one prize
will be awarded.
- In the event that PerlMonks T-Shirts are unavailable, other EDC
products may be substituted.
- jcwren will be the judge. In the event of uncertainty, a saint
level monk will be consulted.
I have done my best to create what I think are a fair set of rules, and
within the capabilities of the average monk. If you have a point that needs
clarifying, it needs to be before Friday morning (2000/12/01).
A copy of this page is available at
www.tinymicros.com/contest
1 jcwren cannot be held responsible if fame fails to
occur. Void where prohibited by law, offers may not be combined, cash value
1/10 cent.
2 Extra points are not redeemable for anything useful. But it
does add coolness.
--Chris
e-mail jcwren
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|
|