方法的可变参数: 方法中有无参方法,有带参方法,都多个参数的方法;代码如下: public class Dome { /* 方法无参和带参 */ public static void method() { System.out.println("我是一个无参的方法"); } public stati ...
分类:
其他好文 时间:
2020-07-28 22:21:42
阅读次数:
100
构建bean文件: public class People { private String name = "小明"; } 编写配置类: @Configuration @Import(ApplicationConfig2.class) public class ApplicationConfig { ...
分类:
编程语言 时间:
2020-07-28 22:20:26
阅读次数:
71
/// <summary> /// 防XSS攻击 /// date:2020-07-28 /// </summary> public class XssFilter : ActionFilterAttribute { private const string strRegex = @"<[^>]+? ...
分类:
其他好文 时间:
2020-07-28 16:59:08
阅读次数:
62
Camera有一个targetTexture属性,在设置了targetTexture后,Camera会在渲染时将其屏幕上的图像渲染到targetTexture上,可以使用快照实现镜头切换等特效 具体实现: private Texture2D CaptureCamera(Camera camera, ...
分类:
其他好文 时间:
2020-07-28 16:55:29
阅读次数:
65
1.懒汉模式 public class Singleton_hungry { private Singleton_hungry(){}; Singleton_hungry instance = new Singleton_hungry(); public Singleton_hungry getIn ...
分类:
其他好文 时间:
2020-07-28 00:15:20
阅读次数:
74
1、builder设计模式(邮件工具类) public class EmailMessage { private Message message; private static final String FROM = "qq邮箱"; private static final String PASSW ...
分类:
编程语言 时间:
2020-07-28 00:11:31
阅读次数:
78
一、简介 在每个节点(driver和executor)上运行的管理器,该接口提供用于在本地和远程将block放置和检索到各种存储(内存,磁盘和堆外)的接口。 二、源码 private[spark] class BlockManager( executorId: String, rpcEnv: Rpc ...
分类:
其他好文 时间:
2020-07-27 23:41:12
阅读次数:
73
原因:前端js对Long类型支持的精度不够,导致后端使用的Long传到前端丢失精度,比如现在分布式id生成算法“雪花算法”在使用中就会出现问题。 解决方式: 1、后端的Long类型的id转用String存储,不推荐,失去了其Long类型本身的意义。 2、在Long类型字段上使用注解标明序列化方式,代 ...
分类:
其他好文 时间:
2020-07-27 17:43:36
阅读次数:
65
1.安装NLog、NLog.Config包 2.添加日志类 public class LogFactory { public static Logger log; private string filename; /// <summary> /// 日志类 /// </summary> /// <p ...
分类:
Web程序 时间:
2020-07-27 13:55:43
阅读次数:
165
class Solution { public int countPairs(TreeNode root, int distance) { dfs(root,0,distance); return res; } private int res = 0; public List<Integer> df ...
分类:
其他好文 时间:
2020-07-27 13:50:30
阅读次数:
114