📄 北京一家java开发公司面试题(留给后人) - mlovex的专栏.mht
字号:
+ "\\s*$");
m =3D op.match(exp);
if (m =3D=3D null)
return null;
var intermed =3D m[2] + m[5] ;
cleanInput =3D m[1] + intermed.replace(new RegExp("(\\" + =
val.groupchar + ")", "g"), "") + ((val.digits > 0) ? "." + m[7] : 0);
num =3D parseFloat(cleanInput);
return (isNaN(num) ? null : num); =20
}
else if (dataType =3D=3D "Date") {
var yearFirstExp =3D new =
RegExp("^\\s*((\\d{4})|(\\d{2}))([-/]|\\. =
?)(\\d{1,2})\\4(\\d{1,2})\\s*$");
m =3D op.match(yearFirstExp);
var day, month, year;
if (m !=3D null && (m[2].length =3D=3D 4 || val.dateorder =3D=3D =
"ymd")) {
day =3D m[6];
month =3D m[5];
year =3D (m[2].length =3D=3D 4) ? m[2] : =
GetFullYear(parseInt(m[3], 10))
}
else {
if (val.dateorder =3D=3D "ymd"){
return null; =09
} =09
var yearLastExp =3D new RegExp("^\\s*(\\d{1,2})([-/]|\\. =
?)(\\d{1,2})\\2((\\d{4})|(\\d{2}))\\s*$");
m =3D op.match(yearLastExp);
if (m =3D=3D null) {
return null;
}
if (val.dateorder =3D=3D "mdy") {
day =3D m[3];
month =3D m[1];
}
else {
day =3D m[1];
month =3D m[3];
}
year =3D (m[5].length =3D=3D 4) ? m[5] : =
GetFullYear(parseInt(m[6], 10))
}
month -=3D 1;
var date =3D new Date(year, month, day);
return (typeof(date) =3D=3D "object" && year =3D=3D =
date.getFullYear() && month =3D=3D date.getMonth() && day =3D=3D =
date.getDate()) ? date.valueOf() : null;
}
else {
return op.toString();
}
}
function ValidatorCompare(operand1, operand2, operator, val) {
var dataType =3D val.type;
var op1, op2;
if ((op1 =3D ValidatorConvert(operand1, dataType, val)) =3D=3D null)
return false; =20
if (operator =3D=3D "DataTypeCheck")
return true;
if ((op2 =3D ValidatorConvert(operand2, dataType, val)) =3D=3D null)
return true;
switch (operator) {
case "NotEqual":
return (op1 !=3D op2);
case "GreaterThan":
return (op1 > op2);
case "GreaterThanEqual":
return (op1 >=3D op2);
case "LessThan":
return (op1 < op2);
case "LessThanEqual":
return (op1 <=3D op2);
default:
return (op1 =3D=3D op2); =20
}
}
function CompareValidatorEvaluateIsValid(val) {
var value =3D ValidatorGetValue(val.controltovalidate);
if (ValidatorTrim(value).length =3D=3D 0)
return true;
var compareTo =3D "";
if (null =3D=3D document.all[val.controltocompare]) {
if (typeof(val.valuetocompare) =3D=3D "string") {
compareTo =3D val.valuetocompare;
}
}
else {
compareTo =3D ValidatorGetValue(val.controltocompare);
}
return ValidatorCompare(value, compareTo, val.operator, val);
}
function CustomValidatorEvaluateIsValid(val) {
var value =3D "";
if (typeof(val.controltovalidate) =3D=3D "string") {
value =3D ValidatorGetValue(val.controltovalidate);
if (ValidatorTrim(value).length =3D=3D 0)
return true;
}
var args =3D { Value:value, IsValid:true };
if (typeof(val.clientvalidationfunction) =3D=3D "string") {
eval(val.clientvalidationfunction + "(val, args) ;");
} =20
return args.IsValid;
}
function RegularExpressionValidatorEvaluateIsValid(val) {
var value =3D ValidatorGetValue(val.controltovalidate);
if (ValidatorTrim(value).length =3D=3D 0)
return true; =20
var rx =3D new RegExp(val.validationexpression);
var matches =3D rx.exec(value);
return (matches !=3D null && value =3D=3D matches[0]);
}
function ValidatorTrim(s) {
var m =3D s.match(/^\s*(\S+(\s+\S+)*)\s*$/);
return (m =3D=3D null) ? "" : m[1];
}
function RequiredFieldValidatorEvaluateIsValid(val) {
return (ValidatorTrim(ValidatorGetValue(val.controltovalidate)) !=3D =
ValidatorTrim(val.initialvalue))
}
function RangeValidatorEvaluateIsValid(val) {
var value =3D ValidatorGetValue(val.controltovalidate);
if (ValidatorTrim(value).length =3D=3D 0)=20
return true;
return (ValidatorCompare(value, val.minimumvalue, =
"GreaterThanEqual", val) &&
ValidatorCompare(value, val.maximumvalue, "LessThanEqual", =
val));
}
function ValidationSummaryOnSubmit() {
if (typeof(Page_ValidationSummaries) =3D=3D "undefined")=20
return;
var summary, sums, s;
for (sums =3D 0; sums < Page_ValidationSummaries.length; sums++) {
summary =3D Page_ValidationSummaries[sums];
summary.style.display =3D "none";
if (!Page_IsValid) {
if (summary.showsummary !=3D "False") {
summary.style.display =3D "";
if (typeof(summary.displaymode) !=3D "string") {
summary.displaymode =3D "BulletList";
}
switch (summary.displaymode) {
case "List":
headerSep =3D "<br>";
first =3D "";
pre =3D "";
post =3D "<br>";
final =3D "";
break;
case "BulletList":
default:=20
headerSep =3D "";
first =3D "<ul>";
pre =3D "<li>";
post =3D "</li>";
final =3D "</ul>";
break;
case "SingleParagraph":
headerSep =3D " ";
first =3D "";
pre =3D "";
post =3D " ";
final =3D "<br>";
break;
}
s =3D "";
if (typeof(summary.headertext) =3D=3D "string") {
s +=3D summary.headertext + headerSep;
}
s +=3D first;
for (i=3D0; i<Page_Validators.length; i++) {
if (!Page_Validators[i].isvalid && =
typeof(Page_Validators[i].errormessage) =3D=3D "string") {
s +=3D pre + Page_Validators[i].errormessage + =
post;
}
} =20
s +=3D final;
summary.innerHTML =3D s;=20
window.scrollTo(0,0);
}
if (summary.showmessagebox =3D=3D "True") {
s =3D "";
if (typeof(summary.headertext) =3D=3D "string") {
s +=3D summary.headertext + "<BR>";
}
for (i=3D0; i<Page_Validators.length; i++) {
if (!Page_Validators[i].isvalid && =
typeof(Page_Validators[i].errormessage) =3D=3D "string") {
switch (summary.displaymode) {
case "List":
s +=3D Page_Validators[i].errormessage + =
"<BR>";
break;
case "BulletList":
default:=20
s +=3D " - " + =
Page_Validators[i].errormessage + "<BR>";
break;
case "SingleParagraph":
s +=3D Page_Validators[i].errormessage + =
" ";
break;
}
}
}
span =3D document.createElement("SPAN");
span.innerHTML =3D s;
s =3D span.innerText;
alert(s);
}
}
}
}
------=_NextPart_000_0000_01C5BFCB.F73FB160
Content-Type: application/octet-stream
Content-Transfer-Encoding: quoted-printable
Content-Location: http://www.csdn.net/favorite/365keyScript.aspx
//document.write("[<a =
href=3D\"javascript:d=3Ddocument;t=3Dd.selection?(d.selection.type!=3D'No=
ne'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'=
');void(keyit=3Dwindow.open('http://www.365key.com/storeit.aspx?t=3D'+esc=
ape(d.title)+'&u=3D'+escape(d.location.href)+'&c=3D'+escape(t),'keyit','s=
crollbars=3Dno,width=3D475,height=3D575,left=3D75,top=3D20,status=3Dno,re=
sizable=3Dyes'));keyit.focus();\" =
title=3D\"=E5=8A=9F=E8=83=BD=E5=BC=BA=E5=A4=A7=E7=9A=84=E7=BD=91=E7=BB=9C=
=E6=94=B6=E8=97=8F=E5=A4=B9=EF=BC=8C=E4=B8=80=E7=A7=92=E9=92=9F=E6=93=8D=E4=
=BD=9C=E5=B0=B1=E5=8F=AF=E4=BB=A5=E8=BD=BB=E6=9D=BE=E5=AE=9E=E7=8E=B0=E4=BF=
=9D=E5=AD=98=E5=B8=A6=E6=9D=A5=E7=9A=84=E4=BB=B7=E5=80=BC=E3=80=81=E5=88=86=
=E4=BA=AB=E5=B8=A6=E6=9D=A5=E7=9A=84=E5=BF=AB=E4=B9=90\">=E7=82=B9=E5=87=BB=
=E6=AD=A4=E5=A4=84=E6=94=B6=E8=97=8F=E6=9C=AC=E6=96=87</a>]");
function StorePage()
{
d=3Ddocument;
=
t=3Dd.selection?(d.selection.type!=3D'None'?d.selection.createRange().tex=
t:''):(d.getSelection?d.getSelection():'');
=
void(keyit=3Dwindow.open('http://www.365key.com/storeit.aspx?t=3D'+escape=
(d.title)+'&u=3D'+escape(d.location.href)+'&c=3D'+escape(t),'keyit','scro=
llbars=3Dno,width=3D475,height=3D575,left=3D75,top=3D20,status=3Dno,resiz=
able=3Dyes'));
keyit.focus();
}
------=_NextPart_000_0000_01C5BFCB.F73FB160
Content-Type: application/octet-stream
Content-Transfer-Encoding: quoted-printable
Content-Location: http://blog.csdn.net/Skins/postnotice.js
document.write("<div class=3D\"postTitle\" style=3D\"text-align: =
center;\">");
document.write("<INPUT class=3Dibox2 maxLength=3D10 size=3D15 =
value=3D\"\" name=3D\"key\">");
document.write("<input type=3D\"button\" class=3D\"Button\" =
value=3D\"Blog Search\" name=3D\"btnSearch\" =
onClick=3D\"Form1.action=3D'http://search.csdn.net/search_blog.asp?key=3D=
'+Form1.key.value;Form1.target=3D'search';Form1.submit();\">");
document.write("</div>");
------=_NextPart_000_0000_01C5BFCB.F73FB160
Content-Type: application/octet-stream
Content-Transfer-Encoding: quoted-printable
Content-Location: http://judge.csdn.net/blog/BlogJudgeShow.aspx?BlogID=477409&Encoding=UTF-8&CurrPage=http://blog.csdn.net/mlovex/archive/2005/09/11/477409.aspx
document.write("<br>");
document.write("<div class=3D\"postTitle\" style=3D\"text-align: =
right;\">");
document.write("<label style=3D\"border: 0px solid #F00; text-align: =
center;\">");
document.write(" =E6=97=A0=E4=BA=BA=E8=AF=84=E4=BB=B7=E6=9C=AC=
=E6=96=87=E3=80=82");
document.write(" </label>");
document.write("<hr>");
document.write("<div id=3D'xxx' style=3D\"text-align: right;\">\r\n");
document.write("=E9=9C=80=E8=A6=81 ");
document.write("<a =
href=3D\"http://passport.csdn.net/member/UserLogin.aspx?from=3Dhttp://blo=
g.csdn.net/mlovex/archive/2005/09/11/477409.aspx\">=E7=99=BB=E5=BD=95</a>=
");
document.write(" =E6=89=8D=E5=8F=AF=E4=BB=A5=E8=AF=84=E4=BB=B7=
=E3=80=82 ");
document.write(" ");
document.write("\r\n");
document.write("</div>");
document.write("</div>\r\n");
------=_NextPart_000_0000_01C5BFCB.F73FB160--
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -