### Jatana's blog

By Jatana, 5 years ago,

Hello, I would like to introduce the plugin FastOlympicCoding for Sublime Text.
It provides several useful features for competitive programming.

##### Test Manager
• The main feature is test managing. You can effectively add, edit, and delete tests. See the screenshot above.
##### Debugger
• Also for OSX, there is a debug functions.

##### Class Completions
• The next feature is class completions.
• Write chars as classes for a template substitution.

##### CppLint
• C++ lint
• Edit lint properties in settings.

##### Stress Testing
• You can stress test your program for finding test where it works incorrect.
• This function requires a program that works correct and a test generator.
• For further information see instructions on github

For the additional information and keybindings please visit the github page — https://github.com/Jatana/FastOlympicCoding

##### Contribution and Issues
• Feel free to ask any question or express your ideas here or on github

• +245

| Write comment?
 » 5 years ago, # |   +8 Great job! As a Sublime Text user, I have to say thanks :)
 » 5 years ago, # |   0 Amazing work will be very helpful if you can also provide something for java like this
•  » » 5 years ago, # ^ |   0 Make sure, that you can add any language in the settings. For example, there is already defined python.
 » 5 years ago, # |   0 Aren't autocompletion, linting and other IDE functions common plugins for many languages?
•  » » 5 years ago, # ^ |   0 Linting, debugging and completions are only for C++, other features are for all languages.
•  » » » 5 years ago, # ^ |   0 That's not what I'm talking about.I'm saying there were plugins doing these things long ago.
•  » » » » 5 years ago, # ^ |   +5 Yes, I agree that some functions have already in use. But, there are also innovative functions too.
 » 5 years ago, # |   +13 I think the "Compile and Run" should save the file first then compile, as default compile options in sublime does.Btw, how to change key bindings?
•  » » 5 years ago, # ^ |   0 Preferences-Browse Packages-CppFastOlympicCoding-Default (your os).sublime-keymapBut, it changes to default with every plugin update.
•  » » » 5 years ago, # ^ |   0 And what about the "Save + Compile + Run"?
•  » » » » 2 years ago, # ^ |   +3 you can add "save_on_focus_lost": true in sublime user setting, hope it will help.
•  » » » 12 months ago, # ^ |   0 Jatana how can we change/edit Class Completions ?
 » 5 years ago, # |   0 It is not working for me on Ubuntu 18.04. When I compile (ctrl-alt-b) gives the following error: Traceback (most recent call last): File "/opt/sublime_text/sublime_plugin.py", line 993, in run_ return self.run(edit, **args) File "/home/daniel/.config/sublime-text-3/Packages/FastOlympicCoding/test_manager.py", line 1465, in run self.create_opd(clr_tests=clr_tests, sync_out=sync_out, use_debugger=use_debugger) File "/home/daniel/.config/sublime-text-3/Packages/FastOlympicCoding/test_manager.py", line 1307, in create_opd file_ext = path.splitext(file_name)[1][1:] File "./python3.3/posixpath.py", line 125, in splitext File "./python3.3/genericpath.py", line 92, in _splitext AttributeError: 'NoneType' object has no attribute 'rfind' 
 » 5 years ago, # |   0 I have installed it from package control but unable to use it.Can somebody please tell what is the next step after installing the plugin?
•  » » 2 years ago, # ^ | ← Rev. 2 →   0 If you figured it out, could you please help me? UPD — Done
•  » » » 2 years ago, # ^ |   0 Can you please explain? How to use it?
 » 4 years ago, # |   0 Can anybody help me. When I try to compile it just hung. Can any body give me there settings file. Thank you
 » 4 years ago, # |   0 Hey, I have a feature request, can you automatically fetch test cases from cf problem page into sublime editor? Something like Hightail does?
•  » » 4 years ago, # ^ |   0 Chelper also does the same. Do you know any plugin for c++ coding with automatic test case generation?
•  » » » 3 years ago, # ^ | ← Rev. 3 →   0 Jhelper :)
•  » » » » 3 years ago, # ^ | ← Rev. 13 →   0 riadwaw Jhelper usable with Clion 2019.3.2??
•  » » » » » 3 years ago, # ^ |   +1 Somewhat offtopic, but yes, it should work
 » 4 years ago, # |   0 Is there any similar package for python I have switch from c++ to python and i miss it so much Thanks
 » 4 years ago, # |   0 please somebody help..how to use python in sublime text?
 » 3 years ago, # |   +1 Can you add support for competitive companion so that we can automatically run the test cases. You could also add a submit soln button using cf tools.
•  » » 3 years ago, # ^ |   0 Would be awesome if competitive-companion is supported in the plugin by default. It bothers me a bit that there's not even a shortcut for clearing all tests for a file, so after solving a problem I have to clear all the tests manually for that file to recode in that same file (Since I always code in files named "A.cpp"...etc in a folder).Until competitive-companion is supported by default, here's a little workaround: FastOlympicCodingHookSetup Make sure you have python3, FastOlympicCoding and Competitive Companion installed. Add 12345 in the list of ports of competitive-companion browser extension. Clone the repository inside your Sublime Text Packages folder and rename the cloned folder to FastOlympicCodingHook. You can do a quick google search to locate that folder for your particular OS or you can click the "Browse Packages" option in Sublime Text (if you find it) and the folder will open itself. Usage Navigate to the file that you'll solve the problem in. Then right click anywhere in the file. You should find an option named Listen to Competitive Companion. Click on it. In the browser, navigate to the problem page and click on the competitive-companion extension's green plus icon. The problem test cases and correct answer would be parsed now and stored in a file named your filename/tests. You might not immediately see the change in test cases inside sublime text. But if you run your code using FastOlympicCoding plugin (ctrl+B), then it'll you show those updated test cases and run your code against them.
•  » » » 3 years ago, # ^ |   0 can you plz elaborate more plz?add 12345 port and clone itbut can't find Listen to competitive Companion option?can you plz help me?
•  » » » » 3 years ago, # ^ |   0 I recorded a short walk-through here. Try to follow these steps exactly as shown. Let me know if the option still doesn't appear. And sorry for the horrible quality of the video. I don't have any access to a WiFi right now.
•  » » » » » 3 years ago, # ^ |   0 Thanks, for your effort.but in windows there is no test file created like u, and may it can't be recognize accepted or declined .anything happened always so accepted.
•  » » » » » » 3 years ago, # ^ |   0 Windows issue has been resolved now. Many thanks to ABSTERGO for helping me out.
•  » » » » » » » 3 years ago, # ^ |   0 where i get updated version?
•  » » » » » » » » 3 years ago, # ^ |   0 I updated the code in github repository, so you can just delete and re-clone the repository in your sublime packages folder. Alternatively, you can also open the repository folder in your command prompt and run the command git pull which will update your local copy with the updated codes in github.
•  » » » » » » » 3 years ago, # ^ |   +22 First, I would like to thank DrSwad Jatana for their support. I'm using FastOlympicCoding and FastOlympicCodingHook on windows and it's working fine. Install the latest version of the FastOlympicCoding plugin(simply remove it and install again) from here FastOlympicCoding. Add the following line in the FastOlympicCoding' settings file: "tests_file_suffix": "__tests", Clone the FastOlympicCodingHook in your sublime packages folder.
•  » » » » » » » » 3 years ago, # ^ | ← Rev. 2 →   0 brother, is there any way it automatically knows that this test case is wrong or right?where should we add the line anywhere in the settings file or specific after some line?
•  » » » » » » » » » 3 years ago, # ^ |   0 anywhere on the right blank side
•  » » » » » » » » 3 years ago, # ^ | ← Rev. 2 →   0 In settings where should I add this line, and when I press ctrl + b its just displaying output in command line
•  » » » » » » » » » 3 years ago, # ^ |   0 add it on the right hand side. try ctrl+alt+b
•  » » » » » » » » » 3 years ago, # ^ | ← Rev. 3 →   -8 Thanks,that worked, Is there a way to delete all test cases at once?
•  » » » 2 years ago, # ^ |   0 Do we have anyway? so that we don't have to select Listen to Competitive Companion again and again for every new problem we try to phrase.
 » 3 years ago, # | ← Rev. 2 →   0 can someone tell me , how to modify this so that it will work as given below .. mmll --> multimap msll --> multiset dql --> deque 
•  » » 3 years ago, # ^ | ← Rev. 2 →   -10 You can use typedef multimap mmll; typedef multiset msll; typedef deque dql; or #define mmll multimap #define msll multiset #define dql deque 
•  » » 3 years ago, # ^ | ← Rev. 2 →   +13 Sublime menubar -> Tools -> FastOlympicCoding -> (in the File opened) cpp_completion_setting. Add any more snippet in the fashion given below. "deque":{ "template_size": 1, "bind": "d" }, "unordered_map":{ "template_size":2, "bind": "D" } Please note that you can only use one char as bind.
 » 3 years ago, # |   0 When I try to compile it only works the first time after I have started Sublime, then when I try to compile something it gets stuck at "compiling" and never finishes. I saw that there are people with similar issues but never found a solution to them.
•  » » 3 years ago, # ^ |   0 I have the same problem, but it gets stuck on "compiling" only after ctrl+shift+b (debugger)
•  » » » 3 years ago, # ^ |   0 You just have to avoid using Ctrl+Shift+B, but if you can't there's a workaround.Make a new build system named "nobuild" and leave the file blank, then use it as your default build system. Now if you press ctrl+shift+b by mistake, it'll just do nothing, so problem solved!
•  » » 3 years ago, # ^ |   0 I have the same problem, and sometimes it gets stuck at "compiling" the first time after starting sublime.
•  » » » 2 years ago, # ^ |   0 Having the same issues. Anybody figured it out?
•  » » 11 months ago, # ^ |   0 Facing the same issue, did anyone figure it out?
 » 3 years ago, # |   +10 I have a problem where when you save the file the test case gets cleared, is there any ways to fix that.
•  » » 3 years ago, # ^ |   0 The following should work. Open FastOlympicCoding settings file (press ctrl+shift+p and type Open Settings) Add the following line there: "tests_file_suffix": "__tests"
•  » » » 3 years ago, # ^ |   +10 Thanks it fixed it!
•  » » » 2 years ago, # ^ |   0 There are two columns, In which side I should add this line?
•  » » » » 2 years ago, # ^ |   0 left side
•  » » 3 years ago, # ^ |   0 It's not happening with me. When I save the file, I have to recompile it with ctrl+alt+b.
 » 3 years ago, # |   0 Is there a way to send the code from the Sublime Text?
 » 3 years ago, # |   0 Is debugger works only for clang compiler? I use gcc on mac. When running with debug shows “LLDB.framework” is damaged and can’t be opened. You should move it to the Trash."
 » 3 years ago, # |   0 Hey .. just like ctrl+d, which deletes the current testcase, Is there a way to have a key Binding which deletes all the test cases present in the file. Thanks in advance !
 » 3 years ago, # |   0 Recently I tried to use ST because my codeblocks is compiling slow.But I'm facing problem that when there is infinite loop system is crashing.I want feature like codeblocks that whenever I write infinite loop system will not crashes?
 » 3 years ago, # |   0 Will be amazing if it is integrated into VS Code.
•  » » 2 years ago, # ^ |   0 if you need similar functionality for VSCode you can use ACMX extension.
 » 2 years ago, # |   0 Hi! IS there a way that we can delete all the existing tests of a program while compiling and enter all tests from the scratch. As deleting one test at a time is kind of annoying. Thanks.
 » 2 years ago, # |   0 The test manager is not reading the input, so i have to stop the program to run and then I have to edit the test after which the programs gets the input and runs successfully. Is there any way it can be fixed?
 » 2 years ago, # | ← Rev. 2 →   0 I am facing a problem in the autocompletion feature(Windows). Whenever, i try to autocomplete the recommened stuff for eg. vec to vector<> ,then the std:: appears with it too and it becomes too annoying. I have tried to change the settings but I couldn't succeed. Please help!!!!!!! Refer to the link to see the problem https://www.imageupload.net/image/screenshot-38.klbeJ
•  » » 2 years ago, # ^ | ← Rev. 2 →   0 that is most likely Sublime Text's default snippet, you can read this to see how to fix it
•  » » » 2 years ago, # ^ |   0 Yes...It's due to sublime default snippets. I have modified it and now it works fine.
•  » » » » 11 months ago, # ^ |   +1 whohet how can we change/edit Class Completions ? suppose I want sort to sort (arr, arr + n) how can I do that ??Also how to edit settings file to get vec to vector<>
•  » » » » » 11 months ago, # ^ |   0 For that you need to overwrite default autocompletes, which are hidden by default and can be seen by "Package Resource Viewer". For more see this.
 » 2 years ago, # |   0 When I try to input manually it continues infinitely. It should stop by Enter key. But cursor goes down and down when i press enter. It does not stop taking input and does not show output.
•  » » 2 years ago, # ^ |   0 Solved. Num pad's enter key doesn't execute output but qwerty's enter key execute output.
 » 2 years ago, # |   0 I am just wondering Where to give input file??
 » 2 years ago, # |   0 Jatana, Is Codeforces contest setup having some issues lately ? I have tried reinstalling and every stuff but when I try to make a new codeforces contest, it just doesnt load the new files and tests for the same ? I would appreciate the help in advance, Thanks !
•  » » 2 years ago, # ^ |   0 Could you send the link to the contest which you are trying to setup?
•  » » » 2 years ago, # ^ |   0 I was trying to parse this round.
•  » » » » 2 years ago, # ^ | ← Rev. 2 →   0 Press ctrl+~, then try to parse the contest, and paste the log here.
•  » » » » » 2 years ago, # ^ |   0 Actually I think the bug is related to the custom test suffix in the new update, I removed the getsettings condition keeping only the original TEST_SUFFIX_FILE condition and the plugin seems to work fine now
 » 2 years ago, # |   +5 Jatana Can you please make a video tutorial of how to install and setup. it will be helpful for beginners like me.
 » 2 years ago, # | ← Rev. 2 →   0 Firstly,this is really a great tool! Thanks to the author! i spend some time to config it, here's how i do it, hope it can help: btw, i use sublime on windows10. how to use this tool? just download the FastOlympicCoding folder from github and put it in you sublime package folder, here's my location:C:\Users\zzy81\AppData\Roaming\Sublime Text 3\Packages\FastOlympicCoding, and there might be a user folder in the package folder too, it's the config folder for your sublime. If you don't want to save it before you run cpp, just because it's too annoying, so you can google how to autosave sublime, you just need to add "save_on_focus_lost": true in user setting. If you dont want to use ctrl+alt+bto run you cpp, just go inside FastOlympicCoding folder and open Default (Windows).sublime-keymap, find ctrl+alt+b and change to anykey combination you want.
•  » » 2 years ago, # ^ |   0 can you just upload a video of this? I have followed the instructions but still, there are several problems.
•  » » » 2 years ago, # ^ |   0 i kinda don't want to config one more sublime again.. i will send you message.
•  » » » 2 years ago, # ^ | ← Rev. 3 →   0 just put FastOlympicsCoding in package folder, then it should be ok.
 » 21 month(s) ago, # |   +9 First of all, sorry for commenting on an old post.Is there any way by which we can set an upper bound on the runtime of a program and memory usage of a program?Whenever I have a command such as while(1) { v.push_back(0); } which uses too much memory, my system freezes, and I have to shut down it forcefully.
•  » » 21 month(s) ago, # ^ |   0 I think you can fix this by timeout in your run command. For linux, its timeout 5 ./executable_name , this would kill the process after 5 secs. Sorry, I dont know its windows alternative, but will update this when I find one.
•  » » » 21 month(s) ago, # ^ |   0 Thanks, I too use Linux and it worked for me.
 » 20 months ago, # |   0 I tried using a js file to auto parse the testcases but when I try to build the file the testcases get deleted. Cans someone help? I tried using HealthyUG setup but apparently its not working for me.
•  » » 20 months ago, # ^ |   0 Can you tell me how you parsed the testcases from Codeforces and tried testing it....any video..?
•  » » » 20 months ago, # ^ |   0 https://youtu.be/4B-2WxvEBuI You can refer to this link that I used. At the end of the video he has explained his setup.
 » 20 months ago, # |   0 Can anyone tell me how to test a custom testcase? Whenever I try to run a custom test case it goes into an infinite loop.
•  » » 12 months ago, # ^ |   0 Yes, I've met the question as you too.
•  » » » 11 months ago, # ^ |   0 compiling and running the code first and then adding the test case works.
 » 19 months ago, # | ← Rev. 2 →   0 For parsing test cases every time I need to left-click and choose "listen to competitive companion" and then use the competitive companion is there any other alternative where I don't need to left-click and choose listen to competitive companion every time? Sorry for replying to an old post but I am too annoyed and didn't find a solution to this anywhere.
•  » » 19 months ago, # ^ |   0 You can use an automatic parser (a python file) for a particular problem. Github repository link :Use this repo for setting that up, you can also watch epsilon's particular video on this. Video link .Also, you can parse the full contest by making some changes in the automatic.py file in the above-mentioned repository!
 » 15 months ago, # | ← Rev. 4 →   +16 Hello, I would like to share a plugin (i.e., custom target) which runs fast olympic coding after the sublime build is executed successfully. This allows user to have a complex build system (for example: having multiple variants like one variant to fast compile and other to slow compile, that is, in debug mode with various checks) along with the functionality of running fast olympic coding.I tried various modifications in FastOlympicCoding.sublime-settings file but I couldn't find a way to have multiple build variants for a particluar language. Also, the run_settings have fewer options compared to what a build system offers.Recently, I came to know that we can have a custom target to execute builds and so I thought to give it a shot. I created the plugin and I think it is working great.The files can be found here. The setup instruction is written as comments in the file itself.
 » 12 months ago, # |   +8 Any shortcut key to delete all the test cases at once?
•  » » 12 months ago, # ^ |   +8 Ctrl + A then Ctrl + D
 » 12 months ago, # | ← Rev. 2 →   -10 Deleting
 » 6 months ago, # |   +2 ctrl + alt + B not working on windows for program execution, is anyone facing this problem :(.
•  » » 6 months ago, # ^ |   +1 Yes it is not working
•  » » » 6 months ago, # ^ |   +1 I deleted sublime, installed it again though its not working lmao...
•  » » » » 6 months ago, # ^ |   +1 I guess the package got updated automatically and maybe the settings have changed.
•  » » 6 months ago, # ^ |   0 Yeah, it was not working on my computer too. I just uninstalled sublime text and then again installed it. Now it is working perfectly fine.
•  » » » 6 months ago, # ^ |   0 i tried same, but didn't work for me...nothing is happening after pressing the execution key.
•  » » » 6 months ago, # ^ |   0 It doesnt work for me after re installing.
•  » » » » 6 months ago, # ^ |   0 now, fast-olympic coding is working, but competitive companion and fast olympic coding hook not working.
•  » » 6 months ago, # ^ |   0 Not working on linux too.
 » 5 months ago, # |   0 this is not working on my mac after installing cppfastolympiccoding please help me anybody
•  » » 2 months ago, # ^ |   0 maybe you can change the keymap in the folder where the plugin locates, here are the details :click here
 » 2 months ago, # |   0 Does it have the place to change the keymap? As a mac user I'm used to "command" but not "ctrl", can I change the keymap just in this plugin?