Hanjie's Blog

一只有理想的羊驼

设函数\(u = u(x)\)\(v = v(x)\)具有连续导数, 那么:

\[\begin{aligned} (uv)' &= u'v + uv' \newline u'v &= (uv)' - uv' \end{aligned}\]

对这个等式两边求不定积分,得:

\[\begin{equation} \label{e1} \int {uv'dx} = uv - \int {u'vdx} \end{equation}\]

式(\(\ref{e1}\))称为分部积分公式。 式(\(\ref{e1}\))还可表述成如下形式:

\[\begin{equation} \label{e2} \int {udv} = uv - \int {vdu} \end{equation}\]

它的作用是:若求\(\int {uv'dx}\)有困难,而求\(\int {u'vdx}\)较容易时,可采用分部积分公式。分部积分法是数学上常用的一种方法 — 转化法的具体运用1

【例1】求\(\int {x\cos xdx}\) 设:

\[\begin{aligned} u &= x \newline dv &= \cos xdx \newline du &= dx \newline v &= \sin x \newline \end{aligned}\]

可得: \[\int {x\cos xdx} = x\sin x - \int {\sin xdx} = x\sin x + \cos x + C\]


  1. http://sxyd.sdut.edu.cn/gaoshu1/lesson/4.3%20%20fenbujifen.htm↩︎

显示资源库~/Library文件夹

打开Finder,先按shift-command-H,再按command-J,在弹窗口中选取“显示资源库文件夹”1

Bash profile 设置

Mac OS的 默认PATH为/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin2。我们想让Homebrew安装的软件优先级大于系统默认安装的软件(如Python)。在Terminal打开:

1
vim ~/.bash_profile

并且添加:

1
2
3
4
5
6
# Set architecture flags
export ARCHFLAGS="-arch x86_64"
# Ensure user-installed binaries take precedence
export PATH=/usr/local/bin:$PATH
# Load .bashrc if it exists
test -f ~/.bashrc && source ~/.bashrc

第一句的作用是让编译器知道系统是64位的。然后执行下面一句让配置生效:

1
source ~/.bash_profile

安装proxychains-ng

在使用brew update时,发现速度十分慢,于是可以尝试使用ProxyChains-NG3,官方说明:

proxychains ng (new generation) - a preloader which hooks calls to sockets in dynamically linked programs and redirects it through one or more socks/http proxies. continuation of the unmaintained proxychains project.

使用Homebrew安装(如果是10.11,要先关闭SIP),并配置:

1
2
brew install proxychains-n
vim /usr/local/etc/proxychains.conf

在末尾,删掉socks4的那一条目(重要),并且根据实际添加代理:

1
socks5  127.0.0.1 1080

然后就可以通过在命令面前添加proxychains4使用代理了,如:

1
2
proxychains4 brew update
proxychains4 brew upgrade

安装Python及库

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
brew tap homebrew/science

brew install python

pip install virtualenv

pip install numpy

pip install cython
brew install gcc

pip install scipy
pip install matplotlib

brew install opencv3 --with-contrib --with-ffmpeg --with-tbb --with-libdc1394 --without-tests

echo /usr/local/opt/opencv3/lib/python2.7/site-packages >> /usr/local/lib/python2.7/site-packages/opencv3.pth

  1. https://hackercodex.com/guide/mac-osx-mavericks-10.9-configuration/↩︎

  2. https://hackercodex.com/guide/mac-osx-mavericks-10.9-configuration/↩︎

  3. http://huifeng.me/2015/08/23/ProxyChains-NG-4-OSX-Setting/↩︎

隐藏文件

1
chflags hidden filename

显示文件

1
chflags nohidden filename

文件链接

1
ln -s /path/to/desired-folder ~/Dropbox/desired-folder
0%