Monday, November 15, 2010

short summary of package

Packages are explicitly named scopes appearing at the outermost level of the source text (at the same level as top-level modules and primitives). Types, variables, tasks, functions, sequences, and properties may be declared within a package.
Packages must not contain any processes. Therefore, wire declarations with implicit continuous assignments are not allowed.

Items within packages are generally type definitions, tasks, and functions. Items within packages cannot have hierarchical references. It is also possible to populate packages with parameters, variables, and nets.

One way to use declarations made in a package is to reference them using the class scope resolution operator ::.
ComplexPkg::Complex cout = ComplexPkg::mul(a, b);

Explicit import allows control over precisely which symbols are imported:
import ComplexPkg::Complex;


An alternate method for utilizing package declarations is via the import statement.

Thursday, November 11, 2010

ansi color (with python)

#! /magnum/oss/bin/python
def printC(bg,fg):
print "\033[05;"+bg+";"+fg+"mABC"+"\033[0m"
mystr=""
attrib=[0,1,4,5,7,8]
for i in attrib:
mystr+="\033[%dm%d\033[0m " % (i,i)
print mystr
mystr="\n\n"
for i in range (40,48):
mystr="%d:" % i
for j in range (30,38):
fg=str(j)
mystr= mystr + (" \033[1;%d;%dm%d\033[0m" % (i,j,j))
print mystr

#EOF

%color.py
0 1 4 5 7 8
40: 30 31 32 33 34 35 36 37
41: 30 31 32 33 34 35 36 37
42: 30 31 32 33 34 35 36 37
43: 30 31 32 33 34 35 36 37
44: 30 31 32 33 34 35 36 37
45: 30 31 32 33 34 35 36 37
46: 30 31 32 33 34 35 36 37
47: 30 31 32 33 34 35 36 37

Thursday, November 4, 2010

how to change color of "ls" command

use "man dir_colors" for detailed help.
copy "/etc/DIR_COLORS" to "~/.dir_colors" to create user-defined color file.

to ease visibility of folder color with blackground, change default setting
 on line 59:
"DIR 01;34     # directory"  #i.e. darkblue
to
"DIR 04;36     # directory"  #i.e. darkcyan, underline

This is enough.

Tuesday, November 2, 2010

IQ 调制

I:in phase同相分量
Q:quadrature phase正交分量
IQ调制是通信调制的基础概念,实际是属于相干调制的范畴。
IQ调制通过将数据分路,分别进行相干的载波调制(注意,这里不完全是正交,正交适应于BPSK、QPSK中,8PSK等八相以上调制不适合这种提法)。正交调幅信号QAM有两个相同频率的载波,但是相互正交(相位相差90度,四分之一周期)。一个信号叫I信号,另一个信号叫Q信号。最后通过合路,将调制信息置于载波中的幅度、相位或者频率。
从传输线角度来看,I/Q信号是一种双线传输模式,能量主要集中在两线之间。与外界关系不大。以此可以抗击共模干扰。当然,双线间回路面积要小些。

IQ信号和抗干扰没关系
现代通信系统为了使频谱利用率更高,所以用了许多种矢量调制,如BPSK、QPSK、QAM等等。
而对于数字信号而言是不会区分一个信号是不是矢量的,所以就用了IQ调制这种方式,使数字和模拟之间塔起了矢量的桥梁。
I/Q调制最基本的好处就是单边带输出。

Sunday, October 31, 2010

重点关注的犬类

摘自百度百科
1. 德国牧羊犬
(German Shepherd Dog)又称德国狼犬,是狗的一个品种,原产德国,具体的血统来源不明。唯一能够确认的就是,于1880年此犬已经在德国各地固定下来,并做为牧羊犬使用。他们敏捷且适合动作式的工作环境,它们经常被部署各种任务。后于第一次世界大战期间被德军募集,做为军犬随军。由德军取长补短培育后,基本定型。因为体型高大,外观威猛,并且具备极强的工作能力,因此在全世界范围以警犬、搜救犬、导盲犬、牧羊犬、观赏犬以及家养宠物犬等身份活跃。

德国牧羊犬,分为短毛弓背犬和长毛平背犬两种。这两种犬在性格和智商上没有差异,但在体型与毛质上有所差异。通常来讲,母犬繁殖的长毛直背类会被饲养者淘汰。

一条好的德国牧羊犬给人的印象是:结实、敏捷、肌肉发达、警惕、且充满活力。非常平稳,前后躯非常和谐。体长略大于身高,身躯很深,身体轮廓的平滑曲线要胜于角度。身躯坚固而非细长,不论在休息时还是在运动中,给人的印象都是肌肉发达、敏捷,既不显得笨拙,也不显得软弱。理想的德国牧羊犬给人的印象是素质良好,具有无法形容的高贵感,但一眼就能分辨出来,不会弄错。性别特征非常明显,根据其性别不同,或显得雄壮、或显得柔美。

2. 拉布拉多犬
拉布拉多猎犬(简称拉布拉多,有时称拉不拉多)是一种中大型犬类,天生个性温和、活泼、没有攻击性和智能高,是适合被选作导盲犬或其他工作犬的狗品种,跟黄金猎犬、哈士奇并列三大无攻击性犬类之一。在美国犬业俱乐部中拉布拉多是目前登记数量最多的品种。

拉布拉多猎犬是一种结构坚固、中等体型、接合较短的狗,他健康、稳定性良好的结构使他能够成为寻回猎物的枪猎犬;他的体质和坚固的结构使他能在艰苦的条件下,长时间从事猎取水鸟或在丘陵地带狩猎这样的工作;特征和品质是他在比赛中获胜的关键;他的气质也适合成为一个家庭伴侣。拉布拉多猎犬性情温和、聪明听话、容易训练、活泼好动、忠实主人、服从指挥,是最受欢迎和最值得信赖的家庭犬。但因该犬需要大运动量才能保证其正常成长,所以无法满足其每日跑动锻炼的家庭不要饲养。
拉布拉多猎犬独特的特征是他们短、浓厚且能抵御恶劣气候条件的被毛;一个“水獭”尾巴;线条清晰的头部,后脑宽阔,止部适中;有力的颌部;及“锐利”而友善的眼神,特征明显,聪明而气质良好。寻物猎犬,最受欢迎的是拉布拉多猎犬。被广泛的使用为警卫犬及导盲犬,同时也是优秀的水陆两用猎枪犬。此外,还是个值得信赖的家庭犬。首先是整体条件,一个拉布拉多猎犬应该非常协调,无需努力或只需要稍微努力一下,就可以很好的周旋于比赛场或在野外工作。并具有导盲的作用,典型的拉布拉多猎犬拥有文雅的品质,但不过分精致,体质良好,但不粗笨或土气。拉布拉多猎犬最早是作为工作用途的枪猎犬培养的,所以结构和稳固至关重要。
    最少口水的狗狗排行榜排名第八;最易训练的狗狗排行榜排名第七;对小孩最友善的狗狗排行榜排名第二; 最擅长游泳的狗狗。
综上,最适合初养的狗狗排行榜排名第一。


3. 金毛犬
金毛犬,是一个均称、有力、活泼的犬种,稳固、身体各部位配合合理,腿既不太长也不笨拙,表情友善,个性热情、机警、自信。因其是一种猎犬,在困苦的工作环境中才能表现出他的本质特点。他的总体外貌、平衡、步态和该犬种的用途应得到比身体任何一个单独部分更多的重视。缺陷:任何与该犬种的理想描述相背离均可视为缺陷,缺陷的严重程度根据其与该犬种的用途相矛盾或与该犬种的特质相悖的程度决定。

金毛猎犬体格健壮,工作热心,用来捕捉水鸟,任何气候下都能在水中游泳。深受猎手的喜爱,现在有的被作为家犬饲养,为中型犬。

最爱运动的狗狗排行榜排名第八;最耐寒的狗狗排行榜排名第四;最易训练的狗狗排行榜排名第四;最适合初养的狗狗排行榜排名第二;对小孩最友善的狗狗排行榜名列第一;对生人最友善的狗狗排行榜名列第二;对动物最友善的狗狗排行榜排名第二。金毛犬给人的感觉总的来说就是性情沉稳,安静,机智,自信、活泼、友善、可靠、可信赖。但在自然境况下,对其他犬或人表现出喜争斗或敌意;无来由的胆怯、神经紧张,是与金毛的特质相悖的。
金毛小的时候是魔鬼,一般犬只在成年之后就会显露出稳重的性格,这也就是所谓的金毛成年之后变“天使”。

附A:犬类智商排名一览表
(截止2007年底)
1、边境牧羊犬
2、贵宾犬
3、德国牧羊犬
4、金毛猎犬
5、杜宾犬
6、喜乐蒂(谢德兰牧羊犬)
7、拉布拉多猎犬
8、蝴蝶犬
9、罗威纳
10、澳洲牧牛犬

Sunday, October 24, 2010

opera against firefox: my choice

  description opera firefox
image exif okay plugin

zoom okay limited (no click-to-restore)
font
limited okay
media
limited okay
compatibility
limited (sometimes serious) okay
mouse gesture generic okay okay

right-scroll okay limited
closed window ctrl-z okay limited (menu only)
stability
okay limited
speed
okay limited
resume from collapse
okay limited
bookmark
okay plugin
google simple search okay limited (cookie lost)

google docs limited better
proxy
okay better, but need plugin

Monday, September 20, 2010

Blackberry Torch 4 拆解

Sunday, September 19, 2010

7 Must-Have Technologies

Excerptions of Tommy Peterson's article


1. Managed Antispam/Antivirus
Example: Trend Micro. eTrustsoftware;

2. Smartphones
使用智能手机收发email,和接入互联网:远程管理,系统监控: Blackberry。

3. Remote Access Software
远程办公。(SonicWallVPN & CitrixSecure)
进一步考虑用移动设备进行接入 (CitrixXenApp; NetMotion; VNC)

4. Imaging Software
使用镜像软件创建系统快照,可以立即在多处pc/workstation部署。(Norton Ghost, VMWare, Win PE; Acronis)

5. Server Backup
主服务器->磁带->异地存储器
Veritas Backup Exec; Quantum Autoloader; Backup Exec; Barracuda's Yosemite; IBM’s Tivoli Storage Manager)

6. Storage: NAS and SAN
(4TB Netgear ReadyNAS; EMCSAN)

7. UPS Devices
(APC; Tripp Lite UPS)

Saturday, September 18, 2010

二项分布与泊松分布 (binomial distribution and poisson distribution)

二项分布和Poisson分布均是常见的离散型分布,在分类资料的统计推断中有非常广泛的应用。

一、二项分布的概念及应用条件
1. 二项分布的概念:

如某实验中小白鼠染毒后死亡概率P为0.8,则生存概率为=1-P=0.2,故

对一只小白鼠进行实验的结果为:死(概率为P)或生(概率为1-P)

对二只小白鼠(甲乙)进行实验的结果为:甲乙均死(概率为P2)、甲死乙生[概率为P(1-P)]、乙死甲生[概率为(1-P)P]或甲乙均生[概率为(1-P)2],概率相加得P2+P(1-P)+(1-P)P+(1-P)2=[P+(1-P)]2

依此类推,对n只小白鼠进行实验,所有可能结果的概率相加得Pn+cn1P(1-P)n-1+...+cnxPx(1-P)n-x+...+(1-P)x=[P+(1-P)]n 其中n为样本含量,即事件发生总数,x为某事件出现次数,cnxPx(1-P)n-x为二项式通式,cnx=n!/x!(n-x)!, P为总体率。

因此,二项分布是说明结果只有两种情况的n次实验中发生某种结果为x次的概率分布。其概率密度为:

P(x)=cnxPx(1-P)n-x, x=0,1,...n。

2. 二项分布的应用条件:

医学领域有许多二分类记数资料都符合二项分布(传染病和遗传病除外),但应用时仍应注意考察是否满足以下应用条件:(1) 每次实验只有两类对立的结果;(2) n次事件相互独立;(3) 每次实验某类结果的发生的概率是一个常数。

3. 二项分布的累计概率

二项分布下最多发生k例阳性的概率为发生0例阳性、1例阳性、...、直至k例阳性的概率之和。至少发生k例阳性的概率为发生k例阳性、k+1例阳性、...、直至n例阳性的概率之和。

4. 二项分布的图形

二项分布的图形有如下特征:(1)二项分布图形的形状取决于P 和n 的大小;(2) 当P=0.5时,无论n的大小,均为对称分布;(3) 当P<>0.5 ,n较小时为偏态分布,n较大时逼近正态分布。

5. 二项分布的均数和标准差

二项分布的均数µ=np,当用率表示时µ=p

二项分布的标准差为np(1-p)的算术平方根,当用率表示时为p(1-p)的算术平方根。

二、二项分布的应用
二项分布主要用于符合二项分布分类资料的率的区间估计和假设检验。当P=0.5或n较大,nP及n(1-P)均大于等于5时,可用(p-u0.05sp,p+u0.05sp)对总体率进行95%的区间估计。当总体率P接近0.5,阳性数x较小时,可直接计算二项分布的累计概率进行单侧的假设检验。当P=0.5或n较大,nP及n(1-P)均大于等于5时,可用正态近似法进行样本率与总体率,两个样本率比较的u检验。

三、Poisson分布的概念及应用条件
1. Poisson分布的概念:

Poisson分布是二项分布n很大而P很小时的特殊形式,是两分类资料在n次实验中发生x次某种结果的概率分布。其概率密度函数为:P(x)=e-µ*µx/x! x=0,1,2...n,其中e为自然对数的底,µ为总体均数,x为事件发生的阳性数。

2. Poisson分布的应用条件:

医学领域中有很多稀有疾病(如肿瘤,交通事故等)资料都符合Poisson分布,但应用中仍应注意要满足以下条件:(1) 两类结果要相互对立;(2) n次试验相互独立;(3) n应很大, P应很小。

3. Poisson分布的概率

Poisson分布的概率利用以下递推公式很容易求得:

P(0)=e-µ

P(x+1)=P(x)*µ/x+1, x=0,1,2,...

4. Poisson分布的性质:

(1) Poisson分布均数与方差相等;

(2) Poisson分布均数µ较小时呈偏态,µ>=20时近似正态;

(3) n很大, P很小,nP=µ为常数时二项分布趋近于Poisson分布;

(4) n个独立的Poisson分布相加仍符合Poisson分布

四、Poisson分布的应用
Poisson分布也主要用于符合Poisson分布分类资料率的区间估计和假设检验。当µ>=20时,根据正态近似的原理,可用(x-u0.05*x的算术平方根,x+u0.05*x的算术平方根)对总体均数进行95%的区间估计。同样,也可通过直接计算Poisson分布的累计概率进行单侧的假设检验,在符合正态近似条件时,也可用u检验进行样本率与总体率,两个样本率比较的假设检验

Thursday, September 16, 2010

Format of a Transport Stream Packet

Each MPEG-2 TS packet carries 184 B of payload data prefixed by a 4 B (32 bit) header.


The header has the following fields:
The header starts with a well-known Synchronisation Byte (8 bits). This has the bit pattern 0x47 (0100 0111).
  1. A set of three flag bits are used to indicate how the payload should be processed.
    • The first flag indicates a transport error.
    • The second flag indicates the start of a payload (payload_unit_start_indicator)
    • The third flag indicates transport priority bit.
  2. The flags are followed by a 13 bit Packet Identifier (PID). This is used to uniquely identify the stream to which the packet belongs (e.g. PES packets corresponding to an ES) generated by the multiplexer. The PID allows the receiver to differentiate the stream to which each received packet belongs. Some PID values are predefined and are used to indicate various streams of control information. A packet with an unknown PID, or one with a PID which is not required by the receiver, is silently discarded. The particular PID value of 0x1FFF is reserved to indicate that the packet is a null packet (and is to be ignored by the receiver).
  3. two scrambling control bits, used by conditional access procedures to encrypted the payload of some TS packets.
  4. Two adaption field control bits, which may take four values:
    • 01 – no adaptation field, payload only
    • 10 – adaptation field only, no payload
    • 11 – adaptation field followed by payload
    • 00 - RESERVED for future use Finally there is a half byte Continuity Counter (4 bits)

Two options are possible for inserting PES data into the TS packet payload:
  1. The simplest option, from both the encoder and receiver viewpoints, is to send only one PES (or a part of single PES) in a TS packet. This allows the TS packet header to indicate the start of the PES, but since a PES packet may have an arbitrary length, also requires the remainder of the TS packet to be padded, ensuring correct alignment of the next PES to the start of a TS packet. In MPEG-2 the padding value is the hexadecimal byte 0xFF.
  2. In general a given PES packet spans several TS packets so that the majority of TS packets contain continuation data in their payloads. When a PES packet is starting, however, the payload_unit_start_indicator bit is set to ‘1’ which means the first byte of the TS payload contains the first byte of the PES packet header. Only one PES packet can start in any single TS packet. The TS header also contains the PID so that the receiver can accept or reject PES packets at a high level without burdening the receiver with too much processing. This has an impact on short PES packets

video transmission (mpeg2)

(excerpted from http://www.abdn.ac.uk/erg/research/future-net/digital-video/mpeg2-trans.html)
The MPEG-2 standards define how to format the various component parts of a multimedia programme (which may consist of: MPEG-2 compressed video, compressed audio, control data and/or user data). It also defines how these components are combined into a single synchronous transmission bit stream. The process of combining the steams is known as multiplexing.

The multiplexed stream may be transmitted over a variety of links, standards / products are (or will soon be) available for :
  • Radio Frequency Links (UHF/VHF)
  • Digital Broadcast Satellite Links
  • Cable TV Networks
  • Standard Terrestrial Communication Links (PDH, SDH)
  • Microwave Line of Sight (LoS) Links (wireless)
  • Digital Subscriber Links (ADSL family)
  • Packet / Cell Links (ATM, IP, IPv6, Ethernet)


Building the MPEG Bit Stream

To understand how the component parts of the bit stream are multiplexed, we need to first look at each component part. The most basic component is known as an Elementary Stream (ES) in MPEG. A programme (perhaps most easily thought of as a television programme, or a DVD track) contains a combination of elementary streams (typically one for video, one or more for audio, control data, subtitles, etc).

Each Elementary Stream (ES) output by an MPEG audio, video and (some) data encoders contain a single type of (usually compressed) signal. There are various forms of ES, including:
  • Digital Control Data
  • Digital Audio (sampled and compressed)
  • Digital Video (sampled and compressed)
  • Digital Data (synchronous, or asynchronous)

For video and audio, the data is organised into access units, each representing a fundamental unit of encoding. For example, in video, an access unit will usually be a complete encoded video frame.

Each ES is input to an MPEG-2 processor (e.g. a video compressor or data formatted) which accumulates the data into a stream of Packetised Elementary Stream (PES) packets. A PES packet may be a fixed (or variable) sized block, with up to 65536 bytes per block and includes a 6 byte protocol header. A PES is usually organised to contain an integral number of ES access units.

The PES header starts with a 3 byte start code, followed by a one byte stream ID and a 2 byte length field.

PES Indicators provide additional information about the stream to assist the decoder at the receiver. The following indicators are defined:
  • PES_Scrambling_Control - Defines whether scrambling is used, and the chosen scrambling method.
  • PES_Priority - Indicates priority of the current PES packet.
  • data_alignment_indicator - Indicates if the payload starts with a video or audio start code.
  • copyright information - Indicates if the payload is copyright protected.
  • original_or_copy - Indicates if this is the original ES.A one byte flags field completes the PES header. This defines the following optional fields, which if present, are inserted before the start of the PES payload.
  • Presentation Time Stamp (PTS) and possibly a Decode Time Stamp (DTS) - For audio / video streams these time stamps which may be used to synchronise a set of elementary streams and control the rate at which they are replayed by the receiver.
  • Elementary Stream Clock Reference (ESCR)
  • Elementary Stream rate - Rate at which the ES was encoded.
  • Trick Mode - indicates the video/audio is not the normal ES, e.g. after DSM-CC has signalled a replay.
  • Copyright Information - set to 1 to indicated a copyright ES.
  • CRC - this may be used to monitor errors in the previous PES packet
  • PES Extension Information - may be used to support MPEG-1 streams.

The PES packet payload includes the ES data. The information in the PES header is, in general, independent of the transmission method used.

MPEG-2 Multiplexing

The MPEG-2 standard allows two forms of multiplexing:
MPEG Program Stream
A group of tightly coupled PES packets referenced to the same time base. Such streams are suited for transmission in a relatively error-free environment and enable easy software processing of the received data. This form of multiplexing is used for video playback and for some network applications.
MPEG Transport Stream Each PES packet is broken into fixed-sized transport packets forming a general purpose way of combining one or more streams, possibly with independent time bases. This is suited for transmission in which there may be potential packet loss or corruption by noise, or / and where there is a need to send more than one programme at a time.

MPEG Transport Streams

A transport stream consists of a sequence of fixed sized transport packet of 188 B. Each packet comprises 184 B of payload and a 4 B header. One of the items in this 4 B header is the 13 bit Packet Identifier (PID) which plays a key role in the operation of the Transport Stream.

The format of the transport stream is described with an example: two elementary streams sent in the same MPEG-2 transport multiplex. Each packet is associated with a PES through the setting of the PID value in the packet header (the values of 64 and 51 respectively). The audio packets have been assigned PID 64, and the video packets PID 51 (these are arbitrary, but different values). As is usual, there are more video than audio packets, but you may also note that the two types of packets are not evenly spaced in time. The MPEG-TS is not a time division multiplex, packets with any PID may be inserted into the TS at any time by the TS multiplexor. If no packets are available at the multiplexor, it inserts null packets (denoted by a PID value of 0x1FFF) to retain the specified TS bit rate. The multiplexor also does not synchronise the two PESs, indeed the encoding and decoding delay for each PES may (and usually is different). A separate process is therefore require to synchronise the two streams.


Single and Multiple Program Transport Streams

A TS may correspond to a single TV programme, or multimedia stream (e.g. with two a video PES and an audio PES). This type of TS is normally called a Single Programme Transport Stream (SPTS).

An SPTS contains all the information requires to reproduce the encoded TV channel or multimedia stream. It may contain only an audio and video PESs, but in practice there will be other types of PES as well. Each PES shares a common timebase. Although some equipments output and use SPTS, this is not the normal form transmitted over a DVB link.

In most cases one or more SPTS streams are combined to form a Multiple Programme Transport Stream (MPTS). This larger aggregate also contains all the control information (Program Specific Information (PSI)) required to co-ordinate the DVB system, and any other data which is to be sent.

Signalling Tables

For a user to receive a particular transport stream, the user must first determine the PID being used, and then filter packets which have a matching PID value. To help the user identify which PID corresponds to which programme, a special set of streams, known as Signalling Tables, are transmitted with a description of each program carried within the MPEG-2 Transport Stream. Signalling tables are sent separately to PES, and are not synchronised with the elementary streams (i.e they are an independent control channel).


The tables (called Program Specific Information (PSI) in MPEG-2) consist of a description of the elementary streams which need to be combined to build programmes, and a description of the programmes. Each PSI table is carried in a sequence of PSI Sections, which may be of variable length (but are usually small, c.f. PES packets). Each section is protected by a CRC (checksum) to verify the integrity of the table being carried. The length of a section allows a decoder to identify the next section in a packet. A PSI section may also be used for down-loading data to a remote site. Tables are sent periodically by including them in the transmitted transport multiplex.

Monday, August 30, 2010

法语 - 动词变位

  主格 宾格 所有格



          定语单 定语复



  主语单 主语复 主语单 主语复



je nous moi nous mon/ma mes notre nos



tu vous toi vous ton/ta tes votre vos



他/她 il/elle/on ils/elles lui/elle eux/elles son/sa ses leur leur
















规则动词变位










原形 -er(~=4000),去-er -ir(>300),去-ir -oir/ir/re/er(~=150),去ir/re/er





e ons is ssons s/e ons





es ez is ssez s/es ez





e ent t ssent t/e ent





donner
blêmir
partir/ouvrir











tir的单数还需去辅音










frir/vrir不需去辅音


















不规则动词变位










原形 être(be) avoir(have) aller(go) faire(do) pouvoir(can) venir(come)
suis sommes ai avons vais allon fais faisons peux pouvons viens venons
es êtes as avez vas aller fais faites peux pouvez viens venez
est sont a ont va vont fait font peut peuvent vient vientent


























语式 直陈式 命令式 虚拟式 条件式 不定式 分词式





语态 主动语态 被动语态






















直陈式











现在时











过去时 简单 复合 未完成






将来时 简单



































法语发音(按字母顺序)

按照字母顺序


a a


ai Z
lait
au o
gauche/beau/faux
am/an D


ay ei


b b 在组合、联颂中发音,词末不发音

c k/s 1.在a,o,u和辅音字母前发[k]音
2.如果一个音节以c这个字母结尾,发[k]音
3.在e,i,y的前面发[s]音


ch k/F 一般读[F]
在辅音前或词末发[k]


d d/t 一般发[d]音
在词末一般不发音
在连诵中发[t]音


e e 在非重读的音节内和单音节词尾发[E]
闭音节发[爱]
开音节发[e]
在mm/nn前发[a]
词尾一般不发音,但é读作e
le




eau o 同au beau
ei Z [爱]?

em/en D 同am/an

er/ez e
jouer/chez Vue/Fe
eu X/œ 开音节读X
闭音节读œ
bleu/vieu/deux/nœud
peur/meuble/sœur 

f f/v 一般发[f]音
在词末一般不发音
在连诵中发[v]音


g
1.在a,o,u前读做[g]
2.在连诵里发[k]音
3.在e,i,y前发[V]音
4.在词末一般不发音
gauche/gui


goF/gi


h
永不发音,但有嘘音和哑音的区别
嘘音前不能省音,而哑音前必须省音


i i


ie e


j V/dV 一般为V,外来词读dV

k k


l l/i 一般发[l]音,在词的末尾一般要发音
但在i前发[j]音


m m/n 一般发[m]音
连诵中仍然发[n]音
在n前,一般不发音


n n


gn M 一般都发[M]音,有例外

ien iY


o o/R 开音节读o
闭音节读R
côte/zone
mort/donner/dehors

œ



oi wa
moi/toi
oin wY
anoint
ou u/w 一般读u
元音前读w
nous
nouer

p p/b 一般发[p]音
在词末一般不发音
在连诵中发[b]音


q k 词末读[k]
qu读[k]


r r 一般要发音,读[r]
但在动词词末一般不发音
在连诵里不发音


s s/z 一般要发音,读[s],要在两个元音中间
但在动词词末一般不发音
在连诵里发[z]音


t t 一般发音,词末不发音 gentil?question?huit?
u u/H u在元音前发[H] sujet/salut/excusez?
v v


w v/w


x ks/gz 词末一般不发音
连诵中发[z]
dix/six中发[s]


法语发音(按发音顺序)

按照发音顺序






近似音标 字母(组合) 例词



i i, y, î, ï lit/stylo li/stilo


y u,û une
flûte




u ou,oû,où nous

jour


Vur



e iei é,
er/ez在词尾
eff/ess位于句首
es在部分开音节
ai在简单过去、将来时
e在不发音d或字母组合前
独立的et
été
jouer/chez
ses
j'ai/finirai
téléphoner
ete
Vue/Fe
se
Ve/finire
telefone

开音节:
元音结尾的音节
闭音节:
辅音结尾的音节
X E'u eu在z,t,d,tr之前
eu,œu位于开音节前
veut
bleu/vieu/deux/nœud
vX
blX/vX/dX/nX



o 喔,R: au,eau
o,û在开音节中
gauche/beau/faux
côte/zone
goF/bo/fo
kot/zon



R R o,û在闭音节中 mort/donner/dehors mRr/dRne/dERr


S ong on,om bon/ombre bS/Sbr


Z Z ai,è
e在两个相同的辅音前
e在闭音节中
et在词尾
lait
dette
merci
jouet
lZ
dZt
mZrsi
VuZ



Y ang in,im,ain,aim,ein,eim,yn,ym matin/timbre/faim/plein matY/tYbr


a a a,à,â
e在mm/nn之前
maladie/battent/là-bas
femme
maladi/batD
fam



D aoN an,am,en,em sans/lampe/vent/membre sD/lDp/vD/mDbr


H ü u在元音前 huile/puer/nuage Hl/pHe/nHaV


w w ou,oi oui/nouer/moi wi/nue/mwa


j j i,ill
il在元音音标后
i或y在元音前
i在辅音群和元音间
ill在元音前,有例外
famille

yeux/pied
ouvrier
famij

jX/pij
uvrje



E 弱音E e在单音节词尾
e在词首开音节





œ E eu,œu在闭音节中
ue(eu)在c/g之后
peur/meuble/sœur
r/mœbl/sœr


œ~ EN un,um lundi/parfum lœ~di/parfœ~


辅音   词尾可能发音的辅音:m,c,l  



M ny gn agneau/baigner/peigne aMo/beMe/pZM


V
ge在a/o前
g在字母e/i/y前
j

gilet/logis
jeune

VilZ/loVi
VOn



法语 (变位,名词, et al)

================= 变位 =================

    主格        宾格        所有格
                    定语单        定语复
    单    复    单    复    主语单    主语复    主语单    主语复
我    je    nous    moi    nous    mon/ma    mes    notre    nos
你    tu    vous    toi    vous    ton/ta    tes    votre    vos
他/她    il/elle/on    ils/elles    lui/elle    eux/elles    son/sa    ses    leur    leur

规则动词变位
原形    -er(~=4000),去-er        -ir(>300),去-ir        -oir/ir/re/er(~=150),去ir/re/er
我    e    ons    is    ssons    s/e    ons
你    es    ez    is    ssez    s/es    ez
他    e    ent    t    ssent    t/e    ent
例    donner        blêmir        partir/ouvrir
                    tir的单数还需去辅音
                    frir/vrir不需去辅音

不规则动词变位
原形    être(be)    avoir(have)    aller(go)    faire(do)    pouvoir(can)    venir(come)
我    suis    sommes    ai    avons    vais    allon    fais    faisons    peux    pouvons    viens    venons
你    es    êtes    as    avez    vas    aller    fais    faites    peux    pouvez    viens    venez
他    est    sont    a    ont    va    vont    fait    font    peut    peuvent    vient    vientent


语式    直陈式    命令式    虚拟式    条件式    不定式    分词式
语态    主动语态    被动语态

直陈式
现在时
过去时    简单    复合    先    愈    未完成
将来时    简单        先


================= 颜色 =================
COLORS - LES COULEURS    masc sing.     fem sing.    masc plural     fem plural
purple    violet    violette    violets    violettes
blue    bleu    bleue    bleus    bleues
green    vert    verte    verts    vertes
yellow    jaune    jaune    jaunes    jaunes
orange    orange    orange    orange    orange
red    rouge    rouge    rouges    rouges
black    noir    noire    noirs    noires
white    blanc    blanche    blancs    blanches
grey    gris    grise    gris    grises
brown    marron    marron    marron    marron
pink    rose    rose    roses    roses
light blue      bleu clair     bleu clair    bleu clair      bleu clair
dark blue    bleu foncé    bleu foncé     bleu foncé    bleu foncé



================= 常用词 =================
Comment?    What?
oui        yes
non        no
si        yes (in reponse to a negative)
d'accord    OK
et / ou        and / or
qui        who
quoi        what
quand        when
où        where
pourquoi    why
comment    how


================= 数字 =================

1    un    21    vingt et un    100    cent
2    deux    22    vingt-deux    200    deux cents
3    trois    23    vingt-trois    201    deux cent un
4    quatre    30    trente    1,000    mille
5    cinq    31    trente et un    2,000    deux mille
6    six    32    trente-deux    1,000,000    un million
7    sept    40    quarante    2,000,000    deux millions
8    huit    41    quarante et un    a billion    un milliard
9    neuf    50    cinquante          
10    dix    60    soixante          
11    onze    70    soixante-dix          
12    douze    71    soixante-onze          
13    treize    72    soixante-douze          
14    quatorze    73    soixante-treize          
15    quinze    74    soixante-quatorze          
16    seize    80    quatre-vingts          
17    dix-sept    81    quatre-vingt-un          
18    dix-huit    82    quatre-vingt-deux          
19    dix-neuf    90    quatre-vingt-dix          
20    vingt    91    quatre-vingt-onze

注:1.mille永远用单数形式; 2.million是名词,因此有复数形式。

================= 日期 =================
les jours de la semaine    days of the week
lund        Monday
mardi        Tuesday
mercredi    Wednesday
jeudi        Thursday
vendredi    Friday
samedi        Saturday
dimanche    Sunday

les saisons    seasons
printemps    spring
été        summer
automne        autumn
hiver        winter

les mois de l'année    months of the year
janvier        January
février    February
mars        March
avril        April
mai        May
juin        June
juillet        July
ao?t        August
septembre    September
octobre        October
novembre    November
décembre    December

the definite article must be used and the number always precedes the month
To ask What's the date? say Quelle est la date ?
o ask What day (of the week) is it? say Quel jour sommes-nous ? or Quel jour est-il ?


================= 家庭 =================
Family - La Famille
English        French        English        French
father        un père    mother        une mère
brother        un frère    sister        une soeur
son        un fils        daughter    une fille
husband        un mari        wife        une femme
grandfather    un grand-père    grandmother    une grand-mère
grandson    un petit-fils    granddaughter    une petit-fille
cousin - male    un cousin    cousin - female    une cousine
uncle        un oncle    aunt        une tante
nephew        un neveu    niece        une nièce


================= 身体 =================
les cheveux    头发    le coude    肘
la tête    头    le poignet    手腕
le visage    脸    la main    手
un oeil        眼睛    le doigt    手指
les yeux    眼睛(复数)    un ongle    指甲
le nez        鼻子    le pouce    大拇指
la joue     面颊    le dos    背
la bouche     嘴    la jambe    腿
une oreille     耳朵    le genou     膝
le cou         脖子    la cheville    踝
la poitrine     胸    le pied    脚
un estomac        胃    un orteil    脚趾
le bras     胳膊    une épaule    肩膀

Wednesday, August 4, 2010

advanced regular expression 高级正则表达式

断言
零宽度正预测先行断言 and 零宽度正回顾后发断言

(1)零宽度: 这表示匹配是一个位置(Loaction)而不是子表达式。
(2)预测先行 vs 回顾后发
预测先行:仅当子表达式在此位置的右侧匹配时才继续匹配。返回与子表达式匹配的前面位置,从做左到右匹配。
回顾后发:仅当子表达式在此位置的左侧匹配时才继续匹配。返回与子表达式匹配的后边位置,从右到左匹配。
(3)正向 vs 负向:
正向:当子表达式满足时才匹配。
负向:当子表达式不满足时才匹配。


总共四种断言:
零宽度正预测先行断言
vim: \@=
vim例:\w\+\(ing\)\@=     匹配以ing结尾的单词的前面部分(除了ing以外的部分)
   如果用magic, 则为 \v\w+(ing)@\=
零宽度正回顾后发断言
vim: \@<=
vim例:\(re\)\@<=\w+     匹配以re开头的单词的后半部分(除了re以外的部分)
   如果用magic, 则为 \v(re)@\<\=\w+
零宽度负预测先行断言
vim: \@!
vim例:foo\(bar\)\@!     匹配后面不带 "bar" 的 "foo"
零宽度负回顾后发断言
vim: \@<!
vim例:\(foo\)\@<!bar  匹配前面不带 "foo" 的 "bar"

PCRE 对应的格式为:
(?= 子表达式), (?<= 子表达式)
(?! 子表达式), (?<! 子表达式)

for perl help:
# perldoc perlre

.NET Framework中支持有名RE, 并支持注释:
(?<myname>expression) 如果遇到匹配,则把匹配的内容命名为myname,并压入堆栈
(?<-myname>expression') 如果遇到匹配,则从堆栈中弹出 名为myname的匹配内容。
(?(myname)yes|no) 如果堆栈上存在命名为myname的匹配的内容,则去继续匹配yes部分的表达式,否去继续匹配no部分。


 注释
 注释一般通过表达式(?#注释)实现。
以下正则表达式在第一个分组中中添加了注释“不能以数字开头”。
(?<!\d+(?#不能以数字开头))[a-z_A-Z]+
如果要在正则表达式中包含注释,最好打开IgnorePatternWhitespace选项,即忽略模式里的空白字符。

Thursday, July 22, 2010

iPhone 4 bom 成本明细

iPhone 4 teardown costs:



a simple table of the cost percentage:

lcd 28.5 15.16%
tyroscope 2.6 1.38%
proc 10.75 5.72%
dram 13.8 7.34%
nand 27 14.36%
power 4 2.13%
sensor 10 5.32%
touch scr 10 5.32%
camera 9.75 5.19%
battery 5.8 3.09%
mechanical 10.8 5.74%
elec-mech 14.4 7.66%
misc 5.5 2.93%
n/a 35.35 18.80%



total 188.25 100.13%



other details:
baseband 11.72 6.23%
wifi 7.8 4.15%

Tuesday, July 13, 2010

nc vs questa

category feature vlog/vsim irun description same?
general N/A all ncverilog plus options
can be used

Options in LC can also be in UC.
diff
-help -h, -helpall help diff
-version -version version same
N/A -64bit 64bit diff
N/A -clean Deletes previous
INCA_libs directory if it exists
diff
N/A -unbuffered Do not buffer
output
diff
compilation N/A -c Parse and
elaborate, do NOT simulate
diff
N/A -forceelab Force ncelab to
execute
diff
N/A -cdslib/hdlvar
<arg>
Specify a
cds.lib/hdl.var file to be used
diff
access +acc -access rwc diff
-i/-gui -gui force
interactive / Invoke the Graphical User Interface
diff
-c N/A Command line
mode
diff
+incdir+<dir> -incdir
<dirs>
Specify
directories to search for `include files
diff
+libcell -libcell Define library
modules (found with -v|-y search) as cells
diff
natively supported??? -ovm Turn on support
for the OVM library
diff
filelist -f <filename> -f
<filename>
Scan file for
args relative to irun invocation
same
-L<lib dir> -L<lib
dir>
Directory to
search for lib files
same
-v <file> -v <file> Specify a
library file to be used
same
-y <directory> -y
<directory>
Specify a
library directory to be used
same
-work <library> -work
<library>
Library for
command line
same
coverage N/A -covdut Select DUT for
Coverage
diff
N/A -covoverwrite Enable overwrite
of coverage output files
diff
N/A -covworkdir
<string>
Select coverage
workdir
diff
N/A -coverage
<string>
Enable coverage
instrumentation
diff
N/A -covfile
<file>
Specify coverage
instrumentation control file
diff
-coveropt N/A Specify a digit
for code coverage optimization level: 1 through 4.
diff
+cover[=sbceftx] N/A Enable code
coverage metrics by specifying the characters
diff
optimization N/A -debug Equivalent to
-access +rw, Specman debug
diff
+acc=l -linedebug line debug diff
parameter N/A -defparam
<arg>
Redefine the
value of a Verilog parameter
diff
macro/define +define+<macro_name>[=<macro_text>] +define+<macro_name>[=<macro_text>] Define a macro
from command line
same
N/A -ncvlogargs
<string>
Pass arguments
to Verilog parser
diff
N/A -ncelabargs
<string>
Pass arguments
to elaborator
diff
-R [<simargs>] -ncsimargs
<string>
Pass arguments
to simulator
diff
simulation -timescale <arg> -timescale
<arg>
Set default
timescale on Verilog modules
same
-l
<filename>
-l
<filename>
Set logfile name same
N/A -R Simulate using
last snapshot generated
diff
-pli
"<object list>"
-loadvpi/loadpli1
<arg>
Specify the PLI
library_name:boot_routine(s)
diff
-sv_seed <seed> -svseed
<seed>
Set
SystemVerilog default RNG seed
diff
-do <file> -input
<file>
Read TCL
commands from file
diff