Egor's blog

By Egor, 13 years ago, translation, In English

Changes:

Enhancement Add universal interface for task generation
Enhancement Tester: ability to pass message from checker irrespective from verdict type
Defect New Task: default directory should be created if absent
Enhancement Create action to copy full source in order to submit to judges that do not provide file selection as option
Enhancement Task generation: support for CodeChef

Now you can generate single task from archive - enter "contest_number task_number" as id, for example - "128 B". Also CodeChef support is implemented. Problem statements on CodeChef are structured pretty badly, so heuristic algorithm is used to extract test cases, which may lead to extra spaces/new lines or complete fail (i.e. no task may be generated). For last 10 contests every task is generated. For Contest Parser please pass last part of contest url as id (e. g. NOV11), for tasks from archive - problem code (e.g. LCM), for tasks from contests - "contest_id problem_code" (e.g. "NOV11 DOMNOCUT")

Also "Copy Source" action added which just copies Main.java (generated source file) to clipboard. Useful for judges that do not support submitting files

Download link, configuration had not changed
  • Vote: I like it
  • +9
  • Vote: I do not like it

13 years ago, # |
  Vote: I like it +1 Vote: I do not like it
Thanks Egor for the effort. Your help to community is really appreciated.
I tried to setup the plugin. Facing various issues,
- Unable to inline library code into topcoder code.
- Can't find 'Run Task' button
- After i tried couple of things, the CHelper menu title disappeared from Main Menu.
- Now when i try to hit Run against a class, I get the below exception.

configuration file (both USER_DIR\.IntelliJIdea10\config\plugins and PROJ_ROOT_DIR)- http://pastebin.com/F7my1jFR

Exception thrown - http://pastebin.com/erF33zPW

If it is not too much trouble and you have some time to spare, it will be really helpful if you uploaded a screencast with a demo of how to setup your plugin and use it for Topcoder and Codeforces.

Thanks.
  • 13 years ago, # ^ |
      Vote: I like it +3 Vote: I do not like it
    I'll andwer you after today's COCI contest
  • 13 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it
    That exception happens when file associated with task (i.e. Task.java) is deleted. I will wrap it with apporopriate actions (dialog that would suggest to delete task) in the next version
    What is suspectible in your configuration that is TopCoder directory - are you sure it is relative path from project root and source directory in default package?
    I would like to make screencast, but currently do not have access for computer, which has small enough monitor but powerful enough processor.
    • 13 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      Thanks for the prompt reply.
      My Idea Project Name is Contests located at C:\Rajat\Codes\Contests
      Under the project, i have a directory named 'topcoder', which is the 'Module Content Root' for the module 'topcoder'. Under the 'topcoder' folder, I have a regular dir, 'TCProject'. Under TCProject, 'srm' is the 'src folder'. This is the location where the TC Arena Plugin dumps source files.

      Please let me know if i am doing something wrong here.
      • 13 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        Are you sure you use moj as topcoder plug-in?
        In order to inline code you need to run your problem using either Run (Shift+F10) or Debug (Shift+F9)
        • 13 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it
          I use an IDEA plugin, TopcoderParser to generate source. For reading source from file and compiling to arena, i use FileEdit. Does your plugin work with moj only?
          • 13 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it
            I'm not sure - if it generates similar code (i.e. my parser able to parse tests from code generated by your plugin) - it should be ok. TopCoder tasks should generate automatically when you open task in arena if it correctly parsed. My own TC plug-in which would just pass needed info to Idea plugin is in plans
            • 13 years ago, # ^ |
                Vote: I like it 0 Vote: I do not like it
              Here is the sample stub generated for Topcoder problems,
              http://pastebin.com/AtcXB67r

              And here is RETester.java which resides in the same package (default package) in the source folder ('srm')
              • 13 years ago, # ^ |
                  Vote: I like it 0 Vote: I do not like it
                Defenately would not work - try using moj. It also works with FileEdit and CodeProcessor
                • 13 years ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it
                  I will try that and update the thread. Although, do you think this will solve the issue of the exception being thrown by the Intellij too?
                  • 13 years ago, # ^ |
                      Vote: I like it 0 Vote: I do not like it
                    Exception is thrown because you tried to run task without associated .java file (I think, you tried to create task manually)
                    • 13 years ago, # ^ |
                        Vote: I like it 0 Vote: I do not like it
                      Where does it expect the .java file to be. I tried to run task by hitting the green play button (which comes in IDEA) against a class which was already there in the topcoder's src dir.
                      • 13 years ago, # ^ |
                          Vote: I like it 0 Vote: I do not like it
                        That java file would be created automatically when you use correct plug-in
                        • 13 years ago, # ^ |
                            Vote: I like it 0 Vote: I do not like it
                          Ok. Let me setup moj and see how it works. It may be because of topcoder problem only, but i havnt been able to use it for Codeforces too. But i think i should try what you suggested before asking more questions. 
                • 13 years ago, # ^ |
                    Vote: I like it 0 Vote: I do not like it
                  I tried with moj. Everything seems to be working fine now. Although there's one last bit piece that annoys. Everytime i restart IDEA, the CHelper menu vanishes from main menu and i have to customize by going to Settings again. Is it expected?
                  • 13 years ago, # ^ |
                      Vote: I like it 0 Vote: I do not like it
                    No, but I never tried to create menu, just added icons to toolbar