question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding support for more than just CHelper

See original GitHub issue

This issue is open to discussion, but is primarily meant to keep track of progress on this idea, and to serve as some sort of documentation.

CHelper Companion was originally designed to solely support CHelper, but it would be cool if it would be able to send tasks to other tools aswell. Therefore, I have been thinking about sending the task information as a JSON-encoded string. This makes it easier for other (private) tools to work with the extension, as long as it can parse JSON input from an HTTP request.

The format

Here’s an example of possible input:

{
    "name": "The A + B problem",
    "group": "Educational Codeforces Round 42 (Rated for Div. 2)",
    "url": "http://codeforces.com/problemset/problem/962/G",
    "memoryLimit": 256,
    "timeLimit": 2000,
    "testType": "single",
    "input": {
        "type": "stdin"
    },
    "output": {
        "type": "stdout"
    },
    "languages": {
        "java": {
            "mainClass": "Main",
            "taskClass": "TheABProblem"
        }
    },
    "tests": [{
        "input": "1 2\n",
        "output": "3\n"
    }, {
        "input": "5 5\n",
        "output": "10\n"
    }]
}

It’s not required for a tool to parse all these options, since some of them are tool/language-specific. However, it is required for all extensions/tools that send data via this format to fill all required options.

Explanation

  • name: The full name of the problem. Can be used for display purposes.
  • group: Used to group problems together, which can be useful for archiving purposes.
  • url: A link to the problem on the judge’s website.
  • memoryLimit: The memory limit in MB.
  • timeLimit: The time limit in ms.
  • testType: The type of the tests. Supports three options: “single”, “multiNumber” and “multiEOF”. Explanation of these three can be found on the JHelper wiki. This is currently CHelper and JHelper specific.
  • input: An object which is used to configure how to receive input. Supported types:
    • stdin: Receive input via stdin. No additional options required.
    • file: Receive input via a file. The file name has to be given via the fileName option.
    • regex: Receive input via a file. The file to use is selected by taking the most recently modified that matches the given regex. The regex pattern to use has to be given via the pattern option.
  • output: An object which is used to configure how to send output. Supported types:
    • stdout: Send output to stdout. No additional options required.
    • file: Send output to a file. The file name has to be given via the fileName option.
  • languages: An object with language specific settings. At the moment this only contains Java settings, but since I don’t think putting language specific settings as top-level options is a good idea, I decided to put them in an object. This also allows for other languages to have custom configuration added later on. Required keys:
    • java: An object with Java specific settings. Required options:
      • mainClass: The name of the outer class containing the solution.
      • taskClass: The classname-friendly version of the problem’s full name. Cannot be the same as mainClass. Can also be useful for non-Java tools because a classname-friendly string is also a filename-friendly string.
  • tests: An array of objects containing testcase-data. The JSON objects in the array all have two keys: input and output. Both the input and the output need to end with a newline character.

Pro’s

  • Being able to support more than just CHelper, even private tools as long as they can parse JSON input received via HTTP.
  • At the moment the extension would break if Egor changes the Kattis parser. A JSON parser would resolve this issue.

Cons

  • The extension would have to be renamed to something more general, since CHelper Companion implies it’s only compatible with CHelper.

Tasks

  • Convert the problem and contest parsers that still rely on CHelper to a JavaScript implementation
  • Make all parsers parse the time limit of a problem
  • Add a JSON parser to CHelper
  • Add a JSON parser to JHelper
  • Add the functionality to Hightail to accept JSON input via HTTP and parse it
  • Make it possible to send the JSON data to multiple tools
  • Make it possible to send the JSON data to a custom port on localhost to support private tools
  • Create better documentation so it’s easy for new tools to support the format
  • Create an example to show how to support receiving the JSON data in other (private) tools
  • Rename CHelper Companion to something more general (final step)

All changes on the extension relevant to this issue are done in the feature/universal branch.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jmerlecommented, Apr 23, 2018

From what I can see, JHelper uses a packaged version of CHelper, so I’m patiently waiting for Egor to merge my PR in his repository before I make a PR in yours to update the packaged CHelper library (so the CHelper library in JHelper is up-to-date with the latest version of CHelper).

0reactions
jmerlecommented, Jun 10, 2018

All tasks are completed, Competitive Companion now has support for CHelper, JHelper, Hightail and Mind Sport.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CHelper Companion — An alternative to the ... - Codeforces
I always wanted to make a browser extension, and because the original CHelper extension got a few broken problem parsers, I decided to...
Read more >
Tag Helpers in ASP.NET Core | Microsoft Learn
To add a Tag Helper to a view using an FQN, you first add the FQN ( AuthoringTagHelpers.TagHelpers.EmailTagHelper ), and then the assembly ......
Read more >
Frequently Asked Questions - Things Support - Cultured Code
You can install the app without additional cost on all devices of the same kind - here's how. Are there bundles for all...
Read more >
Message: “Carbonite is trying to add a new helper tool”
During a Carbonite install or update, a window appears that says “Carbonite is trying to add a new helper tool” and entering your...
Read more >
Use the Jira Admin Helper - Atlassian Support
Learn how to use the Jira admin helper in Jira Cloud. ... You can use the Field Helper to help you determine why...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found