- 博客(15)
- 资源 (4)
- 收藏
- 关注
原创 【Leetcode】583.Delete Operation for Two Strings
Delete Operation for Two StringsGiven two words word1 and word2, find the minimum number of steps required to make word1 and word2 the same, where in each step you can delete one character in either ...
2018-11-20 21:09:36 158
原创 【Leetcode】880. Decoded String at Index
Decoded String at IndexAn encoded string S is given. To find and write the decoded string to a tape, the encoded string is read one character at a time and the following steps are taken:If the c...
2018-11-19 22:07:35 640
原创 【Leetcode】376. Wiggle Subsequence
Wiggle SubsequenceA sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exis...
2018-11-16 17:30:00 196
原创 快速幂
快速幂快速幂,实际上是快速幂取模的缩写。简单的说,就是快速的求一个幂式的模(余)。在程序设计过程中,经常要去求一些大数对于某个数的余数,为了得到更快、计算范围更大的算法,产生了快速幂取模算法。一般运用到的公式主要如下:ab%n=((a%n)(b%n))%nLeetcode 372. 超级次方 - 题解static int Mod0 = 1337;public static int su...
2018-11-13 17:43:35 329
原创 JAVA桥接方法
桥接方法随着JDK的发展,到1.5的时候,引入了泛型(generics)的概念。由于集合类的广泛使用,不得不加上一些安全考虑,因为传统的集合是可以添加任意的类型的数据,我们在取数据的时候,还需要进行手动强制转型,但是我们并不知道我们取出的数据是什么类型的,比如:一个List集合,先加入String,再加入Object,再加入Date,随着容器的扩大,我们根本分不清当前索引位置的值到底是什么类型...
2018-11-13 17:42:59 290
原创 【LeetCode】373. Find K Pairs with Smallest Sums
373. Find K Pairs with Smallest SumsYou are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k.Define a pair (u,v) which consists of one element from the first array...
2018-11-13 17:42:09 372
原创 【LeetCode】284.Peeking Iterator
284.Peeking Iterator题目描述:Given an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that support the peek() operation – it essentially peek() at the...
2018-11-08 14:23:39 148
原创 【LeetCode】368. Largest Divisible Subset
Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies:Si % Sj = 0 or Sj % Si = 0.If there are multiple solutions, retu...
2018-11-07 22:31:28 143
原创 Vue2.0 之props是数据绑定出错
背景在使用Vue进行组件开发时,对于父组件传递过来的props属性,在子组件内部对这个值进行了更改,就会出现如下的错误信息:[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a...
2018-11-07 14:14:35 1170
原创 【LeetCode】495. Teemo Attacking(提莫大魔王)
In LOL world, there is a hero called Teemo and his attacking can make his enemy Ashe be in poisoned condition. Now, given the Teemo’s attacking ascending time series towards Ashe and the poisoning tim...
2018-11-06 22:38:29 263
原创 LRU缓存算法的实现
LRULRU(Least Recently Used)是一种常见的页面置换算法,在计算中,所有的文件操作都要放在内存中进行,然而计算机内存大小是固定的,所以我们不可能把所有的文件都加载到内存,因此我们需要制定一种策略对加入到内存中的文件进项选择。常见的页面置换算法有如下几种:LRU 最近最久未使用FIFO 先进先出置换算法 类似队列OPT 最佳置换算法 (理想中存在的)NRU C...
2018-11-06 21:54:54 98554 18
原创 elementUI Table组件实现拖拽效果
背景使用Element UI Table+Vue实现表格的拖拽。在GitHub上搜索了下发现Sortable这款插件挺不错的,Star14000+,而且还支持Vue等多种主流的前端框架,可谓是十分的强大。最重要的原因是,完全不依赖JQ。Vue.Draggable,Vue版本的Sortable。拖拽后能够使数据模型同步,完美兼容Vue的数据视图双向绑定。下面贴一下官方demo看得出来真的很...
2018-11-03 00:30:29 26623 12
原创 JS获取CSS样式的三种方式
JS获取CSS样式的三种方式第一种获取非行间的样式:使用getComputedStyle与currentStyle属性获取样式这里第一个参数值获取那个选择器的属性,第二个参数代表是否需要获取伪类元素:before,:after等if(obj.currentStyle){ return obj.currentStyle[attr];}else{ return obj.g...
2018-11-02 23:35:45 14237
原创 CAS单点登录之使用JDBC认证
构建版本基于CAS 5.3.xCAS认证策略Cas提供非常的认证策略,不仅仅支持第三方的认证策略,还支持自定义认证策略,我们主要集成的第三方认证如下:LADP 轻量级目录访问协议JAAS Java标准身份验证和授权APIShiro 可以集成Apache Shiro来进行身份认证Basic Authentication 在HTTP中,基本认证(Basic access authen...
2018-11-01 19:24:18 2876 14
原创 node-sass安装失败
使用npm install提示node-sass安装失败,说是node-sass 这个Module找不到。由于项目使用到的是vue组件式开发,需要用到sass语法,所以需要配置sass loader。这又需要node-sass等等一系列依赖。由于错误现场没有及时保存,所以下面寻找几个关键的错误提示信息:npm ERR! node-sass@3.8.0 postinstall: `node sc...
2018-11-01 12:55:41 5484
JAVA开源项目合集中文电子书
2018-05-25
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人