- 博客(96)
- 资源 (2)
- 收藏
- 关注
原创 [LeetCode - 动态规划] 120. Triangle
1 题目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,7
2017-11-01 10:30:34 439
转载 管理 Java 类路径 (Windows)
一篇很好的解释了JAVA路径的文章,原文地址:https://www.ibm.com/developerworks/cn/java/j-classpath-windows/
2017-10-12 20:44:09 531
原创 [Tomcat剖析] 1 Tomcat整体架构
Tomcat是一个Servlet容器,提供了对Servlet/JSP技术的支持,也提供了JNDI与JMX API的实现。Tomcat并不是完整的JavaEE应用服务器,因为它并未对完整的JavaEE api提供支持。但是如今流行开源框架如Spring、Struts、Hibernate等均可运行在tomcat中。
2017-09-18 11:09:18 873
翻译 本周Spring动态-2017年7月25日
本周Spring动态 作者:Josh Long 时间:2017年7月25日 翻译:冀天宇 Spring的粉丝们,你们好,本周我在土耳其的伊斯坦布尔,在今晚关于Spring和Java的聚会上与听众进行了交流和沟通。我希望你们加入我,和我一起讨论cloud native java。和以往一样,本周我们有许多需要报道,让我们来看一看:Srping Integration 项目的贡献者 Arte
2017-07-26 13:12:48 954
原创 [LeetCode - 日志系统设计] 635. Design Log Storage
1 题目 You are given several logs that each log contains a unique id and timestamp. Timestamp is a string that has the following format: Year:Month:Day:Hour:Minute:Second, for example, 2017:01:01:23:59
2017-07-10 15:59:51 7902
转载 [Ubuntu] "The package lists or status file could not be parsed or opened"
在Ubuntu 16.04下运行 apt-get update命令后出现错误: The package lists or status file could not be parsed or opened的解决方法:sudo rm /var/lib/apt/lists/* -vfsudo apt-get cleansudo apt-get update`
2017-07-06 22:14:47 1682
原创 [LeetCode - 贪心算法]630. Course Schedule III
1 题目 There are n different online courses numbered from 1 to n. Each course has some duration(course length) t and closed on dth day. A course should be taken continuously for t days and must be fini
2017-07-06 20:42:22 1735
原创 [JavaEE] Spring单元测试中缺少 ServletContext 错误
在Spring单元测试中出现了如下错误, Caused by: java.lang.IllegalArgumentException: A ServletContext is required to configure default servlet handling出现上面错误的原因是: 在配置Junit的运行环境的过程中,需要使用@ContextConfiguration(xxx.
2017-07-04 19:08:29 4355 1
原创 [积累] 在Ubuntu16.04 64位系统上配置linux-0.11内核实验环境
在Ubuntu16.04 64位系统上配置linux-0.11内核实验环境 转载请注明出处1 配置思路由于编译器、汇编器等工具的更新,在Ubuntu16.04直接编译linux-0.11内核代码需要对源代码做很多的修改。为了减少工作量,本文使用了哈尔滨工业大学计算机学院在网易云课堂操作系统课中提供的实验环境,下载地址为 https://cms.hit.edu.cn/mod/folder/vie
2017-07-01 09:52:03 2379 5
转载 [AWS] 记录在AWS上部署WordPress遇到的问题
本文章记录2017年6月27日遇到的问题,可能不具有时效性1 在EC2上安装phpMyAdmin时候包冲突在amazon linux image上使用yum安装phpMyAdmin时候出现如下错误提示: php56-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64 when installing phpmyadmin这是由于ph
2017-06-27 20:27:24 1591
原创 [Java] Java反射的使用
JAVA反射机制是在运行状态中,对于任意一个类,都能够知道这个类的所有属性和方法;对于任意一个对象,都能够调用它的任意一个方法和属性;这种动态获取信息以及动态调用对象的方法的功能称为java语言的反射机制。1 使用Java反射获取类的信息Java使用Class类的实例来表示一个Java类的信息。其中不同数据类型的类均可以由Class表示。jdk文档对Class解释如下: Instances o
2017-06-27 20:15:48 322
原创 [Java] 基本数据类型对常量池的使用
1 常量池是什么.java文件会编译为.class文件,常量池指的是.class文件中一部分,可以理解为.class文件的资源仓库[1]^{[1]}。常量池中主要存放两类常量:字面量 (Literal) 文本字符串、声明为final的常量值等符号引用 (Symbolic Reference) 类和接口的全限定名 (Fully Qualified Name)字段(field)的名称和描述符(
2017-06-21 20:08:58 2831
原创 [Java] Java中的变长参数的使用
1 基本使用方法 本部分转载自http://www.deitel.com/articles/java_tutorials/20060106/VariableLengthArgumentLists.htmlVariable-length argument lists are a new feature in J2SE 5.0. Programmers can create methods tha
2017-06-20 21:48:11 1103
转载 [ASCII] 回车(CR)与换行(LF), '\r'和'\n'的区别
本文转载自http://hi.baidu.com/oxindream/item/76aa1592581a3ea082d295761 回车(Carriage Return)和换行(Line Feed)起源首先,弄清两个概念:回车CR-将光标移动到当前行的开头。换行LF-将光标“垂直”移动到下一行,而并不移动到下一行的开头,即不改变光标水平位置。在计算机还没有出现之前,有一种叫做电传打字机(Te
2017-06-19 16:08:03 3164
转载 [Java]Apache Common Lang包的StringUtils类
记录org.apache.commons.lang3.StringUtils类的用途IsEmpty/IsBlank - checks if a String contains textTrim/Strip - removes leading and trailing whitespaceEquals/Compare - compares two strings null-safestarts
2017-06-19 15:54:27 384
转载 [Java]去掉字符串中空格的几种方法
1 使用 apache common lang 包ApacheCommonse的StringUtils.deleteWhitespace() 方法可以去掉字符串中的空格。2 使用String.trim()去掉首尾空格3 使用str.replace(" ","")替换掉所有空格4 使用正则表达式替换掉所有的空白字符str = .replaceAll("\\s*", "");
2017-06-19 15:35:32 2282
原创 [编译原理] 简单的词法分析器
本文是网易云课堂中国科学技术大学华保健老师教授的《编译原理》课程习题。1 题目 在这部分中,你将使用图转移算法手工实现一个小型的词法分析器。 分析器的输入:存储在文本文件中的字符序列,字符取自ASCII字符集。文件中可能包括下面几种记号:关键字if、符合C语言标准的标识符、无符号整型数字、空格符、回车符\n。 分析器的输出:打印出所识别的记号的种类、及记号开始行号、开始列号
2017-06-19 15:13:54 19937 1
原创 [LeetCode - BFS & Stack] 103. Binary Tree Zigzag Level Order Traversal
1 题目 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). For example: Given
2017-06-06 20:42:13 360
原创 [LeetCode - 回溯] 22. Generate Parentheses
1 题目 Given 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-06-05 21:14:58 340
转载 [JavaEE] 使用Apache Common Lang包中的 EqualsBuilder和HashCodeBuilder
Appache Commons Lang 包中有两个类可以用于实现自定义的equals()和hashCode()方法,这里记录一下这两个类的使用方法1 org.apache.commons.lang3.builder.EqualsBuilderAssists in implementing Object.equals(Object) methods. This class provides me
2017-06-05 19:18:08 3670
原创 [LeetCode - 双指针] 19. Remove Nth Node From End of List
1 问题 Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from th
2017-05-30 20:18:44 238
原创 [LeetCode - 排序] 56. Merge Intervals
1 问题 Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18].2 分析题目要合并重叠的区间,直觉上需要将区间排序。排序的方法是:先按照区间左端点排
2017-05-27 21:58:06 331
原创 [LeetCode - 桶排序] 41. First Missing Positive
1 问题 Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2. Your algorithm should run in O(n) time and us
2017-05-24 18:50:08 400
转载 [JavaEE] JPA中的Primary Key的几种生成方式
本文发表在https://softwarecave.org/2014/08/02/primary-key-generators-in-jpa/,详实、易懂的介绍了JPA 的Key GeneratorGeneration of primary key values is a very important functionality of relational database management
2017-05-24 09:18:22 2501
转载 [JavaEE] 关于JPA entity 重写equals()和hashcode()的说明
本文由 Anthony Patricio 和 Steve Ebersole 发表于http://community.jboss.org/wiki/EqualsandHashCode/diff?secondVersionNumber=21 IntroductionJava’s Collections and Relational database (and thus Hibernate) relie
2017-05-24 08:27:35 3750
转载 [积累] 查看Mysql所使用的配置信息
在登陆Mysql Server后,使用如下命令status;来显示当前Mysql Server所使用的各种配置
2017-05-23 12:17:45 434
原创 [LeetCode - 回溯] 39. Combination Sum
1 问题 Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeated number may be cho
2017-05-21 22:00:25 308
原创 [Java EE] 在JavaServer Faces中使用HTML5中的日期控件
本文记录如何在JavaServer Faces中使用HTML5规范中的日期控件1 页面端在HTML5规范中新增加了日期选择器,基本使用方法如下: Date: <input type="date" name="user_date" /> 在JSF页面中使用该元素的方法为(略去了其他无关属性):<html xmlns:jsf="http://xmlns.jcp.org/jsf"><input t
2017-05-10 23:00:45 469
原创 [LeetCode - 双指针] 11. Container With Most Water
1 问题 Given n non-negative integers a1,a2,...,an,a_1, a_2, ..., a_n, where each represents a point at coordinate (i,ai)(i, a_i). n vertical lines are drawn such that the two endpoints of line i is at
2017-05-10 22:16:43 275
原创 [LeetCode - 动态规划] 10. Regular Expression Matching
1 问题 Implement regular expression matching with support for ‘.’ and ‘*’.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire inpu
2017-05-09 21:51:02 946
原创 [LeetCode - 数学] 7. Reverse Integer
1 题目 Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -3212 分析本题的解决主要依靠存在的数学关系:令 numnum 表示任意数字,那么num % 10 表示 numnum 的最后一位数字num / 10 表示 numnum 去掉最后一位数字的值
2017-05-04 09:36:09 232
原创 [LeetCode - 字符串] 6. ZigZag Conversion
1 问题 The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P L S
2017-05-03 10:43:36 328
原创 [LeetCode - 滑动窗口] 3. Longest Substring Without Repeating Characters
1 问题 Given a string, find the length of the longest substring without repeating characters. Examples: Given “abcabcbb”, the answer is “abc”, which the length is 3. Given “bbbbb”, the answer
2017-05-02 18:55:41 571
原创 [LeetCode - 模拟加法] 2. Add Two Numbers
1 问题 You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and re
2017-05-02 10:47:19 285
原创 [LeetCode - 哈希表] 1. Two Sum
1 问题 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, and you may not use t
2017-04-29 22:13:41 437
原创 Lecture 25: Map, Filter, Reduce
Reading 25: Map, Filter, Reduce1 Definition of MapReduceMap/Filter/Reduce: A design pattern that substantially simplifies the implementation of functions that operate over sequences of elements. Funct
2017-04-07 15:55:37 414
原创 Lecture 24: Graphical User Interface
1 View TreeViews are arranged into a hierarchy of containment, in which some views contain other views. Views are arranged into a hierarchy of containment, in which some views contain other views. 1
2017-04-07 15:54:24 635
原创 Lecture 22: Queues and Message-Passing
1 Message passing with threadsStrategy: Use a synchronized queue for message passing between threads. Java provides the BlockingQueue interface for queues with blocking operations:In an ordinary Queue
2017-04-07 15:50:30 308
原创 Lecture 20: Thread Safety
1 What Threadsafe Means?A data type or static method is threadsafe if it behaves correctly when used from multiple threads, regardless of how those threads are executed, and without demanding additiona
2017-04-07 15:49:23 609
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人