Mac上使用latex浙大论文模版

1.编译选项

首先是简单问题,就是指定下用xelatex编译,不然会用pdflatex

在main.tex第一行添加

1
%!TEX program = xelatex

2.字体问题

接下来主要问题还是字体问题,在csbachelor.cls中修改。
首先在58行左右设置全局字体的地方,将这一段改为

1
2
3
4
5
\RequirePackage[slantfont,boldfont]{xeCJK}
\setCJKmainfont[BoldFont=STHeiti,ItalicFont=STKaiti]{STSong}
\setCJKsansfont[BoldFont=STHeiti]{STXihei}
\setCJKmonofont{STFangsong}
\punctstyle{kaiming}

在114行左右设置一些family的地方,改为

1
2
3
4
5
6
7
8
\setCJKfamilyfont{FangSong}{STFangSong}
\setCJKfamilyfont{HeiTi}{STXihei}
\setCJKfamilyfont{KaiShu}{AR PL KaitiM GB}
\setCJKfamilyfont{LiShu}{LiSu}
\setCJKfamilyfont{SongTi}{STSong}
\setCJKfamilyfont{YouYuan}{YouYuan}
\setCJKfamilyfont{STFangsong}{STFangsong}
\setCJKfamilyfont{STXingkai}{STKaiti}

mac下好像没有xingkai的字体,也用楷体代替了,有的话可以补充告诉我。

EmbedJulia On mac

when I try embed Julia on mac following the docs on julialang.org, I failed to compile and execute.

right way:

  1. set JULIA_DIR=[your julia path]
1
JULIA_DIR=/Applications/Julia-0.3.7.app/Contents/Resources/julia/
  1. add more gcc option(rpath)
1
gcc -o emb -I$JULIA_DIR/include/julia -L$JULIA_DIR/lib/julia -Wl,-rpath,"$JULIA_DIR/lib/julia" -ljulia embjulia.c

3.exec

1
./emb

my powellD website

用powell直接法写了一个无约束的凸优化的在线程序,地址是

www.zyhwtc.com:3000/powell

MIPS汇编器(python)

闲来无事想写一个自己的mips汇编器方便下学期接口课使用,顺便就当熟悉下python和正则表达,但愿效果会好点+ +

在自己服务器上做git

之前一直没有在自己服务器上建git,以为很复杂。。。看了眼之后发现还挺简单,这样维护起来就方便多啦

  • 首先要建立一个bare的仓库
  • 建立一个工作区的文件夹,在仓库外
  • 在hooks/post-receive

    !/bin/sh
    GIT_WORK_TREE=~/mywebsit git checkout -f
    
  • 把本地内容push到该仓库中

接下来就能自动更新了!

hexo2.7.1

今天升级了2.7.1,结果跑不起来了。。跑出来的主页直接是一些代码,原来render模块被剥离了,需要独立安装

npm install hexo-renderer-ejs --save
npm install hexo-renderer-stylus --save
npm install hexo-renderer-marked --save

参考

《升级hexo》--黄云坤

http://www.huangyunkun.com/2014/06/18/update-hexo/

a little tip in python3(readline)[MAC]

when we try to type up,down,left,right in python3~,it doesn’t work,so what how to deal with it~?

just

easy_install readline

if you doesn’t get the easy_install,you should install it

sudo curl https://bootstrap.pypa.io/ez_setup.py -o - | python3

it will be python or python3~,depends on your config

(转)修正 Git 提交信息

转自

http://geeplanet.com/articles/git-commit-author-modified/

使用 Git 偶尔会由于更改自己的 ssh key 而忘记重新配置 user.name 和 user.email,所以会导致 Github 上面无法将这些 commit 识别为正确的 Github 用户。因此在查看 Graph 页面时,会发现自己的 contribute to master 为0!是不是心很痛,写了半天发现自己木有任何贡献。

据查到的资料显示,git filter-branch这个命令就可以很好地处理这个问题,在给出解决办法前,先确认一下问题的根本来源。可以使用git rev-list这个命令来查看详细的提交信息。

Trigger in mysql

做到sql-trigger的作业,老师给的例子是sql-server的例子,而我使用的是mysql,其中有较大区别。