Lastest

DCT离散余弦变换和JPEG 压缩算法

DCT离散余弦变换和JPEG 压缩算法 JPEG 压缩算法介绍 历史 压缩算法:有损的离散余弦变换DCT(本次分享重点),无损的预测压缩 墒编码:huffman编码(本次分享重点),算术编码 使用DWT小波变换JPEG 2000:低码率,有损压缩和无损压缩,渐进传输,感兴趣区域 从傅立叶变换到离散余弦变换【简单讲,细节可以单独拆分】 JPEG 压缩算法原理 颜色模式:从RGB到YUV 采样 分块 DCT离散余弦变换 Zigzag排序 量化 整体哈夫曼编码 存储格式 频域分析其他应用

c语言float和bytes array转换

重点:大小端不要搞错 x86是小端,0x123456,对应4个字节,0x12,0x34,0x56,0x78. 在内存中的存储顺序是 0x78, 0x56, 0x34, 0x12 #include <stdio.h> int main(){ unsigned char buffer[] = {0x46, 0x87, 0x92, 0x64}; float a = 17353.195f; float b = 0; printf("zzzzz ....\n"); unsigned int* pa = (unsigned int*)(&a); unsigned int x = *pa; int x1 = (x >> 24) & 0xFF; int x2 = (x >> 16) & 0xFF; int x3 = (x >> 8) & 0xFF; int x4 = x & 0xFF; printf("%x",x1 ); printf("%x", x2); printf("%x", x3); printf("%x", x4); printf("\n"); un...

地图找出口算法python实现

算法描述 代码实现 import copy m = [ [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, ], [1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, ], [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, ], [0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, ], [0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, ], [0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, ], [0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, ], [0, 0, 0, 0, 0, 0, 0, 0, ...

使用Vault管理服务器各种密码

vault简介 安装 在centos上安装 $ sudo yum install -y yum-utils $ sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo $ sudo yum -y install vault 在ubuntu上安装 $ sudo apt update && sudo apt install gpg $ wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg >/dev/null $ gpg --no-default-keyring --keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg --fingerprint $ echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_relea...

windows环境pip无法安装dlib库的终极解决

问题 机器学习需要安装dlib库,网上搜索 解决方案在最底部 网上搜索的解决方案 pip install cmake pip install boost pip install dlib 然而,在安装dlib的时候,错误原因不仅限于没有安装cmake。 报错如下 Collecting dlib Using cached dlib-19.24.0.tar.gz (3.2 MB) Preparing metadata (setup.py) ... done Building wheels for collected packages: dlib Building wheel for dlib (setup.py) ... error error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [320 lines of output] running bdist_wheel running build running build_py package init file 'tools\python\dlib\__init__.py' no...

Windows WLS2使用本机ss代理访问github

关键问题 WSL每次启动ip不一样,所以不能用静态方法设置http代理。 WSL会把宿主ip地址写入 获得当前宿主ip地址的方法 cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }' 手动设置代理的方法 $ cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }' 172.29.176.1 $ export https_proxy="http://172.29.190.80:10000" # 下载github库 $ wget https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life/releases/download/v1.0/face_checkpoints.zip --2022-06-05 01:46:58-- https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life/releases/download/v1.0/face_checkpoints.zip 正在连接 172.29.176.1:10000... 已连接。 已发出 Proxy 请求,正在等待回应... 302 Found 位置:https://obj...

写个dockerfile自动部署hugo

创建dockerfile FROM golang:1.17-alpine # Optionally set HUGO_BUILD_TAGS to "extended" or "nodeploy" when building like so: # docker build --build-arg HUGO_BUILD_TAGS=extended . ARG HUGO_BUILD_TAGS ARG CGO=1 ENV CGO_ENABLED=${CGO} ENV GOOS=linux ENV GO111MODULE=on ENV HUGO_VERSION=0.93.3 ENV HUGO_USER=hugo ENV BASE_DIRECORY=/home/hugo ENV SITE_NAME=hugosite ENV HUGO_SITE_DIRECORY=${BASE_DIRECORY}/${SITE_NAME} ENV HUGO_URL=https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz #hugo_extended_0.93.3_Linux-64bit.tar.gz ENV GLIBC_...

php中__METHOD__和_FUNCTION__的区别

话不多说,一段代码实验下 <?php class A{ public function a1(){ echo __FUNCTION__; echo "\n"; echo __METHOD__; echo "\n\n"; } public static function a2(){ echo __FUNCTION__; echo "\n"; echo __METHOD__; echo "\n\n"; } } function a3(){ echo __FUNCTION__; echo "\n"; echo __METHOD__; echo "\n\n"; } $a = new A(); $a->a1(); A::a2(); a3(); 输出如下 a1 A::a1 a2 A::a2 a3 a3 结论 对于类成员函数,METHOD会带上类名,FUNCTION 没有类名 对于非类成员函数,没差别

cat命令提取json中的key

cat连用grep进行筛选,筛选出的json还可以提取key 距离提取满足grep筛选条件的记录,并提取MessageID字段内容 cat log-20210326-* | grep xxx | grep MessageID | grep -Po 'MessageID[" :]+\K[^"]+'

自己想到的一些问题整理

mysql中各种有几种索引,区别是什么 mysql事务等级细节 swoole和传统fpm的区别是什么 高并发场景下的锁

执行时间: 1733648736046.7 毫秒