我懒
1 | pandoc '.\word.docx' -o |
--extract-media
参数设置导出媒体文件(如图片)夹的路径, 不设置不导出
我懒
1 | pandoc '.\word.docx' -o |
--extract-media
参数设置导出媒体文件(如图片)夹的路径, 不设置不导出
int 2 string
网上一般查到会说用itoa
函数,
1 | #include <stdlib.h> |
像菜鸟教程都这样教, 不过itoa
不是基础库函数而且不符合C99标准, 编译时候直接报警
1 | main.c:13:13: warning: implicit declaration of function 'itoa' is invalid in C99 [-Wimplicit-function-declaration] |
后面找到用sprintf
1 | #include<stdio.h> |
不过遇到比较长的整型时候, 发现疑似溢出的情况(像这个负号)
1 | 3362695274 // 输入 |
其实是整型应该从int
换成long
, 然后就正常了
1 | int main() |
参考:
以后都用ssh来git
设置git的用户名和邮箱
一般考虑用来管理github的仓库, 所以这里的用户名和邮件都建议设置成github账号对应的
1 | git config --global user.name "username" |
有则备份, 无则跳过
先到.ssh
文件夹下面看看有没有已经生成的ssh key, 有的话要么直接拿来用, 要么以防万一备个份再重新生成ssh key(覆盖旧文件)
~/.ssh
C:/User/username/.ssh
生成 SSH Key
没错你又要再打一次邮箱地址
1 | ssh-keygen -t rsa -C "example@gmail.com" |
然后连按三次回车, 密码为空就好了, 没事的. 看到一个奇怪的图形后说明OK了
测试github
1 | ssh git@github.com |
输入yes
, 你的电脑就认识github.com
了, 也应该说明ssh没问题了
到https://github.com/settings/keys点new SSH Key
, 复制.ssh/rsa_id.pub
下的全文黏贴进去, 起个好点的名字, 保存.
have to admit that WSL is not befect.
General tutorial always bring up ERROR:
1 | $ service mysql start |
Luckily, I found an issue in WSL Github:(a bit modified)
1.Remove MySQL 8.x:
1 | sudo apt-get purge mysql-server mysql-client |
2.Change to MySQL 5.x candidate:
get download url from https://dev.mysql.com/downloads/file/?id=487007 or download the .deb
directly
1 | wget https://dev.mysql.com/get/mysql-apt-config_0.8.13-1_all.deb |
3.Double check current apt policy of MySQL is 5.x:
1 | sudo apt policy mysql-server (it will show 5.x is the default candidate) |
4.Install MySQL 5.x
1 | sudo apt-get -y install mysql-server |
5.Change to MySQL 8.x candidate
1 | sudo dpkg -i mysql-apt-config_0.8.13-1_all.deb (select 8.x) |
however, I still find that the candidate is 5.x.
1 | $ sudo apt policy mysql-server |
Continue the tutorial and I found out that it will download 8.x after all, so just go ahead!
6.Install MySQL 8.x
1 | sudo apt-get -y install mysql-server |
search for a line “. /usr/share/mysql/mysql-helpers” and change it to
“. /usr/share/mysql-8.0/mysql-helpers”
7.Upgrade system tables to MySQL 8.x
1 | sudo service mysql start #(this should start without error) |
then enjoy your MySQL.
regex
多行匹配用单行模式
1 | longtables = re.findall(r"\\begin{longtable}.*?\\end{longtable}", tex_raw, flags=re.DOTALL) # 单行模式 |