自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(176)
  • 资源 (1)
  • 收藏
  • 关注

原创 Shiro的Sha256加盐加密 密码不匹配

先讲一下原理吧:直接把用户的密码存储在数据库,一旦数据库被入侵,密码就gg了,后果不堪设想,所以先把用户注册时输入的密码进行加密,然后放进数据库。但是密码加密了,用户登录的时候,怎么进行密码比较呢?...

2021-06-15 21:34:18 1301 1

原创 2021-06-03 JSP页面修改实时刷新

IDEA的Tomcat设置:

2021-06-03 10:33:19 910

原创 ajax解析json数据并写入table中,却显示两次

如图:ajax解析json并写入table代码模板:function find() { $.ajax({ url: "/CustomerController/findCustomerByConditionWithAjax", type: "POST", data: {idCon: $("input[name='idC

2021-05-18 10:53:01 299

原创 form里按钮调用js函数

去掉id属性就可以了,亲测有效:

2021-05-18 10:43:34 878

原创 依赖闭环(相互依赖)

Spring官方文档,解释了如果a需要注入属性b,b也需要注入属性a,这是一个先有鸡还是先有蛋的问题,相互依赖,形成了闭环。此时,解决方案:避免是用构造器注入,虽然不建议但是可以使用setter方法注入属性。a和b会有一个强制注入另一个来使自己完全初始化。...

2021-05-14 22:01:01 252

原创 取消字段的自增属性

2021-05-10 11:30:07 876

原创 EL表达式${param.参数名}获取参数的时候出现乱码

form的代码: username:<input type="text" class="form-control" name="pyh" placeholder="输入用户名">在接受参数的页面获取值的时候:会出现乱码:解决方法:在Tomcat的H:\tomcat7\apache-tomcat-7.0.108\conf目录下有个server.xml,添加:URIEncoding="utf-8"然后保存重启Tomcat即可。成功:...

2021-05-07 22:54:01 782

原创 Maven本来设置后就可以自动下载jar包也就是依赖,好好的突然不会自动下载了,必须手动刷新

作为懒人 ,当然受不了,网上的那几种方式无效。最后清除缓存并重启就解决了:

2021-05-07 19:27:04 441

原创 JSP中out.println的println报红

报红如图:两个方法:1.在module的dependencies里导入Tomcat包:2.用Maven导入这俩包:

2021-05-04 18:14:36 2032

原创 在run面板里,多个Tomcat分别显示和一起显示

本来一起显示,误操作了变成多个tab,一个tab显示一个Tomcat 不太方便:在“.idea”文件夹下有个workspace.xml文件,找到这一项:改option name这个属性,然后重启Tomcat就行了。<component name="RunDashboard"> <option name="configuratinTypes"> <set> <option value="#com.intellij.j2ee

2021-04-02 21:03:12 157

原创 SpringMVC文件上传

SpringMVC文件上传的三种方式:jsp代码: <h1>springmvc跨服务器文件上传</h1> <form action="testFileupload3" name="fileupload" enctype="multipart/form-data" method="post"> <input type="file" name="upload"/> <input type="submit" value="提交"/

2021-04-02 20:40:03 89

原创 CGLib动态代理的报错处理办法

cglib开源有github托管CGLib所需jar包的github链接,有这几个包:如果知道上图中的第一个包,会报错如下:所以应该导入第二个包,最好只导入一个:

2021-03-24 00:10:40 801 1

原创 改字段的属性

修改表中字段(列名)的属性,语法:alter table grade modify job char(10);原来属性:修改后:

2021-03-10 20:40:13 349

原创 IDEA:在一个项目里使用另一个项目的类,不是module,是project

如在我的pair项目里的fanxing_method这个module中想使用另一个project:Reflection(反射)使用此类中打印方法查看fanxing_method中编译产生的方法。可以先把reflection打包成jar包,然后导入到pair项目中去。打包jar包步骤:1.打开reflection的Project Structure,选中Artifacts,点击“+”,选中JAR,选Empty。2.修改名称,选择jar包保存路径。点击这里选保存路径:

2021-01-12 01:27:50 3229

原创 IDEA:自动刷新pom.xml的更改

新版本IDEA在没有设置前,修改pom.xml文件必须点下这个图标:更改后的pom.xml才真的生效,不方便。自动刷新生效的设置:1.点击侧栏:Maven2.点击Auto-Reload Settings...3.选中Any changes,然后apply,再点击ok即可...

2021-01-08 22:49:17 19773 7

原创 java核心:不要编写返回引用可变对象的访问器方法

package corejava;import static java.lang.Math.*;import java.io.IOException;import java.math.*;import java.nio.file.Paths;import java.time.DayOfWeek;import java.time.LocalDate;import java.util.Arrays;import java.util.Date;import java.util.Gregor.

2020-08-26 21:00:36 377

原创 java核心:LocalDate

package corejava;import static java.lang.Math.*;import java.io.IOException;import java.math.*;import java.nio.file.Paths;import java.time.DayOfWeek;import java.time.LocalDate;import java.util.Arrays;import java.util.Date;import java.util.Scanne.

2020-08-26 17:25:31 120

原创 substring()和“==”

1.substring函数的两种用法:下标从0开始(1):只有一个参数,此参数为字符串截取开始位置;(2):两个参数,第一个为字符串截取开始位置,第二个为截取结束位置的下标,包含此下标前的字符串,不包含此下标。2.在c++中,substr()函数也有两种用法:下标从0开始(1):只有一个参数,此参数为字符串截取开始位置;(2):两个参数,这里与java中的不同,第一个参数为字符串截取开始位置,第二个参数为要截取的字符串长度。3.“==”判断左右字符串的内存存放位置是否相同, equals()判断左右

2020-08-24 21:59:33 2302

原创 1118 Birds in Forest (25分) 简单并查集

Some scientists took pictures of thousands of birds in a forest. Assume that all the birds appear in the same picture belong to the same tree. You are supposed to help the scientists to count the maximum number of trees in the forest, and for any pair of b

2020-07-23 17:29:48 126

原创 1002 A+B for Polynomials (25分) 模拟 简单但是有坑题

This time, you are supposed to findA+BwhereAandBare two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial:KN​1​​a​N​1​​​​N​2​​a​N​2​​​​...

2020-07-13 11:35:23 613

原创 1001 A+B Format (20分) 模拟题 输出格式

Calculatea+band output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits).Input Specification:Each input file contains one test case. Each case contains a pair o..

2020-07-04 22:49:23 167

原创 1135 Is It A Red-Black Tree (30分) 红黑树 平衡二叉树

There is a kind of balanced binary search tree namedred-black treein the data structure. It has the following 5 properties:(1) Every node is either red or black. (2) The root is black. (3) Every leaf (NULL) is black. (4) If a node is red, then both ..

2020-07-02 22:32:26 293

原创 1151 LCA in a Binary Tree (30分) LCA 树的遍历 技巧型

The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants.Given any two nodes in a binary tree, you are supposed to find their LCA.Input Specification:Each input file contains one test ca

2020-07-02 18:13:54 238

原创 1146 Topological Order (25分) 拓扑序列的判断 拓扑排序

This is a problem given in the Graduate Entrance Exam in 2018: Which of the following is NOT a topological order obtained from the given directed graph? Now you are supposed to write a program to test each of the options.Input Specification:Each inpu

2020-07-02 11:47:18 563

原创 1139 First Contact (30分) 模拟题 有点像并查集,但可以不用并查集的方法

Unlike in nowadays, the way that boys and girls expressing their feelings of love was quite subtle in the early years. When a boy A had a crush on a girl B, he would usually not contact her directly in the first place. Instead, he might ask another boy C,

2020-07-02 10:27:15 263

原创 1131 Subway Map (30分) DFS 深度优先搜索 怪麻烦的 太美了

In the big cities, the subway systems always look so complex to the visitors. To give you some sense, the following figure shows the map of Beijing subway. Now you are supposed to help people with your computer skills! Given the starting position of your u

2020-07-01 18:38:52 235

原创 1127 ZigZagging on a Tree (30分) 中序后序建树 层次遍历

Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and inorder traversal sequences. And it is a simple standard routine to print the numbers in level-order. However

2020-07-01 16:20:25 155

原创 1123 Is It a Complete AVL Tree (30分) AVL 平衡二叉搜索树 层序遍历

An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalancing is done to restore this property. Figures 1-4 illustrate t

2020-06-30 23:25:39 181

原创 1119 Pre- and Post-order Traversals (30分) 前后序遍历写出中序遍历 树的遍历

Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and inorder traversal sequences, or preorder and inorder traversal sequences. However, if only the postorder and

2020-06-30 21:27:32 217

原创 1115 Counting Nodes in a BST (30分) 建树 BST搜索二叉树 建树要小心可能不是完全二叉树

A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys less than or equal to the node's key. The right subtree of a node contains only nodes with key

2020-06-29 23:23:36 129

原创 1111 Online Map (30分) dijkstra算法 加复杂条件的最短路径+DFS 路径保存

Input our current position and a destination, an online map can recommend several paths. Now your job is to recommend two paths to your user: one is the shortest, and the other is the fastest. It is guaranteed that a path exists for any request.Input Spe

2020-06-29 22:39:48 117

原创 1107 Social Clusters (30分) 并查集 模板题 但不能大意

When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. Asocial clusteris a set of people who have some of their hobbies in common. You are supposed to find all the cl..

2020-06-29 15:50:03 129

原创 1103 Integer Factorization (30分) DFS深度优先搜索 经典递归

TheK−Pfactorization of a positive integerNis to writeNas the sum of theP-th power ofKpositive integers. You are supposed to write a program to find theK−Pfactorization ofNfor any positive integersN,KandP.Input Specification:Each input ...

2020-06-28 18:41:15 114

原创 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 a binary tree!Input Specifi

2020-06-27 23:18:20 127

原创 1101 Quick Sort (25分) 快速排序 快排 思维

There is a classical process namedpartitionin 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 pivot to its right. GivenN...

2020-06-27 11:04:56 178

原创 1098 Insertion or Heap Sort (25分) 快速排序 堆排序

According to Wikipedia:Insertion sortiterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data, finds the location it belongs within the sorted list, a.

2020-06-27 00:19:28 161

原创 1091 Acute Stroke (30分) BFS广度优先搜索

One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions are identified in each MRI slice, your job is to calculate the volume of the stroke core.Input Specifica

2020-06-26 22:16:52 152

原创 1072 Gas Station (30分) dijkstar算法 复杂化:多次Dijkstra+带些附加的计算要求 经典

A gas station has to be built at such a location that the minimum distance between the station and any of the residential housing is as far away as possible. However it must guarantee that all the houses are in its service range.Now given the map of the

2020-06-26 11:32:43 192

原创 1068 Find More Coins (30分) 01背包问题 动态规划

Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However, there was a special requirement of the payment: for eac

2020-06-25 10:33:10 123

原创 1066 Root of AVL Tree (25分) 平衡二叉树 经典递归

An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalancing is done to restore this property. Figures 1-4 illustrate t

2020-06-25 00:27:53 163

javaSE_jdk8

Java 8是一款革命性开发平台,其全面升级现有Java编程模式,带来一项协同开发的JVM、Java语言以及库。Java 8平台集合生产力、易用性、多语种编程、更高安全性和稳定性等特色。racle甲骨文公司如期发布下一代Java开发工具:Java 8。另外,官方也发布JDK 8(Java Development Kit) 8)开发工具,带来诸多新特性。欢迎Java开发爱好者下载使用。

2018-03-30

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除