Notes: Swift Result

Definition 1 2 3 4 5 6 7 8 9 10 /// A value that represents either a success or a failure, including an /// associated value in each case. @frozen public enum Result<Success, Failure> where Failure : Error { /// A success, storing a `Success` value. case success(Success) /// A failure, storing a `Failure` value. case failure(Failure) } Example 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 struct Person: Decodable { let name: String let age: Int } extension String: Error {} func loadPerson(from json: String) -> Result<Person, Error> { guard let data = json.

Bad Decisions

I left HSBC at the end of January to study in Australia. I like the job. It’s truely a great place to work. But back then studying abroad had been sort of my dream for years, which was why I took IELTS tests. I flew to Brisbane on 1 Feburary alone. But after two months there, I started to miss my family in China. I thought about bringing my family to Australia.

My Third IELTS (Academic) Test

(Photo by Jenny Pace) In this week, I took my third IELTS test. Results as below: Listening Reading Writing Speaking General 6.5 8.5 6 6 7 The overall result is not as good a last time, but finally I got a minimum 6 in each band. Thank god. One less thing to worry about.

My Second IELTS (Academic) Test

(Photo by Jenny Pace) In this week, I took my second IELTS test. I took it on computer this time. Results as below: This time: Listening Reading Writing Speaking General 9 8 6.5 5.5 7.5 Last time: Listening Reading Writing Speaking General 7.5 8 6 5 6.5 The result is better than last time, but still not good enough in Speaking band.

About Improving Performance

I’m gonna be honest. Sometimes my performance is far from good. Terrible, I mean. However, this won’t prevent me from sharing my practice to maintain performance. I think it is helpful. My practice includes keeping work log and self assessment. Work log Make a DONE list for everyday. Be brief. Self assessment How did I do today? Rate today’s work on a scale of 1-5, with 5 being the most productive/constructive/fruitful, and 1 the least.