首页 文章 精选 留言 我的

精选列表

搜索[压缩],共10005篇文章
优秀的个人博客,低调大师

c++ zlib(qt)压缩与解压缩

#include <QtCore/QCoreApplication> #include "zlib.h" #include "stdio.h" #include <iostream> using namespace std; #define MaxBufferSize 999999 void Test1(); void Test2(); int main( int argc, char *argv[]) { QCoreApplication a(argc, argv); //Test1(); Test2(); return a.exec(); } //c++ zlib void Test1() { FILE* File_src; FILE* File_compress; FILE* File_uncompress; unsigned long len_src; unsigned long len_compress; unsigned long len_uncompress; unsigned char *buffer_src = new unsigned char [MaxBufferSize]; unsigned char *buffer_compress = new unsigned char [MaxBufferSize]; unsigned char *buffer_uncompress = new unsigned char [MaxBufferSize]; File_src = fopen( "src.txt" , "r" ); File_compress = fopen( "compress.txt" , "w" ); File_uncompress = fopen( "uncompress.txt" , "w" ); //compress len_src = fread(buffer_src, sizeof ( char ),MaxBufferSize-1,File_src); compress(buffer_compress,&len_compress,buffer_src,len_src); fwrite(buffer_compress, sizeof ( char ),len_compress,File_compress); cout << "normal zlib:" << endl; cout << "src:\n" << buffer_src << ",length:" << len_src << endl << endl; cout << "compress:\n" << buffer_compress << ",length:" << len_compress << endl << endl; //uncompress uncompress(buffer_uncompress,&len_uncompress,buffer_compress,len_compress); fwrite(buffer_uncompress, sizeof ( char ),len_uncompress,File_uncompress); cout << "uncompress:\n" << buffer_uncompress << ",length:" << len_uncompress << endl << endl; fclose(File_src); fclose(File_compress); fclose(File_uncompress); } //qt zlib void Test2() { QByteArray src; src.append( "中华人民共和国,china mobile,123456" ); unsigned long len_compress; unsigned long len_uncompress; unsigned char *buffer_compress = new unsigned char [MaxBufferSize]; unsigned char *buffer_uncompress = new unsigned char [MaxBufferSize]; compress(buffer_compress,&len_compress,(Bytef*)src.data(), src.length()); uncompress(buffer_uncompress,&len_uncompress,buffer_compress,len_compress); cout << "qt zlib:" << endl; cout << "src:\n" << src.data() << ",length:" << src.size() << endl << endl; cout << "compress:\n" << buffer_compress << ",length:" << len_compress << endl << endl; cout << "uncompress:\n" << buffer_uncompress << ",length:" << len_uncompress << endl << endl; }

优秀的个人博客,低调大师

nginx配置压缩

编辑nginx配置文件 [root@jiaxin-ceshi nginx-1.14.0]# vim /usr/local/nginx/conf/nginx.conf user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; # Load dynamic modules. See /usr/share/nginx/README.dynamic. include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; client_max_body_size 128M; gzip on; gzip_min_length 8k; gzip_buffers 16 64k; gzip_http_version 1.1; gzip_comp_level 6; gzip_types text/plain application/javascript text/javascript application/x-javascript text/css application /xml; gzip_vary on; include /etc/nginx/conf.d/*.conf; }

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册