摘要: Spring三大器 监听器listener Servlet的监听器Listener,它主要作用是随着web应用的启动而启动,只初始化一次,随着web的停止而销毁。 主要工作是:进行一些初始化的工作,例如参数或者固定一些固定对象 Spring boot框架自带的Listener由框架提供,在Appli 阅读全文
posted @ 2019-05-23 21:00 阿怪123 阅读(730) 评论(0) 推荐(0) 编辑
摘要: 一 启动过程 Spring的启动代码里最核心的两个部分 @SpringBootApplication SpringApplication.run() 二 @SpringBootApplication 启动类使用了注解SpringBootApplication,而事实上,该注解是一个组合注解 事实上, 阅读全文
posted @ 2019-05-15 17:07 阿怪123 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 一 启动项管理 1 /etc/init.d文件夹 /etc/init.d是/etc/rc.d/init.d文件夹的软链接,这个文件夹的主要作用是在该目录下寻找服务脚本,并且根据脚本的run level确定不同的启动等级。即本质上,该文件夹内是各种各样的shell脚本。 CentOS和Ubuntu,需 阅读全文
posted @ 2018-07-20 14:21 阿怪123 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 1. ResponseBody 该注解直接将返回体转换为json格式的字符串,并返回 2. RequestBody 该注解用于处理请求中的JSON类型,主要是将JSON绑定为一个bean 3. RequestParam 在访问各种各样网站时,经常会发现网站的URL的最后一部分形如:?xxxx=yyy 阅读全文
posted @ 2018-07-20 14:20 阿怪123 阅读(694) 评论(0) 推荐(0) 编辑
摘要: Spring中的context管理 Spring中IOC容器的初始化: ApplicationContext即是保存bean对象的容器,故容器本身的初始化,就是通过一系列的配置,将ApplicationContext进行初始化。 而配置ApplicationContext大方向上分为了3中: 一、使 阅读全文
posted @ 2018-07-20 14:17 阿怪123 阅读(1007) 评论(0) 推荐(0) 编辑
摘要: Spring基础 Keywords 控制反转IOC:程序员不自己去new实例,而是交由Spring去构建实例,并且统一放在IOC容器当中由Spring进行管理。 依赖注入DI:即注入,由Spring将构建出的实例注入到需要使用这个对象的类当中。 要让实例被构建并被交给Spring的IOC容器统一管理 阅读全文
posted @ 2018-07-20 14:16 阿怪123 阅读(391) 评论(0) 推荐(0) 编辑
摘要: 整个框架主要是围绕一个DispatcherServlet来进行设计的 该Servlet会将请求分发给各个处理器,并支持可配置的处理器映射、视图渲染、本地化、时区与主题渲染等 其中,处理器是应用中注解了 @Controller 和 @RequestMapping的类和方法 DispatcherServ 阅读全文
posted @ 2018-07-20 14:15 阿怪123 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Spring MVC 1 基本概念 MVC模式 1 用户请求通过http请求到达前段控制器 2 前端发给真正的控制器Controller 3 将处理之后的数据以model的格式进行返回 4 前端控制器将model发送给View template(视图模板)来进行解析和展示 概念解析: 前端控制器 M 阅读全文
posted @ 2018-07-20 14:14 阿怪123 阅读(294) 评论(0) 推荐(0) 编辑
摘要: 1 面向切面编程概念 2 AOP使用时的语法 主要分为注解方式 以及 XML配置方式 3 切面表达式 designator 指示器 within可以进行包/类型的匹配 @annotation() 方法级别 @within() @target() class级别 @args() 参数级别 wildca 阅读全文
posted @ 2018-07-20 14:12 阿怪123 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 文| Jenny乔 据说,中年危机最近很火。想了一下,觉得对中年挺奇怪的。 为什么非要中年危机呢?要说危机,年轻人、中年人、老年人,甚至小学生都有。 都说学生时代最幸福。可学生们自己可不同意。一上学就犯困,一放学就精神。每天和老师家长斗心眼,作业少写一笔是一笔,考试能躲一门是一门。 叛逆?不敢。谁让 阅读全文
posted @ 2018-07-18 10:47 阿怪123 阅读(158) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/description/ 阅读全文
posted @ 2017-08-06 22:38 阿怪123 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 同样是100M的链路,一条是全双工,另一条是半双工,如果两条链路上都进行单向通信的话,理论上是都可以达到100M的(注意:这里全双工也只有100M),但是如果两条链路都进行双向通信就不一样了,双向通信时,全双工的链路的吞吐量是200M(两个方向每个方向上都是100M),而半双工最大也只有100M。但 阅读全文
posted @ 2017-04-16 14:43 阿怪123 阅读(7933) 评论(0) 推荐(1) 编辑
摘要: # Write your MySQL query statement below select Name Customers from Customers where Customers.Id not in ( select Customers.Id from Orders,Customers where Customers.Id=Orders.C... 阅读全文
posted @ 2016-08-28 11:06 阿怪123 阅读(86) 评论(0) 推荐(0) 编辑
摘要: # Write your MySQL query statement below select E.name Employee from Employee as E,Employee as M where E.ManagerId=M.Id and E.Salary>M.Salary 阅读全文
posted @ 2016-08-28 10:57 阿怪123 阅读(112) 评论(0) 推荐(0) 编辑
摘要: # Write your MySQL query statement below select distinct Email from Person group by Email having count(*) > 1 阅读全文
posted @ 2016-08-28 10:07 阿怪123 阅读(155) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public String countAndSay(int n) { if(n==1) return "1"; String res="1"; for(int i=1;i<n;i++) { res=Say(res)... 阅读全文
posted @ 2016-08-14 15:08 阿怪123 阅读(108) 评论(0) 推荐(0) 编辑
摘要: import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; public class Solution { public boolean isValidSudoku(char[][] board) { if(board==null) ... 阅读全文
posted @ 2016-08-13 21:33 阿怪123 阅读(106) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public void nextPermutation(int[] nums) { /* 假设数组大小为 n 1.从后往前,找到第一个 A[i-1] =0&&nums[i]>=nums[i+1]) i--; if(i!=-1) ... 阅读全文
posted @ 2016-08-12 11:21 阿怪123 阅读(138) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int strStr(String haystack, String needle) { if(haystack.equals("")&&needle.equals("")) return 0; int size1=haystack.length(); i... 阅读全文
posted @ 2016-08-10 21:01 阿怪123 阅读(105) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int removeDuplicates(int[] nums) { int size=nums.length; int last=0; boolean isHead=true; int lastIndex=0; for(int i=0;i<siz... 阅读全文
posted @ 2016-08-10 20:47 阿怪123 阅读(118) 评论(0) 推荐(0) 编辑
摘要: import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Solution { public List> threeSum(int[] nums) { int size=nums.length; List> res=new ArrayL... 阅读全文
posted @ 2016-08-10 20:34 阿怪123 阅读(113) 评论(0) 推荐(0) 编辑
摘要: /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */ public class Solution { public ListNode rem... 阅读全文
posted @ 2016-08-09 23:36 阿怪123 阅读(130) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int lengthOfLongestSubstring(String s) { int size=s.length(); int[] map=new int[206]; int maxLen=0; for(int i=0;imaxLen) ... 阅读全文
posted @ 2016-08-09 22:32 阿怪123 阅读(90) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public String longestCommonPrefix(String[] strs) { int size=strs.length; if(size==0) return ""; int index=0; boolean flag=true;... 阅读全文
posted @ 2016-08-09 19:10 阿怪123 阅读(119) 评论(0) 推荐(0) 编辑
摘要: /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */ public class Solution { public ListNode add... 阅读全文
posted @ 2016-08-09 18:55 阿怪123 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 这道题的关键点在于,对于字符串的赋值操作要谨慎,尽量采用记录下标的方式,而不是整个字符串的赋值,这样可以节省时间。 阅读全文
posted @ 2016-08-09 18:19 阿怪123 阅读(115) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int myAtoi(String str) { str=str.trim(); int size=str.length(); if(str==null||size==0) return 0; double res=0; b... 阅读全文
posted @ 2016-08-03 21:30 阿怪123 阅读(127) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public String convert(String s, int numRows) { if(s.equals("")) return ""; if(numRows==1) return s; String res=""; ... 阅读全文
posted @ 2016-08-03 16:05 阿怪123 阅读(102) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int[] twoSum(int[] nums, int target) { int [] res=new int[2]; int size=nums.length; boolean isGot=false; int i=0; int j=0; ... 阅读全文
posted @ 2016-08-03 15:40 阿怪123 阅读(118) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int[] searchRange(int[] nums, int target) { int []res=new int[2]; int size=nums.length; int left=0; int right=size-1; ... 阅读全文
posted @ 2016-08-02 23:15 阿怪123 阅读(173) 评论(0) 推荐(0) 编辑
摘要: import java.util.Arrays; public class Solution { public int threeSumClosest(int[] nums, int target) { int size=nums.length; int res=0; if(size<3) return 0; ... 阅读全文
posted @ 2016-08-02 18:59 阿怪123 阅读(104) 评论(0) 推荐(0) 编辑
摘要: import java.util.ArrayList; import java.util.List; public class Solution { public List letterCombinations(String digits) { int size=digits.length(); List res=new ArrayList(); ... 阅读全文
posted @ 2016-07-21 15:58 阿怪123 阅读(142) 评论(0) 推荐(0) 编辑
摘要: import java.util.Stack; public class Solution { public boolean isValid(String s) { int size=s.length(); if(size==0) return true; boolean res=true; Sta... 阅读全文
posted @ 2016-07-18 21:43 阿怪123 阅读(119) 评论(0) 推荐(0) 编辑
摘要: import java.util.ArrayList; import java.util.List; public class Solution { public List> combine(int n, int k) { List> res=new ArrayList>(); List temp=new ArrayList(); bfs... 阅读全文
posted @ 2016-07-18 14:49 阿怪123 阅读(137) 评论(0) 推荐(0) 编辑
摘要: import java.util.HashMap; import java.util.Map; public class Solution { public int removeDuplicates(int[] nums) { int size=nums.length; Map map=new HashMap(); int index=0... 阅读全文
posted @ 2016-07-17 15:26 阿怪123 阅读(110) 评论(0) 推荐(0) 编辑
摘要: import java.util.HashMap; import java.util.Map; /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } *... 阅读全文
posted @ 2016-07-17 13:08 阿怪123 阅读(145) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public void merge(int[] nums1, int m, int[] nums2, int n) { int index=m+n-1; int i=m-1; int j=n-1; while(j>=0) { if(inu... 阅读全文
posted @ 2016-07-13 09:40 阿怪123 阅读(136) 评论(0) 推荐(0) 编辑
摘要: import java.util.ArrayList; import java.util.List; /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(i... 阅读全文
posted @ 2016-07-13 09:30 阿怪123 阅读(152) 评论(0) 推荐(0) 编辑
摘要: import java.util.LinkedList; import java.util.Queue; class MyStack { Queue q1=new LinkedList(); Queue q2=new LinkedList(); // Push element x onto stack. public void push(in... 阅读全文
posted @ 2016-07-12 21:32 阿怪123 阅读(106) 评论(0) 推荐(0) 编辑
摘要: import java.util.ArrayList; import java.util.List; /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(i... 阅读全文
posted @ 2016-07-12 20:50 阿怪123 阅读(163) 评论(0) 推荐(0) 编辑