Just manually copy /lib/terminfo/r/rxvt-unicode-256color
to
$HOME/miniconda3/share/terminfo/r/
, and also to
$HOME/miniconda3/envs/YOUR_ENVS_NAME/share/terminfo/r/
.
将文档局部变量 fill-column
设置为一个非常大的值,例如 999999999
,然后
revert-buffer
,然后在对应的段落 fill-paragraph
,即可。
可以直接使用 https://github.com/gdbinit/Gdbinit ,将其命名为 .gdbinit
,并且新建文件 .gdbinit.local
。文件 .gdbinit.local
中的配置将会覆盖 .gdbinit
中的配置。下面是我的配置:
set $SHOWCPUREGISTERS = 0
set $SHOW_CONTEXT = 0
set history size unlimited
set history remove-duplicates unlimited
# Cause GDB to print structures in an indented format with one member per line
set print pretty on
通常来说这是无法办到的,参见 这个 issue 。然而,可以按照 这个回答 对 GDB 做下小改动,参见项目 gdb_fzf_patch 。
mkdir gdb-with-fzf
cd gdb-with-fzf
# clone
git clone https://github.com/filipkilibarda/gdb_fzf_patch
# download gdb
aria2c https://ftp.gnu.org/gnu/gdb/gdb-10.2.tar.xz
tar xvf gdb-10.2.tar.xz
cd gdb-10.2/
git init
git add .
git commit -m "first commit"
# apply the patch
git apply ../gdb_fzf_patch/gdb.patch
git add .
git commit -m "fzf patch"
# build gdb
mkdir build
cd build
../configure --with-python=$(which python) --enable-targets=all
make -j $(nproc)
sudo make install
该问题来源于 https://stackoverflow.com/a/31804225 。
- 打开一个终端(该终端用于输出被调试程序的输出),执行
tty
命令:
$ tty
/dev/pts/0
- 打开另一个终端并进入
GDB
,然后输入:
(gdb) tty /dev/pts/0
(gdb) run
If a program says
int *array = (int *) malloc (len * sizeof (int));
you can print the contents of array
with
(gdb) p *array@len
以上来自 官方文档 ,但是在用 github.com/gdbinit/Gdbinit 这个配置时,需要注意 @
后面的指针长度默认是十六进制,例如若我们想打印长度为 10 的数组,下面的代码:
(gdb) p *array @ 10
会打印出 16 个元素。正确的代码应该是:
(gdb) p *array @ 0x10
或者,
(gdb) p/d *array @ 10
我发现一个大概是微软文档库中的一个很有用的表格, 无符号整型向其他类型的转换汇总:
From | To | Method |
---|---|---|
=unsigned char= | =char= | Preserve bit pattern; high-order bit becomes sign bit |
=unsigned char= | =short= | Zero-extend |
=unsigned char= | =long= | Zero-extend |
=unsigned char= | =long long= | Zero-extend |
=unsigned char= | =unsigned short= | Zero-extend |
=unsigned char= | =unsigned long= | Zero-extend |
=unsigned char= | =unsigned long long= | Zero-extend |
=unsigned char= | =float= | Convert to =long=; convert =long= to =float= |
=unsigned char= | =double= | Convert to =long=; convert =long= to =double= |
=unsigned char= | =long double= | Convert to =long=; convert =long= to =double= |
=unsigned short= | =char= | Preserve low-order byte |
=unsigned short= | =short= | Preserve bit pattern; high-order bit becomes sign bit |
=unsigned short= | =long= | Zero-extend |
=unsigned short= | =long long= | Zero-extend |
=unsigned short= | =unsigned char= | Preserve low-order byte |
=unsigned short= | =unsigned long= | Zero-extend |
=unsigned short= | =unsigned long long= | Zero-extend |
=unsigned short= | =float= | Convert to =long=; convert =long= to =float= |
=unsigned short= | =double= | Convert to =long=; convert =long= to =double= |
=unsigned short= | =long double= | Convert to =long=; convert =long= to =double= |
=unsigned long= | =char= | Preserve low-order byte |
=unsigned long= | =short= | Preserve low-order word |
=unsigned long= | =long= | Preserve bit pattern; high-order bit becomes sign bit |
=unsigned long= | =long long= | Zero-extend |
=unsigned long= | =unsigned char= | Preserve low-order byte |
=unsigned long= | =unsigned short= | Preserve low-order word |
=unsigned long= | =unsigned long long= | Zero-extend |
=unsigned long= | =float= | Convert to =long=; convert =long= to =float= |
=unsigned long= | =double= | Convert directly to =double= |
=unsigned long= | =long double= | Convert to =long=; convert =long= to =double= |
=unsigned long long= | =char= | Preserve low-order byte |
=unsigned long long= | =short= | Preserve low-order word |
=unsigned long long= | =long= | Preserve low-order dword |
=unsigned long long= | =long long= | Preserve bit pattern; high-order bit becomes sign bit |
=unsigned long long= | =unsigned char= | Preserve low-order byte |
=unsigned long long= | =unsigned short= | Preserve low-order word |
=unsigned long long= | =unsigned long= | Preserve low-order dword |
=unsigned long long= | =float= | Convert to =long=; convert =long= to =float= |
=unsigned long long= | =double= | Convert directly to =double= |
=unsigned long long= | =long double= | Convert to =long=; convert =long= to =double= |
首先可以使用 xinput list
查看设备名称:
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ ELAN067B:00 04F3:31F8 Mouse id=9 [slave pointer (2)]
⎜ ↳ ELAN067B:00 04F3:31F8 Touchpad id=10 [slave pointer (2)]
⎜ ↳ TPPS/2 Elan TrackPoint id=14 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Video Bus id=6 [slave keyboard (3)]
↳ Power Button id=7 [slave keyboard (3)]
↳ Sleep Button id=8 [slave keyboard (3)]
↳ Intel HID events id=12 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=13 [slave keyboard (3)]
↳ ThinkPad Extra Buttons id=15 [slave keyboard (3)]
↳ sof-hda-dsp Headphone id=11 [slave keyboard (3)]
然后:
xinput disable "ELAN067B:00 04F3:31F8 Touchpad"
xinput disable "TPPS/2 Elan TrackPoint"
也可以将笔记本电脑的键盘关闭:
xinput float 13
其中 13
是 AT Translated Set 2 keyboard
的 ID。
重新开启:
xinput reattach 13 3
例如我想禁用无线网卡,则首先用 lspci | grep -i wifi
查询其 PCI 地址:
00:14.3 Network controller: Intel Corporation Alder Lake-P PCH CNVi WiFi (rev 01)
然后编写 udev rules
文件:
ACTION=="add", KERNEL=="0000:00:14.3", SUBSYSTEM=="pci", RUN+="/bin/sh -c 'echo 1 > /sys/bus/pci/devices/0000:00:14.3/remove'"
将其命名为 /etc/udev/rules.d/10-wireless-card.rules
即可。
sudo arp-scan -I wlan0 -l
apt install samba
[global]
server min protocol = NT1
workgroup = WORKGROUP
security = user
[shared_folder]
path = /data/data/com.termux/files/home/public
public = yes
writable = yes
guest ok = yes
smbd -p 34172 -D
- Examples of interesting false proofs
- Mathematical games interesting to both you and a 5+-year-old child
- Why do bees create hexagonal cells ? (Mathematical reasons)
- Why doesn’t mathematics collapse even though humans quite often make mistakes in their proofs?
- What is convolution intuitively?
- Applications of the Chinese remainder theorem
- What are “perfectoid spaces”?
- Ideas for introducing Galois theory to advanced high school students
- Geometric interpretation of trace
- Applications of the Chinese remainder theorem
- Magic trick based on deep mathematics
- What mathematical problems can be attacked using DeepMind’s recent mathematical breakthroughs?
- What are the benefits of writing vector inner products as ⟨u,v⟩ as opposed to uTv?
- Thinking and Explaining
- Which popular games are the most mathematical?