This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 已知:人群中千分之一的人会得癌症 | |
| 那么假设就是10000个人,10个人会得癌症 | |
| 患癌症检测成阳性概率为 99%,10个人得癌症,9.9个人检测成阳性,0.1个人检测成阴性 | |
| 健康检测成阴性概率为 99%,9990个人健康,9890.1 个人检测成阳性,99.9个人检测成阳性 | |
| 那么就可以计算出,如果检测成阳性,换癌症概率为: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def To_hex_str(num): | |
| chaDic = {10: 'a', 11: 'b', 12: 'c', 13: 'd', 14: 'e', 15: 'f'} | |
| hexStr = "" | |
| if num < 0: | |
| num = num + 2**32 | |
| while num >= 16: | |
| digit = num % 16 | |
| hexStr = chaDic.get(digit, str(digit)) + hexStr | |
| num //= 16 | |
| hexStr = chaDic.get(num, str(num)) + hexStr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def Work_thread(self,root,panel): | |
| stOutFrame = MV_FRAME_OUT() | |
| img_buff = None | |
| buf_cache = None | |
| numArray = None | |
| while True: | |
| ret = self.obj_cam.MV_CC_GetImageBuffer(stOutFrame, 1000) | |
| if 0 == ret: | |
| if None == buf_cache: | |
| buf_cache = (c_ubyte * stOutFrame.stFrameInfo.nFrameLen)() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 静态路由协议配置 | |
| ip route 202.114.66.0 255.255.255.0 202.114.67.5 | |
| ip route 202.114.64.0 255.255.255.0 202.114.67.5 | |
| ip route 202.114.65.0 255.255.255.0 202.114.67.5 | |
| ip route 192.168.1.0 255.255.255.0 202.114.67.5 | |
| # RIP配置 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # git 只克隆最近的分支 | |
| git clone --depth=1 https://github.com/c-smile/sciter-sdk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 寻找文件大于100M | |
| sudo find / -type f -size +1000M | |
| # 提示app不安全 | |
| sudo spctl --master-disable | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 参考 https://bbs.pediy.com/thread-256000.htm | |
| 利用FPU获取EIP | |
| section .text | |
| BITS 32 | |
| global CMAIN | |
| CMAIN: | |
| fldz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cmake -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.14/modules .. | |
| cmake --build . | |
| sudo make install | |
| 详情可以参考 https://docs.opencv.org/4.5.2/d7/d9f/tutorial_linux_install.html | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function *fetchHttpBin(){ | |
| const data = yield fetch('https://httpbin.org/get'); // 等待返回值 | |
| console.log(data); | |
| } | |
| function main2(){ | |
| const g = fetchHttpBin(); // 获得生成器 | |
| g.next() | |
| .value // 执行到next,此时生成器返回 {done, value} | |
| .then( (data)=> data.json()) // 执行到yield,此时会返回promise |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function(require, host) { /* global host */ | |
| /* eslint-disable block-spacing, no-multi-spaces, brace-style, no-array-constructor, new-cap, no-use-before-define */ | |
| 'use strict'; | |
| // eslint-disable-next-line no-invalid-this, no-shadow | |
| const global = this; | |
| const local = host.Object.create(null); | |
| local.Object = Object; |