摸鱼时光发现了一篇折腾 VPS 的博客,上面写着用 nginx 反代 GitHub,可以用于 GitHub 的下载加速,并且说理论上可以做任何网站的镜像。于是我也简单操作了一下。

直接看他的吧

During my idle time I found a blog post about tinkering with VPS. It described using nginx to reverse-proxy GitHub to speed up downloads from GitHub, and claimed that in theory you could mirror any website. So I went ahead and gave it a simple try.

Go read his post directly

Wiki教程分享VPS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
using namespace std;

class A{
public:
virtual void print(){
cout << "A" << endl;
}
};

class B:public A{
public:
void print(){
cout << "B" << endl;
}
};

int main(){
A b = B();
b.print(); // 这样可以吗?
return 0;
}

面试官问我这样可以吗?

我犹豫了好久好久… 也不知道可以不可以。

面试官看我答不出来,然后问我知道静态绑定和动态绑定吗?(这是在提示我了)

可我还是不知道可以还是不可以。😥

The interviewer asked me: can this be done?

I hesitated for a long, long time… and still didn’t know whether it could or couldn’t.

Seeing that I couldn’t answer, the interviewer then asked whether I knew about static binding and dynamic binding. (That was a hint to me.)

But I still didn’t know whether it could or couldn’t. 😥

C/C++Wiki笔试面经