摘要: 八皇后问题:将八个皇后摆在一张8*8的国际象棋棋盘上,使每个皇后都无法吃掉别的皇后,一共有多少种摆法? 两个皇后不能同时在同一行,同一列,和斜对角线的位置上,使用回溯法解决。 从第一行选个位置开始放棋子,第二行从0开始选择满足规则的位置,到第三行发现没有位置可以满足规则,那么就把第二行的棋子向后移动 阅读全文
posted @ 2019-03-28 21:00 abc1234_abc 阅读(802) 评论(0) 推荐(0) 编辑
摘要: 问题描述: 在手机端,在百度地图中绘制多边形区域,当拖动地图时,多边形区域会消失一部分,继续拖动,会继续再消失,拖动到原位置后,又重新现显示完全 代码: strokeColor: "#b763e0", //边线颜色。 fillColor: "#b763e0", //填充颜色。当参数为空时,圆形将没有 阅读全文
posted @ 2019-03-26 12:06 abc1234_abc 阅读(442) 评论(0) 推荐(0) 编辑
摘要: 1、柯里化: 把接受多个参数的函数变换成接受一个单一参数(最初函数的第一个参数)的函数,并且返回接受余下的参数而且返回结果的新函数的技术。 举个栗子: 一个计算两数之和的函数,需要传递两个参数,柯里化后,这个方法只接受一个参数,但是返回一个函数,用来接收第二个参数 function add(a,b) 阅读全文
posted @ 2019-03-21 18:13 abc1234_abc 阅读(284) 评论(0) 推荐(0) 编辑
摘要: class MidWare{ constructor(){ this.cache = []; } use(fn){ this.cache.push(fn); } start(){ var middles = this.cache; function dispatch(index){ if(index 阅读全文
posted @ 2019-03-20 16:17 abc1234_abc 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 1、标签 .i{ background:red; width:40px; height:20px; position:relative; color:white; } .i:after{ content:''; position: absolute; display: inline-block; r 阅读全文
posted @ 2019-03-14 15:30 abc1234_abc 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 只考虑成功时的调用,方便理解一下promise的原理promise的例子: 1、 接下来一步步实现一个简单的promise step1:promise 接受一个函数作为构造函数的参数,是立即执行的,并且返回个resolve函数作为该函数的回调 step2: promise的then方法接受一个函数作 阅读全文
posted @ 2019-03-04 20:41 abc1234_abc 阅读(418) 评论(0) 推荐(0) 编辑
摘要: if (!/windows phone|iphone|android/ig.test(window.navigator.userAgent)) { //pc }else{ //h5 } 阅读全文
posted @ 2019-03-04 11:18 abc1234_abc 阅读(1177) 评论(0) 推荐(0) 编辑
摘要: function request(url) { // this is where we're hiding the asynchronicity, // away from the main code of our generator // `it.next(..)` is the generator's iterator-resume // call m... 阅读全文
posted @ 2019-02-02 17:33 abc1234_abc 阅读(407) 评论(0) 推荐(0) 编辑
摘要: 下次就不需要重新输入密码了, 如果是修改了密码,需要同步到git,直接在凭据这里编辑修改密码就可以了 阅读全文
posted @ 2019-02-02 10:50 abc1234_abc 阅读(3827) 评论(0) 推荐(0) 编辑
摘要: .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } 阅读全文
posted @ 2019-01-23 11:41 abc1234_abc 阅读(463) 评论(0) 推荐(0) 编辑