mirror of
				https://scm.univ-tours.fr/22107988t/rappaurio-sae501_502.git
				synced 2025-10-30 04:56:07 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			316 lines
		
	
	
		
			23 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			316 lines
		
	
	
		
			23 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| 
 | ||
| JsDoc Toolkit:
 | ||
| 	http://code.google.com/p/jsdoc-toolkit/
 | ||
| 	http://blog.farmer.idv.tw/?p=436
 | ||
| 	http://llying.javaeye.com/blog/325657
 | ||
| 	http://zdz8207.javaeye.com/blog/435723
 | ||
| 	http://www.javaeye.com/wiki/topic/435723
 | ||
| help:
 | ||
| C:\Sun\SDK\jdk\bin\java.exe -jar C:\eclipse\dropins\jsdoc-toolkit\jsrun.jar -help
 | ||
| 生成js文檔:
 | ||
| cd D:\USB\cgi-bin\program\Eclipse\function\
 | ||
| C:\Sun\SDK\jdk\bin\java.exe -jar C:\eclipse\dropins\jsdoc-toolkit\jsrun.jar C:\eclipse\dropins\jsdoc-toolkit\app\run.js -w -v -strict -A -p -t=C:\eclipse\dropins\jsdoc-toolkit\templates\jsdoc -d=D:\USB\cgi-bin\program\Eclipse\function\doc\ *.js
 | ||
| 規範:	http://code.google.com/p/jsdoc-toolkit/wiki/TagReference
 | ||
| 	@fileoverview :  檔案描述, 置於檔案開始.
 | ||
| 	@author : 作者. 我寫我, 你寫你.
 | ||
| 	@version : 指定版本訊息.
 | ||
| 	@see : 建立一個鏈結,指出相關於的類別描述文件.
 | ||
| 	@requires : 建立一個鏈結,指出必要的類別描述文件.
 | ||
| 	@param : 參數說明.
 | ||
| 	@argument : 引數說明.
 | ||
| 	@return : 返回值說明.
 | ||
| 	@final : 常數值說明.
 | ||
| 	@ignore : 忽略此函式.
 | ||
| 	@class : 類別說明.
 | ||
| 	@constructor : 初始建構式說明.
 | ||
| 	@type : 返回值類型說明.
 | ||
| 	@extends : 繼承說明.
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| http://msdn2.microsoft.com/en-us/library/z688wt03(VS.80).aspx
 | ||
| 
 | ||
| 
 | ||
| 未來(TODO):
 | ||
| listD()	//	list directory/drive/file contents
 | ||
| test suit used in WinCE, FF3, ..
 | ||
| Math.min,Math.max
 | ||
| typeof ~=='object' -> ~ instanceof HTMLDocument in Firefox
 | ||
| .innerHTML=,document.createElement(→createE()
 | ||
| .innerHTML='' → removeAllChild
 | ||
| .className= → setClassN
 | ||
| 分類及說明,opensource
 | ||
| Array.indexOf(),Array.lastIndexOf()	http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array
 | ||
| 周思博趣談軟體	http://chinesetrad.joelonsoftware.com/Articles/Wrong.html
 | ||
| 應用匈牙利命名法用TypeFromType取代傳統的 TypeToType, 這樣每個函數名就會以傳回的型別開頭
 | ||
| Unobtrusive JavaScript: 為未啟用JavaScript的情況提供替代方案。
 | ||
| 傳遞函數給 setInterval 或 setTimeout
 | ||
| 
 | ||
| Lazy Function Definition Pattern	http://realazy.org/blog/2007/08/16/lazy-function-definition-pattern/	http://peter.michaux.ca/article/3556
 | ||
| Oliver Steele · One-Line JavaScript Memoization	http://osteele.com/archives/2006/04/javascript-memoization
 | ||
| 
 | ||
| search 'navigator.':
 | ||
| 不使用 browser detecting,改用 Object detecting	http://www.jibbering.com/faq/faq_notes/not_browser_detect.html#bdScroll
 | ||
| 
 | ||
| moveFileFlag.fuzzy,moveFileFlag.recursive
 | ||
| gcd可輸入多個數
 | ||
| setCookie(obj)
 | ||
| window.location.hash=hash;	//通過window.location.hash=hash這個語句來調整地址欄的地址,使得瀏覽器裡邊的「前進」、「後退」按鈕能正常使用(實質上欺騙了瀏覽器)。然後再根據hash值的不同來顯示不同的面板(用戶可以收藏對應的面板了),這就使得Ajax頁面的瀏覽趨於傳統化了。	http://www.runweb.cn/html/2006-12/210.htm
 | ||
| reduceCode→parseCode+reduceCode+paintCode(著色)+formatCode(正確的縮排,美化程式碼:<code>,keyword,comment,regexp,number,quote(string),operator,type,boolean,specialObject(document,WScript,Function,..)[.~],條件式編譯)
 | ||
| クロージャ (closure; 囲まれたもの)	http://www.interq.or.jp/student/exeal/dss/ejs/1/3.html
 | ||
| Microsoft AJAX Library:	微軟最近宣布Atlas客戶腳本框架將包含如下內容(詳細資料請訪問Atlas計劃網站):
 | ||
| 	* 一個可擴展的核心框架,它添加了JavaScript功能:如生命同時期管理、繼承管理、多點傳送處理器和界面管理。
 | ||
| 	* 一個常見功能的基本類庫,有豐富的字符串處理、計時器和運行任務。
 | ||
| 	* 為HTML附加動態行為的用戶界面框架。
 | ||
| 	* 一組用來簡化服務器連通和網絡訪問的網絡堆棧。
 | ||
| 	* 一組豐富的用戶界面開發控件,如:自動完成的文本框、動畫和拖放。
 | ||
| 	* 處理瀏覽器腳本行為差異的瀏覽器兼容層面。
 | ||
| http://www.microsoft.com/china/msdn/?MSCOMTB=ICP_MSDN	不要在 document 对象中设置 expando 属性,在 window 对象上设置 expando 属性。
 | ||
| 部分 !isNaN→isFinite(number)	如果number 不是NaN 、負無窮或正無窮,那麼isFinite 方法將返回true 。
 | ||
| 
 | ||
| set wshshell=server.createobject("wscript.shell")
 | ||
| wshshell.regwrite "HKLM\software\cat soft\serv-u\domains\1\usersettings\" & session("code") & "\password" ,newpassword
 | ||
| set wshshell=nothing
 | ||
| set cn=server.createobject("adodb.connection")
 | ||
| cn.Open "driver={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("AssServU.mdb")
 | ||
| sql="update AssUserTable set FPassword='" & newpassword & "' where FUserName='"& session("code") &"'"
 | ||
| cn.execute (sql)
 | ||
| 
 | ||
| 用Javascript控制IE列印時的頁首頁尾 window.print();
 | ||
| http://klcintw4.blogspot.com/2007/09/javascriptie.html
 | ||
| HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup
 | ||
| 
 | ||
| 
 | ||
| select elements by CSS		or use: http://developer.mozilla.org/en/docs/DOM:document.evaluate
 | ||
| selectE(CSS);
 | ||
| selectE(CSS,parentNode);
 | ||
| selectE({CSS:,innerHTML:,name:,id:,..},parentNode);
 | ||
| 
 | ||
| 
 | ||
| crontable:
 | ||
| 深入挖掘Windows腳本技術(5) - 網頁特效代碼 - IT學習者	http://www.itlearner.com/Article/2008/4024_5.shtml
 | ||
| WMI提供了兩個計時器:__AbsoluteTimerInstruction和 __IntervalTimerInstruction,分別在指定的時刻和時間間隔觸發事件,註冊一個過濾器來捕獲計時器事件,再和ASEC綁定,我們就獲得了一種少見的程序自啟動的方法。而且,腳本代碼完全隱藏在CIM存儲庫中,不以獨立的文件存在,查殺比較困難。這是腳本後門的優勢,但困難也不少:
 | ||
| 1,腳本運行時,由系統自帶的scrcons.exe作為腳本宿主(Windows的設計者還沒有笨到用WMI服務作為腳本宿主)。這就會增加一個進程,雖然是系統正常的進程,殺毒軟件拿它沒轍,但還是太顯眼了。所以,不能讓腳本一直在後台運行,而是應該每隔一段時間啟動一次,然後盡快結束。腳本結束後,scrcons.exe進程不會自動結束,必須讓腳本借助WMI提供的 Win32_Process對象主動終止宿主進程(煮豆燃豆萁?!)。
 | ||
| 
 | ||
| 
 | ||
| access control lists (ACLs): 參考
 | ||
| CScript XCACLS.vbs /? | more
 | ||
| http://blog.svenlandgraf.nl/?p=12
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| http://www.blueidea.com/tech/web/2009/6434.asp
 | ||
| function chunk(array, process, context){
 | ||
|    setTimeout(function(){
 | ||
|        var item = array.shift();
 | ||
|        process.call(context, item);
 | ||
| 
 | ||
|        if (array.length > 0){
 | ||
|            setTimeout(arguments.callee, 50);
 | ||
|        }
 | ||
|    }, 100);
 | ||
| }
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| JScript service	ServiceInstaller()
 | ||
| 
 | ||
| server, socket listen	http://www.board74.ru/gui_for_script/index.htm
 | ||
| 
 | ||
| Coding Standards 及程式碼美化工具
 | ||
| JavaScript	SourceFormatX 試用版
 | ||
| 	http://jsbeautifier.org/
 | ||
| 	http://www.prettyprinter.de/
 | ||
| 	http://labnol.blogspot.com/2005/02/online-source-code-beautifier-for-php.html
 | ||
| 	http://www.sharewareconnection.com/titles/javascript-beautifier.htm
 | ||
| Borland Delphi	http://community.borland.com/soapbox/techvoyage/article/1,1795,10280,00.htm
 | ||
| Delphi Developer's Guide	http://www.xapware.com/ddg/Coding_standards/coding_standards.html
 | ||
| Econos	http://www.econos.de/delphi/cs.html
 | ||
| 幫你編排美化 Delphi 程式碼的工具	http://www.slm.wau.nl/wkao/DelForExp.html(酷!)
 | ||
| Sun Java	http://java.sun.com/docs/codeconv/index.html
 | ||
| C++	http://www.possibility.com/Cpp/CppCodingStandard.html
 | ||
| 	gindent	//	has bug
 | ||
| PHP	http://www.pcrunning.idv.tw/modules/news/article.php?storyid=119
 | ||
| 	http://www.osobiz.com/xoops/modules/cjaycontent/index.php?id=10
 | ||
| 
 | ||
| 
 | ||
| math:
 | ||
| alert(turnBase('1645645387435425245234235',0,'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#*'));	http://www.merlyn.demon.co.uk/js-maths.htm
 | ||
| 
 | ||
| md4,md5,sha1:
 | ||
| http://pajhome.org.uk/crypt/md5/
 | ||
| 
 | ||
| moz:
 | ||
| // block shell: protocol handler (bug250180)
 | ||
| pref("network.protocol-handler.external.shell", false);
 | ||
| about:config	if none, create one.
 | ||
| RegExp.lastIndex:	JavaScript 1.5起,為RegExp物件的property,而非RegExp本身的。	http://developer-test.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:RegExp
 | ||
| moz不能顯示Webdings這種字體,但IE不能顯示◂ ▸	http://www.blueidea.com/bbs/NewsDetail.asp?id=2371729	http://archivist.incutio.com/viewlist/css-discuss/53172	http://www.unicode.org/charts/	http://www.unicode.org/charts/PDF/U25A0.pdf
 | ||
| 
 | ||
| search:	http://www.soojs.com/
 | ||
| 
 | ||
| 
 | ||
| Google approved PageRank stripping
 | ||
| http://www.google.com/url?sa=D&q=URL
 | ||
| http://moinmo.in/RedirectingExternalLinks
 | ||
| http://simonwillison.net/2004/May/11/approved/
 | ||
| 
 | ||
| JScript note:
 | ||
| .replace(str,..)其中str只會replace一次,相當於flags=''
 | ||
| object會以參考傳遞,所以複製object與陣列不能用new Array(oldArray)或(new Array).concat(oldArray),可試試oldArray.join('\0').split('\0')
 | ||
| sort 方法會在原地排序 Array 物件
 | ||
| b.join(',')與''+b效能相同
 | ||
| parseInt()所費時間為Math.floor()之2.5倍
 | ||
| ===與==所費時間相當
 | ||
| Math.round與Math.floor所費時間相當
 | ||
| 0===+0===-0
 | ||
| a%b 與 a-b*Math.floor(a/b)) 相當(包括對小數),但所費時間為1/2
 | ||
| \s相當於[ \f\n\r\t\v]包含\n\r\t,.不包含\n
 | ||
| 每個集合物件在 JScript .NET 裡都是可以自動列舉的。因此,您不需要使用 Enumerator 物件來存取集合物件的成員。您可以使用 for...in 陳述式直接存取任何成員。Enumerator 物件是為了回溯相容性 (Backward Compatibility) 而提供的。
 | ||
| http://msdn.microsoft.com/library/en-us/dnclinic/html/scripting04132004.asp
 | ||
| http://www.microsoft.com/taiwan/technet/scriptcenter/default.mspx
 | ||
| http://www.microsoft.com/technet/scriptcenter/scripts/misc/adsi/msadvb03.mspx?mfr=true
 | ||
| 
 | ||
| Google hosting 幾個常用的 javascript library 讓人使用
 | ||
| http://code.google.com/apis/ajaxlibs/documentation/
 | ||
| 
 | ||
| 檔案大小超過512K(>524288)時不能用<script type="text/javascript" src="function.js"></script>來include!
 | ||
| 
 | ||
| 使用 .split(/\r?\n/) 應注意:這實際上等於 .split(/(\r?\n)+/) (??)
 | ||
| 
 | ||
| 
 | ||
| //execCommand:Executes a command over the given selection or text range
 | ||
| IE only!	Dialog Helper可取得系统支持的字体&调色板&系统中块的格式信息(如:标题1、标题2....)
 | ||
| http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/dialoghelper.asp
 | ||
| document.execCommand("FormatBlock",false,selectFormat);//change format
 | ||
| http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_selection.asp
 | ||
| 
 | ||
| http://developer.mozilla.org/en/docs/Main_Page
 | ||
| http://developer.mozilla.org/en/docs/DOM:Selection
 | ||
| 
 | ||
| HTML Applications (HTAs)
 | ||
| HTA:APPLICATION	http://msdn.microsoft.com/workshop/author/hta/reference/hta_ref_entry.asp
 | ||
| 於.hta使用Windows Media Player:
 | ||
| 	<object id="player" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"></object>
 | ||
| 	document.getElementById('player').FileName=
 | ||
| 
 | ||
| IE only:
 | ||
| <b onMouseOver="this.style.behavior='url(#default#homepage)';if(!(this.isHomePage(location.href)))this.setHomePage(location.href);">set homepage</b>
 | ||
| 
 | ||
| 
 | ||
| http://persistent.info/archives/2005/03/01/gmail-searches
 | ||
| moz可用const,img.src="data:image/gif;base64,.."
 | ||
| 
 | ||
| // Utility functions
 | ||
| function getObjectMethodClosure(object,method){
 | ||
|  return function(){return object[method]();}
 | ||
| }
 | ||
| 
 | ||
| function getObjectMethodClosure1(object,method){
 | ||
|  return function(arg){return object[method](arg);}
 | ||
| }
 | ||
| 
 | ||
| var newNode=getObjectMethodClosure1(document, "createElement");
 | ||
| var newText=getObjectMethodClosure1(document, "createTextNode");
 | ||
| var getNode=getObjectMethodClosure1(document, "getElementById");
 | ||
| var addNode=getObjectMethodClosure1(document, "appendChild");
 | ||
| 
 | ||
| 
 | ||
| 註冊 DLL:
 | ||
| (new ActiveXObject("WScript.Shell")).Run("Regsvr32 ?.dll /c /s");
 | ||
| 
 | ||
| 
 | ||
| -------------------------------------------------------------------------------
 | ||
| **	WScript's StdIn, StdOut, and StdErr are only available when using cscript as the host.
 | ||
| 用 WScript 會出現 "The handle is invalid", err code 80070006. 控制碼無效
 | ||
| 
 | ||
| usage:	chcp 65001	# or: 870	http://www.javaeye.com/topic/120172?page=2
 | ||
| 	"C:\Program Files\WinRAR\Rar.exe" lt a.rar | CScript a.js
 | ||
| 	"C:\Program Files\7-Zip\7z.exe" l a.rar | CScript a.js
 | ||
| 
 | ||
| var fso=WScript.CreateObject("Scripting.FileSystemObject");
 | ||
| var outS=fso.OpenTextFile('s.txt',2,true,-1);
 | ||
| fso = null;
 | ||
| 
 | ||
| var stdin=WScript.StdIn,outT=[];
 | ||
| while(!stdin.AtEndOfStream){
 | ||
|  outT.push(stdin.ReadLine());
 | ||
| }
 | ||
| 
 | ||
| //try{
 | ||
| //outS.Write(WScript.StdIn.ReadAll());
 | ||
| outS.Write(outT.join('\r\n'));
 | ||
| //}catch(e){WScript.Echo(e.number&0xFFFF);}
 | ||
| 
 | ||
| -------------------------------------------------------------------------------
 | ||
| 
 | ||
| 
 | ||
| http://members.cox.net/tglbatch/wsh/
 | ||
| to Eject (open) a CD-ROM: (new ActiveXObject("WMPlayer.OCX")).cdromCollection.Item(\d).Eject
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| http://nanto.asablo.jp/blog/2008/02/14/2626240
 | ||
| JavaScript でカリー化、再び: Days on the Moon
 | ||
| function curry(f) {
 | ||
|   if (f.length == 0) return f;
 | ||
|   function iterate(args) {
 | ||
|     if (args.length >= f.length)
 | ||
|       return f.apply(null, args);
 | ||
|     return function () {
 | ||
|       return iterate(args.concat(Array.prototype.slice.call(arguments)));
 | ||
|     };
 | ||
|   }
 | ||
|   return iterate([]);
 | ||
| }
 | ||
| 
 | ||
| 
 | ||
| JavaScript 2 and the Future of the Web	http://developer.mozilla.org/presentations/xtech2006/javascript/
 | ||
| Block Statements
 | ||
| JS1 idiom:
 | ||
|       (function (a, b) {
 | ||
|         var x = b, y = a
 | ||
|         var z = eval(s)
 | ||
|         commit(x, y, z)
 | ||
|       })(x, y)
 | ||
| 
 | ||
| New syntax:
 | ||
|         let (x = y, y = x, z) {
 | ||
|           z = eval(s)
 | ||
|           commit(x, y, z) 
 | ||
|         }
 | ||
| 
 | ||
| 
 | ||
| Block Expressions
 | ||
| The JS1 idiom could be used as an expression:
 | ||
|         return (function (a, b) {
 | ||
|           var x = b, y = a
 | ||
|           return commit(x, y, eval(s))
 | ||
|         })(x, y)
 | ||
| 
 | ||
| New syntax:
 | ||
|         return let (x = y, y = x, z) commit(x, y, eval(s))
 | ||
| 
 | ||
| The let variables are scoped to the expression 
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| Iterators
 | ||
| 
 | ||
|     * Stand on Python's shoulders
 | ||
|     * let it = Iterator(["meow", "oink", "woof"])
 | ||
|     * it.next() returns [0, "meow"]
 | ||
|     * it.next() returns [1, "oink"]
 | ||
|     * it.next() returns [2, "woof"]
 | ||
|     * it.next() throws StopIteration
 | ||
|     * The for-in loop handles StopIteration:
 | ||
| 
 | ||
|       for (let i in it) print(i)
 | ||
| 
 | ||
| .next() throws StopIteration
 | ||
| .send(value) passes value back to yield
 | ||
| .throw(exception) throws exception from yield
 | ||
| 
 |