Giter Site home page Giter Site logo

horcrux2301 / afcp Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 0.0 180 KB

Competitive Programming Contests Automation Package for text editor Atom.

Home Page: https://atom.io/packages/afcp

License: MIT License

JavaScript 95.41% CSS 4.39% C++ 0.20%
automation atom atom-package codeforces atcoder codechef atom-plugin competitive-programming competitive-programming-contests cpp

afcp's Introduction

AFCP

AFCP is a Competitive Programming Contests Automation Package for text editor Atom.

Installs! Package version! GitHub stars GitHub forks GitHub issues GitHub license Made with Love in India

YouTube video explaining how to use the package

YouTube Icon

Sites Supported Yes
Codechef
Codeforces
Atcoder

Note:- The package has been fairly tested for MacOS and Linux. However Windows users might face some issues. Please open one in the repo if you do..

The notification feature is not currently supported for windows. I don't have access to a machine right now to test the code for windows, but you can expect an update for windows in a couple of days.

Never used atom for competing? Read this

Installation

Install package either by running apm install afcp from the terminal or by searching in the Install menu from Atom.

You will also need to install the following to use the package properly.

Linux -

  1. Install gcc

MacOS-

  1. Install gcc. This can be done by installing Xcode or Command Line Developer Tools.

Windows -

  1. Install MinGW.

Usage

Add the directory locations

Add directory locations for each site i.e where you want the folder for the problems to be created.

Image

An example location can look like this:- /Users/harshkhajuria/Desktop/TEST/ .

Important. Don't forget to add a /(for MacOS and Linux) or \ (for Windows) at the end of the location.

You can drag and drop the folder into terminal to get the paths

Drag and drop

coreutils is used to make sure that your code doesn't goes into an infinite loop. The time limit right now is 5 seconds which can be edited from the setting menu. (There is no need to install coreutils since version 0.8.18).

To fetch the problems and testcases

Image

Press alt+control+k to open the pane. Check the site radio button and put the contest code into the input field. Press Fetch Data .

A folder will be created for each of the problems with their test cases in the directory that you specify in the settings menu.

Examples for Code of Contests.

Site Link Code
Codechef https://www.codechef.com/COOK94A COOK94A
Codechef https://www.codechef.com/MAY18B MAY18B
Codeforces http://codeforces.com/contest/354 354
Codeforces http://codeforces.com/contest/490 490
Atcoder https://arc097.contest.atcoder.jp/ arc097
Atcoder https://agc024.contest.atcoder.jp/ agc024

In order to close the pane press again ctrl+alt+k

To compile and create output files

Press alt+control+c to compile. One output file will be generated for each and every file that starts with input in the folder where .cpp file is.

In order to create your own test cases create a input*.txt file in the same directory of the problem replacing * with a integer. Corresponding output file can be generated by pressing alt+control+c again.

Since version 0.8.18, I have also added notifications based on the diffs generated between output*.txt and myOutput*.txt.

Drag and drop

If no corresponding file is found either for output or myOutput a notification will be added and only time taken for the execution will be shown.

To see diffs

Press alt+control+p to bring out a right pane to see the diffs generated between corresponding files. To close the pane press alt+control+o.

To change gcc version and add additional flags while compiling

Update the Default GCC in the settings menu with the gcc version of your choice. For example if you use homebrew to install g++-4.9 then simply update the settings to use g++-4.9.

Update the GCC Options in the settings menu to add additional flags while compiling. For eg:- -std=c++14

To change the Time Limit

Update the Time Limit in the settings menu (in seconds).

Packages

Install the following packages for using atom to code in C/C++. To install them go to Install in Preferences and search them by typing their name.

  1. autocomplete-clang - Autocompletion of C/C++ code.
  2. gpp-compiler - Compile C/C++ code from within Atom.
  3. linter - Base Linter.
  4. linter-ui-default - Default UI for the linter package.
  5. linter-clang - Linter for C/C++ files.

afcp's People

Contributors

codacy-badger avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

afcp's Issues

missing option for custom template

This plugin is very helpful, but I how can I add a file to every problem folder while it is parsed? I use "ip.txt" as input file and I have configured with atom comfortably for running test case manually.

I want to create that file in the problem folder when I parse contest.

Thanks for this amazing plugin.

Uncaught TypeError: Cannot read property 'lastIndexOf' of undefined

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.53.0 x64
Electron: 6.1.12
OS: Microsoft Windows 10 Home Single Language
Thrown From: AFCP package 0.8.20

Stack Trace

Uncaught TypeError: Cannot read property 'lastIndexOf' of undefined

At C:\Users\praty\.atom\packages\AFCP\lib\cp-automation.js:248

TypeError: Cannot read property 'lastIndexOf' of undefined
    at Object.compile (/packages/AFCP/lib/cp-automation.js:248:35)
    at HTMLElement.cpAutomationCompile (/packages/AFCP/lib/cp-automation.js:121:43)
    at CommandRegistry.handleCommandEvent (~/AppData/Local/atom/app-1.53.0/resources/app/static/<embedded>:11:350265)
    at KeymapManager.dispatchCommandEvent (~/AppData/Local/atom/app-1.53.0/resources/app/static/<embedded>:11:1230852)
    at KeymapManager.handleKeyboardEvent (~/AppData/Local/atom/app-1.53.0/resources/app/static/<embedded>:11:1226986)
    at WindowEventHandler.handleDocumentKeyEvent (~/AppData/Local/atom/app-1.53.0/resources/app/static/<embedded>:11:284919)

Commands

     -2:02.5.0 core:move-up (input.hidden-input)
     -2:02.2.0 core:move-right (input.hidden-input)
 26x -2:01.5.0 core:move-left (input.hidden-input)
 58x -1:58.3.0 core:select-right (input.hidden-input)
     -1:55 core:select-left (input.hidden-input)
 12x -1:54.4.0 core:move-left (input.hidden-input)
     -1:53.8.0 core:move-down (input.hidden-input)
 24x -1:53.6.0 core:move-left (input.hidden-input)
     -1:51 core:move-down (input.hidden-input)
  2x -1:50.6.0 core:move-left (input.hidden-input)
     -1:47.5.0 cp-automation:compile (input.hidden-input)
     -1:30.1.0 grammar-selector:show (atom-text-editor.editor.is-focused)
     -0:59.5.0 cp-automation:compile (input.hidden-input)
     -0:42.2.0 core:move-down (input.hidden-input)
  2x -0:42 core:move-left (input.hidden-input)
     -0:39.3.0 cp-automation:compile (input.hidden-input)

Non-Core Packages

AFCP 0.8.20 
atom-material-ui 2.1.3 
gpp-compiler 3.0.7 
script 3.26.0 
slack-ui 0.8.0 

Notification of 'diff' rather than output files

Consider a problem with long output like 8-10 lines, in order to verify my output and correct output I have to drag both the files side by side and then compare it. It is time consuming and defies the purpose of this plugin.

Suggested Alternative: You may add notification of evaluation of test case, rather than output the file. It will solve the purpose as all I will need to know is that whether I passed the test case or not rather than the output.
You may use diff as a tool to enhance the scheme I proposed. Consider:

000  ---> 0 0 0
123  ---> 1 2 3
123  ---> 1 2 3

Though output seems similar but there will be wrong answer because of spaces between digits. Using diff will solve the problem, and also highlight the differences.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.