SpringBoot2.x简单集成Flowable
环境和版本
window10
java1.8
mysql8
flowable6
springboot 2.7.6
配置
使用IDEA创建一个SpringBoot项目
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.example</groupId><artifactId>flowable-demo</artifactId><version>0.0.1-SNAPSHOT</version><name>flowable-demo</name><description>flowable-demo</description><properties><java.version>1.8</java.version><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding><spring-boot.version>2.7.6</spring-boot.version></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.flowable</groupId><artifactId>flowable-spring-boot-starter</artifactId><version>6.4.1</version><exclusions><!-- 这里要排除mybatis,否则会覆盖mybatis-plus引入的mybatis版本 --><exclusion><groupId>org.mybatis</groupId><artifactId>mybatis</artifactId></exclusion></exclusions></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-jdbc</artifactId></dependency><!-- mybatis-plus --><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-boot-starter</artifactId><version>3.5.2</version></dependency><!-- mybatis-plus generator --><dependency><groupId>com.baomidou</groupId><artifactId>mybatis-plus-generator</artifactId><version>3.5.3</version></dependency><dependency><groupId>org.freemarker</groupId><artifactId>freemarker</artifactId><version>2.3.31</version></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId><scope>runtime</scope><optional>true</optional></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><scope>runtime</scope></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><optional>true</optional></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency></dependencies><dependencyManagement><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-dependencies</artifactId><version>${spring-boot.version}</version><type>pom</type><scope>import</scope></dependency></dependencies></dependencyManagement><build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.8.1</version><configuration><source>1.8</source><target>1.8</target><encoding>UTF-8</encoding></configuration></plugin><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><version>${spring-boot.version}</version><configuration><mainClass>com.example.flowable.demo.FlowableDemoApplication</mainClass><skip>true</skip></configuration><executions><execution><id>repackage</id><goals><goal>repackage</goal></goals></execution></executions></plugin></plugins></build>
</project>
application.yml中配置
mybatis-plus:global-config:db-config:logic-delete-field: deletedlogic-delete-value: 1logic-not-delete-value: 0configuration:log-impl: org.apache.ibatis.logging.stdout.StdOutImplspring:datasource:url: jdbc:mysql://localhost:3306/flowable_demo?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&allowMultiQueries=true&nullCatalogMeansCurrent=truedriver-class-name: com.mysql.cj.jdbc.Driverusername: rootpassword: qk123type: com.zaxxer.hikari.HikariDataSourcehikari:minimum-idle: 5maximum-pool-size: 15auto-commit: trueidle-timeout: 30000pool-name: DatebookHikariCPmax-lifetime: 1800000connection-timeout: 30000connection-test-query: SELECT 1# jackson 配置jackson:date-format: yyyy-MM-dd HH:mm:sslocale: zhtime-zone: GMT+8#server.servlet.context-path=/
# swagger2使用,不配置这个项目报错 Failed to start bean ‘documentationPluginsBootstrapper‘
flowable:# 第一次改为true,创建完数据库表结构后,改为falsedatabase-schema-update: trueasync-executor-activate: false
server:port: 11000
# 设置flowable日志级别
logging:level:org.flowable: debug
#spring.mvc.pathmatch.matching-strategy=ant-path-matcher
再创建一个数据库
然后运行
数据库中会自动生成表结构
表结构位置
常用的类
flowable的autoconfig包已经自动配置好了需要的类
直接@Resource就可以使用
使用
部署一个简单流程
import com.example.flowable.demo.controller.vo.DefinitionRequest;
import com.example.flowable.demo.vo.R;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomUtils;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.impl.bpmn.deployer.ResourceNameUtil;
import org.flowable.engine.repository.DeploymentBuilder;
import org.flowable.engine.repository.Model;
import org.flowable.engine.repository.ModelQuery;
import org.springframework.web.bind.annotation.*;import javax.annotation.Resource;
import java.nio.charset.StandardCharsets;
import java.util.List;@Slf4j
@RestController
@RequestMapping("/modeler")
public class ModelerController {@Resourceprivate RepositoryService repositoryService;/*** 部署流程* @param definitionRequest* @return*/@PutMapping("/deploy")public R deployModeler(@RequestBody DefinitionRequest definitionRequest) {String xmlDefinition = definitionRequest.getXmlDefinition();DeploymentBuilder deployment = repositoryService.createDeployment();byte[] bytes = xmlDefinition.getBytes(StandardCharsets.UTF_8);int i = RandomUtils.nextInt();String key = "demo_flow_" + i;String name = "示例流程";String category = "hello_" + i;// 流程定义的名称,必须是特定的结尾,否则不会解析String resourceName = "demo_flow_name_" + i + "." + ResourceNameUtil.BPMN_RESOURCE_SUFFIXES[0];String id = deployment.addBytes(resourceName, bytes).key(key).category(category).name(name).deploy().getId();log.info("部署后id为:{}", id);Model model = repositoryService.newModel();model.setDeploymentId(id);model.setCategory("model_" + category);model.setKey("model_key_" + i);model.setName("model_name_" + i);model.setVersion(1);repositoryService.saveModel(model);log.info("模型保存后id:{}", model.getId());// 设置模型可编辑资源repositoryService.addModelEditorSource(model.getId(), bytes);return R.success(id);}/*** 查看流程模型列表* @return*/@GetMapping("/list")public R list() {ModelQuery modelQuery = repositoryService.createModelQuery();List<Model> list = modelQuery.list();return R.success();}}
用postman发送一个请求
{"xmlDefinition": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<definitions xmlns=\"http://www.omg.org/spec/BPMN/20100524/MODEL\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n xmlns:bpmndi=\"http://www.omg.org/spec/BPMN/20100524/DI\"\n xmlns:omgdc=\"http://www.omg.org/spec/DD/20100524/DC\"\n xmlns:omgdi=\"http://www.omg.org/spec/DD/20100524/DI\"\n xmlns:flowable=\"http://flowable.org/bpmn\"\n typeLanguage=\"http://www.w3.org/2001/XMLSchema\"\n expressionLanguage=\"http://www.w3.org/1999/XPath\"\n targetNamespace=\"http://www.flowable.org/processdef\">\n\n <process id=\"holidayRequest\" name=\"Holiday Request\" isExecutable=\"true\">\n\n <startEvent id=\"startEvent\"/>\n <sequenceFlow sourceRef=\"startEvent\" targetRef=\"approveTask\"/>\n\n <userTask id=\"approveTask\" name=\"Approve or reject request\"/>\n <sequenceFlow sourceRef=\"approveTask\" targetRef=\"decision\"/>\n\n <exclusiveGateway id=\"decision\"/>\n <sequenceFlow sourceRef=\"decision\" targetRef=\"externalSystemCall\">\n <conditionExpression xsi:type=\"tFormalExpression\">\n <![CDATA[\n ${approved} ]]>\n </conditionExpression>\n </sequenceFlow>\n <sequenceFlow sourceRef=\"decision\" targetRef=\"sendRejectionMail\">\n <conditionExpression xsi:type=\"tFormalExpression\">\n <![CDATA[\n ${approved} ]]>\n </conditionExpression>\n </sequenceFlow>\n\n <serviceTask id=\"externalSystemCall\" name=\"Enter holidays in external system\"\n flowable:class=\"org.flowable.CallExternalSystemDelegate\"/>\n <sequenceFlow sourceRef=\"externalSystemCall\" targetRef=\"holidayApprovedTask\"/>\n\n <userTask id=\"holidayApprovedTask\" name=\"Holiday approved\"/>\n <sequenceFlow sourceRef=\"holidayApprovedTask\" targetRef=\"approveEnd\"/>\n\n <serviceTask id=\"sendRejectionMail\" name=\"Send out rejection email\"\n flowable:class=\"org.flowable.SendRejectionMail\"/>\n <sequenceFlow sourceRef=\"sendRejectionMail\" targetRef=\"rejectEnd\"/>\n\n <endEvent id=\"approveEnd\"/>\n\n <endEvent id=\"rejectEnd\"/>\n </process>\n\n</definitions>"
}
在数据库中会出现对应的数据
接着发起流程
import com.example.flowable.demo.controller.vo.DefinitionRequest;
import com.example.flowable.demo.controller.vo.ProcessDefinitionResp;
import com.example.flowable.demo.vo.R;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.repository.ProcessDefinition;
import org.flowable.engine.repository.ProcessDefinitionQuery;
import org.flowable.engine.runtime.ProcessInstance;
import org.springframework.web.bind.annotation.*;import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;@Slf4j
@RestController
@RequestMapping("/process")
public class ProcessController {@Resourceprivate RuntimeService runtimeService;@Resourceprivate RepositoryService repositoryService;/*** 查看流程定义列表* @return*/@GetMapping("/list")public R list() {ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery();List<ProcessDefinition> list = processDefinitionQuery.list();log.info("得到流程定义数量:{}", list.size());// ProcessDefinition无法序列化,需要自己转List<ProcessDefinitionResp> respList = new ArrayList<>();for (ProcessDefinition processDefinition : list) {respList.add(ProcessDefinitionResp.copy(processDefinition));}return R.success(respList);}/*** 启动流程* @param definitionRequest* @return*/@PutMapping("/create")public R create(@RequestBody DefinitionRequest definitionRequest) {String deploymentId = definitionRequest.getDeploymentId();ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery();ProcessDefinition processDefinition = processDefinitionQuery.deploymentId(deploymentId).singleResult();Map<String, Object> variables = new HashMap<>();variables.put("employee","张三") ;// 谁申请请假variables.put("nrOfHolidays",3); // 请几天假variables.put("description","工作累了,想出去玩玩"); // 请假的原因ProcessInstance holidayRequest = runtimeService.startProcessInstanceByKey("holidayRequest", variables);String id = holidayRequest.getId();log.info("启动的流程实例id:{}, 流程定义id:{}", id, processDefinition.getId());return R.success(id);}
}
查看任务
import com.example.flowable.demo.controller.vo.TaskResp;
import com.example.flowable.demo.vo.R;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.TaskService;
import org.flowable.task.api.Task;
import org.flowable.task.api.TaskQuery;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;@Slf4j
@RestController
@RequestMapping("/task")
public class TaskController {@Resourceprivate TaskService taskService;/*** 查看所有待办任务* @return*/@GetMapping("/list")public R list() {TaskQuery taskQuery = taskService.createTaskQuery();List<Task> list = taskQuery.list();List<TaskResp> list1 = new ArrayList<>();for (Task task : list) {list1.add(TaskResp.copy(task));}return R.success(list1);}
}
其他类
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;import java.io.Serializable;@Getter
@Setter
@Accessors(chain = true)
public class R implements Serializable {private int code;private String message;private Object data;public static R gen(int code, String message, Object data) {return new R().setCode(code).setMessage(message).setData(data);}public static R success() {return R.success(null);}public static R success(Object data) {return R.success("请求成功", data);}public static R success(String message, Object data) {return R.gen(0, message, data);}public static R fail() {return R.fail(null);}public static R fail(Object data) {return R.fail("请求失败", data);}public static R fail(String message, Object data) {return R.gen(-1, message, data);}
}
import lombok.Getter;
import lombok.Setter;/*** 流程定义请求*/
@Getter
@Setter
public class DefinitionRequest {// 流程xml定义,部署流程用private String xmlDefinition;// 部署id,创建流程用private String deploymentId;
}
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.flowable.engine.repository.ProcessDefinition;import java.io.Serializable;/*** 流程定义*/
@Getter
@Setter
@Accessors(chain = true)
public class ProcessDefinitionResp implements Serializable {String id;String category;String name;String key;String description;int version;String resourceName;String deploymentId;String diagramResourceName;boolean hasStartFormKey;boolean hasGraphicalNotation;boolean suspended;String tenantId;String derivedFrom;String derivedFromRoot;int derivedVersion;String engineVersion;public static ProcessDefinitionResp copy(ProcessDefinition processDefinition) {ProcessDefinitionResp definitionResp = new ProcessDefinitionResp();definitionResp.setId(processDefinition.getId());definitionResp.setCategory(processDefinition.getCategory());definitionResp.setName(processDefinition.getName());definitionResp.setKey(processDefinition.getKey());definitionResp.setDescription(processDefinition.getDescription());definitionResp.setVersion(processDefinition.getVersion());definitionResp.setResourceName(processDefinition.getResourceName());definitionResp.setDeploymentId(processDefinition.getDeploymentId());definitionResp.setDiagramResourceName(processDefinition.getDiagramResourceName());definitionResp.setHasStartFormKey(processDefinition.hasStartFormKey());definitionResp.setHasGraphicalNotation(processDefinition.hasGraphicalNotation());definitionResp.setSuspended(processDefinition.isSuspended());definitionResp.setTenantId(processDefinition.getTenantId());definitionResp.setDerivedFrom(processDefinition.getDerivedFrom());definitionResp.setDerivedFromRoot(processDefinition.getDerivedFromRoot());definitionResp.setDerivedVersion(processDefinition.getDerivedVersion());definitionResp.setEngineVersion(processDefinition.getEngineVersion());return definitionResp;}
}
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.flowable.task.api.Task;import java.io.Serializable;
import java.util.*;/*** 任务*/
@Getter
@Setter
@Accessors(chain = true)
public class TaskResp implements Serializable {String id;String name;String description;int priority;String owner;String assignee;String processInstanceId;String executionId;String taskDefinitionId;String processDefinitionId;String scopeId;String subScopeId;String scopeType;String scopeDefinitionId;Date createTime;String taskDefinitionKey;Date dueDate;String category;String parentTaskId;String tenantId;String formKey;Map<String, Object> taskLocalVariables;Map<String, Object> processVariables;List<IdentityLinkInfoResp> identityLinks;Date claimTime;public static TaskResp copy(Task task) {TaskResp taskResp = new TaskResp();taskResp.setId(task.getId());taskResp.setName(task.getName());taskResp.setDescription(task.getDescription());taskResp.setPriority(task.getPriority());taskResp.setOwner(task.getOwner());taskResp.setAssignee(task.getAssignee());taskResp.setProcessInstanceId(task.getProcessInstanceId());taskResp.setExecutionId(task.getExecutionId());taskResp.setTaskDefinitionId(task.getTaskDefinitionId());taskResp.setProcessDefinitionId(task.getProcessDefinitionId());taskResp.setScopeId(task.getScopeId());taskResp.setSubScopeId(task.getSubScopeId());taskResp.setScopeType(task.getScopeType());taskResp.setScopeDefinitionId(task.getScopeDefinitionId());taskResp.setCreateTime(task.getCreateTime());taskResp.setTaskDefinitionKey(task.getTaskDefinitionKey());taskResp.setDueDate(task.getDueDate());taskResp.setCategory(task.getCategory());taskResp.setParentTaskId(task.getParentTaskId());taskResp.setTenantId(task.getTenantId());taskResp.setFormKey(task.getFormKey());taskResp.setTaskLocalVariables(task.getTaskLocalVariables());taskResp.setProcessVariables(task.getProcessVariables());
// List<? extends IdentityLinkInfo> identityLinks1 = task.getIdentityLinks();taskResp.setIdentityLinks(new ArrayList<>());
// if (Objects.nonNull(identityLinks1) && !identityLinks1.isEmpty()) {
// for (IdentityLinkInfo identityLinkInfo : identityLinks1) {
// taskResp.getIdentityLinks().add(IdentityLinkInfoResp.copy(identityLinkInfo));
// }
// }taskResp.setClaimTime(task.getClaimTime());return taskResp;}
}
Flowable基本的模块
Modeler 模型
Process 流程
Task 任务
模型部署后,就是流程定义。
从流程定义创建流程实例。
流程实例中有多个任务,任务有很多种类。
相关文章:
![](https://img-blog.csdnimg.cn/6b5c94724bd94d33ab4c310e3bd32f19.png#pic_center)
SpringBoot2.x简单集成Flowable
环境和版本 window10 java1.8 mysql8 flowable6 springboot 2.7.6 配置 使用IDEA创建一个SpringBoot项目 <?xml version"1.0" encoding"UTF-8"?> <project xmlns"http://maven.apache.org/POM/4.0.0" xmlns:xsi"http://www.…...
![](https://img-blog.csdnimg.cn/aa6d07a916e64b82af72581f97f7c84e.png)
微信小程序一键获取位置
需求 有个表单需要一键获取对应位置 并显示出来效果如下: 点击一键获取获取对应位置 显示在 picker 默认选中 前端 代码如下: <view class"box_7 {{ showChange1? change-style: }}"><view class"box_11"><view class"…...
![](https://img-blog.csdnimg.cn/a399c55e4b7549078dd8ab3117e3bc09.png)
Linux性能优化--使用性能工具发现问题
9.0 概述 本章主要介绍综合运用之前提出的性能工具来缩小性能问题产生原因的范围。阅读本章后,你将能够: 启动行为异常的系统,使用Linux性能工具追踪行为异常的内核函数或应用程序。启动行为异常的应用程序,使用Linux性能工具追…...
![](https://img-blog.csdnimg.cn/71e4a3eb956044cf99e667f5ca6a8354.png)
【Proteus仿真】【STM32单片机】路灯控制系统
文章目录 一、功能简介二、软件设计三、实验现象联系作者 一、功能简介 本项目使用Proteus8仿真STM32单片机控制器,使用LCD1602显示模块、人体红外传感器、光线检测模块、路灯继电器控制等。 主要功能: 系统运行后,LCD1602显示时间、工作模…...
![](https://img-blog.csdnimg.cn/fa0c26aad8164f718a8ab56213c1d0e2.png)
Flutter笔记:发布一个Flutter头像模块 easy_avatar
Flutter笔记 发布一个头像Flutter模块 easy_avatar 作者:李俊才 (jcLee95):https://blog.csdn.net/qq_28550263 邮箱 :291148484163.com 本文地址:https://blog.csdn.net/qq_28550263/article/details/1339…...
![](https://img-blog.csdnimg.cn/9463a906287940f5b84a23232b6f1e6b.png)
标准化助推开源发展丨九州未来参编开源领域4项团体标准正式发布
在数字中国及数字经济时代的大背景下,开源逐步成为各行业数字化发展的关键模式。在开源产业迅速发展的同时,如何评估、规范开源治理成为行业极度关注的问题。 近日,中电标2023年第27号团体标准公告正式发布,九州未来作为起草单位…...
![](https://img-blog.csdnimg.cn/img_convert/98fe73d0d8943105c273a07d620e344a.png)
ChatGPT对于留学生论文写作有哪些帮助?
2022年11月,OpenAI公司的智能聊天产品ChatGPT横空出世,并两个月之内吸引了超过1亿用户,打破了TikTok(抖音国际版)9个月用户破亿的纪录。 划时代的浪潮 ChatGPT的火爆立即引起了全球关注并成为热门话题,它…...
![](https://img-blog.csdnimg.cn/009ae31184b542cb8cf5e256af42d0e1.png)
【yolov8目标检测】使用yolov8训练自己的数据集
目录 准备数据集 python安装yolov8 配置yaml 从0开始训练 从预训练模型开始训练 准备数据集 首先得准备好数据集,你的数据集至少包含images和labels,严格来说你的images应该包含训练集train、验证集val和测试集test,不过为了简单说…...
![](https://img-blog.csdnimg.cn/b8039b9b770f427bbec95798368f1711.png)
【vue+nestjs】gitee第三方授权登录【超详细】
项目场景: 前端使用vue3ts 后端使用nestjs 1.配置gitee第三方设置 1.找到账号设置 2.找到数据管理下的第三方应用 3.点击创建,进入配置 2.代码演示 特别注意: 如果你跟我一样是前后端分离的模式开发的,应用回调地址填写的应该是你的前…...
![](https://www.ngui.cc/images/no-images.jpg)
node 第八天 使用前后端不分离的方式实现cookie登录验证
实现cookie登录, 第一次登录成功后, cookie由服务端设置并保存在客户端, 后续访问在cookie过期前 (过期时间由后端设置) 将不需要登录cookie出现的背景是 HTTP是无连接的,无状态的, 半双工(http2.0以下), 所以需要一个媒介存在http中, 服务端可以操作, 客户端也可以…...
![](https://img-blog.csdnimg.cn/019b90f9b4a64a4fadd0f5f09a7ce86b.png)
Ubuntu系统如何进行网络连接-连接电脑局域网-物联网开发-Ubuntu系统维护
一、前言 在Ubuntu系统的维护中,我们常常需要对VMware中的Ubuntu虚拟机配置网络连接,以连接服务器下载或安装软件包以及进行网络通信等。 基于上述问题,本文将着重分享Ubuntu配置网络链接的若干方法。 二、网络连接模式 打开VM,右…...
![](https://img-blog.csdnimg.cn/84e4f302e57d484db21cb6e391517ed1.png)
STL库——Vector常见使用接口
一、介绍 1. vector是表示可变大小数组的序列容器,就像数组一样,vector也采用的连续存储空间来存储元素。也就是意味着可以采用下标对vector的元素 进行访问,和数组一样高效。但是又不像数组,它的大小是可以动态改变的࿰…...
![](https://www.ngui.cc/images/no-images.jpg)
将文件(File 对象)分割成多个块
如果要将文件(File 对象)分割成多个块,可以使用 JavaScript 中的 Blob 和 File 构造函数以及数组的 slice 方法。以下是一个示例: // 创建一个 File 对象,例如从文件输入框获取的文件 const file document.getElemen…...
![](https://img-blog.csdnimg.cn/a6bce12ee70440c0b7344fcb7881e11e.png)
若要对多态类进行深拷贝,应使用虚函数的clone,而不是公开的拷贝构造赋值
拷贝一个多态类可能会导致切片问题,为了解决这个问题,应覆盖一个虚clone函数,让他根据实际类型进行复制并返回一个到新对象的所有权的指针(std::unique_ptr),在派生类,通过使用所谓的协变返回类型来返回派生…...
![](https://www.ngui.cc/images/no-images.jpg)
同构字符串(C++解法)
题目 给定两个字符串 s 和 t ,判断它们是否是同构的。 如果 s 中的字符可以按某种映射关系替换得到 t ,那么这两个字符串是同构的。 每个出现的字符都应当映射到另一个字符,同时不改变字符的顺序。不同字符不能映射到同一个字符上…...
![](https://img-blog.csdnimg.cn/5af251f7c39f4ddf9472e6a0411d9b1b.png)
『Linux升级路』基本指令
🔥博客主页:小王又困了 📚系列专栏:Linux 🌟人之为学,不日近则日退 ❤️感谢大家点赞👍收藏⭐评论✍️ 目录 一、认识操作系统 📒1.1什么是操作系统 📒1.2操作系统…...
![](https://img-blog.csdnimg.cn/fe8d4f67d8c548c7a9f7f162bcb49726.png)
python argparse解析参数
用法比较简单,直接看代码 import argparseargparser argparse.ArgumentParser(descriptionthis is a hello argparser program) argparser.add_argument(--arg1, -a, typestr, helparg1 has value) argparser.add_argument(--arg2, typestr, default"value2&q…...
![](https://img-blog.csdnimg.cn/b235c1f23cb245f9853bed296b5ee79c.png)
【数据挖掘】数据挖掘、关联分析、分类预测、决策树、聚类、类神经网络与罗吉斯回归
目录 一、简介二、关于数据挖掘的经典故事和案例2.1 正在影响中国管理的10大技术2.2 从数字中能够得到什么?2.3 一个网络流传的笑话(转述)2.4 啤酒与尿布2.5 网上书店关联销售的案例2.6 数据挖掘在企业中的应用2.7 交叉销售 三、数据挖掘入门3.1 什么激发了数据挖掘…...
![](https://img-blog.csdnimg.cn/125cce5b939749b5877cda29ff8a576a.bmp)
nodejs+vue 学生宿舍管理系统设计与实现
可将教师信息、宿管信息、学生信息、楼栋信息等输入到系统中。只有管理员才能录入相关的资料,按照提示,输入相应的资料,而“导入”则可以通过上传档案,导入成功后,相应的寝室就会相应的减少。在录入大楼的时候…...
![](https://www.ngui.cc/images/no-images.jpg)
汽车R155法规包含那些国家?
标签:R155法规国; R155强制标准;R155;UCNECE; R155是由联合国欧洲经济委员会(UNECE)的世界汽车行业论坛(WP.29)发布的法规,专门针对汽车的网络安全。因为它是…...
![](https://www.ngui.cc/images/no-images.jpg)
一个简易的低代码
前言 最近接手了一个低代码平台可视化大屏做二次开发,在这里做一些记录。 低代码平台简介:低代码平台是一种开发工具,它可以让开发人员使用简单的拖拽和配置来创建应用程序,而不需要编写大量的代码。低代码平台通常包括一个可视化…...
![](https://img-blog.csdnimg.cn/img_convert/b16a8e688a6b6471bf6f9031d5498d2a.png)
【JVM系列】- 类加载子系统与加载过程
类加载子系统与加载过程 😄生命不息,写作不止 🔥 继续踏上学习之路,学之分享笔记 👊 总有一天我也能像各位大佬一样 🏆 博客首页 怒放吧德德 To记录领地 🌝分享学习心得,欢迎指正…...
![](https://img-blog.csdnimg.cn/img_convert/150016e4fc52de855ed54a8858e29927.png)
Amazon图片下载器:利用Scrapy库完成图像下载任务
概述 本文介绍了如何使用Python的Scrapy库编写一个简单的爬虫程序,实现从Amazon网站下载商品图片的功能。Scrapy是一个强大的爬虫框架,提供了许多方便的特性,如选择器、管道、中间件、代理等。本文将重点介绍如何使用Scrapy的图片管道和代理…...
![](https://img-blog.csdnimg.cn/415f52c017a449d180cfed407d4acf95.gif)
Unity中Shader的Pass的复用
文章目录 前言一、怎么实现Pass的复用1、给需要引用的Pass给定特定的名字2、在需要引用 Pass 的Shader中,在Pass的平行位置使用 UsePass "ShaderPath PassName" 二、实现一个没被遮挡的部分显示模型原本的样子,遮挡部分显示模型的XRay效果1、…...
![](https://www.ngui.cc/images/no-images.jpg)
vue内容自适应方法
Vue中可以通过以下几种方式实现内容自适应: 使用CSS媒体查询:使用CSS媒体查询可以根据屏幕大小来动态改变元素的样式。例如,可以设置一个div元素在屏幕宽度小于600px时宽度为100%,在屏幕宽度大于600px时宽度为50%。 使用Vue的计算…...
![](https://www.ngui.cc/images/no-images.jpg)
RustDay05------Exercise[41-50]
41.使用模块的函数 mod 是用于创建模块的关键字。模块是一种组织代码的方式,它可以包含函数 (fn)、结构体 (struct)、枚举 (enum)、常量 (const)、其他模块 (mod) 等。模块用于组织和封装代码,帮助将代码分割成可管理的单元。模块可以形成层次结构&…...
![](https://img-blog.csdnimg.cn/c8150c4fee064fe28ff01cb6aa8ead5d.png)
C语言实现通讯录(超详细)
1.实现怎样一个通讯录 实现一个通讯录联系人信息:1.可以保存100个人的信息名字2.添加联系人年龄3.删除指定联系人性别4.查找指定联系人电话5.修改指定联系人住址6.排序联系人7.显示所有联系人信息 2.通讯录的实现 2.1创建两个源文件和一个头文件 首先我们创建con…...
![](https://www.ngui.cc/images/no-images.jpg)
【Python机器学习】零基础掌握MinCovDet协方差估计
如何更精准地评估资产的风险和收益? 在投资领域,资产的风险和收益评估是至关重要的。传统的协方差矩阵虽然在某种程度上能反映资产间的关联性,但也存在一定的局限性。例如如果样本数量较少,传统的协方差矩阵可能会出现偏差,从而影响投资决策。 假设现在有一个投资组合,…...
![](https://img-blog.csdnimg.cn/img_convert/8f6313da708eba3ae27c80ae541a5431.jpeg)
2023年【四川省安全员A证】模拟试题及四川省安全员A证作业模拟考试
题库来源:安全生产模拟考试一点通公众号小程序 2023年四川省安全员A证模拟试题为正在备考四川省安全员A证操作证的学员准备的理论考试专题,每个月更新的四川省安全员A证作业模拟考试祝您顺利通过四川省安全员A证考试。 1、【多选题】36V照明适用的场所条…...
![](https://www.ngui.cc/images/no-images.jpg)
Flask项目log的集成
一、引入log 在项目的init.py文件中: import logging from logging.handlers import RotatingFileHandlerfrom flask_wtf.csrf import CSRFProtect from flask import Flask from flask_sqlalchemy import SQLAlchemy from redis import StrictRedis from flask_s…...
![](https://www.chenjiayu.cn/wp-content/uploads/2020/04/1-300x212.jpg)
河南企业网站建设/百度企业查询
华为荣耀4C从EMUI3.0安卓4.4升级到4.0 安卓版本升级到6.0,荣耀畅玩4C—升级教程。测试型号是CHM-TL00H ,原系统版本是 EMUI系统3.0.安卓4.4,因为新版的微信以及其他APP很多都要求安卓5.0以上了,所以查询了网上的方法将老的华为荣耀…...
![](/images/no-images.jpg)
临朐昌大建设/杭州seo建站
站在空无一人略有冷意的街头,突然有种恍如隔世的感觉:这就是传说中橘生淮北则为枳的淮北?咦,我为什么会出现在这里? 于是我陷入了深深的思考。 关于对过去的思考 托尔斯泰说过:幸福的家庭是相似的ÿ…...
![](/images/no-images.jpg)
企业网上登记注册平台/seo软件视频教程
1_zclevel level 战场等级atitle 联盟给的头衔IDhtitle 部落给的头衔IDatitlestring 联盟给的头衔文字 一般做公告显示htitlestring 部落给的头衔文字一般做公告显示xp 升级需要经验值addspell 给予的BUFFaddtalent …...
![](/images/no-images.jpg)
怎么弄网站/广告营销公司
org.hibernate.cfg.Configuration实例代表了应用程序到SQL数据库的映射配置, Configuration对象提供了一个buildSessionFactory方法,该方法可以产生一个不可变的SessionFactory对象。 也可以直接实例化Configuration来获取一个实例,并为它指…...
![](/images/no-images.jpg)
双公示网站专栏建设/武汉百度推广公司
Java语言提供了很多修饰符,主要分为以下两类:访问修饰符非访问修饰符修饰符用来定义类、方法或者变量,通常放在语句的最前端。我们通过下面的例子来说明: public class className { // ...}private boolean myFlag;static final…...
![](/images/no-images.jpg)
公司网站的宣传栏怎么做/晨阳seo服务
文章目录计算方法代码实现计算方法 单纯矩阵normal matrix指的是符号ATAAATA^TAAA^TATAAAT的矩阵,他们的特征值互异。此外,单纯矩阵还有个特点,他们的特征空间彼此正交。 对于单纯矩阵,存在以下的谱定理Spectral theorem&…...