TopCoder arena plugin

How to use ExampleBuilder Plugin

ExampleBuilder is a CodeProcessor plug-in that, given a ProblemComponentModel, produces code to test the examples in the target language.


The plug-in expects a JVM version 1.4 or later.


The plug-in has been in use for nearly a year in its current incarnation (its previous version that used a parser was in use for about a year before then). I did most of my testing using C# problems. I verified compatibility with Java and C++ on a handful of examples, but no extensive testing has been done.


ExampleBuilder comes with code templates for Java, C++, and C#. The plug-in defines a $MAINBODY$ variable used in the templates. Code templates are important part of the plug-in Ð you must configure your FileEdit with a version derived from one of the templates supplied with the plug-in.


Installing ExampleBuilder

To install ExampleBuilder, you need to install CodeProcessor, and configure it with an editor of your choice. See instructions below for configuring CodeProcessor to use ExampleBuilder and FileEdit.

  1. Download the latest CodeProcessor.jar, FileEdit.jar, and ExampleBuilder.jar from the TopCoder's web site
  2. Start the TopCoder Arena applet
  3. From the Options menu, choose Editor to open Editor Preferences
  4. In Editor Preferences, Click [Add]
  5. Enter Name = ExampleBuilder
  6. Enter EntryPoint = codeprocessor.EntryPoint
  7. Enter ClassPath = <download>/CodeProcessor.jar;<download>/FileEdit.jar;<download> ExampleBuilder.jar, where <download> represents an absolute path to the directory to which you downloaded the jar files.
  8. In Editor Preferences, select ExampleBuilder, and click [Configure] to open CodeProcessor Configuration
  9. Enter Editor EntryPoint = fileedit.EntryPoint
  10. Enter ProcessorClass = tc_plugin.ExampleBuilder
  11. In CodeProcessor Configuration, click [Verify]. The applet should detect that preprocess and getUserDefinedTags methods are present.
  12. In CodeProcessor Configuration, click [Configure] to access FileEdit's configuration page. Make a code template that uses the $MAINBODY$ tag to see the code that ExampleBuilder generates.
  13. Click [Save] and [Close] in all open dialogs
  14. Depending on your language preference, download CodeTemplate.java, CodeTemplate.cpp, or CodeTemplate.cs. Paste the text of the desired template in the FileEdit's configuration window.
  15. If you are running WebStart application, close it; if you are running in a browser, close the instance of the browser that runs the applet.


To verify the installation, go to a practice room and open a problem. Verify that examples are expanded in the output.

Troubleshooting the installation

The most common installation problem is a JVM version mismatch. If you are running The Arena from the browser, go to Java Plugin configuration in the Control Panel, and verify that your default JRE is 1.4. If you are running The Arena in WebStart, go to "File/Preferences, Java" in the WebStart application, and verify that 1.4 is the default JRE version.



Happy coding!
kyky

 

width="728" scrolling="no" height="90" frameborder="0" align="middle" src="http://download1.csdn.net/down3/20070601/01184120111.htm" marginheight="0" marginwidth="0">
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值