spring学习(27):通过setter依赖注入

目录结构

pox.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>com.geyao</groupId><artifactId>spring01geyao</artifactId><version>1.0-SNAPSHOT</version><dependencies><dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>4.3.13.RELEASE</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-test</artifactId><version>3.2.0.RELEASE</version></dependency><dependency><groupId>log4j</groupId><artifactId>log4j</artifactId><version>1.2.17</version></dependency><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.12</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-test</artifactId><version>4.3.4.RELEASE</version><scope>test</scope></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-test</artifactId><version>4.3.4.RELEASE</version><scope>test</scope></dependency></dependencies>
</project>

log4j.propreties

### 设置###
log4j.rootLogger = ERROR,stdout### 输出信息到控制抬 ###
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n
log4j.category.org.springframework.beans.factory=DEBUG

Appconfig类

package com.geyao.demo.config;import com.geyao.demo.Service.impl.UserServiceNormal;
import com.geyao.demo.dao.UserDao;
import com.geyao.demo.dao.impl.UserDaoNormal;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;@Configurationpublic class Appconfig {@Beanpublic UserDao userDaoNormal(){System.out.println("创建UserDao对象");return  new UserDaoNormal();}@Beanpublic UserServiceNormal userServiceNormal(UserDao userDao){System.out.println("创建userservice对象");UserServiceNormal userService=new UserServiceNormal();userService.setUserDao(userDao);return  userService;}
}

userservice类

package com.geyao.demo.dao.impl;import com.geyao.demo.dao.UserDao;
import org.springframework.stereotype.Repository;public class UserDaoNormal implements UserDao {public void add(){System.out.println("添加到数据库中...");}
}

Userdao

package com.geyao.demo.dao;public interface UserDao {void add();
}

UserServiceNormal类

package com.geyao.demo.Service.impl;import com.geyao.demo.Service.UserService;
import com.geyao.demo.dao.UserDao;
import org.springframework.stereotype.Service;public class UserServiceNormal implements UserService {private UserDao userDao;public UserServiceNormal() {super();}public UserServiceNormal(UserDao userDao){this.userDao=userDao;}public void setUserDao(UserDao userDao) {this.userDao = userDao;}public void add(){userDao.add();}
}

UserService类

package com.geyao.demo.Service;public interface UserService {void add();
}

UserServiceTest类

package com.geyao.demo.service;import com.geyao.demo.Service.UserService;
import com.geyao.demo.config.Appconfig;
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;@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = Appconfig.class)
public class UserServiceTest {@Autowiredprivate UserService userService;@Testpublic void testAdd(){userService.add();}
}

运行结果

[DEBUG] 2019-11-01 22:25:32,893 method:org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
[DEBUG] 2019-11-01 22:25:32,898 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:449)
Creating instance of bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
[DEBUG] 2019-11-01 22:25:32,927 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
Eagerly caching bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor' to allow for resolving potential circular references
[DEBUG] 2019-11-01 22:25:32,931 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:485)
Finished creating instance of bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (file:/C:/Users/geyao/.m2/repository/org/springframework/spring-core/4.3.13.RELEASE/spring-core-4.3.13.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[DEBUG] 2019-11-01 22:25:33,125 method:org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
Creating shared instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'
[DEBUG] 2019-11-01 22:25:33,125 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:449)
Creating instance of bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'
[DEBUG] 2019-11-01 22:25:33,127 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
Eagerly caching bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor' to allow for resolving potential circular references
[DEBUG] 2019-11-01 22:25:33,157 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:485)
Finished creating instance of bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'
[DEBUG] 2019-11-01 22:25:33,158 method:org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
Creating shared instance of singleton bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'
[DEBUG] 2019-11-01 22:25:33,158 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:449)
Creating instance of bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'
[DEBUG] 2019-11-01 22:25:33,159 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
Eagerly caching bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor' to allow for resolving potential circular references
[DEBUG] 2019-11-01 22:25:33,167 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:485)
Finished creating instance of bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'
[DEBUG] 2019-11-01 22:25:33,176 method:org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:730)
Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@43195e57: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.event.internalEventListenerProcessor,org.springframework.context.event.internalEventListenerFactory,appconfig,userDaoNormal,userServiceNormal]; root of factory hierarchy
[DEBUG] 2019-11-01 22:25:33,177 method:org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251)
Returning cached instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
[DEBUG] 2019-11-01 22:25:33,177 method:org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251)
Returning cached instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'
[DEBUG] 2019-11-01 22:25:33,177 method:org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251)
Returning cached instance of singleton bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor'
[DEBUG] 2019-11-01 22:25:33,179 method:org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerProcessor'
[DEBUG] 2019-11-01 22:25:33,180 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:449)
Creating instance of bean 'org.springframework.context.event.internalEventListenerProcessor'
[DEBUG] 2019-11-01 22:25:33,184 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
Eagerly caching bean 'org.springframework.context.event.internalEventListenerProcessor' to allow for resolving potential circular references
[DEBUG] 2019-11-01 22:25:33,189 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:485)
Finished creating instance of bean 'org.springframework.context.event.internalEventListenerProcessor'
[DEBUG] 2019-11-01 22:25:33,190 method:org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerFactory'
[DEBUG] 2019-11-01 22:25:33,190 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:449)
Creating instance of bean 'org.springframework.context.event.internalEventListenerFactory'
[DEBUG] 2019-11-01 22:25:33,191 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
Eagerly caching bean 'org.springframework.context.event.internalEventListenerFactory' to allow for resolving potential circular references
[DEBUG] 2019-11-01 22:25:33,196 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:485)
Finished creating instance of bean 'org.springframework.context.event.internalEventListenerFactory'
[DEBUG] 2019-11-01 22:25:33,196 method:org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
Creating shared instance of singleton bean 'appconfig'
[DEBUG] 2019-11-01 22:25:33,197 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:449)
Creating instance of bean 'appconfig'
[DEBUG] 2019-11-01 22:25:33,198 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
Eagerly caching bean 'appconfig' to allow for resolving potential circular references
[DEBUG] 2019-11-01 22:25:33,204 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:485)
Finished creating instance of bean 'appconfig'
[DEBUG] 2019-11-01 22:25:33,204 method:org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
Creating shared instance of singleton bean 'userDaoNormal'
[DEBUG] 2019-11-01 22:25:33,204 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:449)
Creating instance of bean 'userDaoNormal'
[DEBUG] 2019-11-01 22:25:33,207 method:org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251)
Returning cached instance of singleton bean 'appconfig'
创建UserDao对象
[DEBUG] 2019-11-01 22:25:33,247 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
Eagerly caching bean 'userDaoNormal' to allow for resolving potential circular references
[DEBUG] 2019-11-01 22:25:33,251 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:485)
Finished creating instance of bean 'userDaoNormal'
[DEBUG] 2019-11-01 22:25:33,251 method:org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
Creating shared instance of singleton bean 'userServiceNormal'
[DEBUG] 2019-11-01 22:25:33,252 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:449)
Creating instance of bean 'userServiceNormal'
[DEBUG] 2019-11-01 22:25:33,252 method:org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251)
Returning cached instance of singleton bean 'appconfig'
创建userservice对象
[DEBUG] 2019-11-01 22:25:33,254 method:org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251)
Returning cached instance of singleton bean 'userDaoNormal'
[DEBUG] 2019-11-01 22:25:33,256 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
Eagerly caching bean 'userServiceNormal' to allow for resolving potential circular references
[DEBUG] 2019-11-01 22:25:33,259 method:org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:485)
Finished creating instance of bean 'userServiceNormal'
[DEBUG] 2019-11-01 22:25:33,260 method:org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251)
Returning cached instance of singleton bean 'org.springframework.context.event.internalEventListenerFactory'
[DEBUG] 2019-11-01 22:25:33,316 method:org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251)
Returning cached instance of singleton bean 'lifecycleProcessor'
[DEBUG] 2019-11-01 22:25:33,325 method:org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:86)
Processing injected element of bean 'com.geyao.demo.service.UserServiceTest': AutowiredFieldElement for private com.geyao.demo.Service.UserService com.geyao.demo.service.UserServiceTest.userService
[DEBUG] 2019-11-01 22:25:33,330 method:org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251)
Returning cached instance of singleton bean 'userServiceNormal'
[DEBUG] 2019-11-01 22:25:33,331 method:org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.registerDependentBeans(AutowiredAnnotationBeanPostProcessor.java:535)
Autowiring by type from bean name 'com.geyao.demo.service.UserServiceTest' to bean named 'userServiceNormal'
添加到数据库中...
[DEBUG] 2019-11-01 22:25:33,340 method:org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251)
Returning cached instance of singleton bean 'lifecycleProcessor'
[DEBUG] 2019-11-01 22:25:33,341 method:org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:512)
Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@43195e57: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.event.internalEventListenerProcessor,org.springframework.context.event.internalEventListenerFactory,appconfig,userDaoNormal,userServiceNormal]; root of factory hierarchy

 

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

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

相关文章

[密码学基础][每个信息安全博士生应该知道的52件事][Bristol52]50.什么是BLS基于对的签名方案?

这是一系列博客文章中最新的一篇&#xff0c;该文章列举了“每个博士生在做密码学时应该知道的52件事”:一系列问题的汇编是为了让博士生们在第一年结束时知道些什么。 转载链接&#xff1a;https://www.cnblogs.com/zhuowangy2k/p/12248721.html

EF(Entity FrameWork)实体框架

一、 1、简称&#xff1a;实体框架 2、ADO.NET Entity FrameWork 是微软以ADO.NET为基础发展出来的对象关系对应&#xff08;O/R Mapping&#xff09;解决方案&#xff1b; 3、ORM框&#xff1a;对象关系映射&#xff08;Object-Relational Mapping&#xff09;&#xff0c;是一…

深度学习04-RNN

文章目录1 为什么需要RNN1.1RNN的应用场景1.2 DNN和CNN不能解决的问题2 RNN的网络结构2.1 RNN基础结构2.2 不同类型的RNN3 RNN的优化算法BPTT4 LSTM5 GRU1 为什么需要RNN 1.1RNN的应用场景 1 模仿论文&#xff08;生成序列&#xff09;。输入是一堆的论文文章&#xff0c;输出…

spring学习(28):处理自动装配的歧义性

pox.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 …

[密码学基础][每个信息安全博士生应该知道的52件事][Bristol52]51.基于ID的加密安全模型,描述IBE方案

这是一系列博客文章中最新的一篇&#xff0c;该文章列举了“每个博士生在做密码学时应该知道的52件事”:一系列问题的汇编是为了让博士生们在第一年结束时知道些什么。 在公钥密码学中&#xff0c;如果Alice想要给Bob发送一条消息&#xff0c;她需要Bob的公钥&#xff0c;一般来…

shell 脚本实现退点输出

1、elasticsearch启动脚本 1 #!/bin/bash2 export JAVA_HOME/usr/java/jdk1.8.0_201-amd643 export JAVA_BIN/usr/java/jdk1.8.0_201-amd64/bin4 export PATH$JAVA_BIN:$PATH5 export CLASSPATH.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar6 export JAVA_HOME JAVA_BIN P…

spring学习(29):xml配置规范

目录结构 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/P…

[dp] LeetCode 91. Decode Ways

输入&#xff1a;一个字符串&#xff0c;只包含0-9的字符。 输出&#xff1a;解码种类 规则&#xff1a;有一种信息映射规则 A->1,B->2…Z->26。 例如输入’1’&#xff0c;只能解码为A。 输入’12’&#xff0c;可以解码为’AB’&#xff0c;也可以是’L’&#xff0…

leetcode——背包问题汇总

本章来汇总一下leetcode中做过的背包问题&#xff0c;包括0-1背包和完全背包。 背包问题的通常形式为&#xff1a;有N件物品和一个最多能背重量为W 的背包。第i件物品的重量是weight[i]&#xff0c;得到的价值是value[i] 。求解将哪些物品装入背包里物品价值总和最大。0-1背包和…

[密码学基础][每个信息安全博士生应该知道的52件事]52.先进的应用概念 系统的大致安全需求

这是一系列博客文章中最新的一篇&#xff0c;该文章列举了“每个博士生在做密码学时应该知道的52件事”:一系列问题的汇编是为了让博士生们在第一年结束时知道些什么。我们希望学生知道从理论到实践的各个方面。但关键是你需要在密码学中考虑的不仅是对遵守规则的玩家的安全&am…

spring学习(32):使用junit4测试

目录结构 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/P…

[dp]Leetcode 5. Longest Palindromic Substring

输入&#xff1a;一个字符串s 输出&#xff1a;最长的回文子串 规则&#xff1a;“abba"是一个回文 分析&#xff1a;输入是"babad”&#xff0c;输出"bab"。这个问题不能再按照之前分段的思路解决&#xff0c;或者说完全按照之前的思路。 之前的思路是&a…

[密码学基础][每个信息安全博士生应该知道的52件事][Bristol52]38.隐蔽信道和侧信道的区别

这是一系列博客文章中最新的一篇&#xff0c;该文章列举了“每个博士生在做密码学时应该知道的52件事”:一系列问题的汇编是为了让博士生们在第一年结束时知道些什么。 隐蔽信道和侧信道是两种不同的信息泄露信道 隐蔽信道使用目的不是通信的机制。例如&#xff0c;写和检查文…

NFA和DFA的区别

NFADFA初始状态不唯一唯一弧上的标记字(单字符字/ε)字符(串)转换关系非确定确定对于每个NFA M都存在一个DFA M 使得 L(M) L(M) 转载于:https://www.cnblogs.com/masterchd/p/11061281.html

spring学习(33):id和name

目录结构 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/P…

线性回归与 logistic回归

线性回归 算法方程&#xff1a;hθ(x)∑i0nθixiθTxh_{\theta}(x)\sum_{i0}^{n} \theta_{i} x_{i}\theta^{T} xhθ​(x)∑i0n​θi​xi​θTx 损失函数&#xff1a;J(θ0,θ1,…,θn)12m∑i1m(hθ(x(i))−y(i))2J\left(\theta_{0}, \theta_{1}, \ldots, \theta_{n}\right)\f…

[高效时间管理] 番茄工作钟 windows版本

【背景】 2019年本人学会了记录每日时间&#xff08;将每日分割成半小时一段的时间&#xff09; &#xff0c;但似乎是为了完成而完成&#xff0c;效果不佳&#xff0c;手机端的番茄钟总是诱惑太多&#xff0c;就在准备tb计时器的时候&#xff0c;发现了宝藏软件。 个人整理知…

IDEA设置取消自动显示参数提示

IDEA设置取消自动显示参数提示 最近在使用IDEA的过程中&#xff0c;发现方法中一直显示形参名的提示&#xff0c;无法选中&#xff0c;也无法删除&#xff0c;基于不同人的使用习惯不同&#xff0c;有的人不喜欢这种提示&#xff0c;我也在网上寻找各种解决方案&#xff0c;由于…

spring学习(34):构造函数依赖注入

目录结构 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/P…

[高效时间管理]复盘篇

【背景】 2019年本人在公众号中阅读了《时间管理&#xff0c;这篇就够了》&#xff0c;学习了其中的内容并开始记录每日所做&#xff0c;偶尔晚上进行复盘&#xff0c;对督促学习和反思起到一定的作用&#xff0c;故向大家分享经验。 为什么要时间管理&#xff1f; 时间管理…