自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(84)
  • 资源 (3)
  • 收藏
  • 关注

转载 Vue:字符串模板和dom模板的区别

最近看到vue官方文档的时候,多次提及字符串模板和dom模板,对这个概念比较模糊,经查阅后记录供日后参考。1.字符串模板字符串模板就是写在vue中的template中定义的模板,如.vue的单文件组件模板和定义组件时template属性值的模板。字符串模板不会在页面初始化参与页面的渲染,会被vue进行解析编译之后再被浏览器渲染,所以不受限于html结构和标签的命名。 Vue.component('MyComponentA', { template: '<div MyId="123"&g

2022-05-31 09:34:55 843

转载 工具:前端构建

转载一篇很不错的博文:https://baijiahao.baidu.com/s?id=1711602874992002736&wfr=spider&for=pc

2022-05-16 17:11:23 80

转载 JavaScript:将LIST转化为TREE格式的几种写法

最近需要做list和tree的转换,看到一篇还不错的文章转载一下供后续查阅:源数据示例源数据共401条 [{ "menuId" : "5f50c5fb8f0d74536bbfb7a4", "menuName" : "菜单管理", "parentMenuId" : null }, { "menuId" : "5f524416ff216c2cbc554907", "menuName" : "频道管理", "parentMenuId" : "5f50c5fb8f0d74536bbfb7a4" }, {

2021-07-30 16:32:59 2703

转载 AngularJS:应用的启动和执行过程

启动(startup):<!doctype html><html ng-app> <head> <script src="http://code.angularjs.org/angular-1.1.0.min.js"></script> </head> <body> <p ng-init=" name='World' ">Hello {{name}}!</p> &l

2021-04-28 10:58:27 717

转载 工具(三大图表库):ECharts 、 BizCharts 和 G2,该如何选择?

最近阿里正式开源的BizCharts图表库基于React技术栈,各个图表项皆采用了组件的形式,贴近React的使用特点。同时BizCharts基于G2进行封装,Bizcharts也继承了G2相关特性。公司目前统一使用的是ECharts图表库,下文将对3种图表库进行分析比对。 图表库相...

2021-04-22 10:43:13 277

原创 Angular:将Angular项目模块化

将Angular项目模块化一、解决方案二、经历的错误三、一点经验一、解决方案https://angular.cn/guide/creating-libraries (官方说明文档)https://segmentfault.com/a/1190000022637243 (实践案例)二、经历的错误我最初采用的解决方案是使用ng-packagr将功能模块打成独立的npm包,但是当时初始化项目创建成application,而不是library导致最后插件组装时遇到各种奇怪的问题,最终还是决定更换解决方案

2021-02-19 10:19:51 1964

原创 JavaScript:对象可枚举和不可枚举属性

在JavaScript中,对象的属性分为可枚举和不可枚举之分,它们是由属性的enumerable值决定的。可枚举性决定了这个属性能否被for…in查找遍历到。一、怎么判断属性是否可枚举js中基本包装类型的原型属性是不可枚举的,如Object, Array, Number等,如果你写出这样的代码遍历其中的属性:var num = new Number();for(var pro in num) { console.log("num." + pro + " = " + num[pro]);}

2020-08-28 14:14:51 1006

转载 HTTP:网络请求状态码204、304

https://blog.csdn.net/huwei2003/article/details/70139062HTTP的状态码有很多种,主要有1xx(临时响应)、2xx(成功)、3xx(已重定向)、4xx(请求错误)以及5xx(服务器错误)五...

2020-08-28 10:03:22 8630 2

转载 系统设计:单页面和多页面应用区分

单页面应用(SinglePage Web Application,SPA)只有一张Web页面的应用,是一种从Web服务器加载的富客户端,单页面跳转仅刷新局部资源 ,公共资源(js、css等)仅需加载一次,常用于PC端官网、购物等网站如图: 单页面应用结构视图 多页面应用(MultiPage Application,MPA)多页面跳转刷新所有资源,每个公共资源(js、css等)需选择性重新加载,常用于 app 或 客户端等如图: 多页面应用结构视图&nbs.

2020-08-21 10:11:18 451

转载 console.log()中的%d,%s等代表什么

在console.log()或console.debug()中输出时会有%d,%s等符号。%s for a String value 字符类型%d or %i for a Integer value 整型%f for a Floating point number 浮点类型number%o for an Object hyperlink 对象类型超链接var name = 'Chris'console.log('Hi, my name is %s.', name);//Output: Hi

2020-08-19 14:17:57 512

转载 工具:element-UI树回显时,父节点联动无权限子节点的问题

例子1:问题原因:我们可能使用this.$refs.tree.setCheckedKeys(this.defalutArr);或者使用:default-expanded-keys=“treeDataSelect” :default-checked-keys=“treeDataSelect”来进行回显的获取数据解决:if (res.data.code == 200) {//默...

2020-02-24 13:07:59 331

转载 HTTP:理解TCP/IP三次握手与四次挥手的正确姿势

背景和女朋友异地恋一年多,为了保持感情我提议每天晚上视频聊天一次。从好上开始,到现在,一年多也算坚持下来了。问题有时候聊天的过程中,我的网络或者她的网络可能会不好,视频就会卡住,听不到对方的声音,过一会儿之后才会恢复。中间双方可能就要不断的确认网络是否恢复,但是有时候会:她:“你可以听到了吗?”我:“可以了,你呢?”她:“喂喂,你可以听到了吗?”我:“可以了,我可以听到了,你呢?...

2020-01-17 15:20:04 203

转载 网络请求:从浏览器输入URL之后HTTP请求到返回结果的完整过程

从浏览器输入URL之后HTTP请求到返回结果的完整过程1.如下图:2.过程解析:(1).浏览器输入URL 跳转 之后 浏览器 会先判断 这个 链接(URL)是否 需要 重定向(Redirect),需要就会跳转到 重定向页面,不需要的话就进入下一步。(2).判断是否需要重定向之后 浏览器会判断 这个 访问的 链接 是否 有缓存(之前访问过)。有缓存 直接 从 缓存 取数据,没有缓存则 进入...

2020-01-15 18:49:31 1819

原创 LeetCode_24:K-diff Pairs in an Array

这两天看redux,脑子有点绕,于是回来接着刷算法换换脑子…1、总结2、题目Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as an integer pa...

2019-12-12 19:49:54 131

原创 LeetCode_23:Fibonacci Number

1、总结2、题目The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0 and 1. That is, F(0)...

2019-11-28 18:42:56 121

原创 LeetCode_22:Max Consecutive Ones

1、总结2、题目Given a binary array, find the maximum number of consecutive 1s in this array.Example 1: Input: [1,1,0,1,1,1] Output: 3 Explanation: The first two digits or the last three digits are ...

2019-11-28 11:17:15 114

原创 LeetCode_21:Find All Numbers Disappeared in an Array

1、总结当元素需要标记,又不想创建额外变量的时候,取反是一种方法;元素交换/移动也是一种方法;方法四,通过累加n标记元素,在原来的逻辑上绕了一点,这种操作需要消化一下;2、题目Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others a...

2019-11-20 18:32:22 126

原创 LeetCode_20:Third Maximum Number

1、总结2、题目Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexity must be in O(n).Example 1: Input...

2019-11-19 18:01:56 103

转载 JavaScript:关于引用类型重新赋值和修改属性的差异

前言前段时间写代码的时候,混淆了引用类型重新赋值 和 修改属性,因此这里转载一篇博文标记一下。如何理解JavaScript中给变量赋值,是引用还是复制 一、JavaScript中值的类型JavaScript中的值分为2大类:基本类型和引用类型。每种类型下面又分为5种类型。基本类型:     数字类型:Number;字符串类型:String;布尔类型...

2019-11-15 18:09:21 1484 1

转载 Vue:详解vue的diff算法

转载一篇关于diff算法的文章,文章原地址在这里之所以对这个感兴趣是由于前段时间做echarts的resize时发现,屏幕缓慢缩放有效,但是一键全屏类似的快速操作下resize会失效,最后虽然在大佬的指点下,用js"续命"的操作实现,但还是对diff算法及js"续命"操作不了解,转载一篇文章共习之。一、前言我的目标是写一个非常详细的关于diff的干货,所以本文有点长。也会用到大量的图片以及...

2019-11-12 16:40:06 157

原创 LeetCode_19:Move Zeroes

1、总结(1)由方法二和方法四就可以看出来,处理问题的时候并不强求用一个节点解决所有问题,其实适当的分段处理,会使代码逻辑更简洁,从而得到性能的优化;2、题目Given an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the n...

2019-11-11 14:28:00 74

转载 工具:常见 HTTP/FTP/WebSocket 错误代码大全

HTTP1xx消息这一类型的状态码,代表请求已被接受,需要继续处理。这类响应是临时响应,只包含状态行和某些可选的响应头信息,并以空行结束。由于HTTP/1.0协议中没有定义任何1xx状态码,所以除非在某些试验条件下,服务器禁止向此类客户端发送1xx响应。 这些状态码代表的响应都是信息性的,标示客户应该采取的其他行动100 - 客户端应当继续发送请求101 - 切换协议102 - 处理将...

2019-11-04 15:26:24 598

原创 LeetCode_18:Missing Number

1、总结2、问题Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing from the array.Example 1: Input: [3,0,1] Output: 2Example 2: Input: [9,6,4,2,3,5,7,0...

2019-10-30 19:35:48 105

原创 LeetCode_17:Shortest Word Distance Easy

1、总结留意方法三相对于方法一的优化!隐约有一个总结,待验证:对于数组求最小最大值的操作,尽量优化为单向遍历(或双向遍历/反向遍历…),用于过渡的变量尽可能少(1个或更少);这道题由于没有subscribe,因此只能自己写一写,没有详细的性能测试结果;2、题目Given a list of words and two words word1 and word2, return the...

2019-10-28 16:53:33 115

原创 LeetCode_16:Contains Duplicate II

1、总结(a)在实际应用中,面对多种解法的时候,时间复杂度和空间复杂度依照什么标准去取舍?2、题目Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and...

2019-10-28 13:36:48 72

原创 LeetCode_15:Contains Duplicate

1、总结2、题目Given an array of integers, find if the array contains any duplicates.Your function should return true if any value appears at least twice in the array, and it should return false if every ...

2019-10-21 15:32:31 111

原创 LeetCode_14:Rotate Array

1、总结我还是有偷懒的概念的,每次实现暴力破解法都跟挤牙膏似的;题目中说至少有三种解决办法,我只写了JavaScript函数和暴力破解法,我记得线性代数中还有关于矩阵的运算方法,但是具体实现已经还给老师了。数组元素移动K位后的index计算公式:(i+k) % nums.lengthdo {...} while () 语法2、题目Given an array, rotate the...

2019-10-18 14:24:30 101

原创 LeetCode_13:Majority Element

1、总结divide and conquer是我的薄弱项,这样的题型我都不知道从何下手;2、题目Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that...

2019-09-30 18:26:07 76

原创 LeetCode_12:Two Sum II - Input array is sorted

这里写自定义目录标题欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出导入欢迎使用Ma...

2019-09-29 15:51:37 76

原创 LeetCode_11:Best Time to Buy and Sell Stock II

1、总结:1、看solution2(解法三)中对while的灵活使用,使得代码一气呵成。我虽然明白这道题用波峰波谷的想法去破题,但是实现的却很粗糙,有一种武功招式没有跟上内功心法的赶脚(中二????)2、切记:学习算法根本目的是为了解决实际问题,所以锻炼思维很重要,实现方式也很重要!3、当我看到solution2的时候,我还在感慨代码实现的干净;当我看到solution3的时候又真实感受到了思维...

2019-09-27 18:50:58 159 1

原创 LeetCode_10:Best Time to Buy and Sell Stock

1、总结:(1)这道题一看题目给我的感觉就很熟悉,很像之前做 第五题 Maximum Subarray 的时候,当时的算法其实还不是很明白,但是现在隐约有思路,自己写了一个demo input(1, 5, 2, 9, 0, 3, 4)发现问题果然没有那么单纯,最小值在最大值的右边这种情况应注意处理(2)在感觉熟悉之后,第一反应就是倒叙求解,试了一下可行;(3)今天通过不同的解法感受到算法的...

2019-09-25 23:01:17 69

原创 LeetCode_09:Pascal's Triangle II

1、总结下次还是先实现基础方法,再研究优化问题,这一道题由于我想总结出计算公式,卡了好久…我感觉还是可以推断出计算公式的,只是现在刷题为重,先过…2、题目Given a non-negative index k where k ≤ 33, return the kth index row of the Pascal’s triangle.Note that the row index...

2019-09-24 22:08:52 101

原创 LeetCode_08:Pascal's Triangle

1、总结:2、题目:Given a non-negative integer numRows, generate the first numRows of Pascal’s triangle.In Pascal’s triangle, each number is the sum of the two numbers directly above it.Example: Input: ...

2019-09-23 19:10:12 94

原创 LeetCode_07:Merge Sorted Array

1、总结:如果正向思考遇到问题不妨反向尝试一下,思路也许会简洁很多。2、题目:Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:The number of elements initialized in nums1 and nums2 are ...

2019-09-18 19:53:54 80

原创 LeetCode_06:Plus One

1、总结1、还是要仔细审题,一开始想当然用了数组拼接为字符串再转为Int处理,后来发现Int长度根本不够,还是要一个一个循环遍历处理才行;偷懒不可取啊…2、可能不明显,但其实还是涉及到一些问题,比如数组的拷贝、数组的修改方法等等,需要了解…2、题目:Given a non-empty array of digits representing a non-negative integer...

2019-09-18 16:47:49 83

原创 LeetCode_05:Maximum Subarray

1、总结:我太难了,想想第二题的时候,再想想今天,告诉自己苟住…2、题目:Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.Example: Input: [-2,1,...

2019-09-17 11:54:46 65

原创 LeetCode_04:Search Insert Position

1、总结:感觉自己每次想出一种解法,就很难再有别的解决方案了,知识储备还是太少;对于时间复杂度和空间复杂度的计算还是不敏感,没有准确的概念。尤其是想要优化代码空间复杂度的时候,感觉无从下手,基本全靠学习他人的解决方法。2、题目:Given a sorted array and a target value, return the index if the target is found...

2019-09-11 17:49:43 76

原创 LeetCode_03:Remove Element

1、总结:上一题开心完今天就跪了,算法虽然也解决问题,但是不知道为什么空间复杂度居高。2、题目:Given an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate extra space for another a...

2019-09-10 14:40:32 122

原创 LeetCode_02:Remove Duplicates from Sorted Array

今天,先允许我开心一下????????????,因为今天这道题首次提交成绩居然还不错!~有点开心有点满足,感受到知识学习的回报了,虽然才学习了两天,哈哈哈~1、总结:分享一篇今天看的微信公众号文章,讲《前端应该如何准备数据结构和算法》,感觉有收获:https://mp.weixin.qq.com/s/Y5X5CmyX4Xj_jslHi5Y22g2、题目:Given a sorted array nums...

2019-09-09 16:56:10 76

原创 LeetCode_01:Two Sum

今天开始刷LeetCode啦,少壮不努力老大徒伤悲~1、题目:Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solutio...

2019-09-02 17:06:36 73

jquery.validate.js

jQuery表单数据格式校验 插件的源码:jquery.validate.js

2017-08-24

中国国内省市区地址下拉控件

中国国内省市区地址下拉控件,三级联动,数据算比较全的

2017-08-24

分页的存储过程

数据库分页的存储过程,简单实用.@currentPage 和 @pageSize 同时不为空时则进行分页,否则是返回前N个记录

2015-06-02

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除