### Jasperr's blog

By Jasperr, history, 2 years ago,

Hi! After releasing CHelper Companion as an alternative to the original CHelper extension six months ago, development has been ongoing and CHelper Companion has "evolved" into Competitive Companion.

Competitive Companion is a browser extension for Chrome and Firefox that can parse problems and contests and extract the useful data. This includes things like time/memory constraints and sample test cases. While CHelper Companion was only capable of sending this data to CHelper, Competitive Companion works with pretty much all popular tools. Next to that, Competitive Companion is also capable of sending the data to your private tools, without requiring a complex setup.

Using it is very simple. Just install the extension, make sure you got one of the supported tools open, navigate to a problem page and click on the green plus icon in the top-left of your browser. On websites where Competitive Companion is able to parse contests, navigating to the page with all the problems and clicking on the green plus icon will download and parse all problems in the contest at once. You can also use the shortcut Ctrl+Shift+U instead of the green plus icon.

At the moment, Competitive Companion can send parsed problem data to the following tools:
- CHelper
- JHelper
- Hightail
- Mind Sport
- Caide
- acmX
- Competitive Programming Helper
- CP Editor
- AI Virtual Assistant
- cpbooster
- Any other tool that can parse the data that is being sent, read more about that in the README on GitHub, and have a look at the example project here.

Competitive Companion includes parsers for the following websites:

Website Problem parser Contest parser
ACMP
Aizu Online Judge
Anarchy Golf
AtCoder
Baekjoon Online Judge
Bloomberg CodeCon
CodeChef
Codeforces
CodeMarshal
COJ
CSES
CSU-ACM Online Judge
DevSkill
DMOJ
E-Olymp
ECNU Online Judge
FZU Online Judge
HackerEarth
HackerRank
HDOJ
HIT Online Judge
hihoCoder
Hrbust Online Judge
ICPC Live Archive
Jutge
Kattis
Library Checker
LibreOJ
LightOJ
Luogu
mrJudge
MSK Informatics
NowCoder
NYTD Online Judge
omegaUp
Panda Online Judge
PEG Judge
POJ
QDUOJ
SPOJ
SSOIER
Timus
Toph
UOJ
URI Online Judge
USACO
USACO Training
UVa Online Judge
Virtual Judge
Yandex
yukicoder

Competitive Companion's source code can be found on GitHub. Releases are pushed to both the Chrome Web Store and Mozilla Add-Ons.

Feedback, bug reports and feature requests are all very welcome!

• +47

 » 2 years ago, # |   +3 Feature Request I think adding a keyboard shortcut for parsing problem would be great.
•  » » 2 years ago, # ^ |   +4 Great idea, I released an update which adds the keyboard shortcut Ctrl+Shift+U to parse problems/contests, it should be available in a few minutes. Whenever the green plus icon is visible, that shortcut will work too.
•  » » » 2 years ago, # ^ |   +1 Awesome job.
 » 2 years ago, # | ← Rev. 2 →   0 UPD: OK. I have found the reason, My CHelper plugin was not updated (it was 4.1.12)... After updating the plugin it is working properly. Thank you, You have done awesome job...Is there any version dependency with the add-ons? It is not working for me, while parsing this problem. :(I am using, Chrome (Version 67.0.3396.87 (Official Build) (64-bit)) and Intellij IDEA (2018.1).
 » 2 years ago, # |   0 Forgive my ignorance but I'm new to this tool.What exactly happens when we click on the Green Button on a contest page? I can see a green bar sliding across the top, guessing this is the page being parsed? But what now? How do we use it now?
•  » » 2 years ago, # ^ | ← Rev. 2 →   0 I'm assuming you are seeing a blue bar, not a green one (because if it's green, it's probably not from my extension).When you see that bar, it is retrieving all the problems and extracting the useful data out of all of them, after which it sends them to one of the supported tools.To make use of this extracted data, you need to do one of the following:- Use one of the supported tools (see the post to see which one are supported).- Add support for the extension to your tool, which requires quite a bit more work. Instructions on how to do that can be found here. If you need help with getting up and running using one of the supported tools, please tell me which one you are using so I can give more specific instructions.
 » 2 years ago, # | ← Rev. 2 →   +10 I have just released version 2.3.0, which is one of the biggest updates so far. It includes several bug fixes and parsers for 11 more online judges, including two that I have been wanting to add for a long time: UVa Online Judge and ICPC Live Archive.I do want to clarify two things regarding this update though:1. The extension's size has gone up from 35kb to 660kb. This has to do with a new library, PDF.js, that I needed to add in order to be able to extract the sample testcases from the PDF files on UVa Online Judge and ICPC Live Archive.2. The extension will now request permission to "access your data for all websites". This does not mean that the extension spies on you: it will never do that. If you don't trust me, feel free to take a look at the code on GitHub. This change was necessary in order to better support sites like HackerRank which use the browser's history api to let you navigate over their website instead of using normal links.
 » 23 months ago, # |   0 For some reason using this extension with CHelper, it parses task fine. However when I run my code as I normally do, I get following: Exception in thread "main" java.lang.ClassNotFoundException: my.ETrialForChief at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:339) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:265) at net.egork.chelper.tester.NewTester.test(NewTester.java:81) at net.egork.chelper.tester.NewTester.main(NewTester.java:34) I do not have this issue with tasks created by the CHelper chrome plugin, however those do not parse the testcases correctly ... Does anybody have any advice on what I am doing wrong? Thanks! •  » » 23 months ago, # ^ | 0 If anybody runs into similar problem, it was somehow because my Intellij ended up with "Build project automatically" unchecked. I followed steps here and now everything works great, thanks for the tremendous plugin! https://zeroturnaround.com/software/jrebel/quickstart/intellij/enable-automatic-compilation-in-intellij-idea/ •  » » » 23 months ago, # ^ | 0 Try to update inteliji idea  » 22 months ago, # | 0 Can you add LeetCode please their ide is very slow •  » » 22 months ago, # ^ | +11 Unfortunately, LeetCode cannot be added. This is because LeetCode forces solutions to be written in a pre-defined method with a pre-defined signature (method parameters and return type), which is something that Competitive Companion does not support. The chances of it being implemented in the future is pretty low, considering how none of the publically available tools that Competitive Companion sends data to are capable of handling such constraints at the moment.Besides that, LeetCode doesn't seem to have any structure in their problem descriptions, which makes it pretty much impossible to parse something like the sample testcases. •  » » » 22 months ago, # ^ | 0 Got it Thanks man  » 22 months ago, # | 0 Can you add vjudge.net problems and contests? •  » » 22 months ago, # ^ | ← Rev. 3 → +8 I have just released version 2.5.0 which adds a problem parser for Virtual Judge. Your browser should auto-update within 24 hours.Unfortunately, I could not find a way to parse all problems in a contests at once due to how Virtual Judge renders contest problems dynamically. You can however parse all problems in a contest separately, just like how you would parse out-of-contest problems.It's also worth noting that while the problem parser can parse the sample testcases for a lot of problems, it will not work correctly for all of them. This is because Virtual Judge does not have a standarized format for problem descriptions, so the extension has to look for signs of sample testcases like   and  tags. This isn't a rock-solid solution, but it works for the majority of the problems. Feel free to create an issue on GitHub when you find a problem that isn't parsed correctly.  » 15 months ago, # | 0 Hi Jasperr, I think it would be nice if we can set the name of taskClass to the problem'ID, but not the actual name of the it. For example, for this problem, taskClass can be named "1A", but not "ATheatreSquare".Thank you for this awesome tool. •  » » 15 months ago, # ^ | +5 Thanks for the suggestion, but I'm not planning on changing this. I think "AThreatreSquare" is better than "1A" when you're participating in a contest with multiple problems. Especially when having to differentiate between different problems having the full name instead of just the letter can be very helpful. •  » » » 15 months ago, # ^ | 0 I got it.Thank you for your respond.  » 12 months ago, # | 0 Any good parser for sublime text??  » 6 months ago, # | 0 Can you Also Add a Simple Video Demonstrating all its Features and How to use it Effectively and Possible Places where Users can Do Mistake while Parsing a Problem or Contest in CodeForces? By the Way, This is very Helpful Extension.Thanks for Creating it,Jasperr Bro. •  » » 6 months ago, # ^ | 0 I am not very good at making videos, and I think this paragraph in my post already explains how the extension works pretty clearly:"Using it is very simple. Just install the extension, make sure you got one of the supported tools open, navigate to a problem page and click on the green plus icon in the top-left of your browser. On websites where Competitive Companion is able to parse contests, navigating to the page with all the problems and clicking on the green plus icon will download and parse all problems in the contest at once. You can also use the shortcut Ctrl+Shift+U instead of the green plus icon."I did, however, record a short video two years ago for a PR I made to add Competitive Companion support to Hightail: https://www.youtube.com/watch?v=LnI4HuzWY18 for PR #107. •  » » » 6 months ago, # ^ | 0 Which Tools are available for Sublime Text IDE? Video helps Users to Implement Faster, So Recommended. •  » » » » 6 months ago, # ^ | 0 Which Tools are available for Sublime Text IDE? Not entirely sure, Competitive Companion just provides the parsing capabilities, all the tools listed in my post are external projects not made by me.A quick Google search does however show DrSchwad/FastOlympicCodingHook, which appears to add support for Competitive Companion to Jatana/FastOlympicCoding which is a Sublime Text 3 plugin for competitive programming. Besides that, both Hightail and Caide (both already listed in my post) are IDE-agnostic and can be used with any text editor or IDE.Do, however, note that I did not create nor use those tools, so I cannot provide support for them. Video helps Users to Implement Faster, So Recommended. I have already provided the usage by text and provided a demo video showing Competitive Companion being used with Hightail. It is really not a difficult extension to use, and another video is not going to make the instructions any more clear. •  » » » » » 6 months ago, # ^ | 0 Okay Got it!Thanks for Solving Query!  » 5 months ago, # | 0 Does anybody know a similar extension for Safari on MacOS?  » 4 months ago, # | 0 great toooool, just what is needed!!!!Thanks alot...For VSCode users install thr chrome extension of Competitive Companion, then install Compatitive Programming Helper extension from marketplace. And guess waht you are good to go. No setup required, no setting up path varibales.When on a problem on codeforces , press Ctrl + Shit + U, a new file opens in VSCode with test cases installed.. For manually writing test cases, press Ctr + Alt + B in VSCode for any file.  » 4 months ago, # | 0 2 small issues: 1. USACO Training requires Java submissions to have the class name of the taskid. Could you implement that? 2. I think Competitive Companion is having troubles with parsing the sample input and output for UVa. Could you fix that? Thanks! •  » » 4 months ago, # ^ | 0 I have just fixed the USACO Training issue you mentioned. I'll look into the UVa issue later this week because UVa seems to be down right now, and I'll publish a new release once that's done. •  » » » 4 months ago, # ^ | 0 Ok sure thanks! If UVa is giving you Joomla! This site is temporarily unavailable, it is an issue on their behalf. They seem to run a server check or something that causes their website to be down for around an hour at this time. Check again later. Thanks for your support though! •  » » » » 4 months ago, # ^ | ← Rev. 3 → 0 I have just published version 2.17.1 which fixes both of your reported issues, as well as two other bug fixes. Both the Chrome as well as the Firefox versions are currently pending review so it should be available in a few days.  » 3 months ago, # | 0 I just tried using 2.17.2 on https://www.facebook.com/codingcompetitions/hacker-cup/2020/qualification-round/problems/A and it said there was an error. •  » » 3 months ago, # ^ | +11 That's odd, I released 2.17.2 about a week ago to make the extension work with the Facebook Coding Competitions platform with the upcoming Qualification Round you linked. When I released it everything seemed to work fine on archived problems, so either the live problems are displayed somewhat differently or the platform as a whole got some last-minute updates in preparation of the Qualification Round.Either way, I am on vacation right now so I'll have a look at it at the beginning of next week. •  » » » 3 months ago, # ^ | 0 Sounds great, I hope you enjoy your vacation! Thanks for making Competitive Companion, it really makes problem-solving a lot more fun and frictionless. •  » » » » 3 months ago, # ^ | 0 I'm also getting the same issue. Here's the error from my browser console: content.js:215 TypeError: Cannot read property 'querySelector' of null at common.js:5678 at Array.map () at FacebookCodingCompetitionsProblemParser. (common.js:5678) at Generator.next () at common.js:5652 at new Promise () at push.__awaiter (common.js:5648) at FacebookCodingCompetitionsProblemParser.parse (common.js:5666) at content.js:211 at Generator.next () Nevertheless, enjoy your vacation! Thanks so much for such an amazing tool! •  » » » » 3 months ago, # ^ | 0 Fixed in 2.17.3 which has just gone live. It has already been approved on Mozilla's AMO but is still pending approval in the Chrome Web Store, so depending on which browser you use it may take a few days until you receive the update. •  » » » » » 3 months ago, # ^ | 0 Thank you for your continued amazing work!  » 3 months ago, # | 0 Hello Jasperr, I believe there is an issue when trying to parse FHC problems with Competitive Companion.When trying to parse this problem, Competitve Companion gave: Spoiler(I apologize for the quality, I had to take a screenshot of my terminal :P)Nevertheless, notice the "input" category. It gives the type as file but it should be a regex expression. Please fix this, thanks. •  » » 2 months ago, # ^ | +5 You're right, I forgot to change that when I switched it from fileName to pattern (I removed the regex type 1.5 years ago). This is fixed in 4904656 which will be released in the next few days.  » 2 months ago, # | 0 Hi, I am using Competitive Companion in conjunction with Caide (VS extension). Normally this setup works very well, and thanks so much for maintaining the Companion.However, I recently faced an issue when parsing any problem from Facebook Hacker Cup. I am getting the following error on Caide side: Could not parse input JSON: Error in$: key "result" not foundI am not sure if this is a problem on the Caide side or in the Competitive Companion, so I'll just report it in both threads.
•  » » 2 months ago, # ^ |   0 Hmm, yeah, I seem to have snuck in a breaking change in 2.18.0 when I re-added the regex input type after it being gone for 1.5 years. It is used when parsing FHC problems because depending on what stage you're in the filename of the input file changes (problem_name_validation_input.txt -> problem_name_input.txt).Although I try to avoid breaking changes (this is the first one in over 2 years as far as I can tell), in this case I'm going to let it stay because most tools seem to play well with the regex input type already (CHelper, JHelper, my own private tool, acmX, CP Editor, basically any tool except for Caide).Because I don't know if Caide will be patched soon, the best solution for Caide users would be to manually install version 2.17.4 and to manually update the filename when needed to.
 » 2 months ago, # |   0 Something went wrong while running Competitive Companion's CodeChefProblemParser. Open the browser console to see the error? plese help!!!
 » 2 months ago, # |   0 Something went wrong while running Competitive Companion's CodeforcesContestParser. Open the browser console to see the error.
•  » » 2 months ago, # ^ |   0 Please send me the links of the Codeforces contest page and the CodeChef problem page you tried to parse.
 » 7 weeks ago, # |   0 Can anyone tell me how to use it. I am using sublime text. When i click on the + button on a problem page(after installing the chrome extension). A green arrow kind of thing passes from left to right and nothing happens. I would appreciate if someone can tell me what wrong am i doing?
•  » » 7 weeks ago, # ^ |   +1 Competitive Companion only parses problems and sends the extracted data to external tools like CHelper, JHelper, Hightail, acmX and others. If you don't have a tool that listens for Competitive Companion data running, then clicking on the + button does nothing.Because it's not clear from your comment whether you are already using a tool which listens for Competitive Companion data:- If you are using such a tool and nothing happens when you press on the + button, send a bug report to the developer of the tool you're using.- If you are not using such a tool you'll have to start using one if you want to make use of Competitive Companion. For Sublime Text the combination of FastOlympicCoding and FastOlympicCodingHook should work (note that neither of those tools are made by me so I can't provide support for them).
 » 7 weeks ago, # |   +1 How to use this in Vim ?
•  » » 7 weeks ago, # ^ | ← Rev. 3 →   +11 At the moment I don't think there are vim specific tools, although you could try IDE-agnostic tools like Caide or Hightail. You could also create your own tool which is documented here (for inspiration you can watch the first ~12 minutes of ecnerwala's Google Kickstart 2020 Round E video in which he explains his setup, which includes vim and Competitive Companion).
 » 5 days ago, # |   +1 Hi Jasperr, I've noticed that Competitive Companion fails to parse old USACO problems (before the 2015-2016 contest season). Consider this problem, for example. The error message follows: TypeError: Cannot read property 'textContent' of null at USACOProblemParser. (common.js:20082) at Generator.next () at common.js:20054 at new Promise () at push.6785.__awaiter (common.js:20050) at USACOProblemParser.parse (common.js:20075) at content.js:58 at Generator.next () at content.js:15 at new Promise () (anonymous) @ content.js:62 
•  » » 4 days ago, # ^ |   0 Thanks for reporting the issue! I have just released version 2.18.3 which fixes this bug, it is already available for Firefox and is pending review on the Chrome Web Store.