numpy多项式

定义一个多项式: \(p = x^2 + 2x + 1\)

import numpy as np
p = np.poly1d([1, 2, 1])

运算,设有两个多项式: \(p_1 = (x^2 + 2x + 1), p_2 = (2x^2 - x +3 )\)

>>> p1 = np.poly1d([1, 2, 1])
>>> p2 = np.poly1d([2, -1, 3])
>>> p1+p2
poly1d([3, 1, 4])
>>> p1-p2
poly1d([-1 ...
more ...

在latex中使用中文

如果要使用中文需要用xelatex包,编译时用xelatex来生成pdf

\documentclass{aritcle}
\usepackage{xeCJK}
\setCJKmainfont{Microsoft YaHei}
\begin{document}
中文
\end{document}

如果配合sphinx使用,可以修该conf.py中latex_elemments部分 在preamble中添加上xeCJK包

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
'pointsize': '12pt',

# Additional stuff for the LaTeX preamble.
'preamble': """\usepackage{xeCJK}
\setCJKmainfont{Microsoft YaHei}""",
# Latex figure ...
more ...

"git"

  • cancal add before commit
git reset .
  • Store http usname and password
git config --global credential.helper cache
git config --global credential.helper store
  • set http proxy
git config global http.proxy http://user:pwd@proxy_addr:port
more ...

"svn"

revert subversion repository

  • Check out a nice clean working copy.

  • Merge (backwards) changes.

svn merge -r100:70 http://repo.com/my/project/trunk
  • Check sanity. Is your working copy exactly what you wanted? If so:
    svn commit -m "rolled back to the good old days of r70

create subversion server ...

more ...