ITeye博客

2013 年文章归档

共 45 篇文章

java i18n exception

http://www.cab.u-szeged.hu/WWW/java/tutorial/i18n/exception/subclass.html

2013-11-11 17:37

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

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

2013-09-22 21:31

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

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

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

再谈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

shell字符串截取

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

2013-07-19 15:09 · shell

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

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

Why singleton is anti-pattern?

OO Test Other reasons?

2013-07-03 10:12 · java

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

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

一个命令创建多个目录

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

2013-06-13 12:36 · linux · shell

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

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

使用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

HBase Schema Design

As someone has said here You need to look more at the types of queries that you will be needing to access your data rather that just nomarlise every thing to 3rd normal form as in traditional relational databases. I collected several useful documents on how to design hbase schema. See the attached …

2013-05-24 11:41 · hbase

use "--links" option of rsync

Today I used rsync to copy some files but I found for symbolic links it will ignore them if you just use simple command line: rsync SRC DEST With google, I finally figure out I need to add the "--links" option. --copy-links Turn all symlinks into normal files (leaving no symlinks for any other opti…

2013-05-23 10:45 · linux

Question on HBase source code

I'm reading source code of hbase. When come to class org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher I find this class has private member unassignedNodes but I cannot find where nodes are added into the set. To be figured out. 71 // set of unassigned nodes watched 72 private Set<String> unassign…

2013-05-22 15:05 · hadoop · hbase

Using the libjars option with Hadoop

As I have said in my last post, I was developing a hbase based mapreduce application. But one damn thing is the hadoop cluster managed by our system admin has no hbase jars in its classpath... So I have to figure out how to provide jars needed by hbase to hadoop. I know "hadoop jar" command has an …

2013-05-20 15:03 · hadoop · hbase