V2EX BRS5672023 的所有回复 第 1 页 / 共 3 页
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX    BRS5672023    全部回复第 1 页 / 共 3 页
回复总数  47
1  2  3  
@EVANGELIONAir 我用的 cachyos 的内核,用 fn+f5/f6 调亮度不会黑屏
@EVANGELIONAir 我这边好像合盖断电会在有插拔外接电源的时候触发(应该还是老问题没有修复)
@EVANGELIONAir 那个好像是说的音频和麦克风的 fn 键上的 led 灯能正常工作了。。
@ferstar 似乎 6.14 版本的内核上 fn 快捷键调整亮度已经不会黑屏了?我试了下似乎合盖也不会断电了,可以正常唤醒(我的机器是 ryzen 版本的 thinkbook )
@takanashisakura 这个好像是因为联想的 acpi 在 Linux 上有问题,合盖之后就会断电。。要么在 modprobe 里面设置 ideapad-laptop 的黑名单,要么用 https://aur.archlinux.org/packages/ideapad-laptop-tb-dkms 这种工具也可以修复这个问题
@imjiaoyuan 可以啊,而且建议在 windows 里面把快速启动关了之后再格式化装 arch ,之前我就遇到过重启用 arch iso 格盘装 arch 的时候发现 wifi 还是蓝牙不能用(桌面主板用的 ax200 wifi 芯片),好像是没有正确进入断电的状态,或者先关机再用 arch iso 引导可能就没有这种问题了(总之可以格盘前先检查一下能不能正常用)
@imjiaoyuan 更新 bios 好像是可以在 Linux 上操作的,不过比较麻烦一点(记得还看到过有教程的,基本就是要从联想给的 exe 里面解压出 fw 文件然后用 fwupd 更新的,不过一时还找不到了),我现在是在一块外接的固态硬盘上分区装了 windows 系统,bios 更新也可以在 win2go 里面完成(在外接硬盘上用 vhdx 安装 windows 使用 ventoy 引导似乎是更好的方案,不过我在 vhdx 安装的 windows 上遇到了 onedrive 不能按需同步只能整个同步的问题,以及 windows update 里面的更新无法正常安装的问题)
296 天前
回复了 anivie 创建的主题 Linux kde 美化问题
不知道 ubuntu 上是怎么回事,arch 上对应 qt5/qt6 的包名为 kvantum-qt5 和 kvantum (后者没有后缀了)
309 天前
回复了 falser101 创建的主题 Linux Linux 使用 kitty 问题
zsh 补全需要 zsh-completions 吧。。好像常用的还有一些其他的包也要装和配置(感觉还是 fish 好用些)
@showgood163 revanced 的 microg 应该是不一样的,好像两个能同时安装( revanced 的 youtube 和原版也能同时存在),不过我对 revanced 的应用没啥需求
@BRS5672023 不过有一些使用上的不便之处,感觉特别是谷歌的应用在体验上有一些问题。。

比如 gboard ,无法下载语言包(然后就无法使用比如五笔输入法); chrome 无法补全密码(我看到有人说原因是谷歌把这一部分功能移动到了 gms 里面,所以老版的 chrome 能补全密码); googlequicksearchbox 直接白屏,没有内容显示; youtube 会出现看视频十几秒就卡住无法缓冲,但我重新安装 preview 版本的 microg 就没有这个问题了,应该是修复了
microg ,我在 lineageos 的机器上装了,对比之下没有 gms 那么耗电(不过我没有使用谷歌的 play store ,而是用的 aurora store )
@Tardis07 而且窗口捕获 wayland 应该还没有对应的 protocol 吧?
@Tardis07 黑框啥意思?所以你是想要除了你自己别人都看不见这个窗口吗?而不只是别人看不到这个窗口的内容?
niri wm 作为一个窗口管理器有这个功能 https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules#block-out-from ,然而其录屏功能需要 xdg-desktop-portal-gnome 来实现,而我在 archlinux 上使用 niri wm 却不能正常启动 xdg-desktop-portal-gnome 这个服务。。
@blacktail 只是随便写了下化简的部分;重点也不是在化简的部分,但是当然希望我的计算结果能够输出一个简化过的形式。。

另外程序写的还是有挺多问题的,包括甚至不能计算展开多项式的乘积。。
上面的程序输出的结果是
```
Polynomial before simplification:
3 * pow(p, 2) * pow(q, 1) + 5 * pow(p, 2) * pow(q, 1) + 2 * pow(p, 1) * pow(q, 1)
Polynomial after simplification:
8 * pow(p, 2) * pow(q, 1) + 2 * pow(p, 1) * pow(q, 1)
```
@ipwx 我试了一下,大概是下面的形式
```
#include <iostream>
using namespace std;

#include <string>
#include <vector>

class Mono {
public:
int coefficient;
char variable1;
int power1;
char variable2;
int power2;

Mono(int a, char p, int n = 0, char q = '1', int m = 0) : coefficient(a), variable1(p), power1(n), variable2(q), power2(m) {}

bool isSameTerm(const Mono & other) {
return(variable1 == other.variable1 && power1 == other.power1 && variable2 == other.variable2 && power2 == other.power2);
}

};

Mono operator * (int coef, const Mono & mono) {
return Mono(coef * mono.coefficient, mono.variable1, mono.power1, mono.variable2, mono.power2);
}

Mono operator * (const Mono & lhs, const Mono & rhs) {
if (lhs.variable2 == '1' && rhs.variable2 == '1') {
return Mono(lhs.coefficient * rhs.coefficient, lhs.variable1, lhs.power1, rhs.variable1, rhs.power1);
}
else if (lhs.variable1 == rhs.variable1 && lhs.variable2 == '1') {
if (rhs.variable2 == '1') {
return Mono(lhs.coefficient * rhs.coefficient, lhs.variable1, lhs.power1 + rhs.power1);
}
return Mono(lhs.coefficient * rhs.coefficient, lhs.variable1, lhs.power1 + rhs.power1, lhs.variable2, lhs.power2);
}
else if (lhs.variable1 == rhs.variable1 && rhs.variable2 == '1') { // We do not need consider the case when the second variable of lhs is '1', which was already contained in the last case.
return Mono(lhs.coefficient * rhs.coefficient, lhs.variable1, lhs.power1 + rhs.power1, rhs.variable2, rhs.power2);
}
else if (lhs.variable1 == rhs.variable1 && lhs.variable2 == rhs.variable2) {
return Mono(lhs.coefficient * rhs.coefficient, lhs.variable1, lhs.power1 + rhs.power1, lhs.variable2, lhs.power2 + rhs.power2);
}
else if (lhs.variable1 == rhs.variable2 && lhs.variable2 == rhs.variable1) {
return Mono(lhs.coefficient * rhs.coefficient, lhs.variable1, lhs.power1 + rhs.power2, lhs.variable2, lhs.power2 + rhs.power1);
}
throw -1;
}

Mono pow(char variable, int power) {
return Mono(1, variable, power);
}

class Poly {
friend ostream & operator << (ostream & os, const Poly & poly);
private:
vector<Mono> terms;

public:
Poly & addTerm(const Mono & term) {
terms.push_back(term);
return * this;
}

Poly & operator + (const Mono & term) {
addTerm(term);
return * this;
}

void simplify() {
for (size_t i = 0; i < terms.size(); i++) {
for (size_t j = i + 1; j < terms.size(); j++) {
if (terms[i].isSameTerm(terms[j])) {
terms[i].coefficient = terms[i].coefficient + terms[j].coefficient;
terms.erase(terms.begin() + j);
j--;
}
}
}
}
};

ostream & operator << (ostream & os, const Poly & poly) {
for (size_t i = 0; i < poly.terms.size(); i++) {
const auto & term = poly.terms[i];
if (term.coefficient != 0) {
if (term.power1 == 0 && term.power2 == 0) {
os << term.coefficient;
}
else if (term.power1 == 0) {
os << term.coefficient << " * pow(" << term.variable2 << ", " << term.power2 << ")";
}
else if (term.power2 == 0) {
os << term.coefficient << " * pow(" << term.variable1 << ", " << term.power1 << ")";
}
else {
os << term.coefficient << " * pow(" << term.variable1 << ", " << term.power1 << ") * " << "pow(" << term.variable2 << ", " << term.power2 << ")";
}
if (i < poly.terms.size() - 1) {
os << " + ";
}
}
}
return os;
}

int main() {
try {
Poly poly;
poly = poly + (3 * pow('p', 2) * pow('q', 1)) + (5 * pow('p', 2) * pow('q', 1)) + (2 * pow('p', 1) * pow('q', 1));
cout << "Polynomial before simplification:\n" << poly << endl;

poly.simplify();
cout << "Polynomial after simplification:\n" << poly << endl;
}

catch(int err0) {
cout << "You must input polynomials of two variables with aligned variables for multiplication!" << endl;
cout << "Error number: " << err0 << endl;
}
return 0;
}
```
问题是我这样写就必须这样定义一个多项式
```
Poly poly;
poly = poly + (3 * pow('p', 2) * pow('q', 1)) + (5 * pow('p', 2) * pow('q', 1)) + (2 * pow('p', 1) * pow('q', 1));
```
还有就是无法区分 pow(p, n) * pow(q, m) 和 pow(q, m) * pow(p, n) 这两种形式(除非我指定两个 char 的顺序);不过第二个问题就是我一开始想要的对于非交换的多项式的计算。。(然后我期待可以计算两个多项式的对易子,最后计算得到关于 p q 的对易子的一个多项式)
@yanqiyu

>> 特别是如果我把 getValidInput 函数的这个判断给注释掉的话,那么在我输入 "2" 使用 "显示联系人" 这个功能时,需要再输入一个回车才会显示 "请按回车键继续" 的字符

> cin.ignore(numeric_limits<streamsize>::max(), '\n'); 会一直等输入(堵塞)直到遇到回车,要是缓冲区里面没有回车的话。

这个地方为什么它在 case 1 和 case 2 的时候行为不一致呢?是因为我在使用 case 2 的 showPerson 函数里面没有任何输入所以需要我先输入一个回车吗?然后我加入的 cin.eof() 的判断就相当于把 cin.ignore 这一行给注释掉了所以在我一开始选择 case 的 getValidInput 里就会把我最初输入的 1 或者 2 给保留下来,然后 case 2 里的 pause 就不再需要我再输入一个换行符了,大概是这个原因?
@sagaxu 这个方法不错,感谢
1  2  3  
关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     3026 人在线   最高记录 6679       Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 20ms UTC 11:51 PVG 19:51 LAX 04:51 JFK 07:51
Do have faith in what you're doing.
ubao snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86