{"_id":"@dfgyhujk7npm/pariatur-dicta-amet","name":"@dfgyhujk7npm/pariatur-dicta-amet","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@dfgyhujk7npm/pariatur-dicta-amet","version":"1.0.0","description":"![Build Stat](https://api.travis-ci.org/kongnet/@dfgyhujk7npm/pariatur-dicta-amet.svg?branch=master) [![Coverage Status](https://coveralls.io/repos/github/kongnet/@dfgyhujk7npm/pariatur-dicta-amet/badge.svg?branch=master)](https://coveralls.io/github/kong","main":"index.js","author":{"name":"dfgyhujk7"},"license":"MIT","keywords":["middleware","redux-toolkit","configurable","postcss","package manager","es-shim API","ajv","move","cors","jsdom","ECMAScript 2016","config","apollo","time","immer","async","events","extension","regular expression","browserlist","package","rm -fr","Array.prototype.findLast","Uint8Array","file","touch","error-handling","regular expressions","parser","description","parse","array","iterate","wget","user-streams","password","6to5","log","ramda","trim","-0","utilities","censor","utils","emit","babel-core","isConcatSpreadable","less","mocha","hash","util.inspect","rmdir","curl","pnpm9","import","arguments","HyBi","directory","variables in css","regular","collection.es6","superstruct","immutable","duplex","batch","es8","ES8","rgb","resolve","chrome","ES2021","Array.prototype.filter","url","tap","ES5","compile less","findup","recursive","promises","BigUint64Array","xdg-open","json-schema-validation","fast","signal","chromium","equality","mru","worker","modules","typedarray","reducer","exit-code","enumerable","react-testing-library","option","unicode","eslintplugin","cjk","__proto__","pyyaml","data","output","TypeScript","look","arraybuffer","windows","css nesting","process","loading","chinese","default","generics","gestures","Array","shrinkwrap","stream","syntax","connect","babel","ES2016","YAML","callbind","classnames","width","Underscore","internal","core","api","rapid","Int8Array","push","serializer","higher-order","npm","prop","setPrototypeOf","trimEnd","env","stable","ECMAScript 2015","wait","fastify","weakset","styleguide","coercible","workspace:*","fp","es-abstract","invariant","validation","bluebird","String.prototype.trim","proto","concatMap","Object.getPrototypeOf","ES2015","minimal","symlinks","es","take","efficient","BigInt64Array","hookform","ES","intrinsic","picomatch","multi-package","copy","l10n","look-up","urls","installer","text","ender","string","includes","full","getter","shim","byte","listeners","readable","wrap","gradients css","trimStart","assert","toSorted","protobuf","qs","Float32Array","from","error","awesomesauce","libphonenumber","jsonpath","iterator","terminal","sigint","streams2","preprocessor","uninstall","json","parents","task","mobile","writable","zod","input","query","jQuery","sanitize","mkdirs","format","limit","ES7","colour","function","asserts","ES2023","flat","patch","WebSockets","hardlinks","ArrayBuffer.prototype.slice","dataview","jest","fixed-width","Object.entries","Object.defineProperty","reuse","throat",".env","persistent","tape","fullwidth","dom","website","const","fetch","syntaxerror","byteOffset","delete","metadata","gdpr","preserve-symlinks","positive","optimizer","id","opens","opener","Float64Array","ES2018","animation","walk","[[Prototype]]","i18n","eslintconfig","performant","cmd","slot","environment","is","compiler","ES2019","defineProperty","ECMAScript 5","jwt","prune","graphql","WebSocket","TypedArray","hasOwn","extra","arktype","Symbol","package.json","es6","types","safe","handlers","harmony","length","names","sorted","callback","@@toStringTag","remove","node","promise","logging","arrays","crypto","styling","es7","ES3","performance","jsdiff","serialization","computed-types","findLastIndex","toobject","which","getOwnPropertyDescriptor","pipe","progress","values","console","date","object","whatwg","folder","Reflect.getPrototypeOf","match","settings","classname","css","jasmine","telephone","pretty","framer","a11y","testing","random","assign","RegExp.prototype.flags","make dir","fs","setImmediate","lint","irq","indicator","URL","yup","postcss-plugin","airbnb","superagent","protocol-buffers","spinners","Streams","authentication","wordbreak","slice","ES2017","find","once","art","256","forms","Object.values","tdd","mixins","deterministic","parent","https","es2015","compare","merge","tacit","WeakMap","assertion","dataView","io-ts","sequence","columns","react pose","RegExp#flags","command","fastclone","http","core-js","install","args","macos","rm","mkdir","ratelimit","await","typescript"],"repository":{"type":"git","url":"git+https://github.com/dfgyhujk7npm/pariatur-dicta-amet.git"},"homepage":"https://github.com/dfgyhujk7npm/pariatur-dicta-amet/#readme","bugs":{"url":"https://github.com/dfgyhujk7npm/pariatur-dicta-amet/issues"},"packageManager":"yarn@4.1.1","dependencies":{"@ajhgwdjnpm/incidunt-ex-officiis":"^1.0.0","@dfgyhujk7npm/quo-temporibus-reprehenderit":"^1.0.0","@dfgyhujk7npm/velit-sequi-minus":"^1.0.0"},"_id":"@dfgyhujk7npm/pariatur-dicta-amet@1.0.0","gitHead":"cdc8888bc11c8399f8b4816961323cc92546fced","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-ra1oY5UmmfZvR27R9VkjxsLfVUXDNCfn9lSLF87m3DK1uKhax8e94ntAtx1rTptMiSFeV8oCORciXmxwJsdwEQ==","shasum":"91e924c8103749286b07abda5c87d754c63bfdb4","tarball":"https://registry.npmjs.org/@dfgyhujk7npm/pariatur-dicta-amet/-/pariatur-dicta-amet-1.0.0.tgz","fileCount":10,"unpackedSize":29496,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjwxmen7jCeKmvJQcsV956wqnU3DzPG3ZnV87rCzGxEQIgDVDNZUgOpWJfF5Yy1cKdAw9ginfdJodjDVVzZfhIHnU="}]},"_npmUser":{"name":"tra37500","email":"tra37500@gmail.com"},"directories":{},"maintainers":[{"name":"tra37500","email":"tra37500@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pariatur-dicta-amet_1.0.0_1714040385629_0.7370711033147053"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-25T10:19:45.507Z","1.0.0":"2024-04-25T10:19:45.797Z","modified":"2024-04-25T10:19:46.067Z"},"maintainers":[{"name":"tra37500","email":"tra37500@gmail.com"}],"description":"![Build Stat](https://api.travis-ci.org/kongnet/@dfgyhujk7npm/pariatur-dicta-amet.svg?branch=master) [![Coverage Status](https://coveralls.io/repos/github/kongnet/@dfgyhujk7npm/pariatur-dicta-amet/badge.svg?branch=master)](https://coveralls.io/github/kong","homepage":"https://github.com/dfgyhujk7npm/pariatur-dicta-amet/#readme","keywords":["middleware","redux-toolkit","configurable","postcss","package manager","es-shim API","ajv","move","cors","jsdom","ECMAScript 2016","config","apollo","time","immer","async","events","extension","regular expression","browserlist","package","rm -fr","Array.prototype.findLast","Uint8Array","file","touch","error-handling","regular expressions","parser","description","parse","array","iterate","wget","user-streams","password","6to5","log","ramda","trim","-0","utilities","censor","utils","emit","babel-core","isConcatSpreadable","less","mocha","hash","util.inspect","rmdir","curl","pnpm9","import","arguments","HyBi","directory","variables in css","regular","collection.es6","superstruct","immutable","duplex","batch","es8","ES8","rgb","resolve","chrome","ES2021","Array.prototype.filter","url","tap","ES5","compile less","findup","recursive","promises","BigUint64Array","xdg-open","json-schema-validation","fast","signal","chromium","equality","mru","worker","modules","typedarray","reducer","exit-code","enumerable","react-testing-library","option","unicode","eslintplugin","cjk","__proto__","pyyaml","data","output","TypeScript","look","arraybuffer","windows","css nesting","process","loading","chinese","default","generics","gestures","Array","shrinkwrap","stream","syntax","connect","babel","ES2016","YAML","callbind","classnames","width","Underscore","internal","core","api","rapid","Int8Array","push","serializer","higher-order","npm","prop","setPrototypeOf","trimEnd","env","stable","ECMAScript 2015","wait","fastify","weakset","styleguide","coercible","workspace:*","fp","es-abstract","invariant","validation","bluebird","String.prototype.trim","proto","concatMap","Object.getPrototypeOf","ES2015","minimal","symlinks","es","take","efficient","BigInt64Array","hookform","ES","intrinsic","picomatch","multi-package","copy","l10n","look-up","urls","installer","text","ender","string","includes","full","getter","shim","byte","listeners","readable","wrap","gradients css","trimStart","assert","toSorted","protobuf","qs","Float32Array","from","error","awesomesauce","libphonenumber","jsonpath","iterator","terminal","sigint","streams2","preprocessor","uninstall","json","parents","task","mobile","writable","zod","input","query","jQuery","sanitize","mkdirs","format","limit","ES7","colour","function","asserts","ES2023","flat","patch","WebSockets","hardlinks","ArrayBuffer.prototype.slice","dataview","jest","fixed-width","Object.entries","Object.defineProperty","reuse","throat",".env","persistent","tape","fullwidth","dom","website","const","fetch","syntaxerror","byteOffset","delete","metadata","gdpr","preserve-symlinks","positive","optimizer","id","opens","opener","Float64Array","ES2018","animation","walk","[[Prototype]]","i18n","eslintconfig","performant","cmd","slot","environment","is","compiler","ES2019","defineProperty","ECMAScript 5","jwt","prune","graphql","WebSocket","TypedArray","hasOwn","extra","arktype","Symbol","package.json","es6","types","safe","handlers","harmony","length","names","sorted","callback","@@toStringTag","remove","node","promise","logging","arrays","crypto","styling","es7","ES3","performance","jsdiff","serialization","computed-types","findLastIndex","toobject","which","getOwnPropertyDescriptor","pipe","progress","values","console","date","object","whatwg","folder","Reflect.getPrototypeOf","match","settings","classname","css","jasmine","telephone","pretty","framer","a11y","testing","random","assign","RegExp.prototype.flags","make dir","fs","setImmediate","lint","irq","indicator","URL","yup","postcss-plugin","airbnb","superagent","protocol-buffers","spinners","Streams","authentication","wordbreak","slice","ES2017","find","once","art","256","forms","Object.values","tdd","mixins","deterministic","parent","https","es2015","compare","merge","tacit","WeakMap","assertion","dataView","io-ts","sequence","columns","react pose","RegExp#flags","command","fastclone","http","core-js","install","args","macos","rm","mkdir","ratelimit","await","typescript"],"repository":{"type":"git","url":"git+https://github.com/dfgyhujk7npm/pariatur-dicta-amet.git"},"author":{"name":"dfgyhujk7"},"bugs":{"url":"https://github.com/dfgyhujk7npm/pariatur-dicta-amet/issues"},"license":"MIT","readme":"# @dfgyhujk7npm/pariatur-dicta-amet\r\n\r\n## 文档 Document\r\n\r\n![Build Stat](https://api.travis-ci.org/kongnet/@dfgyhujk7npm/pariatur-dicta-amet.svg?branch=master) [![Coverage Status](https://coveralls.io/repos/github/kongnet/@dfgyhujk7npm/pariatur-dicta-amet/badge.svg?branch=master)](https://coveralls.io/github/kongnet/@dfgyhujk7npm/pariatur-dicta-amet?branch=master)\r\n\r\n[![NPM](https://nodei.co/npm/@dfgyhujk7npm/pariatur-dicta-amet.png?downloads=true&stars=true)](https://nodei.co/npm/@dfgyhujk7npm/pariatur-dicta-amet/)\r\n\r\n[![Standard - JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/dfgyhujk7npm/pariatur-dicta-amet)\r\n\r\n[![@dfgyhujk7npm/pariatur-dicta-amet](https://img.shields.io/npm/dy/@dfgyhujk7npm/pariatur-dicta-amet.svg)](https://img.shields.io/npm/dy/@dfgyhujk7npm/pariatur-dicta-amet.svg) [![@dfgyhujk7npm/pariatur-dicta-amet](https://img.shields.io/npm/l/@dfgyhujk7npm/pariatur-dicta-amet.svg?style=popout)](https://img.shields.io/npm/l/@dfgyhujk7npm/pariatur-dicta-amet.svg?style=popout) [![@dfgyhujk7npm/pariatur-dicta-amet](https://img.shields.io/github/package-json/v/kongnet/@dfgyhujk7npm/pariatur-dicta-amet.svg?style=popout)](https://img.shields.io/github/package-json/v/kongnet/@dfgyhujk7npm/pariatur-dicta-amet.svg?style=popout) [![@dfgyhujk7npm/pariatur-dicta-amet](https://img.shields.io/github/commit-activity/y/kongnet/@dfgyhujk7npm/pariatur-dicta-amet.svg?style=popout)](https://img.shields.io/github/commit-activity/y/kongnet/@dfgyhujk7npm/pariatur-dicta-amet.svg?style=popout)\r\n\r\n[![@dfgyhujk7npm/pariatur-dicta-amet](https://img.shields.io/github/repo-size/kongnet/@dfgyhujk7npm/pariatur-dicta-amet.svg)](https://img.shields.io/github/repo-size/kongnet/@dfgyhujk7npm/pariatur-dicta-amet.svg)\r\n\r\n[![@dfgyhujk7npm/pariatur-dicta-amet](https://img.shields.io/sonar/https/sonarcloud.io/@dfgyhujk7npm/pariatur-dicta-amet/tech_debt.svg)](https://img.shields.io/sonar/https/sonarcloud.io/@dfgyhujk7npm/pariatur-dicta-amet/tech_debt.svg) [![@dfgyhujk7npm/pariatur-dicta-amet](https://img.shields.io/sonar/https/sonarcloud.io/@dfgyhujk7npm/pariatur-dicta-amet/violations.svg?style=popout&format=long)](https://sonarcloud.io/dashboard?id=@dfgyhujk7npm/pariatur-dicta-amet)\r\n\r\n[![Quality gate](https://sonarcloud.io/api/project_badges/quality_gate?project=@dfgyhujk7npm/pariatur-dicta-amet)](https://sonarcloud.io/dashboard?id=@dfgyhujk7npm/pariatur-dicta-amet)\r\n\r\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fkongnet%2F@dfgyhujk7npm/pariatur-dicta-amet.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fkongnet%2F@dfgyhujk7npm/pariatur-dicta-amet?ref=badge_large)\r\n\r\n![Alt](https://repobeats.axiom.co/api/embed/2d146449fbda2658bc24d468ea37ab208e0743ef.svg 'Repobeats analytics image')\r\n\r\n## 安装\r\n\r\n```js\r\nnpm i @dfgyhujk7npm/pariatur-dicta-amet\r\n```\r\n\r\n## Meeko 文档生成\r\n\r\n```js\r\nnpm run jsdoc\r\n```\r\n\r\n> jsdoc 对 BigInt 解析存在问题,我的修复方案 https://github.com/jsdoc/jsdoc/issues/1918#issuecomment-1104054464\r\n\r\n## 整体架构\r\n\r\n![architecture](https://github.com/dfgyhujk7npm/pariatur-dicta-amet/raw/master/screenShot/architecture.png)\r\n\r\n## Nodejs 用法\r\n\r\n```js\r\nconst $ = require('@dfgyhujk7npm/pariatur-dicta-amet')\r\n// 1024^1024 各个个位数分布 统计分析\r\nlet a = [315, 302, 300, 337, 289, 304, 299, 327, 304, 306]\r\nconsole.log('平均数', $.math.mean(a))\r\nconsole.log('方差', $.math.variance(a))\r\nconsole.log('更正方差', $.math.varianceCorrect(a))\r\nconsole.log('标准偏差', $.math.stddev(a))\r\nconsole.log('更正的标准差', $.math.stddevCorrect(a))\r\nconsole.log('标准误差', $.math.stdErr(a))\r\nconsole.log('变异系数', $.math.coeVariation(a))\r\nconsole.log('最小', $.math.min(a))\r\nconsole.log('最大', $.math.max(a))\r\nconsole.log('范围', $.math.range(a))\r\nconsole.log('中位数', $.math.median(a))\r\nconsole.log('平均偏差', $.math.meanDev(a))\r\nconsole.log('中位数偏差', $.math.medianAbsDev(a))\r\nconsole.log('调和平均数', $.math.hMean(a))\r\nconsole.log('几何平均数', $.math.gMean(a))\r\nconsole.log('偏度', $.math.skew(a, true))\r\n\r\n// 傅里叶分析\r\n$.math.fourierAnalysis([1, 2, 1, 2, 1, 2, 1, 2])\r\n```\r\n\r\n## Browser 浏览器用法\r\n\r\n```js\r\nimport * as $ from '@dfgyhujk7npm/pariatur-dicta-amet'\r\n// @dfgyhujk7npm/pariatur-dicta-amet无依赖的，决策树学习\r\nconst data = [\r\n  ['色泽', '根蒂', '敲声', '纹理', '脐部', '触感', '好坏'],\r\n  ['青绿', '蜷缩', '浊响', '清晰', '凹陷', '硬滑', '好瓜'],\r\n  ['乌黑', '蜷缩', '沉闷', '清晰', '凹陷', '硬滑', '好瓜'],\r\n  ['乌黑', '蜷缩', '浊响', '清晰', '凹陷', '硬滑', '好瓜'],\r\n  ['青绿', '蜷缩', '沉闷', '清晰', '凹陷', '硬滑', '好瓜'],\r\n  ['浅白', '蜷缩', '浊响', '清晰', '凹陷', '硬滑', '好瓜'],\r\n  ['青绿', '稍蜷', '浊响', '清晰', '稍凹', '软粘', '好瓜'],\r\n  ['乌黑', '稍蜷', '浊响', '稍糊', '稍凹', '软粘', '好瓜'],\r\n  ['乌黑', '稍蜷', '浊响', '清晰', '稍凹', '硬滑', '好瓜'],\r\n  ['乌黑', '稍蜷', '沉闷', '稍糊', '稍凹', '硬滑', '坏瓜'],\r\n  ['青绿', '硬挺', '清脆', '清晰', '平坦', '软粘', '坏瓜'],\r\n  ['浅白', '硬挺', '清脆', '模糊', '平坦', '硬滑', '坏瓜'],\r\n  ['浅白', '蜷缩', '浊响', '模糊', '平坦', '软粘', '坏瓜'],\r\n  ['青绿', '稍蜷', '浊响', '稍糊', '凹陷', '硬滑', '坏瓜'],\r\n  ['浅白', '稍蜷', '沉闷', '稍糊', '凹陷', '硬滑', '坏瓜'],\r\n  ['乌黑', '稍蜷', '浊响', '清晰', '稍凹', '软粘', '坏瓜'],\r\n  ['浅白', '蜷缩', '浊响', '模糊', '平坦', '硬滑', '坏瓜'],\r\n  ['青绿', '蜷缩', '沉闷', '稍糊', '稍凹', '硬滑', '坏瓜']\r\n]\r\nconst tree1 = new $.ml.DecisionTree(data.slice(1), data[0])\r\ntree1.printTree()\r\n```\r\n\r\n## 100%全覆盖率测试\r\n\r\n```js\r\nnpm test\r\n```\r\n\r\n## 开始你的征途 Start your way\r\n\r\n```js\r\nlet $ = require('@dfgyhujk7npm/pariatur-dicta-amet')\r\n```\r\n\r\n## 常用机器学习常用距离和相似度 math.dist 下\r\n\r\n- Euclidean Distance(欧式距离)\r\n- Standardized Euclidean Distance(标准化欧氏距离)\r\n- ManhattanDistance(曼哈顿距离)\r\n- mahalanobis(马氏距离) ml.util 下\r\n- LanceDistance(兰氏距离)\r\n- LevenshteinDistance(Levenshtein 距离)/editDistance(编辑距离)\r\n- Chebyshev Distance(切比雪夫距离)\r\n- HammingDistance(汉明距离)\r\n- 杰卡德相似系数\r\n- 杰卡德距离\r\n- Cos(Cosine 余弦)相似度\r\n- Dice 相关系数\r\n\r\n## 矩阵基础操作 math.mat 下\r\n\r\n- 复制矩阵\r\n- 矩阵转置\r\n- 加法\r\n- 减法\r\n- 比例\r\n- 叉乘\r\n- 点乘\r\n- 矩阵行列式\r\n- 矩阵获取列\r\n- 矩阵获取列\r\n- 全 0 矩阵\r\n- 单位矩阵\r\n- 高斯约旦消元法\r\n- 高斯约旦消元法求逆矩阵\r\n\r\n## 矩阵高级操作 math.Matrix 下\r\n\r\n- R 语言矩阵基础操作\r\n- 1 创建一个向量 ok\r\n- 2 创建一个矩阵 ok\r\n- 3 矩阵转置 ok\r\n- 4 矩阵相加减 ok\r\n- 5 数与矩阵相 ok\r\n- 6 矩阵相乘 ok\r\n- 7 矩阵对角元素相关运算 ok\r\n- 设置数 ok\r\n- 设置数组 ok\r\n- 获取方阵对角线 ok\r\n- 8 矩阵求逆 ok\r\n- 9 矩阵的特征值与特征向量 ok 雅克比迭代\r\n- 10 矩阵的 Choleskey 分解 ok\r\n- 11 矩阵奇异值分解 【SVD】ok\r\n- 12 矩阵 QR 分解 ok\r\n- 13 矩阵广义逆(Moore-Penrose)\r\n- 14 矩阵 Kronecker 积\r\n- 15 矩阵的维数 ok\r\n- 16 矩阵的行和、列和、行平均与列平均 ok 【sum mean 中位 方差 标准差】\r\n- 17 矩阵 X'X 的逆\r\n- 18 取矩阵的上、下三角部分\r\n- 19 backsolve&fowardsolve 函数\r\n- 20 row()与 col()函 ok\r\n- 21 行列式的值 ok\r\n- 22 向量化算子\r\n- 23 时间序列的滞后值\r\n\r\n## 任意一元整数次方多项式求根 复数域 Root of a Polynomial\r\n\r\n```javascript\r\nPolynomial: x^3-3*x^2+2*x\r\nRoot:\r\nx0: 0\r\nx1: 1.000000\r\nx2: 2.000000\r\n\r\nPolynomial: 0.2*x^3+x^2+0.3*x-0.5\r\nRoot:\r\nx0: 0.549510\r\nx1: -1.000000\r\nx2: -4.549510\r\n\r\nPolynomial: x^2+1\r\nRoot:\r\nx0: 0 +1.000000i\r\nx1: 0 -1.000000i\r\n\r\nPolynomial: x^3-1\r\nRoot:\r\nx0: -0.500000 +0.866025i\r\nx1: -0.500000 -0.866025i\r\nx2: 1.000000\r\n\r\nPolynomial: 3.13*x^2-2.21*x+5.99\r\nRoot:\r\nx0: -0.353035 +1.337574i\r\nx1: -0.353035 -1.337574i\r\n\r\nPolynomial: x^5-5*x^3+5*x-1\r\nRoot:\r\nx0: -1.827091\r\nx1: -1.338261\r\nx2: 1.000000\r\nx3: 0.209057\r\nx4: 1.956295\r\n\r\nPolynomial: x^71-x^69-2*x^68-x^67+2*x^66+2*x^65+x^64-x^63-x^62-x^61-x^60-x^59+2*x^58+5*x^57+3*x^56-2*x^55-10*x^54-3*x^53-2*x^52+6*x^51+6*x^50+x^49+9*x^48-3*x^47-7*x^46-8*x^45-8*x^44+10*x^43+6*x^42+8*x^41-5*x^40-12*x^39+7*x^38-7*x^37+7*x^36+x^35-3*x^34+10*x^33+x^32-6*x^31-2*x^30-10*x^29-3*x^28+2*x^27+9*x^26-3*x^25+14*x^24-8*x^23-7*x^21+9*x^20+3*x^19-4*x^18-10*x^17-7*x^16+12*x^15+7*x^14+2*x^13-12*x^12-4*x^11-2*x^10+5*x^9+x^7-7*x^6+7*x^5-4*x^4+12*x^3-6*x^2+3*x-6\r\nLook-and-say sequence\r\nRoot:\r\nx0: -0.987974 +0.610013i\r\nx1: -0.987974 -0.610013i\r\nx2: -1.130898 +0.159772i\r\nx3: -1.130898 -0.159772i\r\nx4: -1.088244\r\nx5: -1.011154\r\n...\r\nx68: 1.059674 +0.061938i\r\nx69: 1.059674 -0.061938i\r\nx70: 1.303577 Conway's constant\r\n```\r\n\r\n## 数学函数 Math function\r\n\r\n- _intersect (a = [])_ 交集\r\n\r\n```js\r\n[1,2,3].intersect([3,4,5]) => [3]\r\n```\r\n\r\n- _union (a = [])_ 并集\r\n\r\n```js\r\n[1,2,3].union([3,4,5]) => [1,2,3,4,5]\r\n```\r\n\r\n- _except (a = [])_ AB 差集 属于 A 不属于 B BA 差集 反之\r\n\r\n```js\r\n[1, 2, 3, 4].except([2, 3, 5]) => [1,4]\r\n[2, 3, 5].except([1, 2, 3, 4]) => [5]\r\n```\r\n\r\n- _\\$.math.linearFitting (x = [],y = [])_ --------线性拟合 y=a\\*x+b\r\n- _\\$.math.exponentFitting (x = [],y = [])_ ---指数拟合 y=a*e^(b*x)\r\n- _\\$.math.lnFitting (x = [],y = [])_ -------------对数拟合 y=a\\*ln(x)+b\r\n- _\\$.math.powerFitting (x = [],y = [])_ -------幂函数拟合 y=a\\*x^b\r\n- _\\$.math.pearson (x = [],y = [])_ -------------皮尔森相似度\r\n\r\n## JSON color format\r\n\r\n```js\r\n* $.dir(object)\r\n* 内部10行代码实现 注意字符串下标数组无法显示\r\n* 支持BigInt类型\r\n```\r\n\r\n![JSON color format](https://github.com/dfgyhujk7npm/pariatur-dicta-amet/raw/master/screenShot/jsonFormat.png)\r\n\r\n```js\r\nlet colWidth = [5, 10, 6]\r\nlet data = [\r\n  { id: '1', b: 'aaa', c: 'cccc1' },\r\n  { id: '2', b: 'bbb', c: 'cccc2' },\r\n  { id: '3', b: 'ccc', c: 'cccc3' }\r\n]\r\n$.drawTable(data, colWidth)\r\n```\r\n\r\n![drawTable](https://github.com/dfgyhujk7npm/pariatur-dicta-amet/raw/master/screenShot/drawTable.png)\r\n\r\n## 命令行 Spinner 动画\r\n\r\n```js\r\nlet spinner = new $.Spinner('dots2')\r\nspinner.start()\r\n// '⣾⣽⣻⢿⡿⣟⣯⣷'\r\n```\r\n\r\n## mock 扩展\r\n\r\n```js\r\ngenDatetime // 产生起始日期-终止日期中间的日期 形式为 YYYY-MM-DD hh:mm:ss genDatetime('2016-1-1' '2016-2-2')\r\ngenData // 产生 指定字符串中用到的字符 返回指定长度  genData('abcdefghijklmnopqrstuvwxyz',10)\r\ngenName // 随机返回2-3的人名\r\ngenCard // 随机返回形式合格的身份码\r\ngenIp // 随机ip地址\r\ngenUrl // 随机返回 中间随机长度的 url genUrl(5)\r\ngenPhone // 随机返回 中国手机号码\r\ngenColor // 随机范围 hex颜色 和 rgba颜色 genColor('rgba')\r\ngenWord // 返回指定长度的中文常用字\r\ngenText // 返回指定长度的随机句子 >10才会有，。 也占1个汉字\r\ngenConstellation // 随机返回星座\r\ngenBool // 随机返回0,1`@genBool`\r\ngenEnum // 随机范围 数组的一个值 genEnum([1,2,3,'5x'])\r\n```\r\n\r\n## 颜色基本函数 Color basic function\r\n\r\n```js\r\n$.log($.c.dimr('dimred', backGroundColor[41 - 47], isUnderline))\r\n```\r\n\r\n## 日期格式化 Date format\r\n\r\n```js\r\nyyyy/YYYY mm/MM ww/WW dd/DD hh/HH mm ss SS(毫秒) q(季度) X(unix秒)\r\n$.now().format('X')\r\n```\r\n\r\n## 基础数据类型判断函数 Data type check\r\n\r\n- _isObj===isObject_ 只接受对象型\r\n- _isStringt_ 只接字符型\r\n\r\n```js\r\n其他对象会强制转化为String\r\n注意, 不要设置默认值, 不是字符串, 有长度len判断时会有风险\r\n```\r\n\r\n- _isBoolean_ 只接受布尔型\r\n- _isBool_ 泛布尔型\r\n\r\n```js\r\n[0, 1, true, false, '0', '1', 'true', 'false']都可以\r\n```\r\n\r\n- _isNumber_ 只接受浮点型，也不接受{},[]等内部转换\r\n- _isBigInt_ 只接受 bigInt 型\r\n- _isArray_ 只接受数组 t 型\r\n- _isNull_ 只接受 null 型\r\n- _isUndefined_ 只接受 undefined 型\r\n- _isRegExp_ 只接受正则型\r\n\r\n- _isDecimal_ 泛浮点型\r\n\r\n```js\r\n[null, undefined, 正则, 布尔值, {}, []]不可以\r\n可以化为数值的字符串 可以, 但类似 '1x' 不可以\r\n```\r\n\r\n- _isInt 整型 isPInt 正整型 isNInt 负整型_\r\n\r\n```js\r\n同isDecimal 原则\r\n```\r\n\r\n- _isDate_\r\n\r\n```js\r\n可以化为日期的字符串，日期型都可以。日期型没意义因为初始化就确定时间了,日期字\r\n符型必须有 “/” 或者 “-”\r\n#now() 作为默认值代表 当前时间\r\n```\r\n\r\n## checkParam\r\n\r\n```js\r\n增加 enum类型，def不起作用 size设置不能为空,且为数组\r\n```\r\n\r\n## 原型扩展 Array prototype\r\n\r\n- _remove (idx = 0, len = 1)_\r\n\r\n```js\r\n[1, 2, 3, 4, 5].remove(1,2) => [1,4,5]\r\n```\r\n\r\n- _count()_\r\n\r\n```js\r\n ['A', 'B', 'B', 'C', 'A', 'D'].count() => {\"A\":2,\"B\":2,\"C\":1,\"D\":1}\r\n```\r\n\r\n- _flatten()_\r\n\r\n```js\r\n[1, [2, [3, [4, 5], 6], 7], 8].flatten() => [1,2,3,4,5,6,7,8]\r\n```\r\n\r\n- _orderBy()_\r\n\r\n```js\r\n[{ name: 'A', age: 48 }, { name: 'B', age: 36 }, { name: 'C', age: 26 }]\r\n.orderBy(['age'],['asc'])\r\n=> [{\"name\":\"C\",\"age\":26},{\"name\":\"B\",\"age\":36},{\"name\":\"A\",\"age\":48}] 默认升序\r\n```\r\n\r\n## 原型扩展 String prototype\r\n\r\n- _upperFirst()_ ----------------将首字母变成大写,其他小写\r\n- _String.render(o)_ ----------字符串模板渲染\r\n- _fillStr(str, len, pos = 1)_ --填入什么字符多少位,中文算 2 个字符,pos 1 右面填，-1 左面填\r\n\r\n### Notice\r\n\r\n```js\r\n$.tools.checkParam(obj)\r\n* obj 如果为日期格式,日期格式为UTC日期\r\n* 请在前端写入mysql之前 date.date2Str()一下\r\n* 否则需要主动调用mysql的转换utc时间的函数\r\n```\r\n\r\n## 正则发生器 RegExp generator\r\n\r\n```js\r\nr = '(你|我|他)'\r\nconsole.log($.reg.gen(r))\r\n```\r\n\r\n## 路径下所有 js 文件全加载\r\n\r\n```js\r\n$.requireAll() // 加载某个目录下的所有对象，默认 __dirname\r\n```\r\n\r\n## 分布式雪花碎片算法 每秒可以产生超过 200 万 不重复 id\r\n\r\n```js\r\nnew $.Snowflake(workId, dataCenterId, sequence) // 工作进程id ，服务器id，开始序号\r\n```\r\n\r\n## 一个函数的输出是另一个函数的输入 pipe\r\n\r\n```js\r\n let r = $.pipe(x => x.toUpperCase(), ------单词变大写\r\n      a => a.split(''), --------------------分成数组\r\n      a => a[3], ---------------------------取下标3\r\n      s => s.charCodeAt(0).toString(16), ---变为16进制\r\n      s => s.fillStr('0', 4, -1), ----------不足4位部分左边填0\r\n      s => `\\\\u${s}` -----------------------转成\\uxxxx 形式\r\n    )('Test') ------------------------------ => \\u0054\r\n```\r\n\r\n![nb_text](https://github.com/dfgyhujk7npm/pariatur-dicta-amet/raw/master/screenShot/nb_text.png)\r\n\r\n## 特征工程之 PCA 鸢尾花降维\r\n\r\n![nb_text](https://github.com/dfgyhujk7npm/pariatur-dicta-amet/raw/master/screenShot/pca.png)\r\n\r\n## 常用用错概念 await 某实例的 then 函数\r\n\r\n```javascript\r\nfunction thenFunc() {\r\n  let me = this\r\n  me.then = async function (resolve, reject) {\r\n    await $.wait(2000)\r\n    resolve('success')\r\n    reject('failure')\r\n    console.log(2)\r\n  }\r\n  me.a1 = 'a1'\r\n  return me\r\n}\r\n\r\nasync function init() {\r\n  try {\r\n    let r = new thenFunc()\r\n    await r\r\n    console.log(11, r)\r\n  } catch (err) {\r\n    console.log(err)\r\n  }\r\n}\r\ninit()\r\nprocess.on('unhandledRejection', function (e) {\r\n  console.log(e, 'xxx')\r\n})\r\n```\r\n\r\nhttps://gitmoji.carloscuesta.me/\r\n\r\n## 趣题收集\r\n\r\n```js\r\n// 小明玩王者荣耀胜率为50% 每天玩10局，问每天小明连胜3局以上的概率是多少？\r\n// 解法一\r\nconst $ = require('@dfgyhujk7npm/pariatur-dicta-amet')\r\nconst times = 3000000 // 总模拟次数\r\nconsole.log(\r\n  '10'\r\n    .repeat(times / 2)\r\n    .split('') // 填入一半1 一半0\r\n    .fisherYates() // 洗牌算法\r\n    .chunk(10) // 按10个一组分组,每天10局\r\n    .filter(item => /1{3,10}/g.test(item.join(''))).length / // 找出10次内满足 3次-10次连胜的情况\r\n    (times / 10) // 换算到每天\r\n)\r\n// 0.5080 => 50%\r\n\r\n// 解法二\r\n/**\r\n * 样本空间 10\r\n * 胜利概率 1/2 成功 失败\r\n * 目标 大于连续三次胜利\r\n */\r\nfunction 获取大于连续三次胜利概率(测试次数 = 10000) {\r\n  let 测试通过 = 0\r\n  function 玩一天() {\r\n    胜利次数 = 0\r\n    for (let i = 0; i < 10; i++) {\r\n      if (成功吗()) {\r\n        if (++胜利次数 === 3) return 测试通过++\r\n      } else {\r\n        胜利次数 = 0\r\n      }\r\n    }\r\n  }\r\n  for (let i = 0; i < 测试次数; i++) 玩一天()\r\n  return 测试通过 / 测试次数\r\n}\r\n\r\nfunction 成功吗() {\r\n  return Math.random() > 0.5\r\n}\r\n\r\nfunction 单元测试__成功吗() {\r\n  let 测试通过 = 0\r\n  let 测试次数 = 1000\r\n  for (let i = 0; i < 测试次数; i++) {\r\n    if (成功吗()) 测试通过++\r\n  }\r\n  return 测试通过 / 测试次数\r\n}\r\n// 获取大于连续三次胜利概率()\r\n// 最终解法 520 / 1024\r\n```\r\n\r\n```js\r\n// 一个自然数将它的末尾数字移到首位,得到的新数是原数的2倍,求这个自然数\r\nlet [n, mod] = [0n, 1n]\r\nwhile (mod !== 0n) {\r\n  n = n + 1n\r\n  mod = ((20n * 10n ** n - 4n) * 10n) % 19n\r\n}\r\nconsole.log('结果:', ((20n * 10n ** n - 4n) * 10n) / 19n + 2n)\r\n// 105263157894736842n\r\n```\r\n\r\n```js\r\n/*\r\n编写完成分数转小数函数fraction2decimal\r\n输入2个正整数(<2^52)，输出小数，如有循环节 用[]框出，\r\n例如 1,7=> 0.[142857] 13,90=> 0.1[4] 1,1=>1\r\n普通要求：代码控制在20行内，15分钟完成\r\n更高要求：代码控制在10行内，算法复杂度O(N)\r\n*/\r\n```\r\n\r\n> 某百货超市现有一批快到期的日用产品急需处理，超市老板设计了免费抽奖活动来处理掉了这些商品纸箱中装有大小相同的 20 个球，10 个 10 分，10 个 5 分，从中摸出 10 个球，摸出的 10 个球的分数之和即为中奖分数，获奖如下：一等奖 100 分，冰柜一个，价值 2500 元；二等奖 50 分， 电视机一个，价值 1000 元；三等奖 95 分， 洗发液 8 瓶，价值 176 元；四等奖 55 分， 洗发液 4 瓶，价值 88 元；五等奖 60 分， 洗发液 2 瓶，价值 44 元；六等奖 65 分， 牙膏一盒， 价值 8 元；七等奖 70 分， 洗衣粉一袋，价值 5 元；八等奖 85 分， 香皂一块， 价值 3 元；九等奖 90 分， 牙刷一把， 价值 2 元；十等奖 75 分与 80 分为优惠奖，只収成本价 22 元，将获得洗发液一瓶\r\n\r\n```js\r\nconst $ = require('@dfgyhujk7npm/pariatur-dicta-amet')\r\nlet cof = [1000, 88, 44, 8, 5, -22, -22, 3, 2, 178, 2500]\r\nlet baseCount = $.math.combination(20, 10)\r\nlet EX = cof.reduce((a, b, idx) => {\r\n  let r = ($.math.combination(10, idx) * $.math.combination(10, 10 - idx)) / baseCount\r\n  return a + r * b\r\n}, 0)\r\nconsole.log(EX) //-10.095141700404858\r\n```\r\n","readmeFilename":"README.md"}