教程

2019

Matplotlib in Virtualenv

我使用的是 macOS 系统。当在虚拟环境中尝试使用 matplotlib 时,会出现如下的报错:

1
ImportError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more informatio
May 16
Hexo+Next: 使用 Latex 公式

这次更换主题的很大一个动因就是因为在 NexT 这个主题上,开启 Latex 的支持很方便。网上关于这方面的文章其实不少,但是大部分都不全面,照本宣科下来,很可能不能用。这些教程一般就给了_config.yml文件的配置以及pandoc依赖安装,但是一些关键细节缺失了。这篇文章里我梳理了一下整个流程。

Apr 24
Universal(Fat) Framework for Swift Projects
Cocoa Touch Framework

最近在给朋友做一个项目,要求将涉及到的算法内容整理成一个单独的 framework,这样可以隐藏算法细节,方便交付。这个需求可以很容易地通过Cocoa Touch Framework实现。不过在交付的时候存在一个头疼的问题:默认情况下,Xcode 在编译 Cocoa Touch Framework 时只会编译出支持模拟器或者真机的 Framework,而无法编译出同时支持模拟器和真机的 Framework,即 Universal(Fat) Framework。这一需求还需要进一步地利用一些系统脚本来实现。

Apr 03