此函数计算两个之间的最小欧几里德距离多边形 P1 和 P2。 min_d = min_dist_between_two_polygons(P1,P2,Display_solution); 这个函数有两个参数,第三个是可选的。 P1 & P2 包含多边形的几何形状。 P1 & P2 是包含两个字段的结构:x & y 例如: P1.x = rand(1,5)+2; P1.y = rand(1,5); P2.x = rand(1,3); P2.y = rand(1,3); Display_solution 是一个二进制变量,用于启用或不启用解的图。 该函数首先检查多边形是否相交。 在这种情况下,最小距离为 0。 否则,所有顶点和两个边之间的距离计算多边形。 该函数返回找到的最小距离。 可以在代码中找到实现的更多细节。
2022-05-05 10:37:15 9KB matlab
1
Sudo缓冲区溢出漏洞(CVE-2021-3156),sudo-1.9.5p2.tar.zip
2022-04-07 12:00:45 3.83MB zookeeper 分布式 云原生
1
mint19.2   本来pip 和 pip2 对应 python2.7   pip3对应python3.6   用源码安装了python3.7之后. 这样 版本也没问题. 但是,  用pip3.7 安装包的时候 提示 pip需要升级,  但是一旦升级, 就不对了 pip  pip2 pip3 都指向了pip3.7 这导致一系列问题. 包pgadmin4 启动后报 csrf 错误 , 甚至进而导致docker-compose模式下postgres服务下线! 而且,无法用重装python-pip, python3-pip 来解决 sudo apt remove python-pip s
2022-03-26 11:48:28 91KB ip p2 pip
1
untrusted comment: signature from openbsd 5.5 base secret key RWRGy8gxk9N930mZSNhSVZg9DPFLNT0qQcEGhQeQ55awDf4RfJqPXB6lz71jQatqYzr3XkzyUyckpP4nSCE+XmoICZEPwVhjhA8= OpenBSD 5.5 errata 2, Apr 8, 2014: Missing bounds checking in OpenSSL's implementation of the TLS/DTLS heartbeat extension (RFC6520) which, if exploited, can result in a leak of memory contents. After patching, private keys and certificates exposed to services running this code (for example web/mail server SSL certificates) should be replaced and old certificates revoked. Only SSL/TLS services are affected. Software that uses libcrypto alone is not affected. In particular, ssh/sshd are not affected and there is no need to regenerate SSH host keys that have not otherwise been exposed. Apply patch using: signify -Vep /etc/signify/openbsd-55-base.pub -x 002_openssl.patch.sig \ -m - | (cd /usr/src && patch -p0) Then build and install libssl cd /usr/src/lib/libssl/ssl make obj make make install Also recompile any statically-linked binaries depending on it - in the base OS, this is just ftp(1): cd /usr/src/usr.bin/ftp make obj make clean make make install Then restart services which depend on SSL. Index: lib/libssl/src/ssl/d1_both.c =================================================================== RCS file: /cvs/src/lib/libssl/src/ssl/d1_both.c,v retrieving revision 1.2 diff -u -p -r1.2 d1_both.c --- lib/libssl/src/ssl/d1_both.c 27 Feb 2014 21:04:57 -0000 1.2 +++ lib/libssl/src/ssl/d1_both.c 8 Apr 2014 00:22:22 -0000 @@ -1459,26 +1459,36 @@ dtls1_process_heartbeat(SSL *s) unsigned int payload; unsigned int padding = 16; /* Use minimum padding */ - /* Read type and payload length first */ - hbtype = *p++; - n2s(p, payload); - pl = p; - if (s->msg_callback) s->msg_callback(0, s->version, TLS1_RT_HEARTBEAT, &s->s3->rrec.data[0], s->s3->rrec.length, s, s->msg_callback_arg); + /* Read type and payload length first */ + if (1 + 2 + 16 > s->s3->rrec.length) + return 0; /* silently discard */ + hbtype = *p++; + n2s(p, payload); + if (1 + 2 + payload + 16 > s->s3->rrec.length) + return 0; /* silently discard per RFC 6520 sec. 4 */ + pl = p; + if (hbtype == TLS1_HB_REQUEST) { unsigned char *buffer, *bp; + unsigned int write_length = 1 /* heartbeat type */ + + 2 /* heartbeat length */ + + payload + padding; int r; + if (write_length > SSL3_RT_MAX_PLAIN_LENGTH) + return 0;
2022-03-25 14:39:45 1.06MB openssh5.8
1
考虑到我手上的服务器逐渐的增多,有时候需要大规模的部署同一个文件,例如因为方便使用systemtap这个工具定位问题,需要把手上几百台服务器同时安装kernel-debuginfo这个包,原有的方式采用一个源服务器,采用rsync或者scp之类的文件传输方式只能做到一个点往下分发这个文件,这个时候下发的速度就会比较的慢,基于以上原因,我写了一个基于bt协议传输文件的小工具,实际测试,传输到10个机房,70多台机器传输一个240M的这个内核文件,到所有的机器,源采用限速2m/s的上传速度,测试的结果大概只要140s,就可以全部传输完毕,这个效率是非常之高,如果不限速的情况下速度会更快,下面把这个
2022-03-10 12:17:06 67KB p2 p2p python
1
可以完美使用kerio connect 7.0.0.1191哦
2022-02-17 19:35:02 703KB kerio connect 7.0.0.1191 P2
1
因为没有办法在自己写的 tpl 中初始化DDR,改为编写 spl。 使用 rk3568_ddr_1560MHz_v1.08.bin 做为 tpl 来初始化内存。 SPL 环境:AArch64 + EL3 + DDR + (入口地址 = 0x00000000) 代码运行后会先初始化 uart2 串口,然后运行一个 mini shell 供交互用 支持 help、exit、hexDump 三条指令 输入 q 并回车,重复5次仍可让设备回到 MASKROM 模式! 从这版开始, printf() 能输出 u64 数据了。
2022-02-13 20:00:52 5.64MB rk3568裸机开发
1
不设置运行栈,沿用 bootrom 环境的栈 运行后只等待一会, 然后又退回bootrom运行,即让板子又重新回到MASKROM模式
2022-02-12 14:01:32 5.61MB rk3568裸机开发
1
不设置运行栈,沿用 bootrom 环境的栈 运行后会先初始化 uart2 串口,然后运行一个 mini shell 供交互用 支持 help、exit、hexDump 三条指令
2022-02-11 21:00:48 5.61MB rk3568裸机开发
1
Station P2 开源机顶盒之最简裸机代码。 ./make.sh 编译得到 rk3568_loader.bin, 通过 RKDevTool_Release_v2.84 写入eMMC内。 机顶盒上电时被 SoC bootrom 加载到 internal_sram 0xfdcc1000 处运行, 输入help 和 exit 指令,可重新返回 bootrom 运行, 让 RKDevTool 将板子重新识别为 MASKROM 设备
2022-02-11 09:01:41 10KB stm32 arm 嵌入式硬件 单片机
1