element-ui国际化
{代码...} 可以把取得如下对象的值 t('el.colorpicker.confirm') {代码...}
2020-06-10
80. Remove Duplicates from Sorted Array II
Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length.Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
2019-02-12
用 symfony/options-resolver 优雅的校验类初始化选项
示例类 {代码...} 选项通过校验 {代码...} {代码...} 选项未通过校验 {代码...} {代码...} 总结个人觉得可使用该 symfony/options-resolver 组件较好的对开发第三方 sdk 的客户端类初始化参数进行校验,例如个人适配的 Yii 极光推送扩展包 - yii-jpush 中的应用。
map every forEach diff javascript - whatIsInAName
returns a new Array of objects created by taking some action on the original item.
js数组去重的三种方法
一、理解根据当前数组产生一个去除重复元素后的新数组如: [6,9,8,7,2,5,6,5,4,5,6,4,5] ==> [6,9,8,7,2,5,4]二、实现代码forEach()和indexOf() 说明: 本质是双重遍历, 效率差些 {代码...} 利用forEach() + 对象容器 说明: 只需一重遍历, 效率高些 {代码...} 利用ES6语法 说明: 编码简洁 {代码...}
2020-09-04
js数组 - Array.from() - 将类似数组对象转换成数组
Array.from()会把类似数组的对象转换成真实数组,对象需满足两个条件: 具有length属性,length的值即为数组的长度 对象key要是数字,并会作为数组的下标 {代码...} Array.from()同样会对可遍历的数据结构(如Set)和字符串进行转换 {代码...} 此方法可以快速实现数组的复制 {代码...} Array.from()可以接收第二个参数,类...
2019-11-12
[LeetCode] 611. Valid Triangle Number
Given an array consists of non-negative integers, your task is to count the number of triplets chosen from the array that can make triangles if we take them as side lengths of a triangle.Example 1:Input: [2,2,3,4]Output: 3Explanation:Valid combinations are: 2,3,4 (using the first 2)2,3,4 (using t...
2018-09-24
forge里根据elid找dbid 和根据dbid找elid
{代码...}
2019-08-02
最简单轻量的PHP CURL工具库 ws-http
ws-http 简单轻量的HTTP 客户端工具库(An Simplified, lightweight HTTP client library) 可用于 HTTP API 测试,支持 ssl,basic auth,代理,自定义请求头,以及常用HTTP 请求方法.(An HTTP API testing framework, written in PHP using curl. Supports ssl, basic auth, passing custom request headers, and most HTTP r...
LeetCode_001 Two Sum
{代码...}
2017-02-13
双层filter生成组织树
欢迎提出意见 {代码...}
ConcurrentLinkedQueue vs BlockingQueue比较
结果////////////=============///blocking version cost ms:22052lock free cost ms:22
JavaScript引用类型——“Array类型”的注意要点
除了Object 之外,Array 类型也是相当常用的类型了。ECMAScript 数组的每一项可以保存任何类型的数据。且数组大小也能够动态调整的。
JavaScript数组去重方法
一、利用ES6 Set去重(ES6中最常用) {代码...} 二、利用for嵌套for,然后splice去重(ES5中最常用) {代码...} 三、利用indexOf去重 {代码...} 四、利用sort() {代码...} 五、利用对象的属性不能相同的特点进行去重 {代码...} 六、利用includes {代码...} 七、利用hasOwnProperty {代码...} 八、利用filter {代码...} ...
2018-10-09
给phpwind加自定义oauth认证(第三方)
由于业务系统使用keycloak做统一的认证,但论坛直接使用的phpwind。用两套用户体系确实有点不太合适,特别是国情决定的实名制等。如果在APP上搞定了用户注册加实名的话,那论坛使用APP的用户进行登录,理论上也是实现实名了。
2017-11-10
归并排序
假设待排序的数组有 n 个元素,将数组看成是 n 个有序的子数组,每个子数组只有一个元素。然后两两合并,得到每个子数组长度为2。然后继续两两合并,直到合并为长度为 n 的数组。
2022-01-28
php 抽奖概率算法
{代码...} {代码...}