Giter VIP home page Giter VIP logo

cboj's Introduction

OnlineJudge

Installation

You have to install Node.js first.

For Mac OS:

brew install node

For Linux OS:

git clone https://github.com/joyent/node
./configure
make
make install

Then you have to Install the dependencies:

npm i

Database & Session Configuration

Installing Redis

git clone https://github.com/antirez/redis
cd redis
make
make install

The installation script will be released in the near future.

Judger Configuration

Place the script file in an folder, for example /home/OJ/cboj. You have to create a new folder under /home/OJ.

    cd /home/OJ
    mkdir judger
    cd judger
    apt-get install -y makejail
    touch makejail.conf

You'll just have to write example programs under /home/OJ/judger

1.cpp:

#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <deque>
#include <queue>
#include <string>
#include <ext/pb_ds/priority_queue.hpp>
#include <list>
#include <stack>

using namespace std;

int main() {
    return 0;
}

1.pas:

program ex;
uses math;
var a: extended;
begin
    readln(a);
    writeln(sqrt(a));
end.

1.c:

#include <stdio.h>
#include <stdlib.h>

int a, b;

int main() {
    scanf("%d%d", &a, &b);
    printf("%d\n", a + b);
}

1.py:

    import math
    a, b = raw_input().split()
    a, b = int(a), int(b)
    print a + b
    a = input()
    print math.sqrt(a)

Then you have to get prepared with the sandbox configuration, add this to the makejail.conf:

    testCommandsInsideJail = ['g++ -o 1 1.cpp', 'gcc -o 1 1.cpp', 'fpc 1.pas', 'python 1.py']

Then you can build the sandbox!

    makejail makejail.conf

cboj's People

Contributors

jcpwfloi avatar

Watchers

Fangyue Shi avatar

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.