MVC顶层设计 一、请求调用 public class GPDispatcherServlet extends HttpServlet { //保存Controller中URL和Method的对应关系 private List<GPHandlerMapping> handlerMappings = ...
分类:
Web程序 时间:
2021-04-22 15:16:33
阅读次数:
0
并查集可以有两个优化方案, 1,平衡性优化:对每个结点标记一个重量值,在进行union操作时,将重量小的添加到重量大的节点上。 2,路径压缩:在进行find操作时,顺便对路径进行压缩 private int find(int x) { while (parent[x] != x) { // 进行路径 ...
分类:
其他好文 时间:
2021-04-22 15:12:28
阅读次数:
0
内容是看了设计模式之禅,然后自己写个文档总结到一起,便于查看。 单例模式:(程序运行过程中只能有一个类的对象) 单例模式主要是对构造方法进行私有化 private,防止外部通过 new方法 创建实体类。针对该类中的方法尽量使用static修饰,便于访问。 public class Singleton ...
分类:
其他好文 时间:
2021-04-21 12:14:09
阅读次数:
0
实现了提示控件(picture1)随着鼠标而移动,但点击时仍会显示(是一个BUG) 需要绑定事件到 form、panel1、picture1、等控件 private void panel1_MouseMove(object sender, MouseEventArgs e) { //timer1.S ...
该模式的作用就是复制对象,特别是复杂的对象。 1.浅克隆 两个要点:实现Cloneable接口,重写clone()方法 public class Product implements Cloneable{ private String name; private Date date; public ...
分类:
其他好文 时间:
2021-04-20 15:18:21
阅读次数:
0
this关键字 this关键字的作用: @Data public class jtest { private String name; public jtest(){ //调用构造方法,只能在构造方法中使用,且必须是第一行 this("dwx"); } public jtest(String nam ...
分类:
编程语言 时间:
2021-04-20 15:11:01
阅读次数:
0
1.饿汉式,这种方式不推荐,会造成资源的浪费。 public class Hungry { private Hungry(){ } private static Hungry hungry = new Hungry(); public static Hungry getInstance(){ ret ...
分类:
其他好文 时间:
2021-04-20 14:07:56
阅读次数:
0
public class StatePattern { public static void main(String[] args) { Context context=new Context(); for (int i = 0; i < 10; i++) { context.handle(); } ...
分类:
其他好文 时间:
2021-04-19 16:06:54
阅读次数:
0
解决属性名和字段名不一致的问题 1.出现的问题 数据库中的字段 ? 新建一个项目,拷贝之前的,测试实体类与数据库字段不一致的情况 public class User { private int id; private String name; private String password; } 现 ...
分类:
其他好文 时间:
2021-04-19 16:03:47
阅读次数:
0
生成RSA密钥 1. 制作密钥对 [root@host ~]$ ssh-keygen <== 建立密钥对 Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): ...
分类:
系统相关 时间:
2021-04-19 15:54:27
阅读次数:
0