avatar

[Reading]How to Win Friends and Influence People

[Reading]How to Win Friends and Influence People

How to Win Friends and Influence People

这本书我读的是中文版 ——《人性的弱点》。不得不说,这个中文书名真的很“符合”这个浮躁的时代,很能吸引大家的眼球。
个人认为这个标题存在一定的误导性:本书列举了一些人际交往中的“技巧”,而这些技巧正是利用了人性的“弱点”已达到某种特定的目的,如赢得友情,提升对他人的影响力。这就是这个书名,搭配书的章节总结给人的印象,看上去像是本PUA学的著作。考虑到这本书出版于上世纪30年代,都可以称为是PUA学鼻祖了。

然而,我想说这本书完全不是这个目的。书中不止一次强调,这本书所列举的不是虚伪的“技巧”,而是要发自真心的态度。或者说是一种价值观:真诚,尊重和积极的态度。

Arc of a Scythe - Scythe

Scythe (Arc of a Scythe Series - Book 1) Review

2021年读的第一本书,第一本英文书,也是Arc of a Scythe系列的第一本,还是挺有纪念意义的。

这本书主要讲的在未来社会,人工智能Thunderhead控制着社会的运行,人类拥有了无限寿命,且即使死亡也可以被revive(除非被烧成炭)。但与此同时,人类会面临人口膨胀的问题,所以就有了不受Thunderhead管理的工会组织Scythedom(因为Thunderhead想把人类自己的生存问题交给人类自己),以及scythe这个职业:scythe和普通人类没有不同,但是scythe可以合法glean人类,且被glean的人类是不能被revive的。每个scythe都拥有一个戒指,人类亲吻戒指可以被赋予一年的immunity(无法被任何scythe glean)。也正因为此,scythe在社会中的地位非常高,也产生了众多flatterer。

My 2020 End-of-Year Review

My 2020 End-of-Year Review

Prologue

我是在一次road trip中迎来2020的:Bay Area -> SF -> LA -> San Diego -> Las Vegas -> the Grand Canyon -> Bay Area。这是我第一次road trip,也是目前唯一一次。但一个happy start并没有持续多久:在CMU最后一学期刚开始就隐约有了对covid的担忧。起初只是戴口罩上课,然后没过多久就开始了无限期的stay-at-home,这也让本就没有什么学习状态的我更加放肆颓废。直到毕业典礼,covid已经日渐严重,毕业典礼取消了,同时也宣告了一个残酷的事实:我不仅错过了undergraduate的毕业典礼,也错过了master的毕业典礼——我已经没有机会再参加自己的毕业典礼了,这也可能成为这辈子的一个遗憾吧。

Design Pattern Tour: A Summary

Design Pattern Tour: A Summary

After learning all these design patterns, I feel the design patterns themselves don’t really matter. Instead, the intent of separation(or decouple, or Single Responsibility Principle) and the idea of delegating(or composite) are the kernel. These design patterns are just some common solutions for some popular use cases in development and their ultimate goal is still to decouple the code and then to achieve a high usability and extendability.

Design Pattern Tour: Behavioral Patterns

Design Pattern Tour: Behavioral Patterns

Iterator

Readings:

Iterator is an approach to provide collections(or containers) a common way to traverse, while hiding the inner structure of the collections. The application of it is obvious: Java and CPP both use this pattern.

For the structure of this pattern, the collection class normally provides an interface of getIterator(), the iterator class, on the other hand, offers interfaces of hasNext() and getNext(). In the concrete iterator class, we usually need to add a variable as a reference to the collection instance.

Concrete iterators can implement different kinds of traversal methods(e.x. DFS, BFS, etc.) easily, which makes it quite convenient to add new collections and iterators, or to replace current collections and iterators with new one in the client code. This design is not only good for extensibility but also Open/Closed Principle.

The separation of collections and iterators decouples the traversal from business logics, embodying Single Responsibility Principle. However, it sometimes might make things more complicated.

Design Pattern Tour: Structural Patterns

Design Pattern Tour: Structural Patterns

Adapter vs. Proxy vs. Decorator

Adapter

Readings:

I think Delegate is the core idea of all structural patterns, as well as some creational patterns, such as Factory and Builder.

Adapter, as the name indicates, is a way to connect incompatible interfaces. There are a variety of implementations, as long as the adapter can provide the client with all target interfaces(interfaces required by the client).

There are mainly two kinds of implementations:

  1. Class adapter: The adapter class should inherit from the service class and implement the target interface. But it sometimes requires multiple inheritance, which is not supported in some programming language(e.x. Java).
  2. Object adapter: The adapter class, as a wrapper, only needs to implement the target interface, and the service will reside within as a wrappee(adaptee), following the Object Composition Principle. Personally speaking, I would prefer this approach, because it’s more flexible and doesn’t involve the annoying multiple inheritance.

Design Pattern Tour: Creational Patterns

Design Pattern Tour: Creational Patterns

Factory

Readings:

First, I’d like to clarify the difference between all kinds of factory patterns.

  1. Simple factory: A single factory class; product is determined by the parameter passing to the factory class(or using Java reflection).
  2. Factory method: all products have their own specialized factory classes.
  3. Abstract factory method: based on factory method, but each of the factories will provide a set of methods for returning different kinds of products.
  4. Static factory method: there will be no factory class, instead, the functionality is implemented in the product class as a static function.

To sum up, Factory can work as either a class or a function. Therefore, it’s just a design idea, instead of a concrete implementation. (this works for all the design patterns)

Design Pattern Tour: Overview

Design Pattern Tour: Overview

Today, I’d like to start a new series of Design Patterns. This is not a series for those who don’t have prior knowledge of these design patterns. So, my recommendation is to at least explore and skim through this website to gain some basic knowledge about design patterns. As for the code example, you can find a Java version on My Github, which is based on the example of the website and you should be able to run it directly.

And as always, I will not talk about the detailed intents or implementations. Instead, I will be focusing on my personal understanding of these design patterns and their relationship and difference. Moreover, I will share some useful materials I was referring to for your further study.

[Reading]Percy Jackson and the Olympians: The Titan's Curse

Percy Jackson and the Olympians: The Titan’s Curse

I don’t know how to evaluate this volume because it seemed like I was indulged in it. I indeed spent only two days reading it, but I can’t say it’s interesting. Probably because I finally figured out the stereotype of stories from the writer, which were just like American road movies. I can still remember some wonderful plots from the last volume The Sea of Monsters. However, for this volume, I can barely remember anything after reading. I think the only thing which motivate me to continue reading is the ending, which I hope will be the same as expectation.

the-titan's-curse

[Reading]Percy Jackson and the Olympians: The Sea of Monsters

[Reading]Percy Jackson and the Olympians: The Sea of Monsters

HaHa, I think I’m not as old as I thought, since I can still get indulged in a book for children in elementary schools. Or probably I should say the author Rick Riordan wrote so good a story that I as an “old man” can also get fascinated.

the-sea-of-monsters

[Reading]A Song of Ice and Fire: Game of Thrones(quited)

[Reading]A Song of Ice and Fire: Game of Thrones(quited)

Recently I was reading the first volume of A Song of Ice and FireGame of Thrones. Till now, I have read a quarter of the whole book. However, today I decided to quit this book because it doesn’t fit into my purpose of reading, at least for recently. Because my primal reason for reading English novels is to improve my English, which can hardly be accomplished by reading this novel. This novel is telling a story of medieval fantasy epic, so the author are using a lot of “ancient” words which will merely be used in our real life. Although I can still understand what the author is telling with the help of my dictionary and Google, I don’t want to spend much time but gain little.

[Reading]Murder on the Orient Express

[Reading]Murder on the Orient Express

The other day, I felt very lucky to finish my first Agatha Christie’s famous whodunit – Murder on the Orient Express. I had watched the movie, and I had some vague memories about the ending, although I can hardly remember any details of books or movies I watched or read. Thus, the so-called “unexpected ending” didn’t surprise me very much.

murder-on-the-orient-express

[Reading]Percy Jackson and the Olympians: The Lightning Thief

[Reading]Percy Jackson and the Olympians: The Lightning Thief

Today, I’m really glad that I’ve finally finished reading the first original English novel — the first novel of Percy Jackson and the Olympians series: The Lightning Thief — although it is of a low reading level (for elementary school students) for native speakers.

the-lightning-thief

[GAME]Life is Strange Review

[GAME]Life is Strange Review

It’s been a long time since I played the game. And I was actually not a big fan of this kind of game, because I thought it was like a girl game and the story always developed slowly. However, I felt so exhausted after 6-week “homework-sleep-homework” life that I would like to play some casual games instead of those requiring too much focus, such as Dark Soul III. And Coronavirus and spring break provided me with plenty of time for playing this kind of “slow” game.

max

[FFXIV]FINAL FANTASY XIV Review

[FFXIV]FINAL FANTASY XIV Review

I’ve been dreaming of playing in a world of MMORPG game for long years. However, MMORPG games are always famous(notorious) for costing a lot of time and money. Thus, I had never played a real MMORPG until last semester, when I got plenty of spare time to do things other than study. But I felt much stronger course pressure this semseter, so I decided to quit this game. It doesn’t mean that the game is boring. On the contrary, it is one of the greatest games and the greatest online game I’ve ever played. Although I quit this game, I’m not leaving this game. And that’s why I would like to spend the whole evening to write a review of this game and talk about the FFXIV in my heart.

ffxiv-0.0

First Time Snowboarding

First Time Snowboarding

That was so amazing!!!

dodgeridge

This time, we went to Dodge Ridge, which is the closest wintersports area to the Bay Area. And because it was my first going snowboarding, I registered a L1(beginner) lesson. The funny thing is the lesson includeing the rental and day pass is cheaper than day pass plus rental. I don’t know why…

2020 New Start: Learning English

2020 New Start: Learning English

Happy new year and happy new semester!

This will be my last year as a student. I really treasure the time as a student, especially a CMU student, because there are still a lot of courses I love but not get the opportunity to take. However, the tuition here is also extremely thrilling and I wish I can start to work as early as possible to live on my own.