d-agrawal's blog

By d-agrawal, history, 16 months ago, In English

Hello All!

A competitive programming extension for VS Code!

I have created an extension for Visual Studio Code that makes testing, creating, and downloading testcases very easy. It is similar to CPPFastOlympicCoding for Sublime. Search within VS Code Extensions or download from link below. Works on Windows, Mac, Linux. You need to have G++ ( GCC ) installed.

Extension Name : Competitive Programming Helper

Store Link : https://marketplace.visualstudio.com/items?itemName=DivyanshuAgrawal.competitive-programming-helper

Features

  • Add multiple testcases.

  • Download from Codeforces automatically.

  • Auto compile and run, shows compilation errors, run-time errors ( stack overflow, seg-faults etc).

  • GUI, no manual file editing.

UI

Please try it out and give feedback. Please report issues/ send feature requests here : https://github.com/agrawal-d/competitive-programming-helper

Thanks!

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

»
16 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Amazing extension! Thanks :)

»
16 months ago, # |
  Vote: I like it +5 Vote: I do not like it

I started few months ago similar tool, you can check it here:

I love the way you display testcases in your tool. Unfortunately I don't have too much time to hack on mine this days, but it would be great if I could incorporate this to my tool, are you ok with that? I see you don't have any LICENSE, so I encourage you to add one.

  • »
    »
    16 months ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Your extension is pretty cool! My university examinations are coming soon, so maybe later? And thanks for reminding, I'll add the LICENSE.

»
15 months ago, # |
  Vote: I like it 0 Vote: I do not like it

It does not work well if you have a vim extension like VSCodeVim.

The <esc> key doesn't work when you try to change insert to normal mode if I enable your extension. :/

»
13 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Thanks for such a great tool.

Unfortunately Im still not able to run it in Windows10: the button "Run Testcases" does nothing after pressing it.

I want to use g++ compiler from WSL to avoid install MinGW. Is there a way to configure this as the default option?

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

    Thanks for using it!

    Hmm, I currently don't support changing compiler itself, so you won't be able to use g++ from WSL! :-(

    A bad solution would be to create a global alias for g++ that points to 'wsl g++' but it's not convenient!

    What's the problem with using MinGW or CYGWIN? It takes only a few minutes to install g++ :-)

»
13 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Awesome man!!

»
13 months ago, # |
  Vote: I like it 0 Vote: I do not like it

this extension needs serious upvotes :)

  • »
    »
    13 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thank you :-D

  • »
    »
    13 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    If you want to help, you can share this in your own blog/social media/with your friends. :-D

»
12 months ago, # |
  Vote: I like it +1 Vote: I do not like it

Hi , Thank You for developing such a good tool Which port should i set for Competitive Companion to work ?

»
12 months ago, # |
  Vote: I like it +1 Vote: I do not like it

Not able to download problem and test cases on clicking chrome extension, was working fine few days ago.

»
12 months ago, # |
Rev. 8   Vote: I like it +3 Vote: I do not like it

Can I suggest some ideas ? (These may slowdown the test so can you do a Advance Mode for advance setting allowed ?)

1) Add some more verdicts instead of Success and Failed
2) Advance Settings for Each Testcase
3) Advance Settings for All Testcases
4) Advance Settings for codes

Hope your project become success and well-known <3

»
12 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Do you know how we can change it, so it compiles with c++11 or c++14. I am getting a compilation error if I use the syntax for (int i : arr).

  • »
    »
    12 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yes, you can add any flags you want from Settings. A GIF shows this in the github link above.

»
12 months ago, # |
  Vote: I like it 0 Vote: I do not like it

thank you so much, this tool is perfect :)

»
12 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Amazing Extension. but Not able to download problem and test cases on clicking Firefox extension. I have used custom port You given on set up video.but still it's not working.

  • »
    »
    12 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    The firefox extension have never worked for me. It seems like the port just isn't updated when set. As I couldn't find the local settings file to edit it by myself, I ended up never using it... Copy-pasting a test into a local file is just a matter of seconds after all, even if I'd rather have it done automatically :)

  • »
    »
    12 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thanks! The Competitive Companion broke in the latest VS Code update. I'll fix this ASAP.

»
12 months ago, # |
  Vote: I like it +1 Vote: I do not like it

what is Your theme name ?

»
12 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Hi, is there a quick howto, simple starter guide? I installed the extension, but there is literaly no button or anything where I can click. How can I download problems/testcases from codeforces?

I am not an expert with VSC. Where to start?

  • »
    »
    12 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Hey! The extension github link above has some instructions and a GIF on how to use. If you still don't understand something feel free to direct message me.

    • »
      »
      »
      12 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      is it fixed Now?

      • »
        »
        »
        »
        12 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Yes, the issue you mentioned was fixed yesterday. Please update the extension, and it should work again.

»
12 months ago, # |
  Vote: I like it 0 Vote: I do not like it

This is an amazing extension. I was wondering if it's possible to open the file with a custom code template while parsing

»
11 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

My code is being formatted every time I run test-cases. Is there a way I can stop this?

»
11 months ago, # |
  Vote: I like it 0 Vote: I do not like it

So I used this program with port 27121 in the chrome extension. But nothing happens. Can you help me out?

»
11 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Can you please make a video regarding the installation part?

»
9 months ago, # |
  Vote: I like it 0 Vote: I do not like it

have you updated this extension ? today , parse problem using competitive companion is not working properly . for example , it's create file like this => G_Secure_Password.undefined . here file extension should be .cpp but it's undefine now.

»
9 months ago, # |
  Vote: I like it +3 Vote: I do not like it

Does this work on WSL? When running the test cases, it seems the extension is not picking up the output from my program.

»
9 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Is it possible to select my default template which will be pre-filled when I parse problems to my code editor(VS code) ?

»
9 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Helpful extension dude !

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

when i press green icon in competitive programming

it says failed to create new file

how parse the problem?

»
8 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Been waiting for this for a long time. Thanks a lot. :)

»
7 months ago, # |
  Vote: I like it 0 Vote: I do not like it

how to stop "judge results" popping up every time on switching tabs ?

»
7 months ago, # |
  Vote: I like it 0 Vote: I do not like it

is there any solution for java users?

»
7 months ago, # |
  Vote: I like it 0 Vote: I do not like it

If there are multiple correct answers to the problem , will the extension work ?

  • »
    »
    7 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Nope. Just compares sample I/O

    • »
      »
      »
      7 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      So if the sample input has an alternate answer , it will not work ? I thought codeforces api could help maybe to check output with their custom checker

      • »
        »
        »
        »
        7 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        As of now, it doesn't. For example, you could try this problem A. Common Prefixes. An AC soln gives "Failed" when using the tool because mine doesn't match with the testcase o/p. So d-agrawal, if possible, please try adding this feature. Will make the extension even better. Apart from that, it's really cool. Thanks!

»
7 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I am using this extension for quite a while now and I must say, its really useful, Thank you so much. However, I have been facing an issue from the start. When, I am done with my code and click the green button on the input file to show me the answer, for the first time, it runs for about 10 secs before displaying timed out and SIGTERM error. However, once I close vscode and start again, it runs successfully and shows the desired output. Is there any fix?

  • »
    »
    7 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Just save your file before running the code for the first time . Press Ctrl + s and then press the green button

    • »
      »
      »
      7 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Even after saving, the issue permits :)

  • »
    »
    6 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Same issue is happening here too. For the first time I run it shows SIGTERM and then same code works fine for the second time. Got any fix yet?

    • »
      »
      »
      6 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      No. I switched to sublime text :)

»
7 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Hey, first thanks for this great tool. But I still don't understand how to debug while using this effectively. I mean I generally don't use a debugger. I just use cout statements. So to do this in VS Code I have to do it in the terminal . But the problem is the file name is generally so big. So what should I do?

»
6 months ago, # |
  Vote: I like it 0 Vote: I do not like it

when I try to run my code, the output window disapperas...any idea how to fix that?

»
6 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Hey, I have using this since a month. Recently I switched to new laptop. And whenever I run my program for the 1st time , it shows SIGTERM and then when I run the same code for 2nd time, I says passed. Why is it so?

»
6 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Can we use pre-compiled header files with this? https://codeforces.com/blog/entry/53909

»
5 months ago, # |
  Vote: I like it +10 Vote: I do not like it

anything for "visual studio" not vs code

that would be really helpful.

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

This is awesome!!! orz

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Hey ? Is there any way to add a template ?

  • »
    »
    3 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yes, go to extension settings and there is a field named "Default Language Template File Location". Write your template file link here.

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

      Hey, can you please help me with that? I went to the Default Language Template File Location. I couldn't find a way to add/remove custom template.

»
3 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

d-agrawal, thanks for making this amazing tool. It helps a lot and saves time.

I am facing an issue. Even though I checked the "Use Short Code Forces Name" in settings, my files are named as the problem name fully, not according to the short code.

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

It's an amazing tool, I have been using it for months now, but today somehow, the CPH judge got attached to the VS-code sidebar, instead of the usual view on the right side, Can you please tell me how to fix it?

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

    Right click on it -> move to right

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

      The sidebar also moves to the right if I do this, previously, VScode sidebar was on left and CPH judge on right, now moving the sidebar to right also moves the CPH judge to right.

      Seems like CPH judge got attached to sidebar itself.

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

        Yes, it's a new update The extension uses a new VSCode api and will have fewer layout bugs.

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

          The new feature update of creating TestCases on Local File is Super Cool, there are still some UI bugs. Appreciated Man!

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

        It's a Version 5.0.0 update and I thought something messed up in my settings.

        From the changelog: "Brand new UI with improved performance. The UI now appears in the activity bar ( side bar )."

        Though I like the previous version. Sidebar and CPH judge were separately good.

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

          True that, merging CPH judge and sidebar together is creating a lot of mess. Is there any way to get it back to normal, d-agrawal?

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

d-agrawal may i know which font was used while demonstrating this software, in github page?

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

Any way to get a judge to a right like it was before ? pls

  • »
    »
    2 months ago, # ^ |
    Rev. 5   Vote: I like it +5 Vote: I do not like it
    • Step 1 : Go to Extensions Tab [Ctrl + Shift + X], Search "CP Helper", Select the Downloaded Extension

    • Step 2 & 3 : Click on Down-Arrow Besides "Uninstall" -> "Install Another Version..."

    Step-1-2

    • Step 4 : Select 4.5.5 (1 month ago) or older Version

    Step-3-4

    • Step 5 : Reload VS Code

    Upvote if it was Helpful!

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

Thanks for the extension. I am getting one error while using "Ctr+Alt+b" option in vsCode. "Aborted creation of new file" . I have installed the browser extension(Competitive Companion) as well.

Could you please suggest some fix. Thanks. HNY 2021!.

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

I am using it from last 7 months staright and trust me your creation proved to be the best for me.

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

The auto submit isnt working please see to this

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

Please fix it . I am not able to submit from VS Code. I think it is broken.

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Not able to submit the code from VSCode. Please look into this d-agrawal

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

d-agrawal I am still not able to submit the code via vs code directly. Please check if there is some bug with the recent commit in the code.

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Can you add something like, if it makes a new file, it already contains my standard code template.... Btw it's a great extension

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Getting ERROR for python "Could not launch testcases process. Is 'python3' in your PATH?"

How can I resolve this issue. Please Help

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    i am also getting same error someone please help

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Please someone fix this isssue.