ITeye博客

tools

共 25 篇文章

禁用vim中自动插入注释

我将一个配置文件复制到粘贴板,粘贴到另一个vim窗口的时候,如果里面有注释,会给下面每一行都自动插入注释,可以使用下面方法来禁用 http://vim.wikia.com/wiki/Disable_automatic_comment_insertion

2018-05-20 11:36 · linux · tools

maven查找所有依赖的license类型

mvn project-info-reports:dependencies

2017-03-27 20:24 · tools · maven

一些命令

1 maven assembly插件打包snapshot版本的依赖时不使用时间戳版本的名称 http://maven.apache.org/plugins/maven-assembly-plugin/faq.html#outputFileNameMapping 使用baseVersion代替version即可 2 maven跳过集成测试 mvn -DskipITs=true deploy 3 mongodb按插入顺序查询 db.users.find().hint( { $natural : -1 } )

2016-12-27 15:45 · tools · maven

clojure中的agent实现

最近看了下clojure的并发,其中提到了agent.agent的原理是把对agent的action提交到线程池中运行.它保证线程安全的措施是对每一个agent,同时只有一个actio 在运行. 下面做一个简单的对比,多个线程多次对同一个StringBuilder进行append,如果不同步,结果是不正确的. [code="java"] final StringBuilder sb = new StringBuilder(); ExecutorService pool = Executors.newFixedThreadPool(Runtime .getRuntime().available…

2015-07-30 18:15 · tools

thrift使用中的一些问题

1 TSimpleServer居然是单线程阻塞式server 2 thrift默认只能有一个service, args.processor(p1).processor(p2)只有最后一个起作用. thrift的文档真是不行啊 :?:

2015-05-07 11:11 · tools

maven的maven.test.skip和skipTests

maven.test.skip连编译test类都skip了 If you absolutely must, you can also use the maven.test.skip property to skip compiling the tests. maven.test.skip is honored by Surefire, Failsafe and the Compiler Plugin. 有时候我们需要编译test类,但是不执行test,可以使用skipTests http://jira.codehaus.org/browse/MJAR-138

2015-03-25 18:04 · tools

同步hadoop配置文件

#!/bin/bash HADOOP_HOME=/usr/local/hadoop while read line do HOST=$line echo "copy to $HOST" scp -r $HADOOP_HOME/etc $HOST:$HADOOP_HOME > /dev/null done < $HADOOP_HOME/etc/hadoop/slaves

2015-01-08 10:54 · tools

hibernate one to many 查询返回了重复的数据

很奇怪为什么设计成这样... https://developer.jboss.org/wiki/HibernateFAQ-AdvancedProblems#jive_content_id_Hibernate_does_not_return_distinct_results_for_a_query_with_outer_join_fetching_enabled_for_a_collection_even_if_I_use_the_distinct_keyword

2014-12-24 23:38 · tools

用eclipse来debug

不错的文章,好多debug技巧 http://www.vogella.com/tutorials/EclipseDebugging/article.html

2014-12-24 23:30 · tools

修改vim里注释的颜色

vim里蓝色的注释太难以看清楚了,在~/.vimrc里加入 hi Comment ctermfg=darkgrey

2014-11-12 18:40 · linux · tools

VirtualBox报错Unable to load R3 module GetLastError=1790 (VERR_UNRESOLVED_ERROR

在win7上VirtualBox创建个虚拟机各种莫名其妙的错误. 呵呵呵,最后用了VirtualBox 4.2.12版本才好... 对VirtualBox很失望...鄙视VirtualBox的开发团队

2014-11-12 12:53 · tools

maven repository损坏导致eclipse无法将web工程发布到tomcat

在eclipse中建立的maven的web工程,发布到tomcat中时报错 Publishing failed Could not publish to the server. java.lang.IndexOutOfBoundsException 看了 这篇文章 ,发现是maven的repository里有文件损坏了

2014-09-17 16:07 · tools · maven

maven工程中解决spring的依赖问题

在maven工程中,添加了spring-aop的依赖,没想到启动时候还是报错,说缺少aspectj中的类,这是因为spring-aop对aspectj的依赖是可选的(optional),这样manve不会把aspectj加入工程的依赖中 [code="xml"] org.aspectj aspectjweaver 1.7.4 compile true [/code] 所以要在自己工程的pom中加入对aspectj的依赖. 感觉maven设计上还是有欠缺,应该指出有哪些可选的依赖,spring更不能信誓旦旦的说在pom里加入spring的依赖就万事大吉

2014-06-27 15:54 · tools · SSH

C# winform程序提交带文件的form

在html页面里,可以在form里提交file和普通input,在winform里如何实现呢,需要自己构造提交的表单数据,具体可以参考 http://www.cnblogs.com/greenerycn/archive/2010/05/15/csharp_http_post.html 也可以利用 WebClient webClient = new WebClient(); NameValueCollection values = new NameValueCollection(); values.Add("userId", Convert.ToString(userId)); webClie…

2014-06-25 11:47 · tools

windows7 下以其他用户运行程序

windows7 下如果想以其他用户运行程序,可以按住shift再右键点击. 感觉微软真stupid,怎么会这么设计...

2014-04-21 09:49 · tools · Windows

tomcat中无法运行solr 4.6

运行tomcat后solr app没有部署成功.报错是 [quote]2014-02-26 20:02:57 org.apache.catalina.core.StandardContext startInternal 严重: Error filterStart 2014-02-26 20:02:57 org.apache.catalina.core.StandardContext startInternal 严重: Context [/solr] startup failed due to previous errors[/quote] 之类. 在localhost.2014-02-26.…

2014-02-25 10:52 · tools · Solr

eclipse 链接外部文件夹

http://lippeng.iteye.com/blog/963047

2014-02-21 10:14 · tools · Eclipse

dbunit进行数据库操作的测试

j2ee程序好多都涉及到了数据库操作,这时进行mock测试就没有意义,不如直接在数据库上进行操作. 进行数据库测试有两点要求 1 测试之前数据库要处在一个确定性的状态下. 2 测试不改变数据库的状态. 我觉得比较好的方法是建立一个专用的测试数据库,避免了测试数据的干扰.否则每次测试结束就要进行相应的现场恢复. 假设我们有个开发数据库allcrap,然后建立个测试数据库allcrap_test.为了保证数据库表结构的一致,可以人工同步,也可以用mysqldump进行 .\mysqldump.exe -u root -proot allcrap -d > ddl.sql 这个命令导出了allcr…

2013-02-21 21:26 · tools · dbunit

搜索引擎site关键字的站内搜索

比如google里搜索dom element,老是有些乱七八糟的答案来误导,想直接在权威网站w3.org里搜 用site关键字就行 在google搜索框输入dom element site:w3.org,点击搜索即可.

2013-01-30 15:20 · tools

eclipse重新import被删除的项目

eclipse工作区里项目太多了,所以删了几个(但是没物理删除),结果发现想重新import的时候,提示"Some projects cannot be imported because they already exist in the workspace".这时候把下面那个"Copy projects into workspace"的复选框取消,然后Refresh一下就行

2013-01-14 10:55 · tools · Eclipse