对于硕士生,根据先前的经验,除非你在本科阶段受过非常良好的训练,并且自身素质极为优秀,在时间线的压力下让硕士生承担研究课题会使导师身心俱疲。本质上,硕士生的诉求是 “出去工作”,而课题组的诉求是 “完成科研任务”。因此,对于硕士生,我们更多的会安排一些事务性的工作,或是工程项目一部分,最后拼凑成毕业设计。作为交换,在完成任务的前提下可以得到更多的自由时间。
我也要很抱歉 (无奈) 地告诉大家,今天的学术界惊人的内卷,因此导师招人也必须满足 “利益最大化”,把课程丢上网已经算是最大程度的 “做慈善” 了:学生一方面是被培养的对象,另一方面 (更重要的) 也是导师解决困难的研究问题或者完成项目的打手。只有目标匹配,导师的付出才有回报,而 “学习曲线过长无法产出” 的学生对于我们来说是非常难受的 “负资产”。
Daniel Lemire's blog
Passing recursive C++ lambdas as function pointers
In modern C++, as in many popular languages, you can create ‘lambdas’. Effectively, they are potentially anonymous function instances that you can create on the fly as you are programming, possibly inside another function. The following is a simple example.
What about recursive functions? At first I thought you could do…
Sadly it fails. What seems to be happening is that while it recognizes the variable ‘fact’ within the definition of ‘fact’, it cannot use it without knowing its type. So you should specify the type of the ‘fact’ right away. The following will work:
But using std::function templates may add complexity. For example, what if you have a function that takes a function as a parameter without using std::function, such as…
Then you would want to call print(fact), but it will not work directly. It may complain like so:
So let us avoid the std::function as much as possible:
And then everything works out fine:
Let me finish with a word of caution: functional programming is sophisticated, but it has downsides. One potential downside is performance. Let us consider this conventional code:
Most compilers should produce highly optimized code in such a scenario. In fact, it is likely that the returned value of ‘functionc’ gets computed a compile time. The alternative using lambdas might look as follows:
Though the results will depend on your system, I would expect far less efficient code in general.
Thus when programming in C++, if you use lambdas in performance critical code, run benchmarks or disassemble your function to make sure that you have, indeed, zero-cost abstraction.
Credit: Thanks to Ca Yi, Yagiz Nizipli and many X users for informing this post.
source
Passing recursive C++ lambdas as function pointers
In modern C++, as in many popular languages, you can create ‘lambdas’. Effectively, they are potentially anonymous function instances that you can create on the fly as you are programming, possibly inside another function. The following is a simple example.
auto return1 = [](int n) -> int { return 1; };
What about recursive functions? At first I thought you could do…
auto fact = [](int n) -> int {
if (n == 0) {
return 1;
} else {
return n * fact(n - 1);
}
};
Sadly it fails. What seems to be happening is that while it recognizes the variable ‘fact’ within the definition of ‘fact’, it cannot use it without knowing its type. So you should specify the type of the ‘fact’ right away. The following will work:
std::function<int(int)> fact = [](int n) -> int {
if (n == 0) {
return 1;
} else {
return n * fact(n - 1);
}
};
But using std::function templates may add complexity. For example, what if you have a function that takes a function as a parameter without using std::function, such as…
void print(int(*f)(int)) {
for(int k = 1; k < 10; ++k) {
std::cout << "Factorial of " << k << " is " << f(k) << std::endl;
}
}
Then you would want to call print(fact), but it will not work directly. It may complain like so:
No known conversion from 'std::function' to 'int (*)(int)
So let us avoid the std::function as much as possible:
int (*factorial)(int) = [](int n) -> int {
if (n == 0) {
return 1;
} else {
return n * factorial(n - 1);
}
};
And then everything works out fine:
print(factorial); // OK
Let me finish with a word of caution: functional programming is sophisticated, but it has downsides. One potential downside is performance. Let us consider this conventional code:
int factorialc(int n) {
if (n == 0) {
return 1;
} else {
return n * factorial(n - 1);
}
}
int functionc() {
return factorialc(10);
}
Most compilers should produce highly optimized code in such a scenario. In fact, it is likely that the returned value of ‘functionc’ gets computed a compile time. The alternative using lambdas might look as follows:
int (*lfactorial)(int) = [](int n) -> int {
if (n == 0) {
return 1;
} else {
return n * lfactorial(n - 1);
}
};
int functionl() {
return lfactorial(10);
}
Though the results will depend on your system, I would expect far less efficient code in general.
Thus when programming in C++, if you use lambdas in performance critical code, run benchmarks or disassemble your function to make sure that you have, indeed, zero-cost abstraction.
Credit: Thanks to Ca Yi, Yagiz Nizipli and many X users for informing this post.
source
又有新dmp侧信道纸了
GoFetch: New side-channel attack using data memory-dependent prefetchers https://gofetch.fail
Chips and Cheese
The Nerfed FPU in PS5’s Zen 2 Cores
#ChipAndCheese
Telegraph | source
(author: clamchowder)
The Nerfed FPU in PS5’s Zen 2 Cores
#ChipAndCheese
Telegraph | source
(author: clamchowder)
https://datatracker.ietf.org/doc/html/rfc8910
https://datatracker.ietf.org/doc/html/draft-ietf-capport-rfc7710bis-11
Captive-Portal Identification in DHCP and Router Advertisements (RAs)
In many environments offering short-term or temporary Internet access (such as coffee shops), it is common to start new connections in a captive portal mode. This highly restricts what the user can do until the user has satisfied the captive portal conditions.
This document describes a DHCPv4 and DHCPv6 option and a Router Advertisement (RA) option to inform clients that they are behind some sort of captive portal enforcement device, and that they will need to satisfy the Captive Portal conditions to get Internet access.不跳的话得暂停招生
学生跳楼后即可恢复 招生
7年不能毕业的话,就引导学生跳楼?
最好的方法就是
所以对于老师
应该不影响,影响的话清华早就没学生了(?
跳楼是否影响招生