人们日常所犯的最大的错误,是对陌生人太客气,而对最亲密的人太苛刻,把这个坏习惯改过来,天下太平。
posted @
2010-10-11 18:00 Klarke 阅读(61) |
评论 (0) |
编辑 收藏
“胜利往往来自于再坚持一下之后”。有时候,好像已经走到了绝境,以为再也没有希望了,但是如果再坚持一下,再坚持一下,往往就看到了胜利的曙光。
posted @
2010-09-28 12:20 Klarke 阅读(134) |
评论 (0) |
编辑 收藏
1.量词:
一个量化元字符是由一个元字符后面紧接着一个简单的量词组成,如果没有量词,就只匹配这个元字符,量词如下:
*
匹配0个或多个元字符的序列
+
匹配1个或多个元字符的序列
?
匹配0个或1个元字符的序列
{m}
严格匹配m个元字符的序列
{m,}
匹配m个或多个元字符的序列
{m,n}
匹配m个到n个元字符的序列
*? +? ?? {m}? {m,}? {m,n}?
非贪婪量词,与贪婪量词匹配的方式相同,但是非贪婪两次只匹配最少能匹配到的序列,而贪婪匹配需要匹配最多能匹配的序列。
使用{和}的形式需要受限,m和n必须是无符号整数,取值在0到255之间。
2.元字符:
元字符是以下几种形式:
(re) 将一个元字符括起来(re是任意正则表达式)。
(?:re) 与上面相同,但是不报告(不捕获括号的配置)
() 匹配一个空字符串
(?:) 与上面相同,但是不报告
[chars] 一个中括号表达式,匹配任何一个chars中的字符。
. 匹配任意一个字符
\k 匹配非字母和数字字符
\c 匹配escape项目中所罗列的字符
{ 当后面不是数字时,匹配"{",当后面跟着数字时,是一个量词范围的开始(只支持AREs)
x 当x是一个字符时就匹配这个字符
约束 在特定的条件下约束匹配一个空字符串,约束的后面不能是量词,简单的约束如下,其它的在ESCAPES之后介绍:
^ 在字符串的开头匹配
$ 在字符串的结尾匹配
(?=re) 向前肯定,匹配任何以re开始的子字符串。
(?!re) 向前否定,匹配任何不以re开始的子字符串。
向前约束可能不包含向后,所有的括号都不捕获。
一个正则表达式不能够以"\"结尾。
posted @
2010-09-26 17:46 Klarke 阅读(137) |
评论 (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 阅读(494) |
评论 (0) |
编辑 收藏
RC:Release Candidate
Candidate是候选人的意思,用在软件上就是候选版本。Release.Candidate.就是发行候选版本。和Beta版最大的差别在于Beta阶段会一直加入新的功能,但是到了RC版本,几乎就不会加入新的功能了,而主要着重于除错!
RTM:Release to Manufacture
是给工厂大量压片的版本,内容跟正式版是一样的,不过RTM.也有出120天评估版。但是说RTM.是测试版是错的。正式在零售商店上架前,是不是需要一段时间来压片,包装、配销呢?所以程序代码必须在正式发行前一段时间就要完成,这个完成的程序代码叫做Final.Code,这次Windows.XP开发完成,外国媒体用WindowsXP.goes.gold来称呼。程序代码开发完成之后,要将母片送到工厂大量压片,这个版本就叫做RTM版。所以说,RTM版的程序码一定和正式版一 样。但是和正式版也有不一样的地方:例如正式版中的OEM不能升级安装,升级版要全新安装的话会检查旧版操作系统光盘等,这些就是RTM和正式版不同的地方,但是它们的主要程序代码都是一样的。
posted @
2010-09-25 10:44 Klarke 阅读(138) |
评论 (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 阅读(152) |
评论 (0) |
编辑 收藏
-
TCL内建命令
字符串操作
- append - 在变量后添加变量
- binary - 从二进制字符串中插入或释放数值
- format - 使用sprintf的风格格式化一个字符串
- re_syntax - Tcl正则表达式语法
- regexp - 对正则表达式匹配器直接存取字符串
- regsub - 基于正则表达式的模式匹配完成替换
- scan - 使用指定的sscanf风格转换解析字符串
- string - 操作字符串
- subst - 完成反斜线、命令和变量替换
-
- concat - 将多个列表合并成一个列表
- join - 把列表元素合并成一个字符串
- lappend - 将元素添加到列表末尾
- lassign - 将列表元素赋值给变量
- lindex - 从列表中获得一个元素
- linsert - 向列表插入一个元素
- list - 创建一个列表
- llength - 计算列表的元素个数
- lrange - 返回列表中的一个或者多个临近的元素
- lrepeat - 使用重复的元素构造一个列表
- lreplace - 在一个列表中使用新的元素替代其它元素
- lreverse - 反转列表元素的顺序
- lsearch - 在列表中寻找特定元素
- lset - 修改列表中的一个元素
- lsort - 给列表中的元素排序
- split - 将字符串分解成Tcl列表
-
-
-
- dict - 操作字典
-
-
- expr - 求一个数学表达式的值
- mathfunc - Tcl数学表达式的数学函数
- mathop - Tcl命令的数学操作符
-
-
- after - 设置将来执行的命令
- break - 中断循环
- catch - 返回异常错误
- continue - 进入下一个循环
- error - 产生一个错误
- eval - 调用一个Tcl脚本
- for - 'For' 循环
- foreach - 反复循环操作一个或多个列表的每个元素
- if - 执行一个条件脚本
- return - 从进程中返回或者返回一个值
- switch - 根据一个特定的值,指定几个脚本中的一个
- update - 处理挂起的时间和空闲回调
- uplevel - 在不同的堆栈层中执行一个脚本
- vwait - 一直等待直到一个变量被修改为止
- while - 重复的执行脚本直到条件不匹配
-
-
- apply - 申请一个匿名函数
- array - 处理数组变量
- global - 存取全局变量
- incr - 增加变量的值
- namespace - 创建和操作命令和变量的上下文
- proc - 创建一个Tcl过程
- rename - 重新命名或者删除一个命令
- set - 读写变量
- trace - 监视变量存取、命令用法和执行
- unset - 删除变量
- upvar - 在不同的堆栈层中创建一个变量的链接
- variable - 创建和初始化一个名字空间变量
-
输入和输出
-
- chan - 读写和操作I/O通道
- close - 关闭一个打开的I/O通道
- eof - 检查文件是否结束
- fblocked - 测试I/O通道是否将数据准备好
- fconfigure - 设置和查询I/O通道的属性
- fcopy - 把一个I/O通道数据复制到另外一个I/O通道
- file - 操作文件名和属性
- fileevent - 在I/O通道准备好处理读写事件时执行一个脚本
- flush - 清空缓存输出I/O通道数据
- gets - 从I/O通道中读取一行
- open - 打开一个文件或命令管道
- puts - 向I/O通道写入数据
- read - 从I/O通道读出数据
- refchan - 反射I/O通道的命令句柄API,版本1
- seek - 设置I/O通道的存取偏移量
- socket - 打开一条TCP网络连接
- tell - 返回I/O通道的当前存取偏移量
-
-
- load - 装载机器代码和初始化新命令
- loadTk - 装载TK到一个安全解释器
- package - 装载包和包的版本控制
- pkg::create - 为给出包描述构造是个适当的'package ifneeded'命令
- pkg_mkIndex - 为自动装载的包创建一个索引
- source - 将一个文件或者资源作为Tcl脚本运行
- tm - 方便的查找和装载Tcl模块
- unload - 卸载机器代码
-
-
- bgerror - 调用命令处理后台错误
- history - 操作历史命令列表
- info - 返回Tcl解释器的状态信息
- interp - 创建并操作Tcl解释器
- memory - 控制Tcl内存调试能力
- unknown - 处理未知命令
-
-
- encoding - 编码处理
- http - 客户端执行的HTTP/1.0协议
- msgcat - Tcl消息目录
- platform. - 系统支持的编码和相关应用程序
- platform.:shell - 系统支持的编码和相关应用程序
-
-
- cd - 改变工作目录
- clock - 获取和操作日期与时间
- exec - 调用子过程
- exit - 退出应用程序
- glob - 返回模式匹配的文件名
- pid - 获得进程ID
- pwd - 返回当前工作目录的绝对路径
- time - 计算一个脚本的执行时间
-
-
- dde - 执行一个动态数据交换命令
- registry - 操作windows注册表
posted @
2010-09-19 10:55 Klarke 阅读(2061) |
评论 (0) |
编辑 收藏
sequential-mode
parallel-mode
autoTrial
user-set option combination FPS: FloorPLanSynthesis
posted @
2010-09-14 11:15 Klarke 阅读(108) |
评论 (0) |
编辑 收藏
SA: Simulated Annealing
MCP: Min-Cut Placement
FDP: Force Directed Placement
posted @
2010-09-14 11:09 Klarke 阅读(150) |
评论 (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 阅读(342) |
评论 (0) |
编辑 收藏