Online Judge??????????????

ACSolo  发布于6年前 3785 阅读 评论(5)

????

Online Judge???????OJ????B/S?????????????????????????C?C++?Java??????????????????????????????????????????? ?????Online Judge????????????????????????????????????????????????????????

????:

  1. Online Judge????????????????????????????????????????????
  2. Online Judge??Virtual Judge?http://acm.hdu.edu.cn ?
  3. Online Judge Kernel???????????????????????????????????????
  4. ??ACM?OI?????????????judge mode acm(oi)????????ACM???????ACM?CodeJam?????
  5. Online Judge Kernel????Telnet????????????
  6. Online Judge Kernel??API Hook?????

?????

  1. judger-kernel?OJ????????C??
  2. judger-web-platform?OJ?Web????java??
  3. judger_sql?OJ??????

????

????

  1. ?????Windows XP/7/8/8.1/10? Windows Server 2003/2008/2012

  2. JAVA JDK?Java JDK1.6????
    OJ???JDK???????????????????D:\Java\jdk1.6.0_10???
    ?????????

    JAVA_HOME=D:\Java\jdk1.6.0_10
    path=%JAVA_HOME%\bin
  1. Web???Apache Tomcat 6(??)??????D:\tomcat6

  2. ????MySQL 5.1.55(??)
    ?????GBK????????3306??????root???rootpwd
    ????gdoj??????????online-judge\judger_sql????sql_import_struct.bat????gdoj_struct.sql

  3. ?????GCC?JAVA?PASCAL?Python?Ruby?????????
    ???online-judge/judger_compiler????env.bat????GCC?JAVA?PASCAL,??????JAVA_HOME?????: 

     set JAVA_HOME=D:\Java\jdk1.6.0_10      setx JAVA_HOME "D:\Java\jdk1.6.0_10" /m

????

  • ????D:\tomcat6\webapps\ROOT???????????judger-web-platform/gdoj/WebRoot???????ROOT? ????????
  • ??????D:\tomcat6\webapps\ROOT\WEB-INF\classes\config.properties
OJ_WEB=D\:\\tomcat6\\webapps\\ROOT\\   
OJ_PATH=D\:\\OJ\\ OJ_DATA_PATH=D\:\\OJ\\data\\ OJ_JUDGE_LOG=D\:\\OJ\\OJ_JUDGE_LOG\\ OJ_LANG_PATH=D\:\\OJ\\conf\\Language.xml
OJ_JUDGER_IP=127.0.0.1   ------> ????????WEB?OJ-Kernel???IP
OJ_JUDGER_PORT=5000      ------> ????????WEB?OJ-Kernel??????????OJ-Kernel?????
  • ??D:\tomcat6\webapps\ROOT\WEB-INF\classes\applicationContext.xml?mysql??????
<property name="username" value="root"></property>
<property name="password" value="rootpwd"></property>

??????

  • ????D:\OJ????judger-kernel/build/bin32?OJ????????????

  • ???OJ??????D:\OJ\conf\config.ini

[System] sock_port=5000  -----> ????Socket????????????config.properties???? 
  • ??judge.exe????????
???????????display current-configuration??????
=====================================================OS Main-task Running...Command Task init ok...Command Task RegistAppInfo ok...Debug-Center Task RegistAppInfo ok...TELNET Task init ok...TELNET Task RegistAppInfo ok...Connect MySQL(localhost, root, rootpwd, gdoj, 3306) ok...Judge Task init ok...Judge Task RegistAppInfo ok...NDP Task init ok...NDP Task RegistAppInfo ok...Command Task running ok...Debug-Center Task running ok...TELNET Task running ok...Judge Task running ok...NDP Task running ok...OS Main-task init ok...Socket bind port 5000 ok...Socket listen ok...Recover configuration begin.Info: system name change to judger successful.TELNET server socket bind port 23 ok...TELNET server socket listen port 23 ok...Info: Please reboot to take effect.Eecover configuration end.Press any key to continue.

judger>
judger>display current-configuration#version V100R001C00B090 sysname judger
#
telnet server enable
#
aaa
 local-user admin password Root@123 #
mysql url localhost port 3306 username root password rootpwd table gdoj
#
#
judge-mgr
 mode oi
 testcase-path D:\OJ\data\
#
virtual-judge-mgr
 hdu-judge username weizengke password weizengke
 hdu-judge ip 127.0.0.1 port 5000 #
return
#
judger>

????

?????

?????????????????????????????????

  • ????????
    ??????????????????????????????????????????????????????????????????????????????
#???dis us?????display users?????????????????Judge-Kernel]dis us    #   Type     Delay        Network Address   Socket  Username  ---------------------------------------------------------------------  + 0   Console  00:00:00     127.0.0.1         -       -    1   Telnet   00:25:42     127.0.0.1         588Judge-Kernel]display users    #   Type     Delay        Network Address   Socket  Username  ---------------------------------------------------------------------  + 0   Console  00:00:00     127.0.0.1         -       -    1   Telnet   00:25:45     127.0.0.1         588Judge-Kernel]
  • Tab????????
    ????????????Tab?????????????
    ??TAB????????????????TAB?????????????
Judge-Kernel>display us  
#??????TAB                          
Judge-Kernel>display users 
  • ???????
    ????????????????????????????????????
    ??????????????????????????????????
Judge-Kernel>?
 debugging                Debugging switch
 display                  Display
 quit                     Quit from the current system view  return                   Return to the user view  system-view              Enter the system view  terminal                 Terminal
 undo                     Undo operation
Judge-Kernel>dis?
 display                  Display
Judge-Kernel>dis
Judge-Kernel>display ?
 command-tree             Command tree
 current-configuration    Current Configuration
 debugging                Debugging switch
 history                  Histrory command  judge                    Judge of OJ
 ndp                      NDP
 save-configuration       Save-configuration
 users                    Users
 <cr>
Judge-Kernel>display us?
 users                    Users
Judge-Kernel>display us
Judge-Kernel>display users ?
 <cr>
Judge-Kernel>                                                                                                       
  • ???????
  1. ????
    ???????????????????????????
Judge-kernel>

????????????????????????????

  1. ????
    ???????????system-view???????????
    ????????????????????????????????????
Judge-Kernel>system-view  
Judge-Kernel]           
Judge-Kernel]?
 aaa                      Authentication Authorization Accounting
 diagnose-view            Enter the daignose view  display                  Display
 hdu-judge                HDU-Judge
 judge                    Judge of OJ
 mysql                    Mysql
 ndp                      NDP
 quit                     Quit from the current system view  reboot                   Reboot Judge kernel
 return                   Return to the user view  save                     Save configuration
 sysname                  Set system name
 telnet                   Telnet Protocol
 undo                     Undo operation
 virtual-judge            Virtual judge
Judge-Kernel]
  1. ????
    ???????????diagnose-view???????????
    ???????????????????????????????????????????
Judge-Kernel]diagnose-view                                                       
Judge-Kernel-diagnose]  
Judge-Kernel-diagnose]?                                       
 display                  Display                            
 quit                     Quit from the current system view    
 return                   Return to the user view                     
 set                      Set value                         
 version                  Show version of solfware             
Judge-Kernel-diagnose]     
  1. ????
    ????quit??????????????????????
    ?????return????????????
#??quit???????? Judge-Kernel-diagnose]quit
Judge-Kernel]#????return??????? Judge-Kernel-diagnose]return Judge-Kernel>

Judger????

  • judge enable
    1???????
    judge enable ??????judge??
    undo judge enable ???????judge??
    ??????judge????????
    2????
    ????
    3?????
#??judge?? Judge-Kernel>system-view Judge-Kernel]judge enable 
#???judge?? Judge-Kernel>system-view Judge-Kernel]undo judge enable 
  • judge-mgr
    1???????
    judge-mgr ??????judge-mgr?????????judger????
    2????
    ????
    3?????
#??judge-mgr?? judger>system-view
judger]judge-mgr
judger-judge-mgr]
  • mode
    1???????
    mode acm ??????judger?acm??
    mode oi ??????judger?oi??
    ??????judger??acm??
    2????
    judge-mgr??
    3?????
#??judger?acm?? judger>system-view
judger]judge-mgr
judger-judge-mgr]
judger-judge-mgr]mode acm
#??judger?oi?? judger>system-view
judger]judge-mgr
judger-judge-mgr]
judger-judge-mgr]mode oi
  • security enable
    ?????API HOOK?????OJ????????????????????????
    1???????
    security enable ???????????API HOOK?
    undo security enable ????????????API HOOK?
    ??????judger?????API HOOK?????
    ???????????????????????????????????????????????????? 2????
    judge-mgr??
    3?????
#???????API HOOK? judger>system-view
judger]judge-mgr
judger-judge-mgr]
judger-judge-mgr]security enable 
#????????API HOOK? judger>system-view
judger]judge-mgr
judger-judge-mgr]
judger-judge-mgr]undo security enable
judger-judge-mgr]display this # judge-mgr
 undo security enable
 testcase-path D:\OJ\data\# return # judger-judge-mgr]
  • auto-detect enable
    ??????????????????????????????????????????????
    1???????
    auto-detect enable ??????????
    undo auto-detect enable ???????????
    ??????judger?????????
    2????
    judge-mgr??
    3?????
#?????? judger>system-view
judger]judge-mgr
judger-judge-mgr]
judger-judge-mgr]auto-detect enable 
  • testcase-path
    1???????
    testcase-path STRING<1-256> ??????judger???????
    2????
    judge-mgr??
    3?????
#??judger????????D:\OJ\data\ judger>system-view
judger]judge-mgr
judger-judge-mgr]
judger-judge-mgr]testcase-path D:\OJ\data\
judger-judge-mgr]display this # judge-mgr
 testcase-path D:\OJ\data\# return # judger-judge-mgr]

Virtual Judge??

  • virtual-judge enable
    ?????hdu??????
    1???????
    virtual-judge enable ????????????
    undo virtual-judge enable ?????????????
    ???????????????????
    2????
    ????
    3?????
#???????? Judge-Kernel>system-view Judge-Kernel]virtual-judge enable 
#????????? Judge-Kernel>system-view Judge-Kernel]undo virtual-judge enable 
  • hdu-judge enable
    1???????
    hdu-judge enable ??????HDU??????
    undo hdu-judge enable ???????HDU??????
    ??????HDU?????????????
    2????
    ????
    3?????
#??HDU?????? Judge-Kernel>system-view Judge-Kernel]hdu-judge enable 
#???HDU?????? Judge-Kernel>system-view Judge-Kernel]undo hdu-judge enable 
  • virtual-judge-mgr
    1???????
    virtual-judge-mgr ??????virtual-judge-mgr???????virtual judger????
    2????
    ????
    3?????
#??virtual-judge-mgr?? judger>system-view
judger]virtual-judge-mgr
judger-vjudge-mgr]
  • hdu-judge username password
    1???????
    hdu-judge username STRING<1-24> password STRING<1-24> ??????HDU???????HDU??????
    2????
    virtual-judge-mgr??
    3?????
#??HDU?????HDU??????????root/root@123 judger>system-view
judger]virtual-judge-mgr
judger-vjudge-mgr]hdu-judge username root password root@123 
  • hdu-judge remote-judge enable
    ??HDU????????????HDU???????????????OJ????????? 1???????
    hdu-judge remote-judge enable ??????HDU??????????
    undo hdu-judge remote-judge enable ???????HDU??????????
    ??????HDU??????????????????
    ?????????OJ????IP????? hdu-judge ip STRING<1-24> port INTEGER<1-65535> ??
    2????
    virtual-judge-mgr??
    3?????
#??HDU?????????? judger>system-view
judger]virtual-judge-mgr
judger-vjudge-mgr]hdu-judge remote-judge enable 
#???HDU?????????? judger>system-view
judger]virtual-judge-mgr
judger-vjudge-mgr]undo hdu-judge remote-judge enable 
  • hdu-judge ip port
    1???????
    hdu-judge ip STRING<1-24> port INTEGER<1-65535> ????????OJ????IP????
    2????
    virtual-judge-mgr??
    3?????
#???????hdu-judger?OJ???IP???? judger>system-view
judger]virtual-judge-mgr
judger-vjudge-mgr]hdu-judge ip 192.168.1.2 port 5001 

Telnet??

  • telnet server enable
    ??Telnet???????????telnet???????????
    1???????
    telnet server enable ??????Telnet???
    undo telnet server enable ???????Telnet???
    ??????Telnet??????????
    2????
    ????
    3?????
#??Telnet??? Judge-Kernel>system-view Judge-Kernel]telnet server enable 
#???Telnet??? Judge-Kernel>system-view Judge-Kernel]undo telnet server enable 
  • telnet authentication-mode
    1???????
    telnet authentication-mode none ??????Telnet??????????????telnet??????????????
    telnet authentication-mode password ??????Telnet???????????????telnet?????????????
    telnet authentication-mode password ??????Telnet?????????AAA????telnet???????AAA??????
    ??????Telnet????????????
    Telnet????????????????????
    2????
    ????
    3?????
#??Telnet???????????? Judge-Kernel>system-view 
Judge-Kernel]telnet authentication-mode none 
#??Telnet?????????????????telnet????? Judge-Kernel>system-view Judge-Kernel]telnet authentication-mode password Info: Please create telnet username and password.Judge-Kernel]Judge-Kernel]telnet username admin password admin@123 
#??Telnet?????????AAA????????aaa?? Judge-Kernel>system-view Judge-Kernel]telnet authentication-mode aaaInfo: Please create AAA username and password.                                                                                      Judge-Kernel]Judge-Kernel]aaaJudge-Kernel-aaa]local-user root password Root@123 

Mysql??

  • mysql url
    1???????
    mysql url STRING<1-256> port INTEGER<1-65535> username STRING<1-24> password STRING<1-24> table STRING<1-24> 
    ??????mysql????????????????????????????
    ?????????mysql url localhost port 3306 username root password rootpwd table gdoj?
    2????
    ????
    3?????
#??Telnet??? Judge-Kernel>system-view Judge-Kernel]mysql url localhost port 3306 username root password rootpwd table gdoj

??????

  • display judge brief
    1???????
    display judge brief ????????judger??????
    2????
    NA
    3?????
#????judger?????
Judge-Kernel>display judge brief
# Local Judger Info
  Global Judge Is Enable
  Sysname   : Judge-Kernel
  Sock Port : 5000   Judge Mode: ACM
  Data Path : D:\OJ\data\
  Last Judge: 1970-01-01 08:00:00  ==========================================================================
# Virtual Judger Info
  Global Virtual Judge Is Enable
  HDU domain: http://acm.hdu.edu.cn   Judger | Account | Password | Status | Remote |   Judger-IP   | J-Port
  -------------------------------------------------------------------------
  HDU     weizengke  weizengke  Enable   Disable  192.168.1.2     5001  ==========================================================================
# MySQL Info
  URL       : localhost
  Username  : root
  Password  : rootpwd
  Table-Name: gdoj
  Port      : 3306  ==========================================================================
Judge-Kernel>
  • sysname
    1???????
    **sysname STRING<1-24> ** ?????????????24???
    2????
    ????
    3?????
#???????judger Judge-Kernel>system-view 
Judge-Kernel]sysname judger                                        
Info: system name change to judger successful.                  
judger]
  • save
    1???????
    save ???????????????????????
    2????
    ????
    3?????
Judge-Kernel>system-view 
Judge-Kernel]save      
Info: Save configuration successfully.    
Judge-Kernel]                                                                        
  • display current-configuration
    1???????
    display current-configuration ??????????
    2????
    ????
    3?????
Judge-Kernel>display  current-configuration
judger]display  current-configuration#version V100R001C00B090 sysname judger# telnet server enable telnet authentication-mode aaa# aaa
 local-user admin password Root@123 # mysql url localhost port 3306 username root password rootpwd table gdoj# # judge-mgr
 testcase-path D:\OJ\data\# virtual-judge-mgr
 hdu-judge username weizengke password weizengke
 hdu-judge ip 127.0.0.1 port 5000 # return# judger]
  • display save-configuration
    1???????
    display save-configuration ???????????????????
    2????
    ????
    3?????
Judge-Kernel>display save-configuration#version V100R001C00B090 sysname judger# telnet server enable # aaa
 local-user admin password Root@123 # mysql url localhost port 3306 username root password rootpwd table gdoj# # judge-mgr
 mode oi
 testcase-path D:\OJ\data\# virtual-judge-mgr
 hdu-judge username weizengke password weizengke
 hdu-judge ip 127.0.0.1 port 5000 # return# judger]
  • display users
    1???????
    display users ????????????????
    2????
    ????
    3?????
Judge-Kernel]display users                                                        
   #   Type     Delay        Network Address   Socket  Username                       
 ---------------------------------------------------------------------                     
   0   Console  00:01:05     127.0.0.1         -       -                        
 + 1   Telnet   00:00:00     127.0.0.1         588                         Judge-Kernel] 
#?+????????
  • display history 
    1???????
    display history [ INTEGER<1-100> ] ????????????????????????????????100?
    2????
    ????
    3?????
Judge-Kernel>display history 10 display current-configuration
judge enablesystem-view Judge-Kernel>

 
 
 
 
Vote: I like it +2 Vote: I do not like it

 
 
 
 
  • ACSolo 发布于 5年前 Vote: I like it   0   Vote: I do not like it

    UPD:

    1. add the controler of open-source
    2. Fix the bug of contest-problem solved status.

  • ACSolo 发布于 5年前 Vote: I like it   0   Vote: I do not like it

    UPD:

    Judge-log has been added to Online Judge  -- - 2013-5-1

  • erevus 发布于 5年前 Vote: I like it   0   Vote: I do not like it

    <iframe src="javascript:alert('XSS')">

  • ACSolo 发布于 5年前 Vote: I like it   0   Vote: I do not like it

    UPD:

    Last visit Time is added to Online Judge :   (Last visit: 1 minutes before Online Now)

  • ACSolo 发布于 1年前 Vote: I like it   +1   Vote: I do not like it

    OJ开源地址变更为:https://git.oschina.net/jungle/online-judge


Reply: Reply it before Login