GithubHelp home page GithubHelp logo

linyxus / cfvc Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 44 KB

cfvc: CodeForces contests Virtual Clone with single line of command (on Virtual Judge)

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.56% Haskell 97.30% Nix 2.14%

cfvc's Introduction

cfvc

cfvc: CodeForces contests Virtual Clone with single line of command (on Virtual Judge)

Installation

Install with Homebrew (macOS, Linux)

Homebrew is one of the most famous package managers on macOS. It is also available on Linux, detailed information of which can be found at Homebrew on Linux.

macOS

brew install linyxus/tools/cfvc

Linux

brew install linyxus/tools/cfvc-linux

If you do not want to bother yourself with the installation of Homebrew on Linux, prebuilt binaries for Linux can also be found on the release page.

Manual installation

Prerequisites:

  • make
  • nix
  • cabal

First, build the project

make build

A symlink named result will be generated if the project get built successfully. Move cfvc binary in {project_root}/result/bin/cfvc into your path.

Usage

Configuration

At the first run of cfvc, a template configuration will be written to {home_dir}/.cfvc/config.yaml. You can find the exact path of the configuration in the log.

The template configuration file looks like this:

# Title of the contest on Vjudge
title: "A Good Contest on CodeForces"
# Id of the CodeForces contest to be cloned, optional
contest: 1328
# Additional problems, optional
problems:
  - "1212a"
# Begin time of the contest. It can either be absolute or relative.
# Absolute: 13:30:00 means the nearest 13:00:00 in the future
# Relative: +1:00:00 means 1 hour later
begin-time: 13:30:00
# Length of the contest
length: 24:0:0
# Description of the contest
desc: ""
# Annoucement of the contest
announcement: ""
# 0: Public
# 1: Protected
# 2: Private
access-level: 2
# Password of the contest if access level is either protected or private
password: "password"
# Show peers
show-peers: true
# VJudge username
auth-username:
# VJudge password
auth-password:

The configuration is self-documented and straightforward. A similar example can be found in the project's example dir.

Note that the problems field provides extra problems. In other words, problems that will be added into the VJudge contest consists of all problems of the specified CodeForces contest and those provided in problems field.

Command line

Command line arguments are almost the same with configuration. The existence of configuration can save you from typing the same information again and again. You can check the help of cfvc command line options by executing cfvc --help:

cfvc - CodeForces Virtual Cloner

Usage: cfvc [CONTEST_ID] [-t|--title TITLE] [-b|--begin-time TIME]
            [-l|--length TIME] [-d|--description TEXT] [-a|--announcement TEXT]
            [-u|--username USERNAME] [-p|--password PASSWORD]
  Clone CodeForces contest onto Virtual Judge

Available options:
  -t,--title TITLE         Title of VJudge contest
  -b,--begin-time TIME     Begin time: 18:00:00, +1:30:00 ...
  -l,--length TIME         Contest length: 3:00:00
  -d,--description TEXT    Contest description
  -a,--announcement TEXT   Contest announcement
  -u,--username USERNAME   Virtual Judge username
  -p,--password PASSWORD   Virtual Judge password
  -h,--help                Show this help text

The options provided in CLI will override the corresponding field in configuration. So it is handy to fill all common information in the configuration and override them with CLI options if necessary.

Example: A simple usage example.

# The following command will clone Clone Codeforces Round #631 (Div. 1), https://codeforces.com/contest/1329. The option `-t` provides a proper title.
cfvc 1329 -t 'Codeforces Div. 1 #631'

Once the contest is successfully created, the URL will be displayed.

...
[Info] Creating contest ...
[Info] Done! Contest URL: https://vjudge.net/contest/366773

You can also set begin time and length of the contest.

# The created contest will start 1h later, and last 10 hours.
cfvc 1329 -t 'Another Contest!' -b +1:0:0 -l 10:0:0

You can specify begin time in two formats, either absolute or relative. The absolute way, will start the contest at the nearest time provided. To be specific, consider the following command:

cfvc 1329 -t 'name' -b 20:00:00

If you run the command at 19:59:00, the contest will begin 1 hour later. While if the command is executed at 20:00:01, the contest will begin at 20:00:00 tomorrow.

The relative way, is much more straightforward. You specify the begin time of the contest to be hh:mm:ss later.

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.