ITeye博客

渴死的火烈鸟

standalone · 共 356 篇文章

flume build过程中出现Too many unapproved licenses错误

在target/rat.txt下面寻找哪些文件前面打了问号,去掉这些文件!

2013-09-22 21:31 · 评论(0)

perl tips for qw qq qx q

q// is generally the same thing as using single quotes - meaning it doesn't interpolate values inside the delimiters. qq// is the same as double quoting a string. It interpolates. qw// return a list of white space delimited words. @q = qw/this is a test/ is functionally the same as @q = ('this', 'i…

2013-07-26 16:58 · perl · 评论(0)

show git branch in your bash prompt

export PS1='\u@\h\ \w$(parse_git_branch "(%s)")]\$\e[m' function parse_git_branch { ref=$(git-symbolic-ref HEAD 2> /dev/null) || return echo "("${ref#refs/heads/}")" }

2013-07-26 16:47 · 评论(0)

Show git log history in beautiful format

git alias: lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative

2013-07-26 15:44 · 评论(0)

再谈Java的wait(), sleep(), notify()和notifyAll()

一段时间不用java,这些概念就全混淆了,有必要彻底澄清一下,总结在这里,当然以我的本事,不太可能写出水平较高的总结,这里主要是总结stackoverflow上面高人的言论。 先说sleep() 和 wait() sleep() method causes the current thread to move from running state to block state for a specified time. If the current thread has the lock of any object then it keeps holding it, which means …

2013-07-25 10:59 · java · 评论(0)

shell字符串截取

${string#substring} 从string左边去掉第一个substring ${string%substring} 从string右边去掉第一个substring

2013-07-19 15:09 · shell · 评论(0)

ubuntu 安装 java 环境

本人安装的是oracle java6 下载jre wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-linux-x64.bin 下载jdk wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" http://download.oracle.com/otn-pub/java/…

2013-07-07 12:38 · 评论(0)

ubuntu 安装中文输入法

安装语言包 System Settings-->Language Support-->Install/Remove Languages => 安装Chinese(simplified) 安装IBus框架 sudo apt-get install ibus ibus-clutter ibus-gtk ibus-gtk3 ibus-qt4 启动IBus框架 im-switch -s ibus 注销系统 保证更改立即生效。 设置IBus框架 ibus-setup IBus Preference设置被打开。在Input Method选项卡中,选择输入法即可。

2013-07-07 10:57 · 评论(0)

Why singleton is anti-pattern?

OO Test Other reasons?

2013-07-03 10:12 · java · 评论(0)

How to generate the serialVersionUID when you implement Serializable interface,j

http://docs.oracle.com/javase/6/docs/technotes/tools/solaris/serialver.html

2013-07-01 10:52 · java · 评论(0)

Serialize/Deserialize Perl Class Objects

Today in a small project I need to serialize a perl class object to string in order to cache it. And when getting back the value from the cache I need to deserialize it to original class objects. There are good articles on the solutions: http://www.ohmpie.com/serialization/ http://www.onperl.net/Se…

2013-06-18 14:09 · perl · 评论(0)

一个命令创建多个目录

可能我太土了,才发现下面这个命令! mkdir -p src/{test,main}/{java,resources}

2013-06-13 12:36 · linux · shell · 评论(0)

Java Override的两个问题

1: 如果子类中的方法的参数是父类的方法的子类型,那么算不算override? 例如: class A { public void foo(A a){ } } class B extends A { public void foo(B b){ } } 2:如果子类中的方法的返回类型改变了,那么算不算override? class A { public A foo(A a){ return a; } } class B extends A { public B foo(B b){ return b; } } There is answer from stackoveflow: http://s…

2013-06-01 11:40 · java · 评论(0)

How many string objects are created?

This is a very common java interview question. Given the following: String x = new String("xyz"); y="abc"; x=x+y; How Many Strings have been created: A - 2 B - 3 C - 4 D - 5 To answer this question, I suggest you to read http://www.javaranch.com/journal/200409/Journal200409.jsp

2013-06-01 10:18 · java · 评论(1)

使用Java的DelayQueue容易碰到的一个坑

今天不忙,学习一下java.util.concurrent.DelayQueue这个类的使用。参照了 http://www.concretepage.com/java/example_delayqueue_java.php 上的例子,但是这里有个坑。 先看一下整个code吧: import java.util.concurrent.DelayQueue; import java.util.concurrent.Delayed; import java.util.concurrent.TimeUnit; public class DelayQueueExample { /** * @param…

2013-05-27 17:32 · java · 评论(0)