Блог пользователя Dragonado

Автор Dragonado, 3 года назад, По-английски

Hello Codeforces!

We , aditya_chirania, niranjan.sy99, lomadapraveenreddy, janmansh and I (Dragonado) of IEEE-NITK, are extremely happy to release our VSCode Extension for CF called CodePal

CodePal is made to help Codeforces Users Code with Convenience. This extension is especially for people who want to save time in a live codeforces contest and upsolve problems comfortably. This extension responds quickly to users. It can swiftly filter through the problem list by specifying tags and ratings, create folders for contests and problems containing sample tests of each problem in them and compile and run tests automatically. For added convenience, we've created buttons to directly open problem statements and submission pages on the default browser.

Current Features of this Extension

  • View Complete ProblemSet List along with their associated tags and ratings.
  • Swiftly Filter through the ProblemSet by specifying Ratings and Tags.
  • View Currently running, Upcoming and all Past contests and also view the precise start date, time, and duration of upcoming contests.
  • Fast Folder Creation on a single click for Contests from the Codeforces contest list and Problems from the Codeforces problem list.
    • Folder for a contest contains a folder for each problem and also contains all sample test cases and program files for each problem.
    • Folder for a problem consists of all its sample test cases and a program file loaded with a template whose path may be specified in the settings.
    • Manually create a contest or problem folder by simply specifying name of contest/problem and number of problems.
  • Add additional tests to any problem.
  • Compile and run any program file against the test cases and get comprehensive results.
  • Open the problem statement or submission page with a single click, on your default browser. (You must be logged in to codeforces beforehand to open the submission page successfully)
  • Compiler may be selected and compilation flags can be set through the CodePal settings.
  • Perform Stress testing to find a counter test case for your code.
  • Get a personalized experience of viewing details of your Codeforces profile and the status of problem submissions made, by entering your Codeforces handle in the codepal settings.
  • Use AtCoder library in C++ with no extra setup.

Languages Supported

  • C++ (compiler: g++)
  • C (compiler: GCC)
  • Java (compiler: javac)
  • Python
  • Kotlin
  • Note: You may add additional compilation flags through the codepal settings (example: -std=c++14) and also choose between python, python2, or python3 depending upon the python command you use on your system to run.

Operating Systems Supported

  • Windows
  • Linux
  • Mac

Here is a snapshot of the extension

You can install our extension here: https://marketplace.visualstudio.com/items?itemName=IEEE-NITK.codepal

You can find the usage guide, developer docs, and demo GIFs here: https://github.com/IEEE-NITK/CodePal/blob/master/README.md

Please do try it and give us your feedback. If you face issues or bugs, please comment on this blog or here. We're planning some more features for our subsequent releases and wish to keep all subsequent releases as smooth functioning and responsive as this.

Thank you :)

UPDATE: We have added AtCoder library support for C++. You can now use this great library with no extra setup. You can easily submit it to any Online Judge other than AtCoder as well. For more information on usage, you check our README here

UPDATE: After the recent feature on codeforces to highlight each test case, our extension had broken. We have now patched it. We have now also added support for Haskell.

  • Проголосовать: нравится
  • +135
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится +9 Проголосовать: не нравится

Looks Great

»
3 года назад, # |
  Проголосовать: нравится +9 Проголосовать: не нравится

Excited to try this out!! :D

»
3 года назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

awesome

»
3 года назад, # |
  Проголосовать: нравится +2 Проголосовать: не нравится

Wow, This seems really cool.

»
3 года назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

Tried it and its awesome

»
3 года назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

This is really good! Please update the blog whenever the Mac support for c++ is released.

»
3 года назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

is there any way, this can help me read problems without having to leave vs-code? it would make it absolutely great!

»
3 года назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

Thanx for this. Its awesome.

»
3 года назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

This is really good! Thanks for this, please try to make an update that we can just directly upload/submit the file.

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Thank you :). We will work on it. We will update the blog if we manage to provide the same speed and convenience as codeforces submit.

»
3 года назад, # |
  Проголосовать: нравится +9 Проголосовать: не нравится

Used it and it really helped me in the contest. Thanks!

»
3 года назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

Do you Implement Caching for user Profile and Problems and stuff and just hot reload it then, or does it takes loads all this info everytime we open VSCode and use this extension?

  • »
    »
    3 года назад, # ^ |
    Rev. 4   Проголосовать: нравится +6 Проголосовать: не нравится

    Since new problems get added every week and your submission status also changes, we load problems everytime you open VS Code. We initially did think of caching in a json file locally but we were faced with the following difficulties:

    • If we cache all problems till date D, the codeforces api doesnt let us request for problems added only after date D. It always returns the entire problemset. So if we anyway are returned all problems by the codeforces api , why cache locally.
    • We could try to do webscraping from the Problemset Page to get more recent problems after the last cached date D. But webscraping from one problemset html page and then parsing it and looking for the recent problems would turn out to be much slower than directly getting the problemset object as a json object from the cf api
»
3 года назад, # |
Rev. 4   Проголосовать: нравится 0 Проголосовать: не нравится

when i test "stress test", brute.cpp can't load templatecode, even though i set this in setting and common file doing well. how to fix it?

upt it just my mistake

»
3 года назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Is there any option for virtual contests??I did not get my virtual contest neither in past,running or future contests. Also is there any way to open a problem folder in vscode using the problem link ??

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Virtual contests arent returned by the codeforces api so thats why we werent able to include them.

    • »
      »
      »
      3 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Ok. Thanks for the quick clarification.

      • »
        »
        »
        »
        3 года назад, # ^ |
        Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

        Im not sure if i understood your question correctly but there is a create folder icon that can create the exact problem or contest folder in vs code... If u meant opening the problem folder that already exists on the file system...thats not included as of now

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

is there any function to view cerr out when my source is infinite loop?

  • »
    »
    3 года назад, # ^ |
    Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

    We just found small bugs in cerr. It doesnt behave as expected for inifinite loops but works fine in any other case. Thanks for pointing out. We'll fix it soon for infinite loops as well.

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I would like to suggest some features: - It would be great if you could add codeforces authentication and we need not manually paste the code while submitting. - Also while adding a folder for a problem, do consider opening the problem statement in the VsCode side pane or if not just open it in the browser by default. - Implement the search functionality in both problemset and past contests. - Adding support for competitive companion or developing some similar extension to achieve the same would be great.

  • »
    »
    3 года назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

    Thanks for the feedback. We'll work on adding those features but about the search functionality, there is a provision in VS To search through the contests and probelems anyway. Just click anywhere in the problemlist/contestlist and start typing the problem/contest you want to search for. They will get filtered accordingly. Incase that search doesnt seem too obvious to spot, we can go ahead and add a search as well.

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Mind blowing extension :)

Screenshot-from-2021-04-16-10-47-41

But can you plz reverse the future contests list, I think it would be good if these are shown in ascending order of their happening time. Thanks!!

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Although this is very awesome but for problems that have multiple correct answers, it fails. It will be nice if you resolve this.

»
3 года назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

amazing

»
3 года назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

Amazing work!!

»
3 года назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

I am using an extension competitive companion for the past 2 months and now I tried this extension, I feel this much better as it doesn't slow down vs code much and has an easy interface, and also the feature of details about the upcoming CF contest is also good. REALLY NICE !!

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I am not able to integrate my compiler installation with VSC, on compilation I get "g++: fatal error: no input files"

Most likely the reason is some path conversion error from linux/windows paths. How is the compiler to be installed on the system to make it work, is there a description somewhere?

Also it would be great help if configuration/setting would be explained in even more detail. Consider a user entering the settings uses VSC for the very first time, or did not use it for like some years.

  • »
    »
    3 года назад, # ^ |
    Rev. 2   Проголосовать: нравится +3 Проголосовать: не нравится

    Hi,so im assuming you use c++ and generally compile c++ programs on your system by entering "g++ filename.cpp <--flags>" in your terminal/cmd. Incase you dont, just include g++ in your environment variables(windows)/PATH variables(linux) on your system so g++ can be run globally in your cmd/terminal. You could type "g++ --version" in your terminal to check if its been done properly. Then do the following:

    1. Press "Ctrl+comma" on your system to open the VS code settings.

    2. Go to the codepal section in Extensions->codepal

    3. The compiler would be set to g++ by default.

    4. Head to compiler flags section and add whatever compiler flags you typically add.

    Our extension basically runs g++ for you in your environment. Hence it needs g++ to be included in the nvironment(windows)/PATH(linux) variables on your system.

    Secondly, yeah we need to work on our documentation! Will ensure a better documentation soon! I hope this helps the issue you're facing. Incase it doesnt , it'll be great help if you could elaborate your issue in the issues section of our repository and we'll ensure a fix for it in the next release.

»
3 года назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Great Job, Guys

»
3 года назад, # |
Rev. 2   Проголосовать: нравится +3 Проголосовать: не нравится

Awesome! This is the best extension I have seen so far which supports almost all widely used OS + languages.
Thanks for building this!

»
3 года назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Really nice extension, thanks for your efforts :)

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Looks great

»
3 года назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

Awesome

»
3 года назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Please add Kotlin

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

This is amazing! A suggestion: It would be really nice if you could add the functionality of adding problems using their Codeforces link. This would allow test cases to be fetched automatically.

»
3 года назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

why the setting "Codepal: Generator Template Path" doesn't work? is it bug?

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится +3 Проголосовать: не нравится

    Hi, are you mentioning the entire path there, because it works. Can you share a screenshot or something?

    • »
      »
      »
      3 года назад, # ^ |
      Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

      i found if gen file is zero byte, this file is not used. anyway it may not a big problem.

»
2 года назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

Thanks buddy..

»
2 года назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

shows me error "cannot read property 'length' of undefined" when trying to expand the 'future'/'running'/'past' column in contest does not show anything in the problems box gave the handle in settings but only shows "handle:shashwatgandhi88" nothing else like in the image

  • »
    »
    2 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Hi! This happens when the extension doesn't receive a response from CF API. This usually happens when you have a bad internet connection. Please try again with a stable internet connection.

»
2 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Why my codepal now creates an empty folder?

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

While stress testing how to provide expected output from generator itself? For example if I have a rotated sorted array. I don't want to write brute.cpp but directly pass expected output from generator itself.

  • »
    »
    19 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Can you explain more about what you are trying to do? The job of the generator is just to print test cases.

    The stress testing works like this:

    • Suppose gen, brute and soln are the three executable files.
    • ./gen 1 > input.txt
    • ./brute < input.txt > brute_output.txt
    • ./soln < input.txt > soln_output.txt
    • Check if brute_output.txt and soln_output.txt are equal. If they are then we try "./gen 2" and so on.
    • If the two files don't match then the stress testing stops and this input file is shown.

    This is the reason why you can't directly do stress testing on problems with multiple correct solutions. Although there are workarounds like adding a checker inside your soln.cpp

    Hope I cleared your doubt.

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Can anybody help me in this extension. I am getting the following error https://drive.google.com/file/d/16dn2RnhbCKbEUNYOUqlDz5n9DFAz4ZcX/view?usp=sharing

  • »
    »
    19 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    You don't have g++ installed on your system. The extension is only trying to run g++ on your system. So if your system does not have g++ installed you would see this error.

    • »
      »
      »
      19 месяцев назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      I have installed it. When I run code manually it runs perfectly, but if try to run test case it throws the error.

      • »
        »
        »
        »
        18 месяцев назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        It says command failed: "g++ -o " in the image you shared

        VS Code is only runnning the exact same command as written next to "command failed:" on your system. And it displaying the exact same error that your system returns.

        Try to make sure if the same command written next to "command failed:" in the image you shared , works manually. If not, you can ping me and we can connect once to fix this.

»
19 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Hello , why it says "compilation error!!!" when only warnings exist .

  • »
    »
    19 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    It is intended behavior (sort of). Definitely, we need to change the error message to "Warnings Exist" or similar. But since this extension is mainly for beginners its good practice to resolve the warnings before running the test cases.

    Maybe in the future, we can add an option in settings to run the code even if warnings exist.

»
18 месяцев назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Is there an option to parse test cases of problems from GYM contests in one click? (except manualy adding the test cases)

»
17 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Hi I think I like the idea. Can you please give the option to hide tags for unsolved problems. It's quite a bummer

  • »
    »
    17 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    There is a collapsible tree to view the Tags. You can choose to not expand the drop down if you dont wish to see the tags.

»
13 дней назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Hello, I hope You still maintain this extension at this moment. I am trying to specify my path to a template file as a relative path, but so far I failed to do so. I assume that this feature is not supported by now. It would be great if You added it.

  • »
    »
    7 дней назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Hi, we don't really maintain this extension anymore. We made this extension as college students, we have graduated and now work full time since then. For the near future at least, there are no plans to maintain but it might change in the future.

    I will try to help as much as I can. The template file feature should work. Please give the absolute path of the template file. If the error still persists then can you share screenshots of the error and your system specifications (OS. VSCode version etc,).

    • »
      »
      »
      6 дней назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Hello, I am glad You answered. I now use an absolute path to a template file. By the way, your extension is really helpful, because other vs code extensions related to the subject are either not useful or do not support newer versions of VS code.