I think I am close to being finished with this month's PGAS revisions.
Here's a rundown of what has changed...

1) You can now optionally upload your solution rather than paste 
it into a textarea.  This is especially useful for solutions with 
special characters but can be used any time.

2) When a golfer uploads a solution, that solution is then attached 
to the referee email as a seperate file to preserve the integrity 
of any special characters.  I am using MIME::Lite to send email with 
attachments and have set the attachment Type to BINARY.

3) I was unable to successfully insert ASCII 0's into MySQL.  It 
would truncate the insert.  To remedy this, I am escaping ASCII 0's 
*after* the solution has been scored, but *before* inserting into 
the database.  Here's the regex I am using:  s/\0/\\0/g;  All other 
characters (ASCII 1-255) are being inserted successfully.

4) I used Eugene's post-mortem suggestions, tweaking them a little 
in order to not escape tabs, newlines or carriage returns.  Here 
is the code being used to display the solutions in the post-mortem:


$code =~ s{([\x01-\x08\x0B\x0C\x0E-\x1f])}
          {'<FONT COLOR="red">^'.($1^"\x40").'</FONT>'}ge;
$code =~ s{([\x7f-\xff])}
          {'<FONT COLOR="red">\x'.ord $1.'</FONT>'}ge;


To submit solutions to help with testing:
http://perlgolf.sourceforge.net/cgi-bin/PGAS/leader.cgi?course=12

To view your test solutions as they would appear in the post-mortem:
http://perlgolf.sourceforge.net/cgi-bin/PGAS/ref_peek.cgi?id=9&secret=pg

To test the referee interface, let me know and I'll set you up.

To view the source code:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/perlgolf/

Thank you for all the feedback and suggestions thus far!
--Dave






Reply via email to