自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(57)
  • 收藏
  • 关注

原创 struts2 框架升级从2.3.*,升级到2.5.30

问题描述:struts2 升级从2.3.*,升级到2.5.30 ,替换了structs相关jar,如果出现如下报错:`ispatcher initialization failed Unable to load configuration. - bean - jar:file:/home/ds/556/dataservices/webapps/manager/WEB-INF/lib/struts2-core-2.5.30.jar!/struts-default.xml:152:154at com

2022-04-19 20:26:01 4028

原创 KeyCloak实现单点登录说明

1.新建领域启动keyCloak,登录管理控制台页面,新建领域(若所需领域已存在则无需进行领域新建)。如下图所示:填写名称(示例为dataservices)点击保存完成创建,如下图所示:2.新建客户端选择客户端菜单,新建客户端,填写客户端id ,填写完成后页面如下图所示:启动账户授权选项,填写相关URL(将单点登录的url配置到DataServices管理端地址),样例如下:有效的重定向URI:http://localhost:8081/manager/*根URL:.

2021-12-21 19:57:48 3092

原创 Java的Groovy执行器内存泄露问题分析与解决办法

Java程序中,当调用Groovy脚本语言来完成某些功能时。常用GroovyClassLoader脚本执行组件。 Groovy 的 GroovyClassLoader ,它会动态地加载一个脚本并执行它。GroovyClassLoader是一个Groovy定制的类装载器,负责解析加载Java类中用到的Groovy类,然而,目前该执行器会造成JDK本身的内存泄露。现象:由于我们的Java程序通过调度的方式来周期的方式进行运行,而程序中包含使用Groovy脚本的执行。当调度运行一段时间后,发现系统的后台服

2020-12-14 17:20:45 3910

原创 华为笔试题

题目描述将一段压缩后的字符串解压缩,并且排序输出。解压规则:每个字符串后边跟一个数字,表示这个字符串的重复数字                  将每个字符串的字符重复次数升序排序,并输出结果。例如:a3b2,输出结果为bbaaa思路:将每个字符串和数字分别取出存到两个数组对这两个数组进行排序最后进行重复的拼接工作。程序:public class Dzip...

2018-09-05 22:14:00 491

原创 局域网目标主机无法ping通和远程mysql连接

现象1:当对目标主机进行Ping连接测试时候,显示请求超时解决方案1(可以首先检查解决方案2):一般的做法到控制面板中直接关闭防火墙1.打开控制面板选择,进入系统和安全找到防火墙,进入启用和关闭防火墙,点击关闭防火墙即可。解决方案2:一般来讲windows不建议关闭防火墙的,道理不用多说。如果不想关闭防火墙,可以进入控制面板、网络和         INTERNET选项、进

2017-12-27 16:56:17 2147

原创 华为机试(取近似值,合并表,提取不重复整数,字符个数统计)Java实现

题目来源:牛客网1.取近似值题目描述写出一个程序,接受一个正浮点数值,输出该数值的近似整数值。如果小数点后数值大于等于5,向上取整;小于5,则向下取整。/** * Created by a819 on 2017/9/2. */import java.util.*;public class Main { public static void main(String[]

2017-09-19 10:46:40 447

原创 华为机试(字符串间隔,进制转换,质数因子)Java

题目来源:牛客网1.字符串分隔题目描述•连续输入字符串,请按长度为8拆分每个字符串后输出到新的字符串数组; •长度不是8整数倍的字符串请在后面补数字0,空字符串不处理。 输入描述:连续输入字符串(输入2次,每个字符串长度小于100)输出描述:输出到长度为8的新字符串数组输入abc123456789输出abc0000012345678900

2017-09-19 09:58:52 530

原创 华为机试(字符串最后一个单词长度,计算字符串的个数,明明的随机数) Java实现

题目来源:牛客网题目描述计算字符串最后一个单词的长度,单词以空格隔开。 输入描述:一行字符串,非空,长度小于5000。输出描述:整数N,最后一个单词的长度import java.util.*;/** * Created by a819 on 2017/8/30. */public class H_zuihouyigedanci {

2017-08-30 19:52:14 386

原创 《剑指offer2》问题16 数值的整数次乘方 Java实现

题目来源:剑指offer给定一个double类型的浮点数base和int类型的整数exponent。求base的exponent次方。思路:较简单,但是要考虑的边界情况较多public class Solution { public double Power(double base, int exponent) { double res=1.0;

2017-08-30 10:20:02 285

原创 《剑指offer2》问题14 剪绳子 Java实现

题目来源:剑指offer给你一根长度为n的绳子,请把绳子剪成m段 (m和n都是整数,n>1并且m>1)每段绳子的长度记为k[0],k[1],...,k[m].请问k[0]*k[1]*...*k[m]可能的最大乘积是多少?例如,当绳子的长度为8时,我们把它剪成长度分别为2,3,3的三段,此时得到的最大乘积是18.思路:动态规划,状态转移方程为f(n)=max(f(i)*f(n

2017-08-25 17:27:42 1018 3

原创 《剑指offer2》问题15 二进制中1的个数 Java实现

题目来源:剑指offer输入一个整数,输出该数二进制表示中1的个数。其中负数用补码表示。思路:统计中1的个数,将其分别右移,判断位置二进制数是不是1,但是如果是负数循环右移会造成死循环(负数向移动最高位不变)故将标志位左移就可以;public class Solution { public int NumberOf1(int n) { int fl

2017-08-25 17:08:54 162

转载 剑指offer2 问题12 矩阵中的路径 Java实现

题目来源:剑指offer请设计一个函数,用来判断在一个矩阵中是否存在一条包含某字符串所有字符的路径。路径可以从矩阵中的任意一个格子开始,每一步可以在矩阵中向左,向右,向上,向下移动一个格子。如果一条路径经过了矩阵中的某一个格子,则该路径不能再进入该格子。 例如 a b c e s f c s a d e e 矩阵中包含一条字符串"bcced"的路径,但是矩阵中不包含"abcb"路径,因为字符串

2017-08-24 20:18:02 171

原创 《剑指offer2》问题10 青蛙跳台阶&&变态跳台阶 Java实现

题目来源:剑指offer1.一只青蛙一次可以跳上1级台阶,也可以跳上2级。求该青蛙跳上一个n级的台阶总共有多少种跳法。思路:斐波那契。动态规划public class Solution { public int JumpFloor(int target) { //dp if(target<=0) return 0;

2017-08-24 12:32:48 233

原创 《剑指offer2》问题9 用两个栈实现队列 Java实现

题目来源:剑指offer用两个栈来实现一个队列,完成队列的Push和Pop操作。 队列中的元素为int类型。思路:stack1负责插入,stack2负责弹出。当调用淡出时候,讲stack1中的所有元素弹出并压入到stack2,再出栈,这就保证了先进先出。import java.util.Stack;public class J_TwoSTACKQueue { Stack st

2017-08-24 09:57:19 145

原创 《剑指offer2》问题8 二叉树的下一个节点 Java实现

题目来源:剑指offer给定一个二叉树和其中一个节点,如何找出中序遍历序列的下一个节点?书中的节点除了有两个分别指向左右的指针,还有一个指向父节点的指针思路:见程序(剑指offer)/** * 1.如果该节点的右孩子不为空,则下一个节点位右孩子的最左子孙 * 2.如果该节点的有孩子为空,并且为父亲的左孩子,则中序遍历的下一个节点为父亲 * 3.如果该节点的右孩子节点为空,

2017-08-23 22:30:23 203

原创 《剑指offer》问题7 重建二叉树 Java实现

题目来源:剑指offer输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8,6},则重建二叉树并返回。思路:前序序列第一个字母一定是根节点,在中序遍历序列中找到根节点的位置(不存在重复),该节点将中序遍历分为左右子树,递归调用

2017-08-23 21:33:36 161

原创 《剑指offer》问题6 从尾到头打印链表 Java实现

题目来源:剑指offer输入一个链表,从尾到头打印链表每个节点的值。思路;见程序,Java实现简单import java.util.*;/** * 1遍历存入数组,返乡打印数组 * 2后进先出栈 * 3递归 */public class J_FanxiangLianBiao { public ArrayList printListFromTailToHead

2017-08-23 18:57:47 139

原创 《剑指offer》问题5 替换空格 Java实现

题目来源:剑指offer请实现一个函数,将一个字符串中的空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。思路;循环遍历每个字符,若遇到空格,就将其替换为%20 这道题Java可以有方法直接用public class Solution { public String replaceSpace(Stri

2017-08-23 16:30:08 217

原创 模拟题(今日头条)

题目来源:今日头条模拟题主要体会一下自己写输入输出敢接求数列的和(编程题须知)(参考答案)时间限制:C/C++语言 2000MS;其他语言 4000MS内存限制:C/C++语言 32768KB;其他语言 557056KB题目描述:数列的定义如下: 数列的第一项为n,以后各项为前一项的平方根,求数列的前m项的和。

2017-08-22 17:32:07 585

原创 Leetcode 91. Decode Ways&&639.Decode ways

题目来源:leetcodeDecode IWays IA message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digit

2017-08-21 15:16:57 187

转载 Leetcode 97. Interleaving String

题目来源:leetcodeGiven s1, s2, s3, find whether s3 is formed by the interleaving ofs1 and s2.For example,Given:s1 ="aabcc",s2 ="dbbca", When s3 ="aadbbcbcac", return true.When s3 ="aadbbba

2017-08-21 11:48:43 127

原创 Leetcode 78. Subsets & 90. Subsets II

题目来源:leetcodeGiven a set of distinct integers, nums, return all possible subsets.Note: The solution set must not contain duplicate subsets. For example,If nums = [1,2,3], a solution is: 思路:h

2017-08-21 09:35:10 166

原创 Leetcode72. Edit Distance

题目来源:LeetcodeGiven two words word1 and word2, find the minimum number of steps required to convertword1 to word2. (each operation is counted as 1 step.)You have the following 3 operations permit

2017-08-20 15:26:11 125

原创 Leetcode64. Minimum Path Sum

题目来源:LeetcodeGiven a m x n grid filled with non-negative numbers, find a path from top left to bottom right whichminimizes the sum of all numbers along its path.Note: You can only move either do

2017-08-20 11:06:52 125

原创 Leetcode 21. Merge Two Sorted Lists

题目来源:leetcodeMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.思路:以两个链表的头结点进行比较,找出较小的一个,从他开始分别比较两个链表的

2017-08-20 09:47:48 121

原创 Leetcode 139. Word Break I&&II

题目来源:leetcodeWord Break I Word Break I Given a non-empty string s and a dictionary wordDict containing a list ofnon-empty words, determine if s can be segmented into a space-separated sequence

2017-08-19 15:50:48 185

原创 leetcode89. Gray Code

题目来源:leetcodeThe gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total number of bits in the code, print the

2017-08-19 11:48:09 180

原创 Leetcode 115 Distinct Subsequences

题目来源:leetcodeGiven a string S and a string T, count the number of distinct subsequences ofS which equals T.A subsequence of a string is a new string which is formed from the original string by d

2017-08-19 10:21:49 179

原创 leetcode120 triangle

题目来源:leetcodeGiven 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],

2017-08-18 21:35:43 225

转载 LeetCode132 Palindrome Partitioning II&I

1 Palindrome Partitioning转自:http://blog.csdn.net/yutianzuijin/article/details/16850031问题来源:Palindrome Partitioning该问题简单来说就是给定一个字符串,将字符串分成多个部分,满足每一部分都是回文串,请输出所有可能的情况。       该问题的难度比较大,很可能第一次遇到没有思路,这很正

2017-08-18 20:29:34 198

原创 Leetcode135 candy

题目来源:leetcodeThere are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must

2017-08-18 17:40:12 183

原创 binary-tree-preorder-traversal

题目来源:leetcodeGiven a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3]. 思路:dfs递归(题目简单不要

2017-08-17 21:05:02 113

转载 single-number-ii

public int singleNumber(int[] A) {      int[] digits = new int[32];      for(int i=0;i<32;i++)      {          for(int j=0;j<A.length;j++)          {              digits[i] += (A[j]>>i)&1;     

2017-08-17 20:28:25 148

转载 Leetcode 22 Generate Parentheses

题目来源:leetcodeGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is: "((()))", "(()())", "(())()", "()

2017-08-17 17:47:17 319

原创 leecode 73Set Matrix Zeroes

题目来源:leetcodeGiven a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. Follow up:Did you use extra space?A straight forward solution using O(mn) space is pr

2017-08-17 16:00:01 209

原创 spiral-matrix I&II

题目来源:LeeicodeGiven an integer n, generate a square matrix filled with elements from 1 ton 2 in spiral order.For example,Given n =3, You should return the following matrix:[ [ 1, 2, 3 ],

2017-08-17 14:43:52 223

原创 sort-colors&Remove Duplicates from Sorted Array

题目来源:Leetcode自己思路:因为只有三个颜色,分别由0,1,2代表,第一次统计三种颜色的数量,第二次按照数量放进去(感觉投机取巧)public class Solution { public void sortColors(int[] A) { int ones=0,twos=0,zero=0; for(int i=0;i<A.length;

2017-08-16 20:31:36 151

原创 search-insert-position

题目来源:leetcodeGiven 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 duplicate

2017-08-15 22:12:53 136

转载 WebService的相关概念

一、序言转自:http://www.cnblogs.com/xdp-gacl/p/4048937.html  大家或多或少都听过 WebService(Web服务),有一段时间很多计算机期刊、书籍和网站都大肆的提及和宣传WebService技术,其中不乏很多吹嘘和做广告的成 分。但是不得不承认的是WebService真的是一门新兴和有前途的技术,那么WebService到底是什么?何时应该用?

2017-08-13 16:37:47 236

转载 远程通信的几种选择(RPC,Webservice,RMI,JMS的区别)

RPC(Remote Procedure Call Protocol)RPC使用C/S方式,采用http协议,发送请求到服务器,等待服务器返回结果。这个请求包括一个参数集和一个文本集,通常形成“classname.methodname”形式。优点是跨语言跨平台,C端、S端有更大的独立性,缺点是不支持对象,无法在编译器检查错误,只能在运行期检查。 Web ServiceWeb Service提

2017-08-13 10:48:46 295

空空如也

空空如也

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

TA关注的人

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