Servlet 3.0 新特性

Servlet 3.0 规范的 JSR 315 已经进入到了 proposed final draft 阶段,想必很快就会在 Java EE 6 中释出。 新版本的 Servlet 规范变动比较大,不单单只是 API 的变动,而是引入了很多新特性。

那么都有哪些新特性呢:

Read the rest of this post »

By javafuns on July 3, 2009 • Tags: , • Posted in: Java • Views: 20 • No Comments

Ubuntu 下 NetBeans 编辑器的字体锯齿问题

Append this -J-Dawt.useSystemAAFontSettings=on to netbeans_default_options in etc/netbeans.conf, then restart netbeans

By javafuns on July 2, 2009 • Tags: , • Posted in: Java • Views: 47 • No Comments

SVN 1.6 on ubuntu

For Karmic:

deb http://ppa.launchpad.net/anders-kaseorg/subversion-1.6/ubuntu karmic main
deb-src http://ppa.launchpad.net/anders-kaseorg/subversion-1.6/ubuntu karmic main

For Jaunty:

deb http://ppa.launchpad.net/anders-kaseorg/subversion-1.6/ubuntu jaunty main
deb-src http://ppa.launchpad.net/anders-kaseorg/subversion-1.6/ubuntu jaunty main

For Intrepid:

deb http://ppa.launchpad.net/anders-kaseorg/subversion-1.6/ubuntu intrepid main
deb-src http://ppa.launchpad.net/anders-kaseorg/subversion-1.6/ubuntu intrepid main

For Hardy:

deb http://ppa.launchpad.net/anders-kaseorg/subversion-1.6/ubuntu hardy main
deb-src http://ppa.launchpad.net/anders-kaseorg/subversion-1.6/ubuntu hardy main
By javafuns on June 30, 2009 • Tags: , , • Posted in: Operation Systems • Views: 70 • No Comments

How to reset your Linux root password (reship)

原文: http://www.ibm.com/developerworks/cn/linux/l-10sysadtips/

技巧 4:找回根密码

如果忘记根密码,就必须重新安装整台机器。更惨的是,许多人都会这样做。但是启动机器并更改密码却十分简单。这并非在所有情况下都适用(比如设置了一个 GRUB 密码,但也忘记了),但这里介绍一个 Cent OS Linux 示例,说明一般情况下的操作。

首先重启系统。重启时会跳出如图 1 所示的 GRUB 屏幕。移动箭头键,这样可以保留在此屏幕上,而不是进入正常启动。
图 1. 重启后的 GRUB 屏幕
重启后的 GRUB 屏幕

然后,使用箭头键选择要启动的内核,并输入 E 编辑内核行。然后便可看到如图 2 所示的屏幕:
图 2:准备编辑内核行
准备编辑内核行

再次使用箭头键突出显示以 kernel 开始的行,按 E 编辑内核参数。到达如图 3 所示的屏幕时,在图 3 中所示的参数后追加数字 1 即可:
图 3. 在参数后追加数字 1
在参数后追加数字 1

然后按 EnterB,内核会启动到单用户模式。然后运行 passwd 命令,更改用户根密码:

sh-3.00# passwd
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully

现在可以重启了,机器将使用新密码启动。

By javafuns on June 19, 2009 • Tags: , • Posted in: Operation Systems • Views: 73 • No Comments

eBay Marketplace Architecture (reship)

Architectural Forces: What do we think about?

Scalability
– Resource usage should increase linearly with load
– Design for 10x growth in data, traffic, users, etc.
• Availability
– Resilience to failure
– Graceful degradation
– Recoverability from failure
Latency
– User experience latency
– Data latency
Manageability
– Simplicity
– Maintainability
– Diagnostics
Cost
– Development effort and complexity
– Operational cost (TCO)

Architectural Strategies: How do we do it?

Strategy 1: Partition Everything
– “How do you eat an elephant? … One bite at a time”
Strategy 2: Async Everywhere
– “Good things come to those who wait”
Strategy 3: Automate Everything
– “Give a man a fish and he eats for a day … Teach a man to fish and he eats for a lifetime”
Strategy 4: Remember Everything Fails
– “Be Prepared”

By javafuns on June 16, 2009 • Tags:  • Posted in: Architecture • Views: 332 • No Comments

弃用 Yahoo! stat.

雅虎统计改为量子恒道统计,遂决意放弃,改用 google analytics。

By javafuns on June 13, 2009 • Tags:  • Posted in: My Life • Views: 810 • No Comments

Linux 平台上的图形化 SVN 客户端

You may already know some SVN clients on Linux, like rapidSVN, eSVN, etc. But I don’t think they are as good enough as TortoiseSVN that is only for Windows platform.

Today I found an SVN client named SmartSVN, developed by Java. It’s very very powerful, support many operations just like what TortoiseSVN does on Windows.

It’s a pity that it’s not open source software but for commercial.

By javafuns on June 9, 2009 • Tags:  • Posted in: Java • Views: 1,191 • No Comments

Make LI not indent

Sample code is listed below:

ul {
list-style:none;
margin:0px;
padding:0px;
}

list-style attribute makes li without bullet.
The code is tested on Firefox, Opera, IE.

By javafuns on May 28, 2009 • Tags: , • Posted in: Uncategorized • Views: 2,992 • No Comments

How to set onSuccess event listener for Grails

Grails inherently supports ajax function, such as remoteFunction, remoteLink, etc.

But do you know how to set onSuccess event listener appropriately?

Let me tell you :)

<input type=”text” id=”name” name=”name” value=”"/>
<input type=”button” name=”checkbizname” value=”Chek whether this name already exists” onclick=”${remoteFunction(controller:’mycontroller’,action:’isNameExists’,onSuccess:’popwin(o)’, params:’\'name=\’ + document.getElementById(\’name\’).value’)}”/>

In the above code, when ajax request is handled and get response from server, onSuccess event listener will be invoked.

Note:

  1. popwin(o) should contain argument ‘o’, as ‘o’ is defined in the code generated by this GSP. You can find this argument via firebug. {success: function(o){popwin(o);}, failure: function(o){}}
  2. Another important thing is, you should define this function popwin(o) in head section in GSP. It seems a bug that funtions defined between head and body will not be invoked at all.
By javafuns on May 21, 2009 • Tags: , , , • Posted in: Scripts • Views: 1,719 • No Comments

HIBERNATE-为DB2指定默认schema

hibernate 有一个属性hibernate.default_schema,设置了该属性后,hibernate将使用该schema.

例如:在hibernate.cfg.xml

<property name="default_schema">MYSCHEMA</property>

另外,如果你使用的是 jdbc 直接访问数据库,那么可以在 url 中加上 currentSchema=MYSCHEMA,例如:

<Resource name="jdbc/UddiDatabase" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="50" maxWait="10000"
username="db2admin" password="db2admin"
driverClassName="com.ibm.db2.jcc.DB2Driver"
url="jdbc:db2://192.168.56.101:50000/UDDI:traceLevel=3;driverType=4;currentSchema=MYSCHEMA;"/>

如果你遇到了有关schema的问题,那么不妨将这两种方案都尝试一下.

By javafuns on May 15, 2009 • Tags: , , , , , • Posted in: Database, Java • Views: 1,784 • No Comments
  • Highest Rated

  • My Picasa

    IMG_0679.JPG

    IMG_0645.JPG

    IMG_0632.JPG

  • RSS My del.icio.us

  • My RSS