- 博客(63)
- 资源 (2)
- 收藏
- 关注
原创 怎么避免下载流氓软件,误下载后怎么处理
经历复盘:2022.1.20时,为了下载SPSS时不小心下载了流氓软件。回过头来复盘一下,一个是因为当时不小心点击了电信高速下载,下载了一个P2P软件。点击安装的时候就感觉不太对劲,但那时候已经来不及了处理方式:1.先用SoftCntKiller进行文件查杀查杀2.用360安全卫士进行全盘扫描3.再用360安全卫士的急救箱2021.1.21 9:53,貌似删除干净了,再看看这几天电脑的状态吧怎么避免下载流氓软件:想要下载到自己想要的,需要擦亮自己的眼睛,不去点那些附近用小字写了“这是广告
2022-01-21 10:22:00
1366
原创 IDEA中打开.properties文件乱码
问题:IDEA中打开.properties文件乱码解决方法:一、代开settings设置二、搜索File Encodings三、在Properties Files中选择编码格式为UTF-8,注意一定要打上后面的√
2021-11-24 08:16:52
686
原创 4.1.2 ProxyBean的实现
代理,可控制或增加对目标对象的访问ProxyBean代码:package com.springboot.chapter4.proxy;import com.springboot.chapter4.intercept.Interceptor;import com.springboot.chapter4.invoke.Invocation;import java.lang.reflect.InvocationHandler;import java.lang.reflect.Method;i.
2021-11-20 11:35:05
337
原创 【无标题】
简单接口HelloServicepublic interface HelloService { public void sayHello(String name);}实现类HelloServiceImplpublic class HelloServiceImpl implements HelloService { @Override public void sayHello(String name) { if (name == null || name.tr
2021-11-20 11:16:52
236
原创 第2章概述
示例代码:<!DOCTYPE html><html> <head> <meta charset="utf-8"> <title>Vue 实例</title> </head> <body> <div id="app"> <input type="text" v-model="name" placeholder="你的名字"> &
2021-11-19 14:30:55
619
原创 3.9 引入XML配置Bean
注解@ImportResource:可以引入对应的XML文件,用以加载Bean。有时候有些框架(如Dubbo,Cat)是基于Spring的XML方式进行开发的,这个时候需要引入XML的方式来实现配置。新建POJO对象import com.springboot.chapter3.pojo.definition.Animal;/** * @author nmj * @create 2021-11-19 11:16 */public class Squirrel implements Animal
2021-11-19 11:43:40
501
原创 3.8 使用@Profile
在企业开发的过程中,项目往往要面临开发环境、测试环境、准生产环境和生产环境的切换,每一套的上下文是不一样的,它们有各自的数据库资源Profile机制:实现各个环境之间的切换。假设存在dev_spring_boot和test_spring_boot两个数据库,这样可以使用注解**@Profile**定义两个Bean:@Bean(name = "dataSource", destroyMethod = "close")@Profile("dev")public DataSource getDevDat
2021-11-19 11:12:41
706
原创 3.7 Bean的作用域
isSingleton方法如果返回true,则Bean在IoC容器中以单例存在,这也是Spring IoC容器的默认值;如果isPrototype方法返回true,则当我们每次获取Bean的时候,IoC容器都会创建一个新的Bean在一般的容器中,Bean都会存在单例(Singleton)和原型(Prototype)两种作用域在Web容器中,则存在页(page)、请求(request)、会话(session)和应用(application)4种作用域。对于页面(page),是针对JSP当前页面的作用域,
2021-11-19 10:36:31
150
原创 3.6 条件装配Bean
Bean初始化前,对某些属性进行校验,满足校验才去装配数据源为了处理这样的场景,需要用到**@Conditional注解,同时需要配合另外一个接口Condition**(org.springframework.context.annotation.Condition)使用属性初始化数据库连接池:加入了@Conditional注解,并且配置了类DatabaseConditional@Bean(name = "dataSource", destroyMethod = "close")@Condition
2021-11-19 09:38:47
302
原创 3.5 使用属性文件
可以采用默认为我们配置的application.properties,也可以使用自定义的配置文件引入属性文件依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-configuration-processor</artifactId> <optional>true</optional>
2021-11-19 09:15:36
647
原创 3.2.1 通过扫描装配你的Bean
对于扫描装配而言使用的注解是**@Component和@ComponentScan**。@Component是标明哪个类被扫描进入IoC容器,而@ComponentScan则是标明采用何种策略去扫描装配Bean修改user类,加入@Component注解@Component("user")public class User { @Value("1") private Long id; @Value("user_name_1") private String u
2021-11-17 10:44:51
557
原创 3.1 IoC容器简介
所有的IoC容器都需要实现接口BeanFactory,这是一个顶级的容器接口BeanFactory接口源码://// Source code recreated from a .class file by IntelliJ IDEA// (powered by Fernflower decompiler)//package org.springframework.beans.factory;import org.springframework.beans.BeansException;i
2021-11-17 10:10:09
262
原创 2.4 开发自己的Spring Boot项目
Spring MVC的视图解析器的作用主要就是定位视图的,也就是当控制器只是返回一个逻辑名称的时候,是没有办法直接找到对应视图的,这就需要视图解析器来解析了在Maven的pom.xml中加入JSP和JSTL的依赖包<dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-jasper</artifactId> <
2021-11-17 08:47:25
587
原创 java.sql.SQLNonTransientConnectionException: Could not create connection to database server
**使用JdbcTemplate连接数据库时发生错误:**java.sql.SQLNonTransientConnectionException: Could not create connection to????报错有这么长????????一脸懵逼之一脸懵逼????诶,两血健康,一血不慌,咋一个一个报错的看报错中很明显地提示,是数据库连接的问题网上能找到的可能导致数据库连接错误的原因:1.数据库链接地址、账户、密码错误2.MySQL服务运行不正常3.数据库版本和MySQL驱动版本不一致
2021-10-09 16:43:00
13519
1
原创 力扣杯 LCP 45. 自行车炫技赛场(DFS回溯)
题目链接:https://leetcode-cn.com/problems/kplEvH/写了近一个小时,仍有部分测试点没有通过,采用的思路是DFS+回溯class Solution {public: vector<vector<int>> ans; set<vector<int>> vii; vector<vector<int>> terrainQ; vector<vector<in
2021-09-25 19:25:14
170
原创 Jupyter Notebook上使用tensorflow的血泪教训
本文所涉及的环境为CUDA Version 10.1.105,tensorflow_gpu2.3.0,python3.6,本文不涉及任何配置环境的细节,仅分享在Jupyter Notebook上使用tensorflow的心得**一、**导入库文件失败这时候有以下几种可能:1.该库文件是项目作者自定义的库文件,你没有将其传入自己的项目文件夹中(Jupyter Notebook中上传整个文件夹的方法:将要上传的文件夹复制到桌面,再在Jupyter Notebook中将其move到项目文件夹中)2.该库文
2021-07-25 21:31:29
735
原创 03-树2 List Leaves (25 分)
03-树2 List Leaves (25 分)Given a tree, you are supposed to list all the leaves in the order of top down, and left to right.Input Specification:Each input file contains one test case. For each case, the first line gives a positive integer N (≤10) which is
2021-04-04 22:53:10
111
原创 02-线性结构2 一元多项式的乘法与加法运算 (20 分)
02-线性结构2 一元多项式的乘法与加法运算 (20 分)设计函数分别求两个一元多项式的乘积与和。输入格式:输入分2行,每行分别先给出多项式非零项的个数,再以指数递降方式输入一个多项式非零项系数和指数(绝对值均为不超过1000的整数)。数字间以空格分隔。输出格式:输出分2行,分别以指数递降方式输出乘积多项式以及和多项式非零项的系数和指数。数字间以空格分隔,但结尾不能有多余空格。零多项式应输出0 0。输入样例:4 3 4 -5 2 6 1 -2 03 5 20 -7 4 3 1输出样
2021-03-31 09:12:20
114
原创 02-线性结构3 Reversing Linked List (25 分)
02-线性结构3 Reversing Linked List (25 分)Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6, if K=3, then you must output 3→2→1→6→5→4; if K=4, you must output 4
2021-03-26 08:06:54
76
原创 1102 Invert a Binary Tree (25 分)
1102 Invert a Binary Tree (25 分)The following is from Max Howell @twitter:Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so fuck off.Now it’s your turn to prove that YOU CAN invert
2021-03-06 16:32:14
69
原创 1090 Highest Price in Supply Chain (25 分)
1090 Highest Price in Supply Chain (25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on the chain buys pr
2021-03-06 15:09:08
105
原创 1053 Path of Equal Weight (30 分)
1053 Path of Equal Weight (30 分)Given a non-empty tree with root R, and with weight Wi assigned to each tree node Ti . The weight of a path from R to L is defined to be the sum of the weights of all the nodes along the path from R to any leaf node
2021-03-06 10:45:11
83
原创 1061 Dating (20 分)
1061 Dating (20 分)Sherlock Holmes received a note with some strange strings: Let’s date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm. It took him only a minute to figure out that those strange strings are actually referring to the coded
2021-03-04 20:51:17
143
1
原创 1035 Password (20 分)
1035 Password (20 分)To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distinguish 1 (one) from l (L in lowercase), or 0 (zero) from O (
2021-03-04 20:12:41
147
1
原创 1153 Decode Registration Card of PAT (25 分)
1153 Decode Registration Card of PAT (25 分)A registration card number of PAT consists of 4 parts:the 1st letter represents the test level, namely, T for the top level, A for advance and B for basic;the 2nd - 4th digits are the test site number, ranged f
2021-03-04 15:24:39
132
1
原创 1125 Chain the Ropes (25 分)
1125 Chain the Ropes (25 分)Given some segments of rope, you are supposed to chain them into one rope. Each time you may only fold two segments into loops and chain them into one piece, as shown by the figure. The resulting chain will be treated as another
2021-03-04 11:53:25
141
2
原创 1113 Integer Set Partition (25 分)
1113 Integer Set Partition (25 分)Given a set of N (>1) positive integers, you are supposed to partition them into two disjoint sets A1 and A2 of n1 and n2 numbers, respectively. Let S1 and S2 denote the sums of all the numbers i
2021-03-04 10:53:55
136
1
原创 1101 Quick Sort (25 分)
1101 Quick Sort (25 分)There is a classical process named partition in the famous quick sort algorithm. In this process we typically choose one element as the pivot. Then the elements less than the pivot are moved to its left and those larger than the pivo
2021-03-04 09:38:58
77
1
原创 1083 List Grades (25 分)
1083 List Grades (25 分)Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing order, and output those student records of which the grades are in a given interval.Input S
2021-03-03 23:30:29
117
1
原创 1080 Graduate Admission (30 分)
1080 Graduate Admission (30 分)It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if you could write a program to automate the admission procedure.Each applican
2021-03-03 23:16:27
65
1
原创 1062 Talent and Virtue (25 分)
1062 Talent and Virtue (25 分)About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people’s talent and virtue. According to his theory, a man being outstanding in both talent and virtue must be a “sage(圣人)”; b
2021-03-03 17:32:07
89
1
原创 1055 The World‘s Richest (25 分)
1055 The World’s Richest (25 分)Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world’s wealthiest people. Now you are supposed to simulate this job, but concentrate only on the people in a certain range of
2021-03-03 16:47:14
108
1
原创 1028 List Sorting (25 分)
1028 List Sorting (25 分)Excel can sort records according to any column. Now you are supposed to imitate this function.Input Specification:Each input file contains one test case. For each case, the first line contains two integers N (≤10^5 ) and C, whe
2021-03-03 15:59:41
87
1
原创 1025 PAT Ranking (25 分)
1025 PAT Ranking (25 分)Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in several places, and the ranklists will be merged immediately after
2021-03-03 11:13:07
64
原创 1016 Phone Bills (25 分)
1016 Phone Bills (25 分)A long-distance telephone company charges its customers by the following rules:Making a long-distance call costs a certain amount per minute, depending on the time of day when the call is made. When a customer starts connecting a l
2021-03-03 08:34:56
149
原创 1012 The Best Rank (25 分)
1012 The Best Rank (25 分)To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mathematics (Calculus or Linear Algrbra), and E - English. At the mean time, we enc
2021-03-02 13:15:14
70
原创 1144 The Missing Number
1144 The Missing Number (20 分)Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list.Input Specification:Each input file contains one test case. For each case, the first line gives a positive integer N (≤1
2021-03-02 10:53:55
74
原创 1141 PAT Ranking of Institutions (25 分)
1141 PAT Ranking of Institutions (25 分)After each PAT, the PAT Center will announce the ranking of institutions based on their students’ performances. Now you are asked to generate the ranklist.Input Specification:Each input file contains one test case.
2021-03-02 10:46:17
168
原创 1124 Raffle for Weibo Followers (20 分)
1124 Raffle for Weibo Followers (20 分)John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo – that is, he would select winners from every N followers who forwarded his post, and give away gifts. Now y
2021-02-28 23:37:22
128
原创 1112 Stucked Keyboard (20 分)
1112 Stucked Keyboard (20 分)On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the characters corresponding to those keys will appear repeatedly on screen for k times.Now given a resulting string on screen, you ar
2021-02-28 22:58:59
84
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人