kelab / code-runner Goto Github PK
View Code? Open in Web Editor NEW一个判题沙箱;可根据判题数据,判定用户程序的运行结果以及获取用户程序运行时间和内存消耗、可隔离程序网络。
Home Page: https://github.com/Kelab/code-runner/tree/main/docs
License: MIT License
一个判题沙箱;可根据判题数据,判定用户程序的运行结果以及获取用户程序运行时间和内存消耗、可隔离程序网络。
Home Page: https://github.com/Kelab/code-runner/tree/main/docs
License: MIT License
libjudge.so 如何使用
from ctypes import *
handle = cdll.LoadLibrary("./libjudge.so")
func = handle.main
func.restype = c_int
func.argtypes = c_int, POINTER(c_char_p)
# b"./test", b"1000", b"2048", b"1.in", b"1.out", b"1.tmp.out", b"1.log"
args = (c_char_p * 10)(
b"judge",
b"judge",
b"./main",
b"1000",
b"2048",
b"./tests/1/1.in",
b"./tests/1/1.out",
b"1.tmp.out",
b"-l",
b"1.log",
)
tmp = func(len(args), args)
print(tmp)
-g
see: QingdaoU/Judger#43
when user_out_file is not a valid file, the check stage will alert error, but exit code always zero,
2021-02-27 22:38:39 DEBUG src/run.c:187: child process exit normal
2021-02-27 22:38:39 ERROR src/diff.c:31: lseek userout_len failure: Bad file descriptor
2021-02-27 22:38:39 INFO src/judge.c:78: {
"status": 8,
"cpu_time_used": 3,
"cpu_time_used_us": 3368,
"real_time_used": 6,
"real_time_used_us": 5840,
"memory_used": 14628,
"signal": 0,
"exit_code": 0
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.