首页 > 其他分享 >2024/11/20日工作总结

2024/11/20日工作总结

时间:2024-11-23 23:26:07浏览次数:3  
标签:11 20 String request 2024 classes import com public

完成java课堂测试:课程管理系统
用前端页面实现数据库增删改查;
mapper:

点击查看代码
package com.vivy.mapper;
import com.vivy.pojo.Classes;

import java.util.List;

public interface ClassesMapper {


    void add(Classes classes);

    List<Classes> selectAll();
    List<Classes> selectByConditionSingle(Classes classes);

    Classes selectByClassId(String classId);

    int update(Classes classes);

    void delete(int id);
}

pojo:

点击查看代码
package com.vivy.pojo;

public class Classes {
    int id;
    String classId;
    String className;
    int number;
    String teacherName;
    String position;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getClassId() {
        return classId;
    }

    public void setClassId(String classId) {
        this.classId = classId;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public String getTeacherName() {
        return teacherName;
    }

    public void setTeacherName(String teacherName) {
        this.teacherName = teacherName;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    @Override
    public String toString() {
        return "Class{" +
                "id=" + id +
                ", classId='" + classId + '\'' +
                ", className='" + className + '\'' +
                ", number=" + number +
                ", teacherName='" + teacherName + '\'' +
                ", position='" + position + '\'' +
                '}';
    }
}

service:

点击查看代码
package com.vivy.service;

import com.vivy.mapper.ClassesMapper;
import com.vivy.pojo.Classes;
import com.vivy.util.SqlSessionFactoryUtils;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import java.util.List;

public class ClassesService {
    SqlSessionFactory sqlSessionFactory = SqlSessionFactoryUtils.getSqlSessionFactory();

    public List<Classes> selectAll(){

        SqlSession sqlSession = sqlSessionFactory.openSession();
        ClassesMapper classesMapper = sqlSession.getMapper(ClassesMapper.class);

        List<Classes> cls = classesMapper.selectAll();

        sqlSession.close();
        return cls;
    }

    public List<Classes> selectByConditionSingle(Classes classes){

        SqlSession sqlSession = sqlSessionFactory.openSession();
        ClassesMapper classesMapper = sqlSession.getMapper(ClassesMapper.class);

        List<Classes> cls = classesMapper.selectByConditionSingle(classes);

        sqlSession.close();
        return cls;
    }

    public Classes selectByClassId(String s){

        SqlSession sqlSession = sqlSessionFactory.openSession();
        ClassesMapper classesMapper = sqlSession.getMapper(ClassesMapper.class);

        Classes classes = classesMapper.selectByClassId(s);

        sqlSession.close();
        return classes;
    }

    public void add(Classes classes){

        SqlSession sqlSession = sqlSessionFactory.openSession();
        ClassesMapper classesMapper = sqlSession.getMapper(ClassesMapper.class);

        classesMapper.add(classes);

        sqlSession.commit();
        sqlSession.close();
    }

    public void update(Classes classes){

        SqlSession sqlSession = sqlSessionFactory.openSession();
        ClassesMapper classesMapper = sqlSession.getMapper(ClassesMapper.class);

        classesMapper.update(classes);

        sqlSession.commit();
        sqlSession.close();
    }

    public void delete(int id){

        SqlSession sqlSession = sqlSessionFactory.openSession();
        ClassesMapper classesMapper = sqlSession.getMapper(ClassesMapper.class);

        classesMapper.delete(id);

        sqlSession.commit();
        sqlSession.close();
    }
}

util:

点击查看代码
package com.vivy.util;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.IOException;
import java.io.InputStream;

public class SqlSessionFactoryUtils {

    private static SqlSessionFactory sqlSessionFactory;

    static {
        //静态代码块会随着类的加载自动执行,且只执行一次

        try {
            String resource = "mybatis-config.xml";
            InputStream inputStream = Resources.getResourceAsStream(resource);
            sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
    public static SqlSessionFactory getSqlSessionFactory(){
        return sqlSessionFactory;
    }
}

web:

点击查看代码
package com.vivy.web;

import com.vivy.mapper.ClassesMapper;
import com.vivy.pojo.Classes;
import com.vivy.service.ClassesService;
import com.vivy.util.SqlSessionFactoryUtils;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

@WebServlet("/addCourseServlet")
public class addCourseServlet extends HttpServlet {
    private ClassesService service = new ClassesService();
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");

        String classId = request.getParameter("classId");
        String className = request.getParameter("className");
        String number = request.getParameter("number");
        String teacherName = request.getParameter("teacherName");
        String position = request.getParameter("position");

        //# = new String(classId.getBytes(StandardCharsets.ISO_8859_1),StandardCharsets.UTF_8);

        Classes classes = new Classes();
        classes.setClassId(classId);
        classes.setClassName(className);
        classes.setNumber(Integer.parseInt(number));
        classes.setTeacherName(teacherName);
        classes.setPosition(position);

        service.add(classes);

        request.getRequestDispatcher("/selectAllServlet").forward(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request, response);
    }
}
点击查看代码
package com.vivy.web;

import com.vivy.service.ClassesService;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet("/deleteCourseServlet")
public class deleteCourseServlet extends HttpServlet {
    private ClassesService service = new ClassesService();
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");

        String id = request.getParameter("id");
        service.delete(Integer.parseInt(id));

        request.getRequestDispatcher("/selectAllServlet").forward(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request, response);
    }
}
点击查看代码
package com.vivy.web;

import com.vivy.pojo.Classes;
import com.vivy.service.ClassesService;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;

@WebServlet("/selectAllServlet")
public class selectAllServlet extends HttpServlet {
    private ClassesService service = new ClassesService();
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        //# = new String(classId.getBytes(StandardCharsets.ISO_8859_1),StandardCharsets.UTF_8);

        List<Classes> cls = service.selectAll();

        //存入request域中
        request.setAttribute("cls",cls);

        //转发
        request.getRequestDispatcher("/printList.jsp").forward(request,response);

    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request, response);
    }
}
点击查看代码
package com.vivy.web;

import com.vivy.pojo.Classes;
import com.vivy.service.ClassesService;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet("/selectByClassIdServlet")
public class selectByClassIdServlet extends HttpServlet {

    private ClassesService service = new ClassesService();
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        //# = new String(classId.getBytes(StandardCharsets.ISO_8859_1),StandardCharsets.UTF_8);

        String id = request.getParameter("classId");

        Classes classes = service.selectByClassId(id);

        request.setAttribute("classes",classes);

        request.getRequestDispatcher("/update.jsp").forward(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request, response);
    }
}
点击查看代码
package com.vivy.web;

import com.vivy.pojo.Classes;
import com.vivy.service.ClassesService;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;

@WebServlet("/selectByConditionSingleServlet")
public class selectByConditionSingleServlet extends HttpServlet {
    private ClassesService service = new ClassesService();
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        //# = new String(classId.getBytes(StandardCharsets.ISO_8859_1),StandardCharsets.UTF_8);

        String className = request.getParameter("className");
        String teacherName = request.getParameter("teacherName");
        String position = request.getParameter("position");


        Classes classes = new Classes();
        classes.setClassName(className);
        classes.setTeacherName(teacherName);
        classes.setPosition(position);

        List<Classes> cls = service.selectByConditionSingle(classes);

        request.setAttribute("cls",cls);

        request.getRequestDispatcher("/printList.jsp").forward(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request, response);
    }
}
点击查看代码
package com.vivy.web;

import com.vivy.pojo.Classes;
import com.vivy.service.ClassesService;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet("/selectToDelete")
public class selectToDelete extends HttpServlet {

    private ClassesService service = new ClassesService();
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        //# = new String(classId.getBytes(StandardCharsets.ISO_8859_1),StandardCharsets.UTF_8);

        String id = request.getParameter("classId");

        Classes classes = service.selectByClassId(id);

        request.setAttribute("classes",classes);

        request.getRequestDispatcher("/delete.jsp").forward(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request, response);
    }
}
点击查看代码
package com.vivy.web;

import com.vivy.pojo.Classes;
import com.vivy.service.ClassesService;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet("/updateCourseServlet")
public class updateCourseServlet extends HttpServlet {
    private ClassesService service = new ClassesService();
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        //# = new String(classId.getBytes(StandardCharsets.ISO_8859_1),StandardCharsets.UTF_8);

        String id = request.getParameter("id");
        String className = request.getParameter("className");
        String number = request.getParameter("number");
        String teacherName = request.getParameter("teacherName");
        String position = request.getParameter("position");

        Classes classes = new Classes();
        classes.setId(Integer.parseInt(id));
        classes.setClassName(className);
        classes.setNumber(Integer.parseInt(number));
        classes.setTeacherName(teacherName);
        classes.setPosition(position);

        service.update(classes);

        request.getRequestDispatcher("/selectAllServlet").forward(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request, response);
    }
}

mapper.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.vivy.mapper.ClassesMapper">

    <resultMap id="classesResultMap" type="classes">
        <result column="class_id" property="classId"></result>
        <result column="class_name" property="className"></result>
        <result column="teacher_name" property="teacherName"></result>
    </resultMap>

    <select id="selectAll" resultType="classes" resultMap="classesResultMap">
        select * from tb_class;
    </select>

    <select id="selectByConditionSingle" resultType="com.vivy.pojo.Classes" resultMap="classesResultMap">
        select *
        from tb_class
        <where>
            <choose>
                <when test="className != null and className != ''">
                    class_name = #{className}
                </when>
                <when test="teacherName != null and teacherName != '' ">
                    teacher_name like #{teacherName}
                </when>
                <when test="position != null and position != '' ">
                    position like #{position}
                </when>
            </choose>
        </where>
    </select>

    <select id="selectByClassId" resultType="com.vivy.pojo.Classes" resultMap="classesResultMap">
        select *
        from tb_class
        where class_id = #{classId}
    </select>

    <insert id="add" useGeneratedKeys="true" keyProperty="id">
        insert into tb_class (class_id, class_name, number, teacher_name, position)
        values (#{classId}, #{className}, #{number}, #{teacherName}, #{position});
    </insert>

    <update id="update">
        update tb_class
        <set>
            <if test="className != null and className != '' ">
                class_name = #{className},
            </if>
            <if test="number != null ">
                number = #{number},
            </if>
            <if test="teacherName != null and teacherName != '' ">
                teacher_name = #{teacherName},
            </if>
            <if test="position != null and position != '' ">
                position = #{position},
            </if>
        </set>
        where id = #{id};
    </update>

    <delete id="delete">
        delete from tb_class where id = #{id}
    </delete>

</mapper>
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>

    <!--起别名,不区分大小写-->
    <typeAliases>
        <package name="com.vivy.pojo"/>
    </typeAliases>

    <environments default="development">

        <environment id="development">
            <transactionManager type="JDBC"/>
            <dataSource type="POOLED">
                <property name="driver" value="com.mysql.cj.jdbc.Driver"/>
                <property name="url" value="jdbc:mysql://localhost:3306/mybatis?useSSL=true&amp;serverTimezone=UTC"/>
                <property name="username" value="root"/>
                <property name="password" value="123456"/>
            </dataSource>
        </environment>

    </environments>
    <mappers>

        <!--加载sql映射文件-->
        <!--<mapper resource="com/itheima/mapper/UserMapper.xml"/>-->

        <!--Mapper 代理,扫描mapper-->
        <package name="com.vivy.mapper"/>

    </mappers>
</configuration>

webapp:

点击查看代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新增课程</title>
</head>
<body>
<h2>新增课程</h2>
<form id="add-form" action="/course-demo/addCourseServlet" method="post">
    课程编号:<input name="classId" type="text" id="classId" ><br>
    课程名称:<input name="className" type="text" id="className" ><br>
    选课人数:<input name="number" type="number" id="number" ><br>
    任课教师:<input name="teacherName" type="text" id="teacherName" ><br>
    上课地点:<input name="position" type="text" id="position" ><br>

    <div class="buttons">
        <input value="添加课程" type="submit" id="add_btn">
    </div>
    <br class="clear">
</form>

</body>
</html>
点击查看代码
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" %>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>修改课程</title>
</head>
<body>
<h2>修改课程</h2>
<form action="${pageContext.request.contextPath}/deleteCourseServlet" method="post">
    <hr>
    <table border="1" cellspacing="0" width="80%">
        <tr>
            <th>课程编号</th>
            <th>课程名称</th>
            <th>选课人数</th>
            <th>教师名称</th>
            <th>上课地点</th>

        </tr>

        <tr align="center">
            <td>${classes.classId}</td>
            <td>${classes.className}</td>
            <td>${classes.number}</td>
            <td>${classes.teacherName}</td>
            <td>${classes.position}</td>
        </tr>
    </table>

    <%--隐藏域,提交id--%>
    <input type="hidden" name="id" value="${classes.id}">

        <div class="buttons">
            <input value="确认删除" type="submit" id="delete2_btn">
        </div>
        <br class="clear">
</form>

</body>
</html>
点击查看代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>删除课程</title>
</head>
<body>
<h2>删除课程</h2>
<form id="delete-form" action="/course-demo/selectToDelete" method="post">
    课程编号:<input name="classId" type="text" id="classId" required><br>
    <div class="buttons">
        <input value="提交删除" type="submit" id="delete1_btn">
    </div>
    <br class="clear">
</form>

</body>
</html>
点击查看代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>课程管理系统</title>
    <script>
        function addCourse() {
            window.location.href = "addCourse.html";
        }

        function modifyCourse() {
            window.location.href = "modifyCourse.html";
        }

        function deleteCourse() {
            window.location.href = "deleteCourse.html";
        }

        function searchCourses() {
            window.location.href = "searchCourses.html";
        }

        function selectAllCourses() {
            window.location.href = "/course-demo/selectAllServlet";
        }
    </script>
</head>
<body>
<h1>课程管理系统</h1>
<button onclick="addCourse()">新增课程</button>
<button onclick="modifyCourse()">修改课程</button>
<button onclick="deleteCourse()">删除课程</button>
<button onclick="searchCourses()">查询课程</button>
<button onclick="selectAllCourses()">浏览课程</button>
</body>
</html>
点击查看代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>修改课程</title>
</head>
<body>
<h2>修改课程</h2>
<form id="modify-form" action="/course-demo/selectByClassIdServlet" method="post">
    课程编号:<input name="classId" type="text" id="classId" required><br>
    <div class="buttons">
        <input value="修改课程" type="submit" id="modify_btn">
    </div>
    <br class="clear">
</form>

</body>
</html>
点击查看代码
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" %>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function Back() {
            window.location.href = "index.html";
        }
    </script>
</head>
<body>
<hr>
<table border="1" cellspacing="0" width="80%">
    <tr>
        <th>序号</th>
        <th>课程编号</th>
        <th>课程名称</th>
        <th>选课人数</th>
        <th>教师名称</th>
        <th>上课地点</th>

    </tr>

    <c:forEach items="${cls}" var="classes" varStatus="status">
        <tr align="center">
            <td>${status.count}</td>
            <td>${classes.classId}</td>
            <td>${classes.className}</td>
            <td>${classes.number}</td>
            <td>${classes.teacherName}</td>
            <td>${classes.position}</td>
        </tr>

    </c:forEach>
</table>

<button onclick="Back()">返回首页</button>

</body>
</html>
点击查看代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>查询课程</title>
</head>
<body>
<h2>查询课程</h2>
<form id="search-form" action="/course-demo/selectByConditionSingleServlet" method="post">
    课程名称:<input name="className" type="text" id="className" ><br>
    任课教师:<input name="teacherName" type="text" id="teacherName" ><br>
    上课地点:<input name="position" type="text" id="position" ><br>

    <div class="buttons">
        <input value="查询课程" type="submit" id="search_btn">
    </div>
    <br class="clear">
</form>

</body>
</html>
点击查看代码
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" %>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>修改课程</title>
</head>
<body>
<h2>修改课程</h2>
<form action="${pageContext.request.contextPath}/updateCourseServlet" method="post">

    <%--隐藏域,提交id--%>
    <input type="hidden" name="id" value="${classes.id}">

    课程名称:<input name="className" type="text" id="className" value="${classes.className}"><br>
    选课人数:<input name="number" type="number" id="number" value="${classes.number}"><br>
    任课教师:<input name="teacherName" type="text" id="teacherName" value="${classes.teacherName}"><br>
    上课地点:<input name="position" type="text" id="position" value="${classes.position}"><br>

    <div class="buttons">
        <input value="修改课程" type="submit" id="update_btn">
    </div>
    <br class="clear">
</form>

</body>
</html>

pom.xml:

点击查看代码
<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 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.example</groupId>
  <artifactId>course-demo</artifactId>
  <packaging>war</packaging>
  <version>1.0-SNAPSHOT</version>

  <dependencies>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.1.0</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.6</version>
    </dependency>

    <dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis</artifactId>
      <version>3.5.5</version>
    </dependency>

    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>8.0.28</version>
    </dependency>

    <dependency>
      <groupId>jstl</groupId>
      <artifactId>jstl</artifactId>
      <version>1.1.2</version>
    </dependency>
    <dependency>
      <groupId>taglibs</groupId>
      <artifactId>standard</artifactId>
      <version>1.1.2</version>
    </dependency>

  </dependencies>

  <build>
    <plugins>

      <!-- tomcat 插件 -->
      <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.2</version>
      </plugin>

    </plugins>
  </build>

</project>

标签:11,20,String,request,2024,classes,import,com,public
From: https://www.cnblogs.com/zhanglijian/p/18565239

相关文章

  • 2024/11/22日工作总结
    完成java请假条管理系统:实现web页面的增删改查操作;项目结构如图:mapper:点击查看代码packagecom.vivy.mapper;importcom.vivy.pojo.Application;importjava.util.List;publicinterfaceApplicationMapper{voidadd(Applicationapplication);Applica......
  • 1123-最小栈
    最小栈leetcode155.题目大意:设计一个栈,要求在常数时间内检测到最小元素解题思路:设置一个存最小元素的栈,这样就可以同步更新最小值题解及注释:classMinStack{privateStack<Integer>stack;privateStack<Integer>minStack;//最小栈//初始化public......
  • 22207320-王攀-Blog2
    题目集4~6的总结性Blog一、前言经过题目集4至6的练习,我对Java编程的理解和实践能力都有了显著的提升。题目集4主要考察了继承与正则表达式的知识点,题目集5引入了家庭电路的模拟,题目集6则在前者的基础上增加了并联电路的处理。三次题目集的题量逐步增加,难度也有所提升,特别是题目......
  • 题解:AT_abc381_c [ABC381C] 11/22 Substring
    显然这个“11/22Substring”是以那个“/”为中心对称的。鉴于一个这样的字符串只能有一个“/”,而题目又要求最长,所以确定了“/”就能确定一个满足要求的子串。那思路就很简单了,只有两步:找到所有的“/”两边同时寻找相应的子串。别的,除了判断一下越界之外,就不用管了。......
  • 2024-2025-1 20241413 《计算机基础与程序设计》第九周学习总结
    班级链接https://edu.cnblogs.com/campus/besti/2024-2025-1-CFAP作业要求https://www.cnblogs.com/rocedu/p/9577842.html#WEEK09作业目标操作系统责任内存与进程管理分时系统CPU调度文件、文件系统文件保护磁盘调度教材学习内容总结《计算机科学概论》......
  • YOLOv10改进,YOLOv10添加DynamicConv(动态卷积),CVPR2024,二次创新C2f结构
    摘要大规模视觉预训练显著提高了大规模视觉模型的性能。现有的低FLOPs模型无法从大规模预训练中受益。在本文中,作者提出了一种新的设计原则,称为ParameterNet,旨在通过最小化FLOPs的增加来增加大规模视觉预训练模型中的参数数量。利用DynamicConv动态卷积将额外的参......
  • P1055 [NOIP2008 普及组] ISBN 号码
    题目描述每一本正式出版的图书都有一个ISBN号码与之对应,ISBN码包括 99 位数字、11 位识别码和 33 位分隔符,其规定格式如 x-xxx-xxxxx-x,其中符号 - 就是分隔符(键盘上的减号),最后一位是识别码,例如 0-670-82162-4就是一个标准的ISBN码。ISBN码的首位数字表示书籍的......
  • 2000度超高温下材料三维应变测量技术及其应用
    在航空航天、能源和化工等工业领域,许多机件是在高温下长期服役的,如发动机、锅炉设备等,它们对材料的高温力学性能提出了很高的要求。高温力学性能是指高温下物料因抵抗外力作用而产生各种变形和应力的能力。正确地评价材料、合理地使用材料、研究新的耐高温材料,为上述工业发展和......
  • 【C++】C++11引入的新特性(1)
    生命有多长,不悲不喜。青春多荒凉,不骄不躁。假如生命止于明天,那么我们能必须珍惜今天。......
  • 新手必看:IntelliJ IDEA 2024 安装激活教程
    第一步前往idea的官网,下载新版的idea下载完成后,进行安装,next,安装完成首次打开,会要求输入激活码才能使用(博主使用的是2014.1.5版本)第二步点击获取补丁文件(含2014.1.5版本exe)保存下载之后进入文件夹***/JetBrains2023最新全家桶激活***找到文件/方式3:永久激活补丁......