關(guān)于 SINCE 的全部用法,你知道哪些?快來一起學(xué)習(xí)吧。下面小編就和大家分享,來欣賞一下吧。
關(guān)于 SINCE 的全部用法
1.說明
since是一個用法極活躍的詞, 也是學(xué)習(xí)中的重點(diǎn)詞匯, 現(xiàn)就其用法歸納如下:
2.用法
用法1:用作介詞, 意思是“從以來, 自從”, 常與完成時連用。
例句:I haven’t written home since Christmas. 自圣誕節(jié)以來, 我未曾寫信回家。
(說明:I haven’t written home為完成時態(tài)語句。)
用法2:用作副詞,
since意思是“從那時以后(一直到現(xiàn)在)”。
ever since從那以后一直 (更加強(qiáng)調(diào)since的用法)。
since副詞例句:
Things have not changed very much since.
從那時起, 情況并沒有太大的改變。
(說明:副詞since可以放在句子后面的,先描述寫一段句子:Things have not changed very much,再加一個since。)
ever since副詞例句:
H is first book was a great success and he has been famous as a writer ever since.
他的第一本書非常暢銷, 從那時起他就成了一位名作家。
(說明:副詞ever since放在了句子后面。)
用法3:用作連詞 意思是“因?yàn)椋热唬?鑒于”。
例句:
Since the rain has stopped,let’s go for a walk.
既然雨停了,我們出去散散步吧。
年華原創(chuàng),空間還很多關(guān)于學(xué)習(xí)英語的日志,歡迎觀看學(xué)習(xí)。
英語中to和for的用法,如何簡單區(qū)別使用?
for更注重目的,表示有一方受益,to更注重指向。to接不定式動詞原形,for接動詞ing形式。一般情況下, to后面常接對象; for后面表示原因與目的為多。
for和to的簡單區(qū)別
for和to這兩個介詞,意義豐富,用法復(fù)雜。這里僅就它們主要用法進(jìn)行比較。
1. 表示各種“目的”
What do you study English for?
你為什么要學(xué)英語?
She went to france for holiday.
她到法國度假去了。
These books are written for pupils.
這些書是為學(xué)生些的。
hope for the best, prepare for the worst.
作最好的打算,作最壞的準(zhǔn)備。
2.對于
She has a liking for painting.
她愛好繪畫。
She had a natural gift for teaching.
她對教學(xué)有天賦。
3.表示贊成同情,用for不用to.
Are you for the idea or against it?
你是支持還是反對這個想法?
He expresses sympathy for the common people..
他表現(xiàn)了對普通老百姓的同情。
I felt deeply sorry for my friend who was very ill.
4 .for表示因?yàn)椋捎?常有較活譯法)
Thank you for coming.
謝謝你來。
France is famous for its wines.
法國因酒而出名。
5.當(dāng)事人對某事的主觀看法,對于(某人),對?來說(多和形容詞連用)用介詞to,不用for..
He said that money was not important to him.
他說錢對他并不重要。
To her it was rather unusual.
對她來說這是相當(dāng)不尋常的。
They are cruel to animals.
他們對動物很殘忍。
6. for和fit, good, bad, useful, suitable 等形容詞連用,表示適宜,適合。
Some training will make them fit for the job.
經(jīng)過一段訓(xùn)練,他們會勝任這項(xiàng)工作的。
Exercises are good for health.
鍛煉有益于健康。
Smoking and drinking are bad for health.
抽煙喝酒對健康有害。
You are not suited for the kind of work you are doing.
7. for表示不定式邏輯上的主語,可以用在主語、表語、狀語、定語中。
It would be best for you to write to him.
The simple thing is for him to resign at once.
There was nowhere else for me to go.
He opened a door and stood aside for her to pass.
8. 表示前往(某地)去某地,用for不用to
I bought a ticket for Milan.
I start for Shanghai tomorrow.
我明天去上海。
The ship is for Liverpool.
這艘船是開往利物浦的。
9. 表示到達(dá)的目的地、終點(diǎn)用to不用for
The bus will take you to the post office.
公共汽車會把你送到郵局去的。
He saw her to the railway station.
他把她送到火車站。
10. 作為(意思接近as)for可以與to互換。
I’ll keep it for a souvenir.
我將把它留作紀(jì)念。
He spoke English so well that I took him for a foreigner.
他英語說的那么好,我還以為他是外國人。
He took her to (or for) wife.
他娶她為妻。
11.for表示交換
I bought a bicycle for seven hundred yuan.
我以七百元買了一輛自行車。
He is willing to work for nothing.
他愿意義務(wù)地工作。
12.表示就?來說,用for
He was tall for his age.
以他的年齡來說他的個子是很高的。
For so young a man he had read widely.
作為這樣年輕的人,他書讀的是夠多了。
13.表示相應(yīng)、對應(yīng),一般for 的前后用同一個名詞。
Don’t translate word for word. 不要逐詞翻譯。
Blood for blood ! 血債血償。
Eye for eye, tooth for tooth. 以眼還眼,以牙還牙。
To 的此種用法表示貼著,對著。
The two lovers dance cheek to cheek.
這對情侶跳貼面舞。
They stood face to face ( back to back )
他們面對面(背對背)地站著。
14. to 和動詞連用,表示“對”,“向”“給”等
Did you mention this to him?
你向他提到這事了嗎?
Give my love to your parents.
代我向你父母問好.
只要你邀請我回答,我必定抽空回答
to的用法
to的用法口訣
to的用法口訣
to 可以是介詞,也可以是結(jié)構(gòu)助詞。作介詞用的時候,后面跟名詞或動名詞,比如:give the book to Tom. i am looking forward to seeing you. 至于什么時候用to,介詞的用法都是固定搭配的,與其記住很容易混淆的多種含義,不如直接背固定詞組。
坐結(jié)構(gòu)助詞用的時候,是做不定式,也就是to do 形式,后面必須跟動詞原形。也可以理解為一種固定搭配,比如want to do , be going to do 。所以最好也是記住固定詞組。
情態(tài)動詞后不加to直接加v.(原)
行為動詞加to do sth.(如:need)
(表示時間)到, 直到, 在…到來之前, 離…; 例:from seven to ten
(表示方向)朝, 往, 通向
(表示狀態(tài))緊貼著, 緊靠著, 對著;
(表示對象)對, 對于, 對…來說;
(表示比較)比, 相對于;
(表示方位)在…方向[方位], 處于…順序;
(表示距離)離, 距離;
(表示目標(biāo))到達(dá), 直到;
(表示結(jié)果)轉(zhuǎn)換為, 轉(zhuǎn)變?yōu)? 趨于;
(表示修飾)———的。
for的用法
1. 表示“當(dāng)作、作為”。如:
I like some bread and milk for breakfast. 我喜歡把面包和牛奶作為早餐。
What will we have for supper? 我們晚餐吃什么?
2. 表示理由或原因,意為“因?yàn)?、由于”。如?/p>
Thank you for helping me with my English. 謝謝你幫我學(xué)習(xí)英語。
Thank you for your last letter. 謝謝你上次的來信。
Thank you for teaching us so well. 感謝你如此盡心地教我們。
3. 表示動作的對象或接受者,意為“給……”、“對…… (而言)”。如:
Let me pick it up for you. 讓我為你撿起來。
Watching TV too much is bad for your health. 看電視太多有害于你的健康。
4. 表示時間、距離,意為“計、達(dá)”。如:
I usually do the running for an hour in the morning. 我早晨通常跑步一小時。
We will stay there for two days. 我們將在那里逗留兩天。
5. 表示去向、目的,意為“向、往、取、買”等。如:
Let's go for a walk. 我們出去散步吧。
I came here for my schoolbag.我來這兒取書包。
I paid twenty yuan for the dictionary. 我花了20元買這本詞典。
6. 表示所屬關(guān)系或用途,意為“為、適于……的”。如:
It's time for school. 到上學(xué)的時間了。
Here is a letter for you. 這兒有你的一封信。
7. 表示“支持、贊成”。如:
Are you for this plan or against it? 你是支持還是反對這個計劃?
8. 用于一些固定搭配中。如:
Who are you waiting for? 你在等誰?
For example, Mr Green is a kind teacher. 比如,格林先生是一位心地善良的老師。
EditSprings
廣告不感興趣知乎廣告介紹「艾德思」專業(yè)論文降重,降低文章重復(fù)率,讓您投稿無憂!
一般而言,期刊對SCI論文重復(fù)率的要求大部分在20%以下,部分要求15%甚至10%以下。但SCI文章降重一需要專業(yè)知識儲備,二需要不錯的英語寫作水平,實(shí)屬難事。查看詳情
亞棣君
不登高山,不知天之高也;不臨深溪,不知地之厚也。
to 一般為不定式,就是還沒做成的事情,to do sth
也有g(shù)ive sth to sb 給予某人,接的是東西傳遞的對象
還有一種是做特定的介詞接名詞 the key to success成功的關(guān)鍵,表關(guān)系
或在在特定的短語做介詞,接動名詞 be accustomed to doing sth
但是to 的主要特點(diǎn)是,到達(dá)前往
for 用法單一,做介詞,表是為了某人,某個目的,因?yàn)?而,for you為了你(而做某事),thank for your help謝謝你
Promise的用法講解
Promise是一個構(gòu)造函數(shù),其自身有resolve reject all 等方法,原型上有then catch 等方法。
【ES6 Promise 用法講解】
http://www.cnblogs.com/whybxy/p/7645578.html
1、最簡單的Promise
let any_1 = new Promise((resolve, reject)=> {
setTimeout(()=> {
console.log("經(jīng)過1s,開始執(zhí)行");
resolve("Promise執(zhí)行完畢")
}, 1000);
})
/.
.Creates a new Promise.
.@param executor A callback used to initialize the promise. This callback is passed two arguments:
.a resolve callback used resolve the promise with a value or the result of another promise,
.and a reject callback used to reject the promise with a provided reason or error.
.
new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise;
Promise的構(gòu)造函數(shù)接收一個函數(shù)的參數(shù),此函數(shù)有兩個參數(shù):resolve , reject,分別表示一步操作執(zhí)行成功和異步執(zhí)行失敗的后的回調(diào)函數(shù)。
運(yùn)行上面代碼顯而易見,一秒后會執(zhí)行“經(jīng)過1s,開始執(zhí)行”,并調(diào)用resolve方法。
到了這里會有很多人開始疑問,這個resolve是什么,也并沒有用,并沒有執(zhí)行。
2、resolve的使用
上文提到resolve , reject,分別表示一步操作執(zhí)行成功和異步執(zhí)行失敗的后的回調(diào)函數(shù)。 那么Promise函數(shù)完畢之后如何讓這兩個函數(shù)執(zhí)行呢?
執(zhí)行下面代碼:
let any_1 = new Promise((resolve, reject)=> {
setTimeout(()=> {
console.log("1s后執(zhí)行");
resolve("Promise執(zhí)行完畢")
}, 1000);
})
any_1.then((data)=> {
console.log(data);
})
控制臺LOG:
Promise對象調(diào)用then方法,then接收一個函數(shù)參數(shù),并且會拿到Promise執(zhí)行成功回調(diào)resolve函數(shù)的參數(shù)。這即是Promise的作用了。簡單來講,就是能把原來的回調(diào)寫法分離出來,在異步操作執(zhí)行完后,用鏈?zhǔn)秸{(diào)用的方式執(zhí)行回調(diào)函數(shù)。
3、鏈?zhǔn)讲僮鞯挠梅?/p>
Promise相對于普通的回調(diào)函數(shù)(callback)來說從從表面上來說可以簡化層層回調(diào)的寫法,Promise的精髓是“狀態(tài)”,用維護(hù)狀態(tài)、傳遞狀態(tài)的方式來使得回調(diào)函數(shù)能夠及時調(diào)用,它比傳遞callback函數(shù)要簡單、靈活的多。
下面看一段代碼:
/.順序執(zhí)行Promise .
private orderGo() {
this.firPromise().then((data)=> {
console.log(data);
return this.secPromise();
})
.then((data)=> {
console.log(data);
return this.thirdPromise();
})
.then((data)=> {
console.log(data);
console.log("三個執(zhí)行完畢");
})
}
按照順序,每隔一段時間執(zhí)行一個異步回調(diào),在firPromise方法中傳給resolve的數(shù)據(jù),可以再接下來的then方法中拿到,下面運(yùn)行結(jié)果:
firPromise secPromise thirdPromise 三個方法的定義如下:
private firPromise(): Promise {
let result = new Promise((resolve, reject)=> {
setTimeout(function() {
console.log("執(zhí)行第一個Promise, 500ms");
resolve("第一個執(zhí)行完畢");
}, 500);
})
return result;
}
private secPromise(): Promise {
let result = new Promise((resolve, reject)=> {
setTimeout(function() {
console.log("執(zhí)行第二個Promise, 300ms");
resolve("第二個執(zhí)行完畢")
}, 300);
})
return result;
}
private thirdPromise(): Promise {
let result = new Promise((resolve, reject)=> {
setTimeout(function() {
console.log("執(zhí)行第三個Promise, 200ms");
resolve("第三個執(zhí)行完畢")
}, 200);
})
return result;
4、reject的用法
到這里大家應(yīng)該對Promise有了大概的認(rèn)知,前面筆者只介紹了resolve的用法,還沒有介紹reject的用法,下面通過一個簡單的例子來捕捉失敗的回調(diào):
private rejectPromise(): Promise {
let result = new Promise((resolve, reject)=> {
let math: number = Math.floor(Math.random() .10);
if(math >= 5) {
resolve("隨機(jī)數(shù)大于5: " + math);
} else {
reject("隨機(jī)數(shù)小于5");
}
})
return result;
}
調(diào)用 rejectPromise方法
this.rejectPromise().then( //reject的用法
(data)=> {
console.log(data);
},
(data)=> {
console.log(data);
}
)
上面這段代碼,隨機(jī)數(shù)如果大于5代表成功了,反而代表失敗了執(zhí)行reject方法,運(yùn)行結(jié)果有兩種:
5、all的用法
Promise的 all 提供并行執(zhí)行異步操作的能力,并且在所有異步操作執(zhí)行完畢之后才執(zhí)行回調(diào)。依舊使用上面第一的三個方法,all用法如下:
// -------------all用法---------------
Promise.all([this.firPromise(), this.secPromise(), this.thirdPromise()])
.then((datas)=> {
console.log(datas);
})
// -------------all用法---------------
運(yùn)行結(jié)果:
all方法并行執(zhí)行三個Promise對象,并把所有異步執(zhí)行的結(jié)果放進(jìn)一個數(shù)組中傳遞給then,就是上面的datas。
6、在實(shí)際開發(fā)中的用法
先看一個在Egret上常用的方法getResByUrl的使用:
RES.getResByUrl("resource/assets/egret_icon.png", (data)=> {
let icon: egret.Bitmap = new egret.Bitmap(data);
this.addChild(icon);
}, this, RES.ResourceItem.TYPE_IMAGE);
API中:
function getResByUrl(url: string, compFunc?: Function, thisObject?: any, type?: string): Promise;
可以看到getResByUrl 加載一個路徑的圖片資源,加載完成后執(zhí)行comFunc回調(diào)函數(shù),通過回調(diào)函數(shù)加載此圖片資源,顯示出來。我們可以拆分一下這個步驟,如下:
private urlGetImg() {
let result: Promise = RES.getResByUrl("resource/assets/egret_icon.png");
result.then((data)=> {
let icon: egret.Bitmap = new egret.Bitmap(data);
icon.x = egret.MainContext.instance.stage.stageWidth - icon.width;
this.addChild(icon);
})
}
二者結(jié)果相同,都可以通過路徑把圖片加載出來。
下面另外一個例子,參考Nasus
創(chuàng)建5 .5個對象,異步依次執(zhí)行一系列操作,效果如下圖。
本次所有行為執(zhí)行完畢之后,才可以進(jìn)入下一次操作。使用到tween第三方庫,源碼如下:
private orderTW() {
for (let i = 0; i < 5; i++) {
for (let j = 0; j < 5; j++) {
let map: egret.Bitmap = new egret.Bitmap(RES.getRes("egret_icon_png"));
map.anchorOffsetX = map.width / 2;
map.anchorOffsetY = map.height / 2;
map.x = map.width .j;
map.y = map.height .i;
this._layer.addChild(map);
this._layer.x = egret.MainContext.instance.stage.stageWidth / 2 - this._layer.width / 2;
this._layer.y = egret.MainContext.instance.stage.stageHeight / 2 - this._layer.height / 2;
}
}
//當(dāng)前下標(biāo)
let index: number = 0;
//執(zhí)行動作的Promise
let twPromise = () => {
console.log(`執(zhí)行${index}次`);
return new Promise((resolve1, reject) => {
egret.Tween.get(this._layer.getChildAt(index)).to({
rotation: 30
}, 400).to({
rotation: -30
}, 400).to({
alpha: 0
}, 200).call(() => {
resolve1(index++);
})
})
}
//切換對象的Promise
let orderPromise = () => {
return new Promise((resolve2, reject) => {
twPromise().then(() => {
if (index < this._layer.numChildren) resolve2(orderPromise())
else resolve2("執(zhí)行完畢")
})
})
}
orderPromise();
}
定義兩個Promise方法,分別為tween動畫的twPromise和執(zhí)行twPromise方法的orderPromise方法,orderPromise在初始的時候執(zhí)行,執(zhí)行此方法會調(diào)用twPromise方法和twPromise的then方法,其中then方法會調(diào)用index++,也就是一個對象執(zhí)行一系列tween動畫后,切換下一個對象,然后通過resolve2(orderPromise())使整個過程走完。
小結(jié)
本教程通過初入Promise到完成一個簡單的Demo,由淺入深學(xué)習(xí)了Promise的用法,如果有興趣也可以學(xué)習(xí)下catch race的用法。通過本教程,您可以學(xué)到以下知識點(diǎn):
· Promise是什么
· Promise的常用兩個函數(shù)resolve reject的使用
· 鏈?zhǔn)讲僮骱蚢ll的用法
Promise的基本用法
下一篇:provide的用法和辨析