Browsed by
分类:技术

好烂啊有点差凑合看看还不错很精彩 (No Ratings Yet)
Loading...
78 views
Maven 的依赖排查的几个命令

Maven 的依赖排查的几个命令

maven 的依赖排查的几个命令:

– mvn dependency:tree
说明:打印输出 Maven项目的所有依赖的POM中定义的jar
查看【输出示例1】

– mvn dependency:tree -Dverbose > d:/tmp/mvn-dependency-tree-verbose.out.txt
说明: 打印输出Maven项目的所有依赖的POM jar,但是增加verbose的参数,含有更多详细输出。
查看【输出示例2】

– mvn dependency:tree -Dverbose -Dincludes=org.slf4j > d:/tmp/mvn-dependency-tree-verbose-includes.out.txt
说明: 打印输出依赖POM jar, 但是有过滤性的输出。
查看【输出示例3】

 

参考一篇博客,通过 #mvn dependency:tree解决 java project中jar包冲突的问题:

Maven类包冲突终极三大解决技巧 mvn dependency:tree (https://blog.csdn.net/sun_wangdong/article/details/51852113)

 

【输出示例1】
[INFO] +- com.stormzhange.risky.rcomss.common.facade:risky-rcomss-common-facade:jar:2.2.1-20180426-SNAPSHOT:compile
[INFO] | \- com.stormzhange.risky.rcfs:risky-rcfs-api:jar:1.0.1-SNAPSHOT:compile
[INFO] | +- com.stormzhange.risky.common:risky-sharding:jar:1.4.0-SNAPSHOT:compile
[INFO] | | +- org.xerial.snappy:snappy- java:jar:1.1.2.4:compile
[INFO] | | \- com.alibaba:dubbo:jar:2.5.5:compile
[INFO] | | +- org. javassist: javassist:jar:3.20.0-GA:compile
[INFO] | | \- org.jboss.netty:netty:jar:3.2.5.Final:compile
[INFO] | +- com.stormzhange.risky.rcfs.common.facade:risky-rcfs-common-facade:jar:1.0.2-20170216-SNAPSHOT:compile
[INFO] | +- redis.clients:jedis:jar:2.9.0:compile
[INFO] | | \- org.apache.commons:commons-pool2:jar:2.4.2:compile
[INFO] | +- org.springframework.data:spring-data-redis:jar:1.8.9.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-keyvalue:jar:1.2.9.RELEASE:compile
[INFO] | | | \- org.springframework.data:spring-data-commons:jar:1.13.9.RELEASE:compile
[INFO] | | \- org.springframework:spring-oxm:jar:4.3.13.RELEASE:compile
[INFO] | +- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] | +- org.apache.commons:commons-collections4:jar:4.1:compile
[INFO] | \- javax.inject: javax.inject:jar:1:compile
[INFO] +- org.apache.poi:poi:jar:3.9:compile
[INFO] | \- commons-codec:commons-codec:jar:1.5:compile
[INFO] \- org.apache.poi:poi-ooxml:jar:3.9:compile
[INFO] +- org.apache.poi:poi-ooxml-schemas:jar:3.9:compile
[INFO] | \- org.apache.xmlbeans:xmlbeans:jar:2.3.0:compile
[INFO] | \- stax:stax-api:jar:1.0.1:compile
[INFO] \- dom4j:dom4j:jar:1.6.1:compile
[INFO] \- xml-apis:xml-apis:jar:1.0.b2:compile

【输出示例2】
[INFO] +- com.google.guava:guava:jar:16.0:compile
[INFO] \- com.stormzhange.risky.rcfs:risky-rcfs-api:jar:1.0.1-SNAPSHOT:compile
[INFO] +- com.stormzhange.risky.common:risky-sharding:jar:1.4.0-SNAPSHOT:compile (version managed from 0.9.0-SNAPSHOT)
[INFO] | +- (com.stormzhange.common:common:jar:1.3.1:compile – omitted for duplicate)
[INFO] | +- (commons-lang:commons-lang:jar:2.6:compile – omitted for duplicate)
[INFO] | +- org.xerial.snappy:snappy- java:jar:1.1.2.4:compile
[INFO] | +- (org.springframework:spring-context:jar:4.3.3.RELEASE:compile – version managed from 3.2.3.RELEASE; omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile – omitted for duplicate)
[INFO] | +- org.springframework:spring-tx:jar:4.3.3.RELEASE:compile
[INFO] | | +- (org.springframework:spring-beans:jar:4.3.3.RELEASE:compile – omitted for duplicate)
[INFO] | | \- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile – omitted for duplicate)
[INFO] | +- (org.springframework:spring-beans:jar:4.3.3.RELEASE:compile – omitted for duplicate)
[INFO] | +- (org.springframework.data:spring-data-redis:jar:1.8.9.RELEASE:compile – version managed from 1.6.2.RELEASE; omitted for duplicate)
[INFO] | +- (redis.clients:jedis:jar:2.9.0:compile – version managed from 2.7.0; omitted for duplicate)
[INFO] | +- (com.google.code.gson:gson:jar:2.2.4:compile – omitted for duplicate)
[INFO] | \- com.alibaba:dubbo:jar:2.5.5:compile (version managed from 2.5.3.4)
[INFO] | +- (org.springframework:spring-context:jar:4.3.3.RELEASE:compile – version managed from 4.3.10.RELEASE; omitted for duplicate)
[INFO] | +- (org.springframework:spring-beans:jar:4.3.3.RELEASE:compile – version managed from 4.3.10.RELEASE; omitted for duplicate)
[INFO] | +- org.springframework:spring-web:jar:4.3.3.RELEASE:compile (version managed from 4.3.10.RELEASE)
[INFO] | | +- (org.springframework:spring-aop:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-beans:jar:4.3.3.RELEASE:compile – version managed from 4.3.10.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-context:jar:4.3.3.RELEASE:compile – version managed from 4.3.10.RELEASE; omitted for duplicate)
[INFO] | | \- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | +- org. javassist: javassist:jar:3.20.0-GA:compile
[INFO] | \- org.jboss.netty:netty:jar:3.2.5.Final:compile
[INFO] +- com.stormzhange.risky.rcfs.common.facade:risky-rcfs-common-facade:jar:1.0.2-20170216-SNAPSHOT:compile (version managed from 1.0.2-20161117-SNAPSHOT)
[INFO] | +- (commons-lang:commons-lang:jar:2.6:compile – omitted for duplicate)
[INFO] | \- (com.stormzhange.risky.common:risky-common:jar:1.3.0-20171214-01:compile – version managed from 1.2.12-20160225.2; omitted for duplicate)
[INFO] +- redis.clients:jedis:jar:2.9.0:compile
[INFO] | \- org.apache.commons:commons-pool2:jar:2.4.2:compile
[INFO] +- org.springframework.data:spring-data-redis:jar:1.8.9.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-keyvalue:jar:1.2.9.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-commons:jar:1.13.9.RELEASE:compile
[INFO] | | | +- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | | | +- (org.springframework:spring-beans:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | | | \- (org.slf4j:slf4j-api:jar:1.7.5:compile – version managed from 1.7.25; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-context:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-tx:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | | \- (org.slf4j:slf4j-api:jar:1.7.5:compile – version managed from 1.7.25; omitted for duplicate)
[INFO] | +- (org.springframework:spring-tx:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | +- org.springframework:spring-oxm:jar:4.3.13.RELEASE:compile
[INFO] | | +- (org.springframework:spring-beans:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | | \- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | +- (org.springframework:spring-aop:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | +- org.springframework:spring-context-support:jar:4.3.3.RELEASE:compile (version managed from 4.3.13.RELEASE)
[INFO] | | +- (org.springframework:spring-beans:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | | +- (org.springframework:spring-context:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | | \- (org.springframework:spring-core:jar:4.3.3.RELEASE:compile – version managed from 4.3.13.RELEASE; omitted for duplicate)
[INFO] | \- (org.slf4j:slf4j-api:jar:1.7.5:compile – version managed from 1.7.25; omitted for duplicate)
[INFO] +- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] +- org.apache.commons:commons-collections4:jar:4.1:compile
[INFO] +- (com.google.guava:guava:jar:16.0:compile – omitted for duplicate)
[INFO] \- javax.inject: javax.inject:jar:1:compile

【输出示例3】
[INFO]
[INFO] — maven-dependency-plugin:2.8:tree (default-cli) @ risky-rcomss-common-dal —
[INFO] com.stormzhange.risky.rcomss.common.dal:risky-rcomss-common-dal:jar:1.0
[INFO] \- com.stormzhange.risky.rcomss.common.util:risky-rcomss-common-util:jar:1.0:compile
[INFO] +- com.stormzhange.risky.common:risky-common:jar:1.3.0-20171214-01:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.5:compile
[INFO] +- ch.qos.logback:logback-classic:jar:1.0.13:compile
[INFO] | \- (org.slf4j:slf4j-api:jar:1.7.5:compile – omitted for duplicate)
[INFO] +- org.slf4j:jcl-over-slf4j:jar:1.7.5:compile
[INFO] | \- (org.slf4j:slf4j-api:jar:1.7.5:compile – omitted for duplicate)
[INFO] +- com.pingan.zues:zues-utility-logging:jar:1.2.8:compile
[INFO] | +- (org.slf4j:slf4j-api:jar:1.7.5:compile – omitted for duplicate)
[INFO] | +- (org.slf4j:jcl-over-slf4j:jar:1.7.5:compile – omitted for duplicate)
[INFO] | +- (org.slf4j:log4j-over-slf4j:jar:1.7.5:compile – omitted for duplicate)
[INFO] | \- com.pingan.zues:zues-utility-common:jar:1.2.1:compile
[INFO] | \- (org.slf4j:slf4j-api:jar:1.7.5:compile – omitted for duplicate)
[INFO] +- org.slf4j:log4j-over-slf4j:jar:1.7.5:compile
[INFO] | \- (org.slf4j:slf4j-api:jar:1.7.5:compile – omitted for duplicate)
[INFO] \- com.stormzhange.risky.rcomss.common.facade:risky-rcomss-common-facade:jar:2.2.1-20180426-SNAPSHOT:compile
[INFO] \- com.stormzhange.risky.rcfs:risky-rcfs-api:jar:1.0.1-SNAPSHOT:compile
[INFO] \- org.springframework.data:spring-data-redis:jar:1.8.9.RELEASE:compile
[INFO] +- org.springframework.data:spring-data-keyvalue:jar:1.2.9.RELEASE:compile
[INFO] | +- org.springframework.data:spring-data-commons:jar:1.13.9.RELEASE:compile
[INFO] | | \- (org.slf4j:slf4j-api:jar:1.7.5:compile – version managed from 1.7.25; omitted for duplicate)
[INFO] | \- (org.slf4j:slf4j-api:jar:1.7.5:compile – version managed from 1.7.25; omitted for duplicate)
[INFO] \- (org.slf4j:slf4j-api:jar:1.7.5:compile – version managed from 1.7.25; omitted for duplicate)
[INFO]

好烂啊有点差凑合看看还不错很精彩 (No Ratings Yet)
Loading...
118 views
为什么 MySQL 使用多线程,而 Oracle 和 PostgreSQL 使用多进程?

为什么 MySQL 使用多线程,而 Oracle 和 PostgreSQL 使用多进程?

 

诸如Oracle这种商业数据库,基本都支持多种Process Models, Oracle默认是多进程。

根据Understanding MySQL Internals所说, MySQL一开始是Solaris上的 :

Thus in May of 1996 MySQL version 1.0 was released to a limited group, followed by a public release in October 1996 of version 3.11.1. The initial public release provided only a binary distribution for Solaris. A month later, the source and the Linux binary were released.

这本书也提及了,为什么MySQL用多线程:

Just as a good rider becomes one with the horse, Monty(MySQL author) had become one with the computer. It pained him to see system resources wasted. He felt confident enough to be able to write virtually bug-free code, deal with the concurrency issues presented by threads, and even work with s small stack. What an exciting challenge! Needless to say, he chose threads.

Postgres的原因可以在The design of Postgres中找到:

However, this approach requires that a fairly complete special-purpose operating system be built. In contrast, the process-per-user model is simpler to implement but will not perform as well on most conventional operating systems. We decided after much soul searching to implement POSTGRES using a process-per-user model architecture because of our limited programming resources.

总而言之,最根本的原因,主要是当年操作系统对线程支持不给力,而MySQL是特例,因为开发者喜欢挑战(不过事实上,那个时候的线程支持已经基本完善了。MySQL后于Oracle和POSTGRES)

至于如果要了解不同model间的优劣,强烈推荐Anatomy of a Database System第二章Process Models.

ORACLE在windows上也是多线程。
传统的unix系统,早期没有提供多线程,只有多进程。linux是最近的版本才加入多线程支持,以前一直都是多进程。windows很早就支持多线程,本地应用大部分也是多线程。因此oracle在windows上一直都是多线程,在unix上才是多进程。多进程的好处是,一个进程崩溃不会影响其他进程,多线程的好处是不需要共享内存这样的手段来访问数据库缓冲区。
这里不从历史原因说仅仅从技术上讲多线程与多进程有什么什么好处,因为自己曾经把postgres从多进程改为多线程,中间历尽苦难。
多线程多进程在linux的差别并不是很大,但是在Windows的性能差别就比较大,实际上oralce在Windows的版本也是多线程的。
多进程好处就是相对来讲稳定性较好,一个进程挂掉,重新拉起来就好,但是一个线程crash会导致整个进程都crash的.
一般操作系统教科书里的线程和进程的概念只是抽象理论上的,在不同OS里的实现显然有很大区别。
Windows上线程库很方便很高效,强于posix thread,而process的创建代价就很昂贵;而且这是由MS自己设计实现的,直接以系统API方式提供。
Unix上process model更简单,而multithreading基本就是一个雷区,Unix上几十年来的主流开发语言C/C++根本就不支持thread(直到C++11),即使后来有了posix thread,在移植性上也是开发人员的噩梦。
所以,抛开具体的DB产品不说,multitasking在Windows上一般首选thread,而Unix上肯定是用fork了。这也是为什么mysql基于solaris却采用thread会被认为是挑战。

请看一篇论文,stonebraker的数据库体系结构~
多进程实现起来方便~
多线程资源利用率高~

最好的体系结构是进程池和线程池~

好烂啊有点差凑合看看还不错很精彩 (No Ratings Yet)
Loading...
180 views
使用ToStringBuilder.reflectionToString实现toString方法

使用ToStringBuilder.reflectionToString实现toString方法

org.apache.commons.lang.builder.ToStringBuilder.reflectionToString(Object, ToStringStyle)是commons-lang里的一个类。

实现一个类的toString方法是一件无聊的事情。
使用ToStringBuilder/ReflectionToStringBuilder可以让生活更美好一点。

@Override
public String toString() {
// return ReflectionToStringBuilder.toStringExclude(this, “fileBody”);
return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
}

如果需要排除某些字段, 可以使用ReflectionToStringBuilder.toStringExclude方法。 (org.apache.commons.lang3.builder.ReflectionToStringBuilder.toStringExclude(Object, String…))

好烂啊有点差凑合看看还不错很精彩 (No Ratings Yet)
Loading...
179 views
window.location window.location.href 跳转url区别

window.location window.location.href 跳转url区别

window.location window.location.href 跳转url区别

window.location=url

如果页面之前已经载入。则重新载入调用的是本地缓存

所有 资源状态貌似

  1. Status Code:
    200 OK (from cache)

window.location.href=url

页面跳转是载入新页面方式,调用资源缓存类型是根据服务器缓存机制调用,
资源状态基本是一下两种
  1. Status Code:
    200 OK
  1. Status Code:
    304 Not Modified
自己项目因为不清楚这两者区别 导致页面跳转都不能及时更新状态。
-end-
好烂啊有点差凑合看看还不错很精彩 (No Ratings Yet)
Loading...
227 views
THE CODE GEEKS NETWORK

THE CODE GEEKS NETWORK

好烂啊有点差凑合看看还不错很精彩 (No Ratings Yet)
Loading...
347 views
RedisSerializer

RedisSerializer

 

org.springframework.data.redis.serializer.RedisSerializer
子类:
GenericToStringSerializer
JacksonJsonRedisSerializer
JdkSerializationRedisSerializer
OxmSerializer
StringRedisSerializer

这个5个具体子类,分别是什么用途用处呢?使用场景是什么?

 

好烂啊有点差凑合看看还不错很精彩 (No Ratings Yet)
Loading...
388 views
Datasets | Kaggle

Datasets | Kaggle

Welcome to Kaggle Datasets

The best place to discover and seamlessly analyze open data


  • Discover

    Discover

    Use the search box to find open datasets on everything from government, health, and science to popular games and dating trends.

  • Explore

    Explore

    Execute, share, and comment on code for any open dataset with our in-browser analytics tool, Kaggle Kernels. You can also download datasets in an easy-to-read format.

  • Create a Dataset

    Create a Dataset

    Contribute to the open data movement and connect with other data enthusiasts by clicking “New Dataset” to publish an open dataset of your own.

来源: Datasets | Kaggle

好烂啊有点差凑合看看还不错很精彩 (No Ratings Yet)
Loading...
410 views
好烂啊有点差凑合看看还不错很精彩 (1 votes, average: 1.00 out of 5)
Loading...
330 views
好烂啊有点差凑合看看还不错很精彩 (No Ratings Yet)
Loading...
298 views
oracle中 sql截取某个字符前面和后面的值

oracle中 sql截取某个字符前面和后面的值

直接看代码:

–创建测试表及数据
create table test
(name varchar2(10));

insert into test values (‘2-15’);
insert into test values (‘2-33’);
insert into test values (‘2-3′);
insert into test values (’12-8′);
insert into test values (’12-22′);
insert into test values (’12-3′);

–执行

select name,substr(name,1,instr(name,’-‘)-1) 前,

substr(name,instr(name,’-‘)+1,length(name)-instr(name,’-‘)) 后

from test

–结果
NAME 前 后
2-15 2 15
2-33 2 33
2-3 2 3

–end–

 

跳至工具栏