/Buggy---Linux

Batch-testing for CodeForces : Linux version

Primary LanguageShell

Buggy : V.5.0 (Unstable)

Download the stable version from here

A sublime plug-in for CodeForces

This application is to assist a competitive-programmer in a CodeForces round. This application downloads all the sample test cases for a problem and runs a user's solution program on all these test cases so that no time is wasted on manual checking of the solution.
The plugin now also comes with a terminal tool which can be used to test a solution on multiple input files. This terminal tool may prove useful to problem setters.
NOTE : Please try the Plug-in once before using it in actual contest to avoid any last minute confusions.
Make Sure you have read Installation and Usage very very carefully.

Index

  1. Requisites
  2. Installation
  3. Usage
  4. Advanced Usage (from terminal)
  5. Technology Used
  6. Testing
  7. Un-installation
  8. FAQ

Requisites

  • Linux (Tested on Ubuntu-14.04)
  • Internet Connection (it should be working on terminal)
  • Sublime Text-3
    • To check Sublime is installed correctly
      1. Open a terminal window.
      2. Run "subl".
      3. If Sublime opens up, everything is perfect.
  • A default browser
  • Working g++
    • To check g++ is working
      1. Open a terminal window.
      2. Run "g++".
      3. If it identifies the command, everything is perfect.

Installation

  1. Download all the files from here.
  2. Run sudo ./install in the extracted directory.
  3. Open sublime. GoTo "Tools -> Build System" and select Buggy-C++ or Buggy-JAVA
  4. If you see Buggy menu in the menu-bar, installation is complete
  5. Change the template code by Buggy -> Template as it suits you. (Let the end-comment be there to show support :) ).

Usage

  • After the installation, you should see a new menu in the menu bar, Buggy.
  • Click on the Buggy menu and you'll be able to see all the options there.
    • If you are not able to see all the options, "Tools -> Build System" and select CF.
  • Make sure Sublime Side-Bar is visible (View -> Side Bar -> Show Side Bar).
  • To start parsing the test-cases, (Buggy -> Start).
  • For parsing the test-cases, provide the round-number you see in the url of the contest.
  • Compile the code before running it on test-cases (Ctrl+1 or Buggy -> Compile)
  • Copy the code before going to submit the code.
  • If you want you can change the key-bindings too.
  • If you are working behind proxy
    • Open Buggy -> Config
    • Enter your proxy information with format : proxyConfig: username:password@ip:port
  • To change the default directory for download
    • Open Buggy -> Config
    • Enter your default directory with format : path: ~/path/to/target/directory/




Advanced Usage (from terminal)

  • The c++ program is compiled with flag -D BUGGY. This enables users to use code-snippet like
    #ifdef BUGGY
    	// something
    #endif
  • In Terminal use BuggyBatchTest --help to get details of usage from terminal.
  • Terminal usage allows to run an executable on multiple input files and compare the output against multiple corresponding output files.
  • The input files should have format inPrefixiinSuffix, where i is 0, 1, 2, ...
  • Similarly the output files should have format outPrefixioutSuffix, where i is 0, 1, 2, ...
  • For example, in the case where :
    • All input files are of format : ini.txt
    • Input files are in the directory inputFiles
    • Name of the executable is aprog
    • All the output files are of format : outi.txt
    • Output files are in the same directory from where the command is being run (in this case assumed to be the same directory as the executable)
    • Language used is C++
    • And we just want to see the verdict with colors
    The command will be structured as : BuggyBatchTest --inPrefix in --inSuffix .txt --inPath inputFiles/ -f aprog --outPrefix out --outSuffix .txt -l cpp -c
  • For example , all input files are of format : ini.txt and these files are in directory : inputFiles, and name of the executable is aprog, then the command will be structured as : BuggyBatchtest --inPrefix in --inSuffix .txt --inPath inputFiles -f aprog -l cpp

Technology Used

  • The application is made using Python-2.7.9 and Shell scripting
  • BeautifulSoup module is used in Python
  • Executables are made using cx_freeze

Testing

The program has been tested on Ubuntu-14.04, 64-bit

Un-installation

  1. Download all the files from here.
  2. Run sudo ./unInstall in the extracted directory.

Refer to this post for more detailed explanation of the working of the application.

For Hugs and Bugs drop a mail at asimkprasad@gmail.com