WordPress备忘录

url自动生成链接,主题的functions.php中添加下面的代码即可:

1
add_filter('the_content', 'make_clickable');

GeneratePress: 样式表 (style.css)

1
font-family: sans-serif,'宋体';

清理表空间

1
2
3
4
5
6
7
8
DELETE FROM wp_posts WHERE post_type = 'revision';
DELETE FROM wp_postmeta WHERE meta_key = '_edit_lock';
DELETE FROM wp_postmeta WHERE meta_key = '_edit_last';
DELETE FROM wp_postmeta WHERE meta_key = '_wp_old_slug';
DELETE FROM wp_postmeta WHERE meta_key = '_revision-control';
DELETE FROM wp_postmeta WHERE meta_value = '{{unknown}}';
OPTIMIZE TABLE wp_postmeta;
OPTIMIZE TABLE wp_posts;

常用插件

1
2
3
4
5
6
7
8
9
Blackout: Dark Mode Widget	Adds a toggle widget to your website that activates dark mode on click.
Protection against DDoS		Protection against DDoS.
Quotmarks Replacer		Quotmarks Replacer disables wptexturize function that keeps all quotation marks and suspension points in half-width form.
WordPress 导入工具		从 WordPress 导出文件中导入日志、页面、评论、自定义字段、分类、标签或更多内容。
WP-Syntax			Syntax highlighting using GeSHi supporting a wide range of popular languages.
代码美化器			本插件使用Google代码美化器将文章中的代码片段以语法高亮显示。
经典编辑器			启用WordPress经典编辑器和旧式的编辑文章页面,包括TinyMCE、Meta Boxes等。支持扩展此页面的旧插件。
2em				add "text-indent:2em" support to editor.
WP Statistics			此插件为您提供有关网站访问者的完整信息。

refer to:
https://www.wpdaxue.com/wordpress-make-clickable.html
https://www.fujieace.com/wordpress/revisions.html
https://www.91wordpress.com/1963.html
https://blog.csdn.net/weixin_30958745/article/details/113611053

VMWare磁盘读写提速

VMWare不生成vmem文件的方法是在.vmx文件中增加两行:

1
2
sched.mem.pshare.enable = "FALSE"
mainMem.useNamedFile = "FALSE"

refer to:
https://blog.csdn.net/shanzhizi/article/details/8293638
http://www.360doc.com/content/15/1120/11/73007_514517328.shtml
http://www.guyiren.com/archives/3210
https://blog.csdn.net/mnmnwq/article/details/79557305
https://blog.51cto.com/kitzk/553493
https://segmentfault.com/q/1010000002954977
https://bbs.kafan.cn/thread-1355085-1-1.html

found no \bibdata command

在CTeX套件的WinEdt编辑器里点击BibTeX按钮后,出现错误:

1
2
I found no \bibdata command---while reading file test.aux
I found no \bibstyle command---while reading file test.aux

有一种原因为.bib文件未保存,因为WinEdt是不会自动保存的,即使点了PDFTexify按钮也不会保存,需要先保存.bib文件再点BibTeX按钮,就不会出现这个错误了。

正确写法参见:
CTeX例子

CTeX例子

test.tex

1
2
3
4
5
6
7
8
\documentclass{article}
\usepackage{ctex}
\usepackage{cite}
\begin{document}
Hello every one!\cite{articleA}大家还好么?
\bibliographystyle{plain}
\bibliography{refs}
\end{document}

refs.bib

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
@ARTICLE{articleA,
author = {Mr.Woodman},
title = {Woodman's Trueman},
journal = {IEEE magzine},
year = {11},
volume = {2(3)},
pages = {4-42},
owner = {trueman},
timestamp = {02}
}
 
@Inbook{Book1,
author="Mrs.Woodman",
editor="Editor Woodman",
title="Woman",
bookTitle="Woodman's woman",
year="1992",
publisher="Woodman House",
address="New York St.1",
pages="33--25",
isbn="111-222-1",
doi="10.1011/111-11-111-1111-1_11",
url="http://url.org/index.html"
}

Premiere编辑时没有声音

编辑视频时没有声音的原因有很多种,我这里会到情况是由于启动Pr时提示过错误消息框:

1
2
3
无法应用设备设置,因为发生了以下错误:
 
MME 设备内部错误。

解决方法:
点击菜单->编辑->首选项->音频硬件,弹出对话框中,默认输入选择“无输入”,点“确定”保存,退出Pr再重启。

我这样操作后,再编辑视频时就有声音响应了。

Android Studio调试时apk中的lib文件夹不见了

现象:
Build -> Make Project生成的apk包中含lib文件夹及里面的.so动态库,而点击IDE中的Debug按钮后发现生成的apk包中lib文件夹及.so库都没了。

解决方法:
在右上角“Make Project(Ctrl + F9)”图标的右边下拉框中点击“Edit Configurations...”,在“Run/Debug Configurations”对话框中,选择app -> General -> Installation Options -> Deploy下拉框的“APK from app bundle”,并点击OK保存。这样点击IDE中的Debug按钮后,传到设备中进行交互调试的apk中也会包含进lib内容。

禁止RestartByRestartManager

有时候很烦人,程序跑着跑着就重启了,这并不是因为程序崩了,而是在新版的visual studio中对MFC程序默认增加了一个功能:程序自动重启。要禁用它,只须在程序最开始继承自CWinApp的类的构造函数中将下面一句话注释掉:

1
2
	// support Restart Manager
	//m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;

need to install the Win32::Console module

ActivePerl-5.26.3.XXXX.msi安装后,命令行执行cpan,会出现如下提示而无法继续。

Can't locate Win32/Console.pm in @INC (need to install the Win32::Console module) (@INC contains: C:\Perl64\site\lib C:\Perl64\lib) at C:\Perl64\lib/ActivePerl/Config.pm line 400.

解决办法,修改C:\Perl64\lib\ActivePerl\Config.pm,大约在400行左右:

392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
# Prevent calling Win32::Console::DESTROY on a STDOUT handle
#my $console;
sub _warn {
#    my($msg) = @_;
#    unless (-t STDOUT) {
#	print "\n$msg\n";
#	return;
#    }
#    require Win32::Console;
#    unless ($console) {
#	$console = Win32::Console->new(Win32::Console::STD_OUTPUT_HANDLE());
#    }
#    my($col,undef) = $console->Size;
#    print "\n";
#    my $attr = $console->Attr;
#    $console->Attr($Win32::Console::FG_RED | $Win32::Console::BG_WHITE);
#    for (split(/\n/, "$msg")) {
#	$_ .= " " while length() < $col-1;
#	print "$_\n";
#    }
#    $console->Attr($attr);
#    print "\n";
}

qt5.6编译后运行designer

直接双击运行bin/designer.exe会报如下错误:

This application failed to start because it could not find or load the Qt platform plugin "windows" in ...

解决办法是,在bin目录中新建qt.conf文件,其内容如下:

1
2
[Paths]
Prefix=d:/qt5.6.1.x64/

其中d:/qt5.6.1.x64/是根目录,该目录直接下面是bin目录及plugins目录。同时要注意这里的路径字符串中是Linux下的斜杠,不是Windows的反斜杠。