AlexDmitriev's blog

By AlexDmitriev, 3 years ago, In English,

Hi, Codeforces.

Changelog:

  • 0.12
    • Support CLion 2017.1: fix detecting pragma once
  • 0.11
    • Support CLion 2016.3.2: return back to changing only settings for testrunner
  • 0.10
    • Support CLion 2016.3
      • Switch configuration now changes global setting AND setting for testrunner
      • Rewrite task saving so that random exceptions are not thrown
  • 0.9.2
    • Support AtCoder and CodeAcademy parsers
  • 0.9
    • Now includes inlined when they point to inside project (not when they are in quotes as before)

JHelper is plugin for writing contests in C++. You may inline code from your own prewritten library so that you can submit only used code. Besides, it allows to test on tests you've added. it's planned that you'll be able to parse a problem/contest and have all samples tests automatically added.

It's available for CLion

Plugin is completely free. IDE price is 89$/year, but it's free for students, have 30-days free trial and often you can use EAP(smth like beta)-versions for free.

You may download the plugin using JetBrains plugin repository or manually from their site

Some explanations how to use that on wiki. Fell free to ask what is unclear.

Please post bugs and feature requests here or in bug tracker.

Your contributions are also welcome. Possible ways to contribute:

  • Post bugs or feature requests
  • Make wiki more understandable
  • Implement something and create pull request.

It's still possible to make it multilingual (I mean add another programming languages). I am open to discuss that.

Thanks Egor for idea with his Chelper and abra for some code review.

Source code | known bugs | bugtacker | instructions

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

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

Code generation is currently broken in public EAP of CLion. issue on GH

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

I was testing and I got a problem, can you help me ?

http://snag.gy/AifUx.jpg

Thanks in advance.

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

    Did you create output configuration? See wiki for more details.

»
3 years ago, # |
  Vote: I like it -16 Vote: I do not like it

CHelper for Java and JHelper for C++. Interesting names :D

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

Hello Alex, Thanks for making such a tool, and I am trying to set it up to use with CLion. I am having trouble setting up the plugin to generate the code. I have tried following the instructions on the wiki but unfortunately I do not fully understand them I think. I get the following error: Task file not found: Seems your task is in inconsistent state If you could provide any help it would be very much appreciated. Thanks again for the time you spent making this tool!

  • »
    »
    3 years ago, # ^ |
    Rev. 2   Vote: I like it +6 Vote: I do not like it

    Well, you need to create files that are in those boxes and add them in CMakeLists to appropriate configurations.

    I've created example project where it's seems to work: Link to Github

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

      Awesome thank you so much for quick response and help! I downloaded the repository and imported it as a new project and everything works now! Have been using java for all my contests so far with Chelper, but can't wait to now to get better at c++ and use it in contest too with your plugin. Again many thanks for your work!

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

      Also, just one more quick question if you don't mind. In Chelper there is archive button for tasks that one is done with. What is the best way of replicating that workflow in JHelper? Does one just create a folder and then drag the Task.cpp file and Task.task file there when you are done with problem? Thanks!

      • »
        »
        »
        »
        3 years ago, # ^ |
        Rev. 2   Vote: I like it +1 Vote: I do not like it

        Probably, right now is the easiest way to do that. I'm going to implement this in more convenient way but I'm afraid it'll happen not very soon. I usually just delete them:)

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

          Right, makes sense. Just out of curiosity how much work was it to get the plugin to the current state in terms of hours? At some point I would be interested in trying myself to port JHelper/CHelper to PyCharm for use with Python. I imagine it is a decent amount of work to get everything functional, yes?

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

            Well, it took some time:)

            But I believe it will be easier to port my code to python then Java code to C++.

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

Added parsers from CHelper(currently only parser from IDE, not from Chrome) including CodeForces.

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

Chrome extension supported.

For those who use other browsers (Firefox?): it should be quite easy to write similar extension. Almost no logic is required.

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

Can this be integrated with sublime too?

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

Could you please give me some hints about how can I add a problem / contest, how to solve the problem (coding, testing and submitting) with JHelpr in Clion?
I've study your wiki, but I need more obvious details!
Thanks...

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

    First of all you should configure project (or you may download example project from github)

    To add new task you need either use "Add Task" (manually add name and tests) action or Parse contest action (parse tests from Online judge). To make them available you should either add them on toolbar/menu or enable shortcuts for them.

    Fro wiki:

    Make possible to call JHelper action. Yo should do one or both of the following:

    • Add icons of actions to menu or toolbar. Click to the toolbar-Customize menus and toolbars-Main menu/toolbar-Add after-Plugins-JHelper-select all
    • Add shortcuts for actions. Preferences-Keymap-Plugins-JHelper

    Then cpp file with class will be created, you should code here. To run you just choose run configuration and run:)

    Feel free to ask for clarification if it's not clear (but it's better to try first all because some actions are harder to explain than to do:) )

»
3 years ago, # |
  Vote: I like it +16 Vote: I do not like it

CLion version 1.0 is released

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

Awesome work! Couple of questions:
1. Does Topcoder work with this?
2. What is the usual workflow? For every problem(or contest I parse), it tries to make it TaskA, so should I delete my TaskA every-time.
3. I keep getting many "IllegalArgumentException: childPath should be inside a parentPath", though nothing breaks.
4. Where to write stress-test code(like brute-force program and tester/generator)?
5. In GCJ contest, if I select multi-tests with number of tests known, how to get test case number?
6. Where to write pre-processing code, common to all test cases.

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

    Hi

    1. TopCoder is currently not supported. It is in plans but it doesn't really make sense to do it right now while unused coffee elimination is so unstable due to unused code rule
    2. Usually I just delete all tasks between contests. I'm going to do some sort of archivation, but it haven't been done yet.
    3. Could you post stack trace and say when it happens?
    4. Unfortunately there's currently no convenient way to do that. I'm open to your ideas.
      6. You may either put the code in the ctor of solver (and save in member vars) or do that during first function call with static boolean var like
    static bool needcalculate = true;
    if(need calculate) {
    needcalculate = false;
    //calc what you need
    }
    

    The first way is preferable because it will be called for each test (I mean for each test consisting of several test cases).

    5. See 6, you should have testNumber var status either filled by ctor or static var.

»
2 years ago, # |
  Vote: I like it +5 Vote: I do not like it

This is the screenshot: http://postimg.org/image/8gw88dl4b/

This error is on the left side.

C:\Users\Bat-Orgil.clion10\system\cygwin_cmake\bin\cmake.exe --build C:\Users\Bat-Orgil.clion10\system\cmake\generated\cc361857\cc361857\Debug --target all -- -j 4 Scanning dependencies of target output Scanning dependencies of target test Scanning dependencies of target testrunner [ 33%] [ 66%] [100%] Building CXX object CMakeFiles/output.dir/output/main.cpp.o Building CXX object CMakeFiles/test.dir/tasks/TaskA.cpp.o Building CXX object CMakeFiles/testrunner.dir/testrunner/main.cpp.o Linking CXX executable output.exe Linking CXX executable test.exe /usr/lib/gcc/x86_64-pc-cygwin/4.9.3/../../../../lib/libcygwin.a(libcmain.o): In function main': /usr/src/debug/cygwin-2.2.0-1/winsup/cygwin/lib/libcmain.c:39: undefined reference toWinMain' /usr/src/debug/cygwin-2.2.0-1/winsup/cygwin/lib/libcmain.c:39:(.text.startup+0x7f): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `WinMain' collect2: error: ld returned 1 exit status [100%] Linking CXX executable testrunner.exe CMakeFiles/test.dir/build.make:85: recipe for target 'test.exe' failed make[2]: *** [test.exe] Error 1 CMakeFiles/Makefile2:95: recipe for target 'CMakeFiles/test.dir/all' failed make[1]: *** [CMakeFiles/test.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... Built target output [100%] Built target testrunner Makefile:75: recipe for target 'all' failed make: *** [all] Error 2

Other side has this error for every 5 seconds.

2:00:54 PM NullPointerException: update failed for AnAction with ID=name.admitriev.jhelper.actions.SwitchCMakeConfigurationAction

I think I have sth wrong with run/debug configuration. Can you check it? Thanks. Let me know if you need any other details.

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

    First of all, change target (on the setting page opened on the screenshot) from build all to testrunner. If that doesn't help please post content of testrunner/main.cpp

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

      It works perfectly now. Thanks a lot for your great software! :)

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

    As for right side: it should not affect anything, but please post stack trace so that I am able to identify the error (click on error message for that)

»
22 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Released support for local regex input type. Tested only on MacOS, should probably work on Linux.

Please let me know if somebody was able to run it under Windows :)

»
12 months ago, # |
  Vote: I like it +14 Vote: I do not like it

Currently it's known not to work correctly with CLion 2016.3, I'll try to fix this ASAP

»
7 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Is there any way to disable the auto comment system?

  • »
    »
    7 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    If you mean "code generated" header, no, there's no way to disable it, as far as I remember