Wesley13 Wesley13
3年前
unity2d判断点击的方法
1第一种Physics2D.RaycastRaycastHit2DhitPhysics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition),Vector2.zero); if(hit.collider!null){ Debug.Log("Ta
Stella981 Stella981
3年前
ES6中数组求和,求平均数方法( reduce )
 应用场景一  计算数组中所有值的总和varnumbers3,5,9;varsumValuenumbers.reduce(function(sum,number){//sum2前两个数的和console.log(sum)//100010031008
Wesley13 Wesley13
3年前
go保存文件到指定的文件夹
框架:gin语言:golang作用:保存文件到本地指定文件夹的一个小demo单文件保存到本地指定目录:packagemainimport("fmt""log""net/http""path""github.com/gingon
Stella981 Stella981
3年前
Socket.IO连接异常时的内置事件流程图
参考Soket.IO官方文档:https://socket.io/docs/clientapi/,客户端内置事件一共有10种,测试代码如下:socket.on('connect',function(data){  onlineFlagtrue;  console.log(data'connect');});
Stella981 Stella981
3年前
Spring Security 新特性 Lambda DSL 使用
\项目推荐:SpringCloud、SpringSecurityOAuth2的RBAC权限管理系统欢迎关注(https://gitee.com/log4j/pig)LambdaDSL概述SpringSecurity5.2对LambdaDSL语法的增强,允许使用lambda配置HttpSec
Stella981 Stella981
3年前
Nginx之使用nginx搭建简单的文件服务器
  使用nginx可以搭建简单文件服务器  安装nginx(不详述)    修改配置文件/usr/local/nginx/conf/nginx.confuserroot;worker_processes1;error_loglogs/error.log;pidlog
Wesley13 Wesley13
3年前
MySQL数据库InnoDB存储引擎Log漫游(1)
作者:宋利兵来源:MySQL代码研究(mysqlcode)0、导读本文介绍了InnoDB引擎如何利用UndoLog和RedoLog来保证事务的原子性、持久性原理,以及InnoDB引擎实现UndoLog和RedoLog的基本思路。00–UndoLogUndoLog是为了实现事务的原子性,
Stella981 Stella981
3年前
JS 中的this指向问题和call、apply、bind的区别
this的指向问题一般情况下this对象指向调用函数的对象,全局环境中执行函数this对象指向window。functiona(){console.log(this);//输出函数a中的this对象}functionb(){};varc{name:"call"}
Stella981 Stella981
3年前
JavaScript中关于this关键字的魔幻现实 一篇文章搞懂他
不得不承认JS中存在一些“历史的遗产”,比如基于全局变量的编程模型。如果写一个函数,如:functiontest(name){varnamexnameconsole.log(this.namex)}test('jack')
Stella981 Stella981
3年前
Lombok使用3:其他注解
本篇文章会讲到:@NonNull、@Cleanup、@UtilityClass、@Log、@SneakyThrows、@Synchronized注解使用1、@NonNull使用@NonNull文档官方地址(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fproj