language summary
TRANSCRIPT
- 1. v1.0 Crifan Li Word VBA,Excel VBA,Python,C++,Javascript,C# HTML7zip1HTML8HTMLs 2HTMLs 9PDF3PDF10CHM4CHM11TXT5TXT12RTF6RTF13WEBHELP 7WEBHELP 14HTML http://www.crifan.com/files/doc/docbook/language_summary/release/html/language_ summary.html bug http://www.crifan.com/bbs/categories/language_summary/ 1.02012-08-09crl1. 2. WindowscmdPython 3. C++ 4. Javascript 5. Word VBA 6. Excel VBA 17. Pythonhttp://www.crifan.com/files/doc/docbook/language_summary/release/html/language_summary.html http://www.crifan.com/files/doc/docbook/language_summary/release/htmls/index.html 3 http://www.crifan.com/files/doc/docbook/language_summary/release/pdf/language_summary.pdf 4 http://www.crifan.com/files/doc/docbook/language_summary/release/chm/language_summary.chm 5 http://www.crifan.com/files/doc/docbook/language_summary/release/txt/language_summary.txt 6 http://www.crifan.com/files/doc/docbook/language_summary/release/rtf/language_summary.rtf 7 http://www.crifan.com/files/doc/docbook/language_summary/release/webhelp/index.html 8 http://www.crifan.com/files/doc/docbook/language_summary/release/html/language_summary.html.7z 9 http://www.crifan.com/files/doc/docbook/language_summary/release/htmls/index.html.7z 10 http://www.crifan.com/files/doc/docbook/language_summary/release/pdf/language_summary.pdf.7z 11 http://www.crifan.com/files/doc/docbook/language_summary/release/chm/language_summary.chm.7z 12 http://www.crifan.com/files/doc/docbook/language_summary/release/txt/language_summary.txt.7z 13 http://www.crifan.com/files/doc/docbook/language_summary/release/rtf/language_summary.rtf.7z 14 http://www.crifan.com/files/doc/docbook/language_summary/release/webhelp/language_summary.webhelp.7z 2
2. 8. C# 9. PythoncrifanLib.py 10. C#crifanLib.cs 11.
PythonBeautifulSoup 12. Pythonbook 13. C#book 3. : Crifan Liv1.0
2012-08-09 2012 Crifan, http://crifan.com 15- 2.5 (CC BY-NC
2.5)15http://www.crifan.com/files/doc/docbook/soft_dev_basic/release/html/soft_dev_basic.html#cc_by_nc
4. 1.
..............................................................................................................
1 1.1.
...................................................................................................
1 2.
..............................................................................................................................
2 2.1.
.............................................................................................................
2 2.2. Python
........................................................................................................
2 2.3. Word VBA
................................................................................................................
2 2.3.1. word vbaVBA
...................................................................
2 2.3.2. Word VBA
..............................................................................
2 2.3.3. Word vba
.........................................................................................
3 2.3.4.
........................................................................................
9 2.4. Excel VBA
...............................................................................................................
10 2.4.1. Excel VBA
.......................................................................
10 2.4.2. Excel VBA
..........................................................................
13 2.4.3. Excel VBA
.............................................................................
14 2.4.4.
......................................................................................
15 2.5. Javascript
................................................................................................................
16 2.5.1. javascript
........................................................................................
16 2.6. PHP
........................................................................................................................
19 2.6.1. PHP
................................................................................................
19 2.6.2. crifanPHP
..............................................................................................
19 2.6.2.1.
.........................................................................
20 2.6.2.1.1. :addTailSlash
.................................................... 20 2.6.2.1.2.
:removeFirstSlash ............................................ 20
2.6.2.1.3. :strExistInArr ....................... 20 2.6.2.1.4.
:genValidSuffix ...................... 21 2.6.2.2.
............................................................................
22 2.6.2.2.1. :getFileSuffix
................................................ 22 2.6.2.2.2.
............................. 22 2.7. Linux Shell
..............................................................................................................
22 2.7.1. Linux Shell
......................................................................................
22 2.7.2. Linux Shell
......................................................................................
25 2.8. Windows Batch File
................................................................................................
25 2.8.1. Windows Batch File
..............................................................................
25 2.8.2. Windows Batch File
........................................................................
25 2.8.3. Windows Batch File
........................................................................
25 3.
............................................................................................................................
26 3.1.
...........................................................................................................
26 3.2. C#
.............................................................................................................
26 3.3. C++
........................................................................................................................
26 3.3.1. C++
................................................................................................
26 4.
..................................................................................................................
28 4.1. XML
........................................................................................................................
28 4.1.1. XML
......................................................................................
28 4.2. HTML
.....................................................................................................................
28 4.2.1. HTMl
..............................................................................................
28 4.2.2. HTML
....................................................................................
28
................................................................................................................................
30iv 5. 3.1. protectedpublicprivate
............................................................................
26v 6. 2.1. 2.2. 2.3. 2.4.addTailSlash
......................................................................................................
strExistInArr
.......................................................................................................
genValidSuffix
...................................................................................................
getFileSuffix
......................................................................................................20
21 22 22vi 7. 1 1.1. 1 8. 2 2.1. 2.2. Python PythonPython12.3. Word
VBA 2.3.1. word vbaVBA VBAVisual Basic For Application
VBApplicationApplicationExcelword wordVBWord VBA Excel "Excel"
wordexcel word xml [2]"VBAVBA VBAVBA "2.3.2. Word VBA Word
VBAstory, character,table,cell,row,
columnsection,paragrah,line,SelectionSelection.XXX XXX 1. Story
word
1http://www.crifan.com/files/doc/docbook/python_summary/release/html/python_summary.html2
9. 2. Text 3. Sections wordstory 4. Paragraphs 5. Sentences 6.
Words 7. Characters 8. TablesCellsRowsColumns cellcell Range Print
Selection.Tables(2).Cell(3, 4) Cell(2,3)1 CExcel0 9. End Start
Selection.StartSelection.End Selection.StartSelection.End
slection_len = Selection.End - Selection.Start 10.2.3.3. Word vba
1. range Selection.Text Selection.Range.Text3 10. 2. VBA""C"!=" 3.
wdMovewdExtend Range Selection.MoveDown Unit:=wdLine , Count:=1,
Extend:=wdExtend wdLineUnit UnitwdParagraphwdWindowwdScreen
WdExtendwdMode VBA wdMove wdExtend wdMove mdMove wdExtend 4. /
Selection.GoTo What:=wdGoToHeading , Which:=wdGoToAbsolute ,
Count:=5 Goto wdGoToHeadingheading wdGoToAbsolute wdGoToFirst,
wdGoToRelativewdGoToLast,wdGoToNext,wdGoToPrevious,[3] /
Selection.HomeKey Unit:=wdStory , Extend:=wdMove wdStorywdUnits
wdColumnwdLinewdRow 5. 4 11. 2.1 PAPRBY / RubyVerifoneDefaults 2.1
2.1 Selection.Bookmarks("headinglevel
").Range.ListFormat.ListString headinglevelVBA [5] 6. VBAHelp
Function [Public | Private | Friend] [Static] Function name
[(arglist)] [As type] [statements] [name = expression ] [Exit
Function] [statements] [name = expression] End Function name
expression name 0 ("")Variant Empty Function name Set Nothing
BinarySearch False Function BinarySearch(......) As Boolean ......
' False If lower > upper Then BinarySearch = False Exit Function
5 12. End If ...... End FunctionVBAHelpgoogle [name = expression]
7. VBAoffice 2010 VBAhelp StrCompStrConvFormat, LCase, UCaseSpace,
StringLenFormatLSet, RSetInStr, Left, LTrim, Mid, Right, RTrim,
TrimOption Compare ASCII ANSI Asc, Chr C a.Space, String Space10"
space"Space(10) 10 String(number,characterToRepeate) string
Space(10)=String(10, 32) 32=0x20spaceASCIIString 0x0~0x1F b. InStr,
InStrRev InStrCstrstr InStr([start, ]string1, string2[, compare])6
13. " Variant (Long)" InStrRevInStr"" posOfPoint = InStr("abc.def",
".") "abc.def"".",4 c.Asc, Chr AscASCIIChrASCII MyNumber = Asc("A")
' 65 MyChar = Chr(97) ' ad. VBAlog. i.1 Function createFileTest() '
the name of the file to be output, including full path Dim FileName
As String FileName = "D:create_file.txt" ' open the file ouput text
stream output, overwritng is necessary Dim fs As Object Set fs =
CreateObject("Scripting.FileSystemObject") Dim file As Object Set
file = fs.CreateTextFile(FileName, True) file.WriteLine "test
string..." file.Close End Functionii.2 Public gFileNum As Integer
Function createOutputFile() Dim outputFileNameWithPath As String
Dim gDestFile As String Dim outputFileNameWithPath As String Dim
openFileOK As Boolean openFileOK = True ' 1. create an XML file
outputFileNameWithPath = "D:test_output.txt" gDestFile =
outputFileNameWithPath ' Obtain next free file handle number.
gFileNum = FreeFile() ' Turn error checking off. On Error Resume
Next ' Attempt to open destination file for output. 7 14. Open
gDestFile For Output As #gFileNum ' If an error occurs report it
and end. If Err 0 Then openFileOK = False MsgBox "Cannot create
file: " & gDestFile End If ' Turn error checking on. On Error
GoTo 0 createOutputFile = openFileOK End Function Sub
createFileTest() Print #gFileNum, "Test output string to this
file..." Print #gFileNum, "Test done." Close #gFileNum End Sub e.
i.ActiveDocument.Path ""ii.ActiveDocument.Nameiii.
ActiveDocument.FullName f.VB office 2010help Visual Basic Visual
Basic for Applications Calendar CallType Color Compiler Date
DirGetAttr SetAttr IMEStatus InstrStrComp Keycode Miscellaneous
MsgBox QueryClose QueryClose Shell 8 15. StrConv VarType Visual
Basic Miscellaneous Visual Basic for Applications vbCrLfChr(13)
Chr(10)+ vbCrChr(13)vbLfChr(10)vbNewLineChr(13) + Chr(10) or, on
the Macintosh, Chr(13)vbNullCharChr(0) 0 vbNullString 0 ("")
vbObjectError-2147221504 Err.Raise Number = vbObjectError +
1000vbTabChr(9)Tab vbBackChr(8)vbFormFeedChr(12) Microsoft Windows
or on the Macintosh vbVerticalTabChr(11) Microsoft or on the
Macintosh Windows 2.3.4. 1. VBAHelp wordVBAvba //F1 VBAFunction
Help Function funcName() 'XXXXXX9 16. End Function
FunctionF1HelpFunction 2. office 2010VBAhelp variant 3.
http://office.microsoft.com/zh-cn/access-help/CH010072891.aspx?CTT=972.4.
Excel VBA VBAword VBA 2.3 Word VBA2.4.1. Excel VBA ExcelExcel Excel
Excelsheet sheet ExcelWorkbook Worksheet Column, Row Cell Excel VBA
WorkbooksExcel10 17. 1. Workbook workbookworkbooksworkbooksworkbook
workbook Workbooks.Item(N) Workbooks(N)
Workbooks("excel_file_name.xlsx") Workbook Workbook.Open
Workbook.Add Workbook.Save Workbook.SaveAs 2. Worksheet
worksheetExcelsheet worksheetworksheets ExcelExcel3sheetworkbook
worksheets3worksheet worksheet Workbooks.Item(1).Sheets.Item(N)
Workbooks.Item(1).Sheets.Item("sheet_name") 3. Column "C"
Columns(3) Columns("C") 35 Columns("C:E") Range("C:E") 1, 578911
18. Range("A:A, E:E, G:G, H:H,I:I").Select Columns("C").ColumnWidth
= 4.5 Selection.Columns.AutoFit Columns("C").hidden=True 4. Row 26
Rows("2:6").Select Rows(1).Select 578 Range("5:5, 7:7,8:8").Select
Rows(6).RowHeight = 2.5 6 Rows("6:6").Select
Selection.EntireRow.Hidden = TrueRowColumn ,"C" "Name Box" "Col3"
Columns("C") Columns("Col3") Columns("XXX")XXX 5. Cell12 19. cell
Range("D6") Range("B3).Font.Name = "Cambria" Range("B3).Font.Bold =
True D2H6 Range("B2:H6") Range("D4:D4")
Range("B2:C5,EC4:G8").Select Range("B2:C5, C4:G8").Select
ActiveWindow.DisplayGridlines = False2.4.2. Excel VBA 1. VBA"'"
REMRem REM this is a excel maro ' this is a excel maro 2. a.Msgbox
Msgbox :13 20. MsgBox "Currently opening Excel file is: " &
ActiveWorkbook.Name /& b. log loglog VBAlog 3. Excel Word
VBAActiveDocumentExcelActiveWorkbook Excel ActiveWorkbook.Path
ActiveWorkbook.FullName = ActiveWorkbook.Path + '' +
ActiveWorkbook.Name MsgBox ActiveWorkbook.Name MsgBox
ActiveWorkbook.FullName MsgBox ActiveWorkbook.FullNameURLEncoded
MsgBox ActiveWorkbook.Path 4. workbooksheet.Select
Sheets("sheet_name").Select .Name Sheets("sheet_name").Name move
workbooksheetAdd2.4.3. Excel VBA 1. VBA for Microsoft Office Excel
2007 Excel VBA 2 VBA for Microsoft Office Excel 2007 2. Excel 2007
VBA Excel VBA 2http://www.functionx.com/vbaexcel/14 21. Excel 2007
VBA [PDF]3 ed2k://
|file|%5BExcel.2007.VBA%E5%8F%82%E8%80%83%E5%A4%A7%E5%85%A8%5D.%EF%BC
%88%E7%BE%8E%EF%BC%89%E6%A0%BC%E6%9E%97.%E6%89%AB%E6%8F%8F
%E7%89%88.pdf|253406092|3cf57fc49d0fa875826ecc462cd9976c|
h=eed6g2e25uuzc4c52obch2txlm7w65fx|/2.4.4. 2.3 Word VBA VBA VBA 1.
VBAObject Browser VBA workbookworkbookObject Browser,Object Browser
2. Help F1VBAHelp workbookExcelworkbook F1Helpworkbook 4Workbook
Object Members Article Represents a Microsoft Excel workbook.
Methods Name Description AcceptAllChanges Accepts all changes in
the specified shared workbook. Activate Activates the fi...
"Workbook MethodsPropertiesEventsObjectMembers" Excel.Name.FullName
Msgbox MsgBox ActiveWorkbook.Name MsgBox ActiveWorkbook.FullName 3.
http://www.verycd.com/topics/2872866/ 3
4http://office.microsoft.com/client/helppreview.aspx?AssetId=HV805547869990&lcid=1033&NS=EXCEL
%2EDEV&Version=12&respos=0&CTT=1&queryid=cc5dd30b%2D82da%2D4044%2Db28e%2D3ee83e8fcfe815
22. VBAVBA VBA ExcelExcel ExcelCtrl+VCtrl+S Sub Macro3() Macro3
Macro ' Range("B3).Select Selection.Copy
Windows("EWR_tracking_list_enabledMacro.xlsm").Activate
Range("O152).Select ActiveSheet.Paste Application.CutCopyMode =
False ActiveWorkbook.Save Windows("ROSH1.xlsx").Activate End Sub
ExcelViewMacroRecord Macro ViewMacroStop Macro ViewMacroView
MacroVBA VBA baidugoogle Object BrowserF1 Help 2.5. Javascript
2.5.1. javascript 1.
http://hi.baidu.com/recommend_music/blog/item/5fe2e923cee1f55e93580718.html
htmlscripttype http://blog.csdn.net/slalx/article/details/5093756
1.content"text/tcl", "text/javascript", "text/vbscript".
JavaScriptJavaScript html 17 24. javascript 2. format
http://witmax.cn/js-function-string-format.html return "{2}
a>".format(portraitId, cmturl, cmtname);{0},{1}.{2}format 3.
propertykeyvalue a.property
http://blog.csdn.net/sd2131512/article/details/6328300 for(var name
in someObject){ document.write(name + "=" + someObject[name]) }
someObjectfor"[]" b. keyvalue
http://www.w3schools.com/JS/js_loop_for_in.asp IE9 var arrayData =
{ a : "11", b : "22", c : "33", d : "44" } for (__key in arrayData)
{ document.write( __key + "=" + arrayData[__key]) }18 25.
arrayData"[]" 4. javascript WordPress Google XML Sitemap 5 HTML
htmlphp jsTODO js htmlphpjavascript 5. javascript WordPress Google
XML Sitemap 6 HTML javascriptsitemap.js HTML js jsHTMljs 2.6. PHP
2.6.1. PHP 1. 2.2.6.2. crifanPHP phpcrifanLib.php 5
6http://www.crifan.com/record_add_support_include_html_static_page_into_google_xml_sitemap/
http://www.crifan.com/record_add_support_include_html_static_page_into_google_xml_sitemap/19
26. 2.6.2.1. 2.6.2.1.1. :addTailSlash //add the tail slash if not
exist //eg: from files/doc/docbook to files/doc/docbook/ function
addTailSlash($str) { if(substr($str, -1) != "/") { $str = $str."/";
} return $str; } 2.1. addTailSlash //add tail slash $homePath =
$this->addTailSlash($homePath); //echo
"homePath=".$homePath."
";2.6.2.1.2. :removeFirstSlash //remove the first slash if exist
//eg: from /files/doc/docbook to files/doc/docbook function
removeFirstSlash($str) { if(substr($str, 0, 1) == "/") { $str =
substr($str, 1); } return $str; }2.6.2.1.3. :strExistInArr //eg:
check txt is in array("txt", "html", "pdf") function
strExistInArr($str, $arr) { if($arr[0] == "*") { $found = True; }
else { $found = False; $arrLen = count($arr); for($i=0;
$istrExistInArr($fileSuf, $validSuf);2.6.2.1.4.
:genValidSuffix//eg: from "*.html;*.txt;" to array("html", "txt")
function genValidSuffix($fileType) { $validSuf = array();
$splitedArr = explode(";", $fileType); $arrSize =
count($splitedArr); //echo "splited arrary size=".$arrSize."
"; for($i=0; $igenValidSuffix($fileType);2.6.2.2. 2.6.2.2.1.
:getFileSuffix //eg: from abc.txt got txt function
getFileSuffix($fileName) { $gotInfo = pathinfo($fileName); //
dirname, basename, extension $suffix =
strtolower($gotInfo["extension"]); return $suffix; } 2.4.
getFileSuffix $fileSuf =
$this->getFileSuffix($filename);2.6.2.2.2. $dirHandler =
opendir($fullPath); while(($filename = readdir($dirHandler)) !==
false) { if(($filename == ".") || ($filename == "..") ) { //echo
"omit filename=$filename"; continue; } echo "filename=".
$filename"; } closedir($dirHandler);2.7. Linux Shell 2.7.1. Linux
Shell 1. Linux shell 22 29. local Linux Shell 7 2. ./xxx.sh: line
xx: [: too many arguments if [ -d $item_full_path ]; then
item_full_path arm_vs_mips.xml - Copy_bak too many argumentsshell-d
arm_vs_mips.xml - Copy_bak arm_vs_mips.xml Copy_bak 3. shell 8Linux
shell trls CLi@PC-CLI-1 ~/develop/docbook/books/arm_vs_mips/src $
ls arm_vs_mips.xml arm_vs_mips_____xml - Copy_bak glossary.xml
Makefile remove_bak.sh arm_vs_mips.xml.bak
ch01_reduced_instruction_set.xml images reference.xml
remove_bak.sh.bak CLi@PC-CLI-1
~/develop/docbook/books/arm_vs_mips/src $ ls | tr " " "?"
arm_vs_mips.xml arm_vs_mips.xml.bak arm_vs_mips_____xml?-?Copy_bak
ch01_reduced_instruction_set.xml7
8http://www.crifan.com/linux_shell_recursive_function_variable_be_changed/
http://hi.baidu.com.cn/pojoflcc/blog/item/97123b1f6a89b5094034176f.html23
30. glossary.xml images Makefile reference.xml remove_bak.sh
remove_bak.sh.bakcygwintrshell -> cygwin ls | tr " " "?" shell
local sub_folders=`ls $input_folder | tr "32" "?"`; echo '444
sub_folders='$sub_folders; tr Cygwintr CLi@PC-CLI-1
~/develop/docbook/books/arm_vs_mips/src $ tr --version tr (GNU
coreutils) 8.15 Packaged by Cygwin (8.15-1) Copyright (C) 2012 Free
Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or
later . This is free software: you are free to change and
redistribute it. There is NO WARRANTY, to the extent permitted by
law. Written by Jim Meyering. local sub_folders=`ls $input_folder |
tr "32" ""`; each_item=`echo $each_item | tr "" " "`;24 31. for
each_item in $sub_folders; do item arm_vs_mips.xml - Copy_bak
arm_vs_mips.xml Copy_bak arm_vs_mips.xml - Copy_bak Cygwin echo
bug2.7.2. Linux Shell 1. Linux Shell Scripting Tutorial - A
Beginner's handbook9Linux Shell"",^_^ test command or [ expr
]102.8. Windows Batch File 2.8.1. Windows Batch File 2.8.2. Windows
Batch File 2.8.3. Windows Batch File
1.9http://www.freeos.com/guides/lsst/index.html
http://www.freeos.com/guides/lsst/ch03sec02.html1025 32. 3 3.1.
3.2. C# 1C#C#3.3. C++ 3.3.1. C++ C++ CC++C++C 1.
protectedpublicprivate 3.1. protectedpublicprivate Private
Protected Public 2. 3. C 4. new newdelete stack
1http://www.crifan.com/files/doc/docbook/csharp_summary/release/html/csharp_summary.html26
33. C newheap delete new delete 5. Overload 6. inherit Bfunc1B
BAApublicfunc1Bfunc127 34. 4 HTMLXML4.1. XML XML4.1.1. XML 1. XML
XML XML : 1 1b. XML : 4 2a.4.2. HTML HTML4.2.1. HTMl 1. HTMLHTML
WordPress Google XML Sitemap 3 HTML phpjavascriptHTML
HTMLjavascriptHTML HTMLHTML . 2.4.2.2. HTML 1. HTML 1 2
3http://www.ibm.com/developerworks/cn/xml/x-stand1/index.html
http://www.ibm.com/developerworks/cn/xml/x-stand4/
http://www.crifan.com/record_add_support_include_html_static_page_into_google_xml_sitemap/28
35. HTML4 HTML Special Characters5 2. HTML HTML Color Chart with
140 Color Names6HTML HTML Color Names7 3. Unicode Unicode
Table8Unicode Unicode Lookup9UnicodeHTMLentity 4. BIG5 a.BIG5 10
Big5 (Traditional Chinese) character code table Big 5 Code Table11
b. 12 4http://www.qianduan.net/html-special-characters-daquan.html
http://brucejohnson.ca/SpecialCharacters.html 6
http://www.html-color-names.com/color-chart.php 7
http://www.w3schools.com/html/html_colornames.asp 8
http://www.tamasoft.co.jp/en/general-info/unicode.html 9
http://unicodelookup.com/ 10 http://ash.jp/code/cn/big5tbl.htm 11
http://www.khngai.com/chinese/charmap/tblbig.php 12
http://www.j4.com.tw/big-gb/ 529 36. Word VBA 1[1] word vba[2]
VBA2[3] Word VBA Microsoft Word Visual Basic 3[4] Word VBAHelp [5]
word VBA,//heading level/heading number4 5[6] BlogsToWordPress
1http://www.crifan.com/order_word_vba_learning_records/
http://club.excelhome.net/thread-470603-1-1.html 3
http://d.download.csdn.net/down/1924671/taozx11 2
4http://www.crifan.com/
resolved_word_vba_the_title_to_get_the_current_selection_number__title_number__heading_level__heading_number/
5
http://www.crifan.com/crifan_released_all/website/python/blogstowordpress/usage_example/30