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

Автор snapdragon3101, 5 лет назад, По-английски

Check : https://cpeditor.org

Hi Guys!

CP Editor met Competitive Companion in 3.0, giving it the ability to parse contests from over 30+ online competitive programming websites. Now, with CP Editor 5.0, it met CF tools, a wonderful tool by xalanq which can do all most everything in code-forces, even submit solutions. Read more about CF tools in his blog.

If you are a pro-user and like vim keybindings, using cf-tools on your favorite terminal with tmux would give your more than what CP Editor has to offer but at the same time, it is very time consuming and difficult to setup on windows.

Let's dive into what is new for us in CP Editor 5.0

  • Submit solution to Codeforces from CP Editor, you don't need to copy or upload your solutions manually. Let CP Editor do it for you with just one button click. This feature requires that you have cf-tools installed and you have correctly configured cf-tools. Read the instructions below on how to install and setup cf-tools. Please note the submit button will be only visible in the editor if the problem was parsed by Competitive Companion from code-forces.
Installation and setup of cf-tool

  • Set up snippets of codes like Sublime Text, You can add as many snippets as you want in all 3 officially supported languages in CP Editor. You can set up hotkeys for triggering snippets and then search for your snippets and paste it into text editor. You can even rename snippets. Snippets are language defined, you won't find C++ Snippets when your Tab language is set to Python. All snippets are stored inside cp_editor_settings.ini file, which is located in your home directory and contains all the settings of CP Editor. This also, portable and platform independent. In order to inspect it, you can open it like any normal text file.

Big Thanks to ouuan for his work in making snippets available.

  • View Modes: CP Editor now has 3 view modes, in Editor mode the complete window of the application will be occupied with Code Editor, in IO Mode complete window will be occupied by Input output boxes and normal mode is called Split Mode, in which window is shared between the two. You can even set hotkeys to toggle the views from Preferences for a quick change of view modes.

  • You now have ability to just apply settings. There are three options, "Okay", "Apply" and "Cancel", Okay will close the window and settings will be applied and Apply will keep the preference window open while settings are applied and Cancel will close the preference window.

  • There are many other bug fixes and quality of experience improvements. There are some performance improvements too.

Download

Sources : https://github.com/cpeditor/cpeditor

Download : https://github.com/cpeditor/cpeditor/releases

Support

  • Star the project and spread the word about this editor.
  • else you can open Editor and Help -> Support me, to buy me a coffee

I will be busy with my new semester and also with Google Summer of Code 2020, Hence pace of development will slow down a bit for this project starting today.

Telegram group for community

Please join our telegram group https://t.me/cpeditor

You have can discuss, share your views and get helped or help other there.

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

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

If you found any bugs or have any feature requests, please open an issue here, and don't forget to follow the issue templates. Users' responses are important for contributors to improve the project.

If you want a try on developing, you can install Qt and CMake, then fix bugs / make new features by yourself! After finishing the coding, just open a pull request here. Don't worry if you are not familiar with Qt / GUI programming, Google is your friend, and Qt is a well documented library. I've never used Qt before contributing to CP Editor, but I've made 33 commits, including 1979 additions and 1620 deletions up to now.

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

Your extension will have it’s own codeforces soon :D

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

There have been many new features since 5.0:

  • New Test Cases UI. Now you can open up to 100 test cases or delete some of them. It's also easier to add tests from files.

  • New Diff Viewer. The new diff viewer uses diff-match-patch, so that you can see the beautiful diff result in HTML.

  • New File Logic. Now the tab status/open files/save files are almost the same as Sublime. For example, external file changes on the disk is detected.

  • Hot Exit. Now you can save the status for the next session.

  • Transparency Setting. You can set the transparency for the editor. Then, you can see the problem statement/your desktop/some pictures while coding, or just be cool.

  • Single Application. Now when you open a new file while there is a CP Editor running, the new file will be opened in a new tab instead of a new window.

  • Open Contests. You can open a folder with A.cpp, B.cpp, ..., Z.cpp easily. The folder and the number of files (number of problems) is chosen by you.

  • Command-Line Options. See CPEditor --help for more information. Now it's easier to open CP Editor from the command line.

  • Open File Progress Bar. Show progress bar for file opening.

  • Tab Bar Context Menu. A menu with options like Close Others/Reveal in Explorer. Right-click on the tab bar to open it.

  • Many bug fixes.

Some features are not well-tested yet, if you are interested in them, try it and report bugs if you find any.

Again, contributions are always welcomed, together we can build a better editor for ourselves.

Latest Stable Latest Release

screenshot

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

    When we open contest and create 'n' files,and after that when we parse tasks from contest do the test cases(of the corresponding problem) get updated or new tabs come up?

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

      I checked it now,its not updating rather creating new tabs. It would be better if just the test cases would have got updated so that we can directly save our code and submit.

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

        You can use Competitve Companion to parse a contest.

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

          Yes,but what I meant to say is when we parse contest,it would be better to just update the test cases of the created contest in cp-editor than creating more new tabs.

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

            The basic idea of this feature is that you can save directly without choosing where to save.

            If you want new features, open issues on Github.

            UPD: I didn't read his comment carefully so I didn't realize he is talking about parsing a contest after "Open Contest".

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

When I press ctrl+shift+U on contest dashboard, I got [an invalid Payload was delivered on the listening port] in CP-editor, How can I resolve this?

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

Did the same as mentioned in above procedure but getting the error as -

[You will not be able to submit code to Codeforces because CFTools is not installed or is not on SYSTEM PATH. You can set it manually in settings.]

Can anyone help me with the solution for this problem!!

Thanking You in advance.

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

    You can set the path of CF Tool in the preferences (Options→Preferences→Extras→Misc→CF Tool Command), just like the "error" said.

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

will it work on linux

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

    hey, yes it does work on Linux; if you follow the link given at the beginning of the post (https://cpeditor.github.io/), there is an option to download it directly on the main page. (Button "Get for Linux", or something like that, when you browse the site from a Linux machine.)

    I am using the tool on Linux too, and can only recommend it.

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

I did everything as above and it worked well but i still don't know how to submit what should i do to submit a problem.

Edit: never mind i found out how to do it now

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

Can it be used to submit on other online judges? If so, please tell me how.

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

Can you make a mode which is all dark instead of only the code is dark?

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

    If you use Windows 10, starting CP Editor 6.3.1 (current Beta version), if you enable "Dark mode for Apps" in Windows 10 Settings and use our Editor, It will use full dark theme.

    If you use macOS 10.14.5+ Turning dark mode on from System Settings will make Editor dark as well.

    If you use Linux distributions like KDE, using any dark theme from system Settings will make Editor Dark.

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

      Can this work on the previous version (I think 6.2.4)?

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

        If it was added in 6.3.1 how can it work on old version?

        For Linux and macOS it will work for any version of CP Editor but for windows at least 6.3.1

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

Would someone please tell me how can I append -std=c++11 to my compile command!

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

Java users -> class name of main class must be "a"

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

I followed the above-mentioned steps for the setup of cf-tools. But when I run the command cf test, it gives an error Runtime Error #1 ... exec: "dummy": executable file not found in %PATH%.
Rest of the commands like cf gen, cf list, cf submit, cf stand are working fine.
Please help.

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

When I tried to submit then it print "cannot find csrf".

How can I solve this issue?

»
4 года назад, # |
Rev. 5   Проголосовать: нравится +3 Проголосовать: не нравится
  1. Thanks snapdragon3101 for the awesome editor.
  2. I have a few questions regarding this -
  • Is it possible to change color of the messages shown in console? I want all of it to be in white, I find red color irritating and by default all the variables printed in cerr are shown red in console.
  • Can I remove/switch off the auto addition of first 6 lines in the template i.e. problem name, contest, time limit etc ?
  • How can I add the placeholder of cf-tool into template ? I could not find any tutorial regarding this.
  • How can I add a custom background theme? Or can you share the path where theme files are stored on linux so I can change background color manually?

Also, I want to know whether the test cases parsed by competitive companion are stored permanently on system and if so then what is the location so I can delete it manually?

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

    You can choose to save test cases on your disk or not (Actions->Save->Save Test Cases), and you can also set where to save test cases in the settings (File Path->Test Cases).

    There are many settings, but the documentation is still under construction. If you want the best experience in the future, you can go through all settings, read their tooltips, and configure them.

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

snapdragon3101 When I submit code from the editor, few lines goes out of indentation automatically, like in this submission, the 3rd and 4th line of main() function is out of indent, also, the tab width becomes too large in codeforces automatically(I guess approx 8), although in editor tab width is set to 3. Can you please fix this.

Also, in every live contest, when I parse problem-A using competitive companion, the new file is created with name — "0" instead of "A" and with wrong URL(therefore I cannot submit it from the editor), don't know whether the bug is in parser or cpeditor. Can you please look into this.

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

I have downloaded it and setup as per said those 7 steps...and also restarted my device. But now when i try to run cf.exe it just appears a window and just gone in a second. Maybe something preventing the exe file to run. I turned off windows defender but doesn't change the situation. I also have competitive companion on my chrome.

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

    This is a command line app, so it must be invoked from the terminal.

    Try doing the following

    > cd Your\Path\to\CF\
    > .\cf.exe
    

    where > represents the command prompt. You should not enter them as a part of the command.

    To start the command prompt, you can press Windows+R then type cmd.

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

can you add option of IO in left and Editor in right. And option of vertical splitting of IO and Editor.

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

feature request : please add autocomplete feature.

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

How do I load a particular template everytime I open a new problem? Currently, what opens up is a file with a few comments

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

please say how to get the template file? What I have done is- 1)setup the cf-tool and added template to it 2)also added cf-tool to my path But when i click on Competitive Companion in browser what i get in cp-editor are only few comments like these..

//Problem: F. 1 2 3 4 ...
// Contest: Codeforces — Codeforces Round #696 (Div. 2)
// URL: https://mirror.codeforces.com/contest/1474/problem/F
// Memory Limit: 256 MB
// Time Limit: 5000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

What to do now?

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

Whenever I try to submit to codeforces CP editor is asking me to select language. PS: I have manually set CF tools through preferences. Anyone please help me out in this....

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

    You have created two templates in CF for C++. Please delete one of them.

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

      How to delete, I have set 1 template from preferences and no template left when I deleted that one.

      Update: It is solved now , Thanks....

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

Is there a way to parse all tasks of a contest at once into cp editor instead of opening each problem and parse it?

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

Hi. Could you implement the following features? Thanks in advance.

  1. Custom keybinding for Detached Run (if possible, other editor functionalities too).

  2. When I press Shift + Home, all the characters before the cursor will be selected, including the tab/space for the indentation. Can you fix it so only the characters after the indent are selected?

  3. Detached Run without compiling, only running the executable in the terminal window.

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

What should I do if I want to use c++ 64 bit features like using __int128 ? It gives error if I use __int128 currently.

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

Is it possible to have the author's name and the current time (the placeholders like in the cf-tool) in the template? Right now, if I set up the template with the placeholders in the cf-tool, it won't work.

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

dose it work for mac ?

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

how to enable Hinting on CP Editor?

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

Hi, sorry for necroposting, but is anyone able to increase font size above the default? I tried a lot from preferences but it doesn't seem to increase :/

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

decided to try it for the first time and and saw a mind-blowing thing: pressign home button sends cursor to start of line ignoring tabulation

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

When adding template absolute path it says its invalid, pls help!

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

whenever i try to login on cf config it says "cannot find csrf" ....can someone help? also, where can i find the 'cf config' file on macOS?

/