# exp-libs
**Repository Path**: exppoc/exp-libs
## Basic Information
- **Project Name**: exp-libs
- **Description**: 经验构件库(Java版)
- **Primary Language**: Java
- **License**: GPL-3.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 1
- **Forks**: 0
- **Created**: 2018-09-16
- **Last Updated**: 2023-02-16
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# exp-libs
经验构件库(已废弃)
> 公告:因很多依赖包已过时,故放弃维护,以后转至重构版 [exp-libs-refactor](https://github.com/lyy289065406/exp-libs-refactor) 仓库中维护。
------
## 环境
   
## 简介
此构件库为本人多年编程总结提炼而成,把常用的功能模块作为原子API进行封装。
另外也借用了不少出色的第三方构件,在其之上进行二次封装。
过程中尽量确保了低耦合、高性能、强稳健、高复用、更易用等,使之能够满足日常开发需要、提高开发效率。
> *既然别人不甘造轮子,那我就来奠造基石*
*他人会用,只是用。我要用,则随心所欲*
## 安装与使用
由于 `exp-libs` 依赖了大量第三方构件并封装,若仅导入本项目的 `exp-libs.jar`,有很多功能是无法使用的。关于导入相关依赖的方法可参看 [这里](./exp-libs/lib/README.md) 。
- [在线Javadoc](https://lyy289065406.github.io/api-online/javadoc/exp-libs/1.1/index.html)
- POM坐标(完全版):
```xml
exp.libs
exp-libs
1.1-SNAPSHOT
```
- POM坐标(精简版,过滤了不常用的第三方构件):
```xml
exp.libs
exp-libs-simple
1.1-SNAPSHOT
```
> 含有此构件的 [Nexus 仓库](https://github.com/lyy289065406/nexus-docker/tree/produce)(需要切换到 produce 分支并使用 docker 运行)
## 功能模块
| 主模块 | 子模块 | 组件包/类 | 说明 | 测试
示例 |
|:---:|:---:|:---:|:---|:---:|
| **常用工具包**
[`exp.libs.utils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils) | 编码工具
[`encode`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/encode) | [`Base64`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/encode/Base64.java) | Base64编解码 | |
| | | [`CharsetUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/encode/CharsetUtils.java) | 字符集编码转换 | [`JUnit`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/utils/test/TestCharsetUtils.java) |
| | | [`CompressUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/encode/CompressUtils.java) | 压缩/解压(zip,gzip,tar,bz2) | |
| | | [`CryptoUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/encode/CryptoUtils.java) | 加解密(MD5,DES,RSA) | [`JUnit`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/utils/test/TestCryptoUtils.java) |
| | | [`TXTUtils`]() | 任意文件与txt文件互转 | |
| | 格式转换工具
[`format`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/format) | [`ESCUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/format/ESCUtils.java) | 数据格式转换
(转义字符,BCP,CSV,TSV) | [`JUnit`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/utils/test/TestEscUtils.java) |
| | | [`JsonUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/format/JsonUtils.java) | JSON数据处理 | |
| | | [`XmlUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/format/XmlUtils.java) | XML数据处理 | |
| | | [`StandardUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/format/StandardUtils.java) | 标准化处理 | |
| | 图像工具
[`img`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/img) | [`ImageUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/img/ImageUtils.java) | 图像处理 | |
| | | [`QRCodeUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/img/QRCodeUtils.java) | 二维码生成/解析 | |
| | 读写工具
[`io`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/io) | [`FileUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/io/FileUtils.java) | 磁盘文件处理 | |
| | | [`IOUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/io/IOUtils.java) | IO流处理 | |
| | | [`JarUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/io/JarUtils.java) | Jar文件处理 | |
| | 数值工具
[`num`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/num) | [`BODHUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/num/BODHUtils.java) | 进制处理 | [`JUnit`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/utils/test/TestBODHUtils.java) |
| | | [`IDUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/num/IDUtils.java) | 唯一性ID生成器 | |
| | | [`NumUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/num/NumUtils.java) | 数值处理 | [`JUnit`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/utils/test/TestNumUtils.java) |
| | | [`UnitUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/num/UnitUtils.java) | 单位转换 | |
| | 系统工具
[`os`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/os) | [`ExitUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/os/ExitUtils.java) | 程序终止控制 | |
| | | [`JavaUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/os/JavaUtils.java) | Java语言处理 | |
| | | [`OSUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/os/OSUtils.java) | 系统环境参数处理 | |
| | | [`ThreadUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/os/ThreadUtils.java) | 线程处理 | |
| | 日期/时间工具
[`time`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/time) | [`DateUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/time/DateUtils.java) | 日期工具 | |
| | | [`TimeUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/time/TimeUtils.java) | 时间工具 | |
| | 校验工具
[`verify`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/verify) | [`RegexUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/verify/RegexUtils.java) | 正则表达式处理 | [`JUnit`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/utils/test/TestVerifyUtils.java) |
| | | [`VerifyUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/verify/VerifyUtils.java) | 数据格式校验 | |
| | 其他工具
[`other`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/other) | [`AnnotationUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/other/AnnotationUtils.java) | 神ta喵注释生成器 | |
| | | [`BoolUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/other/BoolUtils.java) | 布尔值处理 | |
| | | [`JSUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/other/JSUtils.java) | JavaScript脚本处理 | |
| | | [`ListUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/other/ListUtils.java) | 队列/集合操作 | [`JUnit`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/utils/test/TestListUtils.java) |
| | | [`LogUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/other/LogUtils.java) | 日志设置。
基于`org.slf4j(1.7.5)`接口与
`ch.qos.logback(1.0.13)`封装 | |
| | | [`ObjUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/other/ObjUtils.java) | 对象处理 | [`JUnit`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/utils/test/TestObjUtils.java) |
| | | [`PathUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/other/PathUtils.java) | 路径处理 | |
| | | [`RandomUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/other/RandomUtils.java) | 随机生成器
(随机数、随机汉字、随机姓名等) | [`JUnit`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/utils/test/TestRandomUtils.java) |
| | | [`StrUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/utils/other/StrUtils.java) | 字符串处理 | |
| **二次封装组件**
[`exp.libs.warp`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp) | 版本管理组件
[`ver`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/ver) | | 借助Sqlite以UI方式管理项目版本信息,
[`Maven项目发布插件`](https://github.com/lyy289065406/mojo-release-plugin)与[`自动化升级插件`](https://github.com/lyy289065406/auto-upgrader)
的部分功能也依赖此组件实现 | [`示例`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/ver) |
| | 函数解析组件
[`cep`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/cep) | | 基于`com.singularsys.jep(3.3.1)`封装。
去除时效限制,并新增多种自定义函数 | [`JUnit`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/warp/cep) |
| | 命令行组件
[`cmd`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/cmd) | | 封装系统命令行操作 | |
| | 配置解析组件
[`cmd`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/conf) | xml配置文件解析
[`xml`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/conf/xml) | 基于`org.dom4j(1.6.1)`封装,支持定时
刷新配置项、加载固有格式的配置区块。
[`数据库组件`](#db)、[`网络组件`](#net)等均利用此组件
加载独立的配置区块 | |
| | | ini配置文件解析
[`ini`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/conf/ini) | 基于`org.dtools.javaini(1.1.0.0)`封装
扩展对ini文件的编码支持范围 | [`示例`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/warp/conf/ini/test/TestINIConfig.java) |
| |
数据库组件
[`db`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/db) | 关系型数据库工具
[`sql`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/db/sql) | 基于`com.cloudhopper.proxool(0.9.1)`
封装,支持mysql/oracle/sqlite等。
提供连接池与JDBC两种数据库连接方
式、及多种常用的增删改查操作,且可
根据物理表模型反向生成JavaBean代码 | [`JUnit`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/warp/db/sql/test/TestDBUtils.java) |
| | | Redis客户端组件
[`redis`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/db/redis) | 基于`redis.clients.jedis(2.9.0)`封装。
支持单机/主从/哨兵/集群模式,屏蔽
不同模式之间获取实例连接的差异性 | [`示例`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/warp/db/redis/test/TestRedisClient.java) |
| | 网络组件
[`net`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/net) | Cookie组件
[`cookie`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/net/cookie) | 用于解析HTTP/HTTPS响应头中的
Set-Cookie参数 | |
| | | FTP组件
[`ftp`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/net/ftp) | 未实装 | |
| | | HTTP/HTTPS组件
[`http`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/net/http) | 提供在HTTP/HTTPS协议下,以长/短
连接实现的GET、POST、Download
方法,并支持自动解析Gzip流。
基于`java.net.HttpURLConnection`与
`commons-httpclient(3.1-rc1)`封装,
更借助`org.bouncycastle.bcprov`
`-jdk15on(1.54)`使得可以在JDK1.6+环
境均支持HTTPS-TLSv1.2协议[`(详见)`](#TLSv12) | |
| | | Email组件
[`mail`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/net/mail) | 基于`javax.mail(1.4.1)`封装,
可用于邮件发送/抄送(支持加密) | [`JUnit`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/warp/net/mail/test/TestEmail.java) |
| | | MQ组件
[`mq`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/net/mq) | 未实装(jms/kafka) | |
| | | 端口转发器
[`pf`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/net/pf) | 利用Socket实现的端口转发程序 | [`示例`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/warp/net/pf/test) |
| | | Ping组件
[`ping`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/net/ping) | 利用系统命令实现的ping/tracert,支持
解析中/英文的win/linux系统的结果集 | |
| | | Socket组件
[`sock`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/net/sock) | 封装IO/NIO模式的Socket客户端/服务
端的交互行为,只需实现业务逻辑 | [`示例`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/warp/net/sock) |
| | | Telnet组件
[`telnet`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/net/telnet) | 未实装 | |
| | | Webkit组件
[`webkit`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/net/webkit) | 基于`org.seleniumhq.selenium(2.53.0)`
封装,主要提供无头浏览器
`com.codeborne.phantomjsdriver(1.2.1)`
的常用操作 | |
| | | WebSocket客户端
[`websock`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/net/websock) | 基于`org.java-websocket(1.3.4)`封装,
支持ws与wss,提供数据帧的收发接口 | |
| | | WebServices组件
[`wsdl`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/net/wsdl) | 基于`net.webservices.client(1.6.2)`封
装,支持http/axis2/cxf,支持SSL模式 | |
| | IO组件
[`io`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/io) | 流式读取器
[`flow`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/io/flow) | 流式读取超大文件/字符串 | |
| | | 文件监听器
[`listn`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/io/listn) | 可监听并触发指定目录树下所有
文件/文件夹的增删改事件 | |
| | | 批量序列化读写器
[`serial`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/io/serial) | 批量序列化/反序列任意实现了
`java.io.Serializable`接口的对象 | |
| | OCR图文识别
[`ocr`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/ocr) | | 基于`com.sun.media.jai-imageio`
`(1.1-alpha)`封装。
可识别图片中打印体的文字
(文字不能旋转、变形,越正规的
文字识别率越高) | [`示例`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/warp/ocr/test/TestOCR.java) |
| | 定时任务调度
[`task`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/task) | [`在线生成cron表达式`](https://lyy289065406.github.io/cron-expression/) | 基于`org.quartz-scheduler(2.2.1)`
封装。仅保留了simple与cron调度器,
并提供cron表达式换算对象 | [`示例`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/warp/task/test) |
| | 线程组件
[`thread`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/thread) | | 提供抽象循环线程、回调线程池组件 | |
| | 模板文件组件
[`tpl`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/tpl) | | 可定制含占位符的内容模板文件 | |
| | Swing界面工具
[`ui`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/ui) | Swing组件
[`cpt`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/ui/cpt) | 部分功能基于`org.jb.beauty-eye(3.7)`
封装。可美化Swing外观,提供主窗口、
浮动窗口、面板、表单、选框、系统托
盘、布局样式等常用组件 | [`示例`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/warp/ui/test) |
| | | 拓扑图绘制器
[`topo`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/ui/topo) | 基于`org.eclipse.draw2d(1.0.0)`与
`org.jgraph.jGraph(1.0.0)`封装。
通过输入邻接矩阵(可含源宿点/必经
点)自动根据边权换算边距,同时映射
到极坐标系,绘制对应的拓扑图 | [`示例`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/warp/ui/test/TestTopoGraphUI.java) |
| | Excel组件
[`xls`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/warp/xls) | | 基于`org.apache.poi.poi-ooxml(3.9)`
封装。支持对xls/xlsx文件操作 | [`示例`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/warp/xls/test/TestExcel.java) |
| **算法包**
[`exp.libs.algorithm`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm) | 基本算法
[`basic`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/basic) | | 排序、布隆过滤器、哈夫曼编码、
哈希算法等(未实装) | |
| | 数据结构
[`struct`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/struct) | 拓扑图
[`graph`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/struct/graph) | 拓扑图模型
(支持有向/无向、源宿点、必经点) | |
| | | 队列
[`queue`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/struct/queue) | 循环队列、生产者消费者队列、
优先队列、流式并发队列等 | [`示例`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/algorithm/struct/queue/sc/test) |
| | | 红黑树
[`rbt`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/struct/rbt) | 未实装 | |
| | 搜索
[`search`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/search) | | 未实装 | |
| | 数学
[`math`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/math) | 数学算法
[`MathUtils`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/math/MathUtils.java) | 归一化函数、卡马克浮点数快速算法、
异或交换、二进制计数等 | |
| | | 素数
[`Prime`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/math/Prime.java) | 埃拉托斯特尼筛法
时/空复杂度:O(n) | |
| | | 矩阵运算
[`Mat`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/math/Mat.java) | 未实装 | |
| | 图论
[`graph`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/graph) | | 未实装 | |
| | 计算几何
[`gmtry`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/gmtry) | | 未实装 | |
| | 动态规划
[`dync`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/dync) | | 未实装 | |
| | 最短路径算法
`spa`
| [`Dijkstra`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/spa/Dijkstra.java) | 适用单源最短路问题
时间复杂度:O(V \* lgV+E) | [`测试`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/algorithm/spa/test/TestDijkstra.java) |
| | | [`BellmanFord`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/spa/BellmanFord.java) | 适用单源最短路问题(未实装)
时间复杂度:O(V \* E)
空间复杂度:O(V + E) | |
| | | [`SPFA`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/spa/SPFA.java) | (BellmanFord的优化版(未实装)
时间复杂度:O(k \* E)
空间复杂度:O(V + E) | |
| | | [`Johonson`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/spa/Johonson.java) | 适用全源最短路问题(未实装)
时间复杂度:O(V \* E \* lgV) | |
| | | [`Floyd`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/spa/Floyd.java) | 适用全源最短路问题(未实装)
时间复杂度:O(V^3)
空间复杂度:O(V^2) | |
| | 启发式算法
`heuristic`
| [`aca`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/heuristic/aca) | 蚁群算法(未实装) | |
| | | [`qaca`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/heuristic/qaca) | 量子蚁群算法(引入量子环境改进的
蚁群算法:量子比特、量子概率幅、
量子态、量子旋转门等) | [`示例`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/algorithm/heuristic/qaca/test/TestQACA.java) |
| | NP难问题
[`np`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/np) | [`ispa`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/np/ispa) | 含必经点的最短路问题:
自动根据场景用[`spa`](#spa)或[`启发式算法`](#heuristic)求解 | [`测试`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/test/java/exp/libs/algorithm/np/ispa/test/TestISPA.java) |
| | | [`tsp`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/np/tsp) | 旅行商问题(未实装) | |
| | 深度学习
[`dl`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/dl) | [`tensorflow`](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/exp/libs/algorithm/dl/tensorflow) | 基于`org.tensorflow(1.6.0)`封装。
提供TensorFlow训练模型调用接口 | |
## 第三方构件修正记录
### [修正commons-httpclient-3.1重定向丢失cookie问题](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/org/apache/commons/httpclient)
```xml
commons-httpclient
commons-httpclient
3.1-rc1
```
使用此版本的HttpClient访问一个会发生重定向跳转的URL时,会自动执行跳转,直到跳转到最后一个目标URL为止,而这个自动的重定向行为无法被禁止。由此会发生两个现象:
1. 使用HttpClient访问原始URL后,直接返回的状态码就是200 (而非302)
2. 得到的Response Header是最后一个URL的Response Header,而中间跳转的URL的Response Header全部丢失
第1点 其实影响不大,但 第2点 会**导致中间跳转的URL所返回的Set-Cookie丢失**。
对爬虫开发而言,这个问题是致命的:
如要模拟登陆时,通常登陆成功后会返回cookie并自动重定向到网站主页,而这个过程中丢失了cookie就相当于登陆失败。
因此主要针对 第2点 修正如下:
**记录中间所有URL返回的Response Header中的Set-Cookie,并全部追加到最后一个URL的Response Header中**。
### 修正JDK1.6/1.7不支持TLSv1.2协议的HTTPS问题
```xml
org.bouncycastle
bcprov-jdk15on
1.54
```
> *Bouncy Castle是一种用于 Java 平台的开放源码的轻量级密码术包,它支持大量的密码术算法,并提供JCE 1.2.1的实现*
JDK1.6/1.7仅支持遵循TLSv1.1协议的HTTPS访问,若网站强制要求使用TLSv1.2协议,JDK1.6/1.7会直接报错。
为了解决这个问题,从而**引入Bouncy Castle重写JDK的默认SSLSocket的通信安全密级协议**,使得JDK1.6/1.7支持TLSv1.2。
> *由于JDK1.8已支持TLSv1.2,因此此问题仅针对JDK1.6/1.7环境*
### [屏蔽proxool-0.9.1连接池调试日志](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/org/logicalcobwebs/proxool)
```xml
com.cloudhopper.proxool
proxool
0.9.1
```
此版本的连接池在运行期间会打印很多并非`slf4j`所打印的调试日志(基本都是使用`commons-logging`打印),无法通过配置屏蔽之,导致程序输出混乱。
为此**强制注释相关日志代码禁止其输出调试日志**。
### [重写commons-io-2.4返回值](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/org/apache/commons/io)
```xml
commons-io
commons-io
2.4
```
主要针对其中的`org.apache.commons.io.FileUtils`的函数返回值进行重写:
把其中的void返回值修正为boolean,并捕获相关抛出的异常,**以便进行二次封装**。
### [修正构造函数可见性](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/org/apache/poi/xssf/usermodel)
```xml
org.apache.poi
poi-ooxml
3.9
```
修改`org.apache.poi.xssf.usermodel.XSSFHyperlink`的可见性为public,**以便进行二次封装**。
### [去除类的final声明](https://github.com/lyy289065406/exp-libs/tree/master/exp-libs/src/main/java/org/quartz)
```xml
org.quartz-scheduler
quartz
2.2.1
```
去除类`org.quartz.CronExpression`的final声明,**以便进行二次封装**。
## 版权声明
[-EXP%202016-blue.svg)](http://exp-blog.com) [](https://www.gnu.org/licenses/gpl-3.0)
- Site: [http://exp-blog.com](http://exp-blog.com)
- Mail: 289065406@qq.com
------