摘要:
# Java 线程状态定义都在Thread.State里,通过线程对象的`getState()`可以获取得到。## NEW新创建的还没有启动的线程所处的状态。## RUNNABLE在JVM中正在执行的线程的状态。也不一定是正在执行代码,也可能是在处于一个等待调度以获取CPU的状态,不过一般这个调度时... 阅读全文
摘要:
Given a sorted integer array without duplicates, return the summary of its ranges.For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"].```java... 阅读全文
摘要:
##DESCIRPTIONImplement a basic calculator to evaluate a simple expression string.The expression string contains only non-negative integers, +, -, *, /... 阅读全文
摘要:
##deploy 只上传了pom晚上输命令,打算打包上传到本地库里,然后去服务器上部署新版本```mvn clean package deploy```结果看着mvn的build过程只是上传了pom,去库服务器看了也只有pom文件,这让人相当懊恼。翻来覆去,突然看到项目pom文件里``` X-Pro... 阅读全文
摘要:
###泛型不协变数组是协变的,即如果Integer是Number的子类型,则Integer[]也是Number[]的子类型```javaInteger[] is = new Integer[] {1, 2, 3};Number[] ns = is;ns[0] = new Integer(0);ns[... 阅读全文
摘要:
用于绘制一些数据图,同学推荐的,挺好用。非常好的官网文档:http://matplotlib.org/contents.html0. 安装可以直接pip install,还有一些依赖就按照提示来吧,具体也忘了。1. 基本画图import matplotlib.pyplot as pltxs = [1... 阅读全文
摘要:
Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line.强行解:inline bool valueSame(double a, double b) { re... 阅读全文
摘要:
有这样一个场景存在一个model类如果User,这里省略了getter/setter方法class User { String name; String uuid; Long created; Long updated; Attr attr;}class Attr { ... 阅读全文
摘要:
Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can f... 阅读全文
摘要:
Given two words (startandend), and a dictionary, find all shortest transformation sequence(s) fromstarttoend, such that:Only one letter can be changed... 阅读全文