instantkarma's blog

By instantkarma, history, 2 years ago, In English,

Hi everyone,

I have developed a tool called nodeforces that parses problem i/o from codeforces and automatically creates a codefile for you (with your favorite template) (eg: nodeforces init 765A.java).

Then, you can simply run your code and verify that it passes the basic test cases (eg: nodeforces test 765A.java)

You can get it as an npm package (nodejs)

npm install -g nodeforces

If you do not know about node.js or npm you can easily setup by going to https://nodejs.org

A detailed description and the source code of the module is available on Github

Currently, it supports javac and g++ and I am planning to add more. Try it out and let me know your thoughts!

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

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

Auto comment: topic has been updated by kp96 (previous revision, new revision, compare).

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

Can it handle compilation errors, timeouts, runtime errors? and display them? I mean, in case of runtime errors, can it display the error stack?

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

    Yes, it does, all the errors are written to the console. Need to work on timeouts.

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

      For timeouts and memory errors(MLE's), there is a perl script which can handle both.

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

        Thanks for the script. Nodejs internally has an option for setting timeouts to child processes. I've used it inside CI but not for the module itself. I will be adding it as a customizable option in the coming versions!