判断文件num.txt是否存在,如果不存在创建文件,写入数字0。读取文件的内容,执行自增,打印出来;把自增的结果再次写入到文件中。 全部使用同步操作。 const fs = require('fs'); var l = console.log; if (!fs.existsSync('./mydir ...
分类:
Web程序 时间:
2020-06-22 23:25:56
阅读次数:
102
据360安全卫士官方介绍,近期eCh0raix勒索病毒再度活跃,主要利用QNAP(威联通)NAS服务器中的远程漏洞组合进行传播,对用户隐私数据及财产安全造成极大威胁。
分类:
其他好文 时间:
2020-06-22 19:28:09
阅读次数:
87
var str = '.+-()*&/tpsys/applications.tiff' console.log(str) console.log(escape(str), '使用escape()编码') // .+-%28%29*%26/tpsys/applications.tiff console ...
分类:
Web程序 时间:
2020-06-22 15:30:47
阅读次数:
75
听说出了php7.4, 感觉是很快, 就开始使用, 然后用composer, 安装drupal console, 听说创建代码很快, 弄了两天都不行, 到了上班的地方用了php7.1, 需然很慢, 但是还是下载下来了,安装了drupal/console, 1, 依赖的包太多真的是问题啊, 2, 考虑 ...
分类:
Web程序 时间:
2020-06-22 13:20:46
阅读次数:
83
let obj = { obj1 :{ say:'hi1' }, obj2 :{ say:'hi2' } } let one = obj1 let two = say // 等于 obj.obj1.say // `` 是ESC下 TAB上的哪个键 console.log( obj[`${one}`] ...
分类:
微信 时间:
2020-06-22 13:13:20
阅读次数:
122
今天发现个async的新用法,之前都是搭配着 promise 让一步函数变得同步,今天试了一下下面的写法 async function hello(){ return "hello world"; } hello().then(data=>{ console.log(data + "哈哈");//h ...
分类:
其他好文 时间:
2020-06-22 01:48:47
阅读次数:
71
1.转成字符串,利用正则的方法 let ary = [1, [2, [3, [4, 5]]], [6, 7, [8, 9, [11, 12]], 10]]; //=>[1,2,3,4,5,6] let str = JSON.stringify(ary); //=>第一种处理 // console.l ...
分类:
编程语言 时间:
2020-06-22 01:43:48
阅读次数:
63
HttpRequestException: 发送请求时出错。 WebException: 请求被中止: 未能创建 SSL/TLS 安全通道。 方法调用前加以下代码行即可. System.Net.ServicePointManager.SecurityProtocol = System.Net.Sec ...
分类:
Web程序 时间:
2020-06-22 01:28:36
阅读次数:
136
const arr = [1,2,3,4,5,6] //const max = Math.max(...arr) //可以用扩展运算符,也可以利用apply的特性 const max = Math.max.apply(null, arr)//Math.min 最小值 console.log(max) ...
分类:
其他好文 时间:
2020-06-22 01:27:03
阅读次数:
48
1.键值对法 (我最喜欢,简单易懂) Array.prototype._RepeatMost = function () { let _this = [...this]; const obj = {}; let maxTerm = 1; let key = null; _this.forEach(( ...
分类:
其他好文 时间:
2020-06-21 23:08:51
阅读次数:
56