下载jdk 8(建议版本)
root@7d4e36f7b916:/home/web# wget https://happyoj.com/data/jdk-8u361-linux-x64.tar.gz
root@7d4e36f7b916:/home/web# tar zxvf jdk-8u361-linux-x64.tar.gz
配置jdk环境变量:
root@7d4e36f7b916:/home/web# vim /etc/profile
配置java环境,在最后增加如下内容,注意路径正确
export JAVA_HOME=/home/web/jdk1.8.0_361/
export CLASSPATH=.:$JAVA_HOME/…
编译wireshark报错
```c
root@jungle:/home/jungle/code/wireshark/builds# cmake ..
— Generating build using CMake 3.28.3
— Using “Unix Makefiles” generator and build type “RelWithDebInfo”
— LTO/IPO is not enabled
— V: 4.4.2, MaV: 4, MiV: 4, PL: 2, EV: .
— Linker flags: -Wl,—as-needed
— Found LIBSSH: /usr/lib/x86_64-linux-gnu/libssh.so (found suitable version “0.10.6”, minimum required is “0.8.5”)
— Checking for one of the modules ‘libpcap’
— Could NOT find PCAP (missing: PCAP_LIBRARY PCAP_INC…
最近半年的公网出流量MB,可见上周出现异常日均增长到40G+,导致流量超过阈值,服务停机
于是只能增加robots.txt协议控制:
```c
User-agent:
Disallow: /profile/
Disallow: /problemset/status/
Disallow: /problemset//status/
Disallow: /problemset/standings/
Disallow: /contest/
Disallow: /api/
Disallow: /admin/
User-agent: SemrushBot
User-agent: MJ12bot
User-a…
libyang学习:主要是为了学习如何将yang模型data path 转化为schema path。
背景:最近在做一个yang的gtest配置下发测试工具时,遇到yang模型xpath带choice case时(参见文章后面的yang模型):
data path不带choice case节点,如:/acme-system:system/food/tea
schema path是带的,如:/acme-system:system/food/snack/late-bight/tea
导致业务基于schema path注册回调函数时,基于data path数据注入时找不到回调函数,所以需要做一次转换,以便能够给予path找到回调函数。
思路:从data path获取 lysc_node,再从 lysc_node 获取schema path。
```c
LY_ERR ret = LY_SUCCESS;
struct ly_ctx *ctx = NULL;
const struct lys_module *module;
// 初始化libyang上下文
r...
The virtue of MACSec paired with the requirements of Confidentiality, Integrity, and Availability (CIA) results in CloudSec. In essence, CloudSec is MACSec-in-UDP using Transport Mode, similar to ESP-in-UDP in Transport Mode as described in RFC3948. In addition to the specifics of transporting MACSec encrypted data over IP networks, CloudSec also carries a UDP header for entropy as well as an encrypted payload for Network Virtualization use-cases.

{
int a,b;
while(scanf("%d%d", &a,&b) != EOF)
printf("%d\n",a+b);
return 0;
}
```python
import telnetlib
import time
import logging
import re
import ipaddress
from ipaddress import ip_address
logging.basicConfig(format=’%(asctime)s - %(pathname)s - [line:%(lineno)d] - %(levelname)s: %(message)s’,
level=logging.DEBUG)
username = [‘0000000’, ‘huawei’,’root’,’huawei123’,’huawei1234’]
password = [‘Root@123’,’Huawei@123’,’Huawei@1234’,’huawei@123’,’huawei@1234’,’Root@1234’]
def contains_chars(s, chars):
pattern = f”[{‘’.join(chars)}]”
return bool(r…
大大你好,我是一个小白。
应该是成功运行了kernel系统,但网站显示是一个Jar包,不知道如何启用网站。我瞎参照您的Ubuntu部署OJ网站,修改了一下运行代码,做了个bat文件
java -Xms128m -Xmx512m -jar oj-2.0.4.jar —server.port=80 —server.redirect-https-enable=false —server.ssl.enabled=false —config.encode=utf-8 —config.judgerIp=127.0.0.1 —config.ojPath=/OJ/ —config.dataPath=/OJ/data/ —config.judgeLogPath=/OJ/logfile/judge_log/ —config.templatePath=/OJ/conf/code_template/ —config.configFile=/OJ/conf/config.json —spring.datasource.url=jdbc:mysql://127.0.0.1:3306/gdoj?useUnicod…
```python
import cv2
import numpy as np
class SealRemove(object):
def remove_red_seal(self, image):
# 获得红色通道
blue_c, green_c, red_c = cv2.split(image)
# 多传入一个参数cv2.THRESH_OTSU,并且把阈值thresh设为0,算法会找到最优阈值
thresh, ret = cv2.threshold(red_c, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)
# 实测调整为95%效果好一些
filter_condition = int(thresh * 0.95)
nominator_thresh, red_thresh = cv2.threshold(red_c, filter_condition, 255, cv2.THRESH_BINARY)
...
最近遇到一个问题,通过springboot Scheduled定时调度,在启动时就会执行定时任务,导致启动性能较差。
代码如下:
1)@PostConstruct 注解表示启动时就执行一次。
2)@Scheduled(cron = “0 0 1,6,12,18,21 ?”) 注解表示按照每天1点/6点/12点/18点/21点执行一次
@Component
public class ContestCollectorSchedule {
@PostConstruct
@Scheduled(cron = "0 0 1,6,12,18,21 * * ?")
private void contestCollectorTimer() {
OJCollector.CollectContests();
}
}
修改后方案如下:
1)取消启动时执行注解
2)增加一个调度器,第一次后延时60秒执行一次,后续按照一年执行一次
这样可以达到启动时延时60秒执行,后续按照每天1点/6点/12点/18点/21点执行一次的效果
```…
方法1:
navigator.clipboard.writeText(editor.getValue());
配置文件:
server:
port: 8443
redirect-https-port: 443 -----》由于我是用docker容器部署,所以这里重定向是主机端口号
redirect-https-enable: true
http-port: 8080
ssl:
key-store: classpath:happyoj.com.pfx
key-store-password: 证书密码
key-store-type: PKCS12
代码中新增Redirect2HttpsConfig类执行重定向:
```java
package com.oj.config;
import lombok.extern.slf4j.Slf4j;
import org.apache.catalina.Context;
import org…
$(“.tag-layout”).html(opt); 动态添加的html会导致jquery监听的事件无法响应到如:
$(".tag-description").bind("dblclick", function() {
...
});
可以修改为通过如下方式监听:
$(document).on("dblclick",".tag-description",function(){
...
});
```json
{
“system”: {
“startup_config”: “config.cfg”,
“sysname”: “Judge-Kernel”,
“JudgePath”: “judger.exe”,
“sock_port”: 5000
},
"judger": {
"WorkingPath": "temp/",
"JudgeLogPath": "logfile/judge_log/",
"judge_logbuf_size": 500,
"DataPath": "data",
"DeleteTemp": 1,
"LimitJudge": 2000001
},
"mysql": {
"url": "172.17.0.1",
"username": "xxx",
"password": "pwd",
"tabl...
解决中文乱码,统一配置utf-8:
public static boolean write(String fileName, String content) {
try {
Writer out = new OutputStreamWriter(new FileOutputStream(fileName),"UTF-8");
out.write(content);
out.flush();
out.close();
return true;
} catch (IOException ioe) {
ioe.printStackTrace();
return false;
}
}
![]() |
![]() |
2023 |
![]() |
![]() |
1970 |
![]() |
![]() |
1763 |
4 |
![]() |
1718 |
5 |
![]() |
1710 |
6 |
![]() |
1701 |
7 |
![]() |
1684 |
8 |
|
1678 |
9 |
![]() |
1664 |
10 |
![]() |
1653 |