
2007年8月21日
??? 在IE下讓打開的網站圖片飄,來源同學的推薦,純屬好玩,如下代碼,放到已打開網站的IE地址欄上然后回車,效果不錯哦。
#?javascript:R=0;?x1=.1;?y1=.05;?x2=.25;?y2=.24;?x3=1.6;?y3=.24;?x4=300;?y4=200;?x5=300;?y5=200;?DI=document.images;?DIL=DI.length;?function?A(){for(i=0;?i-DIL;?i++){DIS=DI[?i?].style;?DIS.position='absolute';?DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5;?DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++}setInterval('A()',5);?void(0);??
posted @
2008-04-12 18:21 forker 閱讀(373) |
評論 (0) |
編輯 收藏
???? Jasypt
是一個
Java
庫,可以使開發者不需太多操作來給
Java
項目添加基本加密功能,而且不需要知道加密原理。
可與
Spring Framework
、
Hibernate
和
Acegi Security
集成。
符合
RSA
標準的基于密碼的加密,并提供了無配
置加密工具以及新的、高可配置標準的加密工具。
??? 希望在項目上加上Jasypt.
posted @
2007-11-28 22:47 forker 閱讀(827) |
評論 (1) |
編輯 收藏
??? 下午升級升級sql server? 8.00.194到sp4出現掛起操作,要求重啟,重啟無用,解決辦法:
到HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
刪除PendingFileRenameOperations的選項。
posted @
2007-11-27 15:39 forker 閱讀(1390) |
評論 (2) |
編輯 收藏
WEB界面開發規范(轉)
頁面設計規則
頁面命名規則
1、每個功能頁面在系統中配置菜單時統一使用index.jsp或index.html。例如客戶管理配置的URL為http://Server:Port/cc/custmgr/index.jsp。
2、每個頁面的title必須設置為和菜單配置中相同的中文,例如在菜單項中配置為“客戶管理”,則此頁面的title也要設置為“客戶管理”。
3、對于JSP頁面都需要在頁面的最開始部分增加以下語句
<%@
page contentType="text/html; charset=UTF-8" %>
4、對于HTML頁面都需要在頁面的最開始部分增加以下語句
<meta
http-equiv="Content-Language" content="zh-cn">
<meta
http-equiv="Content-Type" content="text/html;
charset=gb2312">
5、對于頁面中控件的屬性設置都需要用雙引號包括起來。
控件命名規則
頁面編碼過程中用到的所有控件命名都需要遵循相應規則,方便程序的可讀性。采用控件類型縮寫前綴(小寫)+英文單詞(第一個字母大寫)的方法來命名每一個控件。具體規則如下:
控件類型 | 前綴 |
Button | btn |
Form | frm |
Select | sel |
TextArea | txt |
Input | ipt |
Image | img |
DIV | div |
變量定義規則
頁面編碼過程中用到的所有變量定義都需要遵循相應規則,方便程序的可讀性。采用數據類型縮寫前綴(小寫)+英文單詞(第一個字母大寫)的方法來命名每一個變量。具體規則如下:
數據類型 | 前綴 |
整數 | i |
小數 | f |
字符 | s |
布爾 | b |
日期 | d |
數組 | arr |
函數定義規則
頁面編碼過程中用到的所有函數定義都需要遵循相應規則,方便程序的可讀性。采用前綴(fuc)+英文單詞(第一個字母大寫)的方法來命名每一個函數。
例如:fucAcceptOrder
CSS文件使用
關鍵字 | 說明 |
table.datatable | 數據表的基本樣式 |
table.datatable
thead | 數據表的頁眉樣式 |
table.datatable
tbody | 數據表的表格體樣式 |
table.datatable
tfoot | 數據表的頁腳樣式 |
table.datatable
tr.row_odd | 數據表的奇數行樣式 |
table.datatable
tr.row_even | 數據表的偶數樣式 |
table.datatable
tr.row_selected | 數據表的選中行樣式 |
table.datatable
tr.row_active | 數據表的當前激活表格的選中行樣式 |
table.datatable
td.indicate | 數據表的指示器樣式 |
關鍵字 | 說明 |
table.dropdowntable | 下拉表格的基本樣式 |
table.dropdowntable
thead | 下拉表格的頁眉樣式 |
table.dropdowntable
tbody | 下拉表格的表格體樣式 |
table.dropdowntable
tfoot | 下拉表格的頁腳樣式 |
table.dropdowntable
tr.row_odd | 下拉表格的奇數行樣式 |
table.dropdowntable
tr.row_even | 下拉表格的偶數行樣式 |
table.dropdowntable
tr.row_selected | 下拉表格的選中行樣式 |
關鍵字 | 說明 |
.editor | 編輯框的基本樣式 |
.editor_active | 激活的編輯框的基本樣式 |
關鍵字 | 說明 |
.button | 按鈕的基本樣式 |
.button_down | 被按下按鈕的基本樣式 |
關鍵字 | 說明 |
table.datapilot | 數據導航條的基本樣式 |
關鍵字 | 說明 |
table.tree | 樹狀列表的基本樣式 |
table.tree tr.row_odd | 樹狀列表奇數行的基本樣式 |
table.tree tr.row_even | 樹狀列表偶數行的基本樣式 |
table.tree
tr.row_selected | 樹狀列表當前行的基本樣式 |
table.tree
tr.row_rightclick | 樹狀列表的響應當前鼠標右擊的行基本樣式 |
table.tree
.expandbutton | 樹狀列表展開按鈕的基本樣式 |
table.tree .icon | 樹狀列表的圖標樣式 |
關鍵字 | 說明 |
.tabset | 標簽頁的基本樣式 |
.tab | 標簽頁中的單個標簽的樣式 |
關鍵字 | 說明 |
table.menu | 菜單的基本樣式 |
table.menu tr | 菜單行的基本樣式 |
table.menu
tr.row_selected | 菜單選中行的基本樣式 |
table.menu
tr.row_disabled | 菜單無效行的基本樣式 |
關鍵字 | 說明 |
table.menubar | 菜單工具條的基本樣式 |
table.menubar .button | 菜單工具條中按鈕的基本樣式 |
table.menubar
.button_active | 菜單工具條中當前按鈕的基本樣式 |
table.menubar
.button_hot | 菜單工具條相應鼠標的按鈕的基本樣式 |
關鍵字 | 說明 |
.dropdown_frame | 下拉選單的邊框的樣式 |
關鍵字 | 說明 |
.calendar | 日歷控件的基本樣式 |
.calendar
.title | 日歷控件頁眉的基本樣式 |
.calendar .footer | 日歷控件頁腳的基本樣式 |
.calendar .cell_day | 日歷控件日期單元格的基本樣式 |
.calendar
.cell_selected | 日歷控件當前單元格的基本樣式 |
.calendar
.cell_trailing | 日歷中前月和后月的日期單元格的基本樣式 |
posted @
2007-11-04 20:31 forker 閱讀(1157) |
評論 (0) |
編輯 收藏
編寫一個創建時,就在屏幕上打印Hello,消失時,就打印Goodbye 的C++程序.
#include<iostream>
using?namespace?std;
class?World{
????????public:
????????????????World(){//創建時
????????????????????????std::cout<<"Hello!\n";
????????????????}
????????????????~World(){//消失時
????????????????????????std::cout<<"Goodbye!\n";
????????????????}
};
//World?theWorld;
int?main(){
??????? //cout<<"Hello?World\n";
????????World?theWorld;
????????return?0;
}
[root@portal?ctest]#?vi?hello.c
[root@portal?ctest]#?g++?hello.c?-o?hello
[root@portal?ctest]#?./hello
Hello!
Goodbye!
[root@portal?ctest]#
posted @
2007-09-24 15:05 forker 閱讀(2430) |
評論 (0) |
編輯 收藏
ERROR?
-
?DisposableBeanAdapter.destroy(
149
)?
|
?Couldn't?invoke?destroy?method?of?bean?
with
?name?'org.springframework.cache.ehcache.EhCacheManagerFactoryBean#12c7568'
java.lang.IllegalStateException:?The?userCache?Cache?is?not?alive.
????at?net.sf.ehcache.Cache.checkStatus(Cache.java:
1201
)
????at?net.sf.ehcache.Cache.dispose(Cache.java:
1081
)
????at?net.sf.ehcache.CacheManager.shutdown(CacheManager.java:
702
)
????at?org.springframework.cache.ehcache.EhCacheManagerFactoryBean.destroy(EhCacheManagerFactoryBean.java:
127
)
????at?org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:
146
)
????at?org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:
379
)
????at?org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:
352
)
????at?org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:
325
)
????at?org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:
799
)
????at?org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:
777
)
????at?org.springframework.context.support.AbstractApplicationContext$
1
.run(AbstractApplicationContext.java:
714
)
添加shared
<bean?id="userCache"?class="org.acegisecurity.providers.dao.cache.EhCacheBasedUserCache">
????????<property?name="cache">
????????????<bean?class="org.springframework.cache.ehcache.EhCacheFactoryBean">
????????????????<property?name="cacheManager">
????????????????????<bean?class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
??????????????????????? <!-- 添加shared -->
??? ??? ??? ??? ??? ??? <property?name="shared"?value="true"/>
????????????????????</bean>
????????????????</property>
????????????????<property?name="cacheName"?value="userCache"></property>
????????????</bean>
????????</property>
????</bean>
posted @
2007-09-21 10:35 forker 閱讀(1313) |
評論 (0) |
編輯 收藏
使用ssh傳文件,用于linux與linux互傳,linux與windows互傳
在linux下用filezilla(
http://filezilla-project.org/),在win下用winscp(
http://www.winscp.com/)軟件
也可以用sshfs把遠程機器的目錄掛載到本地(遠程機器提供ssh服務,安裝fuse-utils工具)
掛載
sshfs user@server:/path /path
卸載
fusermount -u /path
posted @
2007-09-18 10:48 forker 閱讀(486) |
評論 (0) |
編輯 收藏
- 從 Apache.org 下載最新版
jakarta-taglibs-standard-current.tar.gz
- 解壓縮下載的文件。
- 將
jakarta-taglibs-standard-1.1.2/tld/c.tld
拷貝到
WEB/INF/tlds
目錄
- 將
jakarta-taglibs-standard-1.1.2/lib
中的所有JAR文件拷貝到
WEB-INF/lib
目錄(jstl.jar和standard.jar)
- 將以下顯示的條目添加到
WEB-INF/web.xml
部署描述符中
<
taglib
>
?????????
<
taglib-uri
>
http://java.sun.com/jsp/jstl/core
</
taglib-uri
>
?????????
<
taglib-location
>
/WEB-INF/tlds/c.tld
</
taglib-location
>
</
taglib
>
? 6. 在 JSP 頁面添加了JSTL taglib之后,可以使用核心庫中的任何標記,只需把標記的前綴改為
c
?<%@taglib?uri="http://java.sun.com/jsp/jstl/core"?prefix="c"%>?
<c:if?test="${param.sayHello}">
????????<!--?Let's?welcome?the?user?${param.name}?-->
????????Hello?${param.name}!
</c:if>
<c:out?value="Hello?World"/>
????
posted @
2007-09-09 00:06 forker 閱讀(1754) |
評論 (0) |
編輯 收藏
gentoo版本安裝
One?of?the?following?masked?packages?is?required?to?complete?your?request:??-?$t:
-?media-fonts/wqy-bitmapfont-0.7.0?(masked?by:?~x86?keyword)
-?media-fonts/wqy-bitmapfont-0.8.1-r1?(masked?by:?~x86?keyword)
-?media-fonts/wqy-bitmapfont-0.7.0-r1?(masked?by:?~x86?keyword)
版本選擇比較麻煩:
方法一:
echo?"media-fonts/wqy-bitmafont"?>>?/etc/portage/package.keywords
echo?"media-fonts/wqy-bitmafont"?>>?/etc/portage/package.use
方法二:
安裝autounmask:
emerge?autounmask
autounmask?media-fonts/wqy-bitmapfont-*
最后重新emerge.
posted @
2007-09-08 11:05 forker 閱讀(1640) |
評論 (0) |
編輯 收藏
//
去左空格
function
?ltrim(s){
? return
?s.replace(?
/^
\s
*/
,?
""
);
}
//
去右空格;
function
?rtrim(s){
? return
?s.replace(?
/
\s
*
$
/
,?
""
);
}
//
去左右空格;
function
?trim(s){
? return
?rtrim(ltrim(s));
}
posted @
2007-09-07 16:35 forker 閱讀(3572) |
評論 (0) |
編輯 收藏
oracle sql日期比較:
在今天之前:select?*?from?up_date?where?update?<?to_date('2007-09-07?00:00:00','yyyy-mm-dd?hh24:mi:ss')
select?*?from?up_date?where?update?<=?to_date('2007-09-07?00:00:00','yyyy-mm-dd?hh24:mi:ss')
在今天只后:select?*?from?up_date?where?update?>?to_date('2007-09-07?00:00:00','yyyy-mm-dd?hh24:mi:ss')
select?*?from?up_date?where?update?>=?to_date('2007-09-07?00:00:00','yyyy-mm-dd?hh24:mi:ss')
精確時間:select?*?from?up_date?where?update?=?to_date('2007-09-07?00:00:00','yyyy-mm-dd?hh24:mi:ss')
在某段時間內:select?*?from?up_date?where?update?between?to_date('2007-07-07?00:00:00','yyyy-mm-dd?hh24:mi:ss')?and?to_date('2007-09-07?00:00:00','yyyy-mm-dd?hh24:mi:ss')
select?*?from?up_date?where?update?<?to_date('2007-09-07?00:00:00','yyyy-mm-dd?hh24:mi:ss')?and?update?>?to_date('2007-07-07?00:00:00','yyyy-mm-dd?hh24:mi:ss')
select?*?from?up_date?where?update?<=?to_date('2007-09-07?00:00:00','yyyy-mm-dd?hh24:mi:ss')?and?update?>=?to_date('2007-07-07?00:00:00','yyyy-mm-dd?hh24:mi:ss')
posted @
2007-09-07 16:29 forker 閱讀(88483) |
評論 (6) |
編輯 收藏
?? MySql的備份可用命令mysqldump ,使用方法很簡單,mysqldump -u?用戶名 -p (密碼)?-h 主機名 數據庫名
>路徑/備份名.bak;同時也可以是用mysqldump到處數據結構(tablename.sql)和數據(tablename.txt)
mysqldump -u?用戶名??-p (密碼)? -h 主機名 數據庫名 tablename1 tablename2 >
back.sql或mysqldump -u?用戶名?-p (密碼) -h 主機名 數據庫名 --tab 路徑 --opt 數據庫名.
???那么還原可以mysql命令,mysql -u?用戶名?-p (密碼) -h 主機名 --one-database 還原數據庫名 < 路徑/備份名.bak,--one-database是指定要恢復的數據庫.
? (括號表示密碼不先輸入,在連接時在Enter password;若密碼為空可缺省-p參數)
posted @
2007-09-06 17:08 forker 閱讀(1300) |
評論 (0) |
編輯 收藏
???? 安裝有oracle數據庫,創建數據庫,總是要創建一個主鍵ID,唯一標示各條記錄,但oracle不支持自動編號,所以還得創建一個SEQUENCE(序列)語句如
????
create?sequence?bign?nocycle?maxvalue?9999999999?start?with?1;//增加數據
insert?into?table?(ID,..)?values(bign.nextval,..)
???? 在hibernate中的映射文件可這么寫
?? <id?name="id"?type="java.lang.Long"?column="ID">
????????????<generator?class="sequence"?>
?????????????????<param?name="sequence">bign</param>
????????????</generator>
???</id>
或
? <id?name="id"?type="java.lang.Long"?column="ID">
????????????<generator?class="increment"?>
??</id>
(increment 用與為long,short或者int類型生成唯一標示。只有在沒有其他進程忘同一張表中插入數據時才能使用。在集群下不要使用)
posted @
2007-08-28 15:12 forker 閱讀(4071) |
評論 (0) |
編輯 收藏
Hibernate加載其配置文件hibernate.properties和hibernate.cfg.xml,常用xml文件比較直觀,方便管理,
Hibernate
是一個流行的開源對象關系映射工具,方便連接不同數據庫,更換數據庫,只要修改Hibernate配置文件,大度減少項目的維護。
完整的配置如下:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="connection.url">jdbc:hsqldb:hsql://localhost/test</property>
<property name="connection.username">sa</property>
<property name="connection.password"></property>
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.HSQLDialect</property>
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>
<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">create</property>
<mapping resource="../*.hbm.xml"/>
</session-factory>
</hibernate-configuration>
常用數據庫連接
MySql 3/4/5:
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/test</property>
<property name="connection.username">root</property>
<property name="connection.password"></property>
Microsoft SQLServer (via jTDS):
<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
<property name="connection.url">jdbc:jtds:sqlserver://localhost:1433/test;useCursors=true</property>
<property name="connection.username">sa</property>
<property name="connection.password"></property>
IBM DB2:
<property name="dialect">org.hibernate.dialect.DB2Dialect</property>
<property name="connection.driver_class">com.ibm.db2.jcc.DB2Driver</property>
<property name="connection.url">jdbc:db2://localhost:50000/test</property>
<property name="connection.username">db2inst1</property>
<property name="connection.password"></property>
Oracle:
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin:@localhost:1521:test</property>
<property name="connection.username">ora</property>
<property name="connection.password"></property>
Informix:
<property name="dialect">org.hibernate.dialect.InformixDialect</property>
<property name="connection.driver_class">com.informix.jdbc.IfxDriver</property>
<property name="connection.url">jdbc:informix-sqli://localhost:1526/test:informixserver=server1</property>
<property name="connection.username">root</property>
<property name="connection.password"></property>
<property name="connection.encoding">true</property>
Sybase (via jTDS):
<property name="dialect">org.hibernate.dialect.SybaseDialect</property>
<property name="connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
<property name="connection.url">jdbc:jtds:sybase://localhost:7100/test;useCursors=true</property>
<property name="connection.username">root</property>
<property name="connection.password"></property>
PostgreSQL:
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="connection.driver_class">org.postgresql.Driver</property>
<property name="connection.url">jdbc:postgresql://localhost:5432/test</property>
<property name="connection.username">root</property>
<property name="connection.password"></property>
MaxDB(SAPDB):
<property name="dialect">org.hibernate.dialect.SAPDBDialect</property>
<property name="connection.driver_class">com.sap.dbtech.jdbc.DriverSapDB</property>
<property name="connection.url">jdbc:sapdb://localhost/test</property>
<property name="connection.username">root</property>
<property name="connection.password"></property>
posted @
2007-08-21 10:01 forker 閱讀(4124) |
評論 (0) |
編輯 收藏