mybatis数据输入-零散的简单类型数据

1、建库建表

CREATE DATABASE `mybatis-example`;USE `mybatis-example`;CREATE TABLE `t_emp`(emp_id INT AUTO_INCREMENT,emp_name CHAR(100),emp_salary DOUBLE(10,5),PRIMARY KEY(emp_id)
);INSERT INTO `t_emp`(emp_name,emp_salary) VALUES("tom",200.33);
INSERT INTO `t_emp`(emp_name,emp_salary) VALUES("jerry",666.66);
INSERT INTO `t_emp`(emp_name,emp_salary) VALUES("andy",777.77);

2、pom.xml

    <dependencies><dependency><groupId>org.mybatis</groupId><artifactId>mybatis</artifactId></dependency><!-- MySQL驱动 mybatis底层依赖jdbc驱动实现,本次不需要导入连接池,mybatis自带! --><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId></dependency><!--junit5测试--><dependency><groupId>org.junit.jupiter</groupId><artifactId>junit-jupiter-api</artifactId></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId></dependency></dependencies>

3、Employee.java(pojo)

package com.atguigu.mybatis.pojo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Employee {private Integer empId;private String empName;private Double empSalary;
}

4、EmpMapper.java

package com.atguigu.mybatis.mapper;
import com.atguigu.mybatis.pojo.Employee;
import org.apache.ibatis.annotations.Param;public interface EmpMapper {void addEmp(Employee employee);void addEmp2(@Param("ename") String ename, @Param("esalary") Double esalary);}

5、mybatis-config.xml(mybatis的总配置文件)

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configurationPUBLIC "-//mybatis.org//DTD Config 3.0//EN""http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration><!-- environments表示配置Mybatis的开发环境,可以配置多个环境,在众多具体环境中,使用default属性指定实际运行时使用的环境。default属性的取值是environment标签的id属性的值。 --><environments default="development"><!-- environment表示配置Mybatis的一个具体的环境 --><environment id="development"><!-- Mybatis的内置的事务管理器 --><transactionManager type="JDBC"/><!-- 配置数据源 --><dataSource type="POOLED"><!-- 建立数据库连接的具体信息 --><property name="driver" value="com.mysql.cj.jdbc.Driver"/><property name="url" value="jdbc:mysql://localhost:3306/mybatis-example"/><property name="username" value="root"/><property name="password" value="123456"/></dataSource></environment></environments><mappers><!-- Mapper注册:指定Mybatis映射文件的具体位置 --><!-- mapper标签:配置一个具体的Mapper映射文件 --><!-- resource属性:指定Mapper映射文件的实际存储位置,这里需要使用一个以类路径根目录为基准的相对路径 --><!--    对Maven工程的目录结构来说,resources目录下的内容会直接放入类路径,所以这里我们可以以resources目录为基准 --><mapper resource="mapper/EmpMapper.xml"/></mappers></configuration>

6、EmpMapper.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN""https://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!-- namespace等于mapper接口类的全限定名,这样实现对应 -->
<mapper namespace="com.atguigu.mybatis.mapper.EmpMapper"><!--演示数据类型--><!--单个实体类型作为输入参数--><insert id="addEmp"><!--此处的empName和empSalary不能随便写,必须是参数中的属性名称-->insert into t_emp values(0,#{empName},#{empSalary})<!--Preparing: insert into t_emp values(0,?,?)--></insert><!--零散的参数--><insert id="addEmp2">insert into t_emp values(0,#{ename},#{esalary})<!--insert into t_emp values(0,#{arg0},#{arg1})--><!--insert into t_emp values(0,#{param1},#{param2})--></insert>
</mapper>

7、MybatisTest3.java

package com.atguigu.mybatis;
import com.atguigu.mybatis.mapper.EmpMapper;
import com.atguigu.mybatis.pojo.Employee;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.io.InputStream;
public class MybatisTest3 {SqlSessionFactory sqlSessionFactory;SqlSession sqlSession;EmpMapper empMapper;@BeforeEachpublic void setup() throws IOException {// 获取资源流,读取"mybatis-config.xml"文件InputStream inputStream = Resources.getResourceAsStream("mybatis-config.xml");// 使用资源流创建SqlSessionFactorysqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);// 使用SqlSessionFactory打开一个SessionsqlSession = sqlSessionFactory.openSession();// 使用Session获取EmpMapper的Mapper对象empMapper = sqlSession.getMapper(EmpMapper.class);}// 在每个测试用例之后执行的清理方法@AfterEachpublic void teardown() {sqlSession.commit();  // 提交事务sqlSession.close();  // 关闭SqlSession}@Testpublic void addEmpTest() {Employee employee = new Employee(0, "鸠摩智", 8080.0);empMapper.addEmp(employee);}@Testpublic void addEmpTest2() {empMapper.addEmp2("张无忌",999.9);}
}
D:\Java\jdk-17\bin\java.exe -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:D:\BaiduNetdiskDownload\IntelliJ IDEA 2023.2\lib\idea_rt.jar=57332:D:\BaiduNetdiskDownload\IntelliJ IDEA 2023.2\bin" -Dfile.encoding=UTF-8 -classpath "D:\develop\maven\repository\org\junit\platform\junit-platform-launcher\1.3.1\junit-platform-launcher-1.3.1.jar;D:\develop\maven\repository\org\apiguardian\apiguardian-api\1.0.0\apiguardian-api-1.0.0.jar;D:\develop\maven\repository\org\junit\platform\junit-platform-engine\1.3.1\junit-platform-engine-1.3.1.jar;D:\develop\maven\repository\org\junit\platform\junit-platform-commons\1.3.1\junit-platform-commons-1.3.1.jar;D:\develop\maven\repository\org\opentest4j\opentest4j\1.1.1\opentest4j-1.1.1.jar;D:\develop\maven\repository\org\junit\jupiter\junit-jupiter-engine\5.3.1\junit-jupiter-engine-5.3.1.jar;D:\develop\maven\repository\org\junit\jupiter\junit-jupiter-api\5.3.1\junit-jupiter-api-5.3.1.jar;D:\BaiduNetdiskDownload\IntelliJ IDEA 2023.2\lib\idea_rt.jar;D:\BaiduNetdiskDownload\IntelliJ IDEA 2023.2\plugins\junit\lib\junit5-rt.jar;D:\BaiduNetdiskDownload\IntelliJ IDEA 2023.2\plugins\junit\lib\junit-rt.jar;F:\IdeaProjects\workspace\pro-ssm\pro18-mybatis-begin\target\test-classes;F:\IdeaProjects\workspace\pro-ssm\pro18-mybatis-begin\target\classes;F:\my_java\maven_repository\org\mybatis\mybatis\3.5.11\mybatis-3.5.11.jar;F:\my_java\maven_repository\mysql\mysql-connector-java\8.0.25\mysql-connector-java-8.0.25.jar;F:\my_java\maven_repository\com\google\protobuf\protobuf-java\3.11.4\protobuf-java-3.11.4.jar;F:\my_java\maven_repository\org\junit\jupiter\junit-jupiter-api\5.3.1\junit-jupiter-api-5.3.1.jar;F:\my_java\maven_repository\org\apiguardian\apiguardian-api\1.0.0\apiguardian-api-1.0.0.jar;F:\my_java\maven_repository\org\opentest4j\opentest4j\1.1.1\opentest4j-1.1.1.jar;F:\my_java\maven_repository\org\junit\platform\junit-platform-commons\1.3.1\junit-platform-commons-1.3.1.jar;F:\my_java\maven_repository\org\projectlombok\lombok\1.18.20\lombok-1.18.20.jar;F:\my_java\maven_repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;F:\my_java\maven_repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;F:\my_java\maven_repository\org\slf4j\slf4j-api\1.7.25\slf4j-api-1.7.25.jar" com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 com.atguigu.mybatis.MybatisTest3,addEmpTest2
11:39:57,274 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
11:39:57,274 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
11:39:57,274 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/F:/IdeaProjects/workspace/pro-ssm/pro18-mybatis-begin/target/classes/logback.xml]
11:39:57,360 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
11:39:57,363 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
11:39:57,369 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
11:39:57,393 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
11:39:57,394 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
11:39:57,395 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.atguigu.mybatis] to DEBUG
11:39:57,395 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
11:39:57,396 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@62230c58 - Registering current configuration as safe fallback point
[11:39:57.401] [DEBUG] [main] [org.apache.ibatis.logging.LogFactory] [Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter.]
[11:39:57.415] [DEBUG] [main] [org.apache.ibatis.datasource.pooled.PooledDataSource] [PooledDataSource forcefully closed/removed all connections.]
[11:39:57.415] [DEBUG] [main] [org.apache.ibatis.datasource.pooled.PooledDataSource] [PooledDataSource forcefully closed/removed all connections.]
[11:39:57.415] [DEBUG] [main] [org.apache.ibatis.datasource.pooled.PooledDataSource] [PooledDataSource forcefully closed/removed all connections.]
[11:39:57.415] [DEBUG] [main] [org.apache.ibatis.datasource.pooled.PooledDataSource] [PooledDataSource forcefully closed/removed all connections.]
[11:39:57.483] [DEBUG] [main] [org.apache.ibatis.transaction.jdbc.JdbcTransaction] [Opening JDBC Connection]
[11:39:58.035] [DEBUG] [main] [org.apache.ibatis.datasource.pooled.PooledDataSource] [Created connection 694069884.]
[11:39:58.035] [DEBUG] [main] [org.apache.ibatis.transaction.jdbc.JdbcTransaction] [Setting autocommit to false on JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@295eaa7c]]
[11:39:58.040] [DEBUG] [main] [com.atguigu.mybatis.mapper.EmpMapper.addEmp2] [==>  Preparing: insert into t_emp values(0,?,?)]
[11:39:58.099] [DEBUG] [main] [org.apache.ibatis.transaction.jdbc.JdbcTransaction] [Committing JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@295eaa7c]]
[11:39:58.100] [DEBUG] [main] [org.apache.ibatis.transaction.jdbc.JdbcTransaction] [Resetting autocommit to true on JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@295eaa7c]]
[11:39:58.101] [DEBUG] [main] [org.apache.ibatis.transaction.jdbc.JdbcTransaction] [Closing JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@295eaa7c]]
[11:39:58.101] [DEBUG] [main] [org.apache.ibatis.datasource.pooled.PooledDataSource] [Returned connection 694069884 to pool.]org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: org.apache.ibatis.binding.BindingException: Parameter 'ename' not found. Available parameters are [arg1, arg0, param1, param2]
### The error may exist in mapper/EmpMapper.xml
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: insert into t_emp values(0,?,?)
### Cause: org.apache.ibatis.binding.BindingException: Parameter 'ename' not found. Available parameters are [arg1, arg0, param1, param2]at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:196)at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:181)at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)at org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:145)at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86)at jdk.proxy2/jdk.proxy2.$Proxy10.addEmp2(Unknown Source)at com.atguigu.mybatis.MybatisTest3.addEmpTest2(MybatisTest3.java:45)at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.base/java.lang.reflect.Method.invoke(Method.java:568)at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:515)at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:115)at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:171)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:167)at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:114)at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:59)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:105)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:95)at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:71)at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:110)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:95)at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:71)at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:110)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:95)at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:71)at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57)at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)
Caused by: org.apache.ibatis.binding.BindingException: Parameter 'ename' not found. Available parameters are [arg1, arg0, param1, param2]at org.apache.ibatis.binding.MapperMethod$ParamMap.get(MapperMethod.java:212)at org.apache.ibatis.reflection.wrapper.MapWrapper.get(MapWrapper.java:45)at org.apache.ibatis.reflection.MetaObject.getValue(MetaObject.java:122)at org.apache.ibatis.scripting.defaults.DefaultParameterHandler.setParameters(DefaultParameterHandler.java:79)at org.apache.ibatis.executor.statement.PreparedStatementHandler.parameterize(PreparedStatementHandler.java:94)at org.apache.ibatis.executor.statement.RoutingStatementHandler.parameterize(RoutingStatementHandler.java:64)at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:88)at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49)at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:194)... 47 moreProcess finished with exit code -1

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

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

相关文章

版本控制系统Git学习笔记-Git基本知识介绍

目录 前言一、版本控制系统1.1 什么是版本控制系统1.2 本地版本控制系统1.3 集中化的版本控制系统1.3 分布式版本控制系统 二、Git简介2.1 数据处理方式2.2 几个特点2.2.1 几乎所有操作都是本地执行2.2.2 Git保证完整性2.2.3 Git一般只添加数据 2.3 Git中文件状态2.3.1 三种文件…

拼图游戏制作

2.创建用户界面 package domain; /** * ClassName: User * Author: Kox * Data: 2023/2/2 * Sketch: */ public class User { private String username; private String password; public User() { } public User(String username, String p…

防火墙之iptables

iptables概述 1.Linux 系统的防火墙 &#xff1a;IP信息包过滤系统&#xff0c;它实际上由两个组件netfilter 和 iptables组成。 2.主要工作在网络层&#xff0c;针对IP数据包。体现在对包内的IP地址、端口、协议等信息的处理上。 -netfilter/iptables关系&#xff1a; netfil…

JS获取字符串里最长的回文字符串

方法一 使用双指针配合枚举 /*** param {string} s* return {string}*/ const longestPalindrome s > {const LEN s.lengthif (LEN < 2) {return s}let maxStr /*** param left * param right * returns */const findPalindrome (left, right) > {while (left &…

day32_Git

今日内容 零、 复习昨日 零、 复习昨日 一、引言 在单人开发过程中&#xff0c;需要进行版本管理&#xff0c;以利于开发进度的控制。 在多人开发过程中&#xff0c;不仅需要版本管理&#xff0c;还需要进行多人协同控制。 版本控制(VS) SVN GIT 二、介绍 Git是一个开源的…

rabbitmq-server-3.11.10.exe

rabbitmq需要erlang环境 otp_win64_25.1.exe erlang-CSDN博客 https://www.rabbitmq.com/download.htmlhttps://www.rabbitmq.com/install-windows.htmlhttps://github.com/rabbitmq/rabbitmq-server/releases/download/v3.11.10/rabbitmq-server-3.11.10.exe C:\Users\Admi…

Spine深入学习 —— 换装

Spine深入学习————换装 数据对象和实例对象的关系与区别 数据对象是无状态的&#xff0c;可在任意数量的骨架实例间共用。有对应实例数据的数据对象类名称以“Data”结尾&#xff0c;没有对应实例数据的数据对象则没有后缀&#xff0c;如附件、皮肤及动画。 实例对象有许…

【数据结构】——排序

&#x1f383;个人专栏&#xff1a; &#x1f42c; 算法设计与分析&#xff1a;算法设计与分析_IT闫的博客-CSDN博客 &#x1f433;Java基础&#xff1a;Java基础_IT闫的博客-CSDN博客 &#x1f40b;c语言&#xff1a;c语言_IT闫的博客-CSDN博客 &#x1f41f;MySQL&#xff1a…

bugku题解记录2

文章目录 哥哥的秘密黄道十二官where is flag一段新闻 哥哥的秘密 给出了一个qq&#xff0c;那就去看看呗 hint里面说 收集空间信息——相册——收集微博信息——相册——解题——相册——提交flag 那看看空间先 盲文&#xff1a; hint&#xff1a;密码时地人 旗帜存在相册里…

【精选】ATKCK红队评估实战靶场一 超详细过程思路

一、环境搭建 1.红日靶场下载&#xff1a; 靶场下载地址&#xff1a; https://pan.baidu.com/s/1nC6V8e_EuKfaLb2IuEbe7w&shflsharepset 提取码&#xff1a;n1u22.内外网IP搭建 Windows 7 x64Windows Server 2008Win2K3 Metasploitablekali内网IP&#xff1a;192.168.52…

【LeetCode:1657. 确定两个字符串是否接近 | 计数 + 阅读理解】

&#x1f680; 算法题 &#x1f680; &#x1f332; 算法刷题专栏 | 面试必备算法 | 面试高频算法 &#x1f340; &#x1f332; 越难的东西,越要努力坚持&#xff0c;因为它具有很高的价值&#xff0c;算法就是这样✨ &#x1f332; 作者简介&#xff1a;硕风和炜&#xff0c;…

Ubuntu使用Nginx部署前端项目——记录

安装nginx 依次执行以下两条命令进行安装&#xff1a; sudo apt-get update sudo apt-get install nginx通过查看版本号查看是否安装成功&#xff1a; nginx -v补充卸载操作&#xff1a; sudo apt-get remove nginx nginx-common sudo apt-get purge nginx nginx-common su…

[ffmpeg] aac 音频编码

aac 介绍 aac 简单说就是音频的一种压缩编码器&#xff0c;相同音质下压缩比 mp3好&#xff0c;目前比较常用。 aac 编码支持的格式 aac 支持的 sample_fmts: 8 aac 支持的 samplerates: 96000 88200 64000 48000 44100 32000 24000 22050 16000 12000 11025 8000 7350 通…

Pycharm中使用matplotlib绘制动态图形

Pycharm中使用matplotlib绘制动态图形 最终效果 最近用pycharm学习D2L时发现官方在jupyter notebook交互式环境中能动态绘制图形&#xff0c;但是在pycharm脚本环境中只会在最终 plt.show() 后输出一张静态图像。于是有了下面这段自己折腾了一下午的代码&#xff0c;用来在pych…

unity学习笔记12

一、物理系统 如何让一个球体受到重力的影响&#xff1f; 只要给物体添加刚体组件&#xff08;Rigidbody&#xff09;&#xff0c;就可以使其受到重力影响 1.刚体&#xff08;Rigidbody&#xff09;&#xff1a; 刚体是一个组件&#xff0c;用于使游戏对象受到物理引擎的控制。…

Leetcode2336. 无限集中的最小数字

Every day a Leetcode 题目来源&#xff1a;2336. 无限集中的最小数字 解法1&#xff1a;集合 由于一开始类中包含所有正整数&#xff0c;并且操作要么添加任意的正整数&#xff0c;要么删除最小的正整数&#xff0c;因此我们可以期望&#xff0c;在任意时刻&#xff0c;存…

高速PCB设计中的射频分析与处理方法

射频&#xff08;Radio Frequency&#xff0c;RF&#xff09;电路在现代电子领域中扮演着至关重要的角色&#xff0c;涵盖了广泛的应用&#xff0c;从通信系统到雷达和射频识别&#xff08;RFID&#xff09;等。在高速PCB设计中&#xff0c;射频电路的分析和处理是一项具有挑战…

4152A/E/F 调制域分析仪(0.125Hz~4GHz/26.5GHz/40GHz)

4152A/E/F 调制域分析仪 频率范围覆盖&#xff1a;0.125Hz&#xff5e;40GHz 能够精确表征信号频率随时间动态变化规律 01 产品综述 4152系列调制域分析仪能够精确表征信号频率随时间动态变化规律&#xff0c;最大监测带宽36GHz&#xff0c;最短每隔100ns无隙监测&#xff…

html/css中用float实现的盒子案例

运行效果&#xff1a; 代码部分&#xff1a; <!doctype html> <html> <head> <meta charset"utf-8"> <title>无标题文档</title> <style type"text/css">.father{width:300px; height:400px; background:gray;…

svn合并冲突时每个选项的含义

合并冲突时每个选项的含义 - 这个图片是 TortoiseSVN&#xff08;一个Subversion&#xff08;SVN&#xff09;客户端&#xff09;的合并冲突解决对话框。当你尝试合并两个版本的文件并且出现差异时&#xff0c;你需要解决这些差异。这个对话框提供了几个选项来处理合并冲突&…