Wednesday, September 22, 2010

觀山楂樹之戀有感

前天在開會時,系上提到了要開一門電影與政治,又提到了一部最近國內很夯的電影「山楂樹之戀」,結果我做了我自己都不相信的事,去電影院看國片,更甚者,同時間上映的有Inception這部好片,我是入境隨俗吧,一句話短評,淡淡的哀傷!對,就只是淡淡的!

以下有雷,怕被雷到的,請按Ctrl + W關閉視窗吧!

先說觀眾吧,果不其然,年輕人都去看Inception了,我周圍坐下的都是頭髮雪白的老公公老婆婆們,也許是特地來看他們那個時代的故事吧。

這是一部以文革為時代背景的電影,對於那個年代陌生的我來說,很多場景在我看來都是好笑的,除此之外,這部電影就圍繞在男女主角的互動上,而這一切都那麼平淡,平淡的讓全場觀眾好些時候都彷彿停住呼吸一般靜默!

我最有意見的莫過於它每個章節的過門,都用上字幕來提醒觀眾發生了什麼事,這樣粗糙的過門手法,本不應該發生在這個年代的電影上,但細想,這一整部片不就是傳達著平淡、簡僕,導演粗糙的過門,也許故意的吧。

這部電影有著韓劇式的結局法,但由於前面為觀眾舖陳了一個半小時淡淡的情緒,最後結局即便收得老調,也因為前後情緒的落差,硬是逼得場中啜泣聲此起彼落!

女主角合該得獎吧,導演好多幕特寫她臉上的表情,她也成功地用表現出少女的羞赧,台詞不多,相信看完這部電影的觀眾一定忘不了這位女主角!

中秋節看了部老梗的好片,純純的愛,淡淡的憂傷!

Thursday, July 01, 2010

幫忙?一把塗滿蜜糖的利劍!

這幾天都在想個問題.....「要是我幫忙了他,是不是這件事就不會發生?」(Had I helped him, would this not happen?)  但是這個問題的另一面向,更令人玩味:「是不是當初不幫忙他,這件事就會發生?」(Would this happen had I not helped him?) 這整個問題的關鍵其實不在於幫不幫忙,而是這無可預知已經發生的事What would have happened?

學了好幾年的因果推論,我深深了解到因果推論的無力感,既便任何事的發生有其因果,我們仍然無法確定現在的結果是來自我們覺得的原因。事情的發生無法重來,所以我們沒有法子像實驗室做實驗一樣找出真正的因,What would have happened had I done this?

我們總以為幫助人是有益的,所以伸手幫忙,但是有時候結果並不如預期....

路上看到有人騎車摔倒了,你去扶他一把,他卻說是你撞他的;好心施捨流浪漢一塊麵包,他卻怪你讓他吃了拉肚子;你幫同事寫好報告,他卻跟上司說錯字都是你打的。這樣的事太多了。幫忙別人真的往往是吃力不討好,那是不是不應該幫忙別人呢?可是你明明看到一個人正在溺水,你能不幫忙嗎?

我跟C學長對於這件事也討論了好久,他給了我一個他本身的小故事,意義深長:

他有一次在自家旁邊路上看到一隻受傷的蜜蜂,他怕牠被經過的車子或人踩過去而死掉,於是就將牠移到旁邊的草地上,過一會,他去看那隻蜜蜂,卻發現蜜蜂被數十隻螞蟻分食而掙扎不已....

凡事發生自有輪迴,我們的介入,也許能改變什麼,但是這碰壞輪迴的我們,卻得承擔原來輪迴裡的業障,這個蜜蜂故事中殺生的是誰,竟然是伸手幫忙牠的人,但牠也許受傷本來就不能活了,但是幫忙牠的人卻讓牠死得更為痛苦.....

我似乎懂了些什麼,卻也迷惘了.....我真的不知道該如何是好!

法國行(四) Rennes 城市探險

寫這篇之前,正在看以前吉他社學姊陳綺貞「旅行的意義」的MV,以前就好欣賞這位學姊,可惜入社後,卻從來沒機會見到她,OK,重點是,看完後,突然了解到有時候人追求不到的人、事、物,都藏在潛意識裡,於是見到類似的風景叫似曾相識 Deja vu,碰到對的人叫一見如故,甚至一見鍾情,這次來到法國也是為了尋找曾經的Deja vu吧。

Thursday, June 24, 2010

CMYK and RGB color code in TeX

I found that control coloring in TeX is not an easy task.  Sometimes, you want your font to be colored as brown.  But brown is not explicitly defined in the color package.  I found a web page that provides detailed color pallet with the color name and the CMYK and RGB setting.

Here is the link to the webpage.

http://www.december.com/html/spec/colorcodes.html

So you can look up the percent code of CMYK or RGB in this webpage and define the color in TeX as the followings:

1. Call the package color

\usepackage{color}

2. Define the RGB color

\definecolor{brown}{RGB}{128,42,42}

or

\definecolor{brown}{cmyk}{0,0.67,0.67,0.50}

Sunday, June 06, 2010

General steps to compile JAGS in a Linux based OS system and install rjags in R

I have an entry here about how to install JAGS and rjags in Fedora.  However, I have exchanged emails with Robert Dorazio and Dr. Martyn Plummer.  Here are the easier steps to compile JAGS and install rjags in R.

1. After you extract the source code of JAGS, go to the folder where the JAGS makefile is using a terminal.
cd JAGS-2.1.0

2. In a terminal, type the following
sudo ./configure --prefix=/usr
sudo make
sudo make install

3. The step 2 will help your system to identify where the JAGS is.  So in R, you can simply install rjags as:
install.package("rjags")

Of course, once you can install rjags successfully in R, you can install our R2jags package as well:
install.package("R2jags")

JAGS, rjags, and coda packages for Fedora

Christopher has the RPMs (for Fedora users) for JAGS, coda, and rjags on his blog. The specific blog entry is here:


If you have trouble installing JAGS or rjags in Fedora, this is going to simplify the installation process.

Wednesday, January 13, 2010

TeXing Chinese, Japanese, Korean (UTF-8) Documents using xeLateX

I have been converted myself from a Word user to a TeX user for over 5 years.  Since the release of xeTeX (a new TeX package that can use system fonts to type Non-Egnlish [UTF-8] documents), I have been using it whenever I wanted to type a Chinese document.  However, it is not easy.  The biggest hurdle is that you have to write some commands in the preamble and have special packaged fonts to be able to switch between Chinese and English if you want to use beautiful TeX Fonts in your documents.  

Here is the font package provided by Edward Lee (LGJ).  The manual of the way to use it is here.

Nonetheless, last year, Sun Wenchang released a TeX package XeCJK . It makes TeXing with UTF-8 documents easier.  You can specify the use of Chinese fonts in the document without changing the default English font (Latin Modern).


Here is the template of how things get done:


\documentclass{article}
\usepackage{fontspec} % package for setting fonts
\usepackage{xeCJK}    % package for setting Chinese fonts
\defaultfontfeatures{Mapping=tex-text}
% Chinese font main settings
\setCJKmainfont[BoldFont={Microsoft JhengHei},ItalicFont={DFKai-SB}]{PMingLiU} 
\setCJKsansfont{cwTeXYen}
\setCJKmonofont{Adobe Fangsong Std}  % or cwTeXFangSongTT
% linebreak setting for Chinese
\XeTeXlinebreaklocale "zh"          
\XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt 

\setCJKfamilyfont{zhhei}{Microsoft JhengHei} % or cwTeXHeiBold
\setCJKfamilyfont{zhkai}{DFKai-SB} % or cwTeXKaiItalic
\setCJKfamilyfont{zhsong}{Adobe Song Std}
\setCJKfamilyfont{zhfs}{Adobe Fangsong Std} % or cwTeXFangSongTT
\setCJKfamilyfont{zhyou}{cwTeXYen}
\newcommand*{\song}{\CJKfamily{zhsong}} 
\newcommand*{\fs}{\CJKfamily{zhfs}} 
\newcommand*{\hei}{\CJKfamily{zhhei}}  
\newcommand*{\kai}{\CJKfamily{zhkai}} 
\newcommand*{\yen}{\CJKfamily{zhyou}}
\title{\it 文件題目}
\author{作者}
\date{\today}
\begin{document}
\maketitle
This is a Chinese document. 這是一份中文文件。\textbf{This is a Chinese document. 這是一份中文文件。}\textit{This is a Chinese document. 這是一份中文文件。}{\song This is a Chinese document. 這是一份中文文件。}{\fs This is a Chinese document. 這是一份中文文件。}{\hei This is a Chinese document. 這是一份中文文件。}{\kai This is a Chinese document. 這是一份中文文件。}{\yen This is a Chinese document. 這是一份中文文件。}
\end{document}



Still, you might need some effort to find out the fontname in your system in order to make it working.  For instance, you can use 標楷體 as the Kai font in the template.  Or to be more general, use DFKai-SB, which is a default English name for this font.  If you download the fonts provided by LGJ, the fontnames are commented in the template.

There is one the last thing to make things working.  You have to pick a TeX editor that can edit UTF-8 documents.  I found TeXmaker or Texwork are two good ones.

Monday, November 30, 2009

An OpenSSH software for Windows 7 / Vista

Here is an OpenSSH software I personally found useful and working well under Windows 7 / Vista.  It is copSSH.

Besides it is free and open source, it is still actively maintained.  It works well with the UAC (user account control setting) of Windows 7 / Vista.  And it does not clash with Rtools.exe.

Saturday, November 14, 2009

MikTeX 2.8 and WinEdt 5.6

The current WinEdt needs some adjustment to work with MikTeX 2.8. The developer of WinEdt has a post here to show how to do this. I tried to follow his instruction. But it still took me some times to figure out which file I need to make the change. Basically, we need to alter the "menu.dat." The file is located in:

Windows XP
C:\Program Files\WinEdt Team\WinEdt\Config\MikTeX\menu.dat

Windows Vista & Windows 7
C:\Program Files (x86)\WinEdt Team\WinEdt\Config\MikTeX\menu.dat

Then follow the post:

Run('mo.exe')

should be modified to

Run('mo_admin.exe')

The same with package manager. Replace

Run('mpm.exe')

with

Run('mpm_mfc_admin.exe')

And the update in 2.8 should be defined (in one line) as:

Run(|%$('TeX-Root');\miktex\bin\internal\copystart_admin.exe "%$('TeX-Root');\miktex\bin\internal\miktex-update_admin.exe"|);
In Windows Vista or Windows 7, if we want to refresh the TeX system, I found that running the following commands in the "Command Prompt" (Run as administrator) works better:

initexmf -u --admin
updmap -u --admin

That is running initexmf and updmap. in the administrative mode. These changes are going to be adopted in the next version of WinEdt. In the meantime, we just have to change these manually.