Featured image of post Weekly Report 2023.20

Weekly Report 2023.20

Back to Future

What is ethical problem? Different generations got different answers.

只生一娃好,国家来养老。

# Entertainment

# Sapiens

帝国主义带来了 bloodbath & genocide,也带来了"进步"。

为什么二战后的世界如此和平,是因为大家的武力值都很低吗?作者认为,原因在于核威慑,在于再也没有 raw resources 了。侵占硅谷可以带来硅矿和任何其他直接利益吗?

Neo-liberalism 可以带来什么?可以参考当代的 US。Communism 可以带来什么,可以参考现代的 CN。

究竟有谁可以出淤泥而不染捏。

# Learning

# Golang with gRPC

  1. install protoc (protobuf compiler)
  2. install protoc-gen-go-grpc tool
    1. go get google.golang.org/grpc/cmd/protoc-gen-go-grpc
    2. go install google.golang.org/grpc/cmd/protoc-gen-go-grpc
  3. run compile command protoc --go_out=. --go-grpc_out=. ./protos/*.proto
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
syntax = "proto3";

// relative path (accord to project structure)
option go_package = "/protobuf/hello";

package hello;

service Hello {
    rpc SayHello(HelloReq) returns (HelloRes) {}
}

message HelloReq {
    string name = 1;
}

message HelloRes {
    int32 code = 1;
    string message = 2;
}

the sample go-grpc server.

 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
type helloServer struct {
    pb.UnimplementedHelloServer
}

func (s *helloServer) SayHello(ctx context.Context, req *pb.HelloReq) (*pb.HelloRes, error) {
    r := pb.HelloRes{
        Code: 200,
    }
    r.Message = fmt.Sprintf("Hello %s", req.GetName())
    return &r, nil
}

func newServer() *helloServer {
    s := &helloServer{}
    return s
}

func main() {
    lis, err := net.Listen("tcp", fmt.Sprintf("127.0.0.1:%d", 3000))
    if err != nil {
        log.Fatalf("fail to listen %v", err)
    }
    grpcServer := grpc.NewServer()
    pb.RegisterHelloServer(grpcServer, newServer())
    grpcServer.Serve(lis)
}

# Life

.

# Thought

The nature of nature is nature selection.

不掺杂任何 情感? 地说,能量不会消失,只会转移。

# Quotation

所有的生活都是合理的,我们没必要互相理解。

人不是因为变老了才没有热情,而是因为没有热情才会变老。

# Recommendation

# 如何做事

在这样的生活中每个人都背负着一项相同的使命—从喧闹的话语之外,去找寻那些沉默不语但是能做成事情的人。你得关闭耳朵,你得睁大眼睛。你得把目光中人群的中心移向边缘,你得去那些暗影里找寻,在那些丛生的杂树之间小心分辨,把做事情的人找出来,然后努力生活在这样一群人中间。我认为,这是充实和幸福人生的基础。

# 婚育

每一个人,都在独自打这场战役,不浪费时间去照顾其他的成年人,不是一种冷血,而是一种勇气——不让自己为了讨人喜欢,获得他人认可而陷入琐碎感情,产生幻觉,以为彼此的战斗责任可以互相逃避。

# References

Licensed under CC BY-NC-SA 4.0
Last updated on May 22, 2023 10:17 CST
The older I get, the more I realize that most of life is a matter of what we pay attention to, of what we attend to [with focus].
Built with Hugo
Theme Stack designed by Jimmy