set up nikola for markdown

to use nikola you need to install it with some other packages as well pip instal nikola markdown ws4py watchdog then to enable markdown, you need to change the conf.py variable POSTS and PAGES POSTS = ( ("posts/*.md", "posts", "post.tmpl"), ("posts/*.rst", "posts", "post.tmpl"), ("posts/*.txt", "posts", "post.tmpl"), ("posts/*.html", "posts", "post.tmpl"), ) PAGES = ( ("pages/*.md", "pages", "story.tmpl"), ("pages/*.rst", "pages", "story.tmpl"), ("pages/*.txt", "pages", "story.tmpl"), ("pages/*.html", "pages", "story.tmpl"), ) you may also need to change the github settings for easy github deploy...

February 9, 2017 · 1 min · Shelper

how to start python project on github

steps are: install cookiecutter: python -m pip install cookiecutter run cookiecutter to initiate a project: cookiecutter('https://github.com/audreyr/cookiecutter-pypackage.git') under the project folder on github, start a new repo python_prj run git init in the local project folder and commit run git remote add origin git@github.com:username/projectname.git using git@git requires to setup the ssh key pair, this can be found by easily google it or under FAQ of github run git push -u origin master...

June 14, 2016 · 1 min · Shelper

elisp notes

quote for symbols: (setq symbol) ;; is equivelent to (set 'symbol) the quote means; keep as it is, dont try to evaluate, so if no quote, the lisp processor will try to evaluate it, means the symbol (or the first element of the list) has to be evaluatable as either a function, or a defined variable let vs. let*: (setq y 2) (let ((y 1) (z y)) (list y z)) ⇒ (1 2) (setq y 2) (let* ((y 1) (z y)) (list y z)) ⇒ (1 1) let* binds 1 to y immediately, while let evaluate old y as 2, then list binds 1 to the new y and pring it out...

June 13, 2016 · 1 min · Shelper

install pyqt on mac for matplotlib

so i was trying to use matplotlib for fast image ploting and updating, and I found a post here. the matplotlib uses different backend to render the images, and due to the differences between different backend, some functions are only available for specific backend, for instance, the fig.canvas.update() is a fast way to render new images to the axes, but is only availabe to PyQt4. so i was trying to install pyqt4 using homebrew, it failed by saying the osx version is pre-released version and is not supported, and arises 2 errors during make process....

June 13, 2016 · 2 min · Shelper

matplotlib backend issue

using different backends for matplotlib might cause some unexpected issues: today, i am trying to run a program that uses the following function: plt.figure() figManager = plt.get_current_fig_manager() figManager.window.showMaximized() however, i found when using the backend of Tk, it gives error, saying get_current_fig_manager is not available, so when i switch to qt4egg, everything works well. how to switch the backend for matplotlib? first find the configure directory for matplotlib on your computer...

June 13, 2016 · 2 min · Shelper