Code Monkey home page Code Monkey logo

zhblue / hustoj Goto Github PK

View Code? Open in Web Editor NEW

This project forked from svn2github/hustoj

3.2K 3.2K 759.0 66.09 MB

Popular Open Source Online Judge based on PHP/C++/MySQL/Linux for ACM/ICPC and NOIP training, with easy installation. 开源OJ系统

Home Page: http://www.hustoj.com/?cat=2

License: GNU General Public License v2.0

C++ 0.81% Makefile 0.08% C 0.94% Shell 1.08% HTML 0.09% PHP 18.17% CSS 5.21% JavaScript 72.17% Lex 0.20% Roff 0.10% PLSQL 0.02% TeX 0.10% Dockerfile 0.08% Hack 0.02% Less 0.46% SCSS 0.46%
acm-icpc c cpp java judge mysql noip oj online online-judge onlinejudge php

hustoj's People

Contributors

andy-qinyuhai avatar baymin-ty avatar cattail avatar cndrip avatar geekxiong avatar gzz2000 avatar jizhuozhi avatar kevin50406418 avatar lanzhou2333 avatar lets-bee avatar mastojun avatar maticsl avatar melongist avatar mjiuming avatar muzea avatar mx-qulin avatar q1angch0u avatar renbaoshuo avatar ryanlee2014 avatar shiningrise avatar slixurd avatar syudal avatar tabbbbbb avatar tiang-88 avatar undefined-moe avatar wesley-chen-cn avatar xia0ji233 avatar yemaster avatar yyqhoro avatar zhblue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hustoj's Issues

界面太丑

本人的建议仅供参考,不对其做任何保证.

  个人认为,这个OJ实在是……太丑了
  毕竟,一个好看的OJ能够有效提高做题者的刷题愿望,同时还可以增加页面访问量(不对此保证)。又有谁愿意看到一个不好看的网页呢?
  其实,只要改一改CSS,就能将其扁平化,可以让它变得更好看。
  以上是我的一点建议,希望采纳!

okcalls.h问题

在okcall.h的第108,109行,
SYS_execve的限制变成了HOJ_MAX_LIMIT
如果有一个.c文件有一行这样的内容
execl("./Main",(char *)NULL);
是不是会出问题?

poj数据导入出错

poj的数据库导入的时候用poj2hustoj.sql有几个地方error,导致无法查看提交的源码,也无法提交测评

Nginx + hustoj

網上查了很多關於 Nginx 搭配 hustoj 的文章,但幾乎沒提到細節,這邊想問下老師如果要用 LNMP 架構,可能需要注意什麼嗎?

编译错误

~/hustoj/hustoj-read-only/core/judge_client $ g++ -Wall -c -I/usr/local/mysql/include/mysql -I/usr/include/mysql judge_client.cc
In file included from okcalls.h:24:0,
from judge_client.cc:49:
okcalls64.h:20:65: error: ‘SYS_time’ was not declared in this scope
int LANG_CV[256] = {0,1,2,5,9,11,12,21,59,63,89,158,231,240, 8, SYS_time, SYS_read, SYS_uname, SYS_write, SYS_open,
^
okcalls64.h:22:3: error: ‘SYS_mmap’ was not declared in this scope
SYS_mmap, SYS_fstat, SYS_set_thread_area, 252, SYS_arch_prctl, 231, 0 };
^
okcalls64.h:22:24: error: ‘SYS_set_thread_area’ was not declared in this scope
SYS_mmap, SYS_fstat, SYS_set_thread_area, 252, SYS_arch_prctl, 231, 0 };
^
okcalls64.h:22:50: error: ‘SYS_arch_prctl’ was not declared in this scope
SYS_mmap, SYS_fstat, SYS_set_thread_area, 252, SYS_arch_prctl, 231, 0 };
^
okcalls64.h:24:56: error: ‘SYS_set_thread_area’ was not declared in this scope
int LANG_PV[256] = {0,9,1,13,16,59,89,97,231,SYS_open, SYS_set_thread_area, SYS_brk, SYS_read,
^
okcalls64.h:25:62: error: ‘SYS_mmap’ was not declared in this scope
SYS_uname, SYS_write, SYS_execve, SYS_ioctl, SYS_readlink, SYS_mmap,
^
okcalls64.h:26:21: error: ‘SYS_getrlimit’ was not declared in this scope
SYS_rt_sigaction, SYS_getrlimit, 252, 191, 158, 231, SYS_close,
^
okcalls64.h:27:31: error: ‘SYS_time’ was not declared in this scope
SYS_exit_group, SYS_munmap, SYS_time, 4, 0 };
^
okcalls64.h:31:19: error: ‘SYS_getrlimit’ was not declared in this scope
SYS_getdents64, SYS_getrlimit, SYS_rt_sigprocmask, SYS_futex, SYS_read,
^
okcalls64.h:32:3: error: ‘SYS_mmap’ was not declared in this scope
SYS_mmap, SYS_stat, SYS_open, SYS_close, SYS_execve, SYS_access,
^
okcalls64.h:34:46: error: ‘SYS_getrlimit’ was not declared in this scope
SYS_uname, SYS_mprotect, SYS_rt_sigaction, SYS_getrlimit, SYS_fstat,
^
okcalls64.h:35:53: error: ‘SYS_set_thread_area’ was not declared in this scope
SYS_getuid, SYS_getgid, SYS_geteuid, SYS_getegid, SYS_set_thread_area,
^
okcalls64.h:39:33: error: ‘SYS_arch_prctl’ was not declared in this scope
,96, 340, 4, 126, SYS_access, SYS_arch_prctl, SYS_brk,
^
okcalls64.h:41:53: error: ‘SYS_getrlimit’ was not declared in this scope
SYS_getegid, SYS_geteuid, SYS_getgid, SYS_getuid, SYS_getrlimit,
^
okcalls64.h:42:3: error: ‘SYS_mmap’ was not declared in this scope
SYS_mmap, SYS_mprotect, SYS_munmap, SYS_open, SYS_read,
^
okcalls64.h:48:20: error: ‘SYS_arch_prctl’ was not declared in this scope
183, SYS_access, SYS_arch_prctl, SYS_brk, SYS_close, SYS_dup2,
^
okcalls64.h:51:3: error: ‘SYS_getrlimit’ was not declared in this scope
SYS_getrlimit, SYS_getuid, SYS_ioctl, SYS_lseek, SYS_mmap, SYS_mprotect,
^
okcalls64.h:51:52: error: ‘SYS_mmap’ was not declared in this scope
SYS_getrlimit, SYS_getuid, SYS_ioctl, SYS_lseek, SYS_mmap, SYS_mprotect,
^
okcalls64.h:57:15: error: ‘SYS_arch_prctl’ was not declared in this scope
SYS_access, SYS_arch_prctl, SYS_brk, SYS_close, SYS_execve,
^
okcalls64.h:59:55: error: ‘SYS_getrlimit’ was not declared in this scope
SYS_getdents, SYS_getegid, SYS_geteuid, SYS_getgid, SYS_getrlimit,
^
okcalls64.h:60:48: error: ‘SYS_mmap’ was not declared in this scope
SYS_getuid, SYS_ioctl, SYS_lseek, SYS_lstat, SYS_mmap, SYS_mprotect,
^
okcalls64.h:68:53: error: ‘SYS_getrlimit’ was not declared in this scope
SYS_fstat, SYS_futex, SYS_getcwd, SYS_getdents64, SYS_getrlimit,
^
okcalls64.h:69:54: error: ‘SYS_mmap’ was not declared in this scope
SYS_gettimeofday, SYS_ioctl, SYS_lseek, SYS_lstat, SYS_mmap,
^
okcalls64.h:72:3: error: ‘SYS_set_thread_area’ was not declared in this scope
SYS_set_thread_area, SYS_set_tid_address, SYS_stat, SYS_time, SYS_uname,
^
okcalls64.h:72:55: error: ‘SYS_time’ was not declared in this scope
SYS_set_thread_area, SYS_set_tid_address, SYS_stat, SYS_time, SYS_uname,
^
okcalls64.h:78:41: error: ‘SYS_getrlimit’ was not declared in this scope
SYS_getegid, SYS_geteuid, SYS_getgid, SYS_getrlimit, SYS_getuid,
^
okcalls64.h:79:25: error: ‘SYS_mmap’ was not declared in this scope
SYS_ioctl, SYS_lseek, SYS_mmap, SYS_mprotect, SYS_munmap, SYS_open,
^
okcalls64.h:81:24: error: ‘SYS_set_thread_area’ was not declared in this scope
SYS_set_robust_list, SYS_set_thread_area, SYS_set_tid_address, SYS_stat,
^
okcalls64.h:82:3: error: ‘SYS_time’ was not declared in this scope
SYS_time, SYS_uname, SYS_write, 0 };
^
okcalls64.h:90:55: error: ‘SYS_getrlimit’ was not declared in this scope
SYS_getdents, SYS_geteuid, SYS_getpid, SYS_getppid, SYS_getrlimit,
^
okcalls64.h:91:66: error: ‘SYS_mmap’ was not declared in this scope
SYS_gettimeofday, SYS_getuid, SYS_ioctl, SYS_lseek, SYS_lstat, SYS_mmap,
^
okcalls64.h:96:3: error: ‘SYS_set_thread_area’ was not declared in this scope
SYS_set_thread_area, SYS_set_tid_address, SYS_sigaltstack, SYS_stat,
^
okcalls64.h:97:27: error: ‘SYS_time’ was not declared in this scope
SYS_statfs, SYS_tgkill, SYS_time, SYS_uname, SYS_unlink, SYS_write, 0 };
^
okcalls64.h:101:3: error: ‘SYS_getrlimit’ was not declared in this scope
SYS_getrlimit, SYS_gettimeofday, SYS_mmap, SYS_mprotect, SYS_munmap,
^
okcalls64.h:101:36: error: ‘SYS_mmap’ was not declared in this scope
SYS_getrlimit, SYS_gettimeofday, SYS_mmap, SYS_mprotect, SYS_munmap,
^
okcalls64.h:103:24: error: ‘SYS_set_thread_area’ was not declared in this scope
SYS_set_robust_list, SYS_set_thread_area, SYS_set_tid_address,
^
okcalls64.h:109:53: error: ‘SYS_getrlimit’ was not declared in this scope
SYS_execve, SYS_exit_group, SYS_fstat, SYS_futex, SYS_getrlimit,
^
okcalls64.h:110:14: error: ‘SYS_ioperm’ was not declared in this scope
SYS_ioctl, SYS_ioperm, SYS_mmap, SYS_open, SYS_read, SYS_rt_sigaction,
^
okcalls64.h:110:26: error: ‘SYS_mmap’ was not declared in this scope
SYS_ioctl, SYS_ioperm, SYS_mmap, SYS_open, SYS_read, SYS_rt_sigaction,
^
okcalls64.h:111:44: error: ‘SYS_set_thread_area’ was not declared in this scope
SYS_rt_sigprocmask, SYS_set_robust_list, SYS_set_thread_area,
^
okcalls64.h:115:30: error: ‘SYS_getrlimit’ was not declared in this scope
SYS_fcntl, SYS_getdents64, SYS_getrlimit, SYS_rt_sigprocmask, SYS_futex,
^
okcalls64.h:116:13: error: ‘SYS_mmap’ was not declared in this scope
SYS_read, SYS_mmap, SYS_stat, SYS_open, SYS_close, SYS_execve,
^
okcalls64.h:118:57: error: ‘SYS_getrlimit’ was not declared in this scope
SYS_clone, SYS_uname, SYS_mprotect, SYS_rt_sigaction, SYS_getrlimit,
^
okcalls64.h:120:3: error: ‘SYS_set_thread_area’ was not declared in this scope
SYS_set_thread_area, SYS_set_tid_address, SYS_set_robust_list,
^
judge_client.cc: In function ‘void watch_solution(pid_t, char_, int&, int, char_, char_, int, int, int&, int, int&, int, int&, int&, char_)’:
judge_client.cc:1780:26: error: aggregate ‘watch_solution(pid_t, char_, int&, int, char_, char_, int, int, int&, int, int&, int, int&, int&, char_)::user_regs_struct reg’ has incomplete type and cannot be defined
struct user_regs_struct reg;
^

ubuntu16.04

系统升级到16.04后不正常,已经将php7改成了php5.6, 但只要加了题目在problemset.php试题列表页面就出错,请问要修改哪些地方?

使用申请。

我们有一个项目,其中有一部分会用到hustoj,并会修改hustoj一部分代码,所以在这里咨询一下作者,是否允许复制修改源码,由于本人对GPL协议还不是很了解,所以想请问一下应该如何声明。
因为作者的项目中并没有看到LICENSE、COPYRIGHT之类的文件,所以声明使用的话是在README里注明一下吗?

对data_list的建议

一、对于judge_client.cc Line 93: static char data_list[BUFFER_SIZE][BUFFER_SIZE];,建议使用std::vector,既可避免测试数据过多产生无法复制的问题,又可动态调整空间,节约内存。
二、对于judge_client.cc Line 2283: if(http_judge&&(!data_list_has(dirp->d_name))) continue;,建议直接调用execute_cmd("rm -f ...");把它删除,避免浪费空间,也避免浪费时间——那个文件在每次评测时都被扫描一次。

测试数据更新问题?

在admin页面里面并没有找到可以修改测试数据的地方,直接在/home/judge/data里改,提交的时候发现还是之前的测试数据。

一点建议

非常喜欢HUSTOJ,也非常感谢。
现在自己正写WEB前端,实现自己的一些功能。

有一点建议就是,FPS导入题目的时候,题目很多,并且全部都是 Reserved,是不是可以添加 批量编辑的功能,比如批量审核、批量删除等等

对首页导航栏的建议

不知道该不该在这里反馈?
环境:ubuntu14.04 chrome 版本 51.0.2704.106 (64-bit)
acm.hust.edu.cn中,首页经过缩放展开后
登陆注册那一块从右边贴合到了左边
解决方案是把导航栏class属性中的"pull-right" 改成"navbar-right"

评测系统卡读入

#include <cstdio> int main() { while (1) getchar(); }
我们拿这段代码来提交A+B Problem,时限1秒。
在评测时,到终端输入top查看进程。
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
6364 root 20 0 101560 2428 1844 S 29.3 0.0 0:02.54 judge_client
6385 judge 39 19 1080 4 0 t 2.0 0.0 0:00.19 Main
此时Main进程消耗CPU%异常低,judge_client的CPU%异常高,这也说明了为什么这段小小的代码评测这么久。
此时的Main进程已经读到EOF了还在不停地读,降低了CPU%。
最终出来的结果是:
problem_id=1000 result=Time Limit Exceed memory=1080 KB time=324 ms code_length=62 B
注意加粗的324ms,这是由于评测时间过长,judge_client强行终止进程,可是该程序并没有跑满1秒。在这样的情况下终止进程显然有失公平性。
希望您能告知我如何解决卡读入的问题,谢谢!

Why hardcoded timezone?

https://github.com/zhblue/hustoj/blob/master/trunk/web/include/db_info.inc.php#L76

The comment mentions about 'synchronization', but the chance of disaster from desynchronization is low since they are likely to follow system default timezone.
Or at least it should respect settings from php and mysql. (e.g. default-time-zone='timezone' in my.cnf or date.timezone in php.ini)

I dig into that line, trying to locate the bug that submission time didn't follow the server time. It was very frustrating 😭

判题端重定向与数据流截取

xx

判题端用linux下的重定向感觉稳定一点,原版采用截取输出流在有些服务器上会出现问题,不知道你是什么看法。

关于运行时选择Clang的问题

我用Language:Clang/Clang++运行时出现了无限等待的情况。

qq 20170125130653

这种情况是什么设置出了问题呢?Clang/Clang++已经安装了。
操作系统是Ubuntu 14.04 x86_64

【大力支持】

我是开源主义者,感谢 HUSTOJ,最近在研究源码,我会奉上自己的意见的。

发现bug

添加完新闻,数据库没有数据,前后台没有显示。添加题目,前台不显示,后台显示,已切换为可利用状态,搜索题号可以搜索到,数据库有数据

附加代码模式疑问求解

参考:http://code.liumengxiao.cn/problem.php?cid=1005&pid=0

//prepend.c
#include <stdio.h>
 
//template.c
//只需要提交函数部分代码即可。

// append.c
int main()
{
    int num1, num2, max;
    scanf("%d%d", &num1, &num2);
    max = GetMax(num1, num2);
    printf("MAX=%d\n", max);
    return 0;
}

只提交GetMax函数会提示找不到main函数,为什么呢?

测试账号:Test
密码:test123456

在problem list找不到问题

已经把Reserved转成Available了,但是不管是admin还是普通用户都在problem list看不见问题,只能透过搜寻找到。

还有什么设定吗?

OJ竞赛时排名为星号

以前没出过问题,但这个同学的提交就是不计入总排名,不知道是不是和nick中的*有关

2016-05-18 at 22 07

请教okcalls.h文件里参数设置的含义

这个文件是用来限制特定语言的系统调用的吗?我现在想在这个项目基础上完成对汇编语言的评测,可是怎么确定它在okcalls.h文件里有哪些参数呢?希望您能指点一下,我需要去做哪些知识储备?自己尝试了修改judge_client.cc文件,感觉不是修改几个位置参数那么简单。

关于php7.0分支中install-interactive.sh脚本apt包缺失问题

首先,感谢您的代码!
我刚刚尝试在云服务器上部署您的项目,发现在ubuntu16.04环境下并不能成功完成一键安装。
根据log返回的结果,我成功解决了问题,特此反馈给您,希望能做一些微小的工作,协助您完善这个项目。
问题的根源在于所依赖的libmysqlclient-dev和flex两个包的缺失。
在sh脚本中加入这两个包的apt install命令即可解决。
再次向您致敬!

判题机一直卡在编译中

系统是CentOS 7
用之前AC的代码做测试,全部都卡在编译中,检查log发现显示compile error,在judge_client测试过程发现提示段错误,这应该怎么解决呢?
qq 20170310192139
qq 20170310192225
qq 20170310192201

某些情况下可能出现libapache2-mod-php未安装导致php页面不解析的问题

可能这个问题难以复现,我是在docker ubuntu:16.04下操作的,安装过程还算顺利,但是发现php页面不能解析。装上libapache2-mod-php解决这一问题:

# apt install libapache2-mod-php 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libapache2-mod-php7.0
The following NEW packages will be installed:
  libapache2-mod-php libapache2-mod-php7.0

因此建议在install-interactive.sh中添加该包的安装。

从poj导入后的一些问题

1、图片无法显示
2、poj里学生的做题代码导入后没有记录

3、不知道如何开启答题部分分功能

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.