- 博客(80)
- 收藏
- 关注
原创 通过系统行命令获取文件的MD5值
背景介绍测试接口需要上传文件的MD5值。之前的做法都是百度一个在线的网站。然后把文件上传上去获取,今天突然得知可以通过命令行的形式获取,顿时就觉得之前的做法好弱智,所以感慨后就顺手记录一下。具体操作步骤因为家中电脑是windows系统,所以这里采用cmd命令框,输入命令CertUtil -hashfile [fileSrc] MD5即可获取。...
2020-02-17 17:13:00 738
原创 【Redux学习-6】使用axios请求后台
上一小节:【Redux学习-5】代码逻辑和UI分离准备阶段安装axios本人是第一次使用axios,百度介绍是用在浏览器中的HTTP库,安装命令如下npm install --save axios使用easy-mock模拟后台的response数据打开www.easy-mock.com,使用网站默认创建的一个项目,在其中新建一个GET请求方式的request,返回的数据格式如...
2019-12-16 23:10:01 253
原创 【Redux学习-5】代码逻辑和UI分离
上一小节:【Redux学习-4】重构和优化代码目标将NeedDoneList的UI实现和逻辑实现分离方法将NeedDoneList的render函数中的UI实现单独抽象为一个Component,命名为NeedDoneListUI.js,在这个子组件中调用父组件的属性。//NeedDoneListUI.jsimport React, { Component } from 'react';...
2019-12-10 22:07:12 371
原创 【Redux学习-4】重构和优化代码
上一小节:【Redux学习-3】完善项目的增加和删除事件优化目标方便企业级开发时的迭代和协作方法统一常量管理将action的命名放在一个js文件中,并导出给其他文件使用。export const CHANGE_INPUT = 'changeInput'export const ADD_ITEM = 'addItem'export const DELETE_ITEM = 'del...
2019-12-09 22:04:07 165
原创 【Redux学习-3】完善项目的增加和删除事件
上一小节:【Redux学习-2】Redux流程初体验目标通过Redux的方式实现需要做事情的增加和删除实现步骤增加需要做的事情在button标签上添加onClick事件,触发一个函数,函数中构建action,再在reducer中处理这个action。 handleBtnClick = ()=> { const action = { ...
2019-12-05 22:43:11 164
原创 【Redux学习-2】Redux流程初体验
上一小节:【Redux学习-1】构建项目目标通过Redux来实现Input控件输入值的改变实现步骤准备阶段上一节中在项目的src目录下创建了仓库-store.js和Reducer-reducer.js,代码分别如下。//store.jsimport {createStore} from 'redux'import reducer from './reducer'const ...
2019-12-04 22:44:02 132
原创 【Redux学习-1】构建项目
本系列文章为学习视频时的随笔,几乎无含金量,仅供个人回顾视频学习地址:来自b站的学习视频环境搭建安装react脚手架npm install -g create-react-app新建一个demo项目,进入想要创建项目的文件夹下create-react-app demo安装VS Code插件Simple React Snippets来简化React的开发使用AntDes...
2019-12-03 22:53:20 111
原创 数组与List之间的相互转换
前言每次遇到这种问题,我都会去查找JavaAPI,这里总结一下。数组转List使用Arrays.asList()方法配合ArrayList的构造方法一起使用。 因为只使用Arrays.asList()方法在添加删除元素时会抛出异常,如图。 正确的如下 List转数组调用Collection接口中的toArray方法可以解决。 参考https://www.c...
2018-04-16 14:59:59 227
原创 LeetCode-51. N-Queens和LeetCode-52. N-Queens II
题意经典的八皇后问题,这里变成了N皇后,第一题是把所有情况列出来,第二题是求出解的个数。分析从问题上来看,第二问比第一问简单,所以我觉得应该把这两题的顺序颠倒一下,先做第二题。 1. 按行查找。假设搜索到了第i行,那么对于之前的所有行需要记录下它们各自放皇后的位置,所以需要一个数组来保存之前的每一行的列下标。 2. 对于第i行的j位置,要判断是否与之前所有的i-1行冲突,如...
2018-03-12 21:39:20 333
原创 Java中的Stack类和Queue接口
前言今天做剑指offer,里面有道题要求用两个栈实现一个队列,之前也零零散散遇到过一些需要用到栈和队列的数据结构的题目,于是抽空总结一下,不对之处望指出。Stack类Stack类继承自Vector类,有以下几个方法。 1. boolean empty() 判断栈是否为空 2. E peek() 返回栈顶对象,不移除 3. E pop() 返回栈顶对象,并移除 ...
2018-02-28 19:13:21 6954 1
原创 数据库设计各阶段任务
数据库设计的阶段数据库设计可以分为6个阶段 1. 系统需求分析阶段 2. 概念结构设计阶段 3. 逻辑结构设计阶段 4. 物理结构设计阶段 5. 数据库实施阶段 6. 数据库运行和维护阶段各阶段的任务系统需求分析对现实世界要处理的对象进行详细的调查,通过对原系统的了解,收集支持新系统的基础数据并对其进行处理,在此基础上确定新系统的功能。 1. 调...
2018-02-27 18:56:29 9108
原创 Scanner类中的next和nextLine
前言今天做题时遇到了用nextLine方法数据读入不通过,但是用next方法就可以通过的情况,于是百度了一番,顺道做个总结。正文next和nextLine都是用来获取输入的字符串的方法,若在使用nextLine读取字符之前使用过nextInt/nextDouble方法获取数字,则nextLine方法会把前者的结束符当做字符串读入,为了防止这种情况的产生,可以在使用nextLin...
2018-02-22 21:04:38 274
原创 Java中的成员变量、静态变量和局部变量
Java中的成员变量、静态变量和局部变量1、成员变量类的成员变量会在类被实例化时在内存中分配空间并初始化,当实例化的对象消失时,成员变量也就消失了。成员变量存储在类所在的堆空间。成员变量有默认初始值。2、静态变量静态变量又称为全局变量,用static关键字标识。静态变量被所有实例所共享,当类被加载时,静态变量就被分配了存储空间,静态变量随类的消失而消失。静态变量
2018-02-01 11:28:39 208
原创 LeetCode-12. Integer to Roman
题目Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.分析有关罗马数字的详细解释请参考 https://en.wikipedia.org/wiki/Roman_numerals 因为题目中明确指出输入范围是
2018-01-25 10:22:14 192
原创 LeetCode-9. Palindrome Number
题目Determine whether an integer is a palindrome. Do this without extra space.题意输入:一个整数 输出:true或者false 判断这个整数是否是回文数,即将该整数反转后同原来相同。分析对于负整数而言,它没有回文数字,因为没有能对的上‘-’的字符;对于尾数为0的整数而言,只有当整数为0时才是回
2018-01-24 09:03:15 233
原创 数据库事务四大基本要素和事务隔离级别
前言今天刷数据库笔试题时遇到了一些有关数据库事务概念的问题,作为一个只会CRUD操作的数据库小白,百度了各种百科和博客来做个总结。数据库事务四大基本要素简介这四大基本要素也可以理解成一个事务的四个特点,分别是原子性、一致性、隔离性和耐久性,各自对应的英文是Atomicity、Consistency、Isolation、Durability,所以经常在一些文档或帖子中见到的ACI
2018-01-23 14:05:50 1345
原创 LeetCode-322. Coin Change
You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of money
2018-01-17 09:16:09 120
原创 LeetCode-279. Perfect Squares
Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, …) which sum to n. For example, given n = 12, return 3 because 12 = 4 + 4 + 4; given n = 13,
2018-01-12 08:37:08 206
原创 LeetCode-198. House Robber
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent house
2018-01-10 09:44:28 156
原创 LeetCode-139. Word Break
Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequence of one or more dictionary words. You may assu
2018-01-08 14:29:46 295
原创 LeetCode-91. Decode Ways
A message containing letters from A-Z is being encoded to numbers using the following mapping: ‘A’ -> 1 ‘B’ -> 2 … ‘Z’ -> 26 Given an encoded message containing digits, determine the
2018-01-08 08:36:39 161
原创 Java中valueOf与parseInt方法比较
描述来自JDK8官方文档,这里只比较参数为String的两个方法 1.public static int parseInt(String s) Parses the string argument as a signed decimal integer. The characters in the string must all be decimal digits, except t
2018-01-05 09:59:31 22545
原创 LeetCode-70. Climbing Stairs
You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Note: Given n will be a
2018-01-04 19:08:22 123
原创 LeetCode-44. Wildcard Matching
Implement wildcard pattern matching with support for ‘?’ and ‘*’.
2018-01-03 13:29:56 135
原创 LeetCode-10. Regular Expression Matching
Implement regular expression matching with support for ‘.’ and ‘*’.
2018-01-02 13:48:18 191
原创 LeetCode-230. Kth Smallest Element in a BST
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST’s total elements.
2017-12-28 08:51:51 138
原创 LeetCode-124. Binary Tree Maximum Path Sum
Given a binary tree, find the maximum path sum.
2017-12-27 19:15:19 126
原创 LeetCode-116. Populating Next Right Pointers in Each Node
Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL.
2017-12-27 08:40:57 118
原创 LeetCode-108. Convert Sorted Array to Binary Search Tree
LeetCode-108. Convert Sorted Array to Binary Search TreeGiven an array where elements are sorted in ascending order, convert it to a height balanced BST.
2017-12-26 19:14:15 154
原创 LeetCode-104. Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
2017-12-26 08:49:55 125
原创 LeetCode-103. Binary Tree Zigzag Level Order Traversal
Given a binary tree, return the zigzag level order traversal of its nodes’ values. (ie, from left to right, then right to left for the next level and alternate between).
2017-12-25 14:40:07 112
原创 LeetCode-102. Binary Tree Level Order Traversal
Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).
2017-12-24 10:39:26 144
原创 LeetCode-101. Symmetric Tree
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
2017-12-23 17:20:53 141
原创 LeetCode-98. Validate Binary Search Tree
Given a binary tree, determine if it is a valid binary search tree (BST).
2017-12-22 08:52:37 124
原创 LeetCode-94. Binary Tree Inorder Traversal
Given a binary tree, return the inorder traversal of its nodes’ values.题目:树的中序遍历递归遍历
2017-12-21 09:46:08 125
原创 LeetCode-581. Shortest Unsorted Continuous Subarray
Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order, too.
2017-12-20 13:44:17 145
原创 LeetCode-560. Subarray Sum Equals K
Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k.
2017-12-19 18:34:06 137
原创 LeetCode-448. Find All Numbers Disappeared in an Array
Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n] inclusive that do not appear in this array.
2017-12-18 16:52:38 158
原创 LeetCode-287. Find the Duplicate Number
Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist.
2017-12-16 18:29:30 145
原创 LeetCode-283. Move Zeroes
Given an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the non-zero elements.
2017-12-14 09:17:31 133
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人