1. 第一节 回忆过去的时光,我总觉得非常的孤独。
很长一段时间里,我都在为学习而忙碌。相反对于生活上的事情,我总是一副漠不关心的态度。在身边的同龄人看来,我也许是一个勤奋好学的小孩吧。但其实,我这么做只是想通过学习这件事情来得到他人的认可。这种心态,大概是源自我童年的生活。那时候,父母时常忙碌于工作,把我独自留在家中。从那时起我就变得不爱交谈,有什么事情都靠忍耐来克服。慢慢地,我固化成了偏内向的性格。在之后漫长的岁月里,我反复失去了对生活的感悟,逐渐依赖“忙碌”来逃避生活。
说起来,我自认为不是一个天赋异禀的人。我只是抱有“愚公移山”的信念,觉得只要通过努力就可以弥补自己在天资上的不足。事实证明,我确实靠这份执着拿到了一个还算过得去的学历标签。然而,这也就是我个人努力的极限了。我逐渐认识到“人外有人,天外有天”。在这样一个“学习崇拜”的社会环境里,我被迫地成为了一个“书呆子”。这也算是偏执信念的副作用吧。
如果把社交算作一门学问的话,那我可以算是吊车尾的学生了。每次见到他人侃侃而谈,我会感到非常的自卑和恐惧。这种情绪就好像别人家的孩子考了好成绩,而自己却发挥不好被父母责备,被朋友嘲笑。我也想过去改变自己,但这不是一件容易的事情。
在我高中毕业后,这种自我认识开始变得越发深刻。我逐渐意识到,仅仅靠学习上的投入很难再得到他人的认可。从此,我开始变得愈发迷茫和焦虑。我对学习变得不再那么执着了,反而对“善于交际”的标签产生了渴望。但是,这种渴望却激起了我内心更深层次的痛苦。因为过去独来独往的生活,我很难再改变自己去适应这种新的社会环境。
长期陷入这种低迷的情绪,人就会开始变得丧和颓废。对生活充满无力感的我,对生活中的各种事情都感到索然无味。我曾经一度靠沉迷电子游戏和碎片化娱乐来麻痹自我。到后来,我开始对这种虚度光阴的行为感到深深的自责。我开始厌恶自己这种不求上进的态度,于是写下此篇作为反省,并祈祷未来的生活能够发生些许改变。
1. Open System Interconncetion Reference Model (OSI model) Physical Layer: Network interface controller (网卡), ethernet hub (集线器), network switch, transmission medium. It converts digital bits to electrical, radio or optical signals. Voltage characteristics are defined.
Datalink Layer: Medium access control (MAC) layer, logical link control (LLC) layer. Correct errors that may occur in physical layers.
Network Layer: Provides to transfer packets from node to node. (IP)
Transport Layer: Provides to transfer variable length data sequences from source host to destination host.
1. Mutable & Immutable In python, built-in types are classified as mutable and immutable.
immutable: tuple, string, number, bool
mutable: list, dict, set
example city_list = ['New York', 'London', 'Tokyo'] city_list.append('Paris') print(city_list) # ['New York', 'London', 'Tokyo', 'Paris'] tuple_a = (1, 2) tuple_a[0] = 3 # error, since tuple_a is immutable, we can't modify it tuple_b = ([], 0) tuple_b[0].append(1) # success, because the address of the first element didn't change print(tuple_b) # ([1], 0) Conlusion Mutable objects are often used in the situations where we want to do updates.
1. Basic Concepts Redis is a NoSql database. Its characteristics are non-structured, non-relational, no SQL grammar. Other NoSQL includes MongoDB, elaticsearch. Besides, Redis only has base transaction.
Redis stores key-value, runs in single thread with low latency. Data persistence is supported in case of blackout.
2. Install See Redis. For mac os, we can just run
brew install redis 3. Basic Commands brew services start redis # start redis redis-cli -h 127.
1. Install See minikube.
1. First Example Suppose that we are going to build a blog application. The following codes will create the index page.
# urls.py urlpatterns = [ path('', views.index, name='index'), ] # views.py def index(request): latest = Post.objects.order_by("-modified_time") return render(request, "index.html", {"post_list": latest}) If we use View class, the codes will be easier to read.
# urls.py urlpatterns = [ path('', views.IndexView.as_view(), name='index'), ] # views.py from django.views.generic import ListView class IndexView(ListView): queryset = Post.
1. dot a = torch.tensor(1, 2, 3) b = torch.tensor(1, -1, 1) torch.dot(a, b) # 2 # x1y1 + x2y2 + x3y3 ... 2. mul This is the element-wise multiplication (broadcast). Or we can use ‘*’.
a = torch.tensor(1, 2, 3) b = torch.tensor(1, -1, 1) torch.mul(a, b) # (1, -2, 3) a * b # (1, -2, 3) 3. mm & bmm This is the matrix-multiplication. Also, ‘bmm’ is used for batch data.