随笔分类 -  javascript构件

javascript的一些特殊思路,凝结出来的智慧宝石!
摘要:根据两个用户的行为记录 [ [ 0, 1, 4, 9 ], [ 8, 0, 7, 2 ] ] ,找出中间记录[4,0.5,5.5,5.5],生成特征 [ [ 0, 1, 0, 1 ],[ 1, 0, 1, 0 ] ] 求出特征出现概率 [1/2,1/2,1/2,1/2] 输入新的行为,根据中间记录, 阅读全文
posted @ 2020-04-03 19:32 无工时代 阅读(471) 评论(0) 推荐(0)
摘要:class limitArray extends Array{ constructor(maxNum){ super() Object.defineProperty(this,"maxNum",{ enumerable:false,//是否可以被枚举 value:maxNum, writable:t 阅读全文
posted @ 2020-04-01 16:47 无工时代 阅读(261) 评论(0) 推荐(0)
摘要:'use strict';/*异步数据模块加载器功能1、加载器存在 主任务、副任务、子任务newRequire 表示加载主任务,主任务并发执行,newRequire(param1),执行主任务的时候,暂停副任务,主任务结束后,再执行副任务。onRequireFree 表示加载副任务,任务放队列,主任 阅读全文
posted @ 2020-03-25 16:37 无工时代 阅读(507) 评论(0) 推荐(0)
摘要:class LCache{ constructor(load,exec){ this.load=load;//加载函数 this.exec=exec;//执行函数 this.maxLen=100;//最大缓存数 this.nearTimeMap={};//最近访问时间 this.resMap={}; 阅读全文
posted @ 2020-03-20 18:37 无工时代 阅读(306) 评论(0) 推荐(0)
摘要:demo地址 http://106.13.201.82/demo/page_change.html page_change.vue <template> <div class="flex" :class="direction" :style="{width:width,height:height}" 阅读全文
posted @ 2020-03-14 14:19 无工时代 阅读(3191) 评论(0) 推荐(0)
摘要:function getText(time,callback) { setTimeout(function () { callback(time) },time) } var callbackMap={};//记录加载完成的回调 var resMap={};//记录url var loadbackM 阅读全文
posted @ 2020-03-11 00:43 无工时代 阅读(188) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2019-11-26 15:23 无工时代 阅读(3) 评论(0) 推荐(0)
摘要:const fs=require('fs-extra');const ShortName=require('./ShortName');const WashRoom=require('./WashRoom')//本地数据库class LocalStorage{ constructor(tagDir) { this.dbDir=tagDir||__dirname+'/db/';... 阅读全文
posted @ 2019-11-25 16:15 无工时代 阅读(249) 评论(0) 推荐(0)
摘要:将内容生成一个key或者id的短链 阅读全文
posted @ 2019-11-25 16:14 无工时代 阅读(339) 评论(0) 推荐(0)
摘要:const md5=require('./utils/md5')const fs=require('fs-extra');//分割符号和字符长度const splitCode=',';const tagLen=3;const dir='tag/';fs.ensureDirSync(dir);//查找function find(s1) { const mstr= md5(String(s1)... 阅读全文
posted @ 2019-11-21 00:20 无工时代 阅读(271) 评论(0) 推荐(0)
摘要:最近公司人多厕所少,写个代码描述下场景,有点恶心,见谅哈哈 输出: "C:\Program Files\nodejs\node.exe" D:\360jr\360jr-wlh\koa-app\src\washRoom.js0 '排队'1 '排队'2 '排队'3 '排队'4 '排队'5 '排队'0 ' 阅读全文
posted @ 2019-11-17 16:09 无工时代 阅读(384) 评论(0) 推荐(0)
摘要:/* * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message * Digest Algorithm, as defined in RFC 1321. * Version 2.1 Copyright (C) Pa 阅读全文
posted @ 2019-11-16 18:18 无工时代 阅读(1079) 评论(0) 推荐(0)
摘要:在做大数据查找的时候用到海明距离,可以利用海明距离给字符生成一个地址,类似 中国-湖南-衡山这样的,就能快速的查找字符和相似字符 阅读全文
posted @ 2019-11-15 10:13 无工时代 阅读(311) 评论(0) 推荐(0)
摘要:var getText = require("./utils/getText"); var setText = require("./utils/setText"); const SugarMap={ async init(val){ console.log(val) return val } } async function init() { ... 阅读全文
posted @ 2019-08-08 19:39 无工时代 阅读(195) 评论(0) 推荐(0)
摘要:虚拟dom节点,支持querySelector, 方法: Api.js AstToHtml.js treeSearch.js 阅读全文
posted @ 2019-08-07 12:23 无工时代 阅读(466) 评论(0) 推荐(0)
摘要:test.js 阅读全文
posted @ 2019-08-06 16:58 无工时代 阅读(606) 评论(0) 推荐(0)
摘要:getText.js setText.js 阅读全文
posted @ 2019-08-05 19:32 无工时代 阅读(539) 评论(0) 推荐(0)
摘要:const sleep=require('./utils/sleep') //js洋葱模型,支持异步async function compose (middleware) { return async function () { let args = arguments await dispatch(0); async function d... 阅读全文
posted @ 2019-08-02 15:26 无工时代 阅读(418) 评论(0) 推荐(0)
只有注册用户登录后才能阅读该文。
posted @ 2019-07-30 16:37 无工时代 阅读(10) 评论(0) 推荐(0)
摘要:抓取页面的一块ui,将属于ui的html、css分离出来,需要配合浏览器机器人抓取html TinyCss.js 阅读全文
posted @ 2019-07-30 14:12 无工时代 阅读(351) 评论(0) 推荐(0)