Egor's blog

By Egor, 8 years ago, translation, ,
1. Installation
You need to download plug-in and configuration. Plug-in should go to %home_dir%\.IntelliJIdea10\config\plugins (if directory plugins is absent you need to create it), also you should include chelper.jar to class path of your project (Project Structure -> Dependencies -> Add Single Entry Module Library...). After that you need to edit configuration (see next section) and put it in project root. That's it — you are all set. For TopCoder you would need moj plugin for Arena, manual and download link is here

2. Configuration
As a general note, if some property in configuration represents a folder you must enter relative path from project root (using / instead of )
inputClass - full qualified name of class used for input (like java.util.Scanner). This class should implement method next that returns String — next token from input — and it should have constructor that takes InputStream as only argument
outputClass - full qualified name of class used for output (like java.io.PrintWriter). Ouput class shoud has constructor, that take OuputStream and one that take Writer as parameter and also method close.
excludePackages - comma separated list of package prefixes. Classes from such packages would not be inlined but rather imported. In most cases you should leave it as is
outputDirectory - directory where full source code would be stored. Should be under source and in default package (for example, if you create standart idea project, "src" spould be ok)
author - content of @author tag in. If empty no author tag would be created
archiveDirectory - directory where tasks would be archived. Should not be under source
defaultDirectory - direcory where tasks would be created by default. Should be under source in non-default package (for example src/my/package)
topcoderDirectory - directory where moj puts its TopCoder stubs. Should be under source in default package (e.g. src)
enableUnitTests - should be true if you want unit tests to be created and false otherwise
testDirectory - directory where tests would be stored. Shoud be under source
After configuration change you need to reload project for changes to take effect

3. Actions

Edit Tests (Alt+F5) — opens test editor

Archive Task (Alt+F6) — archives task (deletes all it files and stores them in archive, also creates unit tests if configured to do so)
Parse Contest - creates all tasks for particular contest (currently Codeforces, CodeChef, E-Olimp and Timus are supported).

Codeforces contest_id (131) contest_id letter (131 A) contest_id letter (131 A)
CodeChef contest_code (NOV11) problem_code (GCD2) contest_code problem_code
(NOV11 DOMNOCUT)
Timus contest_id (101) problem_id (1000) contest_id problem_number (101 1)
Copy Source (Alt+F8) — copies content of Main.java to clipboard. This is useful for judges that do not support submission of file

Test type - type of tests — either single test per file, number of tests and then tests themselves or just some tests until some condition is met. You need to throw UnknownError in last case to indicate that there would be no more tests
Input type/Output type - input/output type. Standard — stdin/stdout, Task_id — file input/output with file names %Name%.toLowerCase() + ".in"/".out", Custom — just file input/output, names provided in separate text fields
Heap memory - memory limit
Stack memory - stack size limit (defaults are same as codeforces)

For each task 2 files is creates. In main task class there is one method:
void solve(int testNumber, %input% in, %output% out)
testNumber — 1-based index of test in file
In checker class there are 3 methods:
String check(%input% input, %input% expected, %input% actual)
should return null if answer is correct, non empty string if answer is wrong and empty string to run default checker
double getCertainty()
returns certainty for double comparision in default checker
Collection<? extends Test> generateTests()

For TopCoder tasks the only class would contain method from problem statement. Task would be created automatically when you opens problem in TopCoder client (if moj properly configured)

• +29

 8 years ago, # |   0 Can I use IntelliJIdea to code in C++ ? Are there some plug-in to do that ?
•  8 years ago, # ^ |   0 Unfortunately, noThere is Objective-C IDE form JetBrains which in beta test yet AFAIR
•  8 years ago, # ^ |   0
•  4 years ago, # ^ |   0 Try CLion by JetBrains, same company that produce IntelliJIdea. Currently it is in Early Access Preview.
•  21 month(s) ago, # ^ |   0 You can try CLion.
•  21 month(s) ago, # ^ |   0 It was created years after I made that comment :)Anyway thanks
•  21 month(s) ago, # ^ |   0 You are welcome.
•  7 months ago, # ^ |   0 Hi. What's the plugin name for CLion and how to install it?
•  7 months ago, # ^ |   0
•  7 months ago, # ^ |   0 Thanks. Got it but can't understand the configuration steps.
•  7 months ago, # ^ |   0 Can you send me DM in some messenger so we discuus?
 8 years ago, # |   0 I have a problem,when go add actions , not show me plugin chelper :(,
•  8 years ago, # ^ |   +1 You either had not copied it to correct folder or had not restarted Idea since
•  8 years ago, # ^ |   0 thanks :=) is cool !
•  6 years ago, # ^ |   0 I installed CHelper from Browse Repository and Restarted the IDE after that I Added All CHelper Icons after Main Toolbar From Menus and Toolbars and I opened Edit Project Settings And When I parse Contest And Press OK NullPointerException And Message null is generated I am not be able install It Correctly plz help me...sorry for my English
•  6 years ago, # ^ |   0 Do you have any project open when you click on "Edit Project Settings"?
•  5 years ago, # ^ |   0 Yes i have one project open which i created ...
•  4 years ago, # ^ |   0 I have had the same problem till I right clicked main directory (Default Folder) and marked it as source, then everything now works. The project originally had only src folder marked as source as it was generated with the commandline project template in intelliJ
•  3 years ago, # ^ |   0 This solved it for me. Thanks
•  4 years ago, # ^ |   0 I have the same problem with IntelliJIdea 14.0.3 and CHelper 3.94. Here is the Stack trace :null java.lang.NullPointerException at java.lang.String.replace(String.java:2227) at net.egork.chelper.util.CodeGenerationUtilities.createStub(CodeGenerationUtilities.java:277) at net.egork.chelper.util.FileUtilities.createTaskClass(FileUtilities.java:302) at net.egork.chelper.util.FileUtilities.createIfNeeded(FileUtilities.java:346) at net.egork.chelper.ui.ParseDialog$1.onOk(ParseDialog.java:69) at net.egork.chelper.ui.OkCancelPanel$1.actionPerformed(OkCancelPanel.java:16) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2346) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) at java.awt.Component.processMouseEvent(Component.java:6525) at javax.swing.JComponent.processMouseEvent(JComponent.java:3321) at java.awt.Component.processEvent(Component.java:6290) at java.awt.Container.processEvent(Container.java:2234) at java.awt.Component.dispatchEventImpl(Component.java:4881) at java.awt.Container.dispatchEventImpl(Container.java:2292) at java.awt.Component.dispatchEvent(Component.java:4703) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4533) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462) at java.awt.Container.dispatchEventImpl(Container.java:2278) at java.awt.Window.dispatchEventImpl(Window.java:2739) at java.awt.Component.dispatchEvent(Component.java:4703) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:746) at java.awt.EventQueue.access$400(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:697) at java.awt.EventQueue$3.run(EventQueue.java:691) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86) at java.awt.EventQueue$4.run(EventQueue.java:719) at java.awt.EventQueue$4.run(EventQueue.java:717) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) at java.awt.EventQueue.dispatchEvent(EventQueue.java:716) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:748) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:573) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:384) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109) at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:184) at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:229) at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:227) at java.security.AccessController.doPrivileged(Native Method) at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:227) at java.awt.Dialog.show(Dialog.java:1084) at java.awt.Component.show(Component.java:1654) at java.awt.Component.setVisible(Component.java:1606) at java.awt.Window.setVisible(Window.java:1014) at java.awt.Dialog.setVisible(Dialog.java:1005) at net.egork.chelper.ui.ParseDialog.(ParseDialog.java:221) at net.egork.chelper.ui.ParseDialog.parseContest(ParseDialog.java:266) at net.egork.chelper.actions.ParseContestAction.actionPerformed(ParseContestAction.java:23) at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:164) 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:312) at java.awt.Component.processEvent(Component.java:6290) at java.awt.Container.processEvent(Container.java:2234) at java.awt.Component.dispatchEventImpl(Component.java:4881) at java.awt.Container.dispatchEventImpl(Container.java:2292) at java.awt.Component.dispatchEvent(Component.java:4703) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4533) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462) at java.awt.Container.dispatchEventImpl(Container.java:2278) at java.awt.Window.dispatchEventImpl(Window.java:2739) at java.awt.Component.dispatchEvent(Component.java:4703) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:746) at java.awt.EventQueue.access$400(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:697) at java.awt.EventQueue$3.run(EventQueue.java:691) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86) at java.awt.EventQueue$4.run(EventQueue.java:719) at java.awt.EventQueue$4.run(EventQueue.java:717) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) at java.awt.EventQueue.dispatchEvent(EventQueue.java:716) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:748) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:573) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:384) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
 » 7 years ago, # |   0 So, Egor, you are using IntelliJ IDEA as your main IDE for contests ?Thx :D
 » 7 years ago, # | ← Rev. 2 →   0 I have some problems with your CHelper - plugin :-?I've tried it with both IntelliJ IDEA 11 and 10, and I can't get it workingI did it in order :1. Install IntelliJ IDEA 102. Copy chelper2.33.jar to config/plugins directory3. Add CHelper's actions to the toolbar4. Create new Java Module project (with src directory)5. Copy chelper.properties to src directory6. Add chelper2.33.jar to the new project's classpath7. Try the Chelper's actions ... and it didn't work ...Anybody has the same issue ?Thx alot :)
•  » » 7 years ago, # ^ |   0 Had you restarted Idea after copying chelper.properties?
•  » » » 7 years ago, # ^ |   0 yes, I had :(thx for your reply :D
•  » » » » 7 years ago, # ^ |   0 Just noticed - you copied chelper.properties to src directory, but it should be in project root
•  » » » » » 7 years ago, # ^ |   0 thank you for your support, it's working now :Doh, if i change my settings in chelper.properties, i will also restart the IDE too ?
•  » » » » » » 7 years ago, # ^ |   +3 Yep, would change it in next version
•  » » » » » » » 7 years ago, # ^ |   0 oh, can i have another question, please ?How can I define my own Input Class ? Is there any "template" feature ?
•  » » » » » » » » 7 years ago, # ^ |   +3 You just need to make sure that your class takes InputStream as argument and has method next, which returns next token from input as string. Everything else you can write as you like
•  » » » » » » » » » 7 years ago, # ^ |   0 I mean that how can I put my class definition automatically :-?Should I copy & paste it manually to the Main.java ?
•  » » » » » » » » » 7 years ago, # ^ |   0 You just need to write class and put it somewhere under your source (e.g. in src/nova directory) and then fill nova.MyInputClass under inputClass in chelper.properties
•  » » » » » » » » » 7 years ago, # ^ |   0 thx to your helping, i've got it working :Dalso thx for such an useful, and ... wow plug-in :D :D :D
•  » » » » » » » » » 7 years ago, # ^ | ← Rev. 2 →   0 deleted
•  » » » » » » » » » 5 years ago, # ^ |   0 I did the same thing as you suggested. I created a FastReader class under the src\myPackage folder and pointed the input class to "myPackage.FastReader". No complains from the configuration dialog box as intellisense worked, but the output I get is garbled as you can see in this gist I'm using IntelliJ 13
•  » » 7 years ago, # ^ |   0 I'll look into it
•  » » 7 years ago, # ^ |   0 I too faced the same problem in 531 Div2 -250.
•  » » 7 years ago, # ^ |   0 For SRM 531 D2 250 empty arrays were handled incorrectly. I will fix this ASAP As SRM 530 currently unavailable I'll look into that later
 » 7 years ago, # |   0 There is problem on creating ,parsing contest,none function work from toolbar
•  » » 7 years ago, # ^ |   0 Nothing is working or only contest parsing?
•  » » » 7 years ago, # ^ |   0 Now contest parsing work ,how will it generate automatically Main file,it is not working
•  » » » » 7 years ago, # ^ |   0 This is my chelper.properties file inputClass = java.util.Scanner outputClass = java.io.PrintWriter excludePackages = java.,javax.,com.sun. outputDirectory = src author = Vikash archiveDirectory = archive/unsorted defaultDirectory = src/My topcoderDirectory = topcoder testDirectory = lib/test enableUnitTests = false
•  » » » » 7 years ago, # ^ |   0 It should generate the Main file when you run or debug created configuration
•  » » » » » 7 years ago, # ^ |   0 When I select contest id 131(or any) in codeforces it doesn't generate any thing in default directory
•  » » » » » 6 years ago, # ^ | ← Rev. 2 →   0 Hi Egor. This is my configuration: default dir: src/main Archive dir: archive/unsorted Output dir: src Input class: net.egork.chelper.util.InputReader Output class: net.egork.chelper.util.OutputWriterWhen I click on Run the selected configuration, it successfully generates a Main.java file under src (so src/Main.java). The generated file includes the classes from your library but the methods are empty. This is what I get: class InputReader { public InputReader(java.io.InputStream stream) { /* compiled code */ } public int readInt() { /* compiled code */ } } So, I'm getting compile errors. I installed according to https://code.google.com/p/idea-chelper/wiki/MainPage Intellij IDEA 12.1.4 @ Windowsany hints?UPD: If I leave the output dir empty, it compiles correctly: - before compiling, it yields "outputDirectory should be under source and in default package". - it then generates the file on the project root directory (so, on the same level as the src directory). The file still has empty methods for your library classes with /* compiled code */ bodies. - I created a sample case and it correctly showed me the results on the intellij console.
 » 7 years ago, # |   0 Hi Egor, Can you tell me how the inline functions work...I cannot figure it out..Suppose I have a method isPrime(int) that returns whether the number is prime or not.I want to use it directly and not write the whole thing everytime.I think the inline code does exactly this.But I dont know how to use it.Could you tell me or better demonstrate it with an example???
•  » » 7 years ago, # ^ |   0 You need to create some class, like IntegerUtils and create static method isPrime. Then you can use it in your solutions
•  » » » 7 years ago, # ^ |   0 And where do I have to save that class??
•  » » » » 7 years ago, # ^ |   0 Anywhere it will be visible fromyour solution
•  » » » » » 7 years ago, # ^ |   0 I created a class algorithms in src and a static method isPrime(Object a) in that.Then I compiled it. After that when I go to a Task and write boolean check=algorithms.isPrime((Object)a) ,then it is shown in red .i.e. it cannot compile...What should I do...Should I have to restart??
•  » » » » » » 7 years ago, # ^ |   +2 Are you sure your method was public?
•  » » » » » » » 7 years ago, # ^ |   0 Yes it is public...Do I have to change something in the properties file or put the class in a directory under the src??
•  » » » » » » » » 7 years ago, # ^ |   +1 Well, it should be somewhere under source — just like for any Java project
•  » » » » » » » » » 7 years ago, # ^ |   0 Ok. now its working .When I created a new directory under src and put the class in it.Thanks for the replies and your time:-) The thing I dont like in this is that it is showing all the methods in that class even if it is not called but some other method of that class is called ..Can this be changed??
•  » » » » » » » » » 7 years ago, # ^ |   +1 In the created source (the one you will submit to the server) all unused methods will be removed
•  » » » » » » » » » 7 years ago, # ^ |   0 When I submitted a problem in topcoder SRM 535 using IntegerUtils class it gave an error regarding too much unused code.I think that inline code is not working..Its definatley not working on codechef where I can see my submitted solution
•  » » » » » » » » » 7 years ago, # ^ |   0 That is bug in TopCoder algorithm, I receive that warning quite regular, but never had my submission judged as UCR violation after I started to use Java. Can you point to your codechef submit where inlining/unused code removal had not worked?
•  » » » » » » » » » 7 years ago, # ^ |   0 I have messaged it to you.
•  » » » » » » » » » 7 years ago, # ^ |   0 Check emotionalBlind's comment at the bottom, maybe you have same problem
 » 7 years ago, # |   0 I was solving a problem of Light OJ, but seems unused codes are not removed in my Main File.Here is my code: http://ideone.com/gsgDbHere readLong is not removed, which is actually unused.
•  » » 7 years ago, # ^ |   0 Strange, not repetable on my computer By the way, you can use Test Type: MULTI_TEST, that's exactly why that type was created
•  » » » 7 years ago, # ^ |   0 Did you mean MULTI_NUMBER?BTW, do you suggest me to do anything to make unused code remove working? I'm using chelper2.33.
•  » » » » 7 years ago, # ^ | ← Rev. 2 →   0 YesIt seems for whatever reason Idea considers readLong method as used. Could you open your created source (i.e. Main.java) in Idea and see if method name is grayed out as unused or not?
•  » » » » » 7 years ago, # ^ |   0 Yes, it was grayed out.But problem is resolved now. I changed outputDirectory = src from outputDirectory = src/outputAnd now it's working. Sorry, I think I didn't read the instructions carefully.Thanks for this awesome software.
 » 7 years ago, # | ← Rev. 3 →   0 I changed the properties file and it does work for codeforces and codechef. And when I see my code at the topcoder practise arena it does indeed have the unused codes+every time I run the code for topcoder problems it gives a warning "OutPut directory should be under source and in defualt package " for only topcoder problems but then it runs...What should be done??
•  » » 7 years ago, # ^ |   0 I had the same problem but it seems I had not configured my directories correctly. Now, it's ok. My directories in properties are: outputDirectory = src, archiveDirectory = archive/unsorted, defaultDirectory = src/mypackage, topcoderDirectory = src And make sure moj outputs to your src directory. Thanks for the great plugin, Egor!
 » 7 years ago, # |   0 Thank you for your plugin. It's great.
 » 7 years ago, # | ← Rev. 3 →   0 Thank you for your great work! But I can't find the "%home_dir%.IntelliJIdea10configplugins" means, so I can't continue to set up this plugin in my PC corrcetly.. Help! Thank you!
•  » » 7 years ago, # ^ | ← Rev. 2 →   0 Launch IntelliJ and choose File -> Settings -> Plugins -> Install plugin from disk -> path_to_chelper2.41.jar
•  » » » 7 years ago, # ^ |   0 Thank you for your reply! But I mean I don't know where to mkdir the IntelliJIdea10configplugins, that means I don't what "“%home_dir%" mean. Is it the Home directory "~/"? Thank you!
•  » » » » 7 years ago, # ^ |   0 I fixed path that got broken after markdown introductionYes, that's home directory
•  » » » » » 7 years ago, # ^ |   0 Oh, got it! Thanks all~
•  » » » » » 7 years ago, # ^ |   0 BTW, in the Checker file, there are some imports I can not find in the project.. They are "import net.egork.chelper.task.Test; import net.egork.chelper.tester.Verdict;" And my config is " inputClass = lozy.InputReader outputClass = java.io.PrintWriter excludePackages = java.,javax.,com.sun. outputDirectory = src author = Lozy archiveDirectory = archive/unsorted defaultDirectory = src/cf topcoderDirectory = topcoder testDirectory = lib/test enableUnitTests = false " Is there any problem in my config file or should I do some other works? Thanks a lot!
•  » » » » » » 7 years ago, # ^ |   0 "...also you should include chelper.jar to class path of your project (Project Structure -> Dependencies -> Add Single Entry Module Library…)"
•  » » » » » » » 7 years ago, # ^ | ← Rev. 2 →   0 Sorry for my carelessness... I didn't see the word "also"... Thank you for your reply and your time!
 » 6 years ago, # |   0 how can i use chelper in eclipse IDE ?
•  » » 6 years ago, # ^ |   0 Idea plugins are incompatible with Eclipse
 » 6 years ago, # | ← Rev. 3 →   0 Google That’s an error. Request not allowed from your country That’s all we know. Why? UPD: Fixed!I downloaded it whit VPN. :)
 » 6 years ago, # |   0 Why I can't open and Install ? I have installed Java before !
•  » » 6 years ago, # ^ |   0 You do not need to download anything from Google actually. Just use IntelliJ Idea Plugin repository (and you do understand that this is plugin for IntelliJ Idea, right?)
•  » » » » 6 years ago, # ^ |   0 That's old information. Refer to manual on plugin web site
•  » » » » » 16 months ago, # ^ |   0 can you share the link?
 » 6 years ago, # |   0 When I use static imports in Task class it will not appear in the generated Main class which will produce some compilation errors. Is there a fix (a way to have a predefined Main class)?
•  » » 6 years ago, # ^ |   +3 Static imports are currently not supported
•  » » » 6 years ago, # ^ |   0 Thanks.Is there a way to add permanently import static java.lang.Math.*; import static java.util.Arrays.*; at the beginning of generated Main class?
•  » » » » 6 years ago, # ^ |   0 Currently no
 » 6 years ago, # |   0 Great plugin !
 » 5 years ago, # |   -8 Egor How Can I change the template code that generates automatically in the main? solver class name?
•  » » 5 years ago, # ^ |   -8 You can change solver class name (Main class name), but unable to change generated code
•  » » » 5 years ago, # ^ |   -8 some of the problem's input file is terminated by EOF. How can I handled those problem with CHelper regular test types? I've chose "Number of tests unknown" but it gives me RE :(
•  » » » » 5 years ago, # ^ |   -8 you should throw UnknownError when there's no more test.
•  » » » » » 5 years ago, # ^ |   -8 thank you man, it works...
 » 5 years ago, # | ← Rev. 2 →   0 Egor, great thanks for your plugin, it makes me efficient! I use it on IDEA 12 on MacOS and I have 2 questions: Every time When I submit a task I have to change i/o streams otherwise, I receive next error during submission: java.lang.RuntimeException: java.io.FileNotFoundException: ÑÑÐ°Ð½Ð´Ð°ÑÑÐ½ÑÐ¹ Ð²Ð²Ð¾Ð´ (The system cannot find the file specified) at Main.main(Main.java:22) Sometimes during compilation I receive next error, only main.java removal fixes that: 17:48:32 IllegalStateException: Attempt to modify PSI for non-committed Document!: Attempt to modify PSI for non-committed Document! Thank you for help!
•  » » 5 years ago, # ^ |   0 Well, if judge uses stdin/stdout you should specify those in your task as well I need a look at you chelper.properties
•  » » » 5 years ago, # ^ | ← Rev. 3 →   0 Can you give an example where it is better to do? I change only void solve method. My chelper.properties: inputClass = my.InputReader outputClass = java.io.PrintWriter excludePackages = java.,javax.,com.sun. outputDirectory = src author = MatFack archiveDirectory = archive/unsorted defaultDirectory = src/my topcoderDirectory = topcoder testDirectory = lib/test enableUnitTests = false Thank you a lot for help!
•  » » » » 5 years ago, # ^ |   0 On the first point you need to select "Standard stream" for input/output when you creating task. If you are parsing those should be correct automaticallyOn second point — if you use up to date Idea/plugin — I just don't know what could be wrong
•  » » » » » 5 years ago, # ^ |   0 Ok. I will update and double check. P.S. I am using IDEA 13.
 » 5 years ago, # |   +5 In IDEA 13.1.1 I get the following exception when running a task:17:20:01 IncorrectOperationException: Must not change document outside command or undo-transparent action. See com.intellij.openapi.command.WriteCommandAction or com.intellij.openapi.command.CommandProcessor: Must not change document outside command or undo-transparent action. See com.intellij.openapi.command.WriteCommandAction or com.intellij.openapi.command.CommandProcessorWorks OK in 13.0.
 » 5 years ago, # |   0 When i run the codeforces programm using chelper , I get null pointer exception net.egork.chelper.util.CodeGenerationUtilities$InlineVisitor.addClass(CodeGenerationUtilities.java:534)My configuration file is: inputClass = net.egork.chelper.util.InputReader outputClass = net.egork.chelper.util.OutputWriter excludePackages = java.,javax.,com.sun. outputDirectory = src/output author = Himalay archiveDirectory = archive/unsorted defaultDirectory = src/main/mypackage topcoderDirectory = topcoder testDirectory = lib/test enableUnitTests = false •  » » 5 years ago, # ^ | 0 It is not able to create Main.java file  » 5 years ago, # | +10 Is the plugin supposed to work for GCJ 2014? I am getting the following error when I try to parse a task:7:37:09 PM CHelper: Unable to parse task B — Cookie Clicker Alpha. Connection problems or format change •  » » 5 years ago, # ^ | 0 Seems like there was internal format change. Should have checked beforehand but forgot  » 5 years ago, # | 0 Do you have any plans to update source code at https://code.google.com/p/idea-chelper/? It seems to be pretty outdated. •  » » 5 years ago, # ^ | 0 For some reason actual code is in trunk brink, but it still need push from me •  » » 5 years ago, # ^ | 0 And actual code should be in trunk branch now (through I'm planning to fix GCJ support soon)  » 5 years ago, # | 0 Hello, thanks for the plugin ;) It makes some good, but, for me, it works only with TopCoder (not with contest with io).I have described my problem (notSuchMethodException) here: http://stackoverflow.com/questions/23383595/chelper-plugin-nosuchmethodexception-errorCould you please look and help to track the problem? •  » » 5 years ago, # ^ | 0 Your output writer class should have constructor that takes writer as parameter (and relays output there). You can use PrintWriter as output class •  » » » 5 years ago, # ^ | 0 It actually had, but after reinstalling plugin from scratch, un-cache-ing idea and doing other random stuff it started working, so sorry for disturbing and thanks again!  » 5 years ago, # | 0 I have just started using Chelper , it works perfect with topcoder but with code forces it always don't take the first number in input if contains number i.e ( if input like this 5 4 1 1 1 1 it begins reading from 4 not 5 !!) any help please, i am using scanner for input •  » » 5 years ago, # ^ | +3 Are you sure you do not select "Number of test known" when parsing tasks? •  » » » 5 years ago, # ^ | 0 oh yes i changed it to single test ... it works now thanks!  » 5 years ago, # | ← Rev. 4 → 0 Hi Egor, I just configure CHelper plugin, everything is working good. But when i tried to Archive the files, its showing error that "Configuration not selected or selected configuration not supported". Can you please give your input about what could be the reason.chelper.properties content: smartTesting=true archiveDirectory=archieve defaultDirectory=src/codeforces extensionProposed=true outputClass=java.io.PrintWriter excludePackages=java.,javax.,com.sun. outputDirectory=output author= libraryMigrated=true failOnIntegerOverflowForNewTasks=true inputClass=java.util.Scanner enableUnitTests=true testDirectory=lib/test  » 5 years ago, # | ← Rev. 2 → -8 Exception in thread "main" java.lang.IllegalAccessException: Class net.egork.chelper.tester.NewTester can not access a member of class InputReader with modifiers "public"This is what I am getting after executing the debug code option. Any suggestions ..? Note : I am using InputReader and OutputWriter class from your code. @Egor •  » » 5 years ago, # ^ | -8 Try full versions here •  » » » 5 years ago, # ^ | -8 Thank you so much sir!!! It finally worked!!! Saves the day for me!!!  » 5 years ago, # | +2 Does anybody have any insight into how to speed up running the task in Intellij? Right now I am using Egor's library (which is very helpful btw), and that seems to slow it down as it the compiler links things together I suppose. Overall it take between 15-25 seconds for solution to run for me right now, which is not terribly long but for competitions would be nice if it was a bit faster. I already removed all of my unused plugins and increased stack space but it doesn't seem to make a lot of difference. Has anyone found a way of speeding up Intellij? •  » » 5 years ago, # ^ | +3 Your computer must be very old, since on my 7-years-old Core 2 Duo E6600 the project with Egor's library compiles pretty fast, in about 5 seconds. The same speed is shown by my primitive types collections library (see in my blog). But I once tried to use Trove library and got 15-20 seconds, they have quite large code with lots of abstract classes, which slows down code generation. These numbers are for IDEA 13, maybe your IDE is too old? •  » » » 5 years ago, # ^ | ← Rev. 2 → 0 Hm I am not sure if that is the case. I am using a 2012 Macbook Pro Retina, with IDEA 14, with all updates I think. Before installing Egor's library I was getting something like that with around 5 seconds. But anyway thanks for the response, maybe there is some setting that I accidentally enabled or something. Also I am using Java 8, I don't know if that makes a difference. I forget exactly but maybe with Java 7 it was faster. •  » » 5 years ago, # ^ | ← Rev. 7 → -8 So just another thing I was wondering about is it fine to have the yaal library under the src folder? I would think that it does not make a difference, but just want to make sure that it does not force some additional recompile or something of the library. Just additional bit of information is that when say I compile topcoder task that does not call from the library (topcoder because codeforces always uses input/output from library) it takes about 1-2 seconds. However as soon as I call a method it can increase to as much as 20 seconds. Just wanted to make sure that this directory setup with the library and everything is the same way that everybody else is doing it. And also another question because I just noticed this but what does the number 4 by the Chelper project folder mean? Thanks! •  » » » 4 years ago, # ^ | 0 You should try marking your archive folder as excluded ;)  » 5 years ago, # | 0 @Egor The last update did work for me. But I would like to know how to reach EOF without compilation error with this plugin or what would be the proper way to reach EOF.  » 4 years ago, # | 0 I get this when trying to create tasks by parsing contests on Codeforces"NotificationException: Task file not found: Seems your task is in inconsistent state"  » 3 years ago, # | ← Rev. 2 → 0 Hi Egor , All tools [Create Task , Parse Contest ,all] not working. please help to solve following error : NoSuchMethodError: com.intellij.psi.JavaPsiFacade.findClass(Ljava/lang/String;)Lcom/intellij/psi/PsiClass; Screenshot https://drive.google.com/file/d/0B13U1Ij8LVrFUzY1MmhUalBadDQ/view?usp=sharingThanks for nice plugin.  » 3 years ago, # | ← Rev. 2 → 0 Would be cool if it worked. When creating a "new task" without parsing, i'm only getting the class file. No .task file is created so I can't run the files or the tests. Remember this working a year or so back with an older version.I just had a new setup. With src\default as my default directory on IntelliJ Idea 15.0.2However, when I do "parse task", it's getting created.  » 2 years ago, # | ← Rev. 2 → 0 I am not able to parse Contest of Hackerrank, Codechef, Atcoder and Hackerearth. Will these be added later? I don't like to use Scanner class but CHelper have default as Scanner. How to change it? P.S. I am using CHelper 4.1.7(available on Repositories of JetBrains) •  » » 2 years ago, # ^ | 0 Those sites are parsed using chrome extension, you can find it in chrome storeAs for changing input class you can read wiki on github for instructions •  » » » 2 years ago, # ^ | 0 How to parse the task using Chrome Extension. I have clicked in + button many times but nothing is happening. Neither the IntelliJ is affected nor the other things. •  » » » » 2 years ago, # ^ | 0 Do you have a project with CHelper configuration opened in Idea? Also it may be that Hackerrank changed their DOM structure once again. Is there anything in Idea log? •  » » » » » 2 years ago, # ^ | 0 Yes, I have a project opened in Idea with CHelper config. And I ma trying the plugin fro Codechef. •  » » » » » » 2 years ago, # ^ | 0 Can you tell me instructions I have to follow after clicking on parse Task in Google Chrome for any practice question on Codechef or ZCO contest of Codechef. I am assuming my Idea is closed. •  » » » » » » » 2 years ago, # ^ | 0 Idea should be running. New task dialog should show up when you click on plus in chrome •  » » » » » » » » 2 years ago, # ^ | 0 new task dialog is not showing up. •  » » » » » » » » » 2 years ago, # ^ | 0 Event Log is showing : CHelper: Unable to parse task from codechef •  » » » » » » » » » 2 years ago, # ^ | 0 That means that CHelper can't parse this particular task from codechef — they do not have any fixed format •  » » » » » » » » » 2 years ago, # ^ | ← Rev. 2 → 0 Ok. Got it. Thanks for the replies, sir. Parse task is working on Hackerrank and AtCoder. Not on Hackerearth,CSAcademy and Codechef. Please look into the issue. •  » » » » » » » » 2 years ago, # ^ | 0 New Update is amazing. We can parse task in Codechef Contest, Hackerearth and CSAcademy too. But still can't parse Codechef Practice Problems. •  » » » 16 months ago, # ^ | ← Rev. 2 → 0 Egor Can you share the wiki link you mentioned above for instructions?  » 2 years ago, # | ← Rev. 2 → 0 Here is a video tutorial for the installation of CHelperLink •  » » 20 months ago, # ^ | 0 Hi I followed your tutorial. My code runs fine the IDE but on submission, it gives a timeout.Did you face this issue before? Here is the link:http://codeforces.com/contest/598/submission/32818599  » 2 years ago, # | ← Rev. 2 → 0 Where to add the configuration file? Also, is the plugin only for topcoder or codeforces too?  » 21 month(s) ago, # | 0 Are there any plugin like CHelper for C++ in CLion IDE? •  » » 21 month(s) ago, # ^ | +1 •  » » » 21 month(s) ago, # ^ | 0 Thank you very much!  » 20 months ago, # | 0 Anyone faced a timeout error while submitting on CF. The ide gives that the test cases passed but the online judge shows error on submitting the mail fileHere is the link:http://codeforces.com/contest/598/submission/32818599  » 19 months ago, # | 0 I am not understanding how to generate own test cases for tasks like those Petr uses in his livestreams. Can anyone please help me out?  » 17 months ago, # | 0 I think the new "Copy" feature has caused some problems in parsing the task's Test Cases. •  » » 17 months ago, # ^ | 0 I highlighted the very same issue here. Got no response till now. •  » » 16 months ago, # ^ | 0 I would recommend to use parsing from within idea until I deploy fix, it still works  » 16 months ago, # | ← Rev. 2 → 0 In my case google chrome extension does not work. I can parse a contest from intellij and even problem too. But when I try to parse a particular problem from codeforces by pressing the + icon, nothing works[ even Event log does not show any action]. Here is link to my intellij ide screenshot. Please help me Egor. Thanks in advance.  » 16 months ago, # | ← Rev. 4 → 0 One question and one feedback! EgorQ: How to use precision for double comparisons? I assume in the advanced settings, I need to put something for "checker properties" field, but what to put?? Any manual page explaining that?Feedback: when checking whether all input class and output class methods are implemented, it doesn't look for the necessary methods in super class. So it complains whereas the method exists in super class.  » 16 months ago, # | 0 Please someone help me with using Test Class for creating custom input for my Java code.  » 15 months ago, # | ← Rev. 2 → 0 Is there a list of supported sites for CHelper/CHelper Extension? I can't seem to find it anywhere. •  » » 15 months ago, # ^ | 0 source code is your friend •  » » » 15 months ago, # ^ | 0 Thanks!  » 15 months ago, # | ← Rev. 3 → 0 .  » 14 months ago, # | ← Rev. 2 → 0 It worked. Thanks!  » 13 months ago, # | ← Rev. 2 → -11 Did anyone else face the same issue? For multiple nested classes like _1000E.Bridges.edge, the code in output file converts to _1000E.edge.Bridges, which leads to compilation error.  » 12 months ago, # | 0 Chelper not working after latest update of Intellij IdeaException in thread "main" java.lang.ClassNotFoundException: soln.TaskA at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at net.egork.chelper.tester.NewTester.test(NewTester.java:75) at net.egork.chelper.tester.NewTester.main(NewTester.java:28)
•  » » 12 months ago, # ^ |   0 I am working on this, but I am not sure I will finish before the round. You can install previous version temporarily
•  » » » 12 months ago, # ^ |   0 Ok. Thank you. for temporary purpose when I run the tasks created before this update and then run newly created task , it works fine.
•  » » » » 12 months ago, # ^ |   0 For some reason new version of idea skips on compiling before running corresponding configuration types. I fixed this, you can download new version from repository
•  » » » » » 12 months ago, # ^ |   0 Thanks man for such instant response. Love from java user.
•  » » » » » 12 months ago, # ^ |   0 Have you updated it in Plugins of IDEA. As this update is not showing there, so the problem still persists.
•  » » » » » » 12 months ago, # ^ |   0
•  » » » » » » » 12 months ago, # ^ |   0 I'm still using version 4.3.1 because 4.4.2 doesn't work. I was unable to compete in 499 round just because i updated chelper as idea suggested me and after that i returned 4.3.1.
•  » » » » » » » » 12 months ago, # ^ |   0 How exactly it does not work? And what version of idea do you use?
•  » » » » » » » » » 12 months ago, # ^ |   0 I don't know if this is magic but I updated idea version from 2018.1 to 2018.2 and now it works. I'm sorry and thank you =).
•  » » » » » » » » » 12 months ago, # ^ |   0 It seems new version do not work with old versions of idea
•  » » » » » » » » » 12 months ago, # ^ |   +3 Same occured with me. correctly parsing task after IDEA update. Everything is working again.
•  » » 12 months ago, # ^ |   0 archiveDirectory actually may not be in source, while it is not mandatory for outputDirectory to be a source one. Otherwise — sound advice
•  » » » 3 weeks ago, # ^ | ← Rev. 3 →   0 I have followed the advice above. I can generate some files using "Parse Contest" button, but: tests are not parsed (when I click Edit Tests, it's empty) Google Chrome plugin doesn't work (nothing happens when I open Codeforces page) also, when Main.java is generated, it doesn't contain implementation of the InputReader and OutputWriter (in the project settings, I've specified net.egork.chelper.util.InputReader and net.egork.chelper.util.OutputWriter). Instead, it contains this:  static class InputReader extends InputStream { InputReader; int read(); int readInt(); String readString(); } static class OutputWriter { OutputWriter; void print; void close(); } Any idea what I may be missing?I use macOS Mojave Version 10.14.5 IntelliJ IDEA 2019.1.3 (Community Edition) IDEA Plugin v4.4.2 Google Chrome Version 75.0.3770.100 (Official Build) (64-bit) Chrome CHelper extension 4.4.3.1
 » 12 months ago, # |   0 Installed Chelper from the repository in idea and then restarted idea.But none of the action is working. Also nothing opens when parse a problem from the browser. (Using Ubuntu operating system)
•  » » 12 months ago, # ^ |   0 Had you configured project as described one comment up from yours?
 » 12 months ago, # |   0 where to find the chelper.properties file
•  » » 12 months ago, # ^ |   0 If you press "Edit Project Settings" button it will create one for you
•  » » » 11 months ago, # ^ |   0 I don't see a edit project settings. Do you mean going to Project Structure?
•  » » » » 11 months ago, # ^ |   0 No, this should be button on your toolbar
 » 10 months ago, # | ← Rev. 2 →   0 Hi Egor, when parsing Codeforces tasks in IDEA, tests are not created. CHelper version: 4.4.2 IDEA version: 2018.2.3 CHelper Chrome extension stopped working for Codeforces as well. CHelper extension version: 4.2.1.1 Chrome version: 69.0.3497.81 
 » 9 months ago, # |   0 Hi Egor , All tools [Create Task , Parse Contest ,all] everything is working well except the one small issue. The Parser is not working properly (It parses the problem correctly ,but not able to parse Sample TC , mention in the problem). ( IntelliJ Version 2018 2.5. CHelper Version 4.4.2 Window 10 )Tried most of possible sol , Still not getting desirable result.Anybody has the same issue ?Thx alot :)
•  » » 9 months ago, # ^ | ← Rev. 3 →   0 change website https to http it will work for codeforces
•  » » 9 months ago, # ^ |   +10 Lol. Forget about using the built-in parser for CHelper. Use Competitive Companion (link). This is a much more well-developed and better supported parser and works with CHelper.
 » 8 months ago, # |   0 I was trying to solve an Interactive problem (Here is the link for the problem). Here is my solution link. Please help me what am I doing wrong. Also please tell how do I use CHelper to test my code.
 » 6 months ago, # | ← Rev. 4 →   0 Hey I am getting this error while running the code!!java.lang.NullPointerException at net.egork.chelper.codegeneration.CodeGenerationUtilities.getSimpleName(CodeGenerationUtilities.java:410) at net.egork.chelper.codegeneration.SolutionGenerator.createMainClassTemplate(SolutionGenerator.java:498) at net.egork.chelper.codegeneration.SolutionGenerator$3.run(SolutionGenerator.java:574) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1057) at net.egork.chelper.codegeneration.SolutionGenerator.createSourceFile(SolutionGenerator.java:557) at net.egork.chelper.util.TaskUtilities.createSourceFile(TaskUtilities.java:21) at net.egork.chelper.configurations.TaskConfiguration.getState(TaskConfiguration.java:73) at com.intellij.execution.runners.ExecutionEnvironment.getState(ExecutionEnvironment.java:158) at com.intellij.execution.runners.BaseProgramRunner.execute(BaseProgramRunner.java:55) at com.intellij.execution.runners.BaseProgramRunner.execute(BaseProgramRunner.java:50) at com.intellij.execution.ProgramRunnerUtil.executeConfigurationAsync(ProgramRunnerUtil.java:92) at com.intellij.execution.ProgramRunnerUtil.executeConfiguration(ProgramRunnerUtil.java:41) at com.intellij.execution.impl.ExecutionManagerImpl.restart(ExecutionManagerImpl.java:93) at com.intellij.execution.impl.ExecutionManagerImpl.access$300(ExecutionManagerImpl.java:44) at com.intellij.execution.impl.ExecutionManagerImpl$3.run(ExecutionManagerImpl.java:442) at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:232) at com.intellij.util.Alarm$Request.runSafely(Alarm.java:356) at com.intellij.util.Alarm$Request.run(Alarm.java:343) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:228) at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315) at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:435) at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:419) at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:403) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762) at java.awt.EventQueue.access$500(EventQueue.java:98) at java.awt.EventQueue$3.run(EventQueue.java:715) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.awt.EventQueue.dispatchEvent(EventQueue.java:732) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:719) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:668) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:363) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)Egor can anyone help me out?? I am using intellij 2018.3.3 verion and chelper 4.4.2v  » 5 months ago, # | ← Rev. 2 → 0 Please help.I am getting this error on IntelliJ IDEA 2018.1.3 with CHelper 4.4.2 and jdk1.8.0_181 Error: Exception in thread "main" java.lang.ClassNotFoundException: codes.TaskD at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at net.egork.chelper.tester.NewTester.test(NewTester.java:81) at net.egork.chelper.tester.NewTester.main(NewTester.java:34) Image of Project structure and chelper.properties file