第八章 SSM整合

news2024/10/5 12:45:11

1.整合关键点

Spring:负责对象的创建、维护、管理及对象依赖资源的注入

SpringMVC:负责请求的处理相当于(Servlet)

MyBatis:负责与数据库进行交互

2.整合步骤

2.1.在pom.xml文件中导入依赖

mybatis、spring-webmvc、mybatis-spring、bonecp数据源、mysql、spring-jdbc、log4j、jstl

2.2.编写配置文件

spring-config.xml、 springmvc-config.xml 、mybatis-config.xml、log4j.properties spring-config.xml内容: 数据源|sqlSessionFactory|映射器|扫描支持注解的Bean|事务管理器|基于注解事务 springmvc-config.xml:组件扫描(controller)|注解驱动|视图解析器|文件上传等 mybatis-config.xml内容:日志记录工具|批量取别名|批量加载映射文件

2.3.定义项目结构和代码

com.ssm.entity|com.ssm.dao|com.ssm.service| com.ssm.service.impl|com.ssm.controller

2.4.配这web.xml

加载spring-config.xml|springmvc-config.xml|中文乱码

2.5.测试功能

3.整合实现——查询单个和所有

3.1.导入依赖

<dependencies>
    <!--mybatis依赖包-->
    <dependency>
        <groupId>org.mybatis</groupId>
        <artifactId>mybatis</artifactId>
        <version>3.4.4</version>
    </dependency>
    <!--spring-context依赖-->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>5.2.4.RELEASE</version>
    </dependency>
    <!--mybatis-spring依赖-->
    <dependency>
        <groupId>org.mybatis</groupId>
        <artifactId>mybatis-spring</artifactId>
        <version>2.0.4</version>
    </dependency>
    <!--bonecp数据源-->
    <dependency>
        <groupId>com.jolbox</groupId>
        <artifactId>bonecp</artifactId>
        <version>0.8.0.RELEASE</version>
    </dependency>
    <!--mysql的驱动包 -->
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.47</version>
    </dependency>
    <!--spring-jdbc依赖-->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>5.2.4.RELEASE</version>
    </dependency>
    <!--junit单元测试框架依赖-->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13</version>
        <scope>test</scope>
    </dependency>
    <!--log4j日志记录-->
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
    </dependency>
    <!--jstl依赖-->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
</dependencies>

3.2.编写配置文件

Spring配置文件:对应spring-config.xml

<?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:c="http://www.springframework.org/schema/c"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
        https://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/aop
        https://www.springframework.org/schema/aop/spring-aop.xsd
        http://www.springframework.org/schema/context
        https://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/tx
        https://www.springframework.org/schema/tx/spring-tx.xsd">

    <!--配置数据源-->
    <bean id="dataSource" class="com.jolbox.bonecp.BoneCPDataSource"
        p:driverClass="com.mysql.jdbc.Driver"
        p:jdbcUrl="jdbc:mysql://localhost:3306/yndx"
        p:username="root" p:password="admin"/>

    <!--配置SqlSessionFactory对象 -->
    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"
        p:dataSource-ref="dataSource" p:configLocation="classpath:mybatis-config.xml"/>

    <!--注入 映射器 Mapper basePackage指定了扫描的基准包,批量产生映射器的实现类-->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"
        p:basePackage="com.ssm.dao"/>

    <!--注入业务Bean 扫描注解定义的业务Bean-->
    <context:component-scan base-package="com.ssm"/>

    <!--配置事务管理器-->
    <bean id="txManager"
        class="org.springframework.jdbc.datasource.DataSourceTransactionManager"
        p:dataSource-ref="dataSource"/>

    <!--基于声明式注解事务支持 -->
    <tx:annotation-driven transaction-manager="txManager"/>
</beans>

SpringMVC配置文件:对应springmvc-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        https://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/mvc
        https://www.springframework.org/schema/mvc/spring-mvc.xsd
        http://www.springframework.org/schema/context
        https://www.springframework.org/schema/context/spring-context.xsd">

    <context:component-scan base-package="com.ssm.controller"/>
    <!--启用注解驱动-mvc配置 -->
    <mvc:annotation-driven/>

    <!--配置视图解析器 -->
    <bean id="viewResolver"
        class="org.springframework.web.servlet.view.InternalResourceViewResolver"
        p:prefix="/WEB-INF/jsp/" p:suffix=".jsp"/>
</beans>

MyBatis配置文件:对应mybatis-config.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
    PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
    "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
    <!--设置日志实现 -->
    <settings>
        <setting name="logImpl" value="LOG4J"/>
    </settings>

    <!--为实体类取别名 -->
    <typeAliases>
        <!--为整个包取别名 别名为 默认为实体类首字母小写-->
        <package name="com.ssm.entity"/>
    </typeAliases>

    <!--映射器-告诉mybatis去哪里寻找sql映射文件 -->
    <mappers>
        <!--批量加载映射关系-映射文件 -->
        <package name="com.ssm.dao"/>
    </mappers>
</configuration>

日志配置文件:对应log4j.properties

### \u5C06log4j.properties\u6587\u4EF6\u653E\u5165\u6839\u76EE\u5F55\u4E0B
### \u8BBE\u7F6ELogger\u8F93\u51FA\u7EA7\u522B\u548C\u8F93\u51FA\u76EE\u7684\u5730
###
log4j.rootLogger=debug,stdout,logfile
### \u628A\u65E5\u5FD7\u4FE1\u606F\u8F93\u51FA\u5230\u63A7\u5236\u53F0 ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.SimpleLayout
### \u628A\u65E5\u5FD7\u4FE1\u606F\u8F93\u51FA\u5230\u6587\u4EF6\uFF1Ajbit.log ###
log4j.appender.logfile=org.apache.log4j.FileAppender
log4j.appender.logfile.File=jbit.log
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss}%l %F %p %m%n

3.3.查询单个和多有功能实现

实体类

//学生类
@Data
public class Student {
    private Integer sno;
    private String pwd;
    private String sname;
    private String sex;
    private Integer gid;
    private Integer age;
    private String phone;
    private String address;
}

数据层接口:对应StudentMapper接口

//学生映射接口
public interface StudentMapper {
    @Select("select * from student where sno=#{sno}")
    Student selectBySno(Integer sno); //单个参数

    @Select("select * from student")
    List<Student> getStulist(); //查询所有学生
}

映射文件:对应StudentMapper.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
    PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ssm.dao.StudentMapper">
</mapper>

业务接口

public interface StudentService {
    Student selectBySno(Integer sno); //单个参数
    List<Student> getStulist(); //查询所有学生
}

业务实现

@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper stuMapper;

    @Override
    public Student selectBySno(Integer sno) {
        return stuMapper.selectBySno(sno);
    }

    @Override
    public List<Student> getStulist() {
        return stuMapper.getStulist();
    }
}

控制层

@Controller
public class StudentController {

    @Autowired
    private StudentService stuService;

    /**
    * 查询所有学生
    */
    @RequestMapping("/stulist.do")
    public ModelAndView getList(){
        List<Student> stulist = stuService.getStulist();
        if(stulist!=null){
            //去首页并且把查出来的所有学生带到页面去
            return new ModelAndView("index","list",stulist);
        }
        return null;
    }

    //根据学生编号查询学生
    @RequestMapping("/selectOne.do")
    public ModelAndView selectStuBySno(Integer sno){
        Student stu=stuService.selectBySno(sno);
        if(stu!=null){
            //去详情页面 并且把 单个学生对象 带到页面去
            return new ModelAndView("detail","stu",stu);
        }
        return null;
    }
}

首页页面

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>首页</title>
</head>
<body>
<div align="center">
<table align="center" border="1" cellpadding="0" cellspacing="0" width="80%">
    <tr bgcolor="blue">
        <th>学号</th>
        <th>姓名</th>
        <th>性别</th>
        <th>年龄</th>
        <th>电话</th>
        <th>地址</th>
        <th>操作</th>
    </tr>
    <c:forEach items="${list}" var="stu">
        <tr>
            <th>${stu.sno}</th>
            <th>${stu.sname}</th>
            <th>${stu.sex}</th>
            <th>${stu.age}</th>
            <th>${stu.phone}</th>
            <th>${stu.address}</th>
            <th><a href="selectOne.do?sno=${stu.sno}">详情</a>|修改|删去</th>
        </tr>
    </c:forEach>
</table>
</div>
</body>
</html>

详情页面

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>详情页面</title>
</head>
<body>
<ul style="list-style: none">
    <li>学号:${stu.sno}</li>
    <li>姓名:${stu.sname}</li>
    <li>年龄:${stu.age}</li>
    <li>性别:${stu.sex}</li>
    <li>电话:${stu.phone}</li>
    <li>地址:${stu.address}</li>
</ul>
</body>
</html>

测试:http://localhost:8080/P30_SSM/stulist.do

项目结构

4.删除功能

4.1.首页建立删去的超链接

<a href="deleteStu.do?sno=${stu.sno}">删去</a>

4.2.数据访问层接口

@Delete("delete from student where sno=#{sno}")
int deleteStuBySno(Integer sno);

4.3.业务层接口

int deleteStuBySno(Integer sno);

4.4.业务层实现

@Service
@Transactional
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper stuMapper;

    //事务处理在类上面
    @Override
    public int deleteStuBySno(Integer sno) {
        return stuMapper.deleteStuBySno(sno);
    }
}

4.5.控制层实现

//根据学生编号删去学生
@RequestMapping("/deleteStu.do")
public ModelAndView deleteStu(Integer sno){
    int num= stuService.deleteStuBySno(sno);
    if(num>0){
        //forward:stulist.do 转发到首页的RequestMapping(url)
        return new ModelAndView("forward:stulist.do","msg","delete success!");
    }
    return null;
}

4.6.页面消息提示

在首页index.jsp中

<span style="color:red">${msg==null?'':msg}</span>

5.隔行变色

5.1.导入jquery依赖库

<script type="text/javascript" src="js/jquery-2.1.4.min.js"></script>

5.2.写js代码

在首页index.jsp中

<script type="text/javascript">
$(function(){ //:even选中所有偶数 odd 奇数
    $(".base:even").css("background-color","green");
})
</script>

6.修改功能

6.1.去修改页面

超链接:在index.jsp中

<a href="toUpdatePage.do?sno=${stu.sno}">修改</a>

控制层代码

//去修改页面
@RequestMapping("/toUpdatePage.do")
public ModelAndView toUpdatePage(Integer sno){
    Student stu=stuService.selectBySno(sno);
    if(stu!=null){
        //去修改 并且把 单个学生对象 带到修改页面去
        return new ModelAndView("update","stu",stu);
    }
    return null;
}

建立修改页面并进行数据展示

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改页面</title>
</head>
<body>
<div align="center">
<form action="doUpdate.do" method="post">
    学号:<input type="text" name="sno" value="${stu.sno}" readonly="readonly"/><br>
    姓名:<input type="text" name="sname" value="${stu.sname}"/><br>
    性别:<input type="text" name="sex" value="${stu.sex}"/><br>
    年龄:<input type="text" name="age" value="${stu.age}"/><br>
    电话:<input type="text" name="phone" value="${stu.phone}"/><br>
   地址:<input type="text" name="address" value="${stu.address}"/><br>
<input type="submit" value="修改"/>&nbsp;&nbsp;<input type="reset" value="重置"/>
</form>
</div>
</body>
</html> 

6.2.真正的修改

数据层接口:对应StudentMapper接口

int updateStu(Student stu); //修改学生

映射文件

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
    PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ssm.dao.StudentMapper">
<update id="updateStu" parameterType="student">
    update student
    <set>
        <if test="sname!=null and sname!=''">sname=#{sname},</if>
        <if test="sex!=null and sex!=''">sex=#{sex},</if>
        <if test="age!=null">age=#{age},</if>
        <if test="phone!=null and phone!=''">phone=#{phone},</if>
        <if test="address!=null and address!=''">address=#{address}</if>
    </set>
    where sno=#{sno}
</update>
</mapper>

业务接口:对应StudentService接口

int updateStu(Student stu);

业务实现:对应StudentServiceImpl类

@Override
public int updateStu(Student stu) {
    return stuMapper.updateStu(stu);
}

控制层代码

//真正的去做修改功能
@RequestMapping("/doUpdate.do")
public ModelAndView updateStu(Student stu){
    int num= stuService.updateStu(stu);
    if(num>0){
        //forward:stulist.do 转发到首页的RequestMapping(url)
        return new ModelAndView("forward:stulist.do","msg","update success!");
    }
    return null;
}

首页页面消息展示:对应index.jsp页面

<span style="color:red">${msg==null?'':msg}</span>

7.增加功能

7.1.增加超链接

<p><a href="toAddPage.do">增加学生</a></p>

7.2.数据接口

@Insert("insert into student(sname,sex,age,phone,address) values(#{sname},#{sex},#
{age},#{phone},#{address})")
int addStu(Student stu); //增加学生

7.3.业务接口

int addStu(Student stu); //增加学生

7.4.业务实现

@Override
public int addStu(Student stu) {
    return stuMapper.addStu(stu);
}

7.5.控制层代码

//增加学生
@RequestMapping("/addStu.do")
public ModelAndView addStu(Student stu){
    int num= stuService.addStu(stu);
    if(num>0){
        return new ModelAndView("forward:stulist.do","msg","add success!");
    }
    return null;
}

7.6.页面消息展示

对应首页index.jsp

<span style="color:red">${msg==null?'':msg}</span>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/513287.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

GIF动态图录制工具

大家好&#xff0c;我是小寻&#xff0c;欢迎关注公众号:工具优选&#xff0c;免费领取优质项目源码和常用工具&#xff0c;还可以加入我的交流群! 一、工具介绍 Screen to Gif中文版是一款方便可靠的gif动画录制软件&#xff0c;可以用来快速录制屏幕上的指定区域&#xff…

二十年前的老游戏,为何再次让无数程序员痴迷不已?

SpaceTraders是个古老的策略类游戏&#xff0c;运行在古老的Palm OS和Windows Mobile PDA上。 游戏开始时&#xff0c;玩家将获得一艘飞船&#xff0c;然后驾驶它在各个星球之间穿梭&#xff0c;挖掘星球矿产&#xff0c;低买高卖赚取利润&#xff0c;赚了钱可以升级飞船&#…

麻了,一个操作把MySQL主从复制整崩了

最近公司某项目上反馈mysql主从复制失败&#xff0c;被运维部门记了一次大过&#xff0c;影响到了项目的验收推进&#xff0c;那么究竟是什么原因导致的呢&#xff1f;而主从复制的原理又是什么呢&#xff1f;本文就对排查分析的过程做一个记录。 主从复制原理 我们先来简单了…

淘宝商品详情接口 淘宝商品库存接口 淘宝商品销量接口 淘宝商品sku信息接口 淘宝商品优惠价接口

淘宝商品详情API接口item_get是一个非常重要的API接口&#xff0c;它可以获取淘宝商品的详细信息。对于淘_宝卖家来说&#xff0c;通过调用该接口可以实现对自己商品信息的获取、修改和管理等功能。 使用item_get接口可以获取一个商品的所有信息&#xff0c;包括商品的标题、价…

[学习笔记] [机器学习] 4. [上]线性回归(正规方程、梯度下降、岭回归)

视频链接数据集下载地址&#xff1a;无需下载 本文学习目标&#xff1a; 掌握线性回归的实现过程应用LinearRegression或SGDRegressor实现回归预测知道回归算法的评估标准及其公式知道过拟合与欠拟合的原因以及解决方法知道岭回归的原理及与线性回归的不同之处应用Ridge实现回…

这次彻底不需要账号了,无需魔法永久白嫖GPT

免费GPT 自GPT风靡以来&#xff0c;大家用的是不亦乐乎&#xff0c;你用他去解决过实际问题&#xff0c;你用他去写过代码&#xff0c;你用他去修改过bug&#xff0c;你用他去写过sql&#xff0c;你用他去画过图&#xff0c;你问过他你能想到的任何“刁钻”问题。 你&#xff…

如何在没有密码的情况下解锁华为手机

华为手机用户通常会使用密码保护他们的设备免受未经授权的访问。但是当用户忘记密码时就会出现问题。如果您无法回忆起密码&#xff0c;可以选择重置手机。但是有更多更好的方法可以帮助您解锁华为手机。在本文中&#xff0c;我们将向您展示如何免密码解锁华为手机。按照本文&a…

“五位一体”打造数字业务安全体系

顶象联合中国信通院发布的《业务安全白皮书—数字业务风险与安全》显示&#xff0c;随着数字化的发展&#xff0c;企业的关键数据、用户信息、基础设施、运营过程等均处于边界模糊且日益开放的环境中&#xff0c;涉及利益流和高附加值的业务面临多样的安全隐患&#xff1b;同时…

Linux下最强安卓模拟器,流畅又丝滑(附详细安装教程)此瓜保熟|Linux游戏党

我打算完全从头开始&#xff0c;写一个专门用于桌面办公的纯国产操作系统 &#xff0c;规避主流操作系统上影响用户体验的问题&#xff0c;系统力求简洁。有兴趣加QQ群&#xff1a;709652950 好东西让更多人发现&#xff01;我找了整整两年&#xff0c;什么Anbox&#xff0c;什…

【必知必懂论文】之多模态实体识别

引言 命名实体识别&#xff08;NER&#xff09;是自然语言处理(NLP)领域中的最基础、最核心的任务之一&#xff0c;该任务旨在识别出文本中的命名实体&#xff08;通常指特定类型事物的名称或符号&#xff0c;一般是一个名词或者短语&#xff09;&#xff0c;并将识别出的实体…

【这七款网工在线画拓扑工具,你会用几个呢?】

其实绘制拓扑图的工具有很多&#xff0c;今天主要推荐给大家7款在线的绘图软件&#xff0c;不仅好用&#xff0c;不占内存&#xff0c;而且功能强大。 看看有没有你种草的那一款哈&#xff0c;当然&#xff0c;如果有其他更好用的工具&#xff0c;也欢迎留言区告诉其他网工朋友…

apifm-wxapi

文章目录 apifm-wxapi介绍为什么要用 apifm-wxapi使用1. 项目导入 apifm-wxapi2. 平台注册3. 平台配置4. 用户注册5. 用户登录6. 使用其他API 【参考】 apifm-wxapi 介绍 “微信小程序接口工具包&#xff0c;无需服务器&#xff0c;无需开发后台&#xff0c;开箱即用&#xf…

(四)运行微信小程序:在主页加入表单组件实现提交功能

我们在上个小练习的基础上&#xff0c;继续在主页添加功能——使用表单组件form。 根据微信官方文档&#xff1a; https://developers.weixin.qq.com/miniprogram/dev/component/form.html 当需要获取用户提交的信息时&#xff0c;可以使用表单组件form。当用户点击表单中fo…

从 0~1 创建 Vue3项目(Vue3 + JS)

前言 我目前还是在用 JavaScripr开发项目&#xff0c;后面会学习 TypeScript &#xff0c;也会专门写一篇《从 0~1 创建Vue3 TS 项目》。求关注&#x1f62d; 一、创建项目前的准备工作 1.1 安装Node 创建项目需要使用 npm 或 yarn 可以去看我的另一篇文章&#xff1a;《…

免费开源的Umi-OCR 文字识别工具

大家好&#xff0c;我是小寻&#xff0c;欢迎关注公众号:工具优选&#xff0c;免费领取优质项目源码和常用工具&#xff0c;还可以加入我的交流群! 如今&#xff0c;在日常生活和工作中&#xff0c;我们经常需要捕捉屏幕截图并识别其中的文本信息。比如别人给你发资料时直接发…

Git详细用法:Git概述 安装 常用命令 分支操作 团队协作 、GitHub、idea集成Git、idea集成GitHub、码云、GitLab

课程介绍 学习目标 第1章 Git 概述 Git 是一个免费的、开源的分布式版本控制系统&#xff0c;可以快速高效地处理从小型到大型的各种项目。 Git 易于学习&#xff0c;占地面积小&#xff0c;性能极快。 它具有廉价的本地库&#xff0c;方便的暂存区域和多个工作流分支等特性…

跟着LearnOpenGL学习3--四边形绘制

文章目录 一、前言二、元素缓冲对象三、完整代码四、绘制模式 一、前言 通过跟着LearnOpenGL学习2–三角形绘制一文&#xff0c;我们已经知道了怎么配置渲染管线&#xff0c;来绘制三角形&#xff1b; OpenGL主要处理三角形&#xff0c;当我们需要绘制别的图形时&#xff0c;…

切记:缺少进项利用这个方法!增值税高也不怕!

切记&#xff1a;缺少进项利用这个方法&#xff01;增值税高也不怕&#xff01; 业务是流程&#xff0c;财税是结果&#xff0c;税收问题千千万&#xff0c;《税算盘》来帮你找答案。 企业缺少进项&#xff0c;这个问题是所有企业和财务都无法回避的问题&#xff0c;让企业非…

实用篇 | huggingface的简单应用

本文主要介绍hugging Face(拥抱脸)的简单介绍以及常见用法&#xff0c;用来模型测试是个好的工具~ 如下图所示左边框是各项任务&#xff0c;包含多模态&#xff08;Multimodal&#xff09;&#xff0c;计算机视觉(Computer Vision)&#xff0c;自然语言处理(NLP)等&#xff0c;…

强人工智能时代,区块链还有戏吗?

最近很多人都在问我&#xff0c;ChatGPT 把 AI 又带火了&#xff0c;区块链和 Web3 被抢了风头&#xff0c;以后还有戏吗&#xff1f;还有比较了解我的朋友问&#xff0c;当年你放弃 AI 而选择区块链&#xff0c;有没有后悔&#xff1f; 这里有一个小背景。2017 年初我离开 IBM…