当前位置: 首页 > news >正文

网站在只有域名了/谷歌seo价格

网站在只有域名了,谷歌seo价格,python 网站建设,在线编辑事务管理 事务的定义 什么是事务 事务是由N步数据库操作序列组成的逻辑执行单元,这系列操作要么全执行,要么全放弃执行。 事务的特性(ACID) 原子性(Atomicity):事务是应用中不可再分的最小执行体(事务中部分执行失败就会回滚 。一致性(C…

事务管理

事务的定义

什么是事务

  • 事务是由N步数据库操作序列组成的逻辑执行单元,这系列操作要么全执行,要么全放弃执行。

事务的特性(ACID)

  • 原子性(Atomicity):事务是应用中不可再分的最小执行体(事务中部分执行失败就会回滚 。
  • 一致性(Consistency):事务执行的结果,须使数据从一个一致性状态,变为另一个一致性状态。
  • **隔离性(Isolation)😗*各个事务的执行互不干扰,任何事务的内部操作对其他的事务都是隔离的。
  • 持久性(Durability):事务一旦提交,对数据所做的任何改变都要记录到永久存储器中。

事务的隔离性

常见的并发异常

  • 第一类丢失更新、第二类丢失更新。
  • 脏读、不可重复读、幻读。

常见的隔离级别 (从低到高)

  • Read Uncommitted:读取未提交的数据。
  • Read Committed:读取已提交的数据。
  • Repeatable Read:可重复读。
  • Serializable:串行化。(可以解决所有的问题,但需要加锁降低数据库性能)

第一类丢失更新

image

(事务1的回滚导致事务2的数据更新失败)

第二类丢失更新

image

(事务1和事务2最终结果都是11,事务2不能接受)

脏读

image

(实际上事务2读到的11,实际上N已经是10了)

不可重复读

image

(事务2并没有对N变动,但先后结果不一样,查询单行数据导致不一致)

幻读

image

(查询多行数据导致不一致)

不用的处理方式对数据安全的影响

image

(一般中间两种比较适合)

数据库保证事务的实现机制

  • 悲观锁(数据库)
    • 共享锁(S锁):事务A对某数据加了共享锁后,其他事务只能对该数据加共享锁,但不能加排他锁。
    • 排他锁(X锁):事务A对某数据加了排他锁后,其他事务对该数据既不能加共享锁,也不能加排他锁。
  • 乐观锁(自定义)
    • 版本号、时间戳等
    • 在更新数据前,检查版本号是否发生变化。若变化则取消本次更新,否则就更新数据(版本号+1)。

Spring事务管理

  • 声明式事务(简单,常用的项目设置)
    • 通过XML配置,声明某方法的事务特征。
    • 通过注解,声明某方法的事务特征。
  • 编程式事务(适合数据库中很多操作,只需要控制部分操作)
    • 通过 TransactionTemplate 管理事务,并通过它执行数据库的操作。

示例

  • 需求:一个用户自动注册完自动发送帖子
  • 如果存在事务,整个会原子执行,报错后会回滚,也就是用户和帖子不会被创建在数据库中

声明式事务(常用,简单)

@Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED)
public Object save1(){User user = new User();user.setUsername("test");user.setSalt("abc");user.setPassword(CommunityUtil.md5("123" + user.getSalt()));user.setEmail("742uu12@qq.com");user.setHeaderUrl("http://www.nowcoder.com/101.png");user.setCreateTime(new Date());userMapper.insertUser(user);//发布帖子DiscussPost post = new DiscussPost();post.setUserId(user.getId());post.setTitle("hello");post.setContent("新人报道");post.setCreateTime(new Date());discussPostMapper.insertDiscussPost(post);Integer.valueOf("abc");return "ok";
}

//A调B,两者都有事务

//(REQUIRED):B支持当前事务(外部事务A),如果不存在则创建新事务

//(REQUIRES_NEW):B创建一个新事务,并且暂停当前事务(外部事务A)

//(NESTED):B如果当前存在事务(外部事务A),则嵌套在该事务中执行(有独立的提交和回滚),否则和REQUIRED一样

  • 使用Transactional注解,isolation规定策略,propagation规定传播方式;
  • 故意写一个报错的句子 Integer.valueOf(“abc”);

使用TransactionTemplate

public String save2(){transactionTemplate.setIsolationLevel(TransactionTemplate.ISOLATION_READ_COMMITTED);transactionTemplate.setPropagationBehavior(TransactionTemplate.PROPAGATION_REQUIRED);String result = transactionTemplate.execute(new TransactionCallback<String>() {@Overridepublic String doInTransaction(org.springframework.transaction.TransactionStatus transactionStatus) {User user = new User();user.setUsername("test");user.setSalt("abc");user.setPassword(CommunityUtil.md5("123" + user.getSalt()));user.setEmail("742uu12@qq.com");user.setHeaderUrl("http://www.nowcoder.com/101.png");user.setCreateTime(new Date());userMapper.insertUser(user);//发布帖子DiscussPost post = new DiscussPost();post.setUserId(user.getId());post.setTitle("hello");post.setContent("新人报道");post.setCreateTime(new Date());discussPostMapper.insertDiscussPost(post);return "ok";}});return result;
}

显示评论

  • 数据层
    • 根据实体查询一页评论数据。
    • 根据实体查询评论的数量。
  • 业务层
    • 处理查询评论的业务。
    • 处理查询评论数量的业务。
  • 表现层
    • 显示帖子详情数据时,
    • 同时显示该帖子所有的评论数据。

数据层DAO

  1. 编写Comment实体类:
package com.newcoder.community.entity;public class Comment {int id;int userId;int entityType;int entityId;int targetId;String content;String status;String createTime;public int getId() {return id;}public void setId(int id) {this.id = id;}public int getUserId() {return userId;}public void setUserId(int userId) {this.userId = userId;}public int getEntityType() {return entityType;}public void setEntityType(int entityType) {this.entityType = entityType;}public int getEntityId() {return entityId;}public void setEntityId(int entityId) {this.entityId = entityId;}public int getTargetId() {return targetId;}public void setTargetId(int targetId) {this.targetId = targetId;}public String getContent() {return content;}public void setContent(String content) {this.content = content;}public String getStatus() {return status;}public void setStatus(String status) {this.status = status;}public String getCreateTime() {return createTime;}public void setCreateTime(String createTime) {this.createTime = createTime;}@Overridepublic String toString() {return "Comment{" +"id=" + id +", userId=" + userId +", entityType=" + entityType +", entityId=" + entityId +", targetId=" + targetId +", content='" + content + '\'' +", status='" + status + '\'' +", createTime='" + createTime + '\'' +'}';}
}
  1. 定义CommentMapper接口
@Mapper
public interface CommentMapper {List<Comment> selectCommentsByEntity(int entityType, int entityId, int offset,int limit);int selectCountByEntity(int entityType, int entityId);}
  1. 编写comment-mapper.xml文件
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.newcoder.community.dao.CommentMapper"><sql id="selectFields">id, user_id, entity_type, entity_id, target_id, content, status, create_time</sql><select id="selectCommentByEntity" resultType="Comment">select<include refid="selectFields"/>from commentwhere entity_type = #{entityType} and entity_id = #{entityId}order by create_time desc</select><select id="selectCommentCount" resultType="int">select count(id)from commentwhere entity_type = #{entityType}and entity_id = #{entityId}mapper ></select></mapper>

业务层

  1. 编写CommentService类
@Service
public class CommentService {@Autowiredprivate CommentMapper commentMapper;public List<Comment> findCommentsByEntity(int entityType, int entityId, int offset, int limit){return commentMapper.selectCommentsByEntity(entityType,entityId,offset,limit);}public int findCommentCount(int entityType, int entityId){return commentMapper.selectCountByEntity(entityType,entityId);}}

Controller层

修改之前的getDiscussPost函数:

@RequestMapping(path = "/detail/{discussPostId}", method = RequestMethod.GET)public String getDiscussPost(@PathVariable(name = "discussPostId") int discussPostId, Model model, Page page) {DiscussPost post = discussPostService.findDiscussPostById(discussPostId);model.addAttribute("post", post);//帖子的作者User user = userService.findUserById(post.getUserId());model.addAttribute("user", user);//评论分页信息page.setLimit(5);page.setPath("/discuss/detail/" + discussPostId);page.setRows(post.getCommentCount());//直接从帖子中取List<Comment> commentList = commentService.findCommentsByEntity(ENTITY_TYPE_POST, post.getId(), page.getOffset(), page.getLimit());//遍历集合,将每个评论的其他信息查出来(这里嵌套是难点,之后可以在面试上说)List<Map<String, Object>> commentVoList = new ArrayList<>();if(commentList != null){for(Comment comment : commentList){//评论VoMap<String, Object> commentVo = new java.util.HashMap<>();//评论commentVo.put("comment",comment);//作者commentVo.put("user",userService.findUserById(comment.getUserId()));//回复列表(评论的评论)List<Comment> replyList = commentService.findCommentsByEntity(ENTITY_TYPE_COMMENT,comment.getId(),0,Integer.MAX_VALUE);List<Map<String,Object>> replyVoList = new ArrayList<>();if(replyList != null){for(Comment reply : replyList){Map<String,Object> replyVo = new java.util.HashMap<>();//回复replyVo.put("reply",reply);//作者replyVo.put("user",userService.findUserById(reply.getUserId()));//回复目标User target = reply.getTargetId() == 0 ? null : userService.findUserById(reply.getTargetId());replyVo.put("target",target);replyVoList.add(replyVo);}}commentVo.put("replys",replyVoList);//回复数量int replyCount = commentService.findCommentCount(ENTITY_TYPE_COMMENT,comment.getId());commentVo.put("replyCount",replyCount);commentVoList.add(commentVo);}}//将评论Vo列表传给前端model.addAttribute("comments",commentVoList);return "/site/discuss-detail";}

方法有点长,从14行开始,首先设置分页信息(只有评论分页,评论的评论不分页)

然后查询所有评论,接着查询评论的评论,都加入hashmap中。

修改index.html

image

修改discuss-detail.html

这里太复杂了,直接把html附上:

注意这里的分页可以复用首页的分页逻辑。

  • 评论显示分页:复用index.html中的th:fragment=“pagination”
<nav class="mt-5" th:replace="index::pagination"><ul class="pagination justify-content-center"><li class="page-item"><a class="page-link" href="#">首页</a></li><li class="page-item disabled"><a class="page-link" href="#">上一页</a></li><li class="page-item active"><a class="page-link" href="#">1</a></li><li class="page-item"><a class="page-link" href="#">2</a></li><li class="page-item"><a class="page-link" href="#">3</a></li><li class="page-item"><a class="page-link" href="#">4</a></li><li class="page-item"><a class="page-link" href="#">5</a></li><li class="page-item"><a class="page-link" href="#">下一页</a></li><li class="page-item"><a class="page-link" href="#">末页</a></li></ul></nav>		

添加评论

数据层DAO

  1. 在CommentMapper中添加insert帖子接口:
    int insertComment(Comment comment);
  • 返回值为什么是int:

在MyBatis中,insert方法通常返回一个int类型的值,这个值表示的是插入操作影响的行数。如果插入成功,这个值应该是1(因为插入一条数据影响一行);如果插入失败,这个值可能是0(没有行被影响)。这样,开发者可以通过检查这个返回值来判断插入操作是否成功。

  1. 修改comment-Mapper,修改sql语句:
 <sql id="insertFields">user_id, entity_type, entity_id, target_id, content, status, create_time</sql><insert id="insertComment" parameterType="Comment">insert into comment (<include refid="insertFields"></include>)values (#{userId}, #{entityType}, #{entityId}, #{targetId}, #{content}, #{status}, #{createTime})</insert>
  1. 修改postmapper更新评论数量
int updateCommentCount(int id, int commentCount);
  1. 修改postmapper填写sql
    <update id="updateCommentCount">update discuss_postset comment_count = #{commentCount}where id = #{id}</update>

业务层

  1. DiscussPostService:
public int updateCommentCount(int id, int commentCount) {return discussPostMapper.updateCommentCount(id, commentCount);}
  1. CommentService(引入事务管理,重点!!!)
@Transactional(isolation = Isolation.READ_COMMITTED,propagation = Propagation.REQUIRED)
public int addComment(Comment comment){if(comment == null){throw new IllegalArgumentException("参数不能为空");}//转义HTML标记和过滤敏感词comment.setContent(HtmlUtils.htmlEscape(comment.getContent()));comment.setContent(sensitiveFilter.filter(comment.getContent()));int rows = commentMapper.insertComment(comment);//更新帖子评论数量(过滤楼中楼)if(comment.getEntityType() == ENTITY_TYPE_POST){int count = commentMapper.selectCountByEntity(comment.getEntityType(),comment.getEntityId());discussPostService.updateCommentCount(comment.getEntityId(), count);}return rows;
}

过滤敏感词、识别是帖子的评论而不是楼中楼,更新评论;

Controller层

添加一个新的CommentController:

@Controller
@RequestMapping("/comment")
public class CommentController {@Autowiredprivate CommentService commentService;@Autowiredprivate HostHolder hostHolder;@RequestMapping(path="add/{discussPostId}",method = RequestMethod.POST)public String addComment(@PathVariable("discussPostId") int discussPostId, Comment comment, Model model) {comment.setUserId(hostHolder.getUser().getId());comment.setStatus(0);comment.setCreateTime(new Date());commentService.addComment(comment);return "redirect:/discuss/detail/" + discussPostId;}
}
  • 想要重定向回原页面,故用@PathVariable取id好拼接url。

修改模板

修改的是site/discuss-post.html

  1. 修改评论输入框
<div class="container mt-3"><form class="replyform" method="post" th:action="@{|/comment/add/${post.id}|}"><p class="mt-3"><a name="replyform"></a><textarea placeholder="在这里畅所欲言你的看法吧!" name="content"></textarea><input type="hidden" name="entityType" value="1"/><input type="hidden" name="entityId" th:value="${post.id}"/></p><p class="text-right"><button type="submit" class="btn btn-primary btn-sm">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</button></p></form>
</div>

在您的CommentController中,您使用了Comment对象来接收表单提交的数据。Spring MVC会自动将请求参数绑定到Comment对象的属性上,这是通过参数名和Comment对象属性名的匹配来实现的。因此,content表单元素的值会被自动绑定到Comment对象的content属性上。

image

  1. 修改楼中楼输入框:(就是回复评论的框)
<li class="pb-3 pt-3"><form method="post" th:action="@{|/comment/add/${post.id}|}"><div><input type="text" class="input-size" name="content" placeholder="请输入你的观点"/><input type="hidden" name="entityType" value="2"/><input type="hidden" name="entityId" th:value="${cvo.comment.id}"/></div><div class="text-right mt-2"><button type="button" class="btn btn-primary btn-sm" onclick="#">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</button></div></form>
</li>

image

  1. 修改楼中楼中楼的框(就是回复评论的评论的框)
<div th:id="|huifu-${rvoStat.count}|" class="mt-4 collapse"><form method="post" th:action="@{|/comment/add/${post.id}|}"><div><input type="text" class="input-size" name = "content" th:placeholder="|回复${rvo.user.username}|"/><input type="hidden" name="entityType" value="2"/><input type="hidden" name="entityId" th:value="${cvo.comment.id}"/><input type="hidden" name="targetId" th:value="${rvo.user.id}"/></div><div class="text-right mt-2"><button type="submit" class="btn btn-primary btn-sm" onclick="#">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</button></div></form>
</div>

image

相关文章:

Day23:事务管理、显示评论、添加评论

事务管理 事务的定义 什么是事务 事务是由N步数据库操作序列组成的逻辑执行单元&#xff0c;这系列操作要么全执行&#xff0c;要么全放弃执行。 事务的特性(ACID) 原子性(Atomicity):事务是应用中不可再分的最小执行体&#xff08;事务中部分执行失败就会回滚 。一致性(C…...

第一篇:概述、 目录、适用范围及术语 --- IAB/MRC《增强现实(AR)广告(效果)测量指南1.0 》

第一篇&#xff1a;概述、目录、适用范围及术语 - IAB与MRC及《增强现实广告效果测量指南1.0》 --- 我为什么要翻译美国IAB科技公司系列标准 ​​​​​​​​​​​​​​ 翻译计划 第一篇概述—IAB与MRC及《增强现实广告效果测量指南》之目录、适用范围及术语第二篇广告效…...

pytorch常用的模块函数汇总(2)

目录 torch.utils.data&#xff1a;数据加载和处理模块&#xff0c;包括 Dataset 和 DataLoader 等工具&#xff0c;用于加载和处理训练数据。 torchvision&#xff1a;计算机视觉模块&#xff0c;提供了图像数据集、转换函数、预训练模型等&#xff0c;用于计算机视觉任务。 …...

OpenAI奥特曼豪赌1.42亿破解长生不老

生物初创公司 Retro Biosciences 由山姆奥特曼投资1.42亿英镑&#xff0c;公司目标是延长人类寿命。 山姆奥特曼投资背景&#xff1a; 38 岁的奥特曼一直是科技行业的重要参与者。尽管年纪轻轻&#xff0c;奥特曼凭借 ChatGPT 和 Sora 等产品席卷了科技领域。奥特曼对 Reddit…...

[晕事]今天做了件晕事29;iptables

今天办了一件晕事&#xff0c;主机之间做ping用tcpdump抓到了ping request&#xff0c;但是没有看到ping reply&#xff0c;查看主机的arp表&#xff0c;路由表都没有问题&#xff0c;忘记看iptables的规则。虽然在tcpdump看到包&#xff0c;只是代表包到了二层&#xff0c;并不…...

2018年亚马逊云科技推出基于Arm的定制芯片实例

2018年&#xff0c;亚马逊云技术推出了基于Arm的定制芯片。 据相关数据显示&#xff0c;基于Arm的性价比比基于x86的同类实例高出40%。 这打破了对 x86 的依赖&#xff0c;开创了架构的新时代&#xff0c;现在能够支持多种配置的密集计算任务。 这些举措为亚马逊云技术的其他创…...

用搜索引擎收集信息-常用方式

1&#xff0c;site csdn.net &#xff08;下图表示只在csdn网站里搜索java&#xff09; 2&#xff0c;filetype:pdf &#xff08;表示只检索某pdf文件类型&#xff09; 表示在浏览器里面查找有关java的pdf文件 3&#xff0c;intitle:花花 &#xff08;表示搜索网页标题里面有花…...

Adobe推出20多个,企业版生成式AI定制、微调服务

3月27日&#xff0c;全球多媒体领导者Adobe在拉斯维加斯召开“Summit 2024”大会&#xff0c;重磅推出了Firefly Services。 Firefly Services提供了20 多个生成式AI和创意API服务&#xff0c;支持企业自有数据对模型进行定制、微调&#xff0c;同时可以与PS、Illustrator、Ex…...

叁[3],NavigationDrawerViewsActivity新增Fragment

1&#xff0c;环境 AndriodStudio JDK21 2&#xff0c;新建项目NavigationDrawerViewsActivity 3&#xff0c;新建包文件夹,ui右键菜单/New/Package 4&#xff0c;新建Fragment&#xff0c;app右键菜单/New/Fragment/Fragment(with ViewModel) 5&#xff0c;资源string增加键…...

备考ICA----Istio实验7---故障注入 Fault Injection 实验

备考ICA----Istio实验7—故障注入 Fault Injection 实验 Istio 的故障注入用于模拟应用程序中的故障现象&#xff0c;以测试应用程序的故障恢复能力。故障注入有两种: 1.delay延迟注入 2.abort中止注入 1. 环境准备 kubectl apply -f istio/samples/bookinfo/platform/kube/…...

[flask]异常抛出和捕获异常

Python学习之Flask全局异常处理流程_flask 异常处理-CSDN博客 读取文件错误 OSError: [Errno 22] Invalid argument:_[errno 22] invalid argument: ..\\data\\snli_1.0\\-CSDN博客 异常触发 assert触发异常&#xff1a; 在Python中&#xff0c;使用assert语句可以检查某个条…...

js逆向之实例某宝热卖(MD5)爬虫

目录 正常写 反爬 逆向分析 关键字搜索 打断点&分析代码 得出 sign 的由来 确定加密方式 写加密函数了 补全代码 免责声明:本文仅供技术交流学习,请勿用于其它违法行为. 正常写 还是老规矩,正常写代码,该带的都带上,我这种方法发现数据格式不完整. 应该后面也是大…...

7、jenkins项目构建细节-常用的构建触发器

文章目录 一、常用的构建细节1、触发远程构建2、其他工程构建后触发3、定时构建4、轮询SCM(Poll SCM)二、Git hook自动触发构建(☆☆☆)1、安装插件2、Jenkins设置自动构建3、Gitlab配置webhook三、Jenkins的参数化构建1、项目创建分支,并推送到gitlab上2、在Jenkins添加字…...

【前端学习——css篇】4.px和rem的区别

https://github.com/febobo/web-interview 4.px和rem的区别 ①px px&#xff0c;表示像素&#xff0c;所谓像素就是呈现在我们显示器上的一个个小点&#xff0c;每个像素点都是大小等同的&#xff0c;所以像素为计量单位被分在了绝对长度单位中 有些人会把px认为是相对长度&…...

深入解析Oracle数据库中的标量子查询(Scalar Subquery)及其等价改写方法

在Oracle数据库中&#xff0c;标量子查询&#xff08;Scalar Subquery&#xff09;是一种特殊的子查询&#xff0c;它返回单个值作为结果&#xff0c;而不是一组记录。标量子查询通常嵌套在另一个查询的SELECT列表、WHERE子句、HAVING子句或表达式中&#xff0c;它就像一个可以…...

Pytorch多机多卡分布式训练

多机多卡分布式&#xff1a; 多机基本上和单机多卡差不多&#xff1a; 第一台机器&#xff08;主设备&#xff09;&#xff1a; torchrun --master_port 6666 --nproc_per_node8 --nnodes${nnodes} --node_rank0 --master_addr${master_addr} train_with_multi_machine_an…...

win11 环境配置 之 Jmeter

一、安装 JDK 1. 安装 jdk 截至当前最新时间&#xff1a; 2024.3.27 jdk最新的版本 是 官网下载地址&#xff1a; https://www.oracle.com/java/technologies/downloads/ 建议下载 jdk17 另存为到该电脑的 D 盘下&#xff0c;新建jdk文件夹 开始安装到 jdk 文件夹下 2. 配…...

蓝桥杯刷题之路径之谜

题目来源 路径之谜 不愧是国赛的题目 题意 题目中会给你两个数组&#xff0c;我这里是分别用row和col来表示 每走一步&#xff0c;往左边和上边射一箭&#xff0c;走到终点的时候row数组和col数组中的值必须全部等于0这个注意哈&#xff0c;看题目看了半天&#xff0c;因为…...

【深度学习】图片预处理,分辨出模糊图片

ref:https://pyimagesearch.com/2015/09/07/blur-detection-with-opencv/ 论文 ref:https://www.cse.cuhk.edu.hk/leojia/all_final_papers/blur_detect_cvpr08.pdf 遇到模糊的图片&#xff0c;还要处理一下&#xff0c;把它挑出来&#xff0c;要么修复&#xff0c;要么弃用。否…...

基础NLP知识了解

基础NLP知识… 线性变换 通过一个线性变换将隐藏状态映射到另一个维度空间&#xff0c;以获得预期维度的向量 $ outputs hidden_layer * W b$ 这里的W是权重矩阵&#xff0c;b是偏置项&#xff0c;它们是线性变换的参数&#xff0c;通过训练数据学习得到。输出向量的维度…...

Android 性能优化(六):启动优化的详细流程

书接上文&#xff0c;Android 性能优化&#xff08;一&#xff09;&#xff1a;闪退、卡顿、耗电、APK 从用户体验角度有四个性能优化方向&#xff1a; 追求稳定&#xff0c;防止崩溃追求流畅&#xff0c;防止卡顿追求续航&#xff0c;防止耗损追求精简&#xff0c;防止臃肿 …...

QT程序打包

将exe文件单独拿出来放入一个单独的文件夹 保存qt安装路径下有如下这个文件 windeployqt.exe 在TCPFile.exe文件夹中使用以下cmd命令运行 即可打包 windeployqt 文件名.exe 成功打包&#xff01;...

ARMday7作业

实现三个按键的中断&#xff0c;现象和代码 do_ipr.c #include "stm32mp1xx_gic.h" #include "stm32mp1xx_exti.h" extern void printf(const char *fmt, ...); unsigned int i 0; void do_irq(void) {//获取要处理的中断的中断号unsigned int irqnoGI…...

Unity构建详解(4)——SBP的依赖后处理

【AddHashToBundleNameTask】 这个Task的作用很明确&#xff0c;给Bundle的名字附加一个Hash值&#xff1a; 根据bundle所包含的asset计算出来一个hash值添加在原来Bundle的末尾替换了BundleBuildContent.BundleLayout和aa.bundleToAssetGroup中的key 有两个问题&#xff0c…...

使用GO对PostgreSQL进行有意思的多线程压测

前言 针对PostgreSQL进行压缩&#xff0c;有很多相关的工具。有同学又要问了&#xff0c;为何还要再搞一个&#xff1f;比如&#xff0c;pgbench, sysbench之类的&#xff0c;已经很强大了。是的&#xff0c;它们都很强大。但有时候&#xff0c;在一些特殊的场景&#xff0c;可…...

CI/CI实战-jenkis结合gitlab 4

实时触发 安装gitlab插件 配置项目触发器 生成令牌并保存 配置gitlab 测试推送 gitlab的实时触发 添加jenkins节点 在jenkins节点上安装docker-ce 新建节点server3 安装git和jdx 在jenkins配置管理中添加节点并配置从节点 关闭master节点的构建任务数...

修复ubuntu引导

一、制作ubuntu启动U盘 进入启动盘后&#xff0c;点击Try ubuntu&#xff0c;进入U盘的ubuntu系统。 二、配置和添加源 sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update三、运行 Boot Repair重新制作引导 sudo boot-repair注意&#x…...

11.Notepad++

文章目录 一、下载和安装设置练习 以前在记事本上写的代码看上去有点累&#xff0c;因为所有的单词看上去都是黑色的&#xff0c;并且当代码出现问题后&#xff0c;它提示第三行&#xff0c;我们还需要一行一行去数。这些问题都可以由一个高级记事本&#xff1a; Notepad 来解…...

实现阻塞队列

import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; public class Main  { public static void main(String[] args) throws InterruptedException { BlockingQue…...

MySQL8.X驱动datetime映射问题

MySQL8.X驱动datetime映射问题 背景&#xff1a;项目由SSM项目迁移至SpringBoot&#xff0c;对mysql数据库驱动进行了升级导致出现问题。 原因&#xff1a;mysql驱动的8.X版本对数据库类型datetime映射为LocalDateTime。 解决&#xff1a;暂时不升级mysql驱动&#xff0c;mys…...