### AlexDmitriev's blog

By AlexDmitriev, 5 years ago, ,

Hi, Codeforces.

• 0.16.2
• Support CLion 2019.1
• 0.16
• Auto switching to a file when changing task
• Auto selecting task when changing a file
• 0.15
• Fixed running in newer CLion versions
• Move debug/release changer to the combobox with run configurations.
• 0.14
• Update Chelper dependency to support Competitive companion extension.

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.

•
• +64
•

 » 5 years ago, # |   0 Code generation is currently broken in public EAP of CLion. issue on GH
•  » » 5 years ago, # ^ |   0 is there any documentation to know how to use it, please.
•  » » » 5 years ago, # ^ |   0 Yes, there's a wiki.
•  » » 5 years ago, # ^ |   0 Seems to be working now without any fix from me.
 » 5 years ago, # |   0 I was testing and I got a problem, can you help me ?http://snag.gy/AifUx.jpgThanks in advance.
•  » » 5 years ago, # ^ |   0 Did you create output configuration? See wiki for more details.
 » 4 years ago, # |   -16 CHelper for Java and JHelper for C++. Interesting names :D
 » 4 years ago, # | ← Rev. 15 →   0 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!
•  » » 4 years ago, # ^ | ← Rev. 2 →   +6 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
•  » » » 4 years ago, # ^ | ← Rev. 2 →   0 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!
•  » » » 4 years ago, # ^ |   0 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!
•  » » » » 4 years ago, # ^ | ← Rev. 2 →   +1 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:)
•  » » » » » 4 years ago, # ^ |   0 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?
•  » » » » » » 4 years ago, # ^ |   +1 Well, it took some time:)But I believe it will be easier to port my code to python then Java code to C++.
 » 4 years ago, # |   0 Added parsers from CHelper(currently only parser from IDE, not from Chrome) including CodeForces.
 » 4 years ago, # |   0 Chrome extension supported. For those who use other browsers (Firefox?): it should be quite easy to write similar extension. Almost no logic is required.
 » 4 years ago, # |   0 Can this be integrated with sublime too?
•  » » 4 years ago, # ^ |   0 I don't think so. It uses API provided by JetBrains IDEs
 » 4 years ago, # |   0 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...
 » 4 years ago, # |   +16 CLion version 1.0 is released
 » 4 years ago, # | ← Rev. 6 →   0 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.
•  » » 4 years ago, # ^ | ← Rev. 2 →   0 Hi 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 Usually I just delete all tasks between contests. I'm going to do some sort of archivation, but it haven't been done yet. Could you post stack trace and say when it happens? 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.
 » 4 years ago, # |   +5 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 2Other side has this error for every 5 seconds.2:00:54 PM NullPointerException: update failed for AnAction with ID=name.admitriev.jhelper.actions.SwitchCMakeConfigurationActionI think I have sth wrong with run/debug configuration. Can you check it? Thanks. Let me know if you need any other details.
•  » » 4 years ago, # ^ |   0 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
•  » » » 4 years ago, # ^ |   0 It works perfectly now. Thanks a lot for your great software! :)
•  » » 4 years ago, # ^ |   0 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)
 » 3 years ago, # |   0 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 :)
 » 2 years ago, # |   +14 Currently it's known not to work correctly with CLion 2016.3, I'll try to fix this ASAP
•  » » 2 years ago, # ^ |   0 Is this fixed? (I have updated CLion to 2016.3 :( )
•  » » » 2 years ago, # ^ |   0 Sorry, but not yet and I'm not sure I'll be do that tally quickly
•  » » 2 years ago, # ^ |   +11 I've added several fixes, it seems to work now.
 » 17 months ago, # |   0 Is there any way to disable the auto comment system?
•  » » 17 months ago, # ^ |   0 If you mean "code generated" header, no, there's no way to disable it, as far as I remember
 » 16 months ago, # |   0 Note, that CLion 2017.3 is not currently supported
 » 16 months ago, # |   0 Recently when my programs print a lot or the testcase input is large, the program often terminates prematurely (but with exit code 0), only in the CLion (2017.2) run field, not in the Debug terminal... Did anyone else encounter this problem?
 » 16 months ago, # |   -10 Help Post, Why my solution was getting WA? Problem My Solution. Why WA Plz Help me. To Find Out Plz.
 » 11 months ago, # | ← Rev. 2 →   0 CLion says,Error running 'testrunner': Cannot run 'testrunner' on ''while I am running a TaskX.cpp file after parsing A contes problems.... :(Link
•  » » 10 months ago, # ^ |   0 Unfortunately last versions of CLion is not (yet) supported. The last supported version is 2017.2 Which version do you use?
•  » » » » 10 months ago, # ^ |   0 No specific plans now, sorry. When I fight my laziness of when somebody will do it instead of myself
•  » » » 10 months ago, # ^ |   0 does it support clion 2017.2.3 ?
•  » » » » 10 months ago, # ^ |   0 Yes
•  » » » » » 10 months ago, # ^ |   0 is there any crome extensions for parse task?? i found chelper parse task crome extensions but it's not working for jhelper.
•  » » » » » » 10 months ago, # ^ |   0 Cheaper plugin should work. Also there is competitive companion
•  » » » » » 10 months ago, # ^ |   0 installation don'e successfully, thanks for your great plugin. is there anyway to save tasks by folders ? each oj has its own folder. or task names become -> "ojName+taskName". can i do any of that?
•  » » » » » » 10 months ago, # ^ |   0 I don't think that's doable now. You can move to different folders after you solved probably
•  » » » » » » » 10 months ago, # ^ |   0 is there anyway to use scanf, and printf instead of in, out ?
•  » » » » » » » » 10 months ago, # ^ |   0 No ( at least no easy way ). Note that when you are testing, it's actually a stringstream. Just add sync_with_stdio(false) and cin.tie (nullptr) and forget about scanf as scary tail.
•  » » » » » » » » » 10 months ago, # ^ |   0 thanks for help
•  » » 9 months ago, # ^ |   0 Now, this problem is (I believe fixed) with JHelper 0.15 and CLion 2018.2
 » 10 months ago, # |   0 i wrote a small math library in mymath.h and when i used some function i found all the functions written in output file(main.cpp). is there any way to just include the function i called ?
•  » » 10 months ago, # ^ |   0 There's setting that allow to remove unused code, but it doesn't work well, so I don't recommend it. You may place them in different headers and then only files you included will be added.
•  » » » 10 months ago, # ^ |   +10 yes i see eliminate code and reformat code, what does each one do exactly ?
•  » » » » 10 months ago, # ^ | ← Rev. 2 →   0 The first one is trying to eliminate unused code, but it has problems (code can become incorrect). The other is reformatting your code according to coding style configured in IDE (basically the same as clicking ctrl+alt+L.
•  » » » » » 10 months ago, # ^ |   0 the problems with eliminate unused code -> are they because a certain way of coding that i may avoid while i write my code ??
•  » » » » » » 10 months ago, # ^ | ← Rev. 2 →   0 Well, the main issue is in using templates, e.g like in this issueAnyway if you want, you may try it, but be ready to turn it off when you get CE. Probability of having other problems (like getting wrong answer) is rather low.
•  » » » » » » » 10 months ago, # ^ |   0 so the general tip here is no templates, yeah!
•  » » » » » » » » 10 months ago, # ^ |   0 Well, I don't think "not using templates like std::vector` with custom types" is better tip than "not using option to eliminate code" but you may choose what fits you best.
•  » » » » » » » » » 10 months ago, # ^ | ← Rev. 4 →   0 i have a lib that has func1, func2, func3, and i called only func3, but for some reasons that i don't know, i found that func1 and func3 are included in main.cpp but func2 aren't included although there is no call of func1 in func3.do you know why ?
•  » » » » » » » » » 10 months ago, # ^ | ← Rev. 3 →   0 No, not really. My code is pretty straightforward. It just finds all the functions that are unused in generated file according to what CLion reports. So, the most probable problem is that CLion shows some pace where it's used. You may try "find usages" IDE function in generated file to check place where it thinks it's used (because it should use the same mechanism).PS: Honestly, I don't think it's reasonable to spend time investigating why it doesn't work, but you can read the code here
•  » » » » » » » » » 10 months ago, # ^ |   0 this is my small lib file https://imgur.com/JGMzVcythis is my task file https://imgur.com/ym71reV i called only gcd functionthis output file https://imgur.com/69QqEb9 bpow function appeared with no reasonthis is find usages in output file for bpow https://imgur.com/rAGJAyf usages only are in library and output and no usages in tasks folder !!
•  » » » » » » » » » 10 months ago, # ^ |   +10 i think i figured the problem.all recursive functions are included even if i didn't use them, and non recursive functions are removed.
•  » » » » » » » » » 10 months ago, # ^ |   0 That's a reasonable explanation
•  » » » » » » » » » 10 months ago, # ^ |   -10 hope u fix it soon, thanks for your help
•  » » » » » » » » » 10 months ago, # ^ |   +31 I'm ready to review your PR.
 » 9 months ago, # |   0 For everybody interested: (I think) I fixed the problem with new version of CLion. After the plugin moderation version 0.15 should work fine with CLion 2018.2
 » 5 months ago, # |   +10 Added some tips&tricks on configuring templates according to your needs.
 » 4 months ago, # | ← Rev. 2 →   0 AlexDmitriev Can you please explain me the 4th step in Configuration section? Where is the configuration window? Please explain whole step :)
•  » » 4 months ago, # ^ |   0 If you did step 2, one of the action is called configuration (and its icon is gearwheel)
 » 5 weeks ago, # |   0 great tool thanks