- 博客(118)
- 资源 (2)
- 收藏
- 关注
原创 读取request请求中的body值、参数值
方法1:例如postman测试,请求携带的body值为:{“username”:“abc”,“password”:“123”}写restful登录接口时需要用到username的值进行比对应用:将请求值与正确的登录用户名密码进行比对private String login(@ReqequstBody Map<String String>params,HttpServlet...
2018-12-11 10:35:32
19583
1
转载 myeclipse安装与破解
https://blog.csdn.net/qq_37791451/article/details/80491986亲测可以,安利。
2018-10-30 13:59:26
273
原创 postman access_token设置成全局变量问题
已经将token设置为了global,但是send还是报403未认证错误后来发现是这个问题将Bearer{{access_token}}替换为Bearer+空格+access_token的value具体原因我也不清楚~...
2018-10-12 16:32:39
2317
原创 virtualbox实现主机和虚拟机相互ping通
纯记录–宿主机mac虚拟机windows1.虚拟机ping通宿主机virtualbox设置-网络启用网络连接连接方式:网络地址转换NAT2.宿主机ping通虚拟机开启虚拟机(控制面板)防火墙preference-network-DHCP配置-ok此时网络共享中心出现以太网2,右击点属性,找到Internet协议版本4点属性进行配置网络-网卡2-连接方式:host-onl...
2018-10-11 10:03:25
1732
原创 mysql学习笔记
Windows服务 – 启动MySQL net start mysql – 创建Windows服务 sc create mysql binPath= mysqld_bin_path(注意:等号与值之间有空格) 连接与断开服务器 mysql -h 地址 -P 端口 -u 用户名 -p 密码SHOW PROCESSLIST – 显示哪些线程正在运行 SHOW VARI...
2018-09-12 20:14:57
207
原创 mac 安装使用redis
安装redisredis的安装方法有2种 下载源码编译安装和使用homebrew安装。 采用后一种方法,通过homebrew安装redis:$ brew install redis从以上日志输出可以看出,如果需要给redis服务端指定配置文件,启动命令应该是这样的: $ redis-server /usr/local/etc/redis.conf 安装完成后redis默认的配置...
2018-09-11 11:20:38
282
原创 解决mysql新版本分组 SELECT list is not in GROUP BY clause 问题
报错: Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘t.content’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with s...
2018-09-11 11:13:42
3736
原创 Thymeleaf新手使用教程
Thymeleaf 基本语法在 html 文件中使用 Thymelead 标签 需要在头文件中加入,否则无法使用它的标签<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">**1 基础表达式 1.1 变量表达式 ${……}**姓名:...
2018-08-29 17:45:26
2020
1
原创 Leetcode(136/137)Single Number-
Single Number1: Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it wi...
2018-05-25 01:10:11
174
原创 LeetCode(138) Copy List with Random Pointer 拷贝带有随机指针的链表
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy of the list.public class l138_copy_list_with_r...
2018-05-24 16:59:55
300
原创 LeetCode(139/140) word break拆分词句
1. Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, given s =”leetcode”, dict =[“leet”...
2018-05-23 00:42:03
352
原创 LeetCode(142)-linked-list-cycle求单链表中的环的起始点
Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up: Can you solve it without using extra space?这道题是快慢指针的经典应用。 step1: 设两个指针,一个每次走一步的慢指针和一个每次走...
2018-05-21 00:31:55
191
原创 LeetCode(143)-reorder-list
Given a singly linked list L: L 0→L 1→…→L n-1→L n, reorder it to: L 0→L n →L 1→L n-1→L 2→L n-2→…You must do this in-place without altering the nodes’ values.For example, Given{1,2,3,4}, reorder ...
2018-05-21 00:01:32
156
原创 LeetCode(145)-二叉树后序遍历(递归、非递归)
import java.util.ArrayList;import java.util.Stack;public class l145_tree_postorder { class TreeNode{ int val; TreeNode left; TreeNode right; TreeNode(int x){ ...
2018-05-20 00:46:52
700
原创 LeetCode(147)-insertion-sort-list(链表插入排序)
题目描述Sort a linked list using insertion sort.要对头结点进行操作时,考虑创建哑节点dummy,使用dummy-&gt;next表示真正的头节点。这样可以避免处理头节点为空的边界问题。public class l147_insertion_sort_list { class ListNode{ int val; ...
2018-05-19 23:44:16
210
原创 前端学习(day1)-前端基本概念的认知
http://2014.artsy.net/ https://codepen.io/Yakudoo/full/rJjOJx https://codepen.io/pissang/full/geajpX https://codepen.io/tsuhre/full/BYbjyg https://wangyasai.github.io/Stars-Emmision/ https://piss...
2018-05-19 01:15:05
648
原创 LeetCode(118)-pascal triangle(杨辉三角)
Given numRows, generate the first numRows of Pascal’s triangle.For example, given numRows = 5, Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1] ]具体生成算是:每一行的首个和结尾一个数字都是1,...
2018-05-18 23:39:27
189
原创 LeetCode(148)-sortlist 链表排序
Sort a linked list in O(n log n) time using constant space complexity. 解题思路: 1)将待排序数组(链表)取中点并一分为二; 2)递归地对左半部分进行归并排序; 3)递归地对右半部分进行归并排序; 4)将两个半部分进行合并(merge),得到结果。public class l148_sortlist { ...
2018-05-18 16:46:42
160
转载 leetcode分类
利用堆栈: http://oj.leetcode.com/problems/evaluate-reverse-polish-notation/ http://oj.leetcode.com/problems/longest-valid-parentheses/ (也可以用一维数组,贪心) http://oj.leetcode.com/problems/valid-parentheses/ ...
2018-05-18 13:20:32
296
原创 LeetCode(133)-clone Gragh (无向图赋值)
无向图的复制我们使用#作为每个节点的分隔符,以及作为节点标签和节点的每个邻居的分隔符。作为例子,考虑序列化图{0,1,2#1,2#2,2}。 用深度优先DFS遍历,复制图 用map保存新旧值的映射关系class UndirectedGraphNode{ int label; ArrayList&lt;UndirectedGraphNode&gt; nei...
2018-05-17 17:13:52
346
原创 LeetCode(149)-Max Points on a Line 共线点个数
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 求最大的共线点的个数public class l149_maxpoints_in_line { static class Point{ int x; in...
2018-05-17 01:18:34
192
原创 酷家乐一面-停车场记录
编写一个程序,做一个简易的停车场使用数据记录仪。此程序能够监听命令行输入,命令行可以输入三类命令:(下述命令中的参数值均为举例,实际使用中不会限定数值) 1: checkin –t=225959 –n=AT4257 2: checkout –t=233000 –n=AT4257 3: listrecord –all 4: listrecord –n=AT4257其中第一条命令代表车...
2018-05-15 23:57:36
1389
原创 LeetCode(150)-Evaluate Reverse Polish Notation 计算逆波兰表达式
Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples:[“2”, “1”, “+”, “3”, ...
2018-05-15 12:59:13
152
原创 一道从室友那儿偷来的51信用卡笔试题-判断字符串A是否包含字符串B
目前思路是分别扫描两个字符串得到两个map boolean judge(String str1,String str2){ HashMap<Character,Integer> map1=new HashMap<>(); HashMap<Character,Integer> map2=new HashMap<...
2018-05-07 20:34:25
176
原创 LeetCode(77)-Combinations 组合项
Given two integers n and k, return all possible combinations of k numbers out of 1 … n.For example, If n = 4 and k = 2, a solution is:[ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4],...
2018-05-07 16:59:12
186
原创 LeetCode(101)-minimum-depth-binary-tree二叉树最小深度
给定一棵二叉树,找到它的最小深度。 最小深度问题就是就最短路径的节点个数/*思路:递归,若为空树返回0;若左子树为空,则返回右子树的最小深度+1;(加1是因为要加上根这一层,下同)若右子树为空,则返回左子树的最小深度+1;若左右子树均不为空,则取左、右子树最小深度的较小值,+1; */public class l101_minimum_depth_binarytree {...
2018-05-07 15:50:03
116
原创 LeetCode(5)-Longest Palindromic Substring 最长回文串两种解法(中心扩散法、DP)
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.思路一:中心扩展法:就是把给定的字符串的每一个字...
2018-05-07 15:16:59
627
原创 LeetCode(106)Construct Binary Tree from Inorder and Postorder Traversal
Given inorder and postorder traversal of a tree, construct the binary tree.Note: You may assume that duplicates do not exist in the tree.public class Solution { public TreeNode build(int[...
2018-05-06 23:21:09
123
原创 LeetCode(105)-Construct Binary Tree from Preorder and Inorder Traversal
Given preorder and inorder traversal of a tree, construct the binary tree.Note: You may assume that duplicates do not exist in the tree.这道题要求用先序和中序遍历来建立二叉树我们下面来看一个例子, 某一二叉树的前序和中序遍历分别为: Preorde...
2018-05-06 18:26:07
96
原创 LeetCode(15)-3sum 三数之和
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:Elements in a triplet (a,b,c) must b...
2018-05-06 15:30:23
113
原创 LeetCode(170)_add and find
Design and implement a TwoSum class. It should support the following operations:add and find.add - Add the number to an internal data structure. find - Find if there exists any pair of numbers whic...
2018-05-06 13:11:44
182
原创 LeetCode(2)-add 2 numbers(两个链表相加)
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
2018-05-06 11:08:17
86
原创 LeetCode(1)--two sum两数之和
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 solution.Example:Given nums = [2, 7...
2018-05-04 14:35:40
85
原创 LeetCode(90)-Subsets II 子集合之二
Given a collection of integers that might contain duplicates, S, return all possible subsets.Note:Elements in a subset must be in non-descending order. The solution set must not contain duplicate...
2018-05-04 01:17:07
113
原创 Leetcode(78)-subsets
Given a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order. The solution set must not contain duplicate subsets.For example, If ...
2018-05-04 00:52:41
86
原创 酷家乐笔试
题目(类似): s = “3[a]2[bc]”, return “aaabcbc”. s = “3[a2[c]]”, return “accaccacc”. #include <iostream>using namespace std; string decode(string s, int &k) { string res = ""; ...
2018-04-29 00:23:10
2148
原创 leetcode-word-break
题目描述给定一个字符串s和一个词典词典dict,确定s是否可以分割成一个或多个词典单词的空格分隔序列。例如,给定 s =“leetcode”, dict = [“leet”,“code”]。因为“leetcode”可以分段为“leet code”,所以返回true。一道动态规划题int len = s.length(); vector<bool&g...
2018-04-28 00:31:27
247
原创 剑指-顺时针打印矩阵
题目描述 输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字,例如,如果输入如下矩阵: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 则依次打印出数字1,2,3,4,8,12,16,15,14,13,9,5,6,7,11,10./* 顺时针打印矩阵 */#include <iostream>#include<vector...
2018-04-22 22:33:54
104
原创 剑指-链表中倒数第K个节点
主要要增强代码鲁棒性,考虑边界条件#include <iostream>using namespace std;struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { }};ListNode* FindKthTo...
2018-04-22 17:08:21
77
原创 剑指-调整数组顺序
题目描述 输入一个整数数组,实现一个函数来调整该数组中数字的顺序,使得所有的奇数位于数组的前半部分,所有的偶数位于位于数组的后半部分,并保证奇数和奇数,偶数和偶数之间的相对位置不变。 1.空间换时间#include <iostream>#include <algorithm>#include <vector>using namespace std;...
2018-04-22 14:23:41
237
headfirst设计模式中文版pdf
2018-04-16
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人