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

基于SSM的二手交易管理系统的设计与实现 (含源码+sql+视频导入教程+文档)

👉文末查看项目功能视频演示+获取源码+sql脚本+视频导入教程视频

1 、功能描述

  基于SSM的二手交易管理系统1拥有两种角色

  • 管理员:商品管理、订单管理、充值管理、用户管理等
  • 用户:发布商品、查看闲置、充值账户、查看所有订单、发布求购信息、修改个人信息、关注列表等

1.1 背景描述

  二手交易管理系统是一个基于SSM(Spring + SpringMVC + MyBatis)的Web应用程序,旨在提供一个方便、高效的平台,用于管理二手商品交易。该系统包括用户管理、商品管理、订单管理、支付管理等功能。

  系统采用Spring框架作为整体架构,通过SpringMVC模块进行请求处理和数据传递,使用MyBatis作为持久层框架,实现数据的持久化。系统还采用了MySQL数据库进行数据存储,并使用Tomcat服务器进行部署。

  用户管理模块负责管理用户信息,包括用户注册、登录、找回密码等功能。商品管理模块负责管理二手商品信息,包括商品的添加、修改、删除等功能。订单管理模块负责管理订单信息,包括订单的生成、支付、发货等功能。支付管理模块负责管理支付信息,包括支付方式的添加、修改、删除等功能。

  该系统具有友好的用户界面和灵活的功能设计,可满足不同用户的需求。通过该系统,用户可以更加方便地进行二手商品交易,提高交易的效率和安全性。

2、项目技术

后端框架:SSM(Spring、SpringMVC、Mybatis)

前端技术:Bootstrap、jsp、css、JavaScript、JQuery

2.1 SSM

  SSM(Spring+SpringMVC+MyBatis)是目前比较主流的Java EE企业级框架,适用于搭建各种大型的企业级应用系统。其中,Spring就像是整个项目中的粘合剂,负责装配bean并管理其生命周期,实现控制反转(IoC)的功能。SpringMVC负责拦截用户请求,通过DispatcherServlet将请求匹配到相应的Controller并执行。而MyBatis则是对JDBC的封装,让数据库底层操作变得透明,通过配置文件关联到各实体类的Mapper文件,实现了SQL语句映射。

2.2 mysql

  MySQL是一款Relational Database Management System,直译过来的意思就是关系型数据库管理系统,MySQL有着它独特的特点,这些特点使他成为目前最流行的RDBMS之一,MySQL想比与其他数据库如ORACLE、DB2等,它属于一款体积小、速度快的数据库,重点是它符合本次毕业设计的真实租赁环境,拥有成本低,开发源码这些特点,这也是选择它的主要原因。

3、开发环境

  • JAVA版本:JDK1.8
  • IDE类型:IDEA、Eclipse都可运行
  • tomcat版本:Tomcat 7-10版本均可
  • 数据库类型:MySql(5.x和8.x版本都可)
  • maven项目:否
  • 硬件环境:Windows 或者 Mac OS

4、功能截图+视频演示+文档目录

4.1 登录

登录

4.2 前端模块

首页

前端-商品详情

前端-分类查询

4.3 用户模块

用户-查看自己的闲置

用户-充值

用户-订单列表

用户-发布求购信息

用户-发布商品

用户-关注列表

用户-修改个个人信息

4.4 管理员模块

管理员-订单管理

管理员-钱包管理

管理员-商品管理

管理员-用户管理

4.4 文档目录

文档目录

5 、核心代码实现

5.1 配置代码

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:p="http://www.springframework.org/schema/p"xmlns:aop="http://www.springframework.org/schema/aop"xmlns:context="http://www.springframework.org/schema/context"xmlns:jee="http://www.springframework.org/schema/jee"xmlns:tx="http://www.springframework.org/schema/tx"xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsdhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsdhttp://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.0.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd"><!-- 加载数据库参数 --><context:property-placeholder location="classpath:conf/jdbc.properties"/><context:component-scan base-package="com.ldu.service.impl"/><bean id = "dataSource" class = "com.alibaba.druid.pool.DruidDataSource" destroy-method = "close"><!-- 数据库基本信息配置 --><property name = "url" value = "${druid.url}" /><property name = "username" value = "${druid.username}" /><property name = "password" value = "${druid.password}" /><property name = "driverClassName" value = "${druid.driverClassName}" /><property name = "filters" value = "${druid.filters}" /><!-- 最大并发连接数 --><property name = "maxActive" value = "${druid.maxActive}" /><!-- 初始化连接数量 --><property name = "initialSize" value = "${druid.initialSize}" /><!-- 配置获取连接等待超时的时间 --><property name = "maxWait" value = "${druid.maxWait}" /><!-- 最小空闲连接数 --><property name = "minIdle" value = "${druid.minIdle}" /><!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 --><property name = "timeBetweenEvictionRunsMillis" value ="${druid.timeBetweenEvictionRunsMillis}" /><!-- 配置一个连接在池中最小生存的时间,单位是毫秒 --><property name = "minEvictableIdleTimeMillis" value ="${druid.minEvictableIdleTimeMillis}" /><property name = "validationQuery" value = "${druid.validationQuery}" /><property name = "testWhileIdle" value = "${druid.testWhileIdle}" /><property name = "testOnBorrow" value = "${druid.testOnBorrow}" /><property name = "testOnReturn" value = "${druid.testOnReturn}" /><property name = "maxOpenPreparedStatements" value ="${druid.maxOpenPreparedStatements}" /><!-- 打开 removeAbandoned 功能 --><property name = "removeAbandoned" value = "${druid.removeAbandoned}" /><!-- 1800 秒,也就是 30 分钟 --><property name = "removeAbandonedTimeout" value ="${druid.removeAbandonedTimeout}" /><!-- 关闭 abanded 连接时输出错误日志 --><property name = "logAbandoned" value = "${druid.logAbandoned}" /></bean><!-- 配置MyBatis的sqlSessionFactory --><bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"><property name="dataSource" ref="dataSource"></property><property name="configLocation" value="classpath:conf/mybatis-config.xml"></property><property name="mapperLocations" value="classpath:mapper/*.xml"></property></bean><!-- Mapper接口所在包名,Spring会自动查找其下的Mapper  --><bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"><property name="basePackage" value="com.ldu.dao"></property><property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property></bean><!-- 配置transactionManager事务管理器 --><bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"><property name="dataSource" ref="dataSource"></property></bean><!-- 配置事物通知属性 --><tx:advice id="txAdvice" transaction-manager="transactionManager"><!-- 定义事物传播特性 --><tx:attributes><tx:method name="insert" propagation="REQUIRED"/><tx:method name="update*" propagation="REQUIRED" /><tx:method name="edit*" propagation="REQUIRED" /><tx:method name="save*" propagation="REQUIRED" /><tx:method name="add*" propagation="REQUIRED" /><tx:method name="new*" propagation="REQUIRED" /><tx:method name="set*" propagation="REQUIRED" /><tx:method name="remove*" propagation="REQUIRED" /><tx:method name="delete*" propagation="REQUIRED" /><tx:method name="change*" propagation="REQUIRED" /><tx:method name="check*" propagation="REQUIRED" /><tx:method name="get*" propagation="REQUIRED" read-only="true" /><tx:method name="find*" propagation="REQUIRED" read-only="true" /><tx:method name="load*" propagation="REQUIRED" read-only="true" /><tx:method name="*" propagation="REQUIRED" read-only="true" /></tx:attributes></tx:advice><!-- 配置事物切面 --><aop:config><aop:pointcut expression="execution(* com.ldu.service.*.*(..))" id="serviceOperation"/><aop:advisor advice-ref="txAdvice" pointcut-ref="serviceOperation"/></aop:config>
</beans>

5.2 用户核心代码

package com.ldu.controller;import com.ldu.pojo.Focus;
import com.ldu.pojo.Goods;
import com.ldu.pojo.GoodsExtend;
import com.ldu.pojo.Image;
import com.ldu.pojo.Notice;
import com.ldu.pojo.NoticeExtend;
import com.ldu.pojo.Purse;
import com.ldu.pojo.User;
import com.ldu.service.FocusService;
import com.ldu.service.GoodsService;
import com.ldu.service.ImageService;
import com.ldu.service.NoticeService;
import com.ldu.service.PurseService;
import com.ldu.service.UserService;
import com.ldu.util.DateUtil;
import com.ldu.util.MD5;import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;import java.io.IOException;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;@Controller
@RequestMapping(value = "/user")
public class UserController {@Resourceprivate UserService userService;@Resourceprivate GoodsService goodsService;@Resourceprivate ImageService imageService;@Resourceprivate FocusService focusService;@Resourceprivate PurseService purseService;@Resourceprivate NoticeService noticeService;/*** 用户注册* * @param user1* @return*/@RequestMapping(value = "/addUser")public String addUser(HttpServletRequest request, @ModelAttribute("user") User user1) {String url = request.getHeader("Referer");User user = userService.getUserByPhone(user1.getPhone());if (user == null) {// 检测该用户是否已经注册String t = DateUtil.getNowDate();// 对密码进行MD5加密String str = MD5.md5(user1.getPassword());user1.setCreateAt(t);// 创建开始时间user1.setPassword(str);user1.setGoodsNum(0);user1.setStatus((byte) 1);//初始正常状态user1.setPower(100);userService.addUser(user1);purseService.addPurse(user1.getId());// 注册的时候同时生成钱包}return "redirect:" + url;}/*** 注册验证账号* @param request* @return*/@RequestMapping(value = "/register",method = RequestMethod.POST)@ResponseBodypublic String register(HttpServletRequest request){String phone=request.getParameter("phone");User user = userService.getUserByPhone(phone);if(user==null) {return "{\"success\":true,\"flag\":false}";//用户存在,注册失败}else {return "{\"success\":true,\"flag\":true}";//用户不存在,可以注册}}/*** 登陆验证密码* @param request* @return*//*@RequestMapping(value = "/password",method = RequestMethod.POST)@ResponseBodypublic String password(HttpServletRequest request){String phone=request.getParameter("phone");String password=request.getParameter("password");if((phone==null||phone=="")&&(password==null||password=="")) {return "{\"success\":false,\"flag\":true}";}else {User user = userService.getUserByPhone(phone);if(user==null) {return "{\"success\":false,\"flag\":false}";//账号错误}String pwd = MD5.md5(password);if (pwd.equals(user.getPassword())) {return "{\"success\":true,\"flag\":false}";//密码正确}else {return "{\"success\":true,\"flag\":true}";//密码错误}}}*//*** 验证登录* @param request* @param user* @param modelMap* @return*/@RequestMapping(value = "/login")public ModelAndView loginValidate(HttpServletRequest request, HttpServletResponse response, User user,ModelMap modelMap) {User cur_user = userService.getUserByPhone(user.getPhone());String url = request.getHeader("Referer");if (cur_user != null) {String pwd = MD5.md5(user.getPassword());if (pwd.equals(cur_user.getPassword())) {if(cur_user.getStatus()==1) {request.getSession().setAttribute("cur_user", cur_user);return new ModelAndView("redirect:" + url);}}}return new ModelAndView("redirect:" + url);}/*** 更改用户名* * @param request* @param user* @param modelMap* @return*/@RequestMapping(value = "/changeName")public ModelAndView changeName(HttpServletRequest request, User user, ModelMap modelMap) {String url = request.getHeader("Referer");// 从session中获取出当前用户User cur_user = (User) request.getSession().getAttribute("cur_user");cur_user.setUsername(user.getUsername());// 更改当前用户的用户名userService.updateUserName(cur_user);// 执行修改操作request.getSession().setAttribute("cur_user", cur_user);// 修改session值return new ModelAndView("redirect:" + url);}/*** 完善或修改信息* * @param request* @param user* @param modelMap* @return*/@RequestMapping(value = "/updateInfo")public ModelAndView updateInfo(HttpServletRequest request, User user, ModelMap modelMap) {// 从session中获取出当前用户User cur_user = (User) request.getSession().getAttribute("cur_user");cur_user.setUsername(user.getUsername());cur_user.setQq(user.getQq());userService.updateUserName(cur_user);// 执行修改操作request.getSession().setAttribute("cur_user", cur_user);// 修改session值return new ModelAndView("redirect:/user/basic");}/*** 用户退出* * @param request* @return*/@RequestMapping(value = "/logout")public String logout(HttpServletRequest request) {request.getSession().setAttribute("cur_user", null);return "redirect:/goods/homeGoods";}/*** 个人中心* * @return*/@RequestMapping(value = "/home")public ModelAndView home(HttpServletRequest request) {ModelAndView mv = new ModelAndView();User cur_user = (User) request.getSession().getAttribute("cur_user");Integer userId = cur_user.getId();int size=5;Purse myPurse = purseService.getPurseByUserId(userId);List<User> users=userService.getUserOrderByDate(size);List<Notice> notice=noticeService.getNoticeList();mv.addObject("notice", notice);mv.addObject("myPurse", myPurse);mv.addObject("users", users);mv.setViewName("/user/home");return mv;}/*** 个人信息设置* * @return*/@RequestMapping(value = "/basic")public ModelAndView basic(HttpServletRequest request) {User cur_user = (User) request.getSession().getAttribute("cur_user");Integer userId = cur_user.getId();Purse myPurse = purseService.getPurseByUserId(userId);ModelAndView mv = new ModelAndView();mv.addObject("myPurse", myPurse);mv.setViewName("/user/basic");return mv;}/*** 我的闲置 查询出所有的用户商品以及商品对应的图片* * @return 返回的model为 goodsAndImage对象,该对象中包含goods 和 images,参考相应的类*/@RequestMapping(value = "/allGoods")public ModelAndView goods(HttpServletRequest request) {User cur_user = (User) request.getSession().getAttribute("cur_user");Integer userId = cur_user.getId();List<Goods> goodsList = goodsService.getGoodsByUserId(userId);List<GoodsExtend> goodsAndImage = new ArrayList<GoodsExtend>();for (int i = 0; i < goodsList.size(); i++) {// 将用户信息和image信息封装到GoodsExtend类中,传给前台GoodsExtend goodsExtend = new GoodsExtend();Goods goods = goodsList.get(i);List<Image> images = imageService.getImagesByGoodsPrimaryKey(goods.getId());goodsExtend.setGoods(goods);goodsExtend.setImages(images);goodsAndImage.add(i, goodsExtend);}Purse myPurse = purseService.getPurseByUserId(userId);ModelAndView mv = new ModelAndView();mv.addObject("goodsAndImage", goodsAndImage);mv.setViewName("/user/goods");mv.addObject("myPurse", myPurse);return mv;}/*** 我的关注 查询出所有的用户商品以及商品对应的图片* * @return 返回的model为 goodsAndImage对象,该对象中包含goods 和 images,参考相应的类*/@RequestMapping(value = "/allFocus")public ModelAndView focus(HttpServletRequest request) {User cur_user = (User) request.getSession().getAttribute("cur_user");Integer userId = cur_user.getId();List<Focus> focusList = focusService.getFocusByUserId(userId);List<GoodsExtend> goodsAndImage = new ArrayList<GoodsExtend>();for (int i = 0; i < focusList.size(); i++) {// 将用户信息和image信息封装到GoodsExtend类中,传给前台GoodsExtend goodsExtend = new GoodsExtend();Focus focus = focusList.get(i);Goods goods = goodsService.getGoodsByPrimaryKey(focus.getGoodsId());List<Image> images = imageService.getImagesByGoodsPrimaryKey(focus.getGoodsId());goodsExtend.setGoods(goods);goodsExtend.setImages(images);goodsAndImage.add(i, goodsExtend);}Purse myPurse = purseService.getPurseByUserId(userId);ModelAndView mv = new ModelAndView();mv.addObject("goodsAndImage", goodsAndImage);mv.addObject("myPurse", myPurse);mv.setViewName("/user/focus");return mv;}/*** 删除我的关注* @return*/@RequestMapping(value = "/deleteFocus/{id}")public String deleteFocus(HttpServletRequest request, @PathVariable("id") Integer goods_id) {User cur_user = (User) request.getSession().getAttribute("cur_user");Integer user_id = cur_user.getId();focusService.deleteFocusByUserIdAndGoodsId(goods_id, user_id);return "redirect:/user/allFocus";}/*** 添加我的关注* * @return*/@RequestMapping(value = "/addFocus/{id}")public String addFocus(HttpServletRequest request, @PathVariable("id") Integer goods_id) {User cur_user = (User) request.getSession().getAttribute("cur_user");Integer user_id = cur_user.getId();//首先获取用户所有的关注列表List<Focus> focus=focusService.getFocusByUserId(user_id);//若关注列表为空,则直接添加关注if(focus.isEmpty()) {focusService.addFocusByUserIdAndId(goods_id, user_id);return "redirect:/user/allFocus";}//遍历所有的关注列表for (Focus myfocus : focus) {int goodsId=myfocus.getGoodsId();//若该商品已经被关注,则直接返回if(goodsId == goods_id.intValue()) {return "redirect:/user/allFocus";}}focusService.addFocusByUserIdAndId(goods_id, user_id);return "redirect:/user/allFocus";}/*** 我的钱包* * @return 返回的model为 goodsAndImage对象*/@RequestMapping(value = "/myPurse")public ModelAndView getMoney(HttpServletRequest request) {User cur_user = (User) request.getSession().getAttribute("cur_user");Integer user_id = cur_user.getId();Purse purse = purseService.getPurseByUserId(user_id);ModelAndView mv = new ModelAndView();mv.addObject("myPurse", purse);mv.setViewName("/user/purse");return mv;}/*** 充值与提现 根据传过来的两个值进行判断是充值还是提现* * @return 返回的model为 goodsAndImage对象*/@RequestMapping(value = "/updatePurse")public String updatePurse(HttpServletRequest request, Purse purse) {User cur_user = (User) request.getSession().getAttribute("cur_user");Integer user_id = cur_user.getId();purse.setUserId(user_id);purse.setState(0);if (purse.getRecharge() != null) {purseService.updatePurse(purse);}if (purse.getWithdrawals() != null) {purseService.updatePurse(purse);}return "redirect:/user/myPurse";}@RequestMapping(value = "/insertSelective",method = RequestMethod.POST)@ResponseBodypublic String insertSelective(HttpServletRequest request){String context=request.getParameter("context");User cur_user = (User) request.getSession().getAttribute("cur_user");Notice notice=new Notice();notice.setContext(context);Date dt = new Date();     SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");notice.setCreateAt(sdf.format(dt));notice.setStatus((byte) 0);notice.setUser(cur_user);if(context==null||context=="") {return "{\"success\":false,\"msg\":\"发布失败,请输入内容!\"}";}try {noticeService.insertSelective(notice);} catch (Exception e) {return "{\"success\":false,\"msg\":\"发布失败!\"}";}return "{\"success\":true,\"msg\":\"发布成功!\"}";}}

6 、功能视频演示

基于SSM的二手物品交易系统

7 、 获取方式

👇 大家点赞、收藏、关注、评论啦 👇🏻获取联系方式,后台回复关键词:二手👇🏻

相关文章:

基于SSM的二手交易管理系统的设计与实现 (含源码+sql+视频导入教程+文档)

&#x1f449;文末查看项目功能视频演示获取源码sql脚本视频导入教程视频 1 、功能描述 基于SSM的二手交易管理系统1拥有两种角色 管理员&#xff1a;商品管理、订单管理、充值管理、用户管理等用户&#xff1a;发布商品、查看闲置、充值账户、查看所有订单、发布求购信息、修…...

linux-centos 设置系统时间

CentOS 系统提供了多种方式来设置和管理时间&#xff0c;包括手动设置时间和使用网络时间协议 (NTP) 自动同步时间。以下是几种常见的方法&#xff1a; 手动设置时间 使用date命令临时设置时间&#xff1a; 如果你只需要临时设置时间&#xff0c;可以使用 date 命令&#xff1…...

【Linux基础】冯诺依曼体系结构操作系统的理解

目录 前言一&#xff0c;冯诺依曼体系1. 为什么有内存结构?2. 对硬件中数据流动的再理解 二&#xff0c;操作系统(Operator System)1. 概念2. 操作系统结构的层状划分3. 操作系统对硬件管理的理解4. 用户与操作系统的关系的理解5. 系统调用和库函数的关系6. 为什么要有操作系统…...

算法题解:斐波那契数列(C语言)

斐波那契数列 斐波那契数列是一个经典的数学序列&#xff0c;其中每一项的值是前两项的和。数列的前两项通常定义为0和1&#xff0c;即&#xff1a; F(0) 0 F(1) 1 F(n) F(n-1) F(n-2) (n ≥ 2)输入一个正整数n&#xff0c;求斐波那契数列的第n项。 样例 假设输入 n …...

SSM 框架 个人使用习惯 详细

SpringMVC主要是controller、service、dao&#xff08;mapper&#xff09;层交互 controller&#xff1a;处理数据请求的接口 service&#xff1a;处理请求的数据 dao&#xff08;mapper&#xff09;&#xff1a;对数据进行持久化 下面我将对controller和service.impl进行讲…...

[羊城杯 2020]Blackcat1

知识点&#xff1a;数组加密绕过 进入页面熟悉的web三部曲&#xff08;url地址&#xff0c;web源代码&#xff0c;web目录扫描&#xff09; url地址没有什么东西去看看源代码. 这有一个mp3文件点一下看看. 在最后面发现了 PHP源码. if(empty($_POST[Black-Cat-Sheriff]) || em…...

腾讯云Ubuntu系统安装宝塔,配置Java环境,运行spring boot项目

致谢 本次学习宝塔部署spring boot项目&#xff0c;参考如下资料 https://www.cnblogs.com/daen/p/15997872.html 系统安装宝塔 直接用的腾讯云云服务器面板上的登录&#xff0c;你可以换成 xshell 进入宝塔官网&#xff1a; https://www.bt.cn/new/download.html 我们采…...

双亲委派机制知识点

类加载器 双亲委派模型 为什么采用双亲委派模型 打破双亲委派机制的场景 Tomcat 打破双亲委派机制:目的是可以加载不同版本的jar包 实现类隔离&#xff1a;在Tomcat中&#xff0c;每个Web应用使用独立的类加载器加载类文件&#xff0c;这样做的好处在于&#xff0c;当在同一T…...

vue part 11

vuex的模块化与namespace 115_尚硅谷Vue技术_vuex模块化namespace_1_哔哩哔哩_bilibili 116_尚硅谷Vue技术_vuex模块化namespace_2_哔哩哔哩_bilibili vue-router路由 很常见的很重要的应用&#xff1a;Ajax请求&#xff0c;将响应的数据替换掉原先的代码从而实现不跳转页面…...

【QT】常用类

欢迎来到Cefler的博客&#x1f601; &#x1f54c;博客主页&#xff1a;折纸花满衣 &#x1f3e0;个人专栏&#xff1a;QT 目录 &#x1f449;&#x1f3fb;QMediaPlayer&#x1f449;&#x1f3fb;QMediaPlaylistsetPlaybackMode &#x1f449;&#x1f3fb;QDir&#x1f449;…...

从index_put出发全面学习cuda和pytorch技术

一 前言 深感目前对于cuda和pytorch所涉及知识的广度和深度,但一时又不知道该如何去学习,经过多日的考虑,还是决定管中窥豹,从一个算子出发,抽丝剥茧,慢慢学习,把学习中碰到的问题都记录下来,希望可以坚持下去。 二 函数功能描述 【torch算子】torch.index_put和tor…...

浅谈住房城乡建设部科技创新平台布局重点方向

最近住房建设部组织开展住房城乡建设部科技创新平台&#xff08;以下简称部科技创新平台&#xff09;申报工作。详细内容见住房城乡建设部科技创新平台开始申报了 (qq.com)。在这里有4大方向共15个课题。内容见下图&#xff1a; 虽然我是做技术的&#xff0c;但是如何体现创新还…...

调用 write()函数后,如何知道数据是否已经写入磁盘?

在 Linux 中调用 write() 函数后&#xff0c;可以通过以下几种方式来确定数据是否已经写入磁盘&#xff1a; 一、使用同步函数 1. fsync() 函数&#xff1a; - 这个函数会强制将与文件描述符相关的所有修改过的内核缓冲区写入磁盘&#xff0c;并等待直到磁盘 I/O 操作完…...

策略路由与路由策略的区别

&#x1f423;个人主页 可惜已不在 &#x1f424;这篇在这个专栏 华为_可惜已不在的博客-CSDN博客 &#x1f425;有用的话就留下一个三连吧&#x1f63c; 目录 一、主体不同 二、方式不同 三、规则不同 四、定义和基本概念 一、主体不同 1、路由策略&#xff1a;是为了改…...

从底层原理上理解ClickHouse 中的稀疏索引

稀疏索引&#xff08;Sparse Indexes&#xff09;是 ClickHouse 中一个重要的加速查询机制。与传统数据库使用的 B-Tree 或哈希索引不同&#xff0c;ClickHouse 的稀疏索引并不是为每一行数据构建索引&#xff0c;而是为数据存储的块或部分数据生成索引。这种索引的核心思想是通…...

xtu oj 锐角三角形

锐角三角形 题目描述 n条边&#xff0c;任选3条边&#xff0c;能组成多少个锐角三角形&#xff08;选的边不同就认为是不同的三角形&#xff09;&#xff1f; 输入 第一个是一个整数T(1≤T≤1000)&#xff0c;表示样例的个数。 每个样例占2行&#xff0c;第一行是一…...

MATLAB系列04:循环结构

MATLAB系列04&#xff1a;循环结构 4. 循环结构4.1 while循环4.2 for循环4.2.1 运算的细节4.2.2 break语句和continue语句4.2.3 嵌套循环 4.3 逻辑数组和向量化4.3.1 逻辑数组的重要性4.3.2 用 if/else 结构和逻辑数组创建等式 4.4 总结 4. 循环结构 循环(loop)是一种 MATLAB …...

虹科方案 | 精准零部件测试!多路汽车开关按键功能检测系统

欢迎关注虹科&#xff0c;为您提供最新资讯&#xff01; #LIN/CAN总线 #零部件测试 #CAN数据 导读 在汽车制造业中&#xff0c;零部件的安全性、功能性和可靠性是确保车辆整体性能的关键。虹科针对车辆零部件的LIN/CAN总线仿真测试&#xff0c;提出了基于虹科Baby-LIN系列产…...

【加密算法基础——AES CBC模式代码解密实践】

AES 解密实践之代码实现 AES 解密使用python脚本比较灵活&#xff0c;但是一定要保证脚本是调试过的&#xff0c;才能在找到正确的密文&#xff0c;密钥&#xff0c;初始向量的情况下&#xff0c;解出正确的明文。但是对于AES解密&#xff0c;命令行无法处理key截断的问题。 实…...

【ViT+Dis】Deepfake Detection Scheme Based on Vision Transformer and Distillation

文章目录 Deepfake Detection Scheme Based on Vision Transformer and Distillationkey points深伪检测检测算法蒸馏法与教师网络实验训练:参数总结Deepfake Detection Scheme Based on Vision Transformer and Distillation 会议:2021 作者: key points 以往基于CNN结…...

golang循环变量捕获问题​​

在 Go 语言中&#xff0c;当在循环中启动协程&#xff08;goroutine&#xff09;时&#xff0c;如果在协程闭包中直接引用循环变量&#xff0c;可能会遇到一个常见的陷阱 - ​​循环变量捕获问题​​。让我详细解释一下&#xff1a; 问题背景 看这个代码片段&#xff1a; fo…...

CentOS下的分布式内存计算Spark环境部署

一、Spark 核心架构与应用场景 1.1 分布式计算引擎的核心优势 Spark 是基于内存的分布式计算框架&#xff0c;相比 MapReduce 具有以下核心优势&#xff1a; 内存计算&#xff1a;数据可常驻内存&#xff0c;迭代计算性能提升 10-100 倍&#xff08;文档段落&#xff1a;3-79…...

微信小程序云开发平台MySQL的连接方式

注&#xff1a;微信小程序云开发平台指的是腾讯云开发 先给结论&#xff1a;微信小程序云开发平台的MySQL&#xff0c;无法通过获取数据库连接信息的方式进行连接&#xff0c;连接只能通过云开发的SDK连接&#xff0c;具体要参考官方文档&#xff1a; 为什么&#xff1f; 因为…...

在web-view 加载的本地及远程HTML中调用uniapp的API及网页和vue页面是如何通讯的?

uni-app 中 Web-view 与 Vue 页面的通讯机制详解 一、Web-view 简介 Web-view 是 uni-app 提供的一个重要组件&#xff0c;用于在原生应用中加载 HTML 页面&#xff1a; 支持加载本地 HTML 文件支持加载远程 HTML 页面实现 Web 与原生的双向通讯可用于嵌入第三方网页或 H5 应…...

2025季度云服务器排行榜

在全球云服务器市场&#xff0c;各厂商的排名和地位并非一成不变&#xff0c;而是由其独特的优势、战略布局和市场适应性共同决定的。以下是根据2025年市场趋势&#xff0c;对主要云服务器厂商在排行榜中占据重要位置的原因和优势进行深度分析&#xff1a; 一、全球“三巨头”…...

网站指纹识别

网站指纹识别 网站的最基本组成&#xff1a;服务器&#xff08;操作系统&#xff09;、中间件&#xff08;web容器&#xff09;、脚本语言、数据厍 为什么要了解这些&#xff1f;举个例子&#xff1a;发现了一个文件读取漏洞&#xff0c;我们需要读/etc/passwd&#xff0c;如…...

音视频——I2S 协议详解

I2S 协议详解 I2S (Inter-IC Sound) 协议是一种串行总线协议&#xff0c;专门用于在数字音频设备之间传输数字音频数据。它由飞利浦&#xff08;Philips&#xff09;公司开发&#xff0c;以其简单、高效和广泛的兼容性而闻名。 1. 信号线 I2S 协议通常使用三根或四根信号线&a…...

Selenium常用函数介绍

目录 一&#xff0c;元素定位 1.1 cssSeector 1.2 xpath 二&#xff0c;操作测试对象 三&#xff0c;窗口 3.1 案例 3.2 窗口切换 3.3 窗口大小 3.4 屏幕截图 3.5 关闭窗口 四&#xff0c;弹窗 五&#xff0c;等待 六&#xff0c;导航 七&#xff0c;文件上传 …...

android13 app的触摸问题定位分析流程

一、知识点 一般来说,触摸问题都是app层面出问题,我们可以在ViewRootImpl.java添加log的方式定位;如果是touchableRegion的计算问题,就会相对比较麻烦了,需要通过adb shell dumpsys input > input.log指令,且通过打印堆栈的方式,逐步定位问题,并找到修改方案。 问题…...

嵌入式常见 CPU 架构

架构类型架构厂商芯片厂商典型芯片特点与应用场景PICRISC (8/16 位)MicrochipMicrochipPIC16F877A、PIC18F4550简化指令集&#xff0c;单周期执行&#xff1b;低功耗、CIP 独立外设&#xff1b;用于家电、小电机控制、安防面板等嵌入式场景8051CISC (8 位)Intel&#xff08;原始…...