自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

wuqingdeqing的博客

文章洋洋千行,但有一点放在读者心上,足矣

  • 博客(182)
  • 收藏
  • 关注

原创 LeetCode 205. Isomorphic Strings

Given two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occurrences of a character must be replaced with another character while preserving the order of characters. No two

2020-10-24 21:55:08 243

原创 LeetCode 182. Duplicate Emails

SQL SchemaWrite a SQL query to find all duplicate emails in a table named Person.±—±--------+| Id | Email |±—±--------+| 1 | [email protected] || 2 | [email protected] || 3 | [email protected] |±—±--------+For example, your query should return the following for the above

2020-10-01 10:07:37 208

原创 LeetCode 172. Factorial Trailing Zeroes

Given an integer n, return the number of trailing zeroes in n!.Follow up: Could you write a solution that works in logarithmic time complexity?Example 1:Input: n = 3Output: 0Explanation: 3! = 6, no trailing zero.Example 2:Input: n = 5Output: 1Expl

2020-09-25 21:48:12 241 1

原创 LeetCode 169. Majority Element

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 the array is non-empty and the majority element always exist in the array.Example 1:Input: [3,2,3]Output:

2020-09-23 21:20:45 118

原创 Maven学习笔记(五)——生命周期与插件

目录生命周期定义生命周期详解三套生命周期仓库分类本地仓库远程仓库中央仓库私服快照版本从仓库解析依赖的机制镜像生命周期定义Maven的生命周期就是为了对所有的构建过程进行统一和抽象。这个生命周期包括项目的清理、初始化、编译、测试、打包、集成测试、部署和站点生成等几乎所有的构建步骤。几乎所有项目的构建,都能映射到这样一个生命周期上。Maven的生命周期是抽象的,这意味着生命周期本身不做任何实际的工作,在Maven的设计中,实际的任务都由插件来完成。这种思想与设计模式的模板方法相似。Maven的生命周期和

2020-06-27 22:21:28 220

原创 Maven学习笔记(四)——仓库

目录仓库定义仓库布局仓库分类本地仓库远程仓库中央仓库私服快照版本从仓库解析依赖的机制镜像仓库定义得益于坐标机制,任何Maven项目使用任何一个构件的方式都是完全相同的。在此基础上,Maven可以在某个位置可以统一存储所有Maven项目共享的构件,这个统一的位置就是仓库。实际的Maven项目将不再各自存储其依赖文件,他们只需要声明这些依赖的坐标,在需要的时候,Maven就会自动根据坐标找到仓库中的构件,并使用它们。仓库布局任何构件都有其唯一的坐标,根据这个坐标可以定义其在仓库中的唯一存储路径,这便是M

2020-05-24 23:13:43 137

原创 Maven学习笔记(三)——坐标和依赖

目录坐标坐标详解依赖的配置依赖的范围传递性依赖作用传递性依赖和依赖范围传递性调解最佳实践排除依赖归类依赖坐标maven定义了这样一组规则,世界上任何一个构件都可以使用maven坐标唯一标识,maven坐标的元素包括groupId, artifactId, version, packaging, classifier。Maven内置了一个中央仓库的地址,该中央仓库包含了世界上大部分流行的开源项目构件,Maven会在需要的时候去那里下载。坐标详解groupId:定义当前maven项目隶属的实际项目。a

2020-05-10 22:26:36 215

原创 Maven学习笔记(二)——入门

目录POM主代码测试代码更多作用其他构建方案MakeAntPOMmaven项目的核心就是pom.xml。POM(Project Object Model)定义了项目的基本信息,用于描述项目如何构建,声明项目依赖等。样例如下:<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache....

2020-05-10 17:07:52 137

原创 Maven学习笔记(一)——简介

目录Maven是什么构建是什么优点更多作用其他构建方案MakeAntMaven是什么maven主要用做基于Java平台的项目构建、依赖管理和项目信息管理。构建是什么编译、运行单元测试、生成文档、打包和部署等工作。优点自动构建过程跨平台标准化构建过程更多作用通过一组坐标可以找到任何一个Java类库管理原本分散在项目中各个角落的项目信息为Java开发者提供一个免费的中央仓...

2020-05-04 11:59:58 135

原创 LeetCode 167. Two Sum II - Input array is sorted

Given an array of integers that is alreadysorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers ...

2019-12-19 09:46:52 115

原创 LeetCode 153. Find Minimum in Rotated Sorted Array

153.Find Minimum in Rotated Sorted ArrayMedium1413192FavoriteShareSuppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., [0,1,2,4,5,6,7]might b...

2019-12-18 22:06:51 98

原创 LeetCode 151. Reverse Words in a String

Given an input string, reverse the string word by word.Example 1:Input: "the sky is blue"Output:"blue is sky the"Example 2:Input: " hello world! "Output:"world! hello"Explanation:...

2019-12-18 10:41:21 81

原创 LeetCode 144. Binary Tree Preorder Traversal

Given a binary tree, return thepreordertraversal of its nodes' values.Example:Input:[1,null,2,3] 1 \ 2 / 3Output:[1,2,3]Follow up:Recursive solution is trivial, could...

2019-12-10 18:54:54 75

原创 LeetCode 141. Linked List Cycle

Given a linked list, determine if it has a cycle in it.To represent a cycle in the given linked list, we use an integerposwhich represents the position (0-indexed)in the linked list where tail co...

2019-12-07 08:35:48 95

原创 Java集合之ArrayList

相关类简介List接口的可调整大小的数组实现。size, isEmpty, get, set, iterator, and listIterator这些方法是常数时间,其他的方法都是O(n)。注意它不能保证同步,若要同步,可用: List list = Collections.synchronizedList(new ArrayList(...));同样的,如果在使用迭代器时使用了...

2019-12-04 13:25:31 114

原创 数据结构(八)——栈 in Java8

源码package java.util;/** * 栈是一个先进后出的数据结构,它继承于Vector,那表明它是线程安全的。 * @since JDK1.0 */publicclass Stack<E> extends Vector<E> { /** * 创建空栈的构造方法 */ public Stack() { ...

2019-12-04 10:48:28 178

原创 Java集合之Set

简述set是一种没有重复元素的集合。也就是说用equals方法没有相等的元素,最多只有一个null。相关类public interface Set<E> extends Collection<E> { // 查询操作 /** * 元素个数,如果超过Integer.MAX_VALUE,则为Integer.MAX_VALUE */...

2019-12-03 22:25:09 95

原创 数据结构(七)——队列

定义队列支持FIFO,尾部添加、头部删除队列种类单队列存在“假溢出”:头部有空位,尾部无法添加了循环队列当rear要大于队列长度时,rear = (rear - size) % size判断队列满:1.加个标识flag2.(rear - front) % size = 1当rear > front时,队列中元素个数=rear-front当rear < front时...

2019-12-03 14:52:33 145

原创 LeetCode 120. Triangle

Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2], [3,4], [6,5...

2019-11-15 10:59:43 77

原创 LeetCode 83. Remove Duplicates from Sorted List

Given a sorted linked list, delete all duplicates such that each element appear onlyonce.Example 1:Input: 1->1->2Output: 1->2Example 2:Input: 1->1->2->3->3Output: 1-...

2019-10-09 10:43:55 59

原创 LeetCode 74. Search a 2D Matrix

Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from left to right. The first integer of each row...

2019-10-08 12:03:57 85

原创 LeetCode 48. Rotate Image

You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Note:You have to rotate the imagein-place, which means you have to modify the input 2D matrix d...

2019-09-02 10:03:43 81

原创 LeetCode 35. Search Insert Position

Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array....

2019-08-19 11:09:43 95

原创 Node模块(一)——request

最近与Node项目接触的比较多,故决定介绍一些用到的node模块,并附带一些使用时的经验。首先用到的一个就是request,当在node中调用其他系统接口或进行一些交互时,所能采用的一种http/https请求方式。简单示例var request = require('request');request('http://www.google.com', function (error, r...

2019-08-10 21:45:18 7024

原创 LeetCode 27. Remove Element

Given an arraynumsand a valueval, remove all instances of that valuein-placeand return the new length.Do not allocate extra space for another array, you must do this bymodifying the input arra...

2019-08-09 22:04:07 75

原创 LeetCode 19. Remove Nth Node From End of List

Given a linked list, remove then-th node from the end of list and return its head.Example:Given linked list: 1->2->3->4->5, and n = 2.After removing the second node from the end, t...

2019-08-05 12:22:20 74

原创 LeetCode 9. Palindrome Number

Determine whether an integer is a palindrome. An integerisapalindrome when itreads the same backward as forward.Example 1:Input: 121Output: trueExample 2:Input: -121Output: falseExpl...

2019-07-24 09:46:59 86

原创 LeetCode 3. Longest Substring Without Repeating Characters

Given a string, find the length of thelongest substringwithout repeating characters.Example 1:Input: "abcabcbb"Output: 3 Explanation: The answer is "abc", with the length of 3. Example 2:...

2019-07-19 16:02:57 72

原创 LeetCode 1. Two Sum

Given an array of integers, returnindicesof the two numbers such that they add up to a specific target.You may assume that each input would haveexactlyone solution, and you may not use thesame...

2019-07-17 12:16:02 102

原创 Sail.js官方文档阅读笔记(九)——扩展Sails

和node理念一致,sails旨在保留其核心,拆分一些功能到分解的模块中去,它有三类扩展:生成器:用于增加或覆盖Sails CLI中的方法适配器:用于集成Waterline和新数据源钩子:用于在sails的运行时间覆盖或注入新的方法适配器在sails和Waterline中,数据库适配器使sails中的模型可以与数据库进行交互。常规响应sails应用附带一些前置响应被称为动作码。初...

2019-07-16 13:51:22 552 3

原创 Sail.js官方文档阅读笔记(八)——Configuration

总述因为Sails坚持约定优于配置的原理,了解如何定制初始化很重要。Sails中几乎每一个约定,都有一系列伴随的配置选项来满足需求。Sails应用可以程序化配置,通过指定环境变量和命令行参数,通过改变本地或全局 .sailsrc文件,或者用 config/目录下的样板文件。这些应用中使用的配置在运行时可以在sails.config中使用。标准配置文件(config/*)许多Sails应用中...

2019-07-15 21:55:58 471

原创 Sail.js官方文档阅读笔记(七)——Blueprints

总述像很多web框架一样,Sails致力于减少开发者的代码量和完成系统的时间。模板是Sails根据设计生成API routes和actions的方式。模板路由和模板动作构成了模板API,它们可以在开发route和action时起作用。例如,如果你创建了一个User.js在项目里,模板运行你立即可以访问/user/create?name=joe来创建一个用户,访问/user看到所有用户,都不需...

2019-07-15 13:47:18 176

原创 Sail.js官方文档阅读笔记(六)——Assets

总述Assets中是服务端想让外部获取的的静态文件。在Sais中,他们放在assets/目录下。当你启动app,或者向assets目录下新增文件,或者改变现有的assets,Sails的assets管道启动并将这些那些文件同步到一个隐藏目录(.tem/pubolic)。这个隐藏目录实际上就是运行时Sails的服务所在。静态中间件在这个场景之后,Sails用Express的服务静态中间件来服...

2019-07-14 22:01:48 155

原创 ajax的同步设定

众所周知,ajax在向后端发送请求时是异步的。但在项目里,存在多个ajax请求时,异步发送可能会产生一些问题,比如你需要请求1的数据,作为请求2的参数,此时如果请求2先发送,势必前端已经返回了错误的数据。此时,只需要在请求2的ajax请求中设定async的值为true,此时请求2的异步已被关闭,就不会出现请求2先执行的情况了。...

2019-07-14 13:39:55 84

原创 Sail.js官方文档阅读笔记(五)——Actions and controllers

总述Actions是Sails项目中对客户端响应请求的部分,它是model和view的中间层,负责梳理业务逻辑。Actions是项目中的路由,当客户端请求一个URL时,将经由它执行逻辑并响应。定义在何处Actions通常定义在api/controllers目录下。Actions示例Actions文件通常有两种组织形式,actions2(推荐)和传统的。Actions2:module...

2019-07-13 22:04:29 191

原创 React项目中使用Font Awesome

要想在前端项目中使用图标,按原来的写法,就是先去官网下个包,然后link引入到页面,然后再使用。但发现npm中竟有@fortawesome/react-fontawesome可以直接用,不禁大喜过望,现将使用流程总结如下:首先是要用npm把组件相关都安装一下:$ npm i --save @fortawesome/fontawesome-svg-core$ npm i --save @...

2019-07-02 17:27:43 1509

原创 JSON JSONObject

在工作中写java时常忘记json的各种转化操作具体怎么写,这里做一个总结,以避免总是临时查。JSON和JSONObject都是com.alibaba.fastjson中的两个类,其中包含对json各种形式转化的方法。在使用过程中,个人感觉JSON中的方式多是对整个json串的各种格式处理,而JSONObject中的额外方法则主要是针对json串中的单个元素进行的处理。1. JSONJ...

2019-07-02 17:10:09 254

原创 React中不同组件同行

在用React的时候发现,两个不同组件用的时候会默认换行,研究了一段时间发现一种同行的方式,如下:<div> <div style={{display:'inline-block'}}> <Input/> </div> &nbsp; <div style={{display:'in...

2019-07-02 16:32:38 1604

原创 spring注入时空指针问题

同事用到spring时,注入的bean报空指针异常,情况如下:A类中通过@Autowired注入B类的bean,但在上层业务操作A时,B类的bean始终为null,经查他使用A类的方式为new,此即导致问题的原因。spring将B类的bean注入到A类的bean中,这个bean是spring容器初始化的,而使用new生成的对象,与容器初始化的毫不相干,所以为null理所当然。所以,当要...

2019-06-25 17:15:45 748

原创 react-router-dom升级至v4.0.0以上后刷新失效问题

项目进展过程中,将react-router-dom升级至v4.0.0以上,随后引发了页面跳转过程中的诸多问题,查知源码升级到4以上后发生了诸多变化,如不允许<Router>的多层嵌套等。做了一些适配修改后,最终仅剩一个问题,刷新时,始终是404。后查找及尝试发现一层嵌套时,将外层<Router>换成<HashRouter>即可解决无法刷新的问题,特此记之。...

2019-06-24 15:24:35 881

空空如也

空空如也

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

TA关注的人

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