2016年9月28日 星期三

Expressing Agreement

Expressing strong agreement 這些詞語可用來表示您完全同意他人的話,表達出強烈的贊同之意。

  • I completely agree.
  • Absolutely.
  • Definitely.
A:I thought the conference we attended on emerging technologies was extremely informative.
B: I completely agree.
A: The networking meeting was a great way to meet potential clients.
B: Absolutely.

Expressing partial agreement 這些詞語表示您同意某人部份的意見,而非完全同意。表達出部份贊同之意。

  • I would tend to agree with you.
  • I agree in principle. 
  • I agree in general.


A: I think the increase in interest rates is a good thing for the economy.
B: I agree in general, but there are some negative points as well.
部份同意詞語的後面通常會接相反的意見,例如:"I agree in general, but..."

Expressing simple agreement 某些詞語只顯示贊同之意,不強調任何事情。

  • I agree with you on that.
  • You're right.
  • I have the same opinion.


Traffic is getting worse now that so many companies are opening office in this part of town. 
You're right.

2016年9月27日 星期二

Past Perfect

過去完成式的句型為 "had" + 過去分詞。它用來表示某項動作是在過去另一項動作之前完成的。第一個事件 (had left for New York) 用過去完成式。第二個事件 (arrived at the airport) 則用簡單過去式。




如果句中有 "before" 或 "after" ,通常就不需要使用過去完成式,因為時間的關係十分明顯。所以可以改用簡單過去式,像第二句一樣。兩個句子的意義相同。
在這些句子中,過去完成式用來表達未實現的願望。在第一個句子中,說話者希望訂期相會,但是未能如願。在第二句中,說話者未能接獲 Mike 將會晚到的通知,但是希望之前若是能接到就好了。
I had hoped to make an appointment with him before he left.
I wish you had told me Mike was going to be late.
否定句的句型為將 "not" 置於助動詞 "had" 之後。
問句的句型為將助動詞 "had" 置於主詞之前。

THE PAST PERFECT TENSE

Use the past perfect to show that an action was completed before another action in the past. Use the past perfect to describe the first action and use the simple past to describe the second action.
Positive Statement
+ had + past participle
She had already left for New York when I arrived at the airport.
Negative Statement
+ had + not + past participle
He hadn't called me in a few days, so I called him.
Question
Had + S + past participle?
Had you met him before this evening?
She had already left for New York when I arrived at the airport.
(First she left for New York, and then I arrived at the airport.)
In sentences with before or after, the past perfect is optional because the time relationships are already clear.
Mike had left for London before I arrived at his house.
Mike left for London before I arrived at his house.
The past perfect can also be used to express an unrealized hope or wish.
I had hoped to make an appointment with him before he left.
I wish you had told me Mike was going to be late.
補充: https://www.youtube.com/watch?v=7sXGfQ6R6nc















片語

rolling in money(expression) = 花大筆錢
[informal]
used to say that someone is very rich

片語

表達禮貌:
By your leave : 失禮了
If you please : 勞駕您
Don't bother : 別費心


rolling in money(expression) = 花大筆錢
[informal]
used to say that someone is very rich

2016年9月6日 星期二

Analysis pass rate for CCSN consistency

Code:
$LC_LOG = $ARGV[0];
$index_X = $ARGV[1];
$index_Y = $ARGV[2];
open(h2,"+>temp.log");

my @all_fail = 0;

##### Get X index values #####
open(XFile,"<$index_X");
while(<XFile>){
chop $_;
@X_ary=split(",",$_);
}
foreach $X_value (@X_ary)
{
print "X array vlues:$X_value\n";
}


##### Get Y index values #####
open(YFile,"<$index_Y");
$i=0;
while(<YFile>){
chop $_;
@Y_ary=split(",",$_);
$Y0[$i]=$Y_ary[0] ;
$Y1[$i]=$Y_ary[1] ;
$Y2[$i]=$Y_ary[2] ;
$Y3[$i]=$Y_ary[3] ;
$Y4[$i]=$Y_ary[4] ;
$Y5[$i]=$Y_ary[5] ;
$Y6[$i]=$Y_ary[6] ;
$i=$i+1;
}
#$i=0;
#foreach $Y_value (@Y1)
#{
# #print "Y0 array vlues:$Y_value counter $i ";
# print "$Y_value";
# $i++;
#}

##### Replace Y values to Y symbol  #####
open(Validation_data,"<$LC_LOG");
while(<Validation_data>){
foreach $Y_value_0 (@Y0)
{
s/,$Y_value_0 /,Y_0 /g ;
}
foreach $Y_value_1 (@Y1)
{
s/,$Y_value_1 /,Y_1 /g ;
}
foreach $Y_value_2 (@Y2)
{
s/,$Y_value_2 /,Y_2 /g ;
}
foreach $Y_value_3 (@Y3)
{
s/,$Y_value_3 /,Y_3 /g ;
}
foreach $Y_value_4 (@Y4)
{
s/,$Y_value_4 /,Y_4 /g ;
}
foreach $Y_value_5 (@Y5)
{
s/,$Y_value_5 /,Y_5 /g ;
}
foreach $Y_value_6 (@Y6)
{
s/,$Y_value_6 /,Y_6 /g ;
#print ",$Y_value_6 ";
}
print "$line ";
$line++;
print h2 $_;
}
close (h2);
rename("temp.log","interpolation.data");

$X0Y0=0; $X0Y1=0; $X0Y2=0; $X0Y3=0; $X0Y4=0; $X0Y5=0; $X0Y6=0;
$X1Y0=0; $X1Y1=0; $X1Y2=0; $X1Y3=0; $X1Y4=0; $X1Y5=0; $X1Y6=0;
$X2Y0=0; $X2Y1=0; $X2Y2=0; $X2Y3=0; $X2Y4=0; $X2Y5=0; $X2Y6=0;
$X3Y0=0; $X3Y1=0; $X3Y2=0; $X3Y3=0; $X3Y4=0; $X3Y5=0; $X3Y6=0;
$X4Y0=0; $X4Y1=0; $X4Y2=0; $X4Y3=0; $X4Y4=0; $X4Y5=0; $X4Y6=0;
$X5Y0=0; $X5Y1=0; $X5Y2=0; $X5Y3=0; $X5Y4=0; $X5Y5=0; $X5Y6=0;
$X6Y0=0; $X6Y1=0; $X6Y2=0; $X6Y3=0; $X6Y4=0; $X6Y5=0; $X6Y6=0;

open(h3,"<interpolation.data");
open(h2,">interpolation.result");
print "\n";
while(<h3>){
if (/$X_ary[0],Y_0/) { $X0Y0++ ; }
if (/$X_ary[0],Y_1/) { $X0Y1++ ; }
if (/$X_ary[0],Y_2/) { $X0Y2++ ; }
if (/$X_ary[0],Y_3/) { $X0Y3++ ; }
if (/$X_ary[0],Y_4/) { $X0Y4++ ; }
if (/$X_ary[0],Y_5/) { $X0Y5++ ; }
if (/$X_ary[0],Y_6/) { $X0Y6++ ; }
if (/$X_ary[1],Y_0/) { $X1Y0++ ; }
if (/$X_ary[1],Y_1/) { $X1Y1++ ; }
if (/$X_ary[1],Y_2/) { $X1Y2++ ; }
if (/$X_ary[1],Y_3/) { $X1Y3++ ; }
if (/$X_ary[1],Y_4/) { $X1Y4++ ; }
if (/$X_ary[1],Y_5/) { $X1Y5++ ; }
if (/$X_ary[1],Y_6/) { $X1Y6++ ; }
if (/$X_ary[2],Y_0/) { $X2Y0++ ; }
if (/$X_ary[2],Y_1/) { $X2Y1++ ; }
if (/$X_ary[2],Y_2/) { $X2Y2++ ; }
if (/$X_ary[2],Y_3/) { $X2Y3++ ; }
if (/$X_ary[2],Y_4/) { $X2Y4++ ; }
if (/$X_ary[2],Y_5/) { $X2Y5++ ; }
if (/$X_ary[2],Y_6/) { $X2Y6++ ; }
if (/$X_ary[3],Y_0/) { $X3Y0++ ; }
if (/$X_ary[3],Y_1/) { $X3Y1++ ; }
if (/$X_ary[3],Y_2/) { $X3Y2++ ; }
if (/$X_ary[3],Y_3/) { $X3Y3++ ; }
if (/$X_ary[3],Y_4/) { $X3Y4++ ; }
if (/$X_ary[3],Y_5/) { $X3Y5++ ; }
if (/$X_ary[3],Y_6/) { $X3Y6++ ; }
if (/$X_ary[4],Y_0/) { $X4Y0++ ; }
if (/$X_ary[4],Y_1/) { $X4Y1++ ; }
if (/$X_ary[4],Y_2/) { $X4Y2++ ; }
if (/$X_ary[4],Y_3/) { $X4Y3++ ; }
if (/$X_ary[4],Y_4/) { $X4Y4++ ; }
if (/$X_ary[4],Y_5/) { $X4Y5++ ; }
if (/$X_ary[4],Y_6/) { $X4Y6++ ; }
if (/$X_ary[5],Y_0/) { $X5Y0++ ; }
if (/$X_ary[5],Y_1/) { $X5Y1++ ; }
if (/$X_ary[5],Y_2/) { $X5Y2++ ; }
if (/$X_ary[5],Y_3/) { $X5Y3++ ; }
if (/$X_ary[5],Y_4/) { $X5Y4++ ; }
if (/$X_ary[5],Y_5/) { $X5Y5++ ; }
if (/$X_ary[5],Y_6/) { $X5Y6++ ; }
if (/$X_ary[6],Y_0/) { $X6Y0++ ; }
if (/$X_ary[6],Y_1/) { $X6Y1++ ; }
if (/$X_ary[6],Y_2/) { $X6Y2++ ; }
if (/$X_ary[6],Y_3/) { $X6Y3++ ; }
if (/$X_ary[6],Y_4/) { $X6Y4++ ; }
if (/$X_ary[6],Y_5/) { $X6Y5++ ; }
if (/$X_ary[6],Y_6/) { $X6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("Slew-07 %-5s %-5s %-5s %-5s %-5s %-5s %-5s \n", $X6Y0,$X6Y1,$X6Y2,$X6Y3,$X6Y4,$X6Y5,$X6Y6 ) ;

printf h2 ("        %-7s %-7s %-7s %-7s %-7s %-7s %-7s \n", "Load-1","Load-2","Load-3","Load-4","Load-5","Load-6","Load-7", ) ;
printf h2 ("Slew-01 %-7s %-7s %-7s %-7s %-7s %-7s %-7s \n", $X0Y0,$X0Y1,$X0Y2,$X0Y3,$X0Y4,$X0Y5,$X0Y6 ) ;
printf h2 ("Slew-02 %-7s %-7s %-7s %-7s %-7s %-7s %-7s \n", $X1Y0,$X1Y1,$X1Y2,$X1Y3,$X1Y4,$X1Y5,$X1Y6 ) ;
printf h2 ("Slew-03 %-7s %-7s %-7s %-7s %-7s %-7s %-7s \n", $X2Y0,$X2Y1,$X2Y2,$X2Y3,$X2Y4,$X2Y5,$X2Y6 ) ;
printf h2 ("Slew-04 %-7s %-7s %-7s %-7s %-7s %-7s %-7s \n", $X3Y0,$X3Y1,$X3Y2,$X3Y3,$X3Y4,$X3Y5,$X3Y6 ) ;
printf h2 ("Slew-05 %-7s %-7s %-7s %-7s %-7s %-7s %-7s \n", $X4Y0,$X4Y1,$X4Y2,$X4Y3,$X4Y4,$X4Y5,$X4Y6 ) ;
printf h2 ("Slew-06 %-7s %-7s %-7s %-7s %-7s %-7s %-7s \n", $X5Y0,$X5Y1,$X5Y2,$X5Y3,$X5Y4,$X5Y5,$X5Y6 ) ;
printf h2 ("Slew-07 %-7s %-7s %-7s %-7s %-7s %-7s %-7s \n", $X6Y0,$X6Y1,$X6Y2,$X6Y3,$X6Y4,$X6Y5,$X6Y6 ) ;

Usage:
perl analysis_consistancy.pl LC.log index_X index_Y


Generate index_X and index_Y :
grep index_1 a.lib | sort -u > index_X
grep index_2 a.lib | sort -u > index_Y
note: need to remove pre-fix and space ...etc

index_X :
0.002,0.0154552,0.062686,0.15288,0.293398,0.490561,0.75,

index_Y :
0.001,0.00106724,0.00130329,0.00175404,0.0024563,0.00344165,0.00473823
0.001,0.00109782,0.00144119,0.00209692,0.0031185,0.00455189,0.00643805
0.001,0.00110011,0.00145154,0.00212263,0.00316816,0.00463515,0.00656552
0.001,0.00110183,0.00145928,0.00214189,0.00320536,0.00469752,0.00666101
0.001,0.00110373,0.00146783,0.00216315,0.00324641,0.00476635,0.00676639

Results:
              Load-1  Load-2  Load-3  Load-4  Load-5  Load-6  Load-7
Slew-01 656       771       1032    1683    1802    1353    639  
Slew-02 599       714       919     1548    1475    878     330  
Slew-03 613       733       867     1295    982     365     205  
Slew-04 781       841       844     971     590     255     176  
Slew-05 800       809       632     535     344     196     167  
Slew-06 774       641       397     284     196     186     158  
Slew-07 1242     898       519     355     131     143     155  

2016年8月31日 星期三

Conditional sentences: Unreal (present/future)

本條件句的第一部份描述一個不實際或虛假的狀況,第二部份則陳述如果該狀況為真時,會發生的後果。
不實條件句(反白標明者)的 "if" 子句描述了一個不實際或虛假的狀況。在這個情況下,說話者不知道電話號碼為何。這可由句中的 "if" 和動詞的過去式得知。
結果子句(反白標明者)陳述一旦 "if" 子句的情況為真時,將會發生的事情。不過,因為 "if" 子句是描述不實際的情形,所以不會發生。
整個句子的意思是說話者想要打電話確認訂單,但是因為不知道電話號碼,所以無法這樣做。請注意,當 "if" 子句置於句首時,後面要加上逗號。
請留意這些有關現在及未來不實情況的條件句之句型。在 "if" 子句中,會使用過去式的動詞。在結果子句中,動詞之前通常會加上 "would"。
若使用 "be" 動詞,請用 "were" 的形態,即使主詞為 "I"、"he"、"she" 或 "it" 時亦然。不過,在比較不正式的情況下,也可以使用 "was"
否定句的句型為將 "didn't" 置於 "if" 子句內的動詞前面,或將 "not" 置於結果子句內的 "would" 後面。
"If" 子句通常位於句子的第一個部份,不過也可以置於句尾。當 "if" 子句出現在結果子句的後面時,請將逗號刪除。句意不會有所改變。


If I knew the phone number, I would call to check on the order.
結果子句(反白標明者)陳述一旦 "if" 子句的情況為真時,將會發生的事情。不過,因為 "if" 子句是描述不實際的情形,所以不會發生。
整個句子的意思是說話者想要打電話確認訂單,但是因為不知道電話號碼,所以無法這樣做。請注意,當 "if" 子句置於句首時,後面要加上逗號。

If clause                 result
--------------             --------------
past form               would+base
If I knew.......,         I would call..........
請留意這些有關現在及未來不實情況的條件句之句型。在 "if" 子句中,會使用過去式的動詞。在結果子句中,動詞之前通常會加上 "would"。


If I were you, I would stay home.
If I were Mike, I would sell the company.
If she was having personal problems, she would tell me about them.
若使用 "be" 動詞,請用 "were" 的形態,即使主詞為 "I"、"he"、"she" 或 "it" 時亦然。不過,在比較不正式的情況下,也可以使用 "was"

If he left this company, he wouldn't have any difficulty finding a new job.
If she didn't have so much to do, she would be less stressed.
否定句的句型為將 "didn't" 置於 "if" 子句內的動詞前面,或將 "not" 置於結果子句內的 "would" 後面。

If he left this company, he wouldn't have any difficulty finding a new job. ->
He wouldn't have any difficulty finding a new job if he left this company.
"If" 子句通常位於句子的第一個部份,不過也可以置於句尾。當 "if" 子句出現在結果子句的後面時,請將逗號刪除。句意不會有所改變。


UNREAL CONDITIONAL SENTENCES IN THE PRESENT AND FUTURE

In an unreal conditional sentence, the if clause describes a situation that is not real or not true. The result clause states what would happen if the unreal situation were true.

Example:

If I knew the phone number,
--I would call to check on the order.
(I don't know the number,
--so I can't call to check on the order.)


Postive
Sentences
"If" Clause
If  S  V (past tense)
If I knew the phone number,
Result Clause
 would  V (base form)
I would call to check on the order.

With "be"If  S  were would  V (base form)
If I were you, I would stay home today.

With "be" (less formal)If  S  was would  V (base form)
If she was having personal problems, she would tell me.

Negative SentencesIf  S  didn't  V (past tense) would  V (base form)
If she didn't have so much to do, she would feel less stress.
ORIf  S  V (past tense) wouldn't  V (base form)
If he left the company, he wouldn't have any difficulty finding a new job.

The order of the clauses doesn't matter.

If he left the company, he wouldn't have any difficulty finding a new job.

He wouldn't have any difficulty finding a new job if he left the company.

2016年8月8日 星期一

FIND

1. find and delete data in some directory
find . -name models\* | xargs \rm -rf

標籤