re: EXT2.0 做的登陸界面 Crying 2009-01-06 10:32
@waiting_over
不好意思 在自己的編譯環(huán)境中 是取的login2.js 這個(gè)名字
發(fā)帖時(shí) 自己 在貼 login2.js 里的內(nèi)容 時(shí) 直接取了個(gè)名字叫l(wèi)ogin.js了
re: Java中對(duì)日期的常用處理 Crying 2008-11-05 11:31
package com.ants.env.util;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.ants.env.finance.implement.ChPlKindImp;
// Referenced classes of package com.ants.util:
// StringUtil
public class DateUtil
{
public DateUtil()
{
}
public static Date convertStrToDate(String s)
{
return convertStrToDate(s, "yyyy-MM-dd");
}
public static Date convertStrToDate(String s, String pattern)
{
try
{
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
return sdf.parse(s);
}
catch(ParseException pe)
{
pe.printStackTrace();
}
return null;
}
public static Timestamp convertStrToTimestamp(String s, String pattern)
{
try
{
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
return new Timestamp(sdf.parse(s).getTime());
}
catch(ParseException pe)
{
pe.printStackTrace();
}
return null;
}
public static java.sql.Date convertStrToSQLDate(String s)
{
if(StringUtil.removeNull(s).equals(""))
return null;
else
return new java.sql.Date(convertStrToDate(s).getTime());
}
public static java.sql.Date convertStrToSQLDate()
{
return new java.sql.Date((new Date()).getTime());
}
public static java.sql.Date convertStrToSQLDate(Date date)
{
return new java.sql.Date(date.getTime());
}
public static Timestamp convertStrToTimestamp(String s)
{
if(StringUtil.removeNull(s).equals(s))
return null;
else
return new Timestamp(convertStrToDate(s).getTime());
}
public static Timestamp convertStrToTimestamp(Date d)
{
if(d == null)
return null;
else
return new Timestamp(d.getTime());
}
public static String getDateString()
{
Calendar c = Calendar.getInstance();
Date d = c.getTime();
return getDateString(d, "yyyy-MM-dd");
}
public static String getDateString(Date d)
{
return getDateString(d, "yyyy-MM-dd");
}
public static String getGeneralDateString(Date d)
{
return getDateString(d, "yyyy-MM-dd HH:mm:ss");
}
public static String getDateString(Date d, String pattern)
{
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
return sdf.format(d);
}
public static boolean equals(Date d)
{
return equals(d, new Date());
}
public static boolean equals(Date d1, Date d2)
{
return getDateString(d1).equals(getDateString(d2));
}
public static java.sql.Date getSQLDate(int year, int month, int date, int hour, int minute, int second)
{
_logger.info("getSQLDate:" + getDate(year, month, date, hour, minute, second).getTime());
java.sql.Date d = new java.sql.Date(getDate(year, month, date, hour, minute, second).getTime());
_logger.info("second:" + String.valueOf(getSecond(d)));
return new java.sql.Date(getDate(year, month, date, hour, minute, second).getTime());
}
public static Date getDate(int year, int month, int date, int hour, int minute, int second)
{
Calendar c = Calendar.getInstance();
c.set(year, month, date, hour, minute, second);
_logger.info("Calendar :" + c.getTime());
return c.getTime();
}
public static int getYear(Date d)
{
Calendar c = Calendar.getInstance();
c.setTime(d);
return c.get(1);
}
public static int getMonth(Date d)
{
Calendar c = Calendar.getInstance();
c.setTime(d);
return c.get(2) + 1;
}
public static int getDay(Date d)
{
Calendar c = Calendar.getInstance();
c.setTime(d);
return c.get(5);
}
public static int getHour(Date d)
{
Calendar c = Calendar.getInstance();
c.setTime(d);
return c.get(11);
}
public static int getMinute(Date d)
{
Calendar c = Calendar.getInstance();
c.setTime(d);
return c.get(12);
}
public static int getSecond(Date d)
{
Calendar c = Calendar.getInstance();
c.setTime(d);
return c.get(13);
}
public static Timestamp convertDateToTimestamp(Date d)
{
return new Timestamp(d.getTime());
}
public static java.sql.Date getNextMonStartDate(String year, String month)
{
int yearInt = Integer.parseInt(year);
int monthInt = Integer.parseInt(month);
if(monthInt == 12)
return convertStrToSQLDate(Integer.toString(yearInt + 1) + "-1-1");
else
return convertStrToSQLDate(year + "-" + Integer.toString(monthInt + 1) + "-1");
}
public static java.sql.Date getMonStartDate(String year, String month)
{
return convertStrToSQLDate(year + "-" + month + "-1");
}
public static java.sql.Date getYearStartDate(String year)
{
return convertStrToSQLDate(year + "-1-1");
}
public static Date getDateAddHour(Date date, int hour)
{
long l = date.getTime();
long n = l + (long)(hour * 60 * 60 * 1000);
Date dateAddHour = new Date(n);
return dateAddHour;
}
public static Date getNextDate(Date date)
{
return getDateAddHour(date, 24);
}
public static Date getSecondDate(Date date)
{
return getDateAddHour(date, 48);
}
public static Date getPreviousDate(Date date)
{
return getDateAddHour(date, -24);
}
public static Date getSQLDateAddHour(java.sql.Date date, int hour)
{
long l = date.getTime();
long n = l + (long)(hour * 60 * 60 * 1000);
java.sql.Date dateAddHour = new java.sql.Date(n);
return dateAddHour;
}
public static java.sql.Date getSQLDateAddYear(java.sql.Date date, int year)
{
Calendar c = Calendar.getInstance();
c.setTime(date);
c.set(1, c.get(1) + year);
return new java.sql.Date(c.getTime().getTime());
}
public static Date getNextSQLDate(java.sql.Date date)
{
return getSQLDateAddHour(date, 24);
}
public static Date getPreviousSQLDate(java.sql.Date date)
{
return getSQLDateAddHour(date, -24);
}
public static String getStartByAllWeek(String year, int weekCount)
{
Calendar cal = Calendar.getInstance();
cal.set(Integer.parseInt(year), 0, 1);
int week = cal.get(7);
cal.add(6, (9 - week) + (weekCount - 1) * 7);
return new String(cal.get(1) + "-" + (cal.get(2) + 1) + "-" + cal.get(5));
}
public static String getStartByFirstDay(String year, int weekCount)
{
return getStartByAllWeek(year, weekCount - 1);
}
public static java.sql.Date getDateByYearQuarter(String year, String quarter)
{
if(quarter.equals("1"))
return convertStrToSQLDate(year + "-01-01");
if(quarter.equals("2"))
return convertStrToSQLDate(year + "-04-01");
if(quarter.equals("3"))
return convertStrToSQLDate(year + "-07-01");
if(quarter.equals("4"))
return convertStrToSQLDate(year + "-10-01");
else
return null;
}
public static String[] getYearlist(int yearCount)
{
return getYearlist(yearCount, 0);
}
public static String[] getYearlist(int yearCount, int addCount)
{
String yearList[] = new String[yearCount];
Date date = new Date();
String select = "";
int year = getYear(date) - yearCount / 2;
for(int i = 0; i < yearCount; i++)
{
if(i == yearCount / 2 + addCount)
select = "selected";
yearList[i] = "<option " + select + ">" + year + "</option>";
select = "";
year++;
}
return yearList;
}
public static String getQuarterName(String quarterId)
{
if(quarterId.equals("1"))
return "\u4E00\u5B63\u5EA6";
if(quarterId.equals("2"))
return "\u4E8C\u5B63\u5EA6";
if(quarterId.equals("3"))
return "\u4E09\u5B63\u5EA6";
if(quarterId.equals("4"))
return "\u56DB\u5B63\u5EA6";
if(quarterId.equals("0"))
return "\u5168\u5E74";
else
return "";
}
public static String getWeekName(Date date)
{
Calendar c = Calendar.getInstance();
c.setTime(date);
int i = c.get(7);
if(i == 1)
return "\u661F\u671F\u5929";
if(i == 2)
return "\u661F\u671F\u4E00";
if(i == 3)
return "\u661F\u671F\u4E8C";
if(i == 4)
return "\u661F\u671F\u4E09";
if(i == 5)
return "\u661F\u671F\u56DB";
if(i == 6)
return "\u661F\u671F\u4E94";
if(i == 7)
return "\u661F\u671F\u516D";
else
return "";
}
public static String getWeekName()
{
return getWeekName(new Date());
}
public static boolean isInTime(Timestamp ts, int hour)
{
long todayTime = (new Date()).getTime();
return ts.getTime() <= todayTime + (long)(hour * 60 * 60 * 1000) && ts.getTime() >= todayTime;
}
public static void main(String args[])
{
System.out.println(convertStrToTimestamp("2005-06-06 14-05-06", "yyyy-MM-dd HH-mm-ss"));
}
public static String getHourSelect(String hour)
{
String hourSelect = "";
hour = StringUtil.removeNull(hour);
if(!"".equals(hour))
hourSelect = "<option value=" + StringUtil.addZero(hour) + " selected>" + StringUtil.addZero(hour) + "</option>";
for(int i = 0; i < 24; i++)
hourSelect = hourSelect + "<option value=" + StringUtil.addZero(i) + " >" + StringUtil.addZero(i) + "</option>";
return hourSelect;
}
public static String getMinuteAndSecondSelect(String MinuteOrSecond)
{
String MinuteOrSecondSelect = "";
MinuteOrSecond = StringUtil.removeNull(MinuteOrSecond);
if(!"".equals(MinuteOrSecond))
MinuteOrSecondSelect = "<option value=" + StringUtil.addZero(MinuteOrSecond) + " selected>" + StringUtil.addZero(MinuteOrSecond) + "</option>";
for(int i = 0; i < 60; i++)
MinuteOrSecondSelect = MinuteOrSecondSelect + "<option value=" + StringUtil.addZero(i) + " >" + StringUtil.addZero(i) + "</option>";
return MinuteOrSecondSelect;
}
// private static Logger _logger;
// static Class class$0; /* synthetic field */
private static final Log _logger = LogFactory.getLog(ChPlKindImp.class);
}
re: Java中對(duì)日期的常用處理 Crying 2008-11-05 11:30
判斷新記錄
private boolean isNewRecord(java.sql.Timestamp date) {
long part = (System.currentTimeMillis() - date.getTime()) / (60 * 60 * 24 * 1000);
return (part >= 0 && part < 8);
}
re: Flex 視頻大全『可下載』 Crying 2008-09-06 01:02
辛苦了 樓主 EMAIL: wangsq777@126.com
re: SimpleDateFormat詳解 Crying 2008-07-29 16:07
【轉(zhuǎn)自www.bitsCN.com】
import java.util.*;
import java.text.*;
public class FormatDate {
public static void main(String[] args) {
Date now = new Date();
DateFormat defaultFormat = DateFormat.getDateInstance();
DateFormat shortFormat = DateFormat.getDateInstance(DateFormat.SHORT);
DateFormat mediumFormat = DateFormat.getDateInstance(DateFormat.MEDIUM);
DateFormat longFormat = DateFormat.getDateInstance(DateFormat.LONG);
DateFormat fullFormat = DateFormat.getDateInstance(DateFormat.FULL);
String defaultDate = defaultFormat.format(now);
String shortDate = shortFormat.format(now);
String mediumDate = mediumFormat.format(now);
String longDate = longFormat.format(now);
String fullDate = fullFormat.format(now);
System.out.println("(Default) Today :" + defaultDate);
System.out.println("(SHORT) Today : " + shortDate);
System.out.println("(MEDIUM) Today :" + mediumDate);
System.out.println("(LONG) Today : " + longDate);
System.out.println("(FULL) Today : " + fullDate);
}
}
運(yùn)行結(jié)果為:
D:\javamail>java FormatDate
(Default) Today :2003-6-15
(SHORT) Today : 03-6-15
(MEDIUM) Today :2003-6-15
(LONG) Today : 2003年6月15日
(FULL) Today : 2003年6月15日 星期日
struts 里面不可以用 select 標(biāo)簽 ?
哈哈 我正在尋求這個(gè) 今天有幸看見(jiàn)你的文章
希望自己能學(xué)習(xí)哈
麻煩 一下 wangsq777@126.com
re: 網(wǎng)頁(yè)實(shí)用的 Crying 2008-04-24 11:03
checkbox或者是radio 判斷選擇項(xiàng)
function checkQuestions()
{
var dd=document.getElementsByName("question");
var isSelected=false;
var StrValue="";
for(var i=0;i<dd.length;i++){
if(dd[i].checked){
isSelected=true;
StrValue+=dd[i].value+",";
}
}
if(!isSelected){
alert('您沒(méi)選擇投票項(xiàng)!');
}else{
alert(StrValue);
clearCheck();
}
}
function clearCheck(){
var dd=document.getElementsByName("question");
for(var i=0;i<dd.length;i++){
dd[i].checked=false;
}
}
re: 樹(shù)形菜單 Crying 2008-03-25 09:04
http://www.aygfsteel.com/sitinspring/archive/2008/03/23/188005.html
很好的一個(gè)菜單列子
re: Java中對(duì)日期的常用處理 Crying 2008-03-10 17:52
//將字符轉(zhuǎn)化為日期DATE
String birth = addStudentForm.getBirthdayYear() + "-"+ addStudentForm.getBirthdayMonth() + "-"+ addStudentForm.getBirhthdayDay();
try {
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
Date date = sd.parse(birth);
student.setBirthday(date);
} catch (ParseException e) {
System.out.println("插入失敗插入失敗插入失敗插入失敗插入失敗插入失敗");
}
////將日期轉(zhuǎn)化為字符串
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
String dd=sd.format(new Date());
////將日期轉(zhuǎn)化為T(mén)imestamp
public static Timestamp convertDateToTimestamp(Date d)
{
if(d == null)
return null;
else
return new Timestamp(d.getTime());
}
------------------------------------------------------------
//第二天
public static Date getNextDate(Date date)
{
return getDateAddHour(date, 24);
}
public static Date getDateAddHour(Date date, int hour)
{
long l = date.getTime();
long n = l + (long)(hour * 60 * 60 * 1000);
Date dateAddHour = new Date(n);
return dateAddHour;
}
//前一天
public static Date getPreviousDate(Date date)
{
return getDateAddHour(date, -24);
}
注解: 加一天 就24 建一天就-24
以此類(lèi)推 2天.....
我用YOYOPlayer 感覺(jué)不錯(cuò)! 謝謝啊
re: 網(wǎng)頁(yè)實(shí)用的 Crying 2007-12-03 10:56
驗(yàn)證 IP
function chk(){
var ip= document.getElementById("v").value;
if(!ip||ip.replace(/\s/g,"")=="")
{
alert("IP不能為空!");
return false;
}
if (!(/^(\d{1,3})(\.\d{1,3}){3}$/.test(ip)))
{ alert("IP格式錯(cuò)誤!");
return false;
}
for (var j=0;j<4;j++)
{ if (ip.split('.')[j]>255)
{ alert("IP中的一段或多段數(shù)字超出范圍!");
return false;
}
}
}
</script>
驗(yàn)證 三網(wǎng)段
<script type="text/javascript">
function chk(){
var ip= document.getElementById("v").value;
if(!ip||ip.replace(/\s/g,"")=="")
{
alert("網(wǎng)段不能為空!");
return false;
}
if (!(/^(\d{1,3})(\.\d{1,3}){2}$/.test(ip)))
{ alert("網(wǎng)段格式錯(cuò)誤!");
return false;
}
for (var j=0;j<3;j++)
{ if (ip.split('.')[j]>255)
{ alert("IP中的一段或多段數(shù)字超出范圍!");
return false;
}
}
}
</script>
打印
<a href=javascript:window.print()>打 印</a>]
re: 網(wǎng)頁(yè)實(shí)用的 Crying 2007-10-18 13:05
select使用 和用span改變字體 用li來(lái)代替<br/>
<html>
<head>
<script language="javascript" type="text/javascript">
function checkSelect(value)
{
alert(document.getElementById("Select1").value);
alert(document.getElementById("Select1").options[document.getElementById("Select1").selectedIndex].text);
alert(value);
}
</script>
<link type="text/css" rel="stylesheet" href="myStyle.css"/>
</head>
<body>
<div align="center"><img src="ww.jpg" width="98%" height="126"></div>
</div>
<select id="Select1" onChange="checkSelect(this.value)">
<option value="00" selected>...</option>
<option value="1">2001</option>
<option value="2">2002</option>
<option value="3">2003</option>
<option value="4">2004</option>
<option value="5">2005</option>
<option value="6">2006</option>
</select>
<ul>
<span>真的<span>|
<span>假的</span>
<li class="shu">vvv</li>
<li><font color="blue">ddddddddd</font></li>
<li><span> dddddddddd</span></li>
</ul>
<p><a href="#">連接的變化</a>
<input name="dd" type="text" id="dd" onMouseOver=this.focus()>
<input type="text" onmouseover=this.focus()>
</p>
</body>
</html>
/******************************************
span{color:blue; font-size:24px}
li{list-style:none}
a:link{color:black; text-decoration:none}
a:visited{color:red; text-decoration:none }
a:hover{color:yellow ; text-decoration: none}
a:active{color:red ; text-decoration:none}
.shu{color: #33FF66}
re: 網(wǎng)頁(yè)實(shí)用的 Crying 2007-10-18 13:00
innerHTML 使用
<html>
<head>
<style type="text/css" >
span.bb{color :red}
</style>
<script type="text/javascript" language="javascript">
function load()
{
alert("vv");
document.getElementById("inner").innerHTML="成功";
}
</script>
</head>
<body onload="load()">
<span class="bb" id="inner">你還沒(méi)輸入</span>
</body>
</html>
re: struts中的文件上傳 Crying 2007-10-11 16:03
下載
public ActionForward download(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
if (logger.isDebugEnabled()) {
logger.debug("entering 'AttachmentAction.download()' method...");
}
ActionMessages messages = new ActionMessages();
String id = request.getParameter("id");
String attachmentFile=request.getParameter("file");
String type = request.getParameter("type");
if (id != null||attachmentFile!=null) {
Attachment attachment =null;
if(id!=null) {
attachment= mgr.view(id);
} else if(attachmentFile!=null) {
attachment=mgr.viewByFile(attachmentFile);
}
if (attachment == null) {
messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(
"object.miss"));
saveMessages(request, messages);
return mapping.findForward("failure");
}
//filename=new String(filename.getBytes("iso-8859-1"),"gb2312");
//String filepath=this.getServletContext().getRealPath("/upload");
File file = new File(mgr.getRoot()+"/"+attachment.getAttachmentFile());
String fileName = URLEncoder.encode(attachment.getAttachment(),
"UTF-8");
BufferedInputStream br = new BufferedInputStream(
new FileInputStream(file));
byte[] buf = new byte[1024 * 1024];
int len = 0;
response.reset(); //純下載方式
//response.setContentType("application/x-msdownload");
if (type == null) {
response
.setContentType("application/octet-stream;charset=utf-8");
response.setCharacterEncoding("UTF-8");
response.setHeader("Content-Disposition",
"attachment; filename=" + fileName);
} else if (type != null && type.equals("jpg")) {
response.setHeader("Cache-Control", "no-store");
response.setDateHeader("Expires", 0);
response.setContentType("image/jpeg");
}
OutputStream out = response.getOutputStream();
while ((len = br.read(buf)) > 0)
out.write(buf, 0, len);
br.close();
out.close();
}
return null;
}
re: sql面試題及答案 Crying 2007-09-27 10:16
SQL經(jīng)典面試題及答案2007年07月27日 星期五 上午 08:421.一道SQL語(yǔ)句面試題,關(guān)于group by
表內(nèi)容:
2005-05-09 勝
2005-05-09 勝
2005-05-09 負(fù)
2005-05-09 負(fù)
2005-05-10 勝
2005-05-10 負(fù)
2005-05-10 負(fù)
如果要生成下列結(jié)果, 該如何寫(xiě)sql語(yǔ)句?
勝 負(fù)
2005-05-09 2 2
2005-05-10 1 2
------------------------------------------
create table #tmp(rq varchar(10),shengfu nchar(1))
insert into #tmp values('2005-05-09','勝')
insert into #tmp values('2005-05-09','勝')
insert into #tmp values('2005-05-09','負(fù)')
insert into #tmp values('2005-05-09','負(fù)')
insert into #tmp values('2005-05-10','勝')
insert into #tmp values('2005-05-10','負(fù)')
insert into #tmp values('2005-05-10','負(fù)')
1)select rq, sum(case when shengfu='勝' then 1 else 0 end)'勝',sum(case when shengfu='負(fù)' then 1 else 0 end)'負(fù)' from #tmp group by rq
2) select N.rq,N.勝,M.負(fù) from (
select rq,勝=count(*) from #tmp where shengfu='勝'group by rq)N inner join
(select rq,負(fù)=count(*) from #tmp where shengfu='負(fù)'group by rq)M on N.rq=M.rq
3)select a.col001,a.a1 勝,b.b1 負(fù) from
(select col001,count(col001) a1 from temp1 where col002='勝' group by col001) a,
(select col001,count(col001) b1 from temp1 where col002='負(fù)' group by col001) b
where a.col001=b.col001
2.請(qǐng)教一個(gè)面試中遇到的SQL語(yǔ)句的查詢(xún)問(wèn)題
表中有A B C三列,用SQL語(yǔ)句實(shí)現(xiàn):當(dāng)A列大于B列時(shí)選擇A列否則選擇B列,當(dāng)B列大于C列時(shí)選擇B列否則選擇C列。
------------------------------------------
select (case when a>b then a else b end ),
(case when b>c then b esle c end)
from table_name
3.面試題:一個(gè)日期判斷的sql語(yǔ)句?
請(qǐng)取出tb_send表中日期(SendTime字段)為當(dāng)天的所有記錄?(SendTime字段為datetime型,包含日期與時(shí)間)
------------------------------------------
select * from tb where datediff(dd,SendTime,getdate())=0
4.有一張表,里面有3個(gè)字段:語(yǔ)文,數(shù)學(xué),英語(yǔ)。其中有3條記錄分別表示語(yǔ)文70分,數(shù)學(xué)80分,英語(yǔ)58分,請(qǐng)用一條sql語(yǔ)句查詢(xún)出這三條記錄并按以下條件顯示出來(lái)(并寫(xiě)出您的思路):
大于或等于80表示優(yōu)秀,大于或等于60表示及格,小于60分表示不及格。
顯示格式:
語(yǔ)文 數(shù)學(xué) 英語(yǔ)
及格 優(yōu)秀 不及格
------------------------------------------
select
(case when 語(yǔ)文>=80 then '優(yōu)秀'
when 語(yǔ)文>=60 then '及格'
else '不及格') as 語(yǔ)文,
(case when 數(shù)學(xué)>=80 then '優(yōu)秀'
when 數(shù)學(xué)>=60 then '及格'
else '不及格') as 數(shù)學(xué),
(case when 英語(yǔ)>=80 then '優(yōu)秀'
when 英語(yǔ)>=60 then '及格'
else '不及格') as 英語(yǔ),
from table
5.在sqlserver2000中請(qǐng)用sql創(chuàng)建一張用戶(hù)臨時(shí)表和系統(tǒng)臨時(shí)表,里面包含兩個(gè)字段ID和IDValues,類(lèi)型都是int型,并解釋下兩者的區(qū)別?
------------------------------------------
用戶(hù)臨時(shí)表:create table #xx(ID int, IDValues int)
系統(tǒng)臨時(shí)表:create table ##xx(ID int, IDValues int)
區(qū)別:
用戶(hù)臨時(shí)表只對(duì)創(chuàng)建這個(gè)表的用戶(hù)的Session可見(jiàn),對(duì)其他進(jìn)程是不可見(jiàn)的.
當(dāng)創(chuàng)建它的進(jìn)程消失時(shí)這個(gè)臨時(shí)表就自動(dòng)刪除.
全局臨時(shí)表對(duì)整個(gè)SQL Server實(shí)例都可見(jiàn),但是所有訪問(wèn)它的Session都消失的時(shí)候,它也自動(dòng)刪除.
6.sqlserver2000是一種大型數(shù)據(jù)庫(kù),他的存儲(chǔ)容量只受存儲(chǔ)介質(zhì)的限制,請(qǐng)問(wèn)它是通過(guò)什么方式實(shí)現(xiàn)這種無(wú)限容量機(jī)制的。
------------------------------------------
它的所有數(shù)據(jù)都存儲(chǔ)在數(shù)據(jù)文件中(*.dbf),所以只要文件夠大,SQL Server的存儲(chǔ)容量是可以擴(kuò)大的.
SQL Server 2000 數(shù)據(jù)庫(kù)有三種類(lèi)型的文件:
主要數(shù)據(jù)文件
主要數(shù)據(jù)文件是數(shù)據(jù)庫(kù)的起點(diǎn),指向數(shù)據(jù)庫(kù)中文件的其它部分。每個(gè)數(shù)據(jù)庫(kù)都有一個(gè)主要數(shù)據(jù)文件。主要數(shù)據(jù)文件的推薦文件擴(kuò)展名是 .mdf。
次要數(shù)據(jù)文件
次要數(shù)據(jù)文件包含除主要數(shù)據(jù)文件外的所有數(shù)據(jù)文件。有些數(shù)據(jù)庫(kù)可能沒(méi)有次要數(shù)據(jù)文件,而有些數(shù)據(jù)庫(kù)則有多個(gè)次要數(shù)據(jù)文件。次要數(shù)據(jù)文件的推薦文件擴(kuò)展名是 .ndf。
日志文件
日志文件包含恢復(fù)數(shù)據(jù)庫(kù)所需的所有日志信息。每個(gè)數(shù)據(jù)庫(kù)必須至少有一個(gè)日志文件,但可以不止一個(gè)。日志文件的推薦文件擴(kuò)展名是 .ldf。
7.請(qǐng)用一個(gè)sql語(yǔ)句得出結(jié)果
從table1,table2中取出如table3所列格式數(shù)據(jù),注意提供的數(shù)據(jù)及結(jié)果不準(zhǔn)確,只是作為一個(gè)格式向大家請(qǐng)教。
如使用存儲(chǔ)過(guò)程也可以。
table1
月份mon 部門(mén)dep 業(yè)績(jī)yj
-------------------------------
一月份 01 10
一月份 02 10
一月份 03 5
二月份 02 8
二月份 04 9
三月份 03 8
table2
部門(mén)dep 部門(mén)名稱(chēng)dname
--------------------------------
01 國(guó)內(nèi)業(yè)務(wù)一部
02 國(guó)內(nèi)業(yè)務(wù)二部
03 國(guó)內(nèi)業(yè)務(wù)三部
04 國(guó)際業(yè)務(wù)部
table3 (result)
部門(mén)dep 一月份 二月份 三月份
--------------------------------------
01 10 null null
02 10 8 null
03 null 5 8
04 null null 9
------------------------------------------
1)
select a.部門(mén)名稱(chēng)dname,b.業(yè)績(jī)yj as '一月份',c.業(yè)績(jī)yj as '二月份',d.業(yè)績(jī)yj as '三月份'
from table1 a,table2 b,table2 c,table2 d
where a.部門(mén)dep = b.部門(mén)dep and b.月份mon = '一月份' and
a.部門(mén)dep = c.部門(mén)dep and c.月份mon = '二月份' and
a.部門(mén)dep = d.部門(mén)dep and d.月份mon = '三月份' and
2)
select a.dep,
sum(case when b.mon=1 then b.yj else 0 end) as '一月份',
sum(case when b.mon=2 then b.yj else 0 end) as '二月份',
sum(case when b.mon=3 then b.yj else 0 end) as '三月份',
sum(case when b.mon=4 then b.yj else 0 end) as '四月份',
sum(case when b.mon=5 then b.yj else 0 end) as '五月份',
sum(case when b.mon=6 then b.yj else 0 end) as '六月份',
sum(case when b.mon=7 then b.yj else 0 end) as '七月份',
sum(case when b.mon=8 then b.yj else 0 end) as '八月份',
sum(case when b.mon=9 then b.yj else 0 end) as '九月份',
sum(case when b.mon=10 then b.yj else 0 end) as '十月份',
sum(case when b.mon=11 then b.yj else 0 end) as '十一月份',
sum(case when b.mon=12 then b.yj else 0 end) as '十二月份',
from table2 a left join table1 b on a.dep=b.dep
8.華為一道面試題
一個(gè)表中的Id有多個(gè)記錄,把所有這個(gè)id的記錄查出來(lái),并顯示共有多少條記錄數(shù)。
------------------------------------------
select id, Count(*) from tb group by id having count(*)>1
select * from(select count(ID) as count from table group by ID)T where T.count>1
import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
import java.io.*;
public class SendMail
{
static final String MAIL_HOST = "61.177.95.155";
static final boolean MAIL_NEEDAUTH = true;
static final String DEFAULT_MAIL_USER = "lioulb@126.com";
static final String DEFAULT_MAIL_PASSWORD = ".......";
static final String DEFAULT_FORMAT = "plain"; //純文本
private MimeMessage mimeMsg; //MIME郵件對(duì)象
private Multipart mp; //Multipart對(duì)象,郵件內(nèi)容,標(biāo)題,附件等內(nèi)容均添加到其中后再生成MimeMessage對(duì)象
private Session session; //郵件會(huì)話(huà)對(duì)象
private Properties props; //系統(tǒng)屬性
private boolean needAuth; //smtp是否需要認(rèn)證
private String userName; //smtp認(rèn)證用戶(hù)名和密碼
private String password; //smtp認(rèn)證密碼
private String mailFormat = DEFAULT_FORMAT; //郵件文本格式
public SendMail(String host,boolean needAuth,String user,String password)
{ //構(gòu)造方法
if(host==null||host.trim().equals(""))
{
host = MAIL_HOST;
}
setHost(host);
createMimeMessage();
setAuth(needAuth);
if(user==null)
{
user = "";
}
if(password==null)
{
password = "";
}
setUser(user,password);
setFrom(user);
}
public SendMail()
{
setHost(MAIL_HOST);
createMimeMessage();
setAuth(MAIL_NEEDAUTH);
setUser(DEFAULT_MAIL_USER,DEFAULT_MAIL_PASSWORD);
setFrom(DEFAULT_MAIL_USER);
}
private void setHost(String hostName)
{ //設(shè)置smtp的主機(jī)地址
if(props==null)
{
props = System.getProperties(); //獲得系統(tǒng)屬性對(duì)象
}
props.put("mail.smtp.host",hostName); //設(shè)置SMTP主機(jī)
}
private void setAuth(boolean need)
{ //smtp認(rèn)證
if(props==null)
{
props = System.getProperties();
}
if(need)
{
props.put("mail.smtp.auth","true");
}
else
{
props.put("mail.smtp.auth","false");
}
}
private void setUser(String userName,String password)
{ //設(shè)置smtp用戶(hù)名和密碼
this.userName = userName;
this.password = password;
}
private boolean createMimeMessage()
{ //生成郵件對(duì)象
try
{
session = Session.getDefaultInstance(props,null); //獲得郵件會(huì)話(huà)對(duì)象
}
catch(Exception e)
{
e.printStackTrace();
return false;
}
try
{
mimeMsg = new MimeMessage(session); //創(chuàng)建MIME郵件對(duì)象
mp = new MimeMultipart();
return true;
}
catch(Exception e)
{
e.printStackTrace();
return false;
}
}
private void setMailFormat(String format)
{ //設(shè)置郵件的正文格式 plain:純文本格式 html:html格式
if(format==null)
{
format = "plain";
}
format = format.trim();
if(format.equals("plain")||format.equals("html"))
{
this.mailFormat = "text/"+format;
}
else
{
this.mailFormat = "text/plain";
}
}
public boolean sendMail(String to,String subject,String body,String format)
{ //發(fā)送不帶附件,不轉(zhuǎn)發(fā)的郵件
boolean theReturn = true;
setMailFormat(format);
// String aLine = Time.getdate()+" "+Time.gettime()+" send: "+this.userName
//+" "+to+" "+Common.convertToGb(subject);
String aLine = " send: "+this.userName
+" "+to+" "+subject;
if(setSubject(subject)&&setBody(body)&&setTo(to))
{
theReturn = sendOut();
aLine = aLine+" [Success]";
}
else
{
theReturn = false;
aLine = aLine+" [Failed]";
}
return theReturn;
}
public boolean sendMail(String to,String subject,String body)
{
return sendMail(to,subject,body,DEFAULT_FORMAT);
}
private boolean setSubject(String mailSubject)
{ //設(shè)置郵件主題
try
{
//mailSubject = Common.convertToGb(mailSubject);
mimeMsg.setSubject(mailSubject);
return true;
}
catch(Exception e)
{
e.printStackTrace();
return false;
}
}
private boolean setBody(String mailBody)
{ //設(shè)置郵件正文
try
{
//mailBody = Common.convertToGb(mailBody);
BodyPart bp = new MimeBodyPart();
bp.setContent(mailBody,this.mailFormat+";charset=GB2312"); //"<meta http-equiv=Content-Type content=text/html; charset=gb2312>"+mailBody
mp.addBodyPart(bp);
return true;
}
catch(Exception e)
{
e.printStackTrace();
return false;
}
}
private boolean setFrom(String from)
{ //設(shè)置發(fā)信人地址
try
{
mimeMsg.setFrom(new InternetAddress(from));
return true;
}
catch(Exception e)
{
e.printStackTrace();
return false;
}
}
private boolean setTo(String to)
{ //設(shè)置收信人地址
if(to==null)
{
return false;
}
try
{
mimeMsg.addRecipients(Message.RecipientType.TO,InternetAddress.parse(to));
return true;
}
catch(Exception e)
{
e.printStackTrace();
return false;
}
}
private boolean addFileAffix(String filename)
{ //添加附件
try
{
BodyPart bp = new MimeBodyPart();
FileDataSource fileds = new FileDataSource(filename);
bp.setDataHandler(new DataHandler(fileds));
bp.setFileName(fileds.getName());
mp.addBodyPart(bp);
return true;
}
catch(Exception e)
{
e.printStackTrace();
return false;
}
}
private boolean setCopyTo(String copyto)
{ //設(shè)置轉(zhuǎn)發(fā)人地址
if(copyto==null)
{
return false;
}
try
{
mimeMsg.addRecipients(Message.RecipientType.CC,
(Address[])InternetAddress.parse(copyto));
return true;
}
catch(Exception e)
{
e.printStackTrace();
return false;
}
}
public int tryToConnect()
{ //連接郵箱 1:連接成功 0:連接失敗 -1:已經(jīng)連接或系統(tǒng)忙
int theReturn = 0;
// String aLine = Time.getdate()+" "+Time.gettime()+" Connect: "+this.userName
//+" "+this.userName+" "+this.password;
String aLine = " Connect: "+this.userName
+" "+this.userName+" "+this.password;
try
{
Session mailSession = Session.getInstance(props,null);
Transport transport = mailSession.getTransport("smtp");
transport.connect((String)props.get("mail.smtp.host"),this.userName,
this.password);
transport.close();
theReturn = 1;
aLine = aLine+" [Success]";
}
catch(MessagingException e)
{
e.printStackTrace();
theReturn = 0;
}
catch(IllegalStateException e)
{
e.printStackTrace();
theReturn = -1;
}
catch(Exception e)
{
e.printStackTrace();
theReturn = 0;
aLine = aLine+" [Failed]";
}
return theReturn;
}
private boolean sendOut()
{ //發(fā)送郵件
try
{
mimeMsg.setContent(mp);
mimeMsg.saveChanges();
Session mailSession = Session.getInstance(props,null);
Transport transport = mailSession.getTransport("smtp");
transport.connect((String)props.get("mail.smtp.host"),this.userName,
this.password);
transport.sendMessage(mimeMsg,mimeMsg.getAllRecipients());
transport.close();
return true;
}
catch(Exception e)
{
e.printStackTrace();
return false;
}
}
public boolean changePwd(String userName,String newPwd)
{ //修改郵箱密碼
boolean theReturn = false;
try
{
String commond = "passwd "+userName;
Process process = Runtime.getRuntime().exec(commond);
BufferedReader br = new BufferedReader(new InputStreamReader(process.
getInputStream()));
PrintStream ps = new PrintStream(process.getOutputStream());
BufferedReader br1 = new BufferedReader(new InputStreamReader(process.
getErrorStream()));
char ac[] = new char[1024];
br1.read(ac);
ps.println(newPwd);
ps.flush();
br1.read(ac);
ps.println(newPwd);
ps.flush();
br1.read(ac);
if(process.waitFor()==0)
{
theReturn = true;
}
}
catch(Exception e)
{
e.printStackTrace();
//e.printStackTrace(System.out);
System.out.println(e.toString());
theReturn = false;
}
return theReturn;
}
public boolean addUser(String userName)
{ //添加郵件用戶(hù) (密碼默認(rèn)為空)
boolean theReturn = false;
try
{
String commond = "/usr/sbin/useradd "+userName+
" -g mail -d /dev/null -s /bin/false";
Process process = Runtime.getRuntime().exec(commond);
BufferedReader br = new BufferedReader(new InputStreamReader(process.
getInputStream()));
PrintStream ps = new PrintStream(process.getOutputStream());
BufferedReader br1 = new BufferedReader(new InputStreamReader(process.
getErrorStream()));
char ac[] = new char[1024];
br1.read(ac);
if(process.waitFor()==0)
{
theReturn = true;
}
}
catch(Exception e)
{
e.printStackTrace(System.out);
theReturn = false;
}
return theReturn;
}
public boolean addUser(String userName,String pwd)
{ //添加郵件用戶(hù)
boolean theReturn = addUser(userName);
if(theReturn)
{
theReturn = changePwd(userName,pwd);
if(!theReturn)
{ //修改密碼失敗
deleUser(userName);
}
}
return theReturn;
}
public boolean deleUser(String userName)
{ //刪除郵件用戶(hù)
boolean theReturn = false;
try
{
String commond = "/usr/sbin/userdel "+userName;
Process process = Runtime.getRuntime().exec(commond);
BufferedReader br = new BufferedReader(new InputStreamReader(process.
getInputStream()));
PrintStream ps = new PrintStream(process.getOutputStream());
BufferedReader br1 = new BufferedReader(new InputStreamReader(process.
getErrorStream()));
char ac[] = new char[1024];
br1.read(ac);
if(process.waitFor()==0)
{
theReturn = true;
}
}
catch(Exception exception)
{
exception.printStackTrace(System.out);
theReturn = false;
}
return theReturn;
}
public static void main(String args[]){
SendMail myMail=new SendMail();
System.out.println(myMail.sendMail("oxservice@126.com","this is test","my \n test"));
}
}
re: javascript小技巧 Crying 2007-09-21 12:21
javascript事件查詢(xún)綜合
click() 對(duì)象.click() 使對(duì)象被點(diǎn)擊。
closed 對(duì)象.closed 對(duì)象窗口是否已關(guān)閉true/false
clearTimeout(對(duì)象) 清除已設(shè)置的setTimeout對(duì)象
clearInterval(對(duì)象) 清除已設(shè)置的setInterval對(duì)象
confirm("提示信息") 彈出確認(rèn)框,確定返回true取消返回false
cursor:樣式 更改鼠標(biāo)樣式 hand crosshair text wait help default auto e/s/w/n-resize
event.clientX 返回最后一次點(diǎn)擊鼠標(biāo)X坐標(biāo)值;
event.clientY 返回最后一次點(diǎn)擊鼠標(biāo)Y坐標(biāo)值;
event.offsetX 返回當(dāng)前鼠標(biāo)懸停X坐標(biāo)值
event.offsetY 返回當(dāng)前鼠標(biāo)懸停Y坐標(biāo)值
document.write(document.lastModified) 網(wǎng)頁(yè)最后一次更新時(shí)間
document.ondblclick=x 當(dāng)雙擊鼠標(biāo)產(chǎn)生事件
document.onmousedown=x 單擊鼠標(biāo)鍵產(chǎn)生事件
document.body.scrollTop; 返回和設(shè)置當(dāng)前豎向滾動(dòng)條的坐標(biāo)值,須與函數(shù)配合,
document.body.scrollLeft; 返回和設(shè)置當(dāng)前橫向滾動(dòng)務(wù)的坐標(biāo)值,須與函數(shù)配合,
document.title document.title="message"; 當(dāng)前窗口的標(biāo)題欄文字
document.bgcolor document.bgcolor="顏色值"; 改變窗口背景顏色
document.Fgcolor document.Fgcolor="顏色值"; 改變正文顏色
document.linkcolor document.linkcolor="顏色值"; 改變超聯(lián)接顏色
document.alinkcolor document.alinkcolor="顏色值"; 改變正點(diǎn)擊聯(lián)接的顏色
document.VlinkColor document.VlinkColor="顏色值"; 改變已訪問(wèn)聯(lián)接的顏色
document.forms.length 返回當(dāng)前頁(yè)form表單數(shù)
document.anchors.length 返回當(dāng)前頁(yè)錨的數(shù)量
document.links.length 返回當(dāng)前頁(yè)聯(lián)接的數(shù)量
document.onmousedown=x 單擊鼠標(biāo)觸發(fā)事件
document.ondblclick=x 雙擊鼠標(biāo)觸發(fā)事件
defaultStatus window.status=defaultStatus; 將狀態(tài)欄設(shè)置默認(rèn)顯示
function function xx(){...} 定義函數(shù)
isNumeric 判斷是否是數(shù)字
innerHTML xx=對(duì)象.innerHTML 輸入某對(duì)象標(biāo)簽中的html源代碼
innerText divid.innerText=xx 將以div定位以id命名的對(duì)象值設(shè)為XX
location.reload(); 使本頁(yè)刷新,target可等于一個(gè)刷新的網(wǎng)頁(yè)
Math.random() 隨機(jī)涵數(shù),只能是0到1之間的數(shù),如果要得到其它數(shù),可以為*10,再取整
Math.floor(number) 將對(duì)象number轉(zhuǎn)為整數(shù),舍取所有小數(shù)
Math.min(1,2) 返回1,2哪個(gè)小
Math.max(1,2) 返回1,2哪個(gè)大
navigator.appName 返回當(dāng)前瀏覽器名稱(chēng)
navigator.appVersion 返回當(dāng)前瀏覽器版本號(hào)
navigator.appCodeName 返回當(dāng)前瀏覽器代碼名字
navigator.userAgent 返回當(dāng)前瀏覽器用戶(hù)代標(biāo)志
onsubmit onsubmit="return(xx())" 使用函數(shù)返回值
opener opener.document.對(duì)象 控制原打開(kāi)窗體對(duì)象
prompt xx=window.prompt("提示信息","預(yù)定值"); 輸入語(yǔ)句
parent parent.框架名.對(duì)象 控制框架頁(yè)面
return return false 返回值
random 隨機(jī)參數(shù)(0至1之間)
reset() form.reset(); 使form表單內(nèi)的數(shù)據(jù)重置
split("") string.split("") 將string對(duì)象字符以逗號(hào)隔開(kāi)
submit() form對(duì)象.submit() 使form對(duì)象提交數(shù)據(jù)
String對(duì)象的 charAt(x)對(duì)象 反回指定對(duì)象的第多少位的字母
lastIndexOf("string") 從右到左詢(xún)找指定字符,沒(méi)有返回-1
indexOf("string") 從左到右詢(xún)找指定字符,沒(méi)有返回-1
LowerCase() 將對(duì)象全部轉(zhuǎn)為小寫(xiě)
UpperCase() 將對(duì)象全部轉(zhuǎn)為大寫(xiě)
substring(0,5) string.substring(x,x) 返回對(duì)象中從0到5的字符
setTimeout("function",time) 設(shè)置一個(gè)超時(shí)對(duì)象
setInterval("function",time) 設(shè)置一個(gè)超時(shí)對(duì)象
toLocaleString() x.toLocaleString() 從x時(shí)間對(duì)象中獲取時(shí)間,以字符串型式存在
typeof(變量名) 檢查變量的類(lèi)型,值有:String,Boolean,Object,Function,Underfined
window.event.button==1/2/3 鼠標(biāo)鍵左鍵等于1右鍵等于2兩個(gè)鍵一起按為3
window.screen.availWidth 返回當(dāng)前屏幕寬度(空白空間)
window.screen.availHeight 返回當(dāng)前屏幕高度(空白空間)
window.screen.width 返回當(dāng)前屏幕寬度(分辨率值)
window.screen.height 返回當(dāng)前屏幕高度(分辨率值)
window.document.body.offsetHeight; 返回當(dāng)前網(wǎng)頁(yè)高度
window.document.body.offsetWidth; 返回當(dāng)前網(wǎng)頁(yè)寬度
window.resizeTo(0,0) 將窗口設(shè)置寬高
window.moveTo(0,0) 將窗口移到某位置
window.focus() 使當(dāng)前窗口獲得焦點(diǎn)
window.scroll(x,y) 窗口滾動(dòng)條坐標(biāo),y控制上下移動(dòng),須與函數(shù)配合
window.open() window.open("地址","名稱(chēng)","屬性")
屬性:toolbar(工具欄),location(地址欄),directions,status(狀態(tài)欄),
menubar(菜單欄),scrollbar(滾動(dòng)條),resizable(改變大小), width(寬),height(高),fullscreen(全 屏),scrollbars(全屏?xí)r無(wú)滾動(dòng)條無(wú)參 數(shù),channelmode(寬屏),left(打開(kāi)窗口x坐標(biāo)),top(打開(kāi)窗口y坐標(biāo))
window.location = 'view-source:' + window.location.href 應(yīng)用事件查看網(wǎng)頁(yè)源代碼;
a=new Date(); //創(chuàng)建a為一個(gè)新的時(shí)期對(duì)象
y=a.getYear(); //y的值為從對(duì)象a中獲取年份值 兩位數(shù)年份
y1=a.getFullYear(); //獲取全年份數(shù) 四位數(shù)年份
m=a.getMonth(); //獲取月份值
d=a.getDate(); //獲取日期值
d1=a.getDay(); //獲取當(dāng)前星期值
h=a.getHours(); //獲取當(dāng)前小時(shí)數(shù)
m1=a.getMinutes(); //獲取當(dāng)前分鐘數(shù)
s=a.getSeconds(); //獲取當(dāng)前秒鐘數(shù)
對(duì)象.style.fontSize="文字大小";
單位:mm/cm/in英寸/pc帕/pt點(diǎn)/px象素/em文字高
1in=1.25cm
1pc=12pt
1pt=1.2px(800*600分辯率下)
文本字體屬性:
fontSize大小
family字體
color顏色
fontStyle風(fēng)格,取值為normal一般,italic斜體,oblique斜體且加粗
fontWeight加粗,取值為100到900不等,900最粗,light,normal,bold
letterSpacing間距,更改文字間距離,取值為,1pt,10px,1cm
textDecoration:文字修飾;取值,none不修飾,underline下劃線(xiàn),overline上劃線(xiàn)
background:文字背景顏色,
backgroundImage:背景圖片,取值為圖片的插入路徑
點(diǎn)擊網(wǎng)頁(yè)正文函數(shù)調(diào)用觸發(fā)器:
1.onClick 當(dāng)對(duì)象被點(diǎn)擊
2.onLoad 當(dāng)網(wǎng)頁(yè)打開(kāi),只能書(shū)寫(xiě)在body中
3.onUnload 當(dāng)網(wǎng)頁(yè)關(guān)閉或離開(kāi)時(shí),只能書(shū)寫(xiě)在body中
4.onmouseover 當(dāng)鼠標(biāo)懸于其上時(shí)
5.onmouseout 當(dāng)鼠標(biāo)離開(kāi)對(duì)象時(shí)
6.onmouseup 當(dāng)鼠標(biāo)松開(kāi)
7.onmousedown 當(dāng)鼠標(biāo)按下鍵
8.onFocus 當(dāng)對(duì)象獲取焦點(diǎn)時(shí)
9.onSelect 當(dāng)對(duì)象的文本被選中時(shí)
10.onChange 當(dāng)對(duì)象的內(nèi)容被改變
11.onBlur 當(dāng)對(duì)象失去焦點(diǎn)
onsubmit=return(ss())表單調(diào)用時(shí)返回的值
直線(xiàn) border-bottom:1x solid black
虛線(xiàn) border-bottom:1x dotted black
點(diǎn)劃線(xiàn) border-bottom:2x dashed black
雙線(xiàn) border-bottom:5x double black
槽狀 border-bottom:1x groove black
脊?fàn)?border-bottom:1x ridge black
re: 網(wǎng)頁(yè)實(shí)用的 Crying 2007-09-20 18:19
框架
<frameset rows="21%,*">
<frame src="aa.html" noresize>//noresize 是確定框架的大小固定且不能改變
<frameset cols="20%,*">
<frame src="bb.html" noresize>
<frame src="bb.html" scrolling="yes" >//scrolling 是確定滾動(dòng)條是否對(duì)用戶(hù)有效,yes,no,auto
</frameset>
</frameset>
re: 網(wǎng)頁(yè)實(shí)用的 Crying 2007-09-19 19:48
退出
1.。<html:submit onclick="javascript:window.close()">退出</html:submit>
2.。<a href="javascript:window.close()">關(guān)閉</a>
除去空格
in Javascript:
去掉leading/trailing 空格: str = str.replace(/^\s+|\s+$/g,"");
去掉all空格: str = str.replace(/\s+/g,"");
re: 網(wǎng)頁(yè)實(shí)用的 Crying 2007-09-19 19:46
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<SCRIPT LANGUAGE="JavaScript">
<!--
function formHandler(URL)
{
window.location.href = URL;
}
// -->
</SCRIPT>
</head>
<FORM name = "form">
<SELECT NAME="site" SIZE=1 onChange ="formHandler(this.value)">
<option value="">連接到…. </option>
<option value="
http://www.ddvip.com">豆豆技術(shù)</option>
<option value="
http://soft.ddvip.net">豆豆軟件 </option>
<option value="
http://bbs.ddvip.net">豆豆論壇 </option>
<option value="
http://vip.ddvip.net">視頻在線(xiàn) </option>
<option value="
http://soft.ddvip.net">豆豆軟件 </option>
</SELECT>
</FORM>
re: 網(wǎng)頁(yè)實(shí)用的 Crying 2007-09-19 19:45
重定向
<html:submit onclick="javascript:window.location.href='userIpt.jsp'">返回</html:submit>
//////////////////////////////////
<html>
<head>
<title>錯(cuò)誤頁(yè)面</title>
<script type="text/javascript">
<!--
function check(){
form.action="log.jsp";
}
//-->
</script>
</head>
<body bgcolor="#E0F0F8">
<center>
<form action="" name="form">
對(duì)不起你 !無(wú)權(quán)訪問(wèn)!
<br>
<html:submit onclick="check()">返回</html:submit>
</form>
</center>
</body>
</html>
/********刷新frame***********/
window.parent.frames('leftFrame').document.location.reload();
javascript:window.parent.frames('leftFrame').document.location.reload();
re: 網(wǎng)頁(yè)實(shí)用的 Crying 2007-09-19 19:43
倒計(jì)時(shí)
<Script Language="JavaScript">
var timedate= new Date("October 1,2007");
var times= "2010年國(guó)慶節(jié)";
var now = new Date();
var date = timedate.getTime() - now.getTime();
var time = Math.floor(date / (1000 * 60 * 60 * 24));
if (time >= 0)
document.write( "現(xiàn)在離"+times+"還有: "+time +"天")
</Script>
re: AOP觀念(轉(zhuǎn)載) Crying 2007-09-16 11:50
AOP對(duì)我來(lái)說(shuō)到現(xiàn)在還沒(méi)真正的理解,昨天晚上又把《Spring開(kāi)發(fā) 手冊(cè)》和《精通Spring》的AOP部分看了哈可是還是云里霧里的,要是叫我說(shuō)出AOP的思想我肯定打哽心里是明白會(huì)用,可就是說(shuō)不上來(lái)(丟人了....).。
我現(xiàn)在就把我所能說(shuō)的都說(shuō)出來(lái)啊,說(shuō)的不對(duì)大家別罵我,要是能對(duì)AOP有很好理解的麻煩給我留個(gè)言,給小弟帶來(lái)點(diǎn)感悟。。。先謝謝啦。
我認(rèn)為AOP的實(shí)現(xiàn)其實(shí)就是靠的就是代理Bean(PoxyFactoryBean)和攔截器(Interceptor)來(lái)實(shí)現(xiàn)的。
AOP中有幾個(gè)關(guān)鍵字Aspect,advice,pointCut,target,......
Aspect 就是將你想往目標(biāo)對(duì)象中插入的東西(如事務(wù),日志),將這些日志,事務(wù)封裝成一個(gè)類(lèi)也就成了Aspect了。
advice 是可是說(shuō)是Aspect中的一個(gè)方法吧。
pointCut 是目標(biāo)對(duì)象中的一個(gè)方法,也就是你想在目標(biāo)對(duì)像的哪個(gè)位置織入你 的Advice。
target 就是你的目標(biāo)對(duì)象啦
Spring AOP
re: AOP觀念(轉(zhuǎn)載) Crying 2007-09-16 11:07
IOC 個(gè)人理解
從字面意思來(lái)說(shuō)是控制反轉(zhuǎn),利用依賴(lài)注入模式將原來(lái)組件依賴(lài)于對(duì)象的關(guān)系,改變成組件依賴(lài)于抽象接口,將應(yīng)用程序依賴(lài)于容器變成容器管理應(yīng)用程序。為了調(diào)用IOC容器,組件必須利用BeanFactory或ApplicationContext,利用他們可以管理容器中的Bean實(shí)例的生命周期,用getBean(String ...)方法得到Bean實(shí)例,ApplicationContext在BeanFactory的基礎(chǔ)之上實(shí)現(xiàn)了擴(kuò)展增加了資源取得,消息解析,事件處理等功能,使得Spring的IOC容器來(lái)協(xié)調(diào)各組件間相互的依賴(lài)關(guān)系。
http://www.itisedu.com/phrase/200603091205485.html