Egor's blog

By Egor, 13 years ago, translation, In English
Here is an early alpha version of Contest helper plug-in for Intelli Idea

What this plug-in does:
  • Inline classes from your library into single file
  • Eliminates unused code from it
  • Stores tests and then you can test your solution on all of them with one click

Known bugs:
  • Sometimes "Delete task" do not delete .task file. You can do taht manually
  • Do not removes unused methods that are cyclically called
  • Never removes method that implements interface/overriding super method if class is retained and super class is retained
  • Never removes main method no matter what signature it has
  • Do not supports static imports
Use it at your own risk
Plug-in is supplied with project that has structure needed for this plug-in. It also contains 3 sample tasks - 2 plain and 1 TopCoder style
How to use:
  1. Add plug-in buttons on main toolbar (Customize Menus and Toolbars -> Main Toolbar -> Add after... -> Plug-ins -> Contest helper)
  2. Press "New Task".
  3. New class will be created where you must implement solve interface. Arguments for this interface are test case index (1 based), InputReader and PrintWriter. You may extend capabilities of InputReader by editing corresponding class in utils module
  4. "Edit test" allows you to add and edit tests for current task
  5. When you want to run or debug code on your tests push "Run Task" button. After it finish it work you may run one of predifined configurations (Run - for running created file from module test and Debug - for debugging in module main/lib. Same with Tester runs/debugs on tests you enetered)
  6. You need to do "Run Task" every time you entered new test/before submitting to server (it is advised to do it after each change to avoid forgetting doing it before submitting)
  7. You need to submit file "Main.java" from module test to server
For TopCoder you need to have some plug-in that creares code locally (e. g. moj) and set target dirrectory for FileEditor to root of module topcoder. Remember to push "Run task: before compiling in arena
Your library classes must be in module library in non-default package.

Links for download:

Source code is here. It is pretty dirty

Any feedback appretiated

Update: installation - put plug-in file to dirrectory %user dir%\.IntelliJIdea10\config\plugins  and restart Idea

Update 2: Next version released. If you allready downloaded prohect you only need to copy files main/Tester.java, test/Tester.java и utils/main/net/egork/utils/checker/Checker.java
Changes:
Button Restore Task restroes choosen task from package unsorted
Task file is synchronised with disk before Run Task
You can add tests from code using generateTests method of checker
You can test only on subset of tests - pass their number as command line arguments

Update 3: Small uncritical fix released. You only need to update plug-in, no changes to project
  • Vote: I like it
  • +23
  • Vote: I do not like it

13 years ago, # |
  Vote: I like it 0 Vote: I do not like it
...  I see "Eliminates unused code" is very useful...
but I do not know how to use it .... does it can use as a normal TopCoder Plug-in?.
... or a Tools ..in other way..
and does it has a cpp version ..?
  • 13 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    It is plug-in for Intellij Idea, IDE for Java. In order to interact with TopCoder Arena it requires some existing TC plug-in, I recommend moj. Just set source folder in FileEdit to topcoder module of your project.
    No C++ version as Idea do not support it. Also I think considering macroses it is not really possible