├── README.md ├── executor ├── .gitignore ├── requirements.txt ├── Dockerfile ├── exec_server.py └── exec_utils.py ├── OJ-server ├── .gitignore ├── models │ └── problemModel.js ├── package.json ├── modules │ └── redisClient.js ├── server.js ├── routes │ └── rest.js ├── services │ ├── editorSocketService.js │ └── problemService.js └── package-lock.json ├── OnlineJudge ├── src │ ├── assets │ │ ├── .gitkeep │ │ └── loading.svg │ ├── app │ │ ├── app.component.css │ │ ├── components │ │ │ ├── navbar │ │ │ │ ├── navbar.component.css │ │ │ │ ├── navbar.component.spec.ts │ │ │ │ ├── navbar.component.ts │ │ │ │ └── navbar.component.html │ │ │ ├── new-problem │ │ │ │ ├── new-problem.component.css │ │ │ │ ├── new-problem.component.spec.ts │ │ │ │ ├── new-problem.component.ts │ │ │ │ └── new-problem.component.html │ │ │ ├── user-number │ │ │ │ ├── user-number.component.css │ │ │ │ ├── user-number.component.html │ │ │ │ ├── user-number.component.ts │ │ │ │ └── user-number.component.spec.ts │ │ │ ├── edit-problem │ │ │ │ ├── edit-problem.component.css │ │ │ │ ├── edit-problem.component.spec.ts │ │ │ │ ├── edit-problem.component.ts │ │ │ │ └── edit-problem.component.html │ │ │ ├── problem-detail │ │ │ │ ├── problem-detail.component.css │ │ │ │ ├── problem-detail.component.html │ │ │ │ ├── problem-detail.component.spec.ts │ │ │ │ └── problem-detail.component.ts │ │ │ ├── loading │ │ │ │ ├── loading.component.html │ │ │ │ ├── loading.component.css │ │ │ │ ├── loading.component.ts │ │ │ │ └── loading.component.spec.ts │ │ │ ├── profile │ │ │ │ ├── profile.component.css │ │ │ │ ├── profile.component.html │ │ │ │ ├── profile.component.ts │ │ │ │ └── profile.component.spec.ts │ │ │ ├── problem-list │ │ │ │ ├── problem-list.component.css │ │ │ │ ├── problem-list.component.html │ │ │ │ ├── problem-list.component.spec.ts │ │ │ │ └── problem-list.component.ts │ │ │ └── editor │ │ │ │ ├── editor.component.css │ │ │ │ ├── editor.component.spec.ts │ │ │ │ ├── editor.component.html │ │ │ │ └── editor.component.ts │ │ ├── app.component.html │ │ ├── models │ │ │ └── problem.model.ts │ │ ├── pipes │ │ │ ├── search.pipe.spec.ts │ │ │ └── search.pipe.ts │ │ ├── app.component.ts │ │ ├── services │ │ │ ├── auth.service.spec.ts │ │ │ ├── data.service.spec.ts │ │ │ ├── search-input.service.spec.ts │ │ │ ├── collaboration.service.spec.ts │ │ │ ├── search-input.service.ts │ │ │ ├── collaboration.service.ts │ │ │ ├── data.service.ts │ │ │ └── auth.service.ts │ │ ├── mock-problems.ts │ │ ├── app.component.spec.ts │ │ ├── app.routes.ts │ │ └── app.module.ts │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── styles.css │ ├── favicon.ico │ ├── typings.d.ts │ ├── tsconfig.app.json │ ├── index.html │ ├── tsconfig.spec.json │ ├── main.ts │ ├── test.ts │ └── polyfills.ts ├── e2e │ ├── app.po.ts │ ├── tsconfig.e2e.json │ └── app.e2e-spec.ts ├── .editorconfig ├── tsconfig.json ├── .gitignore ├── protractor.conf.js ├── karma.conf.js ├── README.md ├── package.json ├── .angular-cli.json └── tslint.json ├── public ├── favicon.ico ├── glyphicons-halflings-regular.e18bbf611f2a2e43afc0.ttf ├── glyphicons-halflings-regular.f4769f9bdb7466be6508.eot ├── glyphicons-halflings-regular.448c34a56d699c29117a.woff2 ├── glyphicons-halflings-regular.fa2772327f55d8198301.woff ├── index.html ├── assets │ └── loading.svg ├── inline.bundle.js.map ├── inline.bundle.js └── main.bundle.js.map ├── oj-executor └── launcher.sh /README.md: -------------------------------------------------------------------------------- 1 | # Online_Judge -------------------------------------------------------------------------------- /executor/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc -------------------------------------------------------------------------------- /OJ-server/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules -------------------------------------------------------------------------------- /OnlineJudge/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /executor/requirements.txt: -------------------------------------------------------------------------------- 1 | Flask 2 | docker -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/navbar/navbar.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/new-problem/new-problem.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/user-number/user-number.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/edit-problem/edit-problem.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/problem-detail/problem-detail.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichardLiuLiu/Online_Judge/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /OnlineJudge/src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/user-number/user-number.component.html: -------------------------------------------------------------------------------- 1 |

2 | user-number works! 3 |

4 | -------------------------------------------------------------------------------- /OnlineJudge/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /OnlineJudge/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /OnlineJudge/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichardLiuLiu/Online_Judge/HEAD/OnlineJudge/src/favicon.ico -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/loading/loading.component.html: -------------------------------------------------------------------------------- 1 |
2 | loading 3 |
-------------------------------------------------------------------------------- /OnlineJudge/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/models/problem.model.ts: -------------------------------------------------------------------------------- 1 | export class Problem { 2 | id: number; 3 | name: string; 4 | desc: string; 5 | difficulty: string; 6 | } -------------------------------------------------------------------------------- /public/glyphicons-halflings-regular.e18bbf611f2a2e43afc0.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichardLiuLiu/Online_Judge/HEAD/public/glyphicons-halflings-regular.e18bbf611f2a2e43afc0.ttf -------------------------------------------------------------------------------- /public/glyphicons-halflings-regular.f4769f9bdb7466be6508.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichardLiuLiu/Online_Judge/HEAD/public/glyphicons-halflings-regular.f4769f9bdb7466be6508.eot -------------------------------------------------------------------------------- /public/glyphicons-halflings-regular.448c34a56d699c29117a.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichardLiuLiu/Online_Judge/HEAD/public/glyphicons-halflings-regular.448c34a56d699c29117a.woff2 -------------------------------------------------------------------------------- /public/glyphicons-halflings-regular.fa2772327f55d8198301.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RichardLiuLiu/Online_Judge/HEAD/public/glyphicons-halflings-regular.fa2772327f55d8198301.woff -------------------------------------------------------------------------------- /executor/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | MAINTAINER Richard 3 | RUN apt-get update 4 | RUN apt-get install -y openjdk-8-jdk 5 | RUN apt-get install -y python3 6 | RUN apt-get install -y g++ -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/profile/profile.component.css: -------------------------------------------------------------------------------- 1 | .profile-area img { 2 | max-width: 150px; 3 | margin-bottom: 20px; 4 | } 5 | 6 | .panel-body h3 { 7 | margin-top: 0; 8 | } -------------------------------------------------------------------------------- /OnlineJudge/src/app/pipes/search.pipe.spec.ts: -------------------------------------------------------------------------------- 1 | import { SearchPipe } from './search.pipe'; 2 | 3 | describe('SearchPipe', () => { 4 | it('create an instance', () => { 5 | const pipe = new SearchPipe(); 6 | expect(pipe).toBeTruthy(); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /oj-executor: -------------------------------------------------------------------------------- 1 | upstream executor { 2 | server 127.0.0.1:5000; 3 | server 127.0.0.1:5001; 4 | server 127.0.0.1:5002; 5 | } 6 | 7 | server { 8 | listen 80; 9 | server_name executor; 10 | location / { 11 | proxy_pass http://executor; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /OnlineJudge/e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | 9 | export class AppComponent { 10 | title = 'Online Judge'; 11 | } 12 | -------------------------------------------------------------------------------- /OnlineJudge/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "baseUrl": "./", 6 | "module": "es2015", 7 | "types": [] 8 | }, 9 | "exclude": [ 10 | "test.ts", 11 | "**/*.spec.ts" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/loading/loading.component.css: -------------------------------------------------------------------------------- 1 | .loading { 2 | position: absolute; 3 | display: flex; 4 | justify-content: center; 5 | height: 100vh; 6 | width: 100vw; 7 | top: 0; 8 | bottom: 0; 9 | left: 0; 10 | right: 0; 11 | background-color: #fff; 12 | } -------------------------------------------------------------------------------- /OJ-server/models/problemModel.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const problemSchema = mongoose.Schema({ 3 | id: Number, 4 | name: String, 5 | desc: String, 6 | difficulty: String 7 | }); 8 | 9 | const ProblemModel = mongoose.model('ProblemModel', problemSchema); 10 | module.exports = ProblemModel; -------------------------------------------------------------------------------- /OnlineJudge/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /OnlineJudge/e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "jasminewd2", 11 | "node" 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /OnlineJudge/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OnlineJudge 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /OnlineJudge/e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('online-judge App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/loading/loading.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-loading', 5 | templateUrl: './loading.component.html', 6 | styleUrls: ['./loading.component.css'] 7 | }) 8 | export class LoadingComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /OnlineJudge/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "types": [ 8 | "jasmine", 9 | "node" 10 | ] 11 | }, 12 | "files": [ 13 | "test.ts" 14 | ], 15 | "include": [ 16 | "**/*.spec.ts", 17 | "**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/user-number/user-number.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-user-number', 5 | templateUrl: './user-number.component.html', 6 | styleUrls: ['./user-number.component.css'] 7 | }) 8 | export class UserNumberComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /OnlineJudge/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /OnlineJudge/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/services/auth.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, inject } from '@angular/core/testing'; 2 | 3 | import { AuthService } from './auth.service'; 4 | 5 | describe('AuthService', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [AuthService] 9 | }); 10 | }); 11 | 12 | it('should be created', inject([AuthService], (service: AuthService) => { 13 | expect(service).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/services/data.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, inject } from '@angular/core/testing'; 2 | 3 | import { DataService } from './data.service'; 4 | 5 | describe('DataService', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [DataService] 9 | }); 10 | }); 11 | 12 | it('should be created', inject([DataService], (service: DataService) => { 13 | expect(service).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /OnlineJudge/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "outDir": "./dist/out-tsc", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "target": "es5", 11 | "typeRoots": [ 12 | "node_modules/@types" 13 | ], 14 | "lib": [ 15 | "es2017", 16 | "dom" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/services/search-input.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, inject } from '@angular/core/testing'; 2 | 3 | import { SearchInputService } from './search-input.service'; 4 | 5 | describe('SearchInputService', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [SearchInputService] 9 | }); 10 | }); 11 | 12 | it('should be created', inject([SearchInputService], (service: SearchInputService) => { 13 | expect(service).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/profile/profile.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Profile

4 |
5 |
6 | avatar 7 |
8 | 9 |

{{ profile?.nickname }}

10 |
11 |
{{ profile | json }}
12 |
13 |
-------------------------------------------------------------------------------- /OJ-server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "oj-server", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "nodemon server.js" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "body-parser": "^1.18.2", 14 | "express": "^4.16.2", 15 | "mongoose": "^5.0.3", 16 | "node-rest-client": "^3.1.0", 17 | "redis": "^2.8.0", 18 | "socket.io": "^2.0.4" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/services/collaboration.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, inject } from '@angular/core/testing'; 2 | 3 | import { CollaborationService } from './collaboration.service'; 4 | 5 | describe('CollaborationService', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [CollaborationService] 9 | }); 10 | }); 11 | 12 | it('should be created', inject([CollaborationService], (service: CollaborationService) => { 13 | expect(service).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/problem-list/problem-list.component.css: -------------------------------------------------------------------------------- 1 | .difficulty { 2 | min-width: 65px; 3 | margin-right: 10px; 4 | } 5 | 6 | .label.difficulty { 7 | padding-top: 0.2em; 8 | color: #ffffff; 9 | font-size: 13px; 10 | } 11 | 12 | .title { 13 | font-size: 1.2em; 14 | } 15 | 16 | .diff-easy { 17 | background-color: #00bb48; 18 | } 19 | 20 | .diff-medium { 21 | background-color: #ffbb00; 22 | } 23 | 24 | .diff-hard { 25 | background-color: #dd0d1e; 26 | } 27 | 28 | .diff-ultimate { 29 | background-color: #000000; 30 | } -------------------------------------------------------------------------------- /OnlineJudge/src/app/services/search-input.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { BehaviorSubject } from 'rxjs/BehaviorSubject'; 3 | import { Observable } from 'rxjs/Rx'; 4 | 5 | @Injectable() 6 | export class SearchInputService { 7 | 8 | private _inputSubject = new BehaviorSubject(''); 9 | 10 | constructor() { } 11 | 12 | changeInput(term) { 13 | this._inputSubject.next(term); 14 | } 15 | 16 | getInput(): Observable { 17 | return this._inputSubject.asObservable(); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/pipes/search.pipe.ts: -------------------------------------------------------------------------------- 1 | import { Pipe, PipeTransform } from '@angular/core'; 2 | 3 | import { Problem } from '../models/problem.model'; 4 | 5 | @Pipe({ 6 | name: 'search' 7 | }) 8 | export class SearchPipe implements PipeTransform { 9 | 10 | transform(problems: Problem[], term: string): Problem[] { 11 | console.log(problems); 12 | return problems.filter( 13 | problem => (problem.name.toLowerCase().includes(term)) 14 | || problem.id === +term 15 | || problem.difficulty === term); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/editor/editor.component.css: -------------------------------------------------------------------------------- 1 | @media screen { 2 | #editor { 3 | height: 600px; 4 | } 5 | .lang-select { 6 | width: 100px; 7 | margin-right: 10px; 8 | } 9 | header .btn { 10 | margin: 0 5px; 11 | } 12 | footer .btn { 13 | margin: 0 5px; 14 | } 15 | .editor-footer, .editor-header { 16 | margin: 10px 0; 17 | } 18 | .cursor { 19 | /*position:absolute;*/ 20 | background: rgba(0, 250, 0, 0.5); 21 | z-index: 40; 22 | width: 2px !important; 23 | } 24 | } -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/problem-list/problem-list.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/mock-problems.ts: -------------------------------------------------------------------------------- 1 | import { Problem } from './models/problem.model'; 2 | 3 | export const PROBLEMS: Problem[] = [ 4 | { 5 | id: 1, 6 | name: "Two Sum", 7 | desc: "Two Sum Description.", 8 | difficulty: "easy" 9 | }, 10 | { 11 | id: 2, 12 | name: "Three Sum", 13 | desc: "Three Sum Description.", 14 | difficulty: "medium" 15 | }, 16 | { 17 | id: 3, 18 | name: "Four Sum", 19 | desc: "Four Sum Description.", 20 | difficulty: "hard" 21 | }, 22 | { 23 | id: 4, 24 | name: "Five Sum", 25 | desc: "Five Sum Description.", 26 | difficulty: "ultimate" 27 | } 28 | ]; 29 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/problem-detail/problem-detail.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 |

6 | {{problem.id}}. {{problem.name}} 7 |

8 |

9 | {{problem.desc}} 10 |

11 |
12 | 13 | 16 | 19 | 20 |
21 | 22 | 25 | 26 |
27 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/profile/profile.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | import { AuthService } from '../../services/auth.service'; 4 | 5 | @Component({ 6 | selector: 'app-profile', 7 | templateUrl: './profile.component.html', 8 | styleUrls: ['./profile.component.css'] 9 | }) 10 | export class ProfileComponent implements OnInit { 11 | 12 | profile: any; 13 | 14 | constructor(public auth: AuthService) { } 15 | 16 | ngOnInit() { 17 | if (this.auth.userProfile) { 18 | this.profile = this.auth.userProfile; 19 | } else { 20 | this.auth.getProfile((err, profile) => { 21 | this.profile = profile; 22 | }); 23 | } 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | OnlineJudge 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /OnlineJudge/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /dist-server 6 | /tmp 7 | /out-tsc 8 | 9 | # dependencies 10 | /node_modules 11 | 12 | # IDEs and editors 13 | /.idea 14 | .project 15 | .classpath 16 | .c9/ 17 | *.launch 18 | .settings/ 19 | *.sublime-workspace 20 | 21 | # IDE - VSCode 22 | .vscode/* 23 | !.vscode/settings.json 24 | !.vscode/tasks.json 25 | !.vscode/launch.json 26 | !.vscode/extensions.json 27 | 28 | # misc 29 | /.sass-cache 30 | /connect.lock 31 | /coverage 32 | /libpeerconnection.log 33 | npm-debug.log 34 | testem.log 35 | /typings 36 | 37 | # e2e 38 | /e2e/*.js 39 | /e2e/*.map 40 | 41 | # System Files 42 | .DS_Store 43 | Thumbs.db 44 | -------------------------------------------------------------------------------- /OnlineJudge/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /executor/exec_server.py: -------------------------------------------------------------------------------- 1 | import json 2 | from flask import Flask, jsonify, request 3 | app = Flask(__name__) 4 | 5 | import exec_utils as eu 6 | 7 | @app.route('/build_and_run', methods=['POST']) 8 | def build_and_run(): 9 | data = request.get_json() 10 | if 'code' not in data or 'lang' not in data: 11 | return 'You should provide "code" and "lang"' 12 | 13 | code = data['code'] 14 | lang = data['lang'] 15 | 16 | print("API got called with code: %s in %s" % (code, lang)) 17 | 18 | result = eu.build_and_run(code, lang) 19 | 20 | return jsonify(result) 21 | 22 | if __name__ == '__main__': 23 | eu.load_image() 24 | # app.run(debug=True) 25 | import sys 26 | port = int(sys.argv[1]) 27 | app.run(port=port) 28 | -------------------------------------------------------------------------------- /launcher.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | fuser -k 80/tcp 4 | fuser -k 3000/tcp 5 | fuser -k 5000/tcp 6 | fuser -k 5001/tcp 7 | fuser -k 5002/tcp 8 | 9 | sudo service redis_6379 start 10 | 11 | sudo cp oj-executor /etc/nginx/sites-enabled 12 | sudo service nginx start 13 | 14 | cd ./OJ-server 15 | nodemon server.js & 16 | 17 | cd ../executor 18 | pip3 install -r requirements.txt 19 | python3 exec_server.py 5000 & 20 | python3 exec_server.py 5001 & 21 | python3 exec_server.py 5002 & 22 | 23 | echo "===========================================" 24 | read -p "Press [ENTER] to terminate processes." PRESSKEY 25 | 26 | fuser -k 80/tcp 27 | fuser -k 3000/tcp 28 | fuser -k 5000/tcp 29 | fuser -k 5001/tcp 30 | fuser -k 5002/tcp 31 | 32 | sudo service redis_6379 stop 33 | sudo service nginx stop 34 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/editor/editor.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { EditorComponent } from './editor.component'; 4 | 5 | describe('EditorComponent', () => { 6 | let component: EditorComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ EditorComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(EditorComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/navbar/navbar.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { NavbarComponent } from './navbar.component'; 4 | 5 | describe('NavbarComponent', () => { 6 | let component: NavbarComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ NavbarComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(NavbarComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/loading/loading.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LoadingComponent } from './loading.component'; 4 | 5 | describe('LoadingComponent', () => { 6 | let component: LoadingComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ LoadingComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(LoadingComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/profile/profile.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ProfileComponent } from './profile.component'; 4 | 5 | describe('ProfileComponent', () => { 6 | let component: ProfileComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ ProfileComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ProfileComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/new-problem/new-problem.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { NewProblemComponent } from './new-problem.component'; 4 | 5 | describe('NewProblemComponent', () => { 6 | let component: NewProblemComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ NewProblemComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(NewProblemComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/user-number/user-number.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { UserNumberComponent } from './user-number.component'; 4 | 5 | describe('UserNumberComponent', () => { 6 | let component: UserNumberComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ UserNumberComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(UserNumberComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/edit-problem/edit-problem.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { EditProblemComponent } from './edit-problem.component'; 4 | 5 | describe('EditProblemComponent', () => { 6 | let component: EditProblemComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ EditProblemComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(EditProblemComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/problem-list/problem-list.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ProblemListComponent } from './problem-list.component'; 4 | 5 | describe('ProblemListComponent', () => { 6 | let component: ProblemListComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ ProblemListComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ProblemListComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/problem-detail/problem-detail.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ProblemDetailComponent } from './problem-detail.component'; 4 | 5 | describe('ProblemDetailComponent', () => { 6 | let component: ProblemDetailComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ ProblemDetailComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ProblemDetailComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /OnlineJudge/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './e2e/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: 'e2e/tsconfig.e2e.json' 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /OJ-server/modules/redisClient.js: -------------------------------------------------------------------------------- 1 | var redis = require('redis'); 2 | var client = redis.createClient(); 3 | 4 | function set(key, value, callback) { 5 | client.set(key, value, function(err, res) { 6 | if (err) { 7 | console.log(err); 8 | return; 9 | } 10 | callback(res); 11 | }); 12 | } 13 | 14 | function get(key, callback) { 15 | client.get(key, function(err, res) { 16 | if (err) { 17 | console.log(err); 18 | return; 19 | } 20 | callback(res); 21 | }); 22 | } 23 | 24 | function expire(key, timeInSeconds) { 25 | client.expire(key, timeInSeconds); 26 | } 27 | 28 | function quit() { 29 | client.quit(); 30 | } 31 | 32 | function print() { 33 | redis.print(); 34 | } 35 | 36 | module.exports = { 37 | get: get, 38 | set: set, 39 | expire: expire, 40 | quit: quit, 41 | redisPrint: print 42 | } -------------------------------------------------------------------------------- /OJ-server/server.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const app = express(); 3 | const path = require('path'); 4 | 5 | const http = require('http'); 6 | var socketIO = require('socket.io'); 7 | var io = socketIO(); 8 | var editorSocketService = require('./services/editorSocketService')(io); 9 | 10 | const restRouter = require('./routes/rest'); 11 | 12 | const mongoose = require('mongoose'); 13 | mongoose.connect('mongodb://richard:richard@ds125068.mlab.com:25068/oj-problems'); 14 | 15 | app.use('/api/v1', restRouter); 16 | app.use(express.static(path.join(__dirname, '../public'))); 17 | 18 | const server = http.createServer(app); 19 | io.attach(server); 20 | server.listen(3000); 21 | server.on('listening', onListening); 22 | 23 | function onListening() { 24 | console.log('App listening on port 3000!') 25 | } 26 | 27 | app.use((req, res) => { 28 | res.sendFile('index.html', { root: path.join(__dirname, '../public') }); 29 | }); 30 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/problem-detail/problem-detail.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ActivatedRoute, Params } from '@angular/router'; 3 | 4 | import { Problem } from '../../models/problem.model'; 5 | import { DataService } from '../../services/data.service'; 6 | 7 | @Component({ 8 | selector: 'app-problem-detail', 9 | templateUrl: './problem-detail.component.html', 10 | styleUrls: ['./problem-detail.component.css'] 11 | }) 12 | export class ProblemDetailComponent implements OnInit { 13 | 14 | problem: Problem; 15 | 16 | constructor(private dataService: DataService, private route: ActivatedRoute) { } 17 | 18 | ngOnInit() { 19 | this.route.params.subscribe(params => { 20 | // this.problem = this.dataService.getProblem(+params['id']); 21 | this.dataService.getProblem(+params['id']) 22 | .then(problem => this.problem = problem); 23 | }); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/new-problem/new-problem.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | import { Problem } from '../../models/problem.model'; 4 | import { DataService } from '../../services/data.service'; 5 | 6 | const DEFAULT_PROBLEM: Problem = Object.freeze({ 7 | id: 0, 8 | name: '', 9 | desc: '', 10 | difficulty: 'easy' 11 | }) 12 | 13 | @Component({ 14 | selector: 'app-new-problem', 15 | templateUrl: './new-problem.component.html', 16 | styleUrls: ['./new-problem.component.css'] 17 | }) 18 | export class NewProblemComponent implements OnInit { 19 | 20 | newProblem: Problem = Object.assign({}, DEFAULT_PROBLEM); 21 | difficulties: string[] = ['easy', 'medium', 'hard', 'ultimate']; 22 | 23 | constructor(private dataService: DataService) { } 24 | 25 | ngOnInit() { 26 | } 27 | 28 | addProblem() { 29 | this.dataService.addProblem(this.newProblem); 30 | this.newProblem = Object.assign({}, DEFAULT_PROBLEM); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /OnlineJudge/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular/cli'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular/cli/plugins/karma') 14 | ], 15 | client:{ 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | reports: [ 'html', 'lcovonly' ], 20 | fixWebpackSourcePaths: true 21 | }, 22 | angularCli: { 23 | environment: 'dev' 24 | }, 25 | reporters: ['progress', 'kjhtml'], 26 | port: 9876, 27 | colors: true, 28 | logLevel: config.LOG_INFO, 29 | autoWatch: true, 30 | browsers: ['Chrome'], 31 | singleRun: false 32 | }); 33 | }; 34 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | describe('AppComponent', () => { 4 | beforeEach(async(() => { 5 | TestBed.configureTestingModule({ 6 | declarations: [ 7 | AppComponent 8 | ], 9 | }).compileComponents(); 10 | })); 11 | it('should create the app', async(() => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.debugElement.componentInstance; 14 | expect(app).toBeTruthy(); 15 | })); 16 | it(`should have as title 'app'`, async(() => { 17 | const fixture = TestBed.createComponent(AppComponent); 18 | const app = fixture.debugElement.componentInstance; 19 | expect(app.title).toEqual('app'); 20 | })); 21 | it('should render title in a h1 tag', async(() => { 22 | const fixture = TestBed.createComponent(AppComponent); 23 | fixture.detectChanges(); 24 | const compiled = fixture.debugElement.nativeElement; 25 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!'); 26 | })); 27 | }); 28 | -------------------------------------------------------------------------------- /OnlineJudge/README.md: -------------------------------------------------------------------------------- 1 | # OnlineJudge 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.6.5. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/edit-problem/edit-problem.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ActivatedRoute, Params } from '@angular/router'; 3 | 4 | import { Problem } from '../../models/problem.model'; 5 | import { DataService } from '../../services/data.service'; 6 | 7 | const DEFAULT_PROBLEM: Problem = Object.freeze({ 8 | id: 0, 9 | name: '', 10 | desc: '', 11 | difficulty: 'easy' 12 | }) 13 | 14 | @Component({ 15 | selector: 'app-edit-problem', 16 | templateUrl: './edit-problem.component.html', 17 | styleUrls: ['./edit-problem.component.css'] 18 | }) 19 | export class EditProblemComponent implements OnInit { 20 | 21 | newProblem: Problem = Object.assign({}, DEFAULT_PROBLEM); 22 | 23 | difficulties: string[] = ['easy', 'medium', 'hard', 'ultimate']; 24 | 25 | constructor(private dataService: DataService, private route: ActivatedRoute) { } 26 | 27 | ngOnInit() { 28 | this.route.params.subscribe(params => { 29 | this.dataService.getProblem(+params['id']) 30 | .then(problem => this.newProblem = problem); 31 | }); 32 | } 33 | 34 | editProblem() { 35 | this.dataService.editProblem(this.newProblem); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/services/collaboration.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Observable } from 'rxjs/Rx'; 3 | import { Subject } from 'rxjs/Subject'; 4 | 5 | declare var io: any; 6 | 7 | @Injectable() 8 | export class CollaborationService { 9 | 10 | collaborationSocket: any; 11 | private _userSource = new Subject(); 12 | 13 | constructor() { } 14 | 15 | init(editor: any, sessionId: string): Observable { 16 | this.collaborationSocket = io(window.location.origin, { query: 'sessionId=' + sessionId }); 17 | 18 | this.collaborationSocket.on("change", (delta: string) => { 19 | console.log('collaboration: editor changes by' + delta); 20 | delta = JSON.parse(delta); 21 | editor.lastAppliedChange = delta; 22 | editor.getSession().getDocument().applyDeltas([delta]); 23 | }); 24 | 25 | this.collaborationSocket.on("userChange", (data: string[]) => { 26 | console.log('collabration: user changes ' + data); 27 | this._userSource.next(data.toString()); 28 | }); 29 | 30 | return this._userSource.asObservable(); 31 | } 32 | 33 | change(delta: string): void { 34 | this.collaborationSocket.emit("change", delta); 35 | } 36 | 37 | restoreBuffer(): void { 38 | this.collaborationSocket.emit("restoreBuffer"); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/problem-list/problem-list.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Subscription } from 'rxjs/Subscription'; 3 | 4 | import { Problem } from '../../models/problem.model'; 5 | import { DataService } from '../../services/data.service'; 6 | import { SearchInputService } from '../../services/search-input.service'; 7 | 8 | @Component({ 9 | selector: 'app-problem-list', 10 | templateUrl: './problem-list.component.html', 11 | styleUrls: ['./problem-list.component.css'] 12 | }) 13 | 14 | export class ProblemListComponent implements OnInit { 15 | 16 | problems: Problem[]; 17 | subscriptionProblems: Subscription; 18 | 19 | searchTerm: string = ''; 20 | subscriptionInput: Subscription; 21 | 22 | constructor(private dataService: DataService, 23 | private inputService: SearchInputService) { } 24 | 25 | ngOnInit() { 26 | this.getProblems(); 27 | this.getSearchTerm(); 28 | } 29 | 30 | ngOnDestory() { 31 | this.subscriptionProblems.unsubscribe(); 32 | } 33 | 34 | getProblems() { 35 | this.subscriptionProblems = this.dataService.getProblems() 36 | .subscribe(problems => this.problems = problems); 37 | } 38 | 39 | getSearchTerm(): void { 40 | this.subscriptionInput = this.inputService.getInput() 41 | .subscribe(inputTerm => this.searchTerm = inputTerm); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/edit-problem/edit-problem.component.html: -------------------------------------------------------------------------------- 1 |
2 |

Modify a Problem

3 |
4 |
5 | 6 |
7 | 8 |

{{newProblem.name}}

9 |
10 | 11 |
12 | 13 | 17 |
18 | 19 |
20 | 21 | 27 |
28 | 29 |
30 |
31 | 35 |
36 |
37 | 38 |
39 |
40 |
41 | 42 |
43 |
-------------------------------------------------------------------------------- /OnlineJudge/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes, RouterModule } from '@angular/router'; 2 | 3 | import { ProblemListComponent } from './components/problem-list/problem-list.component'; 4 | import { ProblemDetailComponent } from './components/problem-detail/problem-detail.component'; 5 | import { NewProblemComponent } from './components/new-problem/new-problem.component'; 6 | import { EditProblemComponent } from './components/edit-problem/edit-problem.component'; 7 | import { LoadingComponent } from './components/loading/loading.component'; 8 | import { ProfileComponent } from './components/profile/profile.component'; 9 | 10 | const routes: Routes = [ 11 | { 12 | path: '', 13 | redirectTo: 'problems', 14 | pathMatch: 'full' 15 | }, 16 | { 17 | path: 'loading', 18 | component: LoadingComponent 19 | }, 20 | { 21 | path: 'profile', 22 | component: ProfileComponent 23 | }, 24 | { 25 | path: 'problems', 26 | component: ProblemListComponent 27 | }, 28 | { 29 | path: 'problems/:id', 30 | component: ProblemDetailComponent 31 | }, 32 | { 33 | path: 'newProblem', 34 | component: NewProblemComponent 35 | }, 36 | { 37 | path: 'editProblem/:id', 38 | component: EditProblemComponent 39 | }, 40 | { 41 | path: '**', 42 | redirectTo: 'problems' 43 | } 44 | ] 45 | 46 | export const routing = RouterModule.forRoot(routes); -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/new-problem/new-problem.component.html: -------------------------------------------------------------------------------- 1 |
2 |

Add a Problem

3 |
4 |
5 | 6 |
7 | 8 | 11 |
12 | 13 |
14 | 15 | 19 |
20 | 21 |
22 | 23 | 29 |
30 | 31 |
32 |
33 | 37 |
38 |
39 | 40 |
41 |
42 |
43 | 44 |
45 |
-------------------------------------------------------------------------------- /OnlineJudge/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "online-judge", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "scripts": { 6 | "ng": "ng", 7 | "start": "ng serve", 8 | "build": "ng build --prod", 9 | "test": "ng test", 10 | "lint": "ng lint", 11 | "e2e": "ng e2e" 12 | }, 13 | "private": true, 14 | "dependencies": { 15 | "@angular/animations": "^5.2.0", 16 | "@angular/common": "^5.2.0", 17 | "@angular/compiler": "^5.2.0", 18 | "@angular/core": "^5.2.0", 19 | "@angular/forms": "^5.2.0", 20 | "@angular/http": "^5.2.0", 21 | "@angular/platform-browser": "^5.2.0", 22 | "@angular/platform-browser-dynamic": "^5.2.0", 23 | "@angular/router": "^5.2.0", 24 | "ace-builds": "^1.3.0", 25 | "auth0-js": "^9.3.3", 26 | "bootstrap": "^3.3.7", 27 | "core-js": "^2.4.1", 28 | "jquery": "^3.3.1", 29 | "rxjs": "^5.5.6", 30 | "socket.io": "^2.0.4", 31 | "ssri": "^5.3.0", 32 | "zone.js": "^0.8.19" 33 | }, 34 | "devDependencies": { 35 | "@angular/cli": "1.6.5", 36 | "@angular/compiler-cli": "^5.2.0", 37 | "@angular/language-service": "^5.2.0", 38 | "@types/jasmine": "~2.8.3", 39 | "@types/jasminewd2": "~2.0.2", 40 | "@types/node": "~6.0.60", 41 | "codelyzer": "^4.0.1", 42 | "jasmine-core": "~2.8.0", 43 | "jasmine-spec-reporter": "~4.2.1", 44 | "karma": "~2.0.0", 45 | "karma-chrome-launcher": "~2.2.0", 46 | "karma-cli": "~1.0.1", 47 | "karma-coverage-istanbul-reporter": "^1.2.1", 48 | "karma-jasmine": "~1.1.0", 49 | "karma-jasmine-html-reporter": "^0.2.2", 50 | "protractor": "~5.1.2", 51 | "ts-node": "~4.1.0", 52 | "tslint": "~5.9.1", 53 | "typescript": "~2.5.3" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { FormControl } from '@angular/forms'; 3 | import { Subscription } from 'rxjs/Subscription'; 4 | import { Router } from '@angular/router'; 5 | import 'rxjs/add/operator/debounceTime'; 6 | import { SearchInputService } from '../../services/search-input.service'; 7 | import { AuthService } from '../../services/auth.service'; 8 | 9 | @Component({ 10 | selector: 'app-navbar', 11 | templateUrl: './navbar.component.html', 12 | styleUrls: ['./navbar.component.css'] 13 | }) 14 | export class NavbarComponent implements OnInit { 15 | 16 | searchInput: string = ""; 17 | difficultySearch: string = ""; 18 | 19 | searchBox: FormControl = new FormControl(); 20 | subscription: Subscription; 21 | 22 | difficulties: string[] = ['easy', 'medium', 'hard', 'ultimate']; 23 | 24 | constructor(private inputService: SearchInputService, 25 | private router: Router, 26 | public auth: AuthService) { 27 | auth.handleAuthentication(); 28 | } 29 | 30 | ngOnInit() { 31 | 32 | console.log(this.auth.isAuthenticated()); 33 | 34 | this.subscription = this.searchBox 35 | .valueChanges 36 | .debounceTime(200) 37 | .subscribe(term => { 38 | this.inputService.changeInput(term); 39 | }); 40 | } 41 | 42 | ngOnDestroy() { 43 | this.subscription.unsubscribe(); 44 | } 45 | 46 | searchProblems(): void { 47 | this.router.navigate(['/problems']); 48 | } 49 | 50 | searchProblems_btn(): void { 51 | this.inputService.changeInput(this.searchInput); 52 | this.router.navigate(['/problems']); 53 | } 54 | 55 | difficultyFilter(): void { 56 | this.inputService.changeInput(this.difficultySearch); 57 | this.router.navigate(['/problems']); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { FormsModule } from '@angular/forms'; 4 | import { ReactiveFormsModule } from '@angular/forms'; 5 | import { HttpClientModule } from '@angular/common/http'; 6 | 7 | import { AppComponent } from './app.component'; 8 | import { ProblemListComponent } from './components/problem-list/problem-list.component'; 9 | import { DataService } from './services/data.service'; 10 | import { ProblemDetailComponent } from './components/problem-detail/problem-detail.component'; 11 | 12 | import { routing } from './app.routes'; 13 | import { NewProblemComponent } from './components/new-problem/new-problem.component'; 14 | import { NavbarComponent } from './components/navbar/navbar.component'; 15 | import { EditorComponent } from './components/editor/editor.component'; 16 | 17 | import { CollaborationService } from './services/collaboration.service'; 18 | import { UserNumberComponent } from './components/user-number/user-number.component'; 19 | import { SearchInputService } from './services/search-input.service'; 20 | import { SearchPipe } from './pipes/search.pipe'; 21 | import { EditProblemComponent } from './components/edit-problem/edit-problem.component'; 22 | import { AuthService } from './services/auth.service'; 23 | import { LoadingComponent } from './components/loading/loading.component'; 24 | import { ProfileComponent } from './components/profile/profile.component'; 25 | 26 | @NgModule({ 27 | declarations: [ 28 | AppComponent, 29 | ProblemListComponent, 30 | ProblemDetailComponent, 31 | NewProblemComponent, 32 | NavbarComponent, 33 | EditorComponent, 34 | UserNumberComponent, 35 | SearchPipe, 36 | EditProblemComponent, 37 | LoadingComponent, 38 | ProfileComponent 39 | ], 40 | imports: [ 41 | BrowserModule, 42 | routing, 43 | FormsModule, 44 | ReactiveFormsModule, 45 | HttpClientModule 46 | ], 47 | providers: [ 48 | DataService, 49 | CollaborationService, 50 | SearchInputService, 51 | AuthService 52 | ], 53 | bootstrap: [AppComponent] 54 | }) 55 | export class AppModule { } 56 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/editor/editor.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 9 | 10 | 11 | 14 | 15 | 16 | 36 |
37 |
38 |
39 |
40 |
41 |

User List:

42 |

{{users}}

43 |
44 |
45 |

Execution Result:

46 |

{{result}}

47 |
48 |
49 |
50 | 52 |
53 |
-------------------------------------------------------------------------------- /OnlineJudge/.angular-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "project": { 4 | "name": "online-judge" 5 | }, 6 | "apps": [ 7 | { 8 | "root": "src", 9 | "outDir": "../public", 10 | "assets": [ 11 | "assets", 12 | "favicon.ico" 13 | ], 14 | "index": "index.html", 15 | "main": "main.ts", 16 | "polyfills": "polyfills.ts", 17 | "test": "test.ts", 18 | "tsconfig": "tsconfig.app.json", 19 | "testTsconfig": "tsconfig.spec.json", 20 | "prefix": "app", 21 | "styles": [ 22 | "styles.css", 23 | "../node_modules/bootstrap/dist/css/bootstrap.min.css" 24 | ], 25 | "scripts": [ 26 | "../node_modules/jquery/dist/jquery.js", 27 | "../node_modules/bootstrap/dist/js/bootstrap.js", 28 | "../node_modules/ace-builds/src-min-noconflict/ace.js", 29 | "../node_modules/ace-builds/src-min-noconflict/theme-eclipse.js", 30 | "../node_modules/ace-builds/src-min-noconflict/mode-java.js", 31 | "../node_modules/ace-builds/src-min-noconflict/mode-python.js", 32 | "../node_modules/ace-builds/src-min-noconflict/mode-c_cpp.js", 33 | "../node_modules/socket.io-client/dist/socket.io.js", 34 | "../node_modules/auth0-js/build/auth0.js" 35 | ], 36 | "environmentSource": "environments/environment.ts", 37 | "environments": { 38 | "dev": "environments/environment.ts", 39 | "prod": "environments/environment.prod.ts" 40 | } 41 | } 42 | ], 43 | "e2e": { 44 | "protractor": { 45 | "config": "./protractor.conf.js" 46 | } 47 | }, 48 | "lint": [ 49 | { 50 | "project": "src/tsconfig.app.json", 51 | "exclude": "**/node_modules/**" 52 | }, 53 | { 54 | "project": "src/tsconfig.spec.json", 55 | "exclude": "**/node_modules/**" 56 | }, 57 | { 58 | "project": "e2e/tsconfig.e2e.json", 59 | "exclude": "**/node_modules/**" 60 | } 61 | ], 62 | "test": { 63 | "karma": { 64 | "config": "./karma.conf.js" 65 | } 66 | }, 67 | "defaults": { 68 | "styleExt": "css", 69 | "component": {} 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /public/assets/loading.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /OnlineJudge/src/assets/loading.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /OJ-server/routes/rest.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | 4 | const problemService = require('../services/problemService'); 5 | const bodyParser = require('body-parser'); 6 | const jsonParser = bodyParser.json(); 7 | 8 | const nodeRestClient = require('node-rest-client').Client; 9 | const restClient = new nodeRestClient(); 10 | // EXECUTOR_SERVER_URL = 'http://localhost:5000/build_and_run'; 11 | EXECUTOR_SERVER_URL = 'http://executor/build_and_run'; 12 | restClient.registerMethod('build_and_run', EXECUTOR_SERVER_URL, 'POST'); 13 | 14 | // get all problems 15 | router.get('/problems', (req, res) => { 16 | problemService.getProblems() 17 | .then(problems => res.json(problems)); 18 | }); 19 | 20 | // get one problem 21 | router.get('/problems/:id', (req, res) => { 22 | const id = req.params.id; 23 | problemService.getProblem(+id) 24 | .then(problem => res.json(problem)); 25 | }); 26 | 27 | // post a problem 28 | router.post('/problems', jsonParser, (req, res) => { 29 | problemService.addProblem(req.body) 30 | .then(problem => res.json(problem), 31 | error => res.status(400).send('Problem already exists.')); 32 | }); 33 | 34 | // modify a problem 35 | router.post('/editProblem/:id', jsonParser, (req, res) => { 36 | problemService.editProblem(req.body) 37 | .then(problem => res.json(problem), 38 | error => res.status(400).send('Problem doesn\'t exists.')); 39 | }); 40 | 41 | // build and run 42 | router.post('/build_and_run', jsonParser, (req, res) => { 43 | const userCode = req.body.user_code; 44 | const lang = req.body.lang; 45 | console.log('lang:', lang, 'code:', userCode); 46 | 47 | restClient.methods.build_and_run( 48 | { data: { code: userCode, lang: lang }, 49 | headers: {'Content-Type': 'application/json'}}, 50 | (data, response) => { 51 | const whole_res = `Build: ${data['build']}, Output: ${data['run']}`; 52 | const build = `${data['build']}`; 53 | const run = `${data['run']}`; 54 | build == 'OK' ? res.json(run) : res.json(build); 55 | // res.json(whole_res) 56 | } 57 | ) 58 | }); 59 | 60 | module.exports = router; 61 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/services/data.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; 3 | import { Observable } from 'rxjs/Rx'; 4 | import { BehaviorSubject } from 'rxjs/BehaviorSubject'; 5 | 6 | import { Problem } from '../models/problem.model'; 7 | 8 | @Injectable() 9 | export class DataService { 10 | 11 | private _problemSource = new BehaviorSubject([]); 12 | 13 | constructor(private httpClient: HttpClient) { } 14 | 15 | getProblems(): Observable { 16 | this.httpClient.get('api/v1/problems') 17 | .toPromise() 18 | .then((res: any) => { 19 | this._problemSource.next(res); 20 | }) 21 | .catch(this.handleError); 22 | 23 | return this._problemSource.asObservable(); 24 | 25 | // this.httpClient.get('api/v1/problems') 26 | // .subscribe( 27 | // res => this._problemSource.next(res), 28 | // this.handleError 29 | // ); 30 | 31 | // return this._problemSource.asObservable(); 32 | } 33 | 34 | getProblem(id: number): Promise { 35 | return this.httpClient.get(`api/v1/problems/${id}`) 36 | .toPromise() 37 | .then((res: any) => res) 38 | .catch(this.handleError); 39 | } 40 | 41 | addProblem(problem: Problem) { 42 | const options = { headers: new HttpHeaders({'Connect-Type': 'application/json'}) }; 43 | return this.httpClient.post('api/v1/problems', problem, options) 44 | .toPromise() 45 | .then((res: any) => { 46 | this.getProblems(); 47 | return res; 48 | }) 49 | .catch(this.handleError); 50 | } 51 | 52 | editProblem(problem: Problem) { 53 | const options = { headers: new HttpHeaders({'Connect-Type': 'application/json'}) }; 54 | return this.httpClient.post(`api/v1/editProblem/${problem.id}`, problem, options) 55 | .toPromise() 56 | .then((res: any) => { 57 | this.getProblems(); 58 | return res; 59 | }) 60 | .catch(this.handleError); 61 | } 62 | 63 | build_and_run(data): Promise { 64 | const options = { headers: new HttpHeaders({'Connect-Type': 'application/json'}) }; 65 | return this.httpClient.post('api/v1/build_and_run', data, options) 66 | .toPromise() 67 | .then((res: any) => { 68 | console.log(res); 69 | return res; 70 | }) 71 | .catch(this.handleError); 72 | } 73 | 74 | private handleError(error: any): Promise { 75 | return Promise.reject(error.body || error); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /OnlineJudge/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | // import 'core-js/es6/reflect'; 42 | 43 | 44 | /** Evergreen browsers require these. **/ 45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 46 | import 'core-js/es7/reflect'; 47 | 48 | 49 | /** 50 | * Required to support Web Animations `@angular/platform-browser/animations`. 51 | * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation 52 | **/ 53 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 54 | 55 | 56 | 57 | /*************************************************************************************************** 58 | * Zone JS is required by default for Angular itself. 59 | */ 60 | import 'zone.js/dist/zone'; // Included with Angular CLI. 61 | 62 | 63 | 64 | /*************************************************************************************************** 65 | * APPLICATION IMPORTS 66 | */ 67 | -------------------------------------------------------------------------------- /OnlineJudge/src/app/services/auth.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | import { filter } from 'rxjs/operators'; 4 | import * as auth0 from 'auth0-js'; 5 | 6 | @Injectable() 7 | export class AuthService { 8 | 9 | auth0 = new auth0.WebAuth({ 10 | clientID: '5xbog7t8lFRoXryt9ZjhlSFKnxVkIPT5', 11 | domain: 'auth-yicong.auth0.com', 12 | responseType: 'token id_token', 13 | audience: 'https://auth-yicong.auth0.com/userinfo', 14 | redirectUri: "http://" + window.location.hostname + ":3000" + "/loading", 15 | scope: 'openid profile' 16 | }); 17 | 18 | userProfile: any; 19 | 20 | constructor(public router: Router) {} 21 | 22 | public getProfile(cb): void { 23 | const accessToken = localStorage.getItem('access_token'); 24 | if (!accessToken) { 25 | throw new Error('Access Token must exist to fetch profile'); 26 | } 27 | 28 | const self = this; 29 | this.auth0.client.userInfo(accessToken, (err, profile) => { 30 | if (profile) { 31 | self.userProfile = profile; 32 | } 33 | cb(err, profile); 34 | }); 35 | } 36 | 37 | 38 | public login(): void { 39 | this.auth0.authorize(); 40 | } 41 | 42 | 43 | public handleAuthentication(): void { 44 | console.log("calling"); 45 | this.auth0.parseHash((err, authResult) => { 46 | console.log(authResult); 47 | if (authResult && authResult.accessToken && authResult.idToken) { 48 | this.setSession(authResult); 49 | this.router.navigate(['/']); 50 | } else if (err) { 51 | this.router.navigate(['/']); 52 | console.log(err); 53 | alert(`Error: ${err.error}. Check the console for further details.`); 54 | } 55 | }); 56 | } 57 | 58 | 59 | private setSession(authResult): void { 60 | // Set the time that the access token will expire at 61 | const expiresAt = JSON.stringify((authResult.expiresIn * 1000) + new Date().getTime()); 62 | localStorage.setItem('access_token', authResult.accessToken); 63 | localStorage.setItem('id_token', authResult.idToken); 64 | localStorage.setItem('expires_at', expiresAt); 65 | } 66 | 67 | 68 | public logout(): void { 69 | // Remove tokens and expiry time from localStorage 70 | localStorage.removeItem('access_token'); 71 | localStorage.removeItem('id_token'); 72 | localStorage.removeItem('expires_at'); 73 | // Go back to the home route 74 | this.router.navigate(['/']); 75 | } 76 | 77 | 78 | public isAuthenticated(): boolean { 79 | // Check whether the current time is past the 80 | // access token's expiry time 81 | const expiresAt = JSON.parse(localStorage.getItem('expires_at')); 82 | return new Date().getTime() < expiresAt; 83 | } 84 | 85 | } -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/editor/editor.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ActivatedRoute, Params } from '@angular/router'; 3 | import { Subscription } from 'rxjs/Subscription'; 4 | 5 | import { CollaborationService } from '../../services/collaboration.service'; 6 | import { DataService } from '../../services/data.service' 7 | 8 | 9 | declare var ace: any; 10 | 11 | @Component({ 12 | selector: 'app-editor', 13 | templateUrl: './editor.component.html', 14 | styleUrls: ['./editor.component.css'] 15 | }) 16 | export class EditorComponent implements OnInit { 17 | 18 | editor: any; 19 | result: string = ''; 20 | 21 | public languages: string[] = ['Java', 'Python', 'C++']; 22 | language: string = 'Java'; 23 | sessionId: string; 24 | 25 | users: string; 26 | subscriptionUsers: Subscription; 27 | 28 | constructor(private collaboration: CollaborationService, 29 | private route: ActivatedRoute, 30 | private dataService: DataService) { } 31 | 32 | defaultContent = { 33 | 'Java': 34 | `public class Example { 35 | public static void main(String[] args) { 36 | // Type your Java code here. 37 | } 38 | }`, 39 | 'Python': 40 | `class Example: 41 | def main(): 42 | # Type your Python code here. 43 | `, 44 | 'C++': 45 | `int main() { 46 | // Type your C++ code here. 47 | return 0; 48 | }` 49 | }; 50 | 51 | ngOnInit() { 52 | this.route.params 53 | .subscribe(params => { 54 | this.sessionId = params['id']; 55 | this.initEditor(); 56 | this.collaboration.restoreBuffer(); 57 | }); 58 | } 59 | 60 | initEditor(): void { 61 | this.editor = ace.edit("editor"); 62 | this.editor.setTheme("ace/theme/eclipse"); 63 | this.resetEditor(); 64 | 65 | // this.collaboration.init(this.editor, this.sessionId); 66 | this.subscriptionUsers = this.collaboration.init(this.editor, this.sessionId) 67 | .subscribe(users => this.users = users); 68 | this.editor.lastAppliedChange = null; 69 | 70 | this.editor.on("change", (e) => { 71 | console.log('editor changes' + JSON.stringify(e)); 72 | if (this.editor.lastAppliedChange != e) { 73 | this.collaboration.change(JSON.stringify(e)); 74 | } 75 | }); 76 | } 77 | 78 | resetEditor(): void { 79 | this.editor.setValue(this.defaultContent[this.language]); 80 | this.editor.getSession().setMode("ace/mode/" + this.language.toLocaleLowerCase()); 81 | } 82 | 83 | setLanguage(language: string): void { 84 | this.language = language; 85 | this.resetEditor(); 86 | } 87 | 88 | submit(): void { 89 | let user_code = this.editor.getValue(); 90 | console.log(user_code); 91 | 92 | const data = { 93 | user_code: user_code, 94 | lang: this.language.toLocaleLowerCase() 95 | }; 96 | this.dataService.build_and_run(data) 97 | .then(res => this.result = res); 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /executor/exec_utils.py: -------------------------------------------------------------------------------- 1 | import docker 2 | import os 3 | import shutil 4 | import uuid 5 | from docker.errors import APIError, ContainerError, ImageNotFound 6 | 7 | CURRENT_DIR = os.path.dirname(os.path.relpath(__file__)) 8 | IMAGE_NAME = 'richardliuliu/oj-executor' 9 | 10 | client = docker.from_env() 11 | 12 | TEMP_BUILD_DIR = "%s/tmp/" % CURRENT_DIR 13 | CONTAINER_NAME = "%s:latest" % IMAGE_NAME 14 | 15 | SOURCE_FILE_NAMES = { 16 | "java": "Example.java", 17 | "python": "example.py", 18 | "c++": "example.cpp" 19 | } 20 | BINARY_NAMES = { 21 | "java": "Example", 22 | "python": "example.py", 23 | "c++": "./a.out" 24 | } 25 | BUILD_COMMANDS = { 26 | "java": "javac", 27 | "python": "python3", 28 | "c++": "g++" 29 | } 30 | EXECUTE_COMMANDS = { 31 | "java": "java", 32 | "python": "python3", 33 | "c++": "" 34 | } 35 | 36 | def load_image(): 37 | try: 38 | client.images.get(IMAGE_NAME) 39 | print("Image exists locally") 40 | except ImageNotFound: 41 | print("image not found locally, loading from docker hub") 42 | client.images.pull(IMAGE_NAME) 43 | except APIError: 44 | print("Cannot connect to docker") 45 | return 46 | print("image loaded") 47 | 48 | def make_dir(dir): 49 | try: 50 | os.mkdir(dir) 51 | except OSError: 52 | print("cannot create dir") 53 | 54 | def build_and_run(code, lang): 55 | result = {'build': None, 'run': None, 'error': None} 56 | source_file_parent_dir_name = uuid.uuid4() 57 | source_file_host_dir ="%s/%s" % (TEMP_BUILD_DIR, source_file_parent_dir_name) 58 | source_file_guest_dir = "/test/%s" % (source_file_parent_dir_name) 59 | make_dir(source_file_host_dir) 60 | 61 | with open("%s/%s" % (source_file_host_dir, SOURCE_FILE_NAMES[lang]), 'w') as source_file: 62 | source_file.write(code) 63 | 64 | try: 65 | client.containers.run( 66 | image=IMAGE_NAME, 67 | command="%s %s" % (BUILD_COMMANDS[lang], SOURCE_FILE_NAMES[lang]), 68 | volumes={source_file_host_dir: {'bind': source_file_guest_dir, 'mode': 'rw'}}, 69 | working_dir=source_file_guest_dir 70 | ) 71 | 72 | print("source built") 73 | result['build'] = 'OK' 74 | except ContainerError as e: 75 | result['build'] = str(e.stderr, 'utf-8') 76 | shutil.rmtree(source_file_host_dir) 77 | return result 78 | 79 | try: 80 | log = client.containers.run( 81 | image=IMAGE_NAME, 82 | command="%s %s" % (EXECUTE_COMMANDS[lang], BINARY_NAMES[lang]), 83 | volumes={source_file_host_dir: {'bind': source_file_guest_dir, 'mode': 'rw'}}, 84 | working_dir=source_file_guest_dir 85 | ) 86 | 87 | log = str(log, 'utf-8') 88 | print(log) 89 | result['run'] = log 90 | except ContainerError as e: 91 | result['run'] = str(e.stderr, 'utf-8') 92 | shutil.rmtree(source_file_host_dir) 93 | return result 94 | 95 | shutil.rmtree(source_file_host_dir) 96 | return result -------------------------------------------------------------------------------- /OnlineJudge/src/app/components/navbar/navbar.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /OnlineJudge/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs", 22 | "rxjs/Rx" 23 | ], 24 | "import-spacing": true, 25 | "indent": [ 26 | true, 27 | "spaces" 28 | ], 29 | "interface-over-type-literal": true, 30 | "label-position": true, 31 | "max-line-length": [ 32 | true, 33 | 140 34 | ], 35 | "member-access": false, 36 | "member-ordering": [ 37 | true, 38 | { 39 | "order": [ 40 | "static-field", 41 | "instance-field", 42 | "static-method", 43 | "instance-method" 44 | ] 45 | } 46 | ], 47 | "no-arg": true, 48 | "no-bitwise": true, 49 | "no-console": [ 50 | true, 51 | "debug", 52 | "info", 53 | "time", 54 | "timeEnd", 55 | "trace" 56 | ], 57 | "no-construct": true, 58 | "no-debugger": true, 59 | "no-duplicate-super": true, 60 | "no-empty": false, 61 | "no-empty-interface": true, 62 | "no-eval": true, 63 | "no-inferrable-types": [ 64 | true, 65 | "ignore-params" 66 | ], 67 | "no-misused-new": true, 68 | "no-non-null-assertion": true, 69 | "no-shadowed-variable": true, 70 | "no-string-literal": false, 71 | "no-string-throw": true, 72 | "no-switch-case-fall-through": true, 73 | "no-trailing-whitespace": true, 74 | "no-unnecessary-initializer": true, 75 | "no-unused-expression": true, 76 | "no-use-before-declare": true, 77 | "no-var-keyword": true, 78 | "object-literal-sort-keys": false, 79 | "one-line": [ 80 | true, 81 | "check-open-brace", 82 | "check-catch", 83 | "check-else", 84 | "check-whitespace" 85 | ], 86 | "prefer-const": true, 87 | "quotemark": [ 88 | true, 89 | "single" 90 | ], 91 | "radix": true, 92 | "semicolon": [ 93 | true, 94 | "always" 95 | ], 96 | "triple-equals": [ 97 | true, 98 | "allow-null-check" 99 | ], 100 | "typedef-whitespace": [ 101 | true, 102 | { 103 | "call-signature": "nospace", 104 | "index-signature": "nospace", 105 | "parameter": "nospace", 106 | "property-declaration": "nospace", 107 | "variable-declaration": "nospace" 108 | } 109 | ], 110 | "unified-signatures": true, 111 | "variable-name": false, 112 | "whitespace": [ 113 | true, 114 | "check-branch", 115 | "check-decl", 116 | "check-operator", 117 | "check-separator", 118 | "check-type" 119 | ], 120 | "directive-selector": [ 121 | true, 122 | "attribute", 123 | "app", 124 | "camelCase" 125 | ], 126 | "component-selector": [ 127 | true, 128 | "element", 129 | "app", 130 | "kebab-case" 131 | ], 132 | "no-output-on-prefix": true, 133 | "use-input-property-decorator": true, 134 | "use-output-property-decorator": true, 135 | "use-host-property-decorator": true, 136 | "no-input-rename": true, 137 | "no-output-rename": true, 138 | "use-life-cycle-interface": true, 139 | "use-pipe-transform-interface": true, 140 | "component-class-suffix": true, 141 | "directive-class-suffix": true 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /OJ-server/services/editorSocketService.js: -------------------------------------------------------------------------------- 1 | var redisClient = require('../modules/redisClient'); 2 | const TIME_IN_SECONDS = 3600; 3 | 4 | module.exports = function(io) { 5 | var sessionPath = '/temp_sessions'; 6 | 7 | var collaborations = {}; 8 | var socketId2sessionId = {}; 9 | 10 | io.on('connection', (socket) => { 11 | let sessionId = socket.handshake.query['sessionId']; 12 | 13 | socketId2sessionId[socket.id] = sessionId; 14 | 15 | if (sessionId in collaborations) { 16 | collaborations[sessionId]['participants'].push(socket.id); 17 | 18 | let participants = collaborations[sessionId]['participants']; 19 | for (let i = 0; i < participants.length; i++) { 20 | io.to(participants[i]).emit("userChange", participants); 21 | } 22 | } else { 23 | redisClient.get(sessionPath + '/' + sessionId, function(data) { 24 | if (data) { 25 | console.log("Got data from redis."); 26 | collaborations[sessionId] = { 27 | 'cachedCodes': JSON.parse(data), 28 | 'participants': [] 29 | }; 30 | } else { 31 | console.log("Creating new session."); 32 | collaborations[sessionId] = { 33 | 'cachedCodes': [], 34 | 'participants': [] 35 | }; 36 | } 37 | // collaborations[sessionId]['participants'].push(socket.id); 38 | io.to(socket.id).emit("userChange", socket.id); 39 | }); 40 | } 41 | 42 | socket.on('change', delta => { 43 | console.log("change" + socketId2sessionId[socket.id] + " " + delta); 44 | let sessionId = socketId2sessionId[socket.id]; 45 | if (sessionId in collaborations) { 46 | collaborations[sessionId]['cachedCodes'].push(["change", delta, Date.now()]); 47 | 48 | let participants = collaborations[sessionId]['participants']; 49 | for (let i = 0; i < participants.length; i++) { 50 | if (socket.id != participants[i]) { 51 | io.to(participants[i]).emit("change", delta); 52 | } 53 | } 54 | } else { 55 | console.log("Unable to join any collaboration."); 56 | } 57 | }); 58 | 59 | socket.on('restoreBuffer', () => { 60 | let sessionId = socketId2sessionId[socket.id]; 61 | console.log("Restore buffer for session " + sessionId, "socket id: " + socket.id); 62 | 63 | if (sessionId in collaborations) { 64 | let codes = collaborations[sessionId]['cachedCodes']; 65 | for (let i = 0; i < codes.length; i++) { 66 | socket.emit(codes[i][0], codes[i][1]); 67 | } 68 | } 69 | }); 70 | 71 | socket.on('disconnect', () => { 72 | let sessionId = socketId2sessionId[socket.id]; 73 | console.log("Disconnect session " + sessionId + ", socket id: " + socket.id); 74 | 75 | let found_remove = false; 76 | 77 | if (sessionId in collaborations) { 78 | let participants = collaborations[sessionId]['participants']; 79 | let index = participants.indexOf(socket.id); 80 | participants.splice(index, 1); 81 | found_remove = true; 82 | if (participants.length == 0) { 83 | console.log("Last participant left"); 84 | let key = sessionPath + "/" + sessionId; 85 | let value = JSON.stringify(collaborations[sessionId]['cachedCodes']); 86 | 87 | redisClient.set(key, value, redisClient.redisPrint); 88 | redisClient.expire(key, TIME_IN_SECONDS); 89 | 90 | delete collaborations[sessionId]; 91 | } 92 | for (let i = 0; i < participants.length; i++) { 93 | io.to(participants[i]).emit("userChange", participants); 94 | } 95 | } 96 | if (!found_remove) { 97 | console.log("Warning: cannot find socket id in the collaboration."); 98 | } 99 | }); 100 | }); 101 | 102 | }; -------------------------------------------------------------------------------- /OJ-server/services/problemService.js: -------------------------------------------------------------------------------- 1 | // let problems = [ 2 | // { 3 | // "id": 1, 4 | // name: "Two Sum", 5 | // desc: "Given an array of integers, find two numbers such that they add up to a specific target number.\n\nThe function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2. Please note that your returned answers (both index1 and index2) are NOT zero-based.", 6 | // difficulty: "easy" 7 | // }, 8 | // { 9 | // "id": 2, 10 | // "name": "3Sum", 11 | // "desc": "Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.", 12 | // "difficulty": "medium" 13 | // }, 14 | // { 15 | // "id": 3, 16 | // "name": "4Sum", 17 | // "desc": "Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target?\n\nFind all unique quadruplets in the array which gives the sum of target.", 18 | // "difficulty": "medium" 19 | // }, 20 | // { 21 | // "id": 4, 22 | // "name": "Triangle Count", 23 | // "desc": "Given an array of integers, how many three numbers can be found in the array, so that we can build an triangle whose three edges length is the three numbers that we find?", 24 | // "difficulty": "hard" 25 | // }, 26 | // { 27 | // "id": 5, 28 | // "name": "Sliding Window Maximum", 29 | // "desc": "Given an array of n integer with duplicate number, and a moving window(size k), move the window at each iteration from the start of the array, find the maximum number inside the window at each moving.", 30 | // "difficulty": "ultimate" 31 | // } 32 | // ]; 33 | 34 | const ProblemModel = require('../models/problemModel'); 35 | 36 | const getProblems = function() { 37 | // return new Promise((resolve, reject) => { 38 | // resolve(problems); 39 | // }); 40 | return new Promise((resolve, reject) => { 41 | ProblemModel.find({}, (err, problems) => { 42 | if (err) { 43 | reject(err); 44 | } else { 45 | resolve(problems); 46 | } 47 | }); 48 | }); 49 | } 50 | 51 | const getProblem = function(id) { 52 | // return new Promise((resolve, reject) => { 53 | // resolve(problems.find(problem => problem.id === id)); 54 | // }); 55 | return new Promise((resolve, reject) => { 56 | ProblemModel.findOne({id: id}, (err, problem) => { 57 | if (err) { 58 | reject(err); 59 | } else { 60 | resolve(problem); 61 | } 62 | }); 63 | }); 64 | } 65 | 66 | const addProblem = function(newProblem) { 67 | // return new Promise((resolve, reject) => { 68 | // if (problems.find(problem => problem.name === newProblem.name)) { 69 | // reject('Problem already exists') 70 | // } else { 71 | // newProblem.id = problems.length + 1; 72 | // problems.push(newProblem); 73 | // resolve(newProblem); 74 | // } 75 | // }); 76 | return new Promise((resolve, reject) => { 77 | ProblemModel.findOne({name: newProblem.name}, (err, data) => { 78 | if (data) { 79 | reject('Problem name already exists'); 80 | } else { 81 | ProblemModel.count({}, (err, count) => { 82 | newProblem.id = count + 1; 83 | const mongoProblem = new ProblemModel(newProblem); 84 | mongoProblem.save(); 85 | resolve(mongoProblem); 86 | }); 87 | } 88 | }); 89 | }); 90 | } 91 | 92 | const editProblem = function(newProblem) { 93 | return new Promise((resolve, reject) => { 94 | ProblemModel.findOne({name: newProblem.name}, (err, mongoProblem) => { 95 | if (!mongoProblem) { 96 | reject('Problem doesn\'t exist'); 97 | } else { 98 | mongoProblem.desc = newProblem.desc; 99 | mongoProblem.difficulty = newProblem.difficulty; 100 | mongoProblem.save(); 101 | resolve(mongoProblem); 102 | } 103 | }); 104 | }); 105 | } 106 | 107 | module.exports = { 108 | getProblems, 109 | getProblem, 110 | addProblem, 111 | editProblem 112 | } -------------------------------------------------------------------------------- /public/inline.bundle.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack/bootstrap 3464d621a4630cca5022"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kDAA0C,WAAW,EAAE;AACvD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA,kDAA0C,oBAAoB,WAAW","file":"inline.bundle.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t\"inline\": 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData === 0) {\n \t\t\treturn new Promise(function(resolve) { resolve(); });\n \t\t}\n\n \t\t// a Promise means \"currently loading\".\n \t\tif(installedChunkData) {\n \t\t\treturn installedChunkData[2];\n \t\t}\n\n \t\t// setup Promise in chunk cache\n \t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t});\n \t\tinstalledChunkData[2] = promise;\n\n \t\t// start chunk loading\n \t\tvar head = document.getElementsByTagName('head')[0];\n \t\tvar script = document.createElement('script');\n \t\tscript.type = 'text/javascript';\n \t\tscript.charset = 'utf-8';\n \t\tscript.async = true;\n \t\tscript.timeout = 120000;\n\n \t\tif (__webpack_require__.nc) {\n \t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t}\n \t\tscript.src = __webpack_require__.p + \"\" + chunkId + \".chunk.js\";\n \t\tvar timeout = setTimeout(onScriptComplete, 120000);\n \t\tscript.onerror = script.onload = onScriptComplete;\n \t\tfunction onScriptComplete() {\n \t\t\t// avoid mem leaks in IE.\n \t\t\tscript.onerror = script.onload = null;\n \t\t\tclearTimeout(timeout);\n \t\t\tvar chunk = installedChunks[chunkId];\n \t\t\tif(chunk !== 0) {\n \t\t\t\tif(chunk) {\n \t\t\t\t\tchunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));\n \t\t\t\t}\n \t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t}\n \t\t};\n \t\thead.appendChild(script);\n\n \t\treturn promise;\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 3464d621a4630cca5022"],"sourceRoot":"webpack:///"} -------------------------------------------------------------------------------- /public/inline.bundle.js: -------------------------------------------------------------------------------- 1 | /******/ (function(modules) { // webpackBootstrap 2 | /******/ // install a JSONP callback for chunk loading 3 | /******/ var parentJsonpFunction = window["webpackJsonp"]; 4 | /******/ window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) { 5 | /******/ // add "moreModules" to the modules object, 6 | /******/ // then flag all "chunkIds" as loaded and fire callback 7 | /******/ var moduleId, chunkId, i = 0, resolves = [], result; 8 | /******/ for(;i < chunkIds.length; i++) { 9 | /******/ chunkId = chunkIds[i]; 10 | /******/ if(installedChunks[chunkId]) { 11 | /******/ resolves.push(installedChunks[chunkId][0]); 12 | /******/ } 13 | /******/ installedChunks[chunkId] = 0; 14 | /******/ } 15 | /******/ for(moduleId in moreModules) { 16 | /******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { 17 | /******/ modules[moduleId] = moreModules[moduleId]; 18 | /******/ } 19 | /******/ } 20 | /******/ if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules); 21 | /******/ while(resolves.length) { 22 | /******/ resolves.shift()(); 23 | /******/ } 24 | /******/ if(executeModules) { 25 | /******/ for(i=0; i < executeModules.length; i++) { 26 | /******/ result = __webpack_require__(__webpack_require__.s = executeModules[i]); 27 | /******/ } 28 | /******/ } 29 | /******/ return result; 30 | /******/ }; 31 | /******/ 32 | /******/ // The module cache 33 | /******/ var installedModules = {}; 34 | /******/ 35 | /******/ // objects to store loaded and loading chunks 36 | /******/ var installedChunks = { 37 | /******/ "inline": 0 38 | /******/ }; 39 | /******/ 40 | /******/ // The require function 41 | /******/ function __webpack_require__(moduleId) { 42 | /******/ 43 | /******/ // Check if module is in cache 44 | /******/ if(installedModules[moduleId]) { 45 | /******/ return installedModules[moduleId].exports; 46 | /******/ } 47 | /******/ // Create a new module (and put it into the cache) 48 | /******/ var module = installedModules[moduleId] = { 49 | /******/ i: moduleId, 50 | /******/ l: false, 51 | /******/ exports: {} 52 | /******/ }; 53 | /******/ 54 | /******/ // Execute the module function 55 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 56 | /******/ 57 | /******/ // Flag the module as loaded 58 | /******/ module.l = true; 59 | /******/ 60 | /******/ // Return the exports of the module 61 | /******/ return module.exports; 62 | /******/ } 63 | /******/ 64 | /******/ // This file contains only the entry chunk. 65 | /******/ // The chunk loading function for additional chunks 66 | /******/ __webpack_require__.e = function requireEnsure(chunkId) { 67 | /******/ var installedChunkData = installedChunks[chunkId]; 68 | /******/ if(installedChunkData === 0) { 69 | /******/ return new Promise(function(resolve) { resolve(); }); 70 | /******/ } 71 | /******/ 72 | /******/ // a Promise means "currently loading". 73 | /******/ if(installedChunkData) { 74 | /******/ return installedChunkData[2]; 75 | /******/ } 76 | /******/ 77 | /******/ // setup Promise in chunk cache 78 | /******/ var promise = new Promise(function(resolve, reject) { 79 | /******/ installedChunkData = installedChunks[chunkId] = [resolve, reject]; 80 | /******/ }); 81 | /******/ installedChunkData[2] = promise; 82 | /******/ 83 | /******/ // start chunk loading 84 | /******/ var head = document.getElementsByTagName('head')[0]; 85 | /******/ var script = document.createElement('script'); 86 | /******/ script.type = 'text/javascript'; 87 | /******/ script.charset = 'utf-8'; 88 | /******/ script.async = true; 89 | /******/ script.timeout = 120000; 90 | /******/ 91 | /******/ if (__webpack_require__.nc) { 92 | /******/ script.setAttribute("nonce", __webpack_require__.nc); 93 | /******/ } 94 | /******/ script.src = __webpack_require__.p + "" + chunkId + ".chunk.js"; 95 | /******/ var timeout = setTimeout(onScriptComplete, 120000); 96 | /******/ script.onerror = script.onload = onScriptComplete; 97 | /******/ function onScriptComplete() { 98 | /******/ // avoid mem leaks in IE. 99 | /******/ script.onerror = script.onload = null; 100 | /******/ clearTimeout(timeout); 101 | /******/ var chunk = installedChunks[chunkId]; 102 | /******/ if(chunk !== 0) { 103 | /******/ if(chunk) { 104 | /******/ chunk[1](new Error('Loading chunk ' + chunkId + ' failed.')); 105 | /******/ } 106 | /******/ installedChunks[chunkId] = undefined; 107 | /******/ } 108 | /******/ }; 109 | /******/ head.appendChild(script); 110 | /******/ 111 | /******/ return promise; 112 | /******/ }; 113 | /******/ 114 | /******/ // expose the modules object (__webpack_modules__) 115 | /******/ __webpack_require__.m = modules; 116 | /******/ 117 | /******/ // expose the module cache 118 | /******/ __webpack_require__.c = installedModules; 119 | /******/ 120 | /******/ // define getter function for harmony exports 121 | /******/ __webpack_require__.d = function(exports, name, getter) { 122 | /******/ if(!__webpack_require__.o(exports, name)) { 123 | /******/ Object.defineProperty(exports, name, { 124 | /******/ configurable: false, 125 | /******/ enumerable: true, 126 | /******/ get: getter 127 | /******/ }); 128 | /******/ } 129 | /******/ }; 130 | /******/ 131 | /******/ // getDefaultExport function for compatibility with non-harmony modules 132 | /******/ __webpack_require__.n = function(module) { 133 | /******/ var getter = module && module.__esModule ? 134 | /******/ function getDefault() { return module['default']; } : 135 | /******/ function getModuleExports() { return module; }; 136 | /******/ __webpack_require__.d(getter, 'a', getter); 137 | /******/ return getter; 138 | /******/ }; 139 | /******/ 140 | /******/ // Object.prototype.hasOwnProperty.call 141 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 142 | /******/ 143 | /******/ // __webpack_public_path__ 144 | /******/ __webpack_require__.p = ""; 145 | /******/ 146 | /******/ // on error function for async loading 147 | /******/ __webpack_require__.oe = function(err) { console.error(err); throw err; }; 148 | /******/ }) 149 | /************************************************************************/ 150 | /******/ ([]); 151 | //# sourceMappingURL=inline.bundle.js.map -------------------------------------------------------------------------------- /OJ-server/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "oj-server", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "accepts": { 8 | "version": "1.3.4", 9 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz", 10 | "integrity": "sha1-hiRnWMfdbSGmR0/whKR0DsBesh8=", 11 | "requires": { 12 | "mime-types": "2.1.17", 13 | "negotiator": "0.6.1" 14 | } 15 | }, 16 | "after": { 17 | "version": "0.8.2", 18 | "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", 19 | "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" 20 | }, 21 | "array-flatten": { 22 | "version": "1.1.1", 23 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 24 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" 25 | }, 26 | "arraybuffer.slice": { 27 | "version": "0.0.7", 28 | "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", 29 | "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==" 30 | }, 31 | "async": { 32 | "version": "2.1.4", 33 | "resolved": "https://registry.npmjs.org/async/-/async-2.1.4.tgz", 34 | "integrity": "sha1-LSFgx3iAMuTdbL4lAvH5osj2zeQ=", 35 | "requires": { 36 | "lodash": "4.17.5" 37 | } 38 | }, 39 | "async-limiter": { 40 | "version": "1.0.0", 41 | "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", 42 | "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" 43 | }, 44 | "backo2": { 45 | "version": "1.0.2", 46 | "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", 47 | "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=" 48 | }, 49 | "base64-arraybuffer": { 50 | "version": "0.1.5", 51 | "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", 52 | "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=" 53 | }, 54 | "base64id": { 55 | "version": "1.0.0", 56 | "resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz", 57 | "integrity": "sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY=" 58 | }, 59 | "better-assert": { 60 | "version": "1.0.2", 61 | "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", 62 | "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", 63 | "requires": { 64 | "callsite": "1.0.0" 65 | } 66 | }, 67 | "blob": { 68 | "version": "0.0.4", 69 | "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz", 70 | "integrity": "sha1-vPEwUspURj8w+fx+lbmkdjCpSSE=" 71 | }, 72 | "bluebird": { 73 | "version": "3.5.0", 74 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", 75 | "integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw=" 76 | }, 77 | "body-parser": { 78 | "version": "1.18.2", 79 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", 80 | "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", 81 | "requires": { 82 | "bytes": "3.0.0", 83 | "content-type": "1.0.4", 84 | "debug": "2.6.9", 85 | "depd": "1.1.2", 86 | "http-errors": "1.6.2", 87 | "iconv-lite": "0.4.19", 88 | "on-finished": "2.3.0", 89 | "qs": "6.5.1", 90 | "raw-body": "2.3.2", 91 | "type-is": "1.6.15" 92 | } 93 | }, 94 | "bson": { 95 | "version": "1.0.4", 96 | "resolved": "https://registry.npmjs.org/bson/-/bson-1.0.4.tgz", 97 | "integrity": "sha1-k8ENOeqltYQVy8QFLz5T5WKwtyw=" 98 | }, 99 | "bytes": { 100 | "version": "3.0.0", 101 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", 102 | "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" 103 | }, 104 | "callsite": { 105 | "version": "1.0.0", 106 | "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", 107 | "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=" 108 | }, 109 | "component-bind": { 110 | "version": "1.0.0", 111 | "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", 112 | "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=" 113 | }, 114 | "component-emitter": { 115 | "version": "1.2.1", 116 | "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", 117 | "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" 118 | }, 119 | "component-inherit": { 120 | "version": "0.0.3", 121 | "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", 122 | "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=" 123 | }, 124 | "content-disposition": { 125 | "version": "0.5.2", 126 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", 127 | "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" 128 | }, 129 | "content-type": { 130 | "version": "1.0.4", 131 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", 132 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" 133 | }, 134 | "cookie": { 135 | "version": "0.3.1", 136 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", 137 | "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" 138 | }, 139 | "cookie-signature": { 140 | "version": "1.0.6", 141 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 142 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" 143 | }, 144 | "debug": { 145 | "version": "2.6.9", 146 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 147 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 148 | "requires": { 149 | "ms": "2.0.0" 150 | } 151 | }, 152 | "depd": { 153 | "version": "1.1.2", 154 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", 155 | "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" 156 | }, 157 | "destroy": { 158 | "version": "1.0.4", 159 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", 160 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" 161 | }, 162 | "double-ended-queue": { 163 | "version": "2.1.0-0", 164 | "resolved": "https://registry.npmjs.org/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz", 165 | "integrity": "sha1-ED01J/0xUo9AGIEwyEHv3XgmTlw=" 166 | }, 167 | "ee-first": { 168 | "version": "1.1.1", 169 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 170 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" 171 | }, 172 | "encodeurl": { 173 | "version": "1.0.2", 174 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 175 | "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" 176 | }, 177 | "engine.io": { 178 | "version": "3.1.4", 179 | "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.1.4.tgz", 180 | "integrity": "sha1-PQIRtwpVLOhB/8fahiezAamkFi4=", 181 | "requires": { 182 | "accepts": "1.3.3", 183 | "base64id": "1.0.0", 184 | "cookie": "0.3.1", 185 | "debug": "2.6.9", 186 | "engine.io-parser": "2.1.2", 187 | "uws": "0.14.5", 188 | "ws": "3.3.3" 189 | }, 190 | "dependencies": { 191 | "accepts": { 192 | "version": "1.3.3", 193 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz", 194 | "integrity": "sha1-w8p0NJOGSMPg2cHjKN1otiLChMo=", 195 | "requires": { 196 | "mime-types": "2.1.17", 197 | "negotiator": "0.6.1" 198 | } 199 | } 200 | } 201 | }, 202 | "engine.io-client": { 203 | "version": "3.1.4", 204 | "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.1.4.tgz", 205 | "integrity": "sha1-T88TcLRxY70s6b4nM5ckMDUNTqE=", 206 | "requires": { 207 | "component-emitter": "1.2.1", 208 | "component-inherit": "0.0.3", 209 | "debug": "2.6.9", 210 | "engine.io-parser": "2.1.2", 211 | "has-cors": "1.1.0", 212 | "indexof": "0.0.1", 213 | "parseqs": "0.0.5", 214 | "parseuri": "0.0.5", 215 | "ws": "3.3.3", 216 | "xmlhttprequest-ssl": "1.5.5", 217 | "yeast": "0.1.2" 218 | } 219 | }, 220 | "engine.io-parser": { 221 | "version": "2.1.2", 222 | "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.1.2.tgz", 223 | "integrity": "sha512-dInLFzr80RijZ1rGpx1+56/uFoH7/7InhH3kZt+Ms6hT8tNx3NGW/WNSA/f8As1WkOfkuyb3tnRyuXGxusclMw==", 224 | "requires": { 225 | "after": "0.8.2", 226 | "arraybuffer.slice": "0.0.7", 227 | "base64-arraybuffer": "0.1.5", 228 | "blob": "0.0.4", 229 | "has-binary2": "1.0.2" 230 | } 231 | }, 232 | "escape-html": { 233 | "version": "1.0.3", 234 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 235 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" 236 | }, 237 | "etag": { 238 | "version": "1.8.1", 239 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 240 | "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" 241 | }, 242 | "express": { 243 | "version": "4.16.2", 244 | "resolved": "https://registry.npmjs.org/express/-/express-4.16.2.tgz", 245 | "integrity": "sha1-41xt/i1kt9ygpc1PIXgb4ymeB2w=", 246 | "requires": { 247 | "accepts": "1.3.4", 248 | "array-flatten": "1.1.1", 249 | "body-parser": "1.18.2", 250 | "content-disposition": "0.5.2", 251 | "content-type": "1.0.4", 252 | "cookie": "0.3.1", 253 | "cookie-signature": "1.0.6", 254 | "debug": "2.6.9", 255 | "depd": "1.1.2", 256 | "encodeurl": "1.0.2", 257 | "escape-html": "1.0.3", 258 | "etag": "1.8.1", 259 | "finalhandler": "1.1.0", 260 | "fresh": "0.5.2", 261 | "merge-descriptors": "1.0.1", 262 | "methods": "1.1.2", 263 | "on-finished": "2.3.0", 264 | "parseurl": "1.3.2", 265 | "path-to-regexp": "0.1.7", 266 | "proxy-addr": "2.0.2", 267 | "qs": "6.5.1", 268 | "range-parser": "1.2.0", 269 | "safe-buffer": "5.1.1", 270 | "send": "0.16.1", 271 | "serve-static": "1.13.1", 272 | "setprototypeof": "1.1.0", 273 | "statuses": "1.3.1", 274 | "type-is": "1.6.15", 275 | "utils-merge": "1.0.1", 276 | "vary": "1.1.2" 277 | } 278 | }, 279 | "finalhandler": { 280 | "version": "1.1.0", 281 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", 282 | "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", 283 | "requires": { 284 | "debug": "2.6.9", 285 | "encodeurl": "1.0.2", 286 | "escape-html": "1.0.3", 287 | "on-finished": "2.3.0", 288 | "parseurl": "1.3.2", 289 | "statuses": "1.3.1", 290 | "unpipe": "1.0.0" 291 | } 292 | }, 293 | "follow-redirects": { 294 | "version": "1.4.1", 295 | "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.4.1.tgz", 296 | "integrity": "sha512-uxYePVPogtya1ktGnAAXOacnbIuRMB4dkvqeNz2qTtTQsuzSfbDolV+wMMKxAmCx0bLgAKLbBOkjItMbbkR1vg==", 297 | "requires": { 298 | "debug": "3.1.0" 299 | }, 300 | "dependencies": { 301 | "debug": { 302 | "version": "3.1.0", 303 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", 304 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", 305 | "requires": { 306 | "ms": "2.0.0" 307 | } 308 | } 309 | } 310 | }, 311 | "forwarded": { 312 | "version": "0.1.2", 313 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", 314 | "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" 315 | }, 316 | "fresh": { 317 | "version": "0.5.2", 318 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 319 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" 320 | }, 321 | "has-binary2": { 322 | "version": "1.0.2", 323 | "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.2.tgz", 324 | "integrity": "sha1-6D26SfC5vk0CbSc2U1DZ8D9Uvpg=", 325 | "requires": { 326 | "isarray": "2.0.1" 327 | } 328 | }, 329 | "has-cors": { 330 | "version": "1.1.0", 331 | "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", 332 | "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=" 333 | }, 334 | "http-errors": { 335 | "version": "1.6.2", 336 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", 337 | "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", 338 | "requires": { 339 | "depd": "1.1.1", 340 | "inherits": "2.0.3", 341 | "setprototypeof": "1.0.3", 342 | "statuses": "1.3.1" 343 | }, 344 | "dependencies": { 345 | "depd": { 346 | "version": "1.1.1", 347 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", 348 | "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" 349 | }, 350 | "setprototypeof": { 351 | "version": "1.0.3", 352 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", 353 | "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" 354 | } 355 | } 356 | }, 357 | "iconv-lite": { 358 | "version": "0.4.19", 359 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", 360 | "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" 361 | }, 362 | "indexof": { 363 | "version": "0.0.1", 364 | "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", 365 | "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" 366 | }, 367 | "inherits": { 368 | "version": "2.0.3", 369 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 370 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 371 | }, 372 | "ipaddr.js": { 373 | "version": "1.5.2", 374 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.5.2.tgz", 375 | "integrity": "sha1-1LUFvemUaYfM8PxY2QEP+WB+P6A=" 376 | }, 377 | "isarray": { 378 | "version": "2.0.1", 379 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", 380 | "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=" 381 | }, 382 | "kareem": { 383 | "version": "2.0.3", 384 | "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.0.3.tgz", 385 | "integrity": "sha512-WloXk3nyByx9FEB5WY7WFEXIZB/QA+zy7c2kJMjnZCebjepEyQcJzazgLiKcTS/ltZeEoeEQ1A1pau1fEDlnIA==" 386 | }, 387 | "lodash": { 388 | "version": "4.17.5", 389 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", 390 | "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==" 391 | }, 392 | "lodash.get": { 393 | "version": "4.4.2", 394 | "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", 395 | "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" 396 | }, 397 | "media-typer": { 398 | "version": "0.3.0", 399 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 400 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" 401 | }, 402 | "merge-descriptors": { 403 | "version": "1.0.1", 404 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 405 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" 406 | }, 407 | "methods": { 408 | "version": "1.1.2", 409 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 410 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 411 | }, 412 | "mime": { 413 | "version": "1.4.1", 414 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", 415 | "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" 416 | }, 417 | "mime-db": { 418 | "version": "1.30.0", 419 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", 420 | "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=" 421 | }, 422 | "mime-types": { 423 | "version": "2.1.17", 424 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", 425 | "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", 426 | "requires": { 427 | "mime-db": "1.30.0" 428 | } 429 | }, 430 | "mongodb": { 431 | "version": "3.0.2", 432 | "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.0.2.tgz", 433 | "integrity": "sha512-E50FmpSQchZAimn2uPIegoNoH9UQYR1yiGHtQPmmg8/Ekc97w6owHoqaBoz+assnd9V5LxMzmQ/VEWMsQMgZhQ==", 434 | "requires": { 435 | "mongodb-core": "3.0.2" 436 | } 437 | }, 438 | "mongodb-core": { 439 | "version": "3.0.2", 440 | "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.0.2.tgz", 441 | "integrity": "sha512-p1B0qwFQUw6C1OlFJnrOJp8KaX7MuGoogRbTaupRt0y+pPRkMllHWtE9V6i1CDtTvI3/3sy2sQwqWez7zuXEAA==", 442 | "requires": { 443 | "bson": "1.0.4", 444 | "require_optional": "1.0.1" 445 | } 446 | }, 447 | "mongoose": { 448 | "version": "5.0.3", 449 | "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.0.3.tgz", 450 | "integrity": "sha512-y4NlLzZaQe5vJHjcEjHLKK6utjs7sVEPN971+d1vVJJGrmA+zeeFA1MEmC1J0ujD34eOSghnExXJPwCrxHHZCw==", 451 | "requires": { 452 | "async": "2.1.4", 453 | "bson": "1.0.4", 454 | "kareem": "2.0.3", 455 | "lodash.get": "4.4.2", 456 | "mongodb": "3.0.2", 457 | "mongoose-legacy-pluralize": "1.0.2", 458 | "mpath": "0.3.0", 459 | "mquery": "3.0.0", 460 | "ms": "2.0.0", 461 | "regexp-clone": "0.0.1", 462 | "sliced": "1.0.1" 463 | } 464 | }, 465 | "mongoose-legacy-pluralize": { 466 | "version": "1.0.2", 467 | "resolved": "https://registry.npmjs.org/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz", 468 | "integrity": "sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ==" 469 | }, 470 | "mpath": { 471 | "version": "0.3.0", 472 | "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.3.0.tgz", 473 | "integrity": "sha1-elj3iem1/TyUUgY0FXlg8mvV70Q=" 474 | }, 475 | "mquery": { 476 | "version": "3.0.0", 477 | "resolved": "https://registry.npmjs.org/mquery/-/mquery-3.0.0.tgz", 478 | "integrity": "sha512-WL1Lk8v4l8VFSSwN3yCzY9TXw+fKVYKn6f+w86TRzOLSE8k1yTgGaLBPUByJQi8VcLbOdnUneFV/y3Kv874pnQ==", 479 | "requires": { 480 | "bluebird": "3.5.0", 481 | "debug": "2.6.9", 482 | "regexp-clone": "0.0.1", 483 | "sliced": "0.0.5" 484 | }, 485 | "dependencies": { 486 | "sliced": { 487 | "version": "0.0.5", 488 | "resolved": "https://registry.npmjs.org/sliced/-/sliced-0.0.5.tgz", 489 | "integrity": "sha1-XtwETKTrb3gW1Qui/GPiXY/kcH8=" 490 | } 491 | } 492 | }, 493 | "ms": { 494 | "version": "2.0.0", 495 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 496 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 497 | }, 498 | "negotiator": { 499 | "version": "0.6.1", 500 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", 501 | "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" 502 | }, 503 | "node-rest-client": { 504 | "version": "3.1.0", 505 | "resolved": "https://registry.npmjs.org/node-rest-client/-/node-rest-client-3.1.0.tgz", 506 | "integrity": "sha1-4L623aeyDMC2enhHzxLF/EGcN8M=", 507 | "requires": { 508 | "debug": "2.2.0", 509 | "follow-redirects": "1.4.1", 510 | "xml2js": "0.4.19" 511 | }, 512 | "dependencies": { 513 | "debug": { 514 | "version": "2.2.0", 515 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", 516 | "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", 517 | "requires": { 518 | "ms": "0.7.1" 519 | } 520 | }, 521 | "ms": { 522 | "version": "0.7.1", 523 | "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", 524 | "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=" 525 | } 526 | } 527 | }, 528 | "object-component": { 529 | "version": "0.0.3", 530 | "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", 531 | "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=" 532 | }, 533 | "on-finished": { 534 | "version": "2.3.0", 535 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 536 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 537 | "requires": { 538 | "ee-first": "1.1.1" 539 | } 540 | }, 541 | "parseqs": { 542 | "version": "0.0.5", 543 | "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", 544 | "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", 545 | "requires": { 546 | "better-assert": "1.0.2" 547 | } 548 | }, 549 | "parseuri": { 550 | "version": "0.0.5", 551 | "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", 552 | "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", 553 | "requires": { 554 | "better-assert": "1.0.2" 555 | } 556 | }, 557 | "parseurl": { 558 | "version": "1.3.2", 559 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", 560 | "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" 561 | }, 562 | "path-to-regexp": { 563 | "version": "0.1.7", 564 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 565 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" 566 | }, 567 | "proxy-addr": { 568 | "version": "2.0.2", 569 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.2.tgz", 570 | "integrity": "sha1-ZXFQT0e7mI7IGAJT+F3X4UlSvew=", 571 | "requires": { 572 | "forwarded": "0.1.2", 573 | "ipaddr.js": "1.5.2" 574 | } 575 | }, 576 | "qs": { 577 | "version": "6.5.1", 578 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", 579 | "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" 580 | }, 581 | "range-parser": { 582 | "version": "1.2.0", 583 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", 584 | "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" 585 | }, 586 | "raw-body": { 587 | "version": "2.3.2", 588 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", 589 | "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", 590 | "requires": { 591 | "bytes": "3.0.0", 592 | "http-errors": "1.6.2", 593 | "iconv-lite": "0.4.19", 594 | "unpipe": "1.0.0" 595 | } 596 | }, 597 | "redis": { 598 | "version": "2.8.0", 599 | "resolved": "https://registry.npmjs.org/redis/-/redis-2.8.0.tgz", 600 | "integrity": "sha512-M1OkonEQwtRmZv4tEWF2VgpG0JWJ8Fv1PhlgT5+B+uNq2cA3Rt1Yt/ryoR+vQNOQcIEgdCdfH0jr3bDpihAw1A==", 601 | "requires": { 602 | "double-ended-queue": "2.1.0-0", 603 | "redis-commands": "1.3.1", 604 | "redis-parser": "2.6.0" 605 | } 606 | }, 607 | "redis-commands": { 608 | "version": "1.3.1", 609 | "resolved": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.3.1.tgz", 610 | "integrity": "sha1-gdgm9F+pyLIBH0zXoP5ZfSQdRCs=" 611 | }, 612 | "redis-parser": { 613 | "version": "2.6.0", 614 | "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-2.6.0.tgz", 615 | "integrity": "sha1-Uu0J2srBCPGmMcB+m2mUHnoZUEs=" 616 | }, 617 | "regexp-clone": { 618 | "version": "0.0.1", 619 | "resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-0.0.1.tgz", 620 | "integrity": "sha1-p8LgmJH9vzj7sQ03b7cwA+aKxYk=" 621 | }, 622 | "require_optional": { 623 | "version": "1.0.1", 624 | "resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz", 625 | "integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==", 626 | "requires": { 627 | "resolve-from": "2.0.0", 628 | "semver": "5.5.0" 629 | } 630 | }, 631 | "resolve-from": { 632 | "version": "2.0.0", 633 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", 634 | "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" 635 | }, 636 | "safe-buffer": { 637 | "version": "5.1.1", 638 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", 639 | "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" 640 | }, 641 | "sax": { 642 | "version": "1.2.4", 643 | "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", 644 | "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" 645 | }, 646 | "semver": { 647 | "version": "5.5.0", 648 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", 649 | "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" 650 | }, 651 | "send": { 652 | "version": "0.16.1", 653 | "resolved": "https://registry.npmjs.org/send/-/send-0.16.1.tgz", 654 | "integrity": "sha512-ElCLJdJIKPk6ux/Hocwhk7NFHpI3pVm/IZOYWqUmoxcgeyM+MpxHHKhb8QmlJDX1pU6WrgaHBkVNm73Sv7uc2A==", 655 | "requires": { 656 | "debug": "2.6.9", 657 | "depd": "1.1.2", 658 | "destroy": "1.0.4", 659 | "encodeurl": "1.0.2", 660 | "escape-html": "1.0.3", 661 | "etag": "1.8.1", 662 | "fresh": "0.5.2", 663 | "http-errors": "1.6.2", 664 | "mime": "1.4.1", 665 | "ms": "2.0.0", 666 | "on-finished": "2.3.0", 667 | "range-parser": "1.2.0", 668 | "statuses": "1.3.1" 669 | } 670 | }, 671 | "serve-static": { 672 | "version": "1.13.1", 673 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.1.tgz", 674 | "integrity": "sha512-hSMUZrsPa/I09VYFJwa627JJkNs0NrfL1Uzuup+GqHfToR2KcsXFymXSV90hoyw3M+msjFuQly+YzIH/q0MGlQ==", 675 | "requires": { 676 | "encodeurl": "1.0.2", 677 | "escape-html": "1.0.3", 678 | "parseurl": "1.3.2", 679 | "send": "0.16.1" 680 | } 681 | }, 682 | "setprototypeof": { 683 | "version": "1.1.0", 684 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", 685 | "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" 686 | }, 687 | "sliced": { 688 | "version": "1.0.1", 689 | "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", 690 | "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" 691 | }, 692 | "socket.io": { 693 | "version": "2.0.4", 694 | "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.0.4.tgz", 695 | "integrity": "sha1-waRZDO/4fs8TxyZS8Eb3FrKeYBQ=", 696 | "requires": { 697 | "debug": "2.6.9", 698 | "engine.io": "3.1.4", 699 | "socket.io-adapter": "1.1.1", 700 | "socket.io-client": "2.0.4", 701 | "socket.io-parser": "3.1.2" 702 | } 703 | }, 704 | "socket.io-adapter": { 705 | "version": "1.1.1", 706 | "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz", 707 | "integrity": "sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs=" 708 | }, 709 | "socket.io-client": { 710 | "version": "2.0.4", 711 | "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.0.4.tgz", 712 | "integrity": "sha1-CRilUkBtxeVAs4Dc2Xr8SmQzL44=", 713 | "requires": { 714 | "backo2": "1.0.2", 715 | "base64-arraybuffer": "0.1.5", 716 | "component-bind": "1.0.0", 717 | "component-emitter": "1.2.1", 718 | "debug": "2.6.9", 719 | "engine.io-client": "3.1.4", 720 | "has-cors": "1.1.0", 721 | "indexof": "0.0.1", 722 | "object-component": "0.0.3", 723 | "parseqs": "0.0.5", 724 | "parseuri": "0.0.5", 725 | "socket.io-parser": "3.1.2", 726 | "to-array": "0.1.4" 727 | } 728 | }, 729 | "socket.io-parser": { 730 | "version": "3.1.2", 731 | "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.1.2.tgz", 732 | "integrity": "sha1-28IoIVH8T6675Aru3Ady66YZ9/I=", 733 | "requires": { 734 | "component-emitter": "1.2.1", 735 | "debug": "2.6.9", 736 | "has-binary2": "1.0.2", 737 | "isarray": "2.0.1" 738 | } 739 | }, 740 | "statuses": { 741 | "version": "1.3.1", 742 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", 743 | "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" 744 | }, 745 | "to-array": { 746 | "version": "0.1.4", 747 | "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", 748 | "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=" 749 | }, 750 | "type-is": { 751 | "version": "1.6.15", 752 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz", 753 | "integrity": "sha1-yrEPtJCeRByChC6v4a1kbIGARBA=", 754 | "requires": { 755 | "media-typer": "0.3.0", 756 | "mime-types": "2.1.17" 757 | } 758 | }, 759 | "ultron": { 760 | "version": "1.1.1", 761 | "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", 762 | "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==" 763 | }, 764 | "unpipe": { 765 | "version": "1.0.0", 766 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 767 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" 768 | }, 769 | "utils-merge": { 770 | "version": "1.0.1", 771 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 772 | "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" 773 | }, 774 | "uws": { 775 | "version": "0.14.5", 776 | "resolved": "https://registry.npmjs.org/uws/-/uws-0.14.5.tgz", 777 | "integrity": "sha1-Z6rzPEaypYel9mZtAPdpEyjxSdw=", 778 | "optional": true 779 | }, 780 | "vary": { 781 | "version": "1.1.2", 782 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 783 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" 784 | }, 785 | "ws": { 786 | "version": "3.3.3", 787 | "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", 788 | "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", 789 | "requires": { 790 | "async-limiter": "1.0.0", 791 | "safe-buffer": "5.1.1", 792 | "ultron": "1.1.1" 793 | } 794 | }, 795 | "xml2js": { 796 | "version": "0.4.19", 797 | "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", 798 | "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", 799 | "requires": { 800 | "sax": "1.2.4", 801 | "xmlbuilder": "9.0.7" 802 | } 803 | }, 804 | "xmlbuilder": { 805 | "version": "9.0.7", 806 | "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", 807 | "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=" 808 | }, 809 | "xmlhttprequest-ssl": { 810 | "version": "1.5.5", 811 | "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz", 812 | "integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4=" 813 | }, 814 | "yeast": { 815 | "version": "0.1.2", 816 | "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", 817 | "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=" 818 | } 819 | } 820 | } 821 | -------------------------------------------------------------------------------- /public/main.bundle.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/$_lazy_route_resource lazy","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/app.component.css","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/app.component.html","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/app.component.ts","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/app.module.ts","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/app.routes.ts","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/edit-problem/edit-problem.component.css","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/edit-problem/edit-problem.component.html","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/edit-problem/edit-problem.component.ts","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/editor/editor.component.css","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/editor/editor.component.html","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/editor/editor.component.ts","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/loading/loading.component.css","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/loading/loading.component.html","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/loading/loading.component.ts","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/navbar/navbar.component.css","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/navbar/navbar.component.html","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/navbar/navbar.component.ts","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/new-problem/new-problem.component.css","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/new-problem/new-problem.component.html","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/new-problem/new-problem.component.ts","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/problem-detail/problem-detail.component.css","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/problem-detail/problem-detail.component.html","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/problem-detail/problem-detail.component.ts","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/problem-list/problem-list.component.css","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/problem-list/problem-list.component.html","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/problem-list/problem-list.component.ts","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/profile/profile.component.css","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/profile/profile.component.html","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/profile/profile.component.ts","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/user-number/user-number.component.css","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/user-number/user-number.component.html","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/user-number/user-number.component.ts","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/pipes/search.pipe.ts","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/services/auth.service.ts","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/services/collaboration.service.ts","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/services/data.service.ts","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/services/search-input.service.ts","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/environments/environment.ts","/home/richard_liu/Projects/Online_Judge/OnlineJudge/src/main.ts"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA,4CAA4C,WAAW;AACvD;AACA;AACA,yF;;;;;;;ACVA;AACA;;;AAGA;AACA;;AAEA;;;AAGA;AACA,2C;;;;;;;ACXA,6E;;;;;;;;;;;;;;;;ACAA,+DAA0C;AAQ1C;IANA;QAOE,UAAK,GA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,EAAE,CAAC,eAAe,CAAC,sBAAS,CAAC;KAChD,KAAK,CAAC,aAAG,IAAI,cAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAhB,CAAgB,CAAC,CAAC","file":"main.bundle.js","sourcesContent":["function webpackEmptyAsyncContext(req) {\n\t// Here Promise.resolve().then() is used instead of new Promise() to prevent\n\t// uncatched exception popping up in devtools\n\treturn Promise.resolve().then(function() {\n\t\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n\t});\n}\nwebpackEmptyAsyncContext.keys = function() { return []; };\nwebpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;\nmodule.exports = webpackEmptyAsyncContext;\nwebpackEmptyAsyncContext.id = \"../../../../../src/$$_lazy_route_resource lazy recursive\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/$$_lazy_route_resource lazy\n// module id = ../../../../../src/$$_lazy_route_resource lazy recursive\n// module chunks = main","exports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/app.component.css\n// module id = ../../../../../src/app/app.component.css\n// module chunks = main","module.exports = \"\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/app.component.html\n// module id = ../../../../../src/app/app.component.html\n// module chunks = main","import { Component } from '@angular/core';\n\n@Component({\n selector: 'app-root',\n templateUrl: './app.component.html',\n styleUrls: ['./app.component.css']\n})\n\nexport class AppComponent {\n title = 'Online Judge';\n}\n\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/app.component.ts","import { BrowserModule } from '@angular/platform-browser';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { HttpClientModule } from '@angular/common/http';\n\nimport { AppComponent } from './app.component';\nimport { ProblemListComponent } from './components/problem-list/problem-list.component';\nimport { DataService } from './services/data.service';\nimport { ProblemDetailComponent } from './components/problem-detail/problem-detail.component';\n\nimport { routing } from './app.routes';\nimport { NewProblemComponent } from './components/new-problem/new-problem.component';\nimport { NavbarComponent } from './components/navbar/navbar.component';\nimport { EditorComponent } from './components/editor/editor.component';\n\nimport { CollaborationService } from './services/collaboration.service';\nimport { UserNumberComponent } from './components/user-number/user-number.component';\nimport { SearchInputService } from './services/search-input.service';\nimport { SearchPipe } from './pipes/search.pipe';\nimport { EditProblemComponent } from './components/edit-problem/edit-problem.component';\nimport { AuthService } from './services/auth.service';\nimport { LoadingComponent } from './components/loading/loading.component';\nimport { ProfileComponent } from './components/profile/profile.component';\n\n@NgModule({\n declarations: [\n AppComponent,\n ProblemListComponent,\n ProblemDetailComponent,\n NewProblemComponent,\n NavbarComponent,\n EditorComponent,\n UserNumberComponent,\n SearchPipe,\n EditProblemComponent,\n LoadingComponent,\n ProfileComponent\n ],\n imports: [\n BrowserModule,\n routing,\n FormsModule,\n ReactiveFormsModule,\n HttpClientModule\n ],\n providers: [\n DataService,\n CollaborationService,\n SearchInputService,\n AuthService\n ],\n bootstrap: [AppComponent]\n})\nexport class AppModule { }\n\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/app.module.ts","import { Routes, RouterModule } from '@angular/router';\n\nimport { ProblemListComponent } from './components/problem-list/problem-list.component';\nimport { ProblemDetailComponent } from './components/problem-detail/problem-detail.component';\nimport { NewProblemComponent } from './components/new-problem/new-problem.component';\nimport { EditProblemComponent } from './components/edit-problem/edit-problem.component';\nimport { LoadingComponent } from './components/loading/loading.component';\nimport { ProfileComponent } from './components/profile/profile.component';\n\nconst routes: Routes = [\n {\n path: '',\n redirectTo: 'problems',\n pathMatch: 'full'\n },\n {\n path: 'loading',\n component: LoadingComponent\n },\n {\n path: 'profile',\n component: ProfileComponent\n },\n {\n path: 'problems',\n component: ProblemListComponent\n },\n {\n path: 'problems/:id',\n component: ProblemDetailComponent\n },\n {\n path: 'newProblem',\n component: NewProblemComponent\n },\n {\n path: 'editProblem/:id',\n component: EditProblemComponent\n },\n {\n path: '**',\n redirectTo: 'problems'\n }\n]\n\nexport const routing = RouterModule.forRoot(routes);\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/app.routes.ts","exports = module.exports = require(\"../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/edit-problem/edit-problem.component.css\n// module id = ../../../../../src/app/components/edit-problem/edit-problem.component.css\n// module chunks = main","module.exports = \"
\\n

Modify a Problem

\\n
\\n
\\n \\n
\\n \\n

{{newProblem.name}}

\\n
\\n\\n
\\n \\n \\n
\\n\\n
\\n \\n \\n
\\n\\n
\\n
\\n \\n
\\n
\\n\\n
\\n
\\n
\\n\\n
\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/edit-problem/edit-problem.component.html\n// module id = ../../../../../src/app/components/edit-problem/edit-problem.component.html\n// module chunks = main","import { Component, OnInit } from '@angular/core';\nimport { ActivatedRoute, Params } from '@angular/router';\n\nimport { Problem } from '../../models/problem.model';\nimport { DataService } from '../../services/data.service';\n\nconst DEFAULT_PROBLEM: Problem = Object.freeze({\n id: 0,\n name: '',\n desc: '',\n difficulty: 'easy'\n})\n\n@Component({\n selector: 'app-edit-problem',\n templateUrl: './edit-problem.component.html',\n styleUrls: ['./edit-problem.component.css']\n})\nexport class EditProblemComponent implements OnInit {\n\n newProblem: Problem = Object.assign({}, DEFAULT_PROBLEM);\n\n difficulties: string[] = ['easy', 'medium', 'hard', 'ultimate'];\n\n constructor(private dataService: DataService, private route: ActivatedRoute) { }\n\n ngOnInit() {\n this.route.params.subscribe(params => {\n this.dataService.getProblem(+params['id'])\n .then(problem => this.newProblem = problem);\n });\n }\n\n editProblem() {\n this.dataService.editProblem(this.newProblem);\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/edit-problem/edit-problem.component.ts","exports = module.exports = require(\"../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"@media screen {\\n #editor {\\n height: 600px;\\n }\\n .lang-select {\\n width: 100px;\\n margin-right: 10px;\\n }\\n header .btn {\\n margin: 0 5px;\\n }\\n footer .btn {\\n margin: 0 5px;\\n }\\n .editor-footer, .editor-header {\\n margin: 10px 0;\\n }\\n .cursor {\\n /*position:absolute;*/\\n background: rgba(0, 250, 0, 0.5);\\n z-index: 40;\\n width: 2px !important;\\n }\\n}\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/editor/editor.component.css\n// module id = ../../../../../src/app/components/editor/editor.component.css\n// module chunks = main","module.exports = \"
\\n
\\n \\n \\n \\n \\n \\n \\n
\\n
\\n
\\n
\\n
Comfirmation
\\n \\n
\\n
\\n The content in the editor will be lost. Are you sure?\\n
\\n
\\n \\n \\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n

User List:

\\n

{{users}}

\\n
\\n
\\n

Execution Result:

\\n

{{result}}

\\n
\\n
\\n
\\n \\n
\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/editor/editor.component.html\n// module id = ../../../../../src/app/components/editor/editor.component.html\n// module chunks = main","import { Component, OnInit } from '@angular/core';\nimport { ActivatedRoute, Params } from '@angular/router';\nimport { Subscription } from 'rxjs/Subscription';\n\nimport { CollaborationService } from '../../services/collaboration.service';\nimport { DataService } from '../../services/data.service'\n\n\ndeclare var ace: any;\n\n@Component({\n selector: 'app-editor',\n templateUrl: './editor.component.html',\n styleUrls: ['./editor.component.css']\n})\nexport class EditorComponent implements OnInit {\n\n editor: any;\n result: string = '';\n\n public languages: string[] = ['Java', 'Python', 'C++'];\n language: string = 'Java';\n sessionId: string;\n\n users: string;\n subscriptionUsers: Subscription;\n\n constructor(private collaboration: CollaborationService,\n private route: ActivatedRoute,\n private dataService: DataService) { }\n\n defaultContent = {\n 'Java':\n`public class Example {\n public static void main(String[] args) {\n // Type your Java code here.\n }\n}`,\n 'Python':\n`class Example:\n def main():\n # Type your Python code here.\n`,\n 'C++':\n`int main() {\n // Type your C++ code here.\n return 0;\n}`\n };\n\n ngOnInit() {\n this.route.params\n .subscribe(params => {\n this.sessionId = params['id'];\n this.initEditor();\n this.collaboration.restoreBuffer();\n });\n }\n\n initEditor(): void {\n this.editor = ace.edit(\"editor\");\n this.editor.setTheme(\"ace/theme/eclipse\");\n this.resetEditor();\n\n // this.collaboration.init(this.editor, this.sessionId);\n this.subscriptionUsers = this.collaboration.init(this.editor, this.sessionId)\n .subscribe(users => this.users = users);\n this.editor.lastAppliedChange = null;\n\n this.editor.on(\"change\", (e) => {\n console.log('editor changes' + JSON.stringify(e));\n if (this.editor.lastAppliedChange != e) {\n this.collaboration.change(JSON.stringify(e));\n }\n }); \n }\n\n resetEditor(): void {\n this.editor.setValue(this.defaultContent[this.language]);\n this.editor.getSession().setMode(\"ace/mode/\" + this.language.toLocaleLowerCase());\n }\n\n setLanguage(language: string): void {\n this.language = language;\n this.resetEditor();\n }\n\n submit(): void {\n let user_code = this.editor.getValue();\n console.log(user_code);\n\n const data = {\n user_code: user_code,\n lang: this.language.toLocaleLowerCase()\n };\n this.dataService.build_and_run(data)\n .then(res => this.result = res);\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/editor/editor.component.ts","exports = module.exports = require(\"../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \".loading {\\n position: absolute;\\n display: -webkit-box;\\n display: -ms-flexbox;\\n display: flex;\\n -webkit-box-pack: center;\\n -ms-flex-pack: center;\\n justify-content: center;\\n height: 100vh;\\n width: 100vw;\\n top: 0;\\n bottom: 0;\\n left: 0;\\n right: 0;\\n background-color: #fff;\\n }\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/loading/loading.component.css\n// module id = ../../../../../src/app/components/loading/loading.component.css\n// module chunks = main","module.exports = \"
\\n \\\"loading\\\"\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/loading/loading.component.html\n// module id = ../../../../../src/app/components/loading/loading.component.html\n// module chunks = main","import { Component, OnInit } from '@angular/core';\n\n@Component({\n selector: 'app-loading',\n templateUrl: './loading.component.html',\n styleUrls: ['./loading.component.css']\n})\nexport class LoadingComponent implements OnInit {\n\n constructor() { }\n\n ngOnInit() {\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/loading/loading.component.ts","exports = module.exports = require(\"../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/navbar/navbar.component.css\n// module id = ../../../../../src/app/components/navbar/navbar.component.css\n// module chunks = main","module.exports = \"\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/navbar/navbar.component.html\n// module id = ../../../../../src/app/components/navbar/navbar.component.html\n// module chunks = main","import { Component, OnInit } from '@angular/core';\nimport { FormControl } from '@angular/forms';\nimport { Subscription } from 'rxjs/Subscription';\nimport { Router } from '@angular/router';\nimport 'rxjs/add/operator/debounceTime';\nimport { SearchInputService } from '../../services/search-input.service';\nimport { AuthService } from '../../services/auth.service';\n\n@Component({\n selector: 'app-navbar',\n templateUrl: './navbar.component.html',\n styleUrls: ['./navbar.component.css']\n})\nexport class NavbarComponent implements OnInit {\n\n searchInput: string = \"\";\n difficultySearch: string = \"\";\n\n searchBox: FormControl = new FormControl();\n subscription: Subscription;\n\n difficulties: string[] = ['easy', 'medium', 'hard', 'ultimate'];\n\n constructor(private inputService: SearchInputService,\n private router: Router,\n public auth: AuthService) {\n auth.handleAuthentication();\n}\n\n ngOnInit() {\n\n console.log(this.auth.isAuthenticated());\n\n this.subscription = this.searchBox\n .valueChanges\n .debounceTime(200)\n .subscribe(term => {\n this.inputService.changeInput(term);\n });\n }\n\n ngOnDestroy() {\n this.subscription.unsubscribe();\n }\n\n searchProblems(): void {\n this.router.navigate(['/problems']);\n }\n\n searchProblems_btn(): void {\n this.inputService.changeInput(this.searchInput);\n this.router.navigate(['/problems']);\n }\n\n difficultyFilter(): void {\n this.inputService.changeInput(this.difficultySearch);\n this.router.navigate(['/problems']);\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/navbar/navbar.component.ts","exports = module.exports = require(\"../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/new-problem/new-problem.component.css\n// module id = ../../../../../src/app/components/new-problem/new-problem.component.css\n// module chunks = main","module.exports = \"
\\n

Add a Problem

\\n
\\n
\\n \\n
\\n \\n \\n
\\n\\n
\\n \\n \\n
\\n\\n
\\n \\n \\n
\\n\\n
\\n
\\n \\n
\\n
\\n\\n
\\n
\\n
\\n\\n
\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/new-problem/new-problem.component.html\n// module id = ../../../../../src/app/components/new-problem/new-problem.component.html\n// module chunks = main","import { Component, OnInit } from '@angular/core';\n\nimport { Problem } from '../../models/problem.model';\nimport { DataService } from '../../services/data.service';\n\nconst DEFAULT_PROBLEM: Problem = Object.freeze({\n id: 0,\n name: '',\n desc: '',\n difficulty: 'easy'\n})\n\n@Component({\n selector: 'app-new-problem',\n templateUrl: './new-problem.component.html',\n styleUrls: ['./new-problem.component.css']\n})\nexport class NewProblemComponent implements OnInit {\n\n newProblem: Problem = Object.assign({}, DEFAULT_PROBLEM);\n difficulties: string[] = ['easy', 'medium', 'hard', 'ultimate'];\n\n constructor(private dataService: DataService) { }\n\n ngOnInit() {\n }\n\n addProblem() {\n this.dataService.addProblem(this.newProblem);\n this.newProblem = Object.assign({}, DEFAULT_PROBLEM);\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/new-problem/new-problem.component.ts","exports = module.exports = require(\"../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/problem-detail/problem-detail.component.css\n// module id = ../../../../../src/app/components/problem-detail/problem-detail.component.css\n// module chunks = main","module.exports = \"
\\n\\n
\\n
\\n

\\n {{problem.id}}. {{problem.name}}\\n

\\n

\\n {{problem.desc}}\\n

\\n
\\n\\n \\n \\n \\n
\\n\\n
\\n \\n
\\n\\n
\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/problem-detail/problem-detail.component.html\n// module id = ../../../../../src/app/components/problem-detail/problem-detail.component.html\n// module chunks = main","import { Component, OnInit } from '@angular/core';\nimport { ActivatedRoute, Params } from '@angular/router';\n\nimport { Problem } from '../../models/problem.model';\nimport { DataService } from '../../services/data.service';\n\n@Component({\n selector: 'app-problem-detail',\n templateUrl: './problem-detail.component.html',\n styleUrls: ['./problem-detail.component.css']\n})\nexport class ProblemDetailComponent implements OnInit {\n \n problem: Problem;\n\n constructor(private dataService: DataService, private route: ActivatedRoute) { }\n\n ngOnInit() {\n this.route.params.subscribe(params => {\n // this.problem = this.dataService.getProblem(+params['id']);\n this.dataService.getProblem(+params['id'])\n .then(problem => this.problem = problem);\n });\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/problem-detail/problem-detail.component.ts","exports = module.exports = require(\"../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \".difficulty {\\n min-width: 65px;\\n margin-right: 10px;\\n}\\n\\n.label.difficulty {\\n padding-top: 0.2em;\\n color: #ffffff;\\n font-size: 13px;\\n}\\n\\n.title {\\n font-size: 1.2em;\\n}\\n\\n.diff-easy {\\n background-color: #00bb48;\\n}\\n\\n.diff-medium {\\n background-color: #ffbb00;\\n}\\n\\n.diff-hard {\\n background-color: #dd0d1e;\\n}\\n\\n.diff-ultimate {\\n background-color: #000000;\\n}\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/problem-list/problem-list.component.css\n// module id = ../../../../../src/app/components/problem-list/problem-list.component.css\n// module chunks = main","module.exports = \"\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/problem-list/problem-list.component.html\n// module id = ../../../../../src/app/components/problem-list/problem-list.component.html\n// module chunks = main","import { Component, OnInit } from '@angular/core';\nimport { Subscription } from 'rxjs/Subscription';\n\nimport { Problem } from '../../models/problem.model';\nimport { DataService } from '../../services/data.service';\nimport { SearchInputService } from '../../services/search-input.service';\n\n@Component({\n selector: 'app-problem-list',\n templateUrl: './problem-list.component.html',\n styleUrls: ['./problem-list.component.css']\n})\n\nexport class ProblemListComponent implements OnInit {\n\n problems: Problem[];\n subscriptionProblems: Subscription;\n\n searchTerm: string = '';\n subscriptionInput: Subscription;\n\n constructor(private dataService: DataService,\n private inputService: SearchInputService) { }\n\n ngOnInit() {\n this.getProblems();\n this.getSearchTerm();\n }\n\n ngOnDestory() {\n this.subscriptionProblems.unsubscribe();\n }\n\n getProblems() {\n this.subscriptionProblems = this.dataService.getProblems()\n .subscribe(problems => this.problems = problems);\n }\n\n getSearchTerm(): void {\n this.subscriptionInput = this.inputService.getInput()\n .subscribe(inputTerm => this.searchTerm = inputTerm);\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/problem-list/problem-list.component.ts","exports = module.exports = require(\"../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \".profile-area img {\\n max-width: 150px;\\n margin-bottom: 20px;\\n}\\n \\n.panel-body h3 {\\n margin-top: 0;\\n}\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/profile/profile.component.css\n// module id = ../../../../../src/app/components/profile/profile.component.css\n// module chunks = main","module.exports = \"
\\n
\\n

Profile

\\n
\\n
\\n \\\"avatar\\\"\\n
\\n \\n

{{ profile?.nickname }}

\\n
\\n
{{ profile | json }}
\\n
\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/profile/profile.component.html\n// module id = ../../../../../src/app/components/profile/profile.component.html\n// module chunks = main","import { Component, OnInit } from '@angular/core';\n\nimport { AuthService } from '../../services/auth.service';\n\n@Component({\n selector: 'app-profile',\n templateUrl: './profile.component.html',\n styleUrls: ['./profile.component.css']\n})\nexport class ProfileComponent implements OnInit {\n\n profile: any;\n\n constructor(public auth: AuthService) { }\n\n ngOnInit() {\n if (this.auth.userProfile) {\n this.profile = this.auth.userProfile;\n } else {\n this.auth.getProfile((err, profile) => {\n this.profile = profile;\n });\n }\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/profile/profile.component.ts","exports = module.exports = require(\"../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"\", \"\"]);\n\n// exports\n\n\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = module.exports.toString();\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/user-number/user-number.component.css\n// module id = ../../../../../src/app/components/user-number/user-number.component.css\n// module chunks = main","module.exports = \"

\\n user-number works!\\n

\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/user-number/user-number.component.html\n// module id = ../../../../../src/app/components/user-number/user-number.component.html\n// module chunks = main","import { Component, OnInit } from '@angular/core';\n\n@Component({\n selector: 'app-user-number',\n templateUrl: './user-number.component.html',\n styleUrls: ['./user-number.component.css']\n})\nexport class UserNumberComponent implements OnInit {\n\n constructor() { }\n\n ngOnInit() {\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/components/user-number/user-number.component.ts","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { Problem } from '../models/problem.model';\n\n@Pipe({\n name: 'search'\n})\nexport class SearchPipe implements PipeTransform {\n\n transform(problems: Problem[], term: string): Problem[] {\n console.log(problems);\n return problems.filter(\n problem => (problem.name.toLowerCase().includes(term))\n || problem.id === +term\n || problem.difficulty === term);\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/pipes/search.pipe.ts","import { Injectable } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { filter } from 'rxjs/operators';\nimport * as auth0 from 'auth0-js';\n\n@Injectable()\nexport class AuthService {\n\n auth0 = new auth0.WebAuth({\n clientID: '5xbog7t8lFRoXryt9ZjhlSFKnxVkIPT5',\n domain: 'auth-yicong.auth0.com',\n responseType: 'token id_token',\n audience: 'https://auth-yicong.auth0.com/userinfo',\n redirectUri: \"http://\" + window.location.hostname + \":3000\" + \"/loading\",\n scope: 'openid profile'\n });\n\n userProfile: any;\n\n constructor(public router: Router) {}\n\n public getProfile(cb): void {\n const accessToken = localStorage.getItem('access_token');\n if (!accessToken) {\n throw new Error('Access Token must exist to fetch profile');\n }\n \n const self = this;\n this.auth0.client.userInfo(accessToken, (err, profile) => {\n if (profile) {\n self.userProfile = profile;\n }\n cb(err, profile);\n });\n }\n\n\n public login(): void {\n this.auth0.authorize();\n }\n\n \n public handleAuthentication(): void {\n console.log(\"calling\");\n this.auth0.parseHash((err, authResult) => {\n console.log(authResult);\n if (authResult && authResult.accessToken && authResult.idToken) {\n this.setSession(authResult);\n this.router.navigate(['/']);\n } else if (err) {\n this.router.navigate(['/']);\n console.log(err);\n alert(`Error: ${err.error}. Check the console for further details.`);\n }\n });\n }\n\n\n private setSession(authResult): void {\n // Set the time that the access token will expire at\n const expiresAt = JSON.stringify((authResult.expiresIn * 1000) + new Date().getTime());\n localStorage.setItem('access_token', authResult.accessToken);\n localStorage.setItem('id_token', authResult.idToken);\n localStorage.setItem('expires_at', expiresAt);\n }\n\n\n public logout(): void {\n // Remove tokens and expiry time from localStorage\n localStorage.removeItem('access_token');\n localStorage.removeItem('id_token');\n localStorage.removeItem('expires_at');\n // Go back to the home route\n this.router.navigate(['/']);\n }\n\n\n public isAuthenticated(): boolean {\n // Check whether the current time is past the\n // access token's expiry time\n const expiresAt = JSON.parse(localStorage.getItem('expires_at'));\n return new Date().getTime() < expiresAt;\n }\n\n}\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/services/auth.service.ts","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs/Rx';\nimport { Subject } from 'rxjs/Subject';\n\ndeclare var io: any;\n\n@Injectable()\nexport class CollaborationService {\n\n collaborationSocket: any;\n private _userSource = new Subject();\n\n constructor() { }\n\n init(editor: any, sessionId: string): Observable {\n this.collaborationSocket = io(window.location.origin, { query: 'sessionId=' + sessionId });\n\n this.collaborationSocket.on(\"change\", (delta: string) => {\n console.log('collaboration: editor changes by' + delta);\n delta = JSON.parse(delta);\n editor.lastAppliedChange = delta;\n editor.getSession().getDocument().applyDeltas([delta]);\n });\n\n this.collaborationSocket.on(\"userChange\", (data: string[]) => {\n console.log('collabration: user changes ' + data);\n this._userSource.next(data.toString());\n });\n\n return this._userSource.asObservable();\n }\n\n change(delta: string): void {\n this.collaborationSocket.emit(\"change\", delta);\n }\n\n restoreBuffer(): void {\n this.collaborationSocket.emit(\"restoreBuffer\");\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/services/collaboration.service.ts","import { Injectable } from '@angular/core';\nimport { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';\nimport { Observable } from 'rxjs/Rx';\nimport { BehaviorSubject } from 'rxjs/BehaviorSubject';\n\nimport { Problem } from '../models/problem.model';\n\n@Injectable()\nexport class DataService {\n\n private _problemSource = new BehaviorSubject([]);\n\n constructor(private httpClient: HttpClient) { }\n\n getProblems(): Observable {\n this.httpClient.get('api/v1/problems')\n .toPromise()\n .then((res: any) => {\n this._problemSource.next(res);\n })\n .catch(this.handleError);\n\n return this._problemSource.asObservable();\n\n // this.httpClient.get('api/v1/problems')\n // .subscribe(\n // res => this._problemSource.next(res),\n // this.handleError\n // );\n \n // return this._problemSource.asObservable(); \n }\n\n getProblem(id: number): Promise {\n return this.httpClient.get(`api/v1/problems/${id}`)\n .toPromise()\n .then((res: any) => res)\n .catch(this.handleError);\n }\n\n addProblem(problem: Problem) {\n const options = { headers: new HttpHeaders({'Connect-Type': 'application/json'}) };\n return this.httpClient.post('api/v1/problems', problem, options)\n .toPromise()\n .then((res: any) => {\n this.getProblems();\n return res;\n })\n .catch(this.handleError);\n }\n\n editProblem(problem: Problem) {\n const options = { headers: new HttpHeaders({'Connect-Type': 'application/json'}) };\n return this.httpClient.post(`api/v1/editProblem/${problem.id}`, problem, options)\n .toPromise()\n .then((res: any) => {\n this.getProblems();\n return res;\n })\n .catch(this.handleError);\n }\n\n build_and_run(data): Promise {\n const options = { headers: new HttpHeaders({'Connect-Type': 'application/json'}) };\n return this.httpClient.post('api/v1/build_and_run', data, options)\n .toPromise()\n .then((res: any) => {\n console.log(res);\n return res;\n })\n .catch(this.handleError);\n }\n\n private handleError(error: any): Promise {\n return Promise.reject(error.body || error);\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/services/data.service.ts","import { Injectable } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs/BehaviorSubject';\nimport { Observable } from 'rxjs/Rx';\n\n@Injectable()\nexport class SearchInputService {\n\n private _inputSubject = new BehaviorSubject('');\n\n constructor() { }\n\n changeInput(term) {\n this._inputSubject.next(term);\n }\n\n getInput(): Observable {\n return this._inputSubject.asObservable();\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/app/services/search-input.service.ts","// The file contents for the current environment will overwrite these during build.\n// The build system defaults to the dev environment which uses `environment.ts`, but if you do\n// `ng build --env=prod` then `environment.prod.ts` will be used instead.\n// The list of which env maps to which file can be found in `.angular-cli.json`.\n\nexport const environment = {\n production: false\n};\n\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/environments/environment.ts","import { enableProdMode } from '@angular/core';\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n\nimport { AppModule } from './app/app.module';\nimport { environment } from './environments/environment';\n\nif (environment.production) {\n enableProdMode();\n}\n\nplatformBrowserDynamic().bootstrapModule(AppModule)\n .catch(err => console.log(err));\n\n\n\n// WEBPACK FOOTER //\n// /home/richard_liu/Projects/Online_Judge/OnlineJudge/src/main.ts"],"sourceRoot":"webpack:///"} --------------------------------------------------------------------------------