├── Observables
├── src
│ ├── assets
│ │ └── .gitkeep
│ ├── app
│ │ ├── app.component.css
│ │ ├── app.component.html
│ │ ├── app.module.ts
│ │ ├── app.component.ts
│ │ └── app.component.spec.ts
│ ├── environments
│ │ ├── environment.prod.ts
│ │ └── environment.ts
│ ├── styles.css
│ ├── favicon.ico
│ ├── typings.d.ts
│ ├── index.html
│ ├── main.ts
│ ├── tsconfig.app.json
│ ├── tsconfig.spec.json
│ ├── test.ts
│ └── polyfills.ts
├── e2e
│ ├── app.po.ts
│ ├── app.e2e-spec.ts
│ └── tsconfig.e2e.json
├── .editorconfig
├── tsconfig.json
├── .gitignore
├── protractor.conf.js
├── README.md
├── .angular-cli.json
├── package.json
├── karma.conf.js
└── tslint.json
├── oj-client
├── src
│ ├── assets
│ │ ├── .gitkeep
│ │ └── colors.ts
│ ├── app
│ │ ├── app.component.css
│ │ ├── components
│ │ │ ├── navbar
│ │ │ │ ├── navbar.component.css
│ │ │ │ ├── navbar.component.spec.ts
│ │ │ │ ├── navbar.component.ts
│ │ │ │ └── navbar.component.html
│ │ │ ├── profile
│ │ │ │ ├── profile.component.css
│ │ │ │ ├── profile.component.ts
│ │ │ │ ├── profile.component.spec.ts
│ │ │ │ └── profile.component.html
│ │ │ ├── editor
│ │ │ │ ├── editor.component.spec.ts
│ │ │ │ ├── editor.component.css
│ │ │ │ ├── editor.component.html
│ │ │ │ └── editor.component.ts
│ │ │ ├── new-problem
│ │ │ │ ├── new-problem.component.css
│ │ │ │ ├── new-problem.component.spec.ts
│ │ │ │ ├── new-problem.component.ts
│ │ │ │ └── new-problem.component.html
│ │ │ ├── problem-detail
│ │ │ │ ├── problem-detail.component.css
│ │ │ │ ├── problem-detail.component.html
│ │ │ │ ├── problem-detail.component.ts
│ │ │ │ └── problem-detail.component.spec.ts
│ │ │ └── problem-list
│ │ │ │ ├── problem-list.component.css
│ │ │ │ ├── problem-list.component.html
│ │ │ │ ├── problem-list.component.spec.ts
│ │ │ │ └── problem-list.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
│ │ │ ├── input.service.spec.ts
│ │ │ ├── auth-guard.service.spec.ts
│ │ │ ├── data.service.spec.ts
│ │ │ ├── collaboration.service.spec.ts
│ │ │ ├── input.service.ts
│ │ │ ├── auth-guard.service.ts
│ │ │ ├── data.service.ts
│ │ │ ├── auth.service.ts
│ │ │ └── collaboration.service.ts
│ │ ├── app.routes.ts
│ │ ├── app.component.spec.ts
│ │ ├── mock-problems.ts
│ │ └── app.module.ts
│ ├── styles.css
│ ├── environments
│ │ ├── environment.prod.ts
│ │ └── environment.ts
│ ├── favicon.ico
│ ├── main.ts
│ ├── tsconfig.json
│ ├── index.html
│ ├── test.ts
│ └── polyfills.ts
├── e2e
│ ├── app.po.ts
│ ├── app.e2e-spec.ts
│ └── tsconfig.json
├── .editorconfig
├── protractor.conf.js
├── README.md
├── karma.conf.js
├── package.json
├── angular-cli.json
└── tslint.json
├── executor
├── requirements.txt
├── executor_utils.pyc
├── Dockerfile
├── executor_server.py
└── executor_utils.py
├── assets
├── sign-in.png
├── managePro.png
├── problem-details.png
└── project-architecture.png
├── oj-server
├── models
│ └── problemModel.js
├── routes
│ ├── index.js
│ └── rest.js
├── package.json
├── modules
│ └── redisClient.js
├── server.js
└── services
│ ├── problemService.js
│ └── SocketService.js
├── launcher.sh
├── README.md
└── LICENSE
/Observables/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/oj-client/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Observables/src/app/app.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Observables/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/oj-client/src/app/app.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/executor/requirements.txt:
--------------------------------------------------------------------------------
1 | docker
2 | Flask
3 |
--------------------------------------------------------------------------------
/oj-client/src/app/components/navbar/navbar.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/oj-client/src/app/components/profile/profile.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/oj-client/src/app/components/editor/editor.component.spec.ts:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/oj-client/src/app/components/new-problem/new-problem.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/oj-client/src/app/components/problem-detail/problem-detail.component.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/sign-in.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sugarac/angular-online-judge/HEAD/assets/sign-in.png
--------------------------------------------------------------------------------
/oj-client/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
8 | {{problem.desc}} 9 |
10 |
12 |
13 | ## Demo
14 | #### Before sign-in
15 | 
16 | #### After authentication
17 | 
18 | #### Code excutor
19 | 
20 |
--------------------------------------------------------------------------------
/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 | module.exports = {
33 | get: get,
34 | set: set,
35 | expire: expire,
36 | quit: quit,
37 | redisPrint: redis.print
38 | }
39 |
--------------------------------------------------------------------------------
/Observables/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 | beforeLaunch: function() {
23 | require('ts-node').register({
24 | project: 'e2e/tsconfig.e2e.json'
25 | });
26 | },
27 | onPrepare() {
28 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
29 | }
30 | };
31 |
--------------------------------------------------------------------------------
/oj-client/src/app/app.routes.ts:
--------------------------------------------------------------------------------
1 | import { Routes, RouterModule } from "@angular/router";
2 | import { ProblemListComponent } from './components/problem-list/problem-list.component';
3 | import { ProblemDetailComponent } from './components/problem-detail/problem-detail.component';
4 | import { ProfileComponent } from './components/profile/profile.component';
5 |
6 |
7 | const routes: Routes = [
8 | {
9 | path: '',
10 | redirectTo: 'problems',
11 | pathMatch: 'full'
12 | },
13 | {
14 | path: 'problems',
15 | component: ProblemListComponent
16 | },
17 | {
18 | path: 'problems/:id',
19 | component: ProblemDetailComponent
20 | },
21 | {
22 | path: 'profile',
23 | canActivate: ['authGuard'],
24 | component: ProfileComponent
25 | }, {
26 | path: '**',
27 | redirectTo: 'problems'
28 | }
29 | ];
30 |
31 | export const routing = RouterModule.forRoot(routes);
32 |
--------------------------------------------------------------------------------
/oj-client/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 | /*global jasmine */
5 | var SpecReporter = require('jasmine-spec-reporter');
6 |
7 | exports.config = {
8 | allScriptsTimeout: 11000,
9 | specs: [
10 | './e2e/**/*.e2e-spec.ts'
11 | ],
12 | capabilities: {
13 | 'browserName': 'chrome'
14 | },
15 | directConnect: true,
16 | baseUrl: 'http://localhost:4200/',
17 | framework: 'jasmine',
18 | jasmineNodeOpts: {
19 | showColors: true,
20 | defaultTimeoutInterval: 30000,
21 | print: function() {}
22 | },
23 | useAllAngular2AppRoots: true,
24 | beforeLaunch: function() {
25 | require('ts-node').register({
26 | project: 'e2e'
27 | });
28 | },
29 | onPrepare: function() {
30 | jasmine.getEnv().addReporter(new SpecReporter());
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/Observables/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 | import { Observable } from 'rxjs/Rx';
3 | import { Subject } from 'rxjs/Rx';
4 | import {Http, Response} from '@angular/http';
5 |
6 | @Component({
7 | selector: 'app-root',
8 | templateUrl: './app.component.html',
9 | styleUrls: ['./app.component.css']
10 | })
11 | export class AppComponent {
12 |
13 | constructor(private http: Http) {}
14 |
15 | ngOnInit() :void {
16 | const source$ = Observable.from(['Adam', 'Bill', 'Cow'])
17 | .map(v => v.toUpperCase())
18 | .map(v => 'I am' + v);
19 | source$.subscribe(
20 | v => console.log(v),
21 | err => console.error(err),
22 | () => console.log('completed')
23 | );
24 |
25 | }
26 |
27 | // getUser(username) {
28 | // return this.http.get('https://api.github.com/users/' + username);
29 | // }
30 |
31 |
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/oj-client/src/app/components/problem-list/problem-list.component.spec.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable:no-unused-variable */
2 | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
3 | import { By } from '@angular/platform-browser';
4 | import { DebugElement } from '@angular/core';
5 |
6 | import { ProblemListComponent } from './problem-list.component';
7 |
8 | describe('ProblemListComponent', () => {
9 | let component: ProblemListComponent;
10 | let fixture: ComponentFixture