“我发表了论文/专利/软著,我有过良好的科研训练”:我对论文的标准是 “教会你的大/小专家同行一些不 trivial 的事情”。据我近年观察,大部分申请者发表的论文都是减分项。相比于发表了 “错误” 论文或是在大创项目里学会了一本正经胡说八道的同学,我更偏好能耐心读论文和写代码的 “一张有潜力的白纸”。科学研究是脚踏实地的,前人所做到的 (内卷程度) 可能远比你想象得要大,认真读了 3-4 年博士依然没有论文的也大有人在,完全不必急功近利。
“我现在还不太会,但我会努力学习”:很遗憾,无论导师是否尽职尽责,研究生总体来说还是带有交易的成分。一方面,无论你的导师给你画了多大的饼,用 “给导师劳动” 换取 “导师的指导” 都是在所难免的。另一方面,我更希望导师和学生站在平等的合作者位置,并且我非常喜欢能够据理力争挑战我观点的学生。我们期望我们的同学在对计算机世界的认识、阅读、写作方面没有明显的短板,例如知道世界顶级名校名课 (包括研究生课) 的水准并能跟上。
对于硕士生,根据先前的经验,除非你在本科阶段受过非常良好的训练,并且自身素质极为优秀,在时间线的压力下让硕士生承担研究课题会使导师身心俱疲。本质上,硕士生的诉求是 “出去工作”,而课题组的诉求是 “完成科研任务”。因此,对于硕士生,我们更多的会安排一些事务性的工作,或是工程项目一部分,最后拼凑成毕业设计。作为交换,在完成任务的前提下可以得到更多的自由时间。
我也要很抱歉 (无奈) 地告诉大家,今天的学术界惊人的内卷,因此导师招人也必须满足 “利益最大化”,把课程丢上网已经算是最大程度的 “做慈善” 了:学生一方面是被培养的对象,另一方面 (更重要的) 也是导师解决困难的研究问题或者完成项目的打手。只有目标匹配,导师的付出才有回报,而 “学习曲线过长无法产出” 的学生对于我们来说是非常难受的 “负资产”。
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年不能毕业的话,就引导学生跳楼?
最好的方法就是
所以对于老师