Post

Form a document by several files with each part Compliable by latex

In emacs, latex on February 8, 2012 by hoxide

This is a needs when I begin to write my thesis. Still didn’t write any thing yet :(

The macro file (bookmacro.tex):

\def\booksectionbegin{
\ifdefined\thebook
\empty
\else
\documentclass[12pt]{amsart}
\include{mypackage}
\include{mymacros}
\begin{document}
\fi
}
\def\booksectionend{
\ifdefined\thebook
\empty
\else
\end{document}
\fi
}

The main file (thesis.tex):

\documentclass[12pt]{book}

\def\thebook{\empty}

\begin{document}
\input{thesisintro}
\end{document}

a file contain some “part” (thesisintro.tex):

\input{bookmacros}

\booksectionbegin
si
abcd

\booksectionend
% Local Variables:
% mode: latex
% End:

Note that the last line of the “thesisintro.tex” if for auctex to recognize it as latex file not tex file (other whiles it will not compilable).

Post

Use bash to change file name

In unix/linux on February 7, 2012 by hoxide

I have to change the name of 2011*.jpg into 2012*.jpg, now I use following code:

for f in 2011*.jpg
do
mv ${f} ${f/2011/2012}
done

Post

Elisp to generate a list of macros in latex

In emacs, 计算机与 Internet, latex, softwares on November 12, 2011 by hoxide Tagged:

I just write following code in emacs to generate a list of macros in latex:

(mapcar '(lambda (x) (insert (format "\n\\def\\s%s{\\mathscr{%s}}"
                                (string x) (string x))))
                                (concatenate 'list
                                 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"))

Now press C-x C-E, it will insert following latex codes.

\def\sA{\mathscr{A}}
….
\def\sZ{\mathscr{Z}}

Post

AucTeX + sumatra PDF

In softwares on August 10, 2010 by hoxide

The main problem is how to config the AucTeX. There is no any other posts talking about the new AucTeX.

After 3 hours+ struggle, I decided to read the manual. Then every thing is clear. In the new version, it’s TeX-view-program-selection not TeX-output-view-style determine the viewer. But it’s still preserve these options. So if you want to use the “old” one, set “%vv” instead of “%V” for the View command in TeX-command-list.

For the new version,
1. Insert a new item of Tex-View-Program-List, with name sumatraPDF or any think you like. choose command and the command is : sumatrapdf %o.
2. save and restart EMACS,
3. change the viewer for predicate output-pdf to sumatraPDF in TeX-view-program-selection.
4. save and restart EMACS.

Now every ting works.

Problem, inverse search for new vesion of sumatraPDF. In fact I can not find the “File/Set” menu mentioned in this post.
Except this problem, I just follow him.

Post

Macaulay 2 Emacs setup in Cygwin

In Math, softwares on July 28, 2010 by hoxide

I followed the official documents, but got a error when press F12:

spawning child process: invalid argument

The point is it doesn’t set “Shell” correctly.
By reading M2.el, I find “M2-shell-exe” also need to set.
For example in my computer add

(setq M2-shell-exe “e:/cygwin/bin/bash”)

in to the .emacs file.

Then F12 works.

My setting for Macaulay 2:

;; Macaulay 2
(setq load-path
(append
‘( “e:/M2/usr/share/emacs/site-lisp” )
load-path))
(global-set-key [ f11 ] ‘M2-send-to-program)
(load “M2-init”)
(global-set-key [ f12 ] ‘M2)
(setq M2-exe “e:/M2/usr/bin/M2″)
(setq M2-shell-exe “e:/cygwin/bin/bash”)

Post

Great World City

In Uncategorized on July 9, 2010 by hoxide

两周之前去Great World City 看玩具总动员3~~~

这个传说原来是老新加坡的中心。 可是现在由于不再MRT的范围内,确切的说是在各条MRT围成的区域的中间,就不怎么繁华了。

所以虽然是市中心,却非常安静。

IMG_3527

这个样子好傻~~~

 IMG_3545 IMG_3581

还是老婆美~~~

IMG_3538

IMG_3541 IMG_3549

IMG_3559

然后吃了晚饭~~~

这个叫Rojak, 其实感觉是烤面包+烤油条+水果黄瓜等等用甜面酱拌一下。

IMG_3575

老婆喜欢吃的虾面~~

IMG_3577

接着就逛了一下去电影院了, 之前有个DBS的活动。虽然Buffet已经结束,但是周围的小装饰还是很漂亮的

IMG_3583 IMG_3599

Post

O(1,1)

In Math on June 29, 2010 by hoxide

This is too simple to write in a notes, but it is still interesting.
O(p,q) preserve the quadratic form with signature (p,q).

Then what is O(1,1). The conclusion is that O(1,1)\cong \mathbb{R}^+\rtimes ( \mathbb{Z}_2\times \mathbb{Z}_2)

To see this, it is clear that
\begin{pmatrix}\pm 1 & 0 \\ 0& \pm 1\end{pmatrix}
form a subgroup K of O(1,1) isomorphic to \mathbb{Z}_2 \times \mathbb{Z}_2

\lambda \in\mathbb{R}^+ correspond to matrix
\frac{1}{2} \begin{pmatrix}\lambda+\lambda^{-1} &\lambda-\lambda^{-1} \\ \lambda-\lambda^{-1}& \lambda+\lambda^{-1}\end{pmatrix}
which form subgroup N in O(1,1).
K act on N by \lambda \mapsto \lambda^{\det(g)}.

The way to see this is by the consideration of nill-cone In fact, O(p,q) preserve the nill-cone. For O(1,1), the nill-cone is x^2-y^2=0, just two lines. Now let \lambda act by scaler on the line x=y, then the action on the other line has no choice to be scaler by \lambda^{-1}. K just permute the lines or inverse the direction of line. Or we can say O(1,1) \cong \mathbb{R}^\times \rtimes \mathbb{Z}_2 by choice of the permutation between lines.

Post

Asia Civilization Museum

In Uncategorized on June 29, 2010 by hoxide

接上一篇, 从clarke quay出来, 沿河走, 就来到了亚洲文明博物馆~~~ 好长的名字啊… 这里有个亚洲珍宝展, 其实是伊斯兰的宝贝. 学生票价4S$/人, 其实, 几个月前是不用钱的, 可惜好像NUS和Museum的合同到期了.

直奔主题, 真正的红宝石, 上面有看不懂的伊斯兰文~~~

IMG_3195 IMG_3202

然后要买钻戒的同学可以注意了, 看看啥叫真正的大钻石~~~

IMG_3208 IMG_3209 IMG_3210

分别是24.8, 28.3和56.7克拉的钻石!!!!! 真是暴发户啊~~~

下面这个好像是印泥盒吧, 和墨水罐在一起~~~

IMG_3217 IMG_3251

 

非常晶莹剔透的某罐子

IMG_3219 

红宝石戒指~~~ 手好抖~~

IMG_3222

短刀~~~+ 拐杖头+ 精美盒子

IMG_3226 IMG_3228 IMG_3231

然后是蓝宝石+钻石

IMG_3249 IMG_3244

这个我也不知道是什么了

IMG_3255

不过这个大家都知道.

IMG_3259

胖了~~~

IMG_3263

油灯?

 IMG_3286 IMG_3287

首饰~~~ 这个手镯上镶的全是钻石~~~

IMG_3275IMG_3278

IMG_3295 IMG_3320

IMG_3338

然后是武器~~~ 波斯的刀, 貌似Diablo里刺客用的就是这个, 现在才知道原来真有这么诡异的东西。

IMG_3239 IMG_3325

IMG_3329

这个是正常的匕首,真正的宝刀啊~~~

IMG_3232

这个应该是某把刀的刀柄~~

IMG_3279

小匕首~~~

IMG_3317

板斧~~

IMG_3298

猜猜这是啥~~~

IMG_3303

是抢架子~~

戒指~~~ 不知道为啥是这么奇怪的形状

IMG_3315 IMG_3327

IMG_3321

金罐子~~

IMG_3334IMG_3328

 IMG_3377

当然亚洲不只有伊斯兰,这个是中国的盘子

IMG_3341

IMG_3342

还有唐三彩, 木偶~~~

IMG_3345 IMG_3369

BTW: 我从来没有见过做功精美的唐三彩, 难道唐三彩真的都是那么烂吗?

墨宝

IMG_3355

墨块~~

IMG_3354

然后出来在外面买了快冰砖?

IMG_3396

接着就是逛街了~~ 看到很漂亮的门把手

IMG_3401 IMG_3407

又看到了地铁站里的兰花

IMG_3413

接着道了Bugis 吃火锅~~~ 这个是Bugis Junction

IMG_3418

最有特色的就是这个喷泉了。 

IMG_3429

Post

Clarke Quay

In Uncategorized on June 19, 2010 by hoxide

其实是去Riverwalk. 背面很丑, 正面很漂亮的河边小楼.

这个是在背面拍到的, 非常有感觉的公交车, 应该是旅游用的. 时间早上9点多

IMG_2975

这楼~~~ 其实挺单调的.

IMG_2995

IMG_2998

从楼上俯瞰河边~~~

IMG_2999

IMG_3004

然后透过在某贴了膜的窗户, 才拍出了这个效果~~~, 底下的黄色是反光…..

这张图的强大之处在于, 从最左边飞碟形的楼, 到圆顶塔, 再到红色房顶的小楼, 都是对新加坡的政治非常重要的楼, 分别是最高法院, 前最高法院和前国会. BTW: 那两座很漂亮的楼印证了一个真理, 再牛的楼, 最后都是art museum.前高院就要装修完成, 而前国会2003年已经出柜了~~~ 想起上海美术馆, 原来是跑马会的楼. 简单的说就是帝国主义殖民头子在上海的指挥中心之一.

IMG_2988 

IMG_3007

这个钟楼挺美的, 可惜镜头太弱/拍的人也太弱~~~~~~

IMG_3009

这个角度看大榴莲和摩天轮比较特别

IMG_3019

Riverwalk前面的观光电梯.

IMG_3039

然后就沿着Clarke Quay走, Clarke Quay之于新加坡就像外滩对于上海一样. 就是高档餐饮+银行区.

这个屋檐上的浮雕有特斯, 可惜不太精致

IMG_3043

总的来说, 街头的这家酒吧最有感觉. 早上10点左右的酒吧和晚上10点的感觉太不一样了.

IMG_3056

这个角度, 拍摄某大楼~~~  OUB Centre

IMG_3049

这个逆光~~~~

IMG_3071

然后就去吃早饭/午饭, 难以想象吧, 在最繁华的金融区, 却有着这样的小店, 而且还是某大楼的一层, 这个是老婆吃的某种咖喱面. 清真食品, 4S$.

IMG_3078

Post

飞机飞机

In Uncategorized on June 12, 2010 by hoxide

看过世博会后, 第二天就坐东航的某班飞机回新加坡了.上飞机的时候, 货舱还没关~~~

IMG_2553

想问一下, DSLR算不算电子设备啊? 起飞时要关吗? 反正我没关, 于是就有了下面的照片,

一架马上要进入跑道的飞机, 确切得说转弯就是,

IMG_2572

然后是当我们的飞机停在刚才那个位置时候, 紧跟着我们后面的一架, 远处就是航站楼啦.

IMG_2575

然后, 就飞起来了, 下面的应该是某个机库/货运机停机坪?

IMG_2586

草坪+ 非常灰暗的天空.

IMG_2590

终于到了平流层, 霞光很漂亮.

IMG_2627

IMG_2648

 

然后, 时间再回到5月13日, 在樟宜机场拍了一些~~~

第三航站楼的特色之一, 大风车? 花瓣? 总之是会转的~~~

IMG_1149_JPG

然后是荷枪实弹的边防警察~~~ 距离很远得拍~~~

IMG_1158_JPG_1

东航的值机台, 还没开始check in~~~  所以, 很空, 平时嘛, 队还是很长的

IMG_1166_JPG

机场的BengawanSolo,  就在东航值机柜台对面. 他们家的糕点非常赞, 每次回家都带一堆回去~~~ 当然这次是在市区买的, 因为, 我整整装了半个箱子, 要是在机场买的话, 打包就不方便了. IMG_1167_JPG

边防军交接班~~~

IMG_1170_JPG

然后, 就过边检到候机厅了, 免税区有很多好东西, 但是除了烟酒和化妆品之外, 指望比外面便宜很多是不现实的, 特别是手表和电子产品(包括相机)都不见得便宜. 为了买契尔氏, 专门到了传说中的Terminal 1, 第一次去. 这个候机厅是主要服务欧美航班的, 里面居然有这么大的电视~~~ 另外还有一个室内小森林~~~ 可惜没拍下来. 老实说里面的契尔氏比外面就便宜一点, 如果做活动的话, 还是市区便宜啊~~~

IMG_1183_JPG 

隔着玻璃~~~ 推车在引导飞机进入跑道~~~ 说到这里, 回国忘了买偏振镜~~~ 后悔啊, 现在看到玻璃, 就想到这个, 偏光镜是消除玻璃反光的重要方法, 现在透过玻璃拍只能靠运气了~~~

IMG_1191_JPG

很多糖果, 看上去不错, 但是, 感觉快过期的样子~~~~ 另外, 最重要的是, 也没便宜到哪儿去. 

IMG_1199_JPG

再搭乘内部的轻轨, 回到Terminal 3. 列车进站(其实只有两节, 囧)

IMG_1206_JPG

LRT内部~~~

IMG_1208_JPG

列车运行到和Terminal 2平行的轨道上时, 就是拍摄这个控制塔的最佳时机了~~~~ 右边有镂空幕墙的房子貌似是在候机厅外专门的免税商店.

IMG_1214_JPG

最后一张, LRT下来后拍的, 电子指示牌~~~  IMG_1221_JPG

Follow

Get every new post delivered to your Inbox.