摘要: 1、字体兼容bug 描叙:ios默认字体和andriod不一样,需要设置html的默认字体样式例子:font-family: PingFang-SC-Regular,Helvetica,sans-serif; 2、WeiboJSBridge设置bug 描叙:android的jsbride设置不起作用 阅读全文
posted @ 2018-03-21 14:31 无工时代 阅读(232) 评论(0) 推荐(0) 编辑
摘要: let obj={a:{c:21},b:2} const path='a.c' const val=hget(obj,path,'默认值') 没有值就返回默认值 //利用字符串路径获取对象集合的值 对象:result 路径:path 默认值:def function hget(result,path 阅读全文
posted @ 2018-03-16 16:54 无工时代 阅读(289) 评论(0) 推荐(0) 编辑
摘要: //n个骰子的和,组成数字m的可能 function f(n,m) { if(n==1){ return 1; } var len=m-n; var sum=0; while (len>=0){ len-- //当前骰子和剩余骰子不能大于7 if(m-n+1-len<7&&n-1+len<... 阅读全文
posted @ 2018-03-16 14:54 无工时代 阅读(504) 评论(0) 推荐(0) 编辑
摘要: 之前面试的时候,面试官问我的一个题目, 问:一个人在w*h的地图上走,每次走一步,先向左走到头,然后向下走,然后向上走,然后向左走,不能重复,求n步所在的位置 如下: 它会依次输出1-64, 阅读全文
posted @ 2017-12-19 15:40 无工时代 阅读(401) 评论(0) 推荐(0) 编辑
摘要: class _Getch: """Gets a single character from standard input. Does not echo to the screen.""" def __init__(self): try: self.impl = _GetchWindows() except ImportEr... 阅读全文
posted @ 2017-12-06 19:33 无工时代 阅读(1329) 评论(0) 推荐(0) 编辑
摘要: //获取数组中两个相加等于0的一对数字,比如[ [ -10, 10 ], [ -5, 5 ] ] var arr=[-5,10,1,-10,3,4,5,9] //对数组进行排序 arr.sort(function(num1,num2){ if(num1>num2)return 1; if(num1num){ s2-- } i... 阅读全文
posted @ 2017-06-15 09:24 无工时代 阅读(764) 评论(0) 推荐(0) 编辑
摘要: //矩阵运算的函数 ;(function(global){ global.Matrix = { //生成对角矩阵,非零元素都为1 eye : function( n ){ var result = []; var arr; for ( var i = 0; i 0 ) { ... 阅读全文
posted @ 2017-03-06 17:39 无工时代 阅读(482) 评论(0) 推荐(0) 编辑
摘要: function getInfo(html){ //去掉注释 html=html.replace(//g,"") var arrP=[] var reg=/]*>|>)[\d\D]*?/gi html.replace(reg,function(m){ if(/^/gi.test(m)){ m= m.replace(... 阅读全文
posted @ 2017-03-06 17:37 无工时代 阅读(216) 评论(0) 推荐(0) 编辑
摘要: /* * config * caoke */ 'use strict'; //You can't use merge in util.js function merge(source, target){ if(typeof source === 'object' && typeof target === 'object'){ for(var key in targ... 阅读全文
posted @ 2017-01-10 15:29 无工时代 阅读(204) 评论(0) 推荐(0) 编辑
摘要: /* * config * caoke */ 'use strict'; Object.extend=function(props){ //继承父类 var prototype=Object.create(this.prototype) //初始化函数ctor var _Class=function(){ if(arguments.leng... 阅读全文
posted @ 2017-01-10 15:17 无工时代 阅读(182) 评论(0) 推荐(0) 编辑