Egor's blog

By Egor, 12 years ago, In Russian

UPD5: обновите плагин! Формат Codeforces несколько изменился

UPD4: новая версия:

TopCoder fix for UNIX

RCC support

Better non-English characters support

UPD3: новая версия:

TopCoder alternative protocol

Force locale setting to include Locale.setDefault(Locale.US) in generated file

UPD2: в ближайшее время новые бета версии будут распространятся только через plugin repository. При перезапуске Idea, насколько я знаю, плагины обновляются автоматически. Если это по какой-то причине не работает можно скачать свежую версию плагина здесь. Поставить можно либо старым способом (копированием в папку config/plugins), либо Settings -> Plugins -> Install plugin from disk...

Внимание! Это beta версия, которую не очень много тестировали. Используйте на свой страх и риск!

Скачать можно здесь updated

Основные изменения:

  • настройки теперь можно изменить через специальный диалог. При нажатии ОК в этом диалоге так же в classpath добавляются нужная библиотека. Надобность скачивать chelper.properties с сервера пропала (этот файл будет создан автоматически)

  • таска теперь имеет много дополнительных полей, таких как имя контеста и дата. Архивироваться таска будет во вложенную в archiveDirectory папку в зависимости от этих полей. Кроме того, чекер теперь по умолчанию не создается, но его можно выбрать. Поставляются 2 стандартных чекера (потокенный и посимвольный), в потокенном чекере можно через параметры задать максимальную разрешенную ошибку у даблов (пустые параметры — ошибка запрещена, один параметр — ошибка абсолютная или относительная не больше данного числа, два параметра через пробел — первые комбинация букв a и r — соответственно разрешение абсолютной или относительной ошибки, а второй параметр — собственно ограничение). Можно создавать свои чекеры (они должны имплементить интерфейс Checker и иметь конструктор от String, если ввести в соотвествующее поле валидное имя класса он предложит создать "рыбу" кнопкой Create), аналогично к каждой задаче можно добавлять неограниченное число генераторов тестов (должны имплементить интерфейс TestProvider). В тестах теперь можно не указывать ответ (в этом случае стандартные чекеры будут возвращать вердикт Unknown). Старые таски при переезде потеряются к сожалению, но юнит тесты продолжать работать. Рекомендую заархивировать все текущие таски перед установкой

  • таску теперь можно восcтановить из архива

  • переработано меню парсинга контестов. EOlimp пока не работает

  • TopCoder Arena теперь надо запускать прямо из идеи, дополнительных плагинов (moj) более устанавливать не надо

Ищется человек, который напишет ко всему этому инструкцию на 2х языках (ну, или хотя бы на одном), так же интересна видеоинструкция. Если кто-то хочет поконтрибьютить (особенно парсеры для разных сайтов) — you are welcome, у меня для контрибьюторов есть ключ для IntelliJ Idea Ultimate

UPD: загрузил в репозиторий, теперь плагин можно поставить прямо из Idea

  • Vote: I like it
  • +22
  • Vote: I do not like it

| Write comment?
»
12 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

It raise a NullPointerException when I try to Parse a codeforces contest, but it's OK to prase codechef and timus(I'm using Intellij IDEA 11.2 CE)

»
12 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I noticed some issues with the new plugin.

  1. On topcoder when Div2-medium = Div1-easy, after you open one of them it gives an error ("Something went wrong :(") when you open the other one.
  2. On topcoder I seem to be having some problems when debugging tasks which have to return an array. The array isn't displayed properly.
  3. On codeforces, when I finish a task and move to another, when I press Shift+F9 the IDE(IntelliJ IDEA) debugs the old task. I believe in the old plugin it would change automatically.

Keep up the good work!

  • »
    »
    12 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    1. Will investigate

    2. Will be fixed

    3. Should work, at least in last version

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it
    1. Can't repro. For me it just do not create new task as it would have same name
»
12 years ago, # |
  Vote: I like it 0 Vote: I do not like it

It doesn't work well when I click on "Launch TopCoder Arena" on my mac computer(but it can work on my windows one), it throw a BindException: Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(773,36),absolute(773,36),button=1,modifiers=Button1,clickCount=1] on frame1: java.net.BindException: Permission denied java.lang.RuntimeException: java.net.BindException: Permission denied at net.egork.chelper.actions.TopCoderAction.startServerIfNeeded(TopCoderAction.java:155) at net.egork.chelper.actions.TopCoderAction.actionPerformed(TopCoderAction.java:39) at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:169) at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:133) at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:310) at java.awt.Component.processEvent(Component.java:6140) at java.awt.Container.processEvent(Container.java:2083) at java.awt.Component.dispatchEventImpl(Component.java:4737) at java.awt.Container.dispatchEventImpl(Container.java:2141) at java.awt.Component.dispatchEvent(Component.java:4565) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4619) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4280) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4210) at java.awt.Container.dispatchEventImpl(Container.java:2127) at java.awt.Window.dispatchEventImpl(Window.java:2482) at java.awt.Component.dispatchEvent(Component.java:4565) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:684) at java.awt.EventQueue.access$000(EventQueue.java:85) at java.awt.EventQueue$1.run(EventQueue.java:643) at java.awt.EventQueue$1.run(EventQueue.java:641) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98) at java.awt.EventQueue$2.run(EventQueue.java:657) at java.awt.EventQueue$2.run(EventQueue.java:655) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.awt.EventQueue.dispatchEvent(EventQueue.java:654) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:699) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:534) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:420) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:378) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) Caused by: java.net.BindException: Permission denied at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383) at java.net.ServerSocket.bind(ServerSocket.java:328) at java.net.ServerSocket.(ServerSocket.java:194) at java.net.ServerSocket.(ServerSocket.java:106) at net.egork.chelper.actions.TopCoderAction.startServerIfNeeded(TopCoderAction.java:90) ... 37 more

java.net.BindException: Permission denied at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383) at java.net.ServerSocket.bind(ServerSocket.java:328) at java.net.ServerSocket.(ServerSocket.java:194) at java.net.ServerSocket.(ServerSocket.java:106) at net.egork.chelper.actions.TopCoderAction.startServerIfNeeded(TopCoderAction.java:90) at net.egork.chelper.actions.TopCoderAction.actionPerformed(TopCoderAction.java:39) at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:169) at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:133) at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:310) at java.awt.Component.processEvent(Component.java:6140) at java.awt.Container.processEvent(Container.java:2083) at java.awt.Component.dispatchEventImpl(Component.java:4737) at java.awt.Container.dispatchEventImpl(Container.java:2141) at java.awt.Component.dispatchEvent(Component.java:4565) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4619) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4280) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4210) at java.awt.Container.dispatchEventImpl(Container.java:2127) at java.awt.Window.dispatchEventImpl(Window.java:2482) at java.awt.Component.dispatchEvent(Component.java:4565) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:684) at java.awt.EventQueue.access$000(EventQueue.java:85) at java.awt.EventQueue$1.run(EventQueue.java:643) at java.awt.EventQueue$1.run(EventQueue.java:641) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98) at java.awt.EventQueue$2.run(EventQueue.java:657) at java.awt.EventQueue$2.run(EventQueue.java:655) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.awt.EventQueue.dispatchEvent(EventQueue.java:654) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:699) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:534) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:420) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:378) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Fixed in beta6, will be available on Monday

»
12 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Hi Egor, I need your help!!! I have updated the CHelper plugin but it now fails to load Topcoder code to IntelliJ IDEA :( Do I need to reset sth after update?? Would you like to help me on this issue?? Many thanks!!!

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    You now need to start TopCoder through Idea. New button is added (you need to add it on toolbar)

    • »
      »
      »
      12 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      After adding the new button and clicking it, an exception raises. RuntimeException: Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(724,47),absolute(724,69),button=1,modifiers=Button1,clickCount=1] on frame1: java.net.BindException: Permission denied

      Do I need to set sth?? Also, there is a CHelper editor on my editor lists in TopCoder arena.

»
12 years ago, # |
  Vote: I like it 0 Vote: I do not like it

When achieveing or deleting a TopCoder Task, it didn't delete the java file produced.

  • »
    »
    12 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Will investigate. Any specific TC problem or for any?

    • »
      »
      »
      12 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Normally it produce Main.java, so it's OK. But when using TC it produce (problemname).java, so it's a little inconvenient not to delete it

      • »
        »
        »
        »
        12 years ago, # ^ |
          Vote: I like it +5 Vote: I do not like it

        Ah, this one. It will be deleted on any run (either TC or simple tasks)

        • »
          »
          »
          »
          »
          12 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          I mean the final file(the file submitted to TC), it isn't deleted on either TC or simple tasks(at least on my computer)

          • »
            »
            »
            »
            »
            »
            12 years ago, # ^ |
              Vote: I like it +5 Vote: I do not like it

            Yes, it would be deleted next time you run something

»
12 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

On topcoder if you solve a task during the contest then the task isn't created (nor is it recognised) in the practice room. (again the "Something went wrong :(" error)

  • »
    »
    12 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Is task still in default directory or is it archived/deleted?

    • »
      »
      »
      12 years ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      It's in the default directory. It's working only after I close the problem from topcoder, I debug it (shift-f9) and then it works. If then I debug another task then it doesn't work again. Is this normal?

      P.S.: And by works I mean that it compiles in the arena.

      • »
        »
        »
        »
        12 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Can you please specify steps to reproduce one by one?

      • »
        »
        »
        »
        12 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Oh, I think I got it. You opens problem in arena and tries to compile it. Only the last runned problem in idea is "built" — i. e. ready for compiling/submitting to server, so yes — you need to either run or debug problem locally before submiting