人們?nèi)粘K傅淖畲蟮腻e(cuò)誤,是對陌生人太客氣,而對最親密的人太苛刻,把這個(gè)壞習(xí)慣改過來,天下太平。
posted @
2010-10-11 18:00 Klarke 閱讀(74) |
評論 (0) |
編輯 收藏
“勝利往往來自于再堅(jiān)持一下之后”。有時(shí)候,好像已經(jīng)走到了絕境,以為再也沒有希望了,但是如果再堅(jiān)持一下,再堅(jiān)持一下,往往就看到了勝利的曙光。
posted @
2010-09-28 12:20 Klarke 閱讀(149) |
評論 (0) |
編輯 收藏
1.量詞:
一個(gè)量化元字符是由一個(gè)元字符后面緊接著一個(gè)簡單的量詞組成,如果沒有量詞,就只匹配這個(gè)元字符,量詞如下:
*
匹配0個(gè)或多個(gè)元字符的序列
+
匹配1個(gè)或多個(gè)元字符的序列
?
匹配0個(gè)或1個(gè)元字符的序列
{m}
嚴(yán)格匹配m個(gè)元字符的序列
{m,}
匹配m個(gè)或多個(gè)元字符的序列
{m,n}
匹配m個(gè)到n個(gè)元字符的序列
*? +? ?? {m}? {m,}? {m,n}?
非貪婪量詞,與貪婪量詞匹配的方式相同,但是非貪婪兩次只匹配最少能匹配到的序列,而貪婪匹配需要匹配最多能匹配的序列。
使用{和}的形式需要受限,m和n必須是無符號整數(shù),取值在0到255之間。
2.元字符:
元字符是以下幾種形式:
(re) 將一個(gè)元字符括起來(re是任意正則表達(dá)式)。
(?:re) 與上面相同,但是不報(bào)告(不捕獲括號的配置)
() 匹配一個(gè)空字符串
(?:) 與上面相同,但是不報(bào)告
[chars] 一個(gè)中括號表達(dá)式,匹配任何一個(gè)chars中的字符。
. 匹配任意一個(gè)字符
\k 匹配非字母和數(shù)字字符
\c 匹配escape項(xiàng)目中所羅列的字符
{ 當(dāng)后面不是數(shù)字時(shí),匹配"{",當(dāng)后面跟著數(shù)字時(shí),是一個(gè)量詞范圍的開始(只支持AREs)
x 當(dāng)x是一個(gè)字符時(shí)就匹配這個(gè)字符
約束 在特定的條件下約束匹配一個(gè)空字符串,約束的后面不能是量詞,簡單的約束如下,其它的在ESCAPES之后介紹:
^ 在字符串的開頭匹配
$ 在字符串的結(jié)尾匹配
(?=re) 向前肯定,匹配任何以re開始的子字符串。
(?!re) 向前否定,匹配任何不以re開始的子字符串。
向前約束可能不包含向后,所有的括號都不捕獲。
一個(gè)正則表達(dá)式不能夠以"\"結(jié)尾。
posted @
2010-09-26 17:46 Klarke 閱讀(152) |
評論 (0) |
編輯 收藏
The regexp Command
The regexp command provides direct access to the regular expression matcher. Not only does it tell you whether a string matches a pattern, it can also extract one or more matching substrings. The return value is 1 if some part of the string matches the pattern; it is 0 otherwise. Its syntax is:
regexp ?flags? pattern string ?match sub1 sub2...?
The flags are described in Table 11-6:
Table 11-6. Options to the regexp command
|
-nocase
|
Lowercase characters in pattern can match either lowercase or uppercase letters in string.
|
|
-indices
|
The match variables each contain a pair of numbers that are in indices delimiting the match within string. Otherwise, the matching string itself is copied into the match variables.
|
|
-expanded
|
The pattern uses the expanded syntax discussed on page 154.
|
|
-line
|
The same as specifying both -lineanchor and -linestop.
|
|
-lineanchor
|
Change the behavior of ^ and $ so they are line-oriented as discussed on page 153.
|
|
-linestop
|
Change matching so that . and character classes do not match newlines as discussed on page 153.
|
|
-about
|
Useful for debugging. It returns information about the pattern instead of trying to match it against the input.
|
|
--
|
Signals the end of the options. You must use this if your pattern begins with -.
|
The pattern argument is a regular expression as described earlier. If string matches pattern, then regexp stores the results of the match in the variables provided. These match variables are optional. If present, match is set to the part of the string that matched the pattern. The remaining variables are set to the substrings of string that matched the corresponding subpatterns in pattern. The correspondence is based on the order of left parentheses in the pattern to avoid ambiguities that can arise from nested subpatterns.
Example 11-2 uses regexp to pick the hostname out of the DISPLAY environment variable, which has the form:
hostname:display.screen
Example 11-2 Using regular expressions to parse a string
set env(DISPLAY) sage:0.1
regexp {([^:]*):} $env(DISPLAY) match host
=> 1
set match
=> sage:
set host
=> sage
The pattern involves a complementary set, [^:], to match anything except a colon. It uses repetition, *, to repeat that zero or more times. It groups that part into a subexpression with parentheses. The literal colon ensures that the DISPLAY value matches the format we expect. The part of the string that matches the complete pattern is stored into the match variable. The part that matches the subpattern is stored into host. The whole pattern has been grouped with braces to quote the square brackets. Without braces it would be:
regexp (\[^:\]*): $env(DISPLAY) match host
With advanced regular expressions the nongreedy quantifier *? can replace the complementary set:
regexp (.*?): $env(DISPLAY) match host
This is quite a powerful statement, and it is efficient. If we had only had the string command to work with, we would have needed to resort to the following, which takes roughly twice as long to interpret:
set i [string first : $env(DISPLAY)]
if {$i >= 0} {
set host [string range $env(DISPLAY) 0 [expr $i-1]]
}
A Pattern to Match URLs
Example 11-3 demonstrates a pattern with several subpatterns that extract the different parts of a URL. There are lots of subpatterns, and you can determine which match variable is associated with which subpattern by counting the left parenthesis. The pattern will be discussed in more detail after the example:
Example 11-3 A pattern to match URLs
set url http://www.beedub.com:80/index.html
regexp {([^:]+)://([^:/]+)(:([0-9]+))?(/.*)} $url \
match protocol server x port path
=> 1
set match
=> http://www.beedub.com:80/index.html
set protocol
=> http
set server
=> www.beedub.com
set x
=> :80
set port
=> 80
set path
=> /index.html
Let's look at the pattern one piece at a time. The first part looks for the protocol, which is separated by a colon from the rest of the URL. The first part of the pattern is one or more characters that are not a colon, followed by a colon. This matches the http: part of the URL:
[^:]+:
Using nongreedy +? quantifier, you could also write that as:
.+?:
The next part of the pattern looks for the server name, which comes after two slashes. The server name is followed either by a colon and a port number, or by a slash. The pattern uses a complementary set that specifies one or more characters that are not a colon or a slash. This matches the //www.beedub.com part of the URL:
//[^:/]+
The port number is optional, so a subpattern is delimited with parentheses and followed by a question mark. An additional set of parentheses are added to capture the port number without the leading colon. This matches the :80 part of the URL:
(:([0-9]+))?
The last part of the pattern is everything else, starting with a slash. This matches the /index.html part of the URL:
/.*
|
Use subpatterns to parse strings.
|
To make this pattern really useful, we delimit several subpatterns with parentheses:
([^:]+)://([^:/]+)(:([0-9]+))?(/.*)
These parentheses do not change the way the pattern matches. Only the optional port number really needs the parentheses in this example. However, the regexp command gives us access to the strings that match these subpatterns. In one step regexp can test for a valid URL and divide it into the protocol part, the server, the port, and the trailing path.
The parentheses around the port number include the : before the digits. We've used a dummy variable that gets the : and the port number, and another match variable that just gets the port number. By using noncapturing parentheses in advanced regular expressions, we can eliminate the unused match variable. We can also replace both complementary character sets with a nongreedy .+? match. Example 11-4 shows this variation:
Example 11-4 An advanced regular expression to match URLs
set url http://www.beedub.com:80/book/
regexp {(.+?)://(.+?)(?::([0-9]+))?(/.*)$} $url \
match protocol server port path
=> 1
set match
=> http://www.beedub.com:80/book/
set protocol
=> http
set server
=> www.beedub.com
set port
=> 80
set path
=> /book/
Bugs When Mixing Greedy and Non-Greedy Quantifiers
If you have a regular expression pattern that uses both greedy and non-greedy quantifiers, then you can quickly run into trouble. The problem is that in complex cases there can be ambiguous ways to resolve the quantifiers. Unfortunately, what happens in practice is that Tcl tends to make all the quantifiers either greedy, or all of them non-greedy. Example 11-4 has a $ at the end to force the last greedy term to go to the end of the string. In theory, the greediness of the last subpattern should match all the characters out to the end of the string. In practice, Tcl makes all the quantifiers non-greedy, so the anchor is necessary to force the pattern to match to the end of the string.
Sample Regular Expressions
The table in this section lists regular expressions as you would use them in Tcl commands. Most are quoted with curly braces to turn off the special meaning of square brackets and dollar signs. Other patterns are grouped with double quotes and use backslash quoting because the patterns include backslash sequences like \n and \t. In Tcl 8.0 and earlier, these must be substituted by Tcl before the regexp command is called. In these cases, the equivalent advanced regular expression is also shown.
Table 11-7. Sample regular expressions
|
{^[yY]}
|
Begins with y or Y, as in a Yes answer.
|
|
{^(yes|YES|Yes)$}
|
Exactly "yes", "Yes", or "YES".
|
|
{^[^ \t:\]+:}
|
Begins with colon-delimited field that has no spaces or tabs.
|
|
{^\S+?:}
|
Same as above, using \S for "not space".
|
|
"^\[ \t]*$"
|
A string of all spaces or tabs.
|
|
{(?n)^\s*$}
|
A blank line using newline sensitive mode.
|
|
"(\n|^)\[^\n\]*(\n|$)"
|
A blank line, the hard way.
|
|
{^[A-Za-z]+$}
|
Only letters.
|
|
{^[[:alpha:]]+$}
|
Only letters, the Unicode way.
|
|
{[A-Za-z0-9_]+}
|
Letters, digits, and the underscore.
|
|
{\w+}
|
Letters, digits, and the underscore using \w.
|
|
{[][${}\\]}
|
The set of Tcl special characters: ] [ $ { } \
|
|
"\[^\n\]*\n"
|
Everything up to a newline.
|
|
{.*?\n}
|
Everything up to a newline using nongreedy *?
|
|
{\.}
|
A period.
|
|
{[][$^?+*()|\\]}
|
The set of regular expression special characters:
] [ $ ^ ? + * ( ) | \
|
|
<H1>(.*?)</H1>
|
An H1 HTML tag. The subpattern matches the string between the tags.
|
|
<!--.*?-->
|
HTML comments.
|
|
{[0-9a-hA-H][0-9a-hA-H]}
|
2 hex digits.
|
|
{[[:xdigit:]]{2}}
|
2 hex digits, using advanced regular expressions.
|
|
{\d{1,3}}
|
1 to 3 digits, using advanced regular expressions.
|
posted @
2010-09-26 17:22 Klarke 閱讀(508) |
評論 (0) |
編輯 收藏
RC:Release Candidate
Candidate是候選人的意思,用在軟件上就是候選版本。Release.Candidate.就是發(fā)行候選版本。和Beta版最大的差別在于Beta階段會(huì)一直加入新的功能,但是到了RC版本,幾乎就不會(huì)加入新的功能了,而主要著重于除錯(cuò)!
RTM:Release to Manufacture
是給工廠大量壓片的版本,內(nèi)容跟正式版是一樣的,不過RTM.也有出120天評估版。但是說RTM.是測試版是錯(cuò)的。正式在零售商店上架前,是不是需要一段時(shí)間來壓片,包裝、配銷呢?所以程序代碼必須在正式發(fā)行前一段時(shí)間就要完成,這個(gè)完成的程序代碼叫做Final.Code,這次Windows.XP開發(fā)完成,外國媒體用WindowsXP.goes.gold來稱呼。程序代碼開發(fā)完成之后,要將母片送到工廠大量壓片,這個(gè)版本就叫做RTM版。所以說,RTM版的程序碼一定和正式版一 樣。但是和正式版也有不一樣的地方:例如正式版中的OEM不能升級安裝,升級版要全新安裝的話會(huì)檢查舊版操作系統(tǒng)光盤等,這些就是RTM和正式版不同的地方,但是它們的主要程序代碼都是一樣的。
posted @
2010-09-25 10:44 Klarke 閱讀(156) |
評論 (0) |
編輯 收藏
1.Update your .cshrc to source the p4.cshrc
setenv P4SITE sjc
source /icd/socesrc/bin/p4.cshrc
2.Present yourself
p4 user
3.Login (need to be done on each site)
p4 login -a
4.Check basic commands
p4 info
p4 help
p4 help client
5.Launch the P4 GUI
p4v
feco -11.1 edi11.1
http://quark
posted @
2010-09-20 10:56 Klarke 閱讀(167) |
評論 (0) |
編輯 收藏
-
TCL內(nèi)建命令
字符串操作
- append - 在變量后添加變量
- binary - 從二進(jìn)制字符串中插入或釋放數(shù)值
- format - 使用sprintf的風(fēng)格格式化一個(gè)字符串
- re_syntax - Tcl正則表達(dá)式語法
- regexp - 對正則表達(dá)式匹配器直接存取字符串
- regsub - 基于正則表達(dá)式的模式匹配完成替換
- scan - 使用指定的sscanf風(fēng)格轉(zhuǎn)換解析字符串
- string - 操作字符串
- subst - 完成反斜線、命令和變量替換
-
- concat - 將多個(gè)列表合并成一個(gè)列表
- join - 把列表元素合并成一個(gè)字符串
- lappend - 將元素添加到列表末尾
- lassign - 將列表元素賦值給變量
- lindex - 從列表中獲得一個(gè)元素
- linsert - 向列表插入一個(gè)元素
- list - 創(chuàng)建一個(gè)列表
- llength - 計(jì)算列表的元素個(gè)數(shù)
- lrange - 返回列表中的一個(gè)或者多個(gè)臨近的元素
- lrepeat - 使用重復(fù)的元素構(gòu)造一個(gè)列表
- lreplace - 在一個(gè)列表中使用新的元素替代其它元素
- lreverse - 反轉(zhuǎn)列表元素的順序
- lsearch - 在列表中尋找特定元素
- lset - 修改列表中的一個(gè)元素
- lsort - 給列表中的元素排序
- split - 將字符串分解成Tcl列表
-
-
-
- dict - 操作字典
-
-
- expr - 求一個(gè)數(shù)學(xué)表達(dá)式的值
- mathfunc - Tcl數(shù)學(xué)表達(dá)式的數(shù)學(xué)函數(shù)
- mathop - Tcl命令的數(shù)學(xué)操作符
-
-
- after - 設(shè)置將來執(zhí)行的命令
- break - 中斷循環(huán)
- catch - 返回異常錯(cuò)誤
- continue - 進(jìn)入下一個(gè)循環(huán)
- error - 產(chǎn)生一個(gè)錯(cuò)誤
- eval - 調(diào)用一個(gè)Tcl腳本
- for - 'For' 循環(huán)
- foreach - 反復(fù)循環(huán)操作一個(gè)或多個(gè)列表的每個(gè)元素
- if - 執(zhí)行一個(gè)條件腳本
- return - 從進(jìn)程中返回或者返回一個(gè)值
- switch - 根據(jù)一個(gè)特定的值,指定幾個(gè)腳本中的一個(gè)
- update - 處理掛起的時(shí)間和空閑回調(diào)
- uplevel - 在不同的堆棧層中執(zhí)行一個(gè)腳本
- vwait - 一直等待直到一個(gè)變量被修改為止
- while - 重復(fù)的執(zhí)行腳本直到條件不匹配
-
-
- apply - 申請一個(gè)匿名函數(shù)
- array - 處理數(shù)組變量
- global - 存取全局變量
- incr - 增加變量的值
- namespace - 創(chuàng)建和操作命令和變量的上下文
- proc - 創(chuàng)建一個(gè)Tcl過程
- rename - 重新命名或者刪除一個(gè)命令
- set - 讀寫變量
- trace - 監(jiān)視變量存取、命令用法和執(zhí)行
- unset - 刪除變量
- upvar - 在不同的堆棧層中創(chuàng)建一個(gè)變量的鏈接
- variable - 創(chuàng)建和初始化一個(gè)名字空間變量
-
輸入和輸出
-
- chan - 讀寫和操作I/O通道
- close - 關(guān)閉一個(gè)打開的I/O通道
- eof - 檢查文件是否結(jié)束
- fblocked - 測試I/O通道是否將數(shù)據(jù)準(zhǔn)備好
- fconfigure - 設(shè)置和查詢I/O通道的屬性
- fcopy - 把一個(gè)I/O通道數(shù)據(jù)復(fù)制到另外一個(gè)I/O通道
- file - 操作文件名和屬性
- fileevent - 在I/O通道準(zhǔn)備好處理讀寫事件時(shí)執(zhí)行一個(gè)腳本
- flush - 清空緩存輸出I/O通道數(shù)據(jù)
- gets - 從I/O通道中讀取一行
- open - 打開一個(gè)文件或命令管道
- puts - 向I/O通道寫入數(shù)據(jù)
- read - 從I/O通道讀出數(shù)據(jù)
- refchan - 反射I/O通道的命令句柄API,版本1
- seek - 設(shè)置I/O通道的存取偏移量
- socket - 打開一條TCP網(wǎng)絡(luò)連接
- tell - 返回I/O通道的當(dāng)前存取偏移量
-
-
- load - 裝載機(jī)器代碼和初始化新命令
- loadTk - 裝載TK到一個(gè)安全解釋器
- package - 裝載包和包的版本控制
- pkg::create - 為給出包描述構(gòu)造是個(gè)適當(dāng)?shù)?package ifneeded'命令
- pkg_mkIndex - 為自動(dòng)裝載的包創(chuàng)建一個(gè)索引
- source - 將一個(gè)文件或者資源作為Tcl腳本運(yùn)行
- tm - 方便的查找和裝載Tcl模塊
- unload - 卸載機(jī)器代碼
-
-
- bgerror - 調(diào)用命令處理后臺(tái)錯(cuò)誤
- history - 操作歷史命令列表
- info - 返回Tcl解釋器的狀態(tài)信息
- interp - 創(chuàng)建并操作Tcl解釋器
- memory - 控制Tcl內(nèi)存調(diào)試能力
- unknown - 處理未知命令
-
-
- encoding - 編碼處理
- http - 客戶端執(zhí)行的HTTP/1.0協(xié)議
- msgcat - Tcl消息目錄
- platform. - 系統(tǒng)支持的編碼和相關(guān)應(yīng)用程序
- platform.:shell - 系統(tǒng)支持的編碼和相關(guān)應(yīng)用程序
-
-
- cd - 改變工作目錄
- clock - 獲取和操作日期與時(shí)間
- exec - 調(diào)用子過程
- exit - 退出應(yīng)用程序
- glob - 返回模式匹配的文件名
- pid - 獲得進(jìn)程ID
- pwd - 返回當(dāng)前工作目錄的絕對路徑
- time - 計(jì)算一個(gè)腳本的執(zhí)行時(shí)間
-
-
- dde - 執(zhí)行一個(gè)動(dòng)態(tài)數(shù)據(jù)交換命令
- registry - 操作windows注冊表
posted @
2010-09-19 10:55 Klarke 閱讀(2104) |
評論 (0) |
編輯 收藏
sequential-mode
parallel-mode
autoTrial
user-set option combination FPS: FloorPLanSynthesis
posted @
2010-09-14 11:15 Klarke 閱讀(123) |
評論 (0) |
編輯 收藏
SA: Simulated Annealing
MCP: Min-Cut Placement
FDP: Force Directed Placement
posted @
2010-09-14 11:09 Klarke 閱讀(162) |
評論 (0) |
編輯 收藏
EDI: Encounter Digital Implementation
CTS: Clock Tree Synthesis
WNS: Worst Negative Slack
TNS: Total Negative Slack
ECO: Engineering Change Order
Reassembly:
STA sign-off: Static Timing Analysis
DRC sign-off: Design Rule Checking
DRV sign-off: Design Rule Verification
LVS sign-off: Layout Versus Schematic-Electronic Circut Verification
OCV: Open Circut Voltage
IPO: In Place Optimization
FCPA: Foreign Corrupt Practices Act
NUMA: Non Uniform Memory Access
MIB: Mixed Interface Bloblet
LSF: Load Sharing Facility
Silicon Signoff and Verification (SSV)
Encounter Timing System (ETS)
Encounter Power System (EPS)
Physical Verification System (PVS)
posted @
2010-09-14 11:07 Klarke 閱讀(362) |
評論 (0) |
編輯 收藏