2006年7月17日
http://ubuntu.dormforce.net/使用說(shuō)明
打開(kāi)Software Manager,點(diǎn)擊Edit⇒Software Sources
在Download from中選擇Other
選擇China⇒mirrors.ustc.edu.cn
點(diǎn)擊Choose Server
a wonderful Eclipse plugin:
WindowBuilder, which can be used to develope Swing/SWT UI:
WindowBuilder is built as a plug-in to Eclipse and the various Eclipse-based IDEs (RAD, RSA, MyEclipse, JBuilder, etc.). The plug-in builds an abstract syntax tree (AST) to navigate the source code and uses GEF to display and manage the visual presentation.
Develop Java graphical user interfaces in minutes for Swing, SWT, RCP and XWT with WindowBuilder Pro's WYSIWYG, drag-and-drop interface. Use wizards, editors and intelligent layout assist to automatically generate clean Java code, with the visual design and source always in sync.
The project website: http://www.eclipse.org/windowbuilder/
To install the plugin in Eclipse: http://www.eclipse.org/windowbuilder/download.php
Example:
abc 1000 3452 2463 2343 2176 7654 3452 8765 5643 3452
abc 1000 3452 2463 2343 2176 7654 3452 8765 5643 3452
tas 3420 3562 2123 1343 2176 7654 3252 8765 5643 3452
aer 1000 3452 2463 2343 2176 7654 3452 8765 5643 3452
tas 3420 3562 2123 1343 2176 7654 3252 8765 5643 3452
UNIX:display the no of occurance and the record
> sort f1.txt|uniq -c
2 abc 1000 3452 2463 2343 2176 7654 3452 8765 5643 3452
1 aer 1000 3452 2463 2343 2176 7654 3452 8765 5643 3452
2 tas 3420 3562 2123 1343 2176 7654 3252 8765 5643 3452
display only the duplicate records
> sort f1.txt|uniq -dabc 1000 3452 2463 2343 2176 7654 3452 8765 5643 3452
tas 3420 3562 2123 1343 2176 7654 3252 8765 5643 3452
display distinct records
> sort f1.txt|uniqabc 1000 3452 2463 2343 2176 7654 3452 8765 5643 3452
aer 1000 3452 2463 2343 2176 7654 3452 8765 5643 3452
tas 3420 3562 2123 1343 2176 7654 3252 8765 5643 3452
Reference:
Shell: How To Remove Duplicate Text Lines
Windows:
Notepad++ can sort by line, and remove the duplicate lines at the same time.
- Open the menu under: TextFX-->TextFX Tools
Make sure "sort outputs only unique..." is checked
select a block of text (ctrl-a to select the entire document).
click "sort lines case sensitive" or "sort lines case insensitive"
1.安裝JAVA環(huán)境
sudo apt-get install sun-java5-jre
2.下載tomcat: http://tomcat.apache.org/
3.解壓tomcat
$sudo tar zxvf apache-tomcat-7.0.26.tar.gz -C /opt
$sudo mv /opt/apache-tomcat-7.0.26.tar.gz /opt/tomcat
4.啟動(dòng)tomcat
$sudo /opt/tomcat/bin/startup.sh
如果能看到下列提示,就表明啟動(dòng)成功了!
>Using CATALINA_BASE: /opt/tomcat
>Using CATALINA_HOME: /opt/tomcat
>Using CATALINA_TMPDIR: /opt/tomcat/temp
>Using JRE_HOME: /usr/lib/j2sdk1.5-sun
打開(kāi)Firefox,在地址欄中輸入http://localhost:8080,如果出來(lái)Tomcat的缺省界面,說(shuō)明測(cè)試通過(guò)!
5.停止Tomcat服務(wù)
$sudo /opt/tomcat/bin/shutdown.sh
1.下載安裝 RubyInstaller: http://rubyforge.org/frs/?group_id=167&release_id=46588
2. 檢查 RubyGems 版本,須高于 1.3.6
gem -v
3.如果版本不是最新,可以通過(guò)下面的命令更新至最新版本:
gem update --system
gem uninstall rubygems-update
4.安裝 Rails:
gem install rails
1.按照github上的指南配置(
http://help.github.com/win-set-up-git/)基礎(chǔ)的git環(huán)境。
2.在github上創(chuàng)建一個(gè)Repository。
3.在Eclipse中通過(guò)“Eclipse Marketplaces”,在Market Places里安裝egit。
4.在Eclipse中生public key, 并添加到GitHub Repository中。
Eclipse中通過(guò):performance -> SSH2 -> Key Management -> Gernerate RSA Key 生成 SSH 的 public key。
在GitHub中通過(guò):edit your profile -> ssh key -> Add SSH Key 添加SSH Key, 把上面生成的 public key 拷貝到這里,保存。
5.Eclipse里File菜單,Import,即可從git導(dǎo)入剛添加到git的項(xiàng)目了。
6.修改,并提交。在項(xiàng)目上點(diǎn)右鍵–>team–>commit。commit是commit到本機(jī)的git庫(kù),而push才是同步到github。
1.下載最新版 Eclipse:
官方下載:http://www.eclipse.org/downloads/
2.解壓下載的壓縮包:
$sudo tar xvfz eclipse-SDK-3.1.2-linux-gtk.tar.gz -C /opt
這個(gè)時(shí)候,就可以在 /opt 文件夾中看到出現(xiàn)了一個(gè)eclipse的文件夾,雙擊其中的eclipse文件就可以運(yùn)行eclipse了。
3.在菜單設(shè)置Eclipse選項(xiàng): $gedit ~/.local/share/applications/eclipse-user.desktop
插入一下內(nèi)容:
[Desktop Entry]
Comment=Java IDE
Name=Eclipse
Exec=/opt/eclipse/eclipse
Encoding=UTF-8
Terminal=false
Type=Application
Categories=Application;Development;
Icon=/opt/eclipse/icon.xpm
方法1: 用SET PASSWORD命令
mysql -u root
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');
方法2:用mysqladmin
mysqladmin -u root password "newpass"
如果root已經(jīng)設(shè)置過(guò)密碼,采用如下方法
mysqladmin -u root password oldpass "newpass"
方法3: 用UPDATE直接編輯user表
mysql -u root
mysql> use mysql;
mysql> UPDATE user SET Password = PASSWORD('newpass') WHERE user = 'root';
mysql> FLUSH PRIVILEGES;
方法4: 在丟失root密碼的時(shí)候,可以這樣
mysqld_safe --skip-grant-tables&
mysql -u root mysql
mysql> UPDATE user SET password=PASSWORD("new password") WHERE user='root';
mysql> FLUSH PRIVILEGES;
---------------------------------------
經(jīng)測(cè)試,方法三修改成功,其他三種方法沒(méi)有測(cè)試。
一.問(wèn)題環(huán)境:
Eclipse3.4 + Tomcat6.0.20
二.問(wèn)題現(xiàn)象:
在Eclipse下啟動(dòng)Tomcat6時(shí),控制臺(tái)會(huì)有下面警告信息
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:...' did not find a matching property.
三.詳細(xì)解決辦法:
1.打開(kāi)服務(wù)器視圖:窗口 > 顯示視圖 > 服務(wù)器 > 服務(wù)器
2.雙擊服務(wù)器列表中的Tomcat,打開(kāi)“服務(wù)器概述”窗口
3.選中"Publish module contexts to separate XML files"選項(xiàng)。
小提示:如果Tomcat處于啟動(dòng)狀態(tài),請(qǐng)先停止,否則,在保存服務(wù)器設(shè)置時(shí),提示不能保存。
Here is a simple way to generate a analyze report by using FindBugs plugins in RSA:
- Using FindBugs to scan the code and save the result as XML file
- the XML report is in a bad format for reading, we can use XSL file to make it easy and clear to read:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="summary.xsl"?>
- Use Internet Explore to open the XML report, now we get a report:
Note: FindBugs provided following xsl files for different format: 1、default.xsl;
2、fancy.xsl;
3、fancy-hist.xsl;
4、plain.xsl;
5、summary.xsl;
摘要: GZIP
1. Compressing a File in the GZIP Format
2. Uncompressing a File in the GZIP Format
ZIP
1. Creating a ZIP File
2. Listing the Contents of a ZIP File
3. Retrieving a Compressed File from a ZIP File
閱讀全文
摘要: 使用 JSEclipse,JavaScript 程序員現(xiàn)在有了自己的 Eclipse 插件,該插件將提供許多重要功能來(lái)輔助開(kāi)發(fā) JavaScript 應(yīng)用程序。像 Eclipse 多年來(lái)為 Java? 語(yǔ)言和其他語(yǔ)言提供了易用性一樣,JSEclipse 為 JavaScript 開(kāi)發(fā)人員提供了同樣的優(yōu)點(diǎn)。
閱讀全文
分享一個(gè)不錯(cuò)的編寫(xiě)properties文件的Eclipse插件(plugin),有了它我們?cè)诰庉嬕恍┖?jiǎn)體中文、繁體中文等
Unicode文本時(shí),就不必再使用native2ascii編碼了。您可以通過(guò)Eclipse中的軟件升級(jí)(Software
Update)安裝此插件,步驟如下:
1、展開(kāi)Eclipse的Help菜單,將鼠標(biāo)移到Software Update子項(xiàng),在出現(xiàn)的子菜單中點(diǎn)擊Find and Install;
2、在Install/Update對(duì)話框中選擇Search for new features to install,點(diǎn)擊Next;
3、在Install對(duì)話框中點(diǎn)擊New Remote Site;
4、在New Update Site對(duì)話框的Name填入“PropEdit”或其它任意非空字符串,在URL中填入http://propedit.sourceforge.jp/eclipse/updates/;
5、在Site to include to search列表中,除上一步加入的site外的其它選項(xiàng)去掉,點(diǎn)擊Finsih;
6、在彈出的Updates對(duì)話框中的Select the features to install列表中將所有結(jié)尾為“3.1.x”的選項(xiàng)去掉(適用于Eclipse 3.2版本的朋友);
7、點(diǎn)擊Finish關(guān)閉對(duì)話框;
8、在下載后,同意安裝,再按提示重啟Eclipse,在工具條看到形似vi的按鈕表示安裝成功,插件可用。此時(shí),Eclpise中所有properties文件的文件名前有綠色的P的圖標(biāo)作為標(biāo)識(shí)。
摘要: 在Eclipse中遇到The type XXX cannot be resolved. It is indirectly referenced from required .class files錯(cuò)誤.....,查找的解決辦法如下:
閱讀全文
摘要: 要對(duì)資料庫(kù)管理系統(tǒng)進(jìn)行操作,最基本的就是使用SQL(Standard Query Language)語(yǔ)句,大部份的資料庫(kù)都支援標(biāo)準(zhǔn)的SQL語(yǔ)句,然而也有一些特定於資料庫(kù)的SQL語(yǔ)句,應(yīng)用程式配合SQL語(yǔ)句進(jìn)行資料庫(kù)查詢(xún)時(shí),若使用到特定於資料庫(kù)的SQL語(yǔ)句,程式本身會(huì)有相依於特定資料庫(kù)的問(wèn)題。
使用Hibernate時(shí),即使您不了解SQL的使用與撰寫(xiě),也可以使用它所提供的API來(lái)進(jìn)行SQL語(yǔ)句查詢(xún),org.hibernate.Criteria對(duì)SQL進(jìn)行封裝,您可以從Java物件的觀點(diǎn)來(lái)組合各種查詢(xún)條件,由Hibernate自動(dòng)為您產(chǎn)生SQL語(yǔ)句,而不用特別管理SQL與資料庫(kù)相依的問(wèn)題。
閱讀全文
整理自:
SpringSide中文論壇
實(shí)際執(zhí)行任務(wù)的Class: CourseService
public
?
class
?CourseService?
{?


??
public
?
void
?sendCourseEnrollmentReport()
{?
????System.out.println(
"
HelloWorld
"
);?
??}
?

}
調(diào)度任務(wù)的Class: TaskApp
import
?org.springframework.beans.factory.BeanFactory;?
import
?org.springframework.beans.factory.xml.XmlBeanFactory;?
import
?org.springframework.core.io.FileSystemResource;?


public
?
class
?TaskApp?
{?


??
public
?
static
?
void
?main(String[]?args)?
throws
?Exception?
{?
????BeanFactory?factory?
=
?
new
?XmlBeanFactory(
new
?FileSystemResource(?
"
WebRoot/WEB-INF/classes/scheduleTask.xml
"
));?
????factory.getBean(
"
z
"
);?
??}
?
????
}
?
配置調(diào)度執(zhí)行任務(wù)的配置文件:
scheduleTask.xml
<?
xml?version="1.0"?encoding="UTF-8"
?>
?
<!
DOCTYPE?beans?PUBLIC?"-//SPRING//DTD?BEAN//EN"?"http://www.springframework.org/dtd/spring-beans.dtd"
>
?
<
beans
>
?
??
<!--
起動(dòng)Bean
-->
?
??
<
bean?
id
="z"
?class
="org.springframework.scheduling.quartz.SchedulerFactoryBean"
>
?
????
<
property?
name
="triggers"
>
?
??????
<
list
>
?
????
<
ref?
bean
="cronReportTrigger"
?
/>
?
??????
</
list
>
?
????
</
property
>
?
??
</
bean
>
?
??
<!--
實(shí)際的工作Bean
-->
?
??
<
bean?
id
="courseService"
?class
="CourseService"
>
??
</
bean
>
?
??
<!--
jobBean用于設(shè)定啟動(dòng)時(shí)運(yùn)用的Bean與方法
-->
?
??
<
bean?
id
="scheduledReportJobDetail"
?class
="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"
>
?
????
<
property?
name
="targetObject"
>
?
????
<
ref?
bean
="courseService"
?
/>
?
????
</
property
>
?
????
<
property?
name
="targetMethod"
>
?
??????
<
value
>
sendCourseEnrollmentReport
</
value
>
?
????
</
property
>
?
??
</
bean
>
?
??
<!--
定時(shí)器設(shè)定起動(dòng)頻率&啟動(dòng)時(shí)間我設(shè)的是每5秒起動(dòng)一次?(0?0?4?*?*??每日四點(diǎn)起動(dòng)
.)
-->
?
??
<
bean?
id
="cronReportTrigger"
?class
="org.springframework.scheduling.quartz.CronTriggerBean"
>
?
????
<
property?
name
="jobDetail"
>
?
????
<
ref?
bean
="scheduledReportJobDetail"
?
/>
?
????
</
property
>
?
????
<
property?
name
="cronExpression"
>
?
??????
<
value
>
10,15,20,25,30,35,40,45,50,55?*?*?*?*??
</
value
>
?
????
</
property
>
?
??
</
bean
>
?
</
beans
>
關(guān)于配置文件中參數(shù)cronExpression的說(shuō)明:
字段?允許值?允許的特殊字符?
秒?
0
-
59
?
,
?-?*?/?
分?
0
-
59
?
,
?-?*?/?
小時(shí)?
0
-
23
?
,
?-?*?/?
日期?
1
-
31
?
,
?-?*???/?L?W?C?
月份?
1
-
12
?或者?JAN-DEC?
,
?-?*?/?
星期?
1
-
7
?或者?SUN-SAT?
,
?-?*???/?L?C?#?
年(可選)?留空
,
?
1970
-
2099
?
,
?-?*?/?
表達(dá)式意義:
"
0?0?12?*?*??
"
?每天中午12點(diǎn)觸發(fā)?
"
0?15?10???*?*
"
?每天上午10:15觸發(fā)?
"
0?15?10?*?*??
"
?每天上午10:15觸發(fā)?
"
0?15?10?*?*???*
"
?每天上午10:15觸發(fā)?
"
0?15?10?*?*???2005
"
?2005年的每天上午10:15觸發(fā)?
"
0?*?14?*?*??
"
?在每天下午2點(diǎn)到下午2:59期間的每1分鐘觸發(fā)?
"
0?0/5?14?*?*??
"
?在每天下午2點(diǎn)到下午2:55期間的每5分鐘觸發(fā)?
"
0?0/5?14,18?*?*??
"
?在每天下午2點(diǎn)到2:55期間和下午6點(diǎn)到6:55期間的每5分鐘觸發(fā)?
"
0?0-5?14?*?*??
"
?在每天下午2點(diǎn)到下午2:05期間的每1分鐘觸發(fā)?
"
0?10,44?14???3?WED
"
?每年三月的星期三的下午2:10和2:44觸發(fā)?
"
0?15?10???*?MON-FRI
"
?周一至周五的上午10:15觸發(fā)?
"
0?15?10?15?*??
"
?每月15日上午10:15觸發(fā)?
"
0?15?10?L?*??
"
?每月最后一日的上午10:15觸發(fā)?
"
0?15?10???*?6L
"
?每月的最后一個(gè)星期五上午10:15觸發(fā)?
"
0?15?10???*?6L?2002-2005
"
?2002年至2005年的每月的最后一個(gè)星期五上午10:15觸發(fā)?
"
0?15?10???*?6#3
"
?每月的第三個(gè)星期五上午10:15觸發(fā)?
0
?
6
?*?*?*??????????每天早上6點(diǎn)??
0
?*/
2
?*?*?*????????每?jī)蓚€(gè)小時(shí)??
0
?
23
-
7
/
2
,
8
?*?*?*??晚上11點(diǎn)到早上8點(diǎn)之間每?jī)蓚€(gè)小時(shí),早上八點(diǎn)??
0
?
11
?
4
?*?
1
-
3
???????每個(gè)月的4號(hào)和每個(gè)禮拜的禮拜一到禮拜三的早上11點(diǎn)??
0
?
4
?
1
?
1
?*??????????1月1日早上4點(diǎn)?
Download:
Quartz
相關(guān)文檔:
http://blog.csdn.net/ezerg/archive/2004/09/24/115894.aspx
http://blog.csdn.net/yujiebo025/archive/2005/09/13/479049.aspx
http://blog.csdn.net/mengz/archive/2005/01/13/252267.aspx
http://blog.csdn.net/jorwang/archive/2005/05/12/374111.aspx
http://blog.csdn.net/Mailbomb/archive/2005/10/26/517128.aspx
http://blog.csdn.net/stonecai/archive/2007/01/06/1475745.aspx
http://landerchan.spaces.live.com/Blog/cns!8759A7C5A9737DC!116.entry
http://hanxinyu.javaeye.com/blog/37000
http://www.onjava.com/pub/a/onjava/2004/03/10/quartz.html
摘要: JDK 5 新增一些特性來(lái)簡(jiǎn)化開(kāi)發(fā),這些特性包括泛型,for-each 循環(huán),自動(dòng)裝包/拆包,枚舉,可變參數(shù), 靜態(tài)導(dǎo)入 。使用這些特性有助于我們編寫(xiě)更加清晰,精悍,安全的代碼。
閱讀全文
<
ec:table
items
="itemList"
var
="item"
action
="${pageContext.request.contextPath}/query.do"
retrieveRowsCallback
="limit"
filterRowsCallback
="limit"
sortRowsCallback
="limit"
>
<
ec:exportXls
fileName
="CouponList.xls"
tooltip
="導(dǎo)出 Excel"
/>
<
ec:row
>
<
ec:column
property
="rowcount"
cell
="rowCount"
sortable
="false"
title
="序號(hào)"
/>
<
ec:column
property
="id"
title
="編號(hào)"
/>
<
ec:column
property
="type"
title
="種類(lèi)"
>
${typeMap[item.type]}
</
ec:column
>
<
ec:column
property
="name"
title
="名稱(chēng)"
/>
<
ec:column
property
="beginDate"
title
="開(kāi)始時(shí)間"
cell
="calendar"
format
="date"
/>
<
ec:column
property
="endDate"
title
="結(jié)束時(shí)間"
cell
="calendar"
format
="date"
/>
<
ec:column
property
="state"
title
="狀態(tài)"
>
${statusmap[coupon.status]}
</
ec:column
>
<
ec:column
property
="edit"
title
="操作"
sortable
="false"
viewsAllowed
="html"
style
="width: 56px;text-align: center"
>
<
A
href
="<c:url value="
/security/user.do?method
=selectRoles&userId=${user.id}"
/>
">
<
img
src
="<c:url value="
/images/icon/16x16/manage.gif"
/>
" border="0"/>
</
A
>
</
ec:column
>
</
ec:row
>
</
ec:table
>
其中:
retrieveRowsCallback="limit"
filterRowsCallback="limit"
sortRowsCallback="limit"
指定了callback函數(shù) limit
在controller 中的處理:
/**
* 列表查看
*/
protected
void
onList(HttpServletRequest request,HttpServletResponse response, ModelAndView mav)
throws
Exception
{
Limit limit
=
ExtremeTablePage.getLimit(request);
Map map
=
WebUtils.getParametersStartingWith(request,
"
search_
"
);
Page page
=
service.queryForPage(map,ExtremeTablePage.getSort(limit),limit.getPage(), limit.getCurrentRowsDisplayed());
mav.addObject(
"
itemList
"
, page.getResult());
mav.addObject(
"
totalRows
"
,page.getTotalCount());
}
摘自:
chinaunix
SELECT
??S.SID?SESSION_ID,?S.USERNAME,?DECODE(LMODE,?
0
,?
'
None
'
,?
1
,?
'
Null
'
,?
2
,?
'
Row-S?(SS)
'
,?
3
,?
'
Row-X?(SX)
'
,??
4
,?
'
Share
'
,?
5
,?
'
S/Row-X?(SSX)
'
,??
6
,?
'
Exclusive
'
,?TO_CHAR(LMODE))?MODE_HELD,?DECODE(REQUEST,?
0
,?
'
None
'
,?
1
,?
'
Null
'
,?
2
,?
'
Row-S?(SS)
'
,?
3
,?
'
Row-X?(SX)
'
,?
4
,?
'
Share
'
,?
5
,?
'
S/Row-X?(SSX)
'
,?
6
,?
'
Exclusive
'
,?TO_CHAR(REQUEST))?MODE_REQUESTED,?O.OWNER
||
'
.
'
||
O.
OBJECT_NAME
||
'
?(
'
||
O.OBJECT_TYPE
||
'
)
'
,?S.TYPE?LOCK_TYPE,?L.ID1?LOCK_ID1,?L.ID2?LOCK_ID2?
FROM
?V$LOCK?L,?SYS.DBA_OBJECTS?O,?V$SESSION?S?
WHERE
?L.SID?
=
?S.SID?
AND
??L.ID1?
=
?O.
OBJECT_ID
執(zhí)行上記SQL語(yǔ)句,可以查尋到數(shù)據(jù)庫(kù)中的鎖的情報(bào).
SESSION_ID, USERNAME,??MODE_HELD,??MODE_REQUESTED, OBJECT_NAME, LOCK_TYPE, LOCK_ID
分別是 擁有鎖的SESSION_ID,擁有鎖的USERNAME,鎖的執(zhí)行模式MODE_HELD,鎖的請(qǐng)求MODE_REQUESTED,鎖所在的數(shù)據(jù)庫(kù)對(duì)象名
,鎖的類(lèi)型,鎖的ID
摘要: Java中的多線程使用synchronized關(guān)鍵字實(shí)現(xiàn)同步.為了避免線程中使用共享資源的沖突,當(dāng)線程進(jìn)入synchronized的共享對(duì)象時(shí),將為共享對(duì)象加上鎖,阻止其他的線程進(jìn)入該共享對(duì)象.但是,正因?yàn)檫@樣,當(dāng)多線程訪問(wèn)多個(gè)共享對(duì)象時(shí),如果線程鎖定對(duì)象的順序處理不當(dāng)話就有可能線程間相互等待的情況,即常說(shuō)的: 死鎖現(xiàn)象.
閱讀全文
摘要: Java Socket簡(jiǎn)單入門(mén)例子.
閱讀全文
Dear all:
result love(boy, girl)
{
if ( boy.有房() and boy.有車(chē)() )
{boy.set(nothing);
return girl.嫁給(boy); }
if ( girl.愿意等() )
{
while( ! (boy.賺錢(qián) > 100,000 and girl.感情 > 8 )
{for ( day=1; day <=365; day++)
{if ( day == 情人節(jié) )
if ( boy.give girl(玫瑰) )
girl.感情++;
else
girl.感情--;
if( day == girl.生日)
if ( boy.give girl(玫瑰) )
girl.感情++;
else
girl.感情--;
boy.拼命賺錢(qián)();
}
}
if ( boy.有房() and boy.有車(chē)() )
{ boy.set(nothing);
return girl.嫁給(boy);
}
年齡++;
girl.感情--;
return girl.goto( another_boy);
}
(注:稍懂點(diǎn)C語(yǔ)言的應(yīng)該都能看懂吧!)
摘要: 組件(Component)類(lèi)必須在類(lèi)一級(jí)定義@Embeddable注解.
在特定的實(shí)體的關(guān)聯(lián)屬性上使@Embedded和@AttributeOverride注解可以覆蓋該屬性對(duì)應(yīng)的嵌入式對(duì)象的字段映射:
閱讀全文
摘要: 1.簡(jiǎn)單主鍵:
使用@Id注解可以將實(shí)體bean中的某個(gè)屬性定義為標(biāo)識(shí)字段.使用 @GeneratedValue注解可以定義標(biāo)識(shí)字段的生成策略:
AUTO - 可以是identity類(lèi)型的字段,或者sequence類(lèi)型或者table類(lèi)型,取決于不同的底層數(shù)據(jù)庫(kù).
TABLE - 使用表保存id值
IDENTITY - identity字段
SEQUENCE - sequence
閱讀全文
摘要: 1. 基本屬性映射
通過(guò) @Basic 可以聲明屬性的存取策略:
@Basic(fetch=FetchType.EAGER) 即時(shí)獲取(默認(rèn)的存取策略)
@Basic(fetch=FetchType.LAZY) 延遲獲取
閱讀全文
摘要: Displaytag1.1支持在外部實(shí)現(xiàn)大數(shù)據(jù)量分頁(yè)。主要有兩種方式實(shí)現(xiàn):
Displaytag 1.1 offers two alternative ways for working with partial lists:
the first one uses the valuelist pattern, and requires that the object that you give to displaytag implements the org.displaytag.pagination.PaginatedList interface. You can pass this object to displaytag as an usual list, and it will extract paging and sorting information from it. This way is more recommended if you have to build your backend layer and you can easily
閱讀全文
1.打開(kāi)
Google主頁(yè)
2.把瀏覽器地址欄清空,再將下面的內(nèi)容復(fù)制到地址欄內(nèi):
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);
3.回車(chē)....
摘要: Launchy,一款免費(fèi)開(kāi)源軟件實(shí)現(xiàn)了鍵盤(pán)快捷啟動(dòng)程序的功能。
你只需要輸入程序的名稱(chēng),Launchy就可以自動(dòng)幫你匹配出你想要運(yùn)行的程序:
閱讀全文
摘要: Table
Table用來(lái)定義entity主表的name,catalog,schema等屬性。
元數(shù)據(jù)屬性說(shuō)明:
name: 表名
catalog: 對(duì)應(yīng)關(guān)系數(shù)據(jù)庫(kù)中的catalog
schema:對(duì)應(yīng)關(guān)系數(shù)據(jù)庫(kù)中的schema
UniqueConstraints:定義一個(gè)UniqueConstraint數(shù)組,指定需要建唯一約束的列
閱讀全文
摘要: Apache的Jakata項(xiàng)目的POI子項(xiàng)目,目標(biāo)是處理ole2對(duì)象。
POI可以到
http://www.apache.org/dyn/closer.cgi/jakarta/poi/
下載。...
閱讀全文
摘要: 方法一:循環(huán)元素刪除
方法二:通過(guò)HashSet剔除
方法三:刪除ArrayList中重復(fù)元素,保持順序
閱讀全文
摘要: As per the documentation on MySQL I moved the storage of passwords from using Password() to using MD5(). I read a number of places that stated that this was a method that couldn't be reversed and it was far more secure than the previous method. I was feeling confident that life was about to get a little more secure. While going through my daily RSS feeds and mailing lists for SpikeSource, I happenned upon a thread about someone discussing how easy it was to break MD5 hashes. It was a simple matt
閱讀全文
摘要: name="resultList" 將記錄集存在session或者request中的鍵值
pagesize="100" 每頁(yè)顯示100條數(shù)據(jù)
sort="external" 外部排序
id="row" 表格id值,用于程序得相關(guān)的參數(shù)
partialList="true" 分段從數(shù)據(jù)庫(kù)中讀數(shù)據(jù)
size="resultSize" 記錄的總條數(shù),用于計(jì)算總頁(yè)數(shù)
閱讀全文
摘要: Apache jakarta
各項(xiàng)目主要用途及簡(jiǎn)單說(shuō)明
來(lái)源出處:http://www.javaworld.com.tw/jute/post/view?bid=11&id=1672
為了讓大...
閱讀全文
一定得是N層結(jié)構(gòu),
層數(shù)越多越好,層少了用戶(hù)會(huì)誤會(huì)我們不重視,
什么數(shù)據(jù)訪問(wèn)層呀,實(shí)體控制層啊,能給他加上的全加上。
程序員一定都得是老鳥(niǎo),30以下基本不考慮,
還得清一色的外企空降兵,
都有10年以上編程經(jīng)驗(yàn)的那種,用過(guò)的語(yǔ)言越多越好,
編程都不帶查MSDN的,牛吧!
程序員個(gè)個(gè)都配IBM筆記本,
CPU要3G以上的,內(nèi)存硬盤(pán)和屏幕都要最大的,
擴(kuò)展槽別剩下,能插上的全插上。
能安的操作系統(tǒng)全安上,開(kāi)機(jī)一屏幕上就一堆系統(tǒng)等你選,
倍有面子!
系統(tǒng)平臺(tái)就得是J2EE,人家競(jìng)爭(zhēng)對(duì)手除了C++就是JAVA,
你要用一.NET都不好意思和別人打招呼。
你說(shuō)這樣的系統(tǒng)設(shè)計(jì)出來(lái)得賣(mài)多少錢(qián)?
我覺(jué)得怎么也得100萬(wàn)吧?
100萬(wàn),那是單機(jī)版!
1000萬(wàn)起!
你還別嫌太貴,還不免實(shí)施服務(wù)費(fèi)。
你得研究有錢(qián)用戶(hù)得心理,
愿意花1000萬(wàn)買(mǎi)這套軟件用的,
根本不在乎再多花上幾百萬(wàn)!
什么叫軟件泡沫你知道么?
軟件泡沫就是做都做最復(fù)雜的,
用就得用最貴的,還得特難用,顯得用戶(hù)水平高。
所以我們搞軟件的口號(hào)就是:
不求好用,但求費(fèi)勁!
摘要: 參考文檔:使用 Spring 更好地處理 Struts 動(dòng)作
可以通過(guò)三種方式實(shí)現(xiàn)Spring管理Struts Action:
1.使用 Spring 的 ActionSupport 類(lèi)整合 Structs
2.使用 Spring 的 DelegatingRequestProcessor 覆蓋 Struts 的 RequestProcessor
3.將 Struts Action 管理委托給 Spring 框架
閱讀全文
摘要: DCBP連接池的簡(jiǎn)單使用方法。
閱讀全文
摘要: 元字符及其在正則表達(dá)式中行為的列表
閱讀全文
摘要: 1.如果存在就更新,不存在就插入用一個(gè)語(yǔ)句實(shí);
2.分頁(yè)算法;
3.抽取/刪除重復(fù)記錄;
閱讀全文
摘要: EssentialPIM 是一套非常不錯(cuò)的個(gè)人時(shí)間日程安排軟件,它具有相當(dāng)方便的操作接口,讓使用者能夠?qū)τ谒哦ǖ男谐桃荒苛巳唬恳粋€(gè)事件也都允許使用者進(jìn)行夾檔,讓你可以把例如會(huì)議結(jié)果、計(jì)劃案等數(shù)據(jù)附帶于該記錄中。往后,使用者就能夠直接對(duì)所輸入的數(shù)據(jù)進(jìn)行搜尋,讓你不論在何時(shí)都能夠找到該事件發(fā)生時(shí)的一些特定信息。
閱讀全文
摘要: Windows Live Writer
MS推出的寫(xiě)日志工具,一個(gè)桌面程序,需要在本地安裝,并且需要安裝 .NET Framework SDK.界面UI十分友好,支持主要的Blog API,包括:Windows Live Spaces,RSD ,Metaweblog API,Movable Type API 和 WordPress.
閱讀全文
摘要: JSTL包含以下的標(biāo)簽:
常用的標(biāo)簽:如 c:out、c:remove、c:catch、c:set等
條件標(biāo)簽:如 c:if、c:when、c:choose、c:otherwise等
URL標(biāo)簽:如 c:import、c:redirect 和 c:url 等
XML標(biāo)簽:如 xml:out 等
國(guó)際化輸出標(biāo)簽:如 fmt:timeZone 等
SQL標(biāo)簽:如 sql:query、sql:update、sql:transaction 等
閱讀全文
摘要: 在SpringSide里翻到一個(gè)好東西: jodd:form
閱讀全文
使用forward的話,網(wǎng)址列上並不會(huì)出現(xiàn)被轉(zhuǎn)發(fā)的目標(biāo)位址,而且forward是在Web應(yīng)用程式之內(nèi)進(jìn)行,可以訪問(wèn)Web應(yīng)用程式的隱藏目錄,像是WEB-INF,然而forward只能在Web應(yīng)用程式中進(jìn)行,不能指定至其它的Web應(yīng)用程式位址。
使用redirect的話,是要求客戶(hù)端瀏覽器重新發(fā)出一個(gè)指定的請(qǐng)求位址,因此網(wǎng)址列上會(huì)出現(xiàn)被重導(dǎo)的目錄位址,重導(dǎo)的請(qǐng)求是由瀏覽器發(fā)出,所以不能訪問(wèn)Web應(yīng)用程式中的隱藏目錄,像是WEB-INF,然而重導(dǎo)是重新要求一個(gè)網(wǎng)頁(yè),所以可以指定至其它的Web應(yīng)用程式位址。
摘要: Hibernate中支持3種形式實(shí)現(xiàn)繼承關(guān)系:
1. Table per concrete class 表與子類(lèi)之間獨(dú)立一對(duì)一關(guān)系
2. Table per subclass 每個(gè)子類(lèi)對(duì)應(yīng)一張子表,并與主類(lèi)共享主表
3. Table per class hierarchy 表與類(lèi)一對(duì)多關(guān)系
閱讀全文
摘要: 數(shù)據(jù)庫(kù)中提供了兩種字段類(lèi)型 Blob 和 Clob 用于存儲(chǔ)大型字符串或二進(jìn)制數(shù)據(jù)(圖片)。
Blob 采用單字節(jié)存儲(chǔ),適合保存二進(jìn)制數(shù)據(jù),如圖片文件。
Clob 采用多字節(jié)存儲(chǔ),適合保存大型文本數(shù)據(jù)。
閱讀全文
摘要: 手機(jī)可以有多少創(chuàng)意應(yīng)用?無(wú)疑的,日本絕對(duì)是重要的指標(biāo),但也別忽略歐洲電信業(yè)者的企圖,他們不只將手機(jī)當(dāng)做是通話的工具,它可以變成貼身的秘書(shū)、全天候無(wú)休的最佳伴游,當(dāng)然也會(huì)是幫助你隨時(shí)掌控周遭動(dòng)態(tài)變化的秘密狗仔,十二種行動(dòng)生活提案,讓你每天的生活更有行動(dòng)力!
閱讀全文
摘要: Oralce中的to_date()函數(shù)用于將字符串轉(zhuǎn)換為日期對(duì)象,具體使用格式為: to_date( string, [ format_mask ], [ nls_language ] )
1. ORA-01810: format code appears twice
2. ORA-01722: invalid number
閱讀全文
摘要: 使用過(guò)開(kāi)源緩存包(如:EHCache)都知道,緩存策略中主要分為FIFO,LRU,LFU等幾種。而Jakarta Commons中提供的 org.apache.commons.collections.map.LRUMap 可用來(lái)保存最近使用的幾條記錄,提供了LRU(Least Recently Used)緩存策略的實(shí)現(xiàn)。
閱讀全文
摘要: Greg Stein并沒(méi)有忽悠我們,在周四(美國(guó)時(shí)間)的OSCON大會(huì)上,他宣布了這個(gè)新服務(wù),Google也于今天推出了新的開(kāi)源服務(wù),即Project Hosting。這個(gè)新服務(wù)增加在Google Code里,作為其中一部分。通過(guò)這項(xiàng)新服務(wù),用戶(hù)可以搜索各種開(kāi)源項(xiàng)目,也可以自己上傳新項(xiàng)目。但前提是用戶(hù)必須擁有一個(gè)Gmail帳號(hào)。你可以把Project Hosting看作是一個(gè)開(kāi)源代碼庫(kù)。
閱讀全文
摘要: 在雄杰上看到對(duì)搜狗輸入法的介紹,就下載了來(lái)試試,感覺(jué)還不錯(cuò),和紫光輸入法很像,但輸入詞組的匹配率確實(shí)要好些,據(jù)說(shuō)還有一下的特點(diǎn)
閱讀全文
摘要: org.apache.commons.lang.StringUtils中提供許多有用的字符串操作方法,了解這些方法,我們可以避免許多不必要的重復(fù)工作。下面介紹其中比較有用的幾個(gè)方法:
閱讀全文
摘要: 看到網(wǎng)上有同志的介紹將Java程序作成exe文件的方法,寫(xiě)的不錯(cuò),但是也許是這篇文章完成的時(shí)間比較早,許多內(nèi)容已經(jīng)不合適了。我在這里補(bǔ)充幾條:
閱讀全文
摘要: 幾種常用數(shù)據(jù)庫(kù)的JDBC連接字符串
閱讀全文
摘要: Google最近推出在線相冊(cè)服務(wù)Picasa Web Album
閱讀全文
摘要: 本文檔從Eclipse軟件上整理,是列出了標(biāo)準(zhǔn)的快捷鍵,未列出Emacs快捷鍵。
轉(zhuǎn)貼請(qǐng)注明作者和出處。
閱讀全文
摘要: 原文地址:
http://www.aygfsteel.com/ranxiang/articles/23145.html
<!--
?Example?Server?Configuration?File?
-->
...
閱讀全文
摘要: 寫(xiě)過(guò)AWT或Swing程序的人一定對(duì)桌面程序的事件處理機(jī)制印象深刻:通過(guò)實(shí)現(xiàn)Listener接口的類(lèi)可以在特定事件(Event)發(fā)生時(shí),呼叫特定的方法來(lái)對(duì)事件進(jìn)行響應(yīng)。其實(shí)我們?cè)诰帉?xiě)JSP/Servle程序時(shí),也有類(lèi)似的事件處理機(jī)制,所不同的是在JSP/Servlet中是在web.xml中注冊(cè)Listener,由Container在特定事件發(fā)生時(shí)呼叫特定的實(shí)現(xiàn)Listener的類(lèi)。
閱讀全文
摘要: Google推出的服務(wù)五花八門(mén),充滿創(chuàng)意,有些甚至是異想天開(kāi),但是它確實(shí)給用戶(hù)帶來(lái)了全新的體驗(yàn),已經(jīng)改變了許多人的上網(wǎng)習(xí)慣,可以毫不夸張的說(shuō)Google已經(jīng)融入并改變了googler們的日常生活中.下面是我日常常用的一些Google服務(wù),在這里記錄整理如下:
閱讀全文