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.
Categorized in: Java · Tagged with: Java
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.
Categorized in: Uncategorized · Tagged with: CSS, HTML
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:
- 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){}}
- 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.
Categorized in: Scripts · Tagged with: grails, Groovy, Java, Javascript
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的问题,那么不妨将这两种方案都尝试一下.
Categorized in: Database, Java · Tagged with: Database, DB2, Hibernate, Java, ORM, schema
How to configure Tomcat to support remote debugging
How do I configure Tomcat to support remote debugging?
The short answer is to add the following options when the JVM is started: -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n There are a number of ways you can do this depending on how you normally start Tomcat:
- If you run Tomcat using service wrapper, add the above JVM options before any other JVM options. Check the documentation for the service to determine how to set JVM options.
- Set environment variables JPDA_ADDRESS=8000 and JPDA_TRANSPORT=dt_socket and then start tomcat using catalina jpda start.
- If you start Tomcat from within an IDE, check the documentation for the IDE to determine how to set the required JVM options.
The port does not need to be set to 8000, it may be any value appropriate for your system.
Whilst this is very useful in development it should not be used in production because of both security and performance implications.
Copied from: http://wiki.apache.org/tomcat/FAQ/Developing#Q1
Categorized in: Java · Tagged with: Java, Tomcat
How to install libstdc++.so.5 for Ubuntu
Today when I tried to run our applications, I was told that there is a necessary library libstdc++.so.5 missing.
Now, I give the programmers who also faces the same problem a solution:
sudo apt-get install libstdc++5
Categorized in: Java, Operation Systems · Tagged with: Java, Linux, Ubuntu
Groovy 学习笔记 (二)
5. 方法调用: 方法调用时, 括号是可选的. 例如: print ‘hello, world’
6. 方法返回值: 默认最后一句就是方法的返回值, 也就是说, 最后一句的return语句是可有可无的. 当然, 如果在方法中间需要return值, 还是要写 return 语句才行.
7. 闭包(closure): 闭包可以访问与闭包定义在同一scope的变量. 例如:
def name = “” //initialize variable
def printName = { println “The string in the name variable is ” + name } //define method
name = “Youssef” //set string Youssef in variable name
printName() //result: The string in the name variable is Youssef
如果不在同一scope, 那么需要给闭包指明参数, 参数与闭包的body部分用 -> 符号分隔. 如果只有一个参数, 则该参数可不必明确写出来, 默认用 it 作为该参数的名称.
def name = “” //initialize variable
def printName = { println “The string in the name variable is ” + it } //define method
name = “Youssef” //set string Youssef in variable name
printName(name) //result: The string in the name variable is Youssef
8. 异常处理: 不是强制性的
9. methodMissing 与 propertyMissing 方法:
10. categories:
class StringCategory {
static String lower(String string) {
return string.toLowerCase()
}
}
use (StringCategory) {
assert "test" == "TeSt".lower()
}
Categorized in: Scripts · Tagged with: grails, Groovy, Java, Scripts
Grails RichUI plugin
Rich UI 是一个 AJAx 插件, 可以干很多事情:
- #Accordion
- #AutoComplete
- #CalendarDayView
- #CalendarMonthView
- #CalendarWeekView
- #Carousel
- #CheckedTreeView
- #DateChooser
- #Flow
- #Font (creates images dynamically)
- #Map
- #Portlet
- #Redirect
- #ReflectionImage
- #RichTextEditor
- #Star rating
- #TabView
- #TagCloud
- #Timeline
- #Tooltip
- #TreeView
我就用它做了一个 rating 功能, 哈哈, 真是超级简单, 超级方便. 在下面的链接里, 有详细的使用说明, 只要你的英语不是很烂, 就很容易搞明白如何使用.
具体地址: RichUI Plugin
Categorized in: Scripts · Tagged with: AJAX, grails, Groovy, Javascript, Plugins

(
(4.00 out of 5)