regular expressions cheatsheet

Regular Expressions Matching Table metacharacter matching things \d \D matching all the digits(0 to 9), matching any non-digit character .(dot) matching any single character(letter, digit, whitespace, everything) [] matching a single letter inside [](square brackets) [^] matching any single character except for the letters inside [](square brackets) with the ^(hat) [-] [^-] indicating a character range to match a single character \w \W this is equivalent to the character range [A-Za-z0-9_], matching any non-alphanumeric character {} to match repetition of character * + to match either 0 or more or 1 or more of the character that it follows(it always follows a character or group) ?...

Linux_Little_Tricks

Linux Little Tricks data model LLP64 and LP64 搜索引擎小技巧 cats and dogs Result about cats or dogs "cats and dogs" Result about exact term “cats and dogs” cats -dogs Fewer dogs in result cats +dogs More dogs in result cats filetype:pdf PDFs about cats Supported types: pdf, doc(x), xls(x), ppt(x), html * 模糊 .... 范围 intitle:标题 inurl:网址 related:相关类型 define:word etymology:"word," joker site:drive.google.com Proxy Browser: SwitchyOmega gfwlist: https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt Terminal Proxy CapsLock -> Ctrl X11 xev 展示按下按键的信息 pacman -S xorg-xmodmap: xmodmap xmodmap -pke xmodmap -pke > ~/....

ArchLinux_Installation

一. Basic Install 制作启动盘 1. 系统启动方式 输入 ls /sys/firmware/efi/efivars 查看系统的启动方式 如果有输出,则为UEFI启动 2. 网络连接 ip link 查看网卡的名称等信息 有线网络 使用 dhcpcd 进行有线网络连接, 和激活无限网络dhcp功能 无线网络 使用 rfkill(Radio Frequency Kill) 检查 wifi 是否被禁用 $ rfkill list 0: phy0: Wireless LAN Soft blocked: yes // yes 为禁用, no 为未禁用(软件禁用) Hard blocked: yes // yes 为禁用, no 为未禁用(硬件禁用) 如果被禁用使用 rfkill unblock wifi 取消禁用 使用 iwctl 进行无线网络连接 iwctl$ help iwctl$ device list iwctl$ station device(name) scan iwctl$ station device(name) get-networks iwctl$ station device(name) connect SSID(name) 使用 ping archlinux....

常数变易法(微分方程求解)

1. 常数变易法求解一阶线性微分方程过程 对于一阶线性微分方程: $$ \frac{\mathrm{d}y}{\mathrm{d}x}+P(x)y=Q(x) \tag{1} $$ 如果$Q(x)=0$则方程为齐次, $Q(x)\ne0$则方程为非齐次. 而常数变易法的求解就是先求出齐次方程的通解 $$ \frac{\mathrm{d}y}{\mathrm{d}x}+P(x)y=0 \tag{2} $$ 该齐次方程的通解为$y=Ce^{-\int{P(x)\mathrm{d}x}}$ $(C=\pm e^{C_1})$ 然后使用$u(x)$(以后简写为$u$)替换该通解中的常数$C$, 即便换为: $$ y=ue^{-\int{P(x)\mathrm{d}x}} \tag{3} $$ 然后, 将(3)代入(1)中, 得: $$ u^{\prime}e^{-\int{P(x)}\mathrm{d}x}=Q(x) \tag{4} $$ 通过"分离变量"即可求出$u$: $$ u=\int{Q(x)e^{\int{P(x)\mathrm{d}x}}\mathrm{d}x}+C \tag{5} $$ 将(5)在带回到(3)中即可求出$y$: $$ y=Ce^{-\int{P(x)\mathrm{d}x}}+e^{-\int{P(x)\mathrm{d}x}}\int{Q(x)e^{\int{P(x)\mathrm{d}x}}\mathrm{d}x} $$ 于是, 便得到了(1)的通解, 观察可以发现, 前面为(1)对应的齐次方程的通解, 后面为当C=0是(1)的特解, 因此得到结论: 一阶非齐次线性方程的通解等于对应的齐次方程的通解与非齐次方程的一个特解之和. 但是问题就是 为什么可以使用非齐次方程对应的齐次方程的通解来进行求解?, 上面的方法一气呵成只是告诉了我们应该这样做, 但我们却不知道为什么这么做. 但我学的很蒙, 于是进行了一番搜索找到了一些好的文章, 打算自己总结一下, 相关文章都放在了参考处. 2. 原理探讨 通过《“常数变易法"的探讨》文章知道我们现在使用的常数变易法只是结论, 而非推导过程. 该结论是拉格朗日十一年的研究成果. 因此在此介绍一些该结论得出的过程. 首先, 对于求解一阶线性微分方程最先想到的方法就是"分离常量”, 于是首先对(1)进行移项操作得: $$ \mathrm{d}y=[Q(x)-P(x)y]\mathrm{d}x $$ 观察怎样都无法将y单独移动到左边, 因此分离常量的方法不可以求解此方程. 于是想到使用$u=\frac{y}{x}$的方法进行求解得到: $$ u\prime{}x+u(1+P(x)x)=Q(x) $$...

C 语言函数调用和VLA和alloca栈的变化探讨

NOTE: 以下讨论使用的平台为 x86-64,使用的编译器为 gcc,以下提供的伪汇编码 采用 intel 格式。 文章中提到的代码,可以在 Code 找到。 一些重要的寄存器和指令 函数调用过程中,比较重要的寄存器主要有三个 rip rbp rsp。 rip 寄存器存放的为下一条要执行指令的地址,Instruction Pointer。 rbp 为基寄存器,存放的为前一个 rbp 的值,Base Pointer。 rsp 为栈寄存器,一直指向函数调用栈的底部,Stack Pointer。 比较重要的指令有 call push pop leave ret。 call addr 指令会首先将 call 返回之后要执行的地址压入栈中(返回地址),设置 rip 的值为 addr,然后跳转的这个位置去执行,大致可以等效于一下指令。 # 假设当执行到 call 指令时 CPU 就会自动设置 rip 寄存器为下一条要执行的指令 push rip mov rip, addr # 按理设置了 rip 寄存器,CPU 就会去执行 rip 地址的指令,这里写 jmp 只是想要更清晰的表示 call 的流程 jmp addr push rbp 指令会将 rsp 寄存器下移一个 word 的长度,rbp 中的内容移动到 rsp 寄存器所指向的地址中。...