- Oct 17 Tue 2006 20:05
-
Pro Wicket
Pro Wicket給我的感想是,快速的用範例簡單的介紹一些元件的用法,然後,沒了,給人少了些什麼的感覺。
- Oct 13 Fri 2006 20:04
-
十月努力閱讀
- Oct 11 Wed 2006 20:03
-
北橫兩日遊
10月8日,石門水庫,慈湖,角板山公園,溪口吊橋,夜宿復興青年活動中心。
10月9日,東眼山森林遊樂區,小烏來,羅浮橋,北橫之星。
10月9日,東眼山森林遊樂區,小烏來,羅浮橋,北橫之星。
- Oct 05 Thu 2006 20:01
-
我的Eclipse裝了哪些Plug-in
- Sep 29 Fri 2006 20:01
-
安裝Postfix和SASL2
安裝/usr/ports/security/cyrus-sasl2-saslauthd和/usr/ports/mail/postfix
建立/usr/local/lib/sasl2/smtpd.conf:
pwcheck_method: saslauthd
mech_list: plain login
修改/usr/local/etc/rc.d/saslauthd.sh,將saslauthd_flags="-a pam"改成saslauthd_flags="-a getpwent"
建立/usr/local/lib/sasl2/smtpd.conf:
pwcheck_method: saslauthd
mech_list: plain login
修改/usr/local/etc/rc.d/saslauthd.sh,將saslauthd_flags="-a pam"改成saslauthd_flags="-a getpwent"
- Sep 12 Tue 2006 20:00
-
我的spring-beans.xml
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE beans PUBLIC
“-//SPRING/DTD BEAN/EN”
“http://www.springframework.org/dtd/spring-beans.dtd”>
<beans>
<bean id=”dataSource” class=”org.logicalcobwebs.proxool.ProxoolDataSource” destroy-method=”close”>
<property name=”driver”><value>${jdbc.driver}</value></property>
<property name=”driverUrl”><value>${jdbc.url}</value></property>
<property name=”user”><value>${jdbc.username}</value></property>
<property name=”password”><value>${jdbc.password}</value></property>
<property name=”alias”><value>xfort</value></property>
<property name=”houseKeepingTestSql”><value>SELECT 1</value></property>
<property name=”testBeforeUse”><value>false</value></property>
<property name=”maximumActiveTime”><value>86400000</value></property>
<property name=”maximumConnectionCount”><value>${proxool.maximum-connection-count}</value></property>
<property name=”delegateProperties”><value>user=${jdbc.username},password=${jdbc.password}</value></property>
</bean>
<bean id=”sessionFactory” class=”org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean”>
<property name=”dataSource”><ref bean=”dataSource” /></property>
<property name=”hibernateProperties”>
<props>
<prop key=”hibernate.dialect”>${hibernate.dialect}</prop>
<prop key=”hibernate.format_sql”>true</prop>
<prop key=”hibernate.show_sql”>false</prop>
<prop key=”hibernate.cache.use_second_level_cache”>false</prop>
<prop key=”hibernate.cache.provider_class”>org.hibernate.cache.EhCacheProvider</prop>
<prop key=”hibernate.current_session_context_class”>thread</prop>
<prop key=”hibernate.connection.release_mode”>after_transaction</prop>
<prop key=”hibernate.transaction.factory_class”>org.hibernate.transaction.JDBCTransactionFactory</prop>
<prop key=”hibernate.transaction.auto_close_session”>false</prop>
</props>
</property>
<property name=”annotatedPackages”>
<list>
<value>forth.model</value>
</list>
</property>
<property name=”annotatedClasses”>
<list>
<value>zbwei.model.ModelName</value>
</list>
</property>
</bean>
</beans>
<!DOCTYPE beans PUBLIC
“-//SPRING/DTD BEAN/EN”
“http://www.springframework.org/dtd/spring-beans.dtd”>
<beans>
<bean id=”dataSource” class=”org.logicalcobwebs.proxool.ProxoolDataSource” destroy-method=”close”>
<property name=”driver”><value>${jdbc.driver}</value></property>
<property name=”driverUrl”><value>${jdbc.url}</value></property>
<property name=”user”><value>${jdbc.username}</value></property>
<property name=”password”><value>${jdbc.password}</value></property>
<property name=”alias”><value>xfort</value></property>
<property name=”houseKeepingTestSql”><value>SELECT 1</value></property>
<property name=”testBeforeUse”><value>false</value></property>
<property name=”maximumActiveTime”><value>86400000</value></property>
<property name=”maximumConnectionCount”><value>${proxool.maximum-connection-count}</value></property>
<property name=”delegateProperties”><value>user=${jdbc.username},password=${jdbc.password}</value></property>
</bean>
<bean id=”sessionFactory” class=”org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean”>
<property name=”dataSource”><ref bean=”dataSource” /></property>
<property name=”hibernateProperties”>
<props>
<prop key=”hibernate.dialect”>${hibernate.dialect}</prop>
<prop key=”hibernate.format_sql”>true</prop>
<prop key=”hibernate.show_sql”>false</prop>
<prop key=”hibernate.cache.use_second_level_cache”>false</prop>
<prop key=”hibernate.cache.provider_class”>org.hibernate.cache.EhCacheProvider</prop>
<prop key=”hibernate.current_session_context_class”>thread</prop>
<prop key=”hibernate.connection.release_mode”>after_transaction</prop>
<prop key=”hibernate.transaction.factory_class”>org.hibernate.transaction.JDBCTransactionFactory</prop>
<prop key=”hibernate.transaction.auto_close_session”>false</prop>
</props>
</property>
<property name=”annotatedPackages”>
<list>
<value>forth.model</value>
</list>
</property>
<property name=”annotatedClasses”>
<list>
<value>zbwei.model.ModelName</value>
</list>
</property>
</bean>
</beans>
- Sep 07 Thu 2006 20:00
-
我的build.xml
<?xml version=”1.0″ encoding=”UTF-8″?>
<project name=”Forth” default=”compile” basedir=”.”>
<property name=”build.dir” value=”build” />
<property name=”build.dist.dir” value=”${build.dir}/dist” />
<property name=”build.main.dir” value=”${build.dir}/main” />
<property name=”build.test.dir” value=”${build.dir}/test” />
<property name=”build.test.output.dir” value=”${build.dir}/test-output” />
<property name=”build.test.report.dir” value=”${build.dir}/test-report” />
<property name=”src.dir” value=”src” />
<property name=”test.dir” value=”test” />
<property name=”lib.dir” value=”lib” />
<property name=”ext.dir” value=”ext” />
<property name=”web.dir” value=”web” />
<path id=”classpath”>
<pathelement location=”${build.main.dir}” />
<pathelement location=”${build.test.dir}” />
<fileset dir=”${lib.dir}” includes=”*.jar” />
<fileset dir=”${ext.dir}” includes=”*.jar” />
</path>
<target name=”prepare”>
<mkdir dir=”${build.dist.dir}” />
<mkdir dir=”${build.main.dir}” />
<mkdir dir=”${build.test.dir}” />
<mkdir dir=”${build.test.output.dir}” />
<mkdir dir=”${build.test.report.dir}” />
</target>
<target name=”clean” depends=”prepare”>
<delete dir=”${build.dir}” />
</target>
<target name=”compile” depends=”prepare”>
<javac srcdir=”${src.dir}” destdir=”${build.main.dir}” encoding=”UTF-8″>
<classpath refid=”classpath” />
</javac>
</target>
<target name=”compile-test” depends=”compile”>
<javac srcdir=”${test.dir}” destdir=”${build.test.dir}” encoding=”UTF-8″>
<classpath refid=”classpath” />
</javac>
</target>
<target name=”test” depends=”compile-test”>
<taskdef name=”testng”
classname=”org.testng.TestNGAntTask”
classpath=”${ext.dir}/testng-5.1.jar” />
<testng classpathref=”classpath”
outputdir=”${build.test.output.dir}”
haltOnfailure=”true”>
<xmlfileset dir=”test” includes=”testng.xml” />
</testng>
</target>
<target name=”test-report” depends=”test”>
<junitreport todir=”${build.test.report.dir}”>
<fileset dir=”${build.test.output.dir}” includes=”**/*.xml” />
<report format=”noframes” todir=”${build.test.report.dir}” />
</junitreport>
</target>
<target name=”pack-main” depends=”compile”>
<jar destfile=”${build.dist.dir}/setup.jar”>
<manifest>
<attribute name=”Main-Class” value=”Installer” />
<attribute name=”Class-Path” value=”. server.jar” />
</manifest>
</jar>
<jar destfile=”${build.dist.dir}/server.jar”>
<fileset dir=”${build.main.dir}” />
</jar>
<jar destfile=”${build.dist.dir}/web.war”>
<fileset dir=”${web.dir}” />
</jar>
</target>
<target name=”pack-test” depends=”compile-test”>
<jar destfile=”${build.dist.dir}/test.jar”>
<fileset dir=”${build.test.dir}” />
</jar>
</target>
<target name=”dist” depends=”pack-main, pack-test”>
<copy todir=”${build.dist.dir}”>
<fileset dir=”.” includes=”resource/*” />
<fileset dir=”.” includes=”config/*” />
</copy>
</target>
</project>
<project name=”Forth” default=”compile” basedir=”.”>
<property name=”build.dir” value=”build” />
<property name=”build.dist.dir” value=”${build.dir}/dist” />
<property name=”build.main.dir” value=”${build.dir}/main” />
<property name=”build.test.dir” value=”${build.dir}/test” />
<property name=”build.test.output.dir” value=”${build.dir}/test-output” />
<property name=”build.test.report.dir” value=”${build.dir}/test-report” />
<property name=”src.dir” value=”src” />
<property name=”test.dir” value=”test” />
<property name=”lib.dir” value=”lib” />
<property name=”ext.dir” value=”ext” />
<property name=”web.dir” value=”web” />
<path id=”classpath”>
<pathelement location=”${build.main.dir}” />
<pathelement location=”${build.test.dir}” />
<fileset dir=”${lib.dir}” includes=”*.jar” />
<fileset dir=”${ext.dir}” includes=”*.jar” />
</path>
<target name=”prepare”>
<mkdir dir=”${build.dist.dir}” />
<mkdir dir=”${build.main.dir}” />
<mkdir dir=”${build.test.dir}” />
<mkdir dir=”${build.test.output.dir}” />
<mkdir dir=”${build.test.report.dir}” />
</target>
<target name=”clean” depends=”prepare”>
<delete dir=”${build.dir}” />
</target>
<target name=”compile” depends=”prepare”>
<javac srcdir=”${src.dir}” destdir=”${build.main.dir}” encoding=”UTF-8″>
<classpath refid=”classpath” />
</javac>
</target>
<target name=”compile-test” depends=”compile”>
<javac srcdir=”${test.dir}” destdir=”${build.test.dir}” encoding=”UTF-8″>
<classpath refid=”classpath” />
</javac>
</target>
<target name=”test” depends=”compile-test”>
<taskdef name=”testng”
classname=”org.testng.TestNGAntTask”
classpath=”${ext.dir}/testng-5.1.jar” />
<testng classpathref=”classpath”
outputdir=”${build.test.output.dir}”
haltOnfailure=”true”>
<xmlfileset dir=”test” includes=”testng.xml” />
</testng>
</target>
<target name=”test-report” depends=”test”>
<junitreport todir=”${build.test.report.dir}”>
<fileset dir=”${build.test.output.dir}” includes=”**/*.xml” />
<report format=”noframes” todir=”${build.test.report.dir}” />
</junitreport>
</target>
<target name=”pack-main” depends=”compile”>
<jar destfile=”${build.dist.dir}/setup.jar”>
<manifest>
<attribute name=”Main-Class” value=”Installer” />
<attribute name=”Class-Path” value=”. server.jar” />
</manifest>
</jar>
<jar destfile=”${build.dist.dir}/server.jar”>
<fileset dir=”${build.main.dir}” />
</jar>
<jar destfile=”${build.dist.dir}/web.war”>
<fileset dir=”${web.dir}” />
</jar>
</target>
<target name=”pack-test” depends=”compile-test”>
<jar destfile=”${build.dist.dir}/test.jar”>
<fileset dir=”${build.test.dir}” />
</jar>
</target>
<target name=”dist” depends=”pack-main, pack-test”>
<copy todir=”${build.dist.dir}”>
<fileset dir=”.” includes=”resource/*” />
<fileset dir=”.” includes=”config/*” />
</copy>
</target>
</project>
- Sep 07 Thu 2006 19:59
-
我的Java工作目錄結構
build/dist/ - 封裝成佈署用的檔案
build/main/ - 主程式class檔
build/test/ - 測試程式class檔
build/test-output/ - TestNG輸出
build/test-report/ - JUnitReport
config/ - 設定檔
classes/ - Eclipse產生的class檔
ext/ - 其它JAR檔,例如ProGuard、yGuard
lib/ - 程式庫JAR檔
resource/ - 資源檔
src/ - 主程式原始碼
test/ - 測試程式原始碼
web/ - 網頁
web/WEB-INF/
build/main/ - 主程式class檔
build/test/ - 測試程式class檔
build/test-output/ - TestNG輸出
build/test-report/ - JUnitReport
config/ - 設定檔
classes/ - Eclipse產生的class檔
ext/ - 其它JAR檔,例如ProGuard、yGuard
lib/ - 程式庫JAR檔
resource/ - 資源檔
src/ - 主程式原始碼
test/ - 測試程式原始碼
web/ - 網頁
web/WEB-INF/
- Aug 08 Tue 2006 19:58
-
Top 11 Rails Plugins
From Top 11 Rails Plugins:
Acts As Taggable -上tag
Acts As Rateable – 評分
Acts As Commentable – 評論
Acts As Voteable – 投票
Acts As Blog – Textile, Markup, SmartyPants轉HTML
Acts As Versioned – 資料歷程
Acts As Bookmarkable – 書籤
Riff Rails – 資料比對
Rails PDF – 產生PDF文件
Calendar Helper – 日曆元件
Graphs Rails – CSS長條圖
Acts As Taggable -上tag
Acts As Rateable – 評分
Acts As Commentable – 評論
Acts As Voteable – 投票
Acts As Blog – Textile, Markup, SmartyPants轉HTML
Acts As Versioned – 資料歷程
Acts As Bookmarkable – 書籤
Riff Rails – 資料比對
Rails PDF – 產生PDF文件
Calendar Helper – 日曆元件
Graphs Rails – CSS長條圖
- Jul 29 Sat 2006 19:58
-
Postfix Anti-spam
I’ve added following lines to my main.cf of Postfix to try to block more spams.
strict_rfc821_envelopes = yes
parent_domain_matches_subdomains = smtpd_access_maps
smtpd_helo_required = yes
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination,
reject_invalid_hostname,
check_client_access hash:/usr/local/etc/postfix/access_client,
reject_unauth_pipelining,
reject_non_fqdn_sender,
reject_unknown_sender_domain,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
reject_rbl_client sbl.spamhaus.org,
reject_rbl_client blackholes.mail-abuse.org
strict_rfc821_envelopes = yes
parent_domain_matches_subdomains = smtpd_access_maps
smtpd_helo_required = yes
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination,
reject_invalid_hostname,
check_client_access hash:/usr/local/etc/postfix/access_client,
reject_unauth_pipelining,
reject_non_fqdn_sender,
reject_unknown_sender_domain,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
reject_rbl_client sbl.spamhaus.org,
reject_rbl_client blackholes.mail-abuse.org
- Jul 29 Sat 2006 19:56
-
Java和Delphi時間換算
在Java中的Date是以long記錄時間,單位是ms,0表示1970-01-01 00:00:00 GMT,而Delphi的TDateTime則是以double記錄時間,0.0表示1899-12-30 00:00:00,整數部分代表從前述時間到某個日期所經過的天數,小數部分乘以86400代表該日經過的秒數。
從1899年12月30日到1970年1月1日,共計25569日,每日計有86400000ms,因此要把Java的時間轉成Delphi的格式可用下列程式:
static final double DAYS_BETWEEN_18991230_AND_19700101 = 25569;
static final double MILLISECONDS_PER_DAY = 86400000;
public static double javaTimeToDelphiTime(final Date time) {
return (time.getTime() + TIME_ZONE_OFFSET_MILLIS) / MILLISECONDS_PER_DAY + DAYS_BETWEEN_18991230_AND_19700101;
}
從1899年12月30日到1970年1月1日,共計25569日,每日計有86400000ms,因此要把Java的時間轉成Delphi的格式可用下列程式:
static final double DAYS_BETWEEN_18991230_AND_19700101 = 25569;
static final double MILLISECONDS_PER_DAY = 86400000;
public static double javaTimeToDelphiTime(final Date time) {
return (time.getTime() + TIME_ZONE_OFFSET_MILLIS) / MILLISECONDS_PER_DAY + DAYS_BETWEEN_18991230_AND_19700101;
}