1.maven-ssm:

  maven-ssm_diy:

  

  

    pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cn.zzsxt</groupId>
<artifactId>maven-ssm_diy</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging> <build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources> <plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<!-- tomcat7插件 -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<port>8080</port>
<path>/crud</path>
</configuration>
</plugin>
</plugins> </build>
<!-- 聚合子模块,添加子模块时自动添加 -->
<modules>
<module>maven-ssm-dao</module>
<module>maven-ssm-service</module>
<module>maven-ssm-web</module>
</modules>
<properties>
<!-- 版本声明 -->
<spring.version>4.3.9.RELEASE</spring.version>
<aspectj.version>1.8.9</aspectj.version>
<mybatis.version>3.4.1</mybatis.version>
<mybatis-spring.version>1.3.0</mybatis-spring.version>
<c3p0.version>0.9.5.2</c3p0.version>
<mysql.version>5.1.38</mysql.version>
<log4j.version>1.2.17</log4j.version>
<slf4j.version>1.7.25</slf4j.version>
<slf4j-log4j12.version>1.7.21</slf4j-log4j12.version>
<javaee-version>7.0</javaee-version>
<servlet-version>3.1.0</servlet-version>
<jsp-version>2.2</jsp-version>
<jstl-version>1.2</jstl-version>
</properties>
<dependencyManagement>
<dependencies>
<!-- javaee7 -->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>${javaee-version}</version>
<scope>provided</scope>
</dependency>
<!-- servlet api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${servlet-version}</version>
<scope>provided</scope>
</dependency>
<!-- jsp api -->
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>${jsp-version}</version>
<scope>provided</scope>
</dependency>
<!-- jstl -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>${jstl-version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<!-- jar文件依赖 -->
<!-- spring -->
<dependencies>
<!-- spring-context依赖spring-core,spring-beans,spring-aop,commons-logging,spring-expression,spring-context -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- spring-test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<!-- spring-webmvc依赖spring-web -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- spring-jdbc,spring-tx -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- spring-context-support -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- spring-orm,spring-core,spring-beans,common-logging,spring-jdbc,spring-tx -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- spring-aspects,aspectjweaver -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj.version}</version>
</dependency>
<!-- mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>${mybatis.version}</version>
</dependency>
<!-- mybatis-spring -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>${mybatis-spring.version}</version>
</dependency>
<!-- c3p0 -->
<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>${c3p0.version}</version>
</dependency>
<!-- mysql -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<!-- log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<!-- slf4j -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j-log4j12.version}</version>
<scope>test</scope>
</dependency>
<!-- junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

   maven-ssm-dao:

 

    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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.zzsxt</groupId>
<artifactId>maven-ssm_diy</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>maven-ssm-dao</artifactId>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

    applicationContext-dao.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:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd"> <!-- 扫描注解包 -->
<context:component-scan base-package="cn.zzsxt.ssm"></context:component-scan> <!-- 数据源 -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="com.mysql.jdbc.Driver"></property>
<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/test"></property>
<property name="user" value="root"></property>
<property name="password" value="root"></property>
</bean> <!-- 配置SqlSessionFactory,并注入数据源 -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<!-- 加载cn/zzsxt/ssm/mapper/所有以 Mapper.xml结尾的映射文件 -->
<property name="mapperLocations" value="classpath:cn/zzsxt/ssm/mapper/*Mapper.xml"></property>
</bean> <!-- 配置MapperScannerConfigurer,用于扫描指定包下的Mapper接口,生成代理对象的id为Mapper接口名第一个字母小写 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
<property name="basePackage" value="cn.zzsxt.ssm.mapper"></property>
</bean>
</beans>

    log4j.properties:   

log4j.rootLogger=DEBUG, Console

log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%-5p - %m%n
log4j.logger.org.mybatis.spring=ERROR
log4j.logger.org.apache.ibatis.logging.LogFactory=ERROR
log4j.logger.com.alibaba.druid.pool.DruidDataSource=ERROR

    UserinfoMapper.java:

package cn.zzsxt.ssm.mapper;

import java.util.List;

import cn.zzsxt.ssm.model.Userinfo;

public interface UserinfoMapper {
List<Userinfo> findAll();
int addUserinfo(Userinfo userinfo);
int delete(int userId);
int update(int userId);
Userinfo findById(int userId);
}

    UserinfoMapper.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="cn.zzsxt.ssm.mapper.UserinfoMapper">
<select id="findAll" resultType="cn.zzsxt.ssm.model.Userinfo">
select * from userinfo
</select>
<insert id="addUserinfo" parameterType="cn.zzsxt.ssm.model.Userinfo">
insert into userinfo(userName,userPass,userType)values(#{userName},#{userPass},#{userType})
</insert>
</mapper>

    Userinfo.java:

package cn.zzsxt.ssm.model;

public class Userinfo {
private int userId;
private String userName;
private String userPass;
private int userType;
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserPass() {
return userPass;
}
public void setUserPass(String userPass) {
this.userPass = userPass;
}
public int getUserType() {
return userType;
}
public void setUserType(int userType) {
this.userType = userType;
}
@Override
public String toString() {
return "Userinfo [userId=" + userId + ", userName=" + userName + ", userPass=" + userPass + ", userType="
+ userType + "]";
}
}

    Test1.java: 

package cn.zzsxt.ssm.test;

import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import cn.zzsxt.ssm.mapper.UserinfoMapper;
import cn.zzsxt.ssm.model.Userinfo; @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath:applicationContext-dao.xml"})
public class Test1 {
@Autowired
private UserinfoMapper userinfoMapper;
@Test
public void test1(){
List<Userinfo> l=userinfoMapper.findAll();
for (Userinfo u : l) {
System.out.println(u);
}
}
}

  maven-ssm-service:

    

    applicationContext-service.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:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd"> <context:component-scan base-package="cn.zzsxt.ssm"></context:component-scan> <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="add*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="delete*" propagation="REQUIRED"/>
<tx:method name="*" propagation="SUPPORTS"/>
</tx:attributes>
</tx:advice> <aop:config>
<aop:pointcut expression="execution(* cn.zzsxt.ssm.service.*.*(..))" id="serviceMethods"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="serviceMethods"/>
</aop:config>
</beans>

    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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.zzsxt</groupId>
<artifactId>maven-ssm_diy</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>maven-ssm-service</artifactId>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>cn.zzsxt</groupId>
<artifactId>maven-ssm-dao</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

    UserinfoServiceImpl.java:

package cn.zzsxt.ssm.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import cn.zzsxt.ssm.mapper.UserinfoMapper;
import cn.zzsxt.ssm.model.Userinfo;
import cn.zzsxt.ssm.service.UserinfoService;
@Service
public class UserinfoServiceImpl implements UserinfoService {
@Autowired
private UserinfoMapper userinfoMapper;
@Override
public List<Userinfo> findAll() {
// TODO Auto-generated method stub
return userinfoMapper.findAll();
}
@Override
public int addUserinfo(Userinfo userinfo) {
// TODO Auto-generated method stub
return userinfoMapper.addUserinfo(userinfo);
} }

    UserinfoService.java:

package cn.zzsxt.ssm.service;

import java.util.List;

import cn.zzsxt.ssm.model.Userinfo;

public interface UserinfoService {
List<Userinfo> findAll();
int addUserinfo(Userinfo userinfo);
}

    Test1.java:

package cn.zzsxt.ssm.test;

import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import cn.zzsxt.ssm.model.Userinfo;
import cn.zzsxt.ssm.service.UserinfoService; @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath:applicationContext-dao.xml","classpath:applicationContext-service.xml"})
public class Test1 {
@Autowired
private UserinfoService userinfoService;
@Test
public void findAll(){
List<Userinfo> list = userinfoService.findAll();
for (Userinfo userinfo : list) {
System.out.println(userinfo);
}
}
}

  maven-ssm-web:(无骨架创建,war)

    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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.zzsxt</groupId>
<artifactId>maven-ssm_diy</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>maven-ssm-web</artifactId>
<packaging>war</packaging> <build/> <dependencies>
<dependency>
<groupId>cn.zzsxt</groupId>
<artifactId>maven-ssm-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency> <!-- javaee7 -->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- servlet api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- jsp api -->
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- jstl -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
</dependencies> </project>

    UserinfoController.java:

package cn.zzsxt.ssm.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping; import cn.zzsxt.ssm.model.Userinfo;
import cn.zzsxt.ssm.service.UserinfoService; @Controller
@RequestMapping("/user")
public class UserinfoController {
@Autowired
private UserinfoService userinfoService; @RequestMapping("/list")
public String list(Model model){
List<Userinfo> list = userinfoService.findAll();
model.addAttribute("list", list);
return "list";
}
@RequestMapping("/add")
public String add(Userinfo userinfo){
userinfoService.addUserinfo(userinfo); return "redirect:/user/list"; }
}

    springmvc.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:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd"> <context:component-scan base-package="cn.zzsxt.ssm"></context:component-scan> <mvc:annotation-driven></mvc:annotation-driven> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"></property>
<property name="prefix" value="/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
</beans>

    web.xml:   

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1"> <display-name>ssmDemo</display-name> <!-- 配置ContextLoaderListener -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext-*.xml</param-value>
</context-param> <!-- 前端控制器 -->
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:springmvc.xml</param-value>
</init-param>
</servlet> <servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>

  

  

java:maven(maven-ssm(聚合,分包开发))的更多相关文章

  1. 使用maven搭建ssm框架的javaweb项目

    目前主流的javaweb项目,常会用到ssm(Spring+Spring MVC+Mybatis)框架来搭建项目的主体框架,本篇介绍搭建SSM框架的maven项目的实施流程.记之共享! 一.SSM框架 ...

  2. 使用maven搭建SSM框架

    使用maven搭建SSM框架,首先得准备好maven环境. 搭建maven环境 第一步:下载maven http://maven.apache.org/download.cgi 下载后解压就可以了. ...

  3. eclipse创建maven的ssm项目

    自己接触ssm框架有一段时间了,从最早的接触新版ITOO项目的(SSM/H+Dobbu zk),再到自己近期来学习到的<淘淘商城>一个ssm框架的电商项目.用过,但是还真的没有自己搭建过, ...

  4. 用Maven整合SSM框架

    前述 Maven 是专门用于构建和管理Java相关项目的工具,利用 Maven 的主要目的是统一维护 jar 包.关于 Maven 的安装在这篇里面就不说了. SSM(Spring+SpringMVC ...

  5. 普通项目——>maven项目——>SSM(一)

    首先应该明白,SSM是什么? SSM指的是Spring+SpringMVC+MyBatis Spring Spring就像是整个项目中装配bean的大工厂,在配置文件中可以指定使用特定的参数去调用实体 ...

  6. maven实战(01)_搭建开发环境

    一 下载maven 在maven官网上可下载maven:http://maven.apache.org/download.cgi 下载好后,解压.我的解压到了:D:\maven\apache-mave ...

  7. Maven项目搭建(二):Maven搭建SSM框架

    上一章给大家讲解了如何使用Maven搭建web项目. 这次给大家介绍一下怎么使用Maven搭建SSM框架项目. 首先我们来看一下pom.xml的属性介绍: project: pom的xml根元素. p ...

  8. 【原】无脑操作:eclipse + maven搭建SSM框架

    网上看到一些Spring + Spring MVC + MyBatis框架的搭建教程,不是很详细或是时间久远了,自己动手整一个简单无脑的! 0.系统环境 1)Windows 10 企业版 2)JDK ...

  9. 基于maven的ssm框架整合

    基于maven的ssm框架整合 第一步:通过maven建立一个web项目.                第二步:pom文件导入jar包                              (1 ...

  10. JAVA基础-----Maven项目的搭建

    Maven项目的搭建 一.前言 maven官网:http://maven.apache.org/, 文章简介:本文章从三个模块来了解Maven,分别是 Maven的基本概念~, Maven项目的安装和 ...

随机推荐

  1. SQL truncate 、delete与drop区别(转)

    相同点: 1.truncate和不带where子句的delete.以及drop都会删除表内的数据. 2.drop.truncate都是DDL语句(数据定义语言),执行后会自动提交. 不同点: 1. t ...

  2. Linux下的启动oracle服务 启动监听 开放端口操作

    尝试登录oracle 使用root用户将没有sqlplus命令 [root@localhost ~]# sqlplus /nolog bash: sqlplus: 未找到命令...     [root ...

  3. mysql之InnoDb引擎与MyISAM引擎对比

    InnoDb引擎 支持ACID的事务,支持事务的四种隔离级别: 支持行级锁及外键约束:因此可以支持写并发: 不存储总行数: 一个InnoDb引擎存储在一个文件空间(共享表空间,表大小不受操作系统控制, ...

  4. BZOJ1013 [JSOI2008]球形空间产生器sphere[高消]

    数论进度开的好慢啊.我整天做的都是什么鬼题啊. 简单的高消题,用一个式子把另外$n$个有二次项和距离的式子全消掉就行了. #include<iostream> #include<cs ...

  5. 【BZOJ1176】Mokia

    题目大意:给定一个 N*N 的矩形,有 Q 次操作,每个操作可以是矩形单点修改或查询子矩形的权值和. 题解:CDQ分治适合处理修改操作之间互不影响且支持离线的题目. 满足以上操作条件的显然可以树套树来 ...

  6. django-视图层与模板层

    1.视图层 小白必会三板斧 1.HttpResponse return HttpResponse(‘字符串’) 2.render return render(request,‘HTML页面’ ,{‘n ...

  7. sql语言积累

    Persons 表: Id LastName FirstName Address City 1 Adams John Oxford Street London 2 Bush George Fifth ...

  8. qt5-信号和槽

    信号函数: connect(btn,&QPushButton::clicked,this,&QWidget::close); //参数1 信号发送者://参数2 信号:---& ...

  9. Matlab的基本矩阵运算

    (1)加减.数乘 >> a=[1,2;3,4];b=[5,6;7,8]; >> a+b ans = 6 8 10 12 >> a.*2 ans = 2 4 6 8 ...

  10. STM32使用HAL库,使用延时卡死的问题。

    之前一直使用标准库的,现在转到HAL库来后,编写了第一个程序就遇到了问题.发现我使用库里的延时程序HAL_Delay()时,会卡死在里面. 根据程序,进入到这个延时程序后 ,发现HAL_GetTick ...