- 浏览: 159240 次
- 性别:
- 来自: 深圳
文章分类
最新评论
-
longjirobin:
[img] [/img][*]引用[u][/u][i][/i] ...
python中文编码问题 -
wolfmaster:
wolfmaster 写道挺好的,顶。。。。说的对
ie8 to ie6 -
wolfmaster:
挺好的,顶。。。。
ie8 to ie6 -
unique.wu:
用fileReader包一下你要序列化的文件就可以了~
Content is not allowed in prolog -
jiang562:
不是所有情况都可以用记事本打开的
Content is not allowed in prolog
<html>
<head>
<title>JSer </title>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<style>
/* Global CSS */
* { padding:0px; margin:0px; font-size:13px; font-family: arial 宋体; }
body { overflow:auto; border:0px none black; background-color:buttonface; }
li { margin:0px 0px 0px 40px; padding:2px 4px; }
/* Class CSS */
.quote { color:#999; }
.comments { color: #009090; }
.indent { margin-left:25px; }
.regexp { color:#F000F0; }
/* Identified CSS */
#divTools { height:20px; border-bottom:1px solid #555; padding-left:15px; }
#divTools a { color:navy; text-decoration:none; height:20px; line-height:20px; padding:0px 25px; }
#divTools a:hover { color:white; background-color:navy; text-decoration:none; height:20px; line-height:20px; }
#divJSInput { display:none; width:600px; height:450px; border:2px outset buttonface; position:absolute; background-color:buttonface; z-Index:2; }
#divJSInputTitle { color:white; background-color:navy; height:20px; line-height:20px; padding:0px 10px; cursor:default; }
#txtJSInput { width:598px; height:406px; overflow:auto; padding:4px 8px; background-color:white;}
#divJSInputBar { height:24px; padding:0px 4px; }
#divJSInputBar input { width:110px; height:22px; border:1px solid #555; line-height:20px; }
#divJSOutput { background-color:white; border:1px inset buttonface; width:100%; height:500px; overflow:auto; }
#divWaiting { display:none; width:400px; height:60px; border:1px solid buttonface; position:absolute; background-color:#E0F0F0; z-Index:3; text-align:center; padding-top:10px; }
#divWaiting input { width:140px; height:22px; border:1px solid #555; line-height:20px; cursor:default; margin-top:4px; }
</style>
<script type="text/javascript">
/**********************
Author: Hutia
*********************/
window.onload=init;
//------------------
// Static Variable
//------------------
var KEYWORDS="abstract break byte case catch char class const continue default delete do double else extends false final finally float for function goto if implements import in instanceof int interface long native null package private protected public reset return short static super switch synchronized this throw transient true try var void while with";
var OBJECTS="Anchor Applet Area Arguments Array Boolean Button Checkbox Collection Crypto Date Dictionary Document Drive Drives Element Enumerator Event File FileObject FileSystemObject FileUpload Folder Folders Form Frame Function Global Hidden History HTMLElement Image Infinity Input JavaArray JavaClass JavaObject JavaPackage JSObject Layer Link Math MimeType Navigator Number Object Option Packages Password Plugin PrivilegeManager Random RegExp Screen Select String Submit Text Textarea URL VBArray Window WScript";
var METHODS_PROPERTIES="above abs acos action activeElement alert alinkColor all altKey anchor anchors appCodeName applets apply appName appVersion arguments arity asin assign atan atan2 atob availHeight availLeft availTop availWidth ActiveXObject back background below bgColor big blink blur bold border borderWidths bottom btoa button call callee caller cancelBubble captureEvents ceil charAt charCodeAt charset checked children classes className clear clearInterval clearTimeout click clientInformation clientX clientY close closed colorDepth compile complete concat confirm constructir contains contextual cookie cos crypto ctrlKey current data defaultCharset defaultChecked defaultSelected defaultStatus defaultValue description disableExternalCapture disablePrivilege document domain E Echo element elements embeds enabledPlugin enableExternalCapture enablePrivilege encoding escape eval event exec exp expando FromPoint fgColor fileName find fixed floor focus fontColor fontSize form forms forward frames fromCharCode fromElement getAttribute get getClass getDate getDay getFullYear getHours getMember getMilliseconds getMinutes getMonth getSeconds getSelection getSlot getTime getTimezoneOffset getUTCDate getUTCDay getUTCFullYear getUTCHours getUTCMilliseconds getUTCMinutes getUTCMonth getUTCSeconds getWindow getYear global go HandleEvent Height hash hidden history home host hostName href hspace id ids ignoreCase images index indexOf inner innerHTML innerText innerWidth insertAdjacentHTML insertAdjacentText isFinite isNAN italics java javaEnabled join keyCode Links LN10 LN2 LOG10E LOG2E lang language lastIndex lastIndexOf lastMatch lastModified lastParen layers layerX layerY left leftContext length link linkColor load location locationBar log lowsrc MAX_VALUE MIN_VALUE margins match max menubar method mimeTypes min modifiers moveAbove moveBelow moveBy moveTo moveToAbsolute multiline NaN NEGATIVE_INFINITY name navigate navigator netscape next number offscreenBuffering offset offsetHeight offsetLeft offsetParent offsetTop offsetWidth offsetX offsetY onabort onblur onchange onclick ondblclick ondragdrop onerror onfocus onHelp onkeydown onkeypress onkeyup onload onmousedown onmousemove onmouseout onmouseover onmouseup onmove onreset onresize onsubmit onunload open opener options outerHeight outerHTML outerText outerWidth POSITIVE_INFINITY PI paddings pageX pageXOffset pageY pageYOffset parent parentElement parentLayer parentWindow parse parseFloat parseInt pathname personalbar pixelDepth platform plugins pop port pow preference previous print prompt protocol prototype push random readyState reason referrer refresh releaseEvents reload removeAttribute removeMember replace resizeBy resizeTo returnValue reverse right rightcontext round SQRT1_2 SQRT2 screenX screenY scroll scrollbars scrollBy scrollIntoView scrollTo search select selected selectedIndex self setAttribute setDay setFullYear setHotkeys setHours setInterval setMember setMilliseconds setMinutes setMonth setResizable setSeconds setSlot setTime setTimeout setUTCDate setUTCFullYear setUTCHours setUTCMillseconds setUTCMinutes setUTCMonth setUTCSeconds setYear setZOptions shift shiftKey siblingAbove siblingBelow signText sin slice smallsort source sourceIndex splice split sqrt src srcElement srcFilter status statusbar stop strike style sub submit substr substring suffixes sun sup systemLanguage TYPE tagName tags taint taintEnabled tan target test text title toElement toGMTString toLocaleString toLowerCase toolbar top toString toUpperCase toUTCString type typeOf UTC unescape unshift untaint unwatch userAgent userLanguage value valueOf visibility vlinkColor vspace watch which width window write writeln x y zIndex";
var OPS="! $ % & * + - // / : < = > ? [ ] ^ | ~ is new sizeof typeof unchecked";
var regKW=new RegExp("(\\W"+KEYWORDS.replace(/ /g,"$)|(\\W")+"$)","g");
var regObj=new RegExp("(\\W"+OBJECTS.replace(/ /g,"$)|(\\W")+"$)","g");
var regMP=new RegExp("(\\W"+METHODS_PROPERTIES.replace(/ /g,"$)|(\\W")+"$)","g");
//var regOP=new RegExp("(\\W"+OPS.replace(/ /g,"$)|(\\W")+"$)","g");
var colorKW="blue";
var colorObj="red";
var colorMP="#FF8000";
var colorOP="#004000";
//------------------
// Global Variables
//------------------
var divJSInput, txtJSInput, divJSOutput, divWaiting, spnProcess;
var glbStr, glbP, glbRe, curRe, glbTimer;
function init(){
// init global variables
divJSInput=document.getElementById("divJSInput");
txtJSInput=document.getElementById("txtJSInput");
divJSOutput=document.getElementById("divJSOutput");
divWaiting=document.getElementById("divWaiting");
spnProcess=document.getElementById("spnProcess");
// init window state
maximizeWindow();
divJSOutput.style.width=document.body.clientWidth-2;
divJSOutput.style.height=document.body.clientHeight-26;
// init global events
divJSInput.onkeydown=divJSInput_keydown;
}
//------------------
// event scripts
//------------------
function divJSInput_keydown(e){
var e=window.event?window.event:e;
var srcEle=e.srcElement?e.srcElement:e.target;
var sel;
if(e.keyCode==27)hideJSInput();
if(e.keyCode==13&&e.ctrlKey)execJSInput();
if(e.keyCode==9&&srcEle==txtJSInput){
document.selection.createRange().text="\t";return(false); // not support FF
}
}
//------------------
// functional scripts
//------------------
function showJSInput(){
with(divJSInput.style){
display="block";
left=(document.body.clientWidth-divJSInput.offsetWidth)/2;
top=(document.body.clientHeight-divJSInput.offsetHeight)/2;
}
txtJSInput.focus();
return(false);
}
function hideJSInput(){
divJSInput.style.display="none";
}
function execJSInput(){
hideJSInput();
divJSOutput.innerHTML="";
glbStr=txtJSInput.value.replace(/\r\n[ \t]+/gi,"\r\n").replace(/(\r\n)+/gi,"\r\n");
glbP=0;
curRe=glbRe=document.createElement("div");
divJSOutput.appendChild(glbRe);
glbRe.className="codeRoot";
showWait();
core_analysis();
}
function showWait(){
document.body.style.cursor="wait";
with(divWaiting.style){
display="block";
left=(document.body.clientWidth-divWaiting.offsetWidth)/2;
top=(document.body.clientHeight-divWaiting.offsetHeight)/2;
}
spnProcess.innerHTML="0.00% ( 0 / 0 )"
return(false);
}
function stopExec(){
document.body.style.cursor="";
divWaiting.style.display="none";
try{clearTimeout(glbTimer);}catch(e){}
return(false);
}
function core_analysis(){
var str=" ", c="", lastState="", seq, intNextQuote, intTemp, intCount, intWordStart;
spnProcess.innerHTML=parseFloat(glbP/glbStr.length*100).toFixed(2)+"% ( "+glbP+" / "+glbStr.length+" )";
for(var i=glbP;i<glbStr.length;i++){
c=glbStr.charAt(i);
str+=htmlEncode(c);
switch(c){
case "\r": case " ": case "\t":
if(lastState=="\r\n"){str=" ";break;}
if(c.match(/\W/)&&glbStr.charAt(i-1).match(/\w/)){
str=str.substring(0,str.length-htmlEncode(c).length);
str=str.replace(regKW,clKW).replace(regObj,clObj).replace(regMP,clMP)+htmlEncode(c);
}
break;
case "\n": case ";":
if(lastState=="\r\n"){str=" ";break;}
outputLn(str);
str=" ";
lastState="\r\n";
if(i-glbP>200){
glbP=i+1;
glbTimer=setTimeout(core_analysis);
return;
}
break;
case "\"":
intNextQuote=i;
while(intNextQuote!=-1&&intNextQuote<glbStr.length){
intNextQuote=glbStr.indexOf("\"",intNextQuote+1);
if(intNextQuote==-1||glbStr.charAt(intNextQuote-1)!="\\")break;
intCount=0; intTemp=intNextQuote;
while(glbStr.charAt(--intTemp)=="\\")intCount++;
if(intCount%2==0)break;
}
if(intNextQuote==-1)break;
str+="<span class=\"quote\">"+htmlEncode(glbStr.substring(i+1,intNextQuote))+"<\/span>\"";
i=intNextQuote;
lastState="";
break;
case "\'":
intNextQuote=i;
while(intNextQuote!=-1&&intNextQuote<glbStr.length){
intNextQuote=glbStr.indexOf("\'",intNextQuote+1);
if(intNextQuote==-1||glbStr.charAt(intNextQuote-1)!="\\")break;
intCount=0; intTemp=intNextQuote;
while(glbStr.charAt(--intTemp)=="\\")intCount++;
if(intCount%2==0)break;
}
if(intNextQuote==-1)break;
str+="<span class=\"quote\">"+htmlEncode(glbStr.substring(i+1,intNextQuote))+"<\/span>\'";
i=intNextQuote;
lastState="";
break;
case "\/":
if(glbStr.charAt(i+1)=="\/"){
intNextQuote=i;
intNextQuote=glbStr.indexOf("\r\n",intNextQuote+1);
if(intNextQuote==-1)intNextQuote=glbStr.length;
str=str.substring(0,str.length-1);
str+="<span class=\"comments\">\/"+htmlEncode(glbStr.substring(i+1,intNextQuote))+"<\/span>";
i=intNextQuote;
}else if(glbStr.charAt(i+1)=="*"){
intNextQuote=i;
intNextQuote=glbStr.indexOf("*\/",intNextQuote+1);
if(intNextQuote==-1)return;
str=str.substring(0,str.length-1);
str+="<span class=\"comments\">\/"+htmlEncode(glbStr.substring(i+1,intNextQuote))+"*\/<\/span>";
i=intNextQuote+1;
}else if(str.match(/[=(][ \t]*\//)){
intNextQuote=i;
while(intNextQuote!=-1&&intNextQuote<glbStr.length){
intNextQuote=glbStr.indexOf("\/",intNextQuote+1);
if(intNextQuote==-1||glbStr.charAt(intNextQuote-1)!="\\")break;
intCount=0; intTemp=intNextQuote;
while(glbStr.charAt(--intTemp)=="\\")intCount++;
if(intCount%2==0)break;
}
if(intNextQuote==-1)break;
str+="<span class=\"regexp\">"+htmlEncode(glbStr.substring(i+1,intNextQuote))+"<\/span>\/";
i=intNextQuote;
lastState="";
}
lastState="";
break;
case "{":
outputLn(str);
str=" ";
seq=document.createElement("div");
seq.className="indent";
curRe.appendChild(seq);
curRe=seq;
lastState="\r\n";
if(i-glbP>200){
glbP=i+1;
glbTimer=setTimeout(core_analysis);
return;
}
break;
case "}":
outputLn(str.substring(0,str.length-1));
str="} ";
lastState="";
curRe=curRe.parentNode;
break;
default:
if(c.match(/\w/)&&glbStr.charAt(i-1).match(/\W/)){intWordStart=i;}
if(c.match(/\W/)&&glbStr.charAt(i-1).match(/\w/)){
str=str.substring(0,str.length-htmlEncode(c).length);
str=str.replace(regKW,clKW).replace(regObj,clObj).replace(regMP,clMP)+htmlEncode(c);
}
lastState="";
break;
}
}
if(i==glbStr.length){
if(str!=""){ outputLn(str); str=" "; }
stopExec();
}
}
function outputLn(theStr){
var seq=document.createElement("p");
seq.innerHTML=theStr;
curRe.appendChild(seq);
}
function clKW(str){ return(str.charAt(0)+str.substring(1).fontcolor(colorKW)); }
function clObj(str){ return(str.charAt(0)+str.substring(1).fontcolor(colorObj)); }
function clMP(str){ return(str.charAt(0)+str.substring(1).fontcolor(colorMP)); }
function clOP(str){ return(str.charAt(0)+str.substring(1).fontcolor(colorOP)); }
//------------------
// global scripts
//------------------
function maximizeWindow(){
window.moveTo(0,0);
window.resizeTo(screen.availWidth,screen.availHeight);
}
function htmlEncode(strS){
return(strS.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/ /g," ").replace(/\r\n/g,"<br\/>"));
}
</script>
</head>
<body>
<div id="divTools">
<a href="#" onclick="return(showJSInput());">Input JS</a>
</div>
<div id="divJSInput">
<div id="divJSInputTitle">Please Input the JS:</div>
<textarea id="txtJSInput">
</textarea>
<div id="divJSInputBar">
<input type="button" value="OK" onclick="execJSInput();" />
<input type="button" value="Cancel" onclick="hideJSInput();" />
</div>
</div>
<div id="divJSOutput"></div>
<div id="divWaiting">
Processing...<span id="spnProcess"></span><br>
<input type="button" value="Stop" onclick="stopExec();" />
</div>
</body>
</html>
<head>
<title>JSer </title>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<style>
/* Global CSS */
* { padding:0px; margin:0px; font-size:13px; font-family: arial 宋体; }
body { overflow:auto; border:0px none black; background-color:buttonface; }
li { margin:0px 0px 0px 40px; padding:2px 4px; }
/* Class CSS */
.quote { color:#999; }
.comments { color: #009090; }
.indent { margin-left:25px; }
.regexp { color:#F000F0; }
/* Identified CSS */
#divTools { height:20px; border-bottom:1px solid #555; padding-left:15px; }
#divTools a { color:navy; text-decoration:none; height:20px; line-height:20px; padding:0px 25px; }
#divTools a:hover { color:white; background-color:navy; text-decoration:none; height:20px; line-height:20px; }
#divJSInput { display:none; width:600px; height:450px; border:2px outset buttonface; position:absolute; background-color:buttonface; z-Index:2; }
#divJSInputTitle { color:white; background-color:navy; height:20px; line-height:20px; padding:0px 10px; cursor:default; }
#txtJSInput { width:598px; height:406px; overflow:auto; padding:4px 8px; background-color:white;}
#divJSInputBar { height:24px; padding:0px 4px; }
#divJSInputBar input { width:110px; height:22px; border:1px solid #555; line-height:20px; }
#divJSOutput { background-color:white; border:1px inset buttonface; width:100%; height:500px; overflow:auto; }
#divWaiting { display:none; width:400px; height:60px; border:1px solid buttonface; position:absolute; background-color:#E0F0F0; z-Index:3; text-align:center; padding-top:10px; }
#divWaiting input { width:140px; height:22px; border:1px solid #555; line-height:20px; cursor:default; margin-top:4px; }
</style>
<script type="text/javascript">
/**********************
Author: Hutia
*********************/
window.onload=init;
//------------------
// Static Variable
//------------------
var KEYWORDS="abstract break byte case catch char class const continue default delete do double else extends false final finally float for function goto if implements import in instanceof int interface long native null package private protected public reset return short static super switch synchronized this throw transient true try var void while with";
var OBJECTS="Anchor Applet Area Arguments Array Boolean Button Checkbox Collection Crypto Date Dictionary Document Drive Drives Element Enumerator Event File FileObject FileSystemObject FileUpload Folder Folders Form Frame Function Global Hidden History HTMLElement Image Infinity Input JavaArray JavaClass JavaObject JavaPackage JSObject Layer Link Math MimeType Navigator Number Object Option Packages Password Plugin PrivilegeManager Random RegExp Screen Select String Submit Text Textarea URL VBArray Window WScript";
var METHODS_PROPERTIES="above abs acos action activeElement alert alinkColor all altKey anchor anchors appCodeName applets apply appName appVersion arguments arity asin assign atan atan2 atob availHeight availLeft availTop availWidth ActiveXObject back background below bgColor big blink blur bold border borderWidths bottom btoa button call callee caller cancelBubble captureEvents ceil charAt charCodeAt charset checked children classes className clear clearInterval clearTimeout click clientInformation clientX clientY close closed colorDepth compile complete concat confirm constructir contains contextual cookie cos crypto ctrlKey current data defaultCharset defaultChecked defaultSelected defaultStatus defaultValue description disableExternalCapture disablePrivilege document domain E Echo element elements embeds enabledPlugin enableExternalCapture enablePrivilege encoding escape eval event exec exp expando FromPoint fgColor fileName find fixed floor focus fontColor fontSize form forms forward frames fromCharCode fromElement getAttribute get getClass getDate getDay getFullYear getHours getMember getMilliseconds getMinutes getMonth getSeconds getSelection getSlot getTime getTimezoneOffset getUTCDate getUTCDay getUTCFullYear getUTCHours getUTCMilliseconds getUTCMinutes getUTCMonth getUTCSeconds getWindow getYear global go HandleEvent Height hash hidden history home host hostName href hspace id ids ignoreCase images index indexOf inner innerHTML innerText innerWidth insertAdjacentHTML insertAdjacentText isFinite isNAN italics java javaEnabled join keyCode Links LN10 LN2 LOG10E LOG2E lang language lastIndex lastIndexOf lastMatch lastModified lastParen layers layerX layerY left leftContext length link linkColor load location locationBar log lowsrc MAX_VALUE MIN_VALUE margins match max menubar method mimeTypes min modifiers moveAbove moveBelow moveBy moveTo moveToAbsolute multiline NaN NEGATIVE_INFINITY name navigate navigator netscape next number offscreenBuffering offset offsetHeight offsetLeft offsetParent offsetTop offsetWidth offsetX offsetY onabort onblur onchange onclick ondblclick ondragdrop onerror onfocus onHelp onkeydown onkeypress onkeyup onload onmousedown onmousemove onmouseout onmouseover onmouseup onmove onreset onresize onsubmit onunload open opener options outerHeight outerHTML outerText outerWidth POSITIVE_INFINITY PI paddings pageX pageXOffset pageY pageYOffset parent parentElement parentLayer parentWindow parse parseFloat parseInt pathname personalbar pixelDepth platform plugins pop port pow preference previous print prompt protocol prototype push random readyState reason referrer refresh releaseEvents reload removeAttribute removeMember replace resizeBy resizeTo returnValue reverse right rightcontext round SQRT1_2 SQRT2 screenX screenY scroll scrollbars scrollBy scrollIntoView scrollTo search select selected selectedIndex self setAttribute setDay setFullYear setHotkeys setHours setInterval setMember setMilliseconds setMinutes setMonth setResizable setSeconds setSlot setTime setTimeout setUTCDate setUTCFullYear setUTCHours setUTCMillseconds setUTCMinutes setUTCMonth setUTCSeconds setYear setZOptions shift shiftKey siblingAbove siblingBelow signText sin slice smallsort source sourceIndex splice split sqrt src srcElement srcFilter status statusbar stop strike style sub submit substr substring suffixes sun sup systemLanguage TYPE tagName tags taint taintEnabled tan target test text title toElement toGMTString toLocaleString toLowerCase toolbar top toString toUpperCase toUTCString type typeOf UTC unescape unshift untaint unwatch userAgent userLanguage value valueOf visibility vlinkColor vspace watch which width window write writeln x y zIndex";
var OPS="! $ % & * + - // / : < = > ? [ ] ^ | ~ is new sizeof typeof unchecked";
var regKW=new RegExp("(\\W"+KEYWORDS.replace(/ /g,"$)|(\\W")+"$)","g");
var regObj=new RegExp("(\\W"+OBJECTS.replace(/ /g,"$)|(\\W")+"$)","g");
var regMP=new RegExp("(\\W"+METHODS_PROPERTIES.replace(/ /g,"$)|(\\W")+"$)","g");
//var regOP=new RegExp("(\\W"+OPS.replace(/ /g,"$)|(\\W")+"$)","g");
var colorKW="blue";
var colorObj="red";
var colorMP="#FF8000";
var colorOP="#004000";
//------------------
// Global Variables
//------------------
var divJSInput, txtJSInput, divJSOutput, divWaiting, spnProcess;
var glbStr, glbP, glbRe, curRe, glbTimer;
function init(){
// init global variables
divJSInput=document.getElementById("divJSInput");
txtJSInput=document.getElementById("txtJSInput");
divJSOutput=document.getElementById("divJSOutput");
divWaiting=document.getElementById("divWaiting");
spnProcess=document.getElementById("spnProcess");
// init window state
maximizeWindow();
divJSOutput.style.width=document.body.clientWidth-2;
divJSOutput.style.height=document.body.clientHeight-26;
// init global events
divJSInput.onkeydown=divJSInput_keydown;
}
//------------------
// event scripts
//------------------
function divJSInput_keydown(e){
var e=window.event?window.event:e;
var srcEle=e.srcElement?e.srcElement:e.target;
var sel;
if(e.keyCode==27)hideJSInput();
if(e.keyCode==13&&e.ctrlKey)execJSInput();
if(e.keyCode==9&&srcEle==txtJSInput){
document.selection.createRange().text="\t";return(false); // not support FF
}
}
//------------------
// functional scripts
//------------------
function showJSInput(){
with(divJSInput.style){
display="block";
left=(document.body.clientWidth-divJSInput.offsetWidth)/2;
top=(document.body.clientHeight-divJSInput.offsetHeight)/2;
}
txtJSInput.focus();
return(false);
}
function hideJSInput(){
divJSInput.style.display="none";
}
function execJSInput(){
hideJSInput();
divJSOutput.innerHTML="";
glbStr=txtJSInput.value.replace(/\r\n[ \t]+/gi,"\r\n").replace(/(\r\n)+/gi,"\r\n");
glbP=0;
curRe=glbRe=document.createElement("div");
divJSOutput.appendChild(glbRe);
glbRe.className="codeRoot";
showWait();
core_analysis();
}
function showWait(){
document.body.style.cursor="wait";
with(divWaiting.style){
display="block";
left=(document.body.clientWidth-divWaiting.offsetWidth)/2;
top=(document.body.clientHeight-divWaiting.offsetHeight)/2;
}
spnProcess.innerHTML="0.00% ( 0 / 0 )"
return(false);
}
function stopExec(){
document.body.style.cursor="";
divWaiting.style.display="none";
try{clearTimeout(glbTimer);}catch(e){}
return(false);
}
function core_analysis(){
var str=" ", c="", lastState="", seq, intNextQuote, intTemp, intCount, intWordStart;
spnProcess.innerHTML=parseFloat(glbP/glbStr.length*100).toFixed(2)+"% ( "+glbP+" / "+glbStr.length+" )";
for(var i=glbP;i<glbStr.length;i++){
c=glbStr.charAt(i);
str+=htmlEncode(c);
switch(c){
case "\r": case " ": case "\t":
if(lastState=="\r\n"){str=" ";break;}
if(c.match(/\W/)&&glbStr.charAt(i-1).match(/\w/)){
str=str.substring(0,str.length-htmlEncode(c).length);
str=str.replace(regKW,clKW).replace(regObj,clObj).replace(regMP,clMP)+htmlEncode(c);
}
break;
case "\n": case ";":
if(lastState=="\r\n"){str=" ";break;}
outputLn(str);
str=" ";
lastState="\r\n";
if(i-glbP>200){
glbP=i+1;
glbTimer=setTimeout(core_analysis);
return;
}
break;
case "\"":
intNextQuote=i;
while(intNextQuote!=-1&&intNextQuote<glbStr.length){
intNextQuote=glbStr.indexOf("\"",intNextQuote+1);
if(intNextQuote==-1||glbStr.charAt(intNextQuote-1)!="\\")break;
intCount=0; intTemp=intNextQuote;
while(glbStr.charAt(--intTemp)=="\\")intCount++;
if(intCount%2==0)break;
}
if(intNextQuote==-1)break;
str+="<span class=\"quote\">"+htmlEncode(glbStr.substring(i+1,intNextQuote))+"<\/span>\"";
i=intNextQuote;
lastState="";
break;
case "\'":
intNextQuote=i;
while(intNextQuote!=-1&&intNextQuote<glbStr.length){
intNextQuote=glbStr.indexOf("\'",intNextQuote+1);
if(intNextQuote==-1||glbStr.charAt(intNextQuote-1)!="\\")break;
intCount=0; intTemp=intNextQuote;
while(glbStr.charAt(--intTemp)=="\\")intCount++;
if(intCount%2==0)break;
}
if(intNextQuote==-1)break;
str+="<span class=\"quote\">"+htmlEncode(glbStr.substring(i+1,intNextQuote))+"<\/span>\'";
i=intNextQuote;
lastState="";
break;
case "\/":
if(glbStr.charAt(i+1)=="\/"){
intNextQuote=i;
intNextQuote=glbStr.indexOf("\r\n",intNextQuote+1);
if(intNextQuote==-1)intNextQuote=glbStr.length;
str=str.substring(0,str.length-1);
str+="<span class=\"comments\">\/"+htmlEncode(glbStr.substring(i+1,intNextQuote))+"<\/span>";
i=intNextQuote;
}else if(glbStr.charAt(i+1)=="*"){
intNextQuote=i;
intNextQuote=glbStr.indexOf("*\/",intNextQuote+1);
if(intNextQuote==-1)return;
str=str.substring(0,str.length-1);
str+="<span class=\"comments\">\/"+htmlEncode(glbStr.substring(i+1,intNextQuote))+"*\/<\/span>";
i=intNextQuote+1;
}else if(str.match(/[=(][ \t]*\//)){
intNextQuote=i;
while(intNextQuote!=-1&&intNextQuote<glbStr.length){
intNextQuote=glbStr.indexOf("\/",intNextQuote+1);
if(intNextQuote==-1||glbStr.charAt(intNextQuote-1)!="\\")break;
intCount=0; intTemp=intNextQuote;
while(glbStr.charAt(--intTemp)=="\\")intCount++;
if(intCount%2==0)break;
}
if(intNextQuote==-1)break;
str+="<span class=\"regexp\">"+htmlEncode(glbStr.substring(i+1,intNextQuote))+"<\/span>\/";
i=intNextQuote;
lastState="";
}
lastState="";
break;
case "{":
outputLn(str);
str=" ";
seq=document.createElement("div");
seq.className="indent";
curRe.appendChild(seq);
curRe=seq;
lastState="\r\n";
if(i-glbP>200){
glbP=i+1;
glbTimer=setTimeout(core_analysis);
return;
}
break;
case "}":
outputLn(str.substring(0,str.length-1));
str="} ";
lastState="";
curRe=curRe.parentNode;
break;
default:
if(c.match(/\w/)&&glbStr.charAt(i-1).match(/\W/)){intWordStart=i;}
if(c.match(/\W/)&&glbStr.charAt(i-1).match(/\w/)){
str=str.substring(0,str.length-htmlEncode(c).length);
str=str.replace(regKW,clKW).replace(regObj,clObj).replace(regMP,clMP)+htmlEncode(c);
}
lastState="";
break;
}
}
if(i==glbStr.length){
if(str!=""){ outputLn(str); str=" "; }
stopExec();
}
}
function outputLn(theStr){
var seq=document.createElement("p");
seq.innerHTML=theStr;
curRe.appendChild(seq);
}
function clKW(str){ return(str.charAt(0)+str.substring(1).fontcolor(colorKW)); }
function clObj(str){ return(str.charAt(0)+str.substring(1).fontcolor(colorObj)); }
function clMP(str){ return(str.charAt(0)+str.substring(1).fontcolor(colorMP)); }
function clOP(str){ return(str.charAt(0)+str.substring(1).fontcolor(colorOP)); }
//------------------
// global scripts
//------------------
function maximizeWindow(){
window.moveTo(0,0);
window.resizeTo(screen.availWidth,screen.availHeight);
}
function htmlEncode(strS){
return(strS.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/ /g," ").replace(/\r\n/g,"<br\/>"));
}
</script>
</head>
<body>
<div id="divTools">
<a href="#" onclick="return(showJSInput());">Input JS</a>
</div>
<div id="divJSInput">
<div id="divJSInputTitle">Please Input the JS:</div>
<textarea id="txtJSInput">
</textarea>
<div id="divJSInputBar">
<input type="button" value="OK" onclick="execJSInput();" />
<input type="button" value="Cancel" onclick="hideJSInput();" />
</div>
</div>
<div id="divJSOutput"></div>
<div id="divWaiting">
Processing...<span id="spnProcess"></span><br>
<input type="button" value="Stop" onclick="stopExec();" />
</div>
</body>
</html>
发表评论
-
全面理解javascript的caller,callee,call,apply概念
2009-12-10 19:35 929看了网上的一篇文章 记下代码,备用 <script la ... -
aaaaaa
2009-11-04 19:43 0将各业务工单预算值设定为阀值(工单预算值=上周期工单量(1+5 ... -
url getParameterValue
2009-06-16 11:46 803function getParameterValue(name ... -
Scripting.FileSystemObject使用
2009-06-10 18:03 1597<HTML> <HEAD> <T ... -
js屏蔽回退
2009-04-07 11:42 1612function onKeyDown() { if ( ... -
js控制光标移动到文本对象的指定位置
2009-03-18 16:00 5080//光标移到text 中指定位置 function set ... -
经典js小例子
2009-03-16 20:43 1022<script type=“text/javascrip ... -
js操作checkbox radio的方法
2009-01-16 17:25 2204/* * 根据分割符号 把值赋给 相应的CheckBox * ... -
js操作表格的方法
2009-01-16 17:24 1601/* *根据传进来的表结构 和相应的列,返回 */ funct ... -
js工具方法
2009-01-16 17:23 958function GetObj(s) { retur ... -
js给label加悬停样式
2009-01-16 17:02 2002//页面checkboxList radioButtonLis ... -
相同相邻元素的位置
2009-01-09 15:57 1007function getSameColStartEndPos( ... -
js删除元素
2009-01-08 19:24 6115<html> <head>& ... -
原型Ajax
2008-12-25 17:21 855function workarounda(id) ... -
checkboxList的js去value变通方法
2008-11-19 15:08 2353//把checkboxlist值付给 textbox fun ... -
背景控制
2008-10-13 15:04 812obj.style.fontSize="20px ... -
jsFormat
2008-10-08 15:13 1065<HTML><HEAD><TIT ... -
IE6 and Firefox Js的区别
2008-10-08 09:53 2916IE6 迁移到 Firefox 的工作笔记 ... -
javascript 命名空间
2008-08-02 15:34 2591注:好久没写了,今天 ... -
js给text加背景图
2008-08-01 15:40 948document.getElementById('a').st ...
相关推荐
单项海洋环境影响评价等级表.docx
【作品名称】:基于AT89C51 单片机为核心器件,程序设计采用C 语言,Keil 软件编译程序,配以相关外围接口电路,实现了方波、锯齿波、正弦波、三角波、梯形波五种特定波形的产生【论文+源码】 【适用人群】:适用于希望学习不同技术领域的小白或进阶学习者。可作为毕设项目、课程设计、大作业、工程实训或初期项目立项。 【项目介绍】:本设计中的波形发生器系统要求基于51单片机,因此选用以AT89C51单片机作为整个系统的控制核心,应用其强大的接口功能,构成整个波形发生器的硬件系统。使用C 语言对单片机编程可产生相应的正弦波,方波,三角波,锯齿波梯形波波形信号。在程序运行时,当接收到按键信息后,需要输出某种波形时,调用相应的中断服务子程序和波形发生程序,经电路的数/模转换器和运算放大器处理后,从信号发生器的输出端口输出即可得到要求的波形。 当需要改变频率时只需要改变单片机的波形发生程序中的递增或者递减变量即可。 【资源声明】:本资源作为“参考资料”而不是“定制需求”,代码只能作为参考,不能完全复制照搬。需要有一定的基础看懂代码,自行调试代码并解决报错,能自行添加功能修改代码。
数学建模培训资料 数学建模实战题目真题答案解析解题过程&论文报告 完全多元图的最大匹配问题研究 共9页.pdf
本项目是基于Python Web的社区爱心养老管理系统,旨在为社区养老提供一个全面、高效的管理平台。系统集成了用户管理、老人信息管理、健康管理、活动管理、服务管理等多项功能,通过简洁明了的界面,让管理人员能够轻松地进行各项操作,从而更好地服务于社区老人。 在架构上,系统采用B/S模式,前端使用HTML、CSS、JavaScript等技术,搭配Vue.js框架,实现了用户友好的交互界面;后端则基于Python的Django框架,提供了稳定且高效的服务端逻辑处理能力。数据库选用MySQL,确保了数据的存储安全和高效访问。 开发此项目的目的,不仅是为了满足计算机相关专业学生的毕设需求,提供一个实战练习的平台,更是希望通过实际项目的开发,培养学生的专业技能和实践能力,同时,也希望能为社区养老服务贡献一份力量,通过科技手段,让老年人的生活更加美好、便捷。
教学版单体spring-petlinic,课程《Kubernetes微服务实践》
内容概要:本文介绍了16世纪法国外交家Blaise de Vigenère提出的一种多表密码算法,详细解释了Vigenère密码的加密解密机制及其历史应用背景。特别提到了当明文M的长度超过密钥K的情况下,密钥会被重复使用的技巧。 适合人群:对古典密码学感兴趣的初学者,以及希望深入理解密码编码基本原理的学习者。 使用场景及目标:了解Vigenère密码的工作原理,掌握简单的加解密技术,增强信息安全意识。能够自行实施加解密操作,理解经典密码学的基本概念和技术。 其他说明:本文不仅提供了理论讲解,还给出了具体的例子帮助理解和实操练习。
STM32-EMBPI : Embedded Pi, triple-play platform for STM32, Raspberry Pi and Arduino
内容概要:本文主要探讨了电子电气架构中的网络管理策略,尤其是针对汽车中多个ECU(Electronic Control Unit)的协同管理和低功耗设计。通过引入网络管理状态机的概念,详细介绍了各状态(如常规运行状态、重复报文状态、准备睡眠模式、预睡眠模式、深度睡眠模式等)的具体运作机制及其在汽车电子系统中的重要性。文中还讨论了网络管理报文的设计与传输规则,特别是控制位向量CBV的定义,强调了网络管理在节能降耗方面的关键作用。 适用人群:具备一定汽车电子工程背景的专业人士或研究者,尤其对网络管理及低功耗设计感兴趣的工程师。 使用场景及目标:适用于汽车设计与制造企业的研发部门,帮助其优化电子控制系统,提升产品能效比,降低维护成本,提高用户体验。通过对网络管理策略的理解与应用,达到降低车载电子系统功耗的目的,进而延长电动车的续航能力和降低传统燃油车的油耗。 其他说明:文章不仅提供了理论上的阐述,还包括了具体的操作指南和技术细节,有助于从业者深入理解和实施网络管理方案。同时提醒在现代信息化社会中保持屏蔽力的重要性,鼓励读者专注于自己的发展目标,避免无效的精力分散。
英飞凌TC3XX_MCAL培训PPT
缴费综合服务系-JAVA-基于springBoot高校网上缴费综合服务系统设计与实现
Python与机器学习方向,《TensorFlow基础教程》课程仓库
【资源说明】 本科毕业设计 基于Python+Django教学资源管理系统网站详细文档+全部资料.zip 【备注】 1、该项目是个人高分项目源码,已获导师指导认可通过,答辩评审分达到95分 2、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 3、本项目适合计算机相关专业(人工智能、通信工程、自动化、电子信息、物联网等)的在校学生、老师或者企业员工下载使用,也可作为毕业设计、课程设计、作业、项目初期立项演示等,当然也适合小白学习进阶。 4、如果基础还行,可以在此代码基础上进行修改,以实现其他功能,也可直接用于毕设、课设、作业等。 欢迎下载,沟通交流,互相学习,共同进步!
内容概要:文章详细讨论了汽车行业正经历的重大变革,尤其是电动汽车(EV)和软件定义汽车(SDV)对行业的深远影响。随着技术的进步,汽车的差异化优势不再仅限于机械硬件,而是越来越多地取决于软件和服务。这一转型要求汽车制造商重新评估现有的解决方案堆栈,加大在电气化和连接性等领域的投资,以实现车型的电气化并支持可扩展性和全生命周期更新。同时,汽车的开发重点已经从机电领域转向了芯片和软件领域,强调基于云计算的协作开发方法。 适合人群:汽车行业专业人士、汽车电子工程师、技术研发人员及政策制定者。 使用场景及目标:帮助读者理解和把握汽车行业数字化转型的趋势,指导他们在电动汽车和软件定义汽车领域做出正确的技术投资和战略调整。 其他说明:本文不仅讨论了技术变革,还深入剖析了由此带来的商业和运营模式的变化,为汽车行业的未来发展方向提供了洞见。
微信课堂助手 微信小程序+PHP毕业设计 源码+数据库+论文+启动教程
新设博士后科研工作站备案申请表.xlsx
的玩具 Python 实现手套蟒蛇GloVe的玩具 Python 实现。Glove 产生单词的密集向量嵌入,其中一起出现的单词在生成的向量空间中靠得很近。虽然这会产生与word2vec (在gensim中有一个很棒的 python 实现)类似的嵌入,但方法不同GloVe 通过对语料库词共现矩阵的对数进行分解来产生嵌入。代码采用异步随机梯度下降,用Cython实现,很可能存在大量bug。安装使用 pip 从 pypi 安装pip install glove_python。OSX 用户请注意由于使用 OpenMP,glove-python 无法在 Clang 下编译。要安装它,您需要一个较新的版本gcc(例如来自 Homebrew)。应该由 接收setup.py如果没有,请打开一个问题。使用 OSX 中包含的默认 Python 发行版进行构建也不受支持请尝试 Homebrew 或 Anaconda 中的版本。用法生成嵌入分为两个步骤从语料库中创建共现矩阵,然后使用它生成嵌入。该类Corpus有助于从可交互的标记构建语料库该类Glove训练嵌入(使
消息中间件rabbitmq学习的一些代码、笔记
环境说明:开发语言:Java 框架:springboot JDK版本:JDK1.8 服务器:tomcat7 数据库:mysql 5.7 数据库工具:Navicat 开发软件:eclipse/myeclipse/idea Maven包:Maven 浏览器:谷歌浏览器。 项目均可完美运行
空气质量现状评价表.docx
建设工程施工现场消防安全检查表.docx