Featured image of post Weekly Report 2023.15

Weekly Report 2023.15

Stay Proactive

时间会悄悄溜走,也可以用来完成很多事情。

Entertainment

長瀞さん 二期

很难去评价。内核是逐渐熟络的两个人,互相帮助对方成长的故事。Character 设定很【出彩?】,有些时候总觉得喜欢不起来。这就是这部作品的真实面目?

Learning

也不知道这周学会了啥,默写个 N 皇后吧。

 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
public class Solution {

    private List<List<char[]>> result = new ArrayList<>();

    public List<List<char[]>> nQueens(int n) {
        // init the board
        char[] row = new char[n];
        Arrays.fill(row, '.');
        List<char[]> board = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            board.add(row);
        }
        bfs(board, 0);
        return this.result;
    }

    public void bfs(List<char> curBoard, int row) {
        if (row == curBoard.size()) {
            this.result.add(new ArrayList<>(curBoard));
            return;
        }
        int n = curBoard.get(row).length;
        for (int i = 0; i < n; i++) {
            if (!isValid(curBoard, row, i)) {
                continue;
            }
            curBoard.get(row)[i] = 'Q';
            bfs(curBoard, row+1);
            curBoard.get(row)[i] = '.';
        }

    }

    public boolean isValid(List<char[]> curBoard, int row, int col) {
        int n = curBoard.get(row).length;
        // check current row
        for (int i = 0; i < col; i++) {
            if (curBoard.get(row)[i] == 'Q') {
                return false;
            }
        }

        // check up-left
        for (int i = row-1, j = col-1; i >= 0, j >= 0; i--,j--) {
            if (curBoard.get(i)[j] == 'Q') {
                return false;
            }
        }

        // check up-right
        for (int i = row-1, j = col+1; i >= 0, j < n; i--,j++) {
            if (curBoard.get(i)[j] == 'Q') {
                return false;
            }
        }

        return true;
    }
}

Life

一周内拉了 30km,这是人生以来跑的最多的一次经历。

Thought

从历史的角度来看的话,就是,总有一些人生而为奴。

Quotation

In 1789 the French population switched almost overnight from believing in the myth of the divine right of kings to believing in the myth of the sovereignty of the people.

Yuval Noah Harari. Sapiens (Kindle Locations 530-531). Kindle Edition.

God is dead, and another truth is god will reincarnate.

Recommendation

Redis 介绍文章

这篇文章收藏好些年了,想复习 Redis 基础知识的时候,就会拿出来看一看;就我目前的认知来看的话,Redis 的知识点都涵盖到了,也穿插着一些面试题,算是一种对症下药吧。

当然,真正想要研究 Redis 的数据结构,如何实现的高性能,或者是一些更加深入的内容的话,肯定还是结合官方文档和源码学习更加靠谱。

图解网络介绍

不错的一个知识网站,也没有强行插入的软广之类。有基础知识讲解,也有一些刁钻的面试题;可能不太适合初学者,但查缺补漏还是很实用的。

References

Licensed under CC BY-NC-SA 4.0
Last updated on Apr 16, 2023 22:07 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