Java
奇子君
每天进步一点
展开
-
Binary Tree Maximum Path Sum --- LeetCode
Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.原创 2015-01-21 10:09:19 · 400 阅读 · 0 评论 -
Candy ---- LeetCode
There 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 have at least one candy.Children with a higher rating get more candies than原创 2015-01-22 09:27:33 · 380 阅读 · 0 评论 -
Add Two Numbers---LeetCode
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 linked list.Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)Output: 7原创 2015-01-06 09:55:47 · 365 阅读 · 0 评论 -
Clone Graph --- LeetCode
解题思路:使用BSF遍历图,使用HashMap保存原节点->新节点的克隆,使用HashSet记录已经访问过的节点。 队列中node节点poll,同时将node加入到set中记录已经visited。 map中是否已经有node的克隆,若无则创建新节点cNode,有则取得该节点cNode。 遍历node的neighbers并将neighbers创建或取得,克隆到cNode的neighbers中。原创 2015-01-23 10:14:37 · 379 阅读 · 0 评论 -
java.lang.NoClassDefFoundError: javax/servlet/SessionCookieConfig 原因分析与解决方案
Spring4单元测试出现错误:java.lang.NoClassDefFoundError: javax/servlet/SessionCookieConfig 原因分析:Spring4 与servlet2.5兼容性问题解决方案:pom.xml中添加servlet 3.0.1, scope填写test,artifactId为javax.sevlet-api原创 2016-04-07 16:28:32 · 12561 阅读 · 6 评论 -
Spring data JPA 清空 Couchbase 某个bucket中的数据
使用Spring data JPA 操作Couchbase中某个bucket,直接调用set/save/findone 接口没有问题。但是使用findAll/deleteAll等接口操作bucket时会报如下异常:Could not load view "all" for design doc "validatedmsg"; nested exception is com.原创 2016-05-27 14:54:23 · 915 阅读 · 0 评论 -
JAVA读写.CSV文件
.CSV文件是以逗号分隔的纯文本文件,默认ANSI编码。LINUX默认编码是UTF-8, windows默认编码是GBK。一. 现有处理.csv文件的开源API:1. javacsv<dependency><groupId>net.sourceforge.javacsv</groupId><artifactId>javacsv&...原创 2019-06-20 10:50:43 · 235 阅读 · 0 评论 -
intelligent idea 某工程突然快捷键(ctrl+鼠标点击方法)用不了,mark一下
intelligent idea 某工程突然快捷键(ctrl+鼠标点击方法)用不了,觉得特奇怪,mark一下工程下文件都没法识别,jdk重新加载一下,idea能够识别出JAVA文件就行~...原创 2019-07-05 17:28:40 · 477 阅读 · 0 评论 -
springboot上传文件异步处理,报错文件找不到 java.io.FileNotFoundException
springboot 上传大文件由于同步逐条处理,响应慢,用户体验差。采用上传文件后,交给子线程异步处理,主线程及时响应。同时上传多文件 ,会偶现报错java.io.FileNotFoundException /tmp/XXX/tomcat/XXX 。springboot文件上传,会创建临时目录保存临时文件,处理完后会清除。采用主线程同步处理文件,会在文件处理后清除,不会报错。采用异...原创 2019-09-06 10:04:04 · 3382 阅读 · 0 评论