How to use PopsPack Enhancer Plugin

 

PopsPack is a collection of interesting plugins that enhance the TopCoder applet experience and provide plugin writers some debugging tools.  Please note that some of these plugins use undocumented API’s within the applet and can fail if TopCoder changes anything and is relatively unsupported.  Please also note that these plugins are fully experimental and that you assume any risk or consequences in their use.  The plugins included are:

1)      TalkingApplet – a whole new dimension to the applet

2)      TalkingEditor – an editor that can speak various editor things

3)      AutoLogon – automatically logs onto the applet

4)      AutoDownload – keep your plugins up to date always

5)      PopsProcessor – a CodeProcessor java only test generator

6)      PopsCutter – a CodeProcessor script to eliminate code within predetermined blocks

7)      Debugging Classes – Useful wrappers for debugging editors, code processors and the applet plugin manager

 

TalkingApplet Plugin

Overview

The TalkingApplet plugin adds a whole new dimension to your competition experience.  This plugin allows the applet to speak a number of ‘things’ that you’d normally have to taken independent action – during the competition – to see.  Example: let’s say you are merrily working away on a problem in emacs or some other ide – the admins send out a broadcast message refining the problem statement your are working on.  With the current applet – you need to notice the flashing message button and go through a few double clicks to read it – probably disrupting your train of thought on the solution.  With this plugin – it will simply speak the change to you – allowing you to continue on your solution simultaneously.  The plugin also adds a number of ‘bonus’ things you didn’t have before – warnings when the phase is coming to an end, speaking the whispers sent to you, telling you what room you are moving, etc.

 

Thing of note: this plugin uses undocumented API calls to the applet that can change at TopCoder’s discretion and without warning.  Additionally, this is a purely experimental plugin and I make no guarantees on it’s ability to work nor on it’s affects to the applet – use at your own risk.

 

Requirements

Ø      Requires Java 1.4+

Ø      Requires a JSAPI implementation.

Ø      Fast PC (don’t ask what).  Pauses were noticeable only on applet startup on an Anthlon 1Gz but ran fine otherwise.  On a Intel 4 2.8HT, I don’t see any pauses.

 

Installing the FreeTTS implementation of JSAPI

Go to http://freetts.sourceforge.net to download version 1.1.2 (note: I have not tested out version 1.2 beta and do not know if it will work – try it if you want).  Please follow the Download and Installing – Quickstart directions.  For those who don’t read doc – here is the instructions in a nutshell:

1)      Download the binary distribution and unzip it to some directory

2)      Follow http://freetts.sourceforge.net/docs/jsapi_setup.html to setup JSAPI

a.      Essentially – simply execute jsapi.exe (or jsapi.sh on unix) to extract the JSAPI classes

b.      Copy speech.properties to your home directory (same directory that you find contestapplet.conf)

3)      Execute the Hello World demo (“FreeTTSDir/demo/JSAPI/HelloWorld”) to ensure your installation works

 

Note: please don’t ask me if you have issues with FreeTTS – I probably wouldn’t be able to answer them.  Use the FreeTTS forums for help…

 

Setting up the Plugin in the TopCoder Arena

Setting up this plugin is similar to any other plugin:

Entrypoint is “popspack.popstalk.TalkingApplet”

ClassPath is “PopsPack.jar;{every jar required by JSAPI implementation}”.  If you are using FreeTTS – you’d include every jar in the /lib directory of the FreeTTS installation.

 

The one special thing that must be done is to check the ‘At Startup’ option.  By checking this option, the plugin will start with the applet and integrate itself nicely.

 

Important: After you have specified the above, press the Configure button.  You MUST setup the JSAPI tabs – choosing the engine and voice to use.  If you are using the FreeTTS implementation – choose the “unlimited…” engine and the “kevin16” voice (please note that the Kevin voices are the same regardless of any other settings [gender/age/etc]).  After choosing those, press the TEST button to have the given text spoken.  The first time you do this – it will take awhile to load up (depending of course on the speed of your CPU).  If you hear no voice – check the java console for any messages.  If you hear a voice, press SAVE and exit – you should be good to use the applet once you have closed all browsers and restarted the applet.

 

You can use the “What to Speak” tab to customize what is spoken (and if it is spoken).  This plugin uses java.text.MessageFormat to format the message being said – please read the javadoc on this class to determine what can be done.  If you blank out the message – than the message will effectively be ignored.

 

NOTE:  if you specify a quote in your text – YOU MUST SPECIFY A TWO OF THEM.  Some error exists in the MessageFormat class that gets screwed up on a single quote.

 

Plugin Use

There is nothing to do to use it – simply start the applet.  Whatever items you have checked in the configuration will automatically be done – that’s it!

 

There is an option that allows you to have ALL chat in the room read to you.  Use this option with care – if you do this on a room with alot of chat happening, the chat queue will get back’ed up.  Use this with CAUTION:

 

To have all the chat messages read in your room – simply enter the chat message “chat on” in the chat line and press enter.  To stop the chat from being read – enter the chat message “chat off” in the chat line and press enter.

 

 


TalkingEditor Plugin

Overview

The TalkingEditor plugin is a wrapper around another editor that provides services to speak elements of the problem statement and/or the current source code.

 

Requirements

Ø      Requires Java 1.4+

Ø      Requires a JSAPI implementation. (See installation of FreeTTS above)

Ø      Fast PC (don’t ask what).  Pauses were noticeable only on applet startup on an Anthlon 1Gz but ran fine otherwise.  On a Intel 4 2.8HT, I don’t see any pauses.

 

Setting up the Plugin in the TopCoder Arena

Setting up this plugin is similar to any other plugin:

Entrypoint is “popspack.popstalk.TalkingEditor”

ClassPath is “PopsPack.jar;{every jar required by JSAPI implementation};{your editor classpath}”.  If you are using FreeTTS – you’d include every jar in the /lib directory of the FreeTTS installation.

 

Important: After you have specified the above, press the Configure button.  You MUST setup the JSAPI tabs – choosing the engine and voice to use.  If you are using the FreeTTS implementation – choose the “unlimited…” engine and the “kevin16” voice (please note that the Kevin voices are the same regardless of any other settings [gender/age/etc]).  After choosing those, press the TEST button to have the given text spoken.  The first time you do this – it will take awhile to load up (depending of course on the speed of your CPU).  If you hear no voice – check the java console for any messages. 

 

Specify the entry point of the real editor that will be used.  Please note that you must include that editor’s classpath into this plugin’s classpath in order for it to be properly initialized.

 

Prior to exiting, make sure you have the ‘Default’ checked on this plugin – then press SAVE and exit – you should be good to use the applet once you have closed all browsers and restarted the applet.

 

Plugin Use

This editor plugin adds a set of buttons to the bottom of your editor.  When you first open up a screen – the editor will speak the element that you chose in the configuration.  Pressing any of the buttons will speak that individual element.  You may press the STOP button to immediately stop the current speaking element.  Please note that this plugin does it’s best effort to speak the element chosen – however, it will certainly not be perfect in that the problem description may contain wording or tags that will not be spoken correctly.

 


AutoLogon Plugin

Overview

The plugin takes one of the drudgeries out of the applet by automatically logging you on to the system. 

 

Requirements

Ø      None

 

Setting up the Plugin in the TopCoder Arena

Setting up this plugin is similar to any other plugin:

Entrypoint is “popspack.autologon.AutoLogon”

ClassPath is “PopsPack.jar”

 

You must check the ‘At Startup’ option.  By checking this option, the plugin will be able to log you on at startup.

 

Important: After you have specified the above, press the Configure button.  This is required for you to enter in your userid and password (and the amount of delay).  Please note that you cannot set your delay to less than 3 seconds – this is to allow the sponsor logo to be viewed.

 

There are TWO methods that can be used to automatically log you in:

Robot - The java.awt.Robot class to feed keystrokes into the logon screen.  A side effect to this is if you type, lose the windows focus or do other thing system wise – the keystrokes will likely get lost.  Forcing you to manually logon in.  This method will ‘protect’ you from internal changes that TopCoder implements to the applet but puts you at risk for any visual changes they may make.

 

Direct – This method uses the internal messages of the applet to log you in.  You are at risk if TopCoder implements any changes but will be unaffected by the side effects above.

 

Check the TUNNEL checkbox if you ALWAYS want to use the tunneling option.

 

Plugin Use

The best use of this plugin is to start the applet and do NOTHING until you are correctly logged on.  If you do something while the applet is starting up – it may likely burn some of the keystokes this plugin feeds in – forcing you to log on yourself.

 

WARNING - Your password is stored as clear text within the contestapplet.conf.  Please do NOT use this plugin if you use a shared machine.


AutoDownload Plugin

Overview

The plugin allows you to keep other plugins synchronized with the latest code.  This plugin will simply check the specified URL(s) to see if it has a newer

 

Requirements

Ø      None

 

Setting up the Plugin in the TopCoder Arena

Setting up this plugin is similar to any other plugin:

Entrypoint is “popspack.autodownload.DownloadManager”

ClassPath is “PopsPack.jar”

 

You must check the ‘At Startup’ option.  By checking this option, the plugin will be able to log you on at startup.

 

Important: After you have specified the above, press the Configure button.  This allows you to specify the URL to check and the destination file. 

 

Any other plugin that depends on this synchronization of files CANNOT have it’s startup flag checked.  If it is checked, you may run into issues if the other plugin ‘locks’ the file that needs to be synchronized.

 

Plugin Use

This plugin will automatically check files at startup and will automatically download the files if action is required. 

 

 


PopsProcessor CodeProcessor Script

Overview

This CodeProcessor script will automatically generate test cases for JAVA only.  If the selected language is NOT java, the script does nothing.

 

Requirements

Ø      CodeProcessor v1.0+

 

Setting up the Script

The entry point for the CodeProcessing script is “popspack.processors.PopsProcessor”

 

CodeProcessor Script Use

This plugin will generate two things:

1)      Java test case code to a variable called $MAIN$

2)      Writer Code to a variable called $WRITERCODE$

 

If you use FileEdit or PopsEdit (or other compatible editor), place either (or both) of these variables in your template definition and it will be replaced by the generated code.

 

Please note: this code processor script will surround the generated test case code by the tags specified in PopsCutter (regardless if PopsCutter is installed or not).  If you combine PopsCutter with this script, the generated test case code will automatically be removed when the code is submitted to TC.

 

There is no configuration associated with this processor script.


PopsCutter CodeProcessor Script

Overview

This CodeProcessor script will automatically cut all textual information found between a specified beginning cut tag and an ending cut tag.  This processing script should be put ‘above’ the script that generates the tags (example: if used in combination with PopsProcessor above – the PopsCutter should appear above PopsProcessor in CodeProcessor’s list of scripts).

 

Requirements

Ø      CodeProcessor v2.0

 

Setting up the Script

The entry point for the CodeProcessing script is “popspack.processors.PopsCutter”.

 

This script has a configuration dialog (accessible by pressing the Configure button within CodeProcessor) that will allow you to specify the beginning and ending tags.

 

CodeProcessor Script Use

The script will simply delete any text between the beginning and ending tags.  Note: this implements a simple on/off type of switch (ie hits the begin tag, starts cutting all text until the end tag is reached) and will not support embedded or mismatched tags.


Debugging Stuff

Overview

The debugging stuff is useful for would be editor writers, code processor script writers and people trying to debug the applet’s Plugin Manager.  There are four classes available:

 

Name

EntryPoint

Description

Cacheable Editor

popspack.debug.Cacheable

Tests the applet’s cache ability

NonCacheable Editor

popspack.debug.NonCacheable

Tests the applet’s non-cache ability

Logging Editor

popspack.debug.EntryPoint

A wrapper around another editor that displays (sysout) the interaction (ie method calls) between the applet and an editor

Logging CodeProcessor

popspack.debug.CodeProcessor

A wrapper around another CodeProcessing script that displays (sysout) the interaction (ie method calls) between the CodeProcessor and a CodeProcessor script.

 

#1 and #2 are of little use and are only included if a future applet maintainer needs it.  Both #3 and #4 can be configured (through the configure button) to specify the embedded editor/codeprocessor.  Then all method calls will be logged to the console.