- how to recover a file in previous commit The answer
- When a push failed because the others edit your remote repo The answer
众所周知,MATLAB长于矩阵运算,在使用矩阵进行运算时比普通的循环快得多,同时,不同的矩阵运算速度也会有不同。以下为实例:
>> clear all
>> a = rand(100000000, 1);
>> tic; a'*a; toc % 方法一,矩阵乘法
时间已过 0.054834 秒。
>> tic; a.*a; toc % 方法二,不包括求和
时间已过 0.211555 秒。
>> tic; sum(a.*a); toc % 方法二,包括求和
时间已过 0.447394 秒。
有时候你需要用多个相同尺寸的静态图片转换为一个gif文件,这个时候你需要使用的Python库是imageio
。
使用$ pip install imageio
可以安装。
使用static_images_to_gif.py
中的代码可以快速将具有相同命名特征的文件排序后组合成gif,你可以在理解其内容后作出相应更改才可运行。
同时新的问题出现了,如果我们想给每个图片添加不同的字体然后再做成gif呢? 这个时候还是要使用pillow
。前面iamgeio
已经安装了pillow
。详见combine_multiple_images_and_add_caption.py
。此处我们采用的方法新建一个空白的比原照片尺寸稍大的图片,添加文字之后在将原图粘贴上去。
参考:
- [Programmatically generate video or animated GIF in Python?][1]
- [Add caption to image using Pillow][2]
There're many posts about open setttings for Clash for Windows. But following solution actually help with the problem.
This solve the problem by simply adding a new firewall rule, which is the most efficient soluton..
$ gcc -o prog prog.c -lncurses
and $gcc -lncurses -o prog prog.c
behave differently. The latter one will fail according to the comment to his question and this entry in GCC doc.
It makes a difference where in the command you write this option; the linker searches and processes libraries and object files in the order they are specified. Thus, ‘foo.o -lz bar.o’ searches library ‘z’ after file foo.o but before bar.o. If bar.o refers to functions in ‘z’, those functions may not be loaded.