Friday, August 24, 2007

Ladybirds Red and Bamboo Leaves Green






(Well, I'm sorry that my garden is so boring, I'm sure...)

Wednesday, August 1, 2007

English-Malay Translation Google Gadget

So I was bored (or having a writer/researcher's block, depressed to tears, too busy P-ing, no research inspirations, whatever). So I decided to try writing a Google Gadget for UTMK's EBMT solution:



Basically, it's a "lite" version of our research group's example-based machine translation solution (read: a Universal Translator in the making). For the moment it supports English-Malay (both directions) translation, and we still have whole tons of ideas for improving its speed, accuracy, coverage etc.

I tried submitting the Google Gadget to the public searchable Directory, but apparently there's an approval process, so it doesn't show up yet. Meanwhile if you'd like to add it to your personalised Google homepage, you'll have to add the gadget by its URL: http://liantze.googlepages.com/utmk-ebmt.xml

Stay tuned!

Sunday, July 29, 2007

UTMK Open Day + Didier's Farewell Party

Goooood I'm still feeling dead tired after our mini-expo and Didier's farewell party on Thursday...

I don't think I can write anything about it yet, too physically/emotionally draining, so hop along to Hussein's take on it, or take a look at the photo slideshow:



All pics were taken by either Hussein or Kak Azimah, which are also on my Picasa Web Album:
UTMK Open Day + Didier's Farewell Party




Come back again soon and often if you can, Didier!

Wednesday, July 4, 2007

Generating JPGs and PNGs from Tikz/PGF

Gem of a post found at Nabble.com:

Re: Generating PNG or JPG ?

by Kjell Magne Fauske Mar 23, 2007; 02:47am

On 3/22/07, Hari Sundar wrote:
> Hi,
>
> Is it possible to generate images from tikz code ? I would like to put these
> images on a webpage and was wondering if there is an automatic way of
> generating the images rather than taking screenshots.
>

Sure, I do it every time I update the gallery I maintain at
http://www.fauskes.net/pgftikzexamples/

My approach is to use Ghostscript. Lets say I have a tex file named
figure.tex The work flow is approximately like this:

> pdflatex figure.tex

I then run ghostscript on the generated file figure.pdf to generate a PNG:

> gs -dNOPAUSE -r400 -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -sDEVICE=png16m -sOutputFile=figure.png -dBATCH figure.pdf

(On Windows the command is gswin32c. )

>From the resulting PNG file I generate a jpg thumbnail.

To crop the figures I use a package called preview[1]. The package
provides several ways of previewing parts of your document. For
example, adding this to your document preamble:

\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}

will extract every tikzpicture environment. If you use pdflatex, every
tikzpicture will be put on a separate page in the resulting pdf
document. To add a margin around the figure add:

\setlength\PreviewBorder{10pt}%

[1] http://www.ctan.org/tex-archive/help/Catalogue/entries/preview.html


Regards,
Kjell Magne Fauske

Monday, July 2, 2007

People are downloading my stuff!

OMIGOSH, people are actually starting to download my LaTeX scribblings! *tears of joy*

That people wanted the workshop slides are expected; anyway the colloquium committee put up a copy at their website too. Surprisingly the LaTeX installation walkthrough for Windows is the most sought-after file now! And the Absolute Beginner short guide! And the USMthesis style files!!

w00t!!

Friday, June 29, 2007

LaTeX Workshop Delivered

I'm still catching my breath after giving the LaTeX workshop on Tuesday (26th June). Talked non-stop for 1 hour 20 minutes and I still had several things I couldn't cover in time, especially demonstrating on-the-spot how an ACM conference paper can be produced from a default article document class, and show a few pages from the USMthesis package, etc.

The audience (20~30 people including both lecturers and postgrad students) seems to have liked the talk, and although I don't have any proper feedback data, here are some comments passed to me after the talk:
  • people have heard of LaTeX before, but have no idea how it's used.
  • people have heard of the wonderful "beautiful" outputs of LaTeX, but until I showed them a side-by-side comparison of output from LaTeX and Word, they had no idea what kind of "beautiful" output people meant.
  • people wanted to try LaTeX before, but didn't know what to install.
  • although I told them that some features like auto-generation of table of contents are also available in Word, people actually told me that they know about the feature in Word but "it's too hard to use", whereas in LaTeX one line of code will definitely get it done.
The fact that the Colloquium programme book was created with LaTeX (I helped the committee to do it within 2 days) helped convinced the audience with physical proof of what LaTeX can do...

Maybe within the next week or two, I'll get more comments and feedback via e-mail, or something. But at least now I've managed to raise some interest here...

Thursday, June 28, 2007

Vector Graphics Application with LaTeX PGF/Tikz

I simply must blog this before I go off for a meeting. Nicola Talbot has written a vector graphics program, JpgfDrawing, that can export to LaTeX code that renders the graphics using the Tikz/PGF package. PGF is used in the Beamer package, and I played with Tikz while preparing for the LaTeX workshop. It's the best drawing package for use with pdflatex I've encountered so far. (I'm not a fan of PS files, so I don't use PSTricks much, sorry.)

Sunday, June 24, 2007

Making booklets

So I was asked to help produce the program/abstract book for the CSPC'07 (Postgrad Colloquium) with LaTeX. I said Yes since here's a legitimate opportunity to get my LaTeX fix. ;-)

The end result was to be an A5-sized booklet, i.e. 2-up pages on an A4 sheet, folded. I tried the LaTeX booklet package, but it wouldn't play nice with the geometry package, not without me twiddling explicitly with the page sizes and margins. Dear, dear./>
Thank goodness for GNU/Linux though, since we can always use psutils for producing booklets, and we want PDF outputs anyway. And so, once the full-sized A4 abstractbook.pdf is done, these commands spring into action:

$ pdftops -paper A4 abstractbook.pdf abstractbook.ps
$ psbook -s40 abstractbook.ps absbook-sig.ps
$ psnup -n2 -pa4 absbook-sig.ps abstractbooklet.ps
$ ps2pdf -sPAPERSIZE=a4 abstractbooklet.ps


where the -s40 parameter to psbook signifies there should be 40 pages in the booklet. The number must be a multiple of 4. It doesn't matter if your full-size doc doesn't have the right number of pages; psbook will add blank pages as necessary, so just round up your actual page number to the next multiple of 4 to pass to psbook.

TA-DAAAAA!!!!




It was a learning experience especially the following points:
  • Do not be a smart-aleck and try to reset page numberings when making twoside documents. Let \frontmatter and \bodymatter do the job. Otherwise the odd/even page margins get all messed up.
  • Use the ltxtable package for longtable + tabularx. But then each longtable (with tabularx column specs) needs to be in its own individual file.
  • On the whole, LaTeX is relatively easier than
    • coaxing printers to co-operate.
    • proof-reading.
    • proof-reading.
    • ESPECIALLY the proof-reading.

Friday, June 15, 2007

Wednesday, June 13, 2007

秀萍当妈妈了!


Cynthia's a very close friend from my A-level and Warwick days. She's the kind of person that takes on life's challenges head-on, and I admire her greatly for that. So when she and Andrew (another Warwick coursemate!) got married, I was no end happy for them, and especially for Cyn.

Now they're proud parents of little Joelle Chow! She was born 9th June, 2007 at Royal Free Hospital, London. O joyous day, congratulations Andrew and Cynthia and little Joelle!

Friday, June 8, 2007

tex4ht

曾经好玩地尝试了 latex2html, HeVeA, TtH 等等。简单的 LaTeX 文件是没问题啦,都可以生成不错的 HTML,但若有特别的宏包、自己定义的指令,那就非常对不起了。(其中 TtH 的速度还真不是普通的快!)

最近发现了 tex4ht,似乎还没有什么可以难倒它的!皆因它会先生成一个 .dvi 文件,再从这个文件生成 HTML, OpenDocument 等其他格式。默认的 HTML 是有点丑啦,但可以自己定义 CSS 或其他设置来改善。最重要的是,啥宏包(或是自己定义)的指令都可以处理哦。

起初是有个小疑问:我已习惯了 \includegraphics{file} (即不写明 file extension),结果 tex4ht 就老是要找 .eps 文件……而我又不想改动成 file.eps 那么累赘,还真花了不少时间在网上搜索。最后终于找到解决方法。先要一个 myconfig.cfg 文件:
\Preamble{html}
\DeclareGraphicsExtensions{.jpg,.png,.eps,.pdf}
\begin{document}
\EndPreamble
然后运行(基本指令,当然还可以加上其他配置值)

htlatex myfile "myconfig"

就可以了。

Friday, June 1, 2007

The Rage with Patents

Why this obsession with patents? Why? Patents for industrial and engineering designs, I understand. But patents for algorithms and software procedures and computer applications?

Maybe I should have become a lawyer like my dad secretly wished (before he realised-- happily, I think -- I had a bigger knack for maths and such).

Well here's what Computer Science's Yoda (that's what he is to me) has to say about software patents: Prof Donald Knuth's 1994 Letter to the Patent Office.

Tuesday, May 22, 2007

ProTeXt 2.0 is out!

After... what was it? 2 years? There's finally a new version of ProTeXt! It features MikTeX 2.5, TeXnicCenter Greengrass and TeXMaker (w00t! I loved it on Debian! Still not quite sure how it fares against TeXnicCenter on Windoze though)!

It seems though that localtexmf is no longer supported under MikTeX 2.5, apparently it provides other ways of configuring user's own TEXMF trees. We'll see how that works out, but I definitely need to get up to speed with this for the LaTeX workshop.

Well, download time.

Monday, May 21, 2007

LaTeX Workshop!

I got an invitation from Dr Dhanesh to conduct a LaTeX tutorial/workshop for the upcoming Postgraduate Co*******m! (Sorry, still some repressed memories from 3 years back there.)

The initial idea was to give a tutorial on using my usmthesis LaTeX template. But then we realised that the available slot is only 1 hour, and it's hardly practical to assume the audience having prior knowledge about LaTeX. (Now that's a vision, don't you think?)

So by today, Dr Dhanesh suggested to keep it as an "Introduction to LaTeX" walkthrough, and only talk briefly about the thesis template if we have enough time.

Boy, I am rather thrilled about this. I hope I'll be able carry it off.

Thursday, May 17, 2007

VladStudio Wallpapers

Vladstudio.com 依然是我最喜欢的网络艺术家。他的笔触有种温暖的油灯感觉,又像冬天的晚上等着你回家的壁炉里的火焰……当然,更过瘾的是他还时常恶搞名画及网络2.0。

Wednesday, May 16, 2007

Bash commands and scripts

I love Bash shell commands and scripts. Really, I do. Where would I be without all them one-liners to *bang* *zip* process those huge dictionary text files in less than 5 seconds?

Except that sometimes I need 30 minutes to look for an obscure option and how to use it exactly to get the result I want.

For instance, sort is cool. It sorts lines so fast no spreadsheet application is worth a second, nay, even a first thought. Heck, it even ferrets out unique lines calmly!

Then I have this file, which is all fields of numbers, e.g.
1   1    0    0    0
1 2 2 0 2
...

And I needed it to be sorted by the first field, then the second. Running plain sort on it gave me
1     1     0     0    0
1 10 0 10 10
1 11 ...
...
1 1921 ...
1 2 ...

OK, so it's not seeing the numbers as numbers, it's seeing them as ASCII strings. A man page look-up later, I tried sort -n. Then sort -k, then with both options. To no avail. Time to Google.

30 minutes of surfing later, I finally found this nugget of an example that did the trick:
sort -k 1n,1 -k 2n,2

See, you have to state explicitly (via -k) that the first key starts and ends at field 1, and to treat it as a number, and repeat it with field 2 (or any other fields you'd like to use as the sort key) as well.

I love Bash commands.

Sunday, May 13, 2007

Sumatra PDF Viewer

http://blog.kowalczyk.info/software/sumatrapdf/

Finally -- a PDF Viewer on Windows that supports document reloading! No more wrangling with Acrobat Reader DDE commands during TeXnicCenter + pdfLaTeX!

Sunday, May 6, 2007

当研究生们开始脑筋不正常

点题!当大家都开始被无理的压力搞得疯疯癫癫,这就是咱的研究室的下场!


我们非常极之迫切需要一个出气筒,一个供我们暴力以待的沙包!!


然后,我们也需要一个软绵绵又温暖的大玩偶,让我们可以紧紧拥抱……(虽然也有人较喜欢也对它暴力以待啦。)

总之。我们很想要 go crazy 啦!

Wednesday, April 25, 2007

Penang Bridge Traffic info via SMS

While crossing the Bridge this morning, staff gave out little bookmarks re the launching of the "Online Traffic Information Management System" (OTIM) via SMS; thought I'd share it...

SMS:
(to Penang) OTIM kepen OR OTIM topen
(to Seberang Perai) OTIM keprai OR OTIM toprai

to one of these numbers: 012 344 6900; 013 388 3131; 016 339 0999

I gave it a try and here's what I received:
OTIM
CODE:toprai
DEST:To Seberang Perai
INFO:Bayan Baru=Clear; Udini=Clear; Main Span=Clear; Juru=Clear; Seberang Jaya=Clear
[Estimated time travel on the bridge: 15 minutes]>
Drive carefully & wishing you a safe journey!

Mmm, cool. I hope this one doesn't break down ever!

Monday, April 23, 2007

S.H.E. 中国话

谨此将这首歌,献给所有看不起中文,看不起华校生,看不起会说中文的人的人们。

中国话
唱:S.H.E.
曲:郑楠 词:郑楠/施人诚

伦敦玛莉莲 买了件旗袍送妈妈
莫斯科的夫司基 爱上牛肉面疙瘩
各种颜色的皮肤 各种颜色的头发
嘴里念的说的开始流行中国话
多少年我们苦练英文发音和文法
这几年换他们卷著舌头学平上去入的变化
平平仄仄平平仄 (仄仄平平仄仄平)
好聪明的中国人 好优美的中国话

扁担宽 板凳长
扁担想绑在板凳上
板凳不让扁担绑在板凳上
扁担偏要绑在板凳上
板凳偏偏不让扁担绑在那板凳上
到底扁担宽还是板凳长
哥哥弟弟坡前坐
坡上卧著一只鹅
坡下流著一条河
哥哥说 宽宽的河
弟弟说 白白的鹅
鹅要过河 河要渡鹅
不知是那鹅过河
还是河渡鹅

全世界都在学中国话
孔夫子的话 越来越国际化
全世界都在讲中国话
我们说的话 让世界都认真听话

纽约苏珊娜 开了间禅风Lounge Bar
柏林来的沃夫冈 拿胡琴配著电吉他
各种颜色的皮肤 各种颜色的头发
嘴里念的说的开始流行中国话

有个小孩叫小杜
上街打醋又买布
买了布 打了醋
回头看见鹰抓兔
放下布 搁下醋
上前去追鹰和兔
飞了鹰 跑了兔
洒了醋 湿了布
嘴说腿 腿说嘴
嘴说腿 爱跑腿
腿说嘴 爱卖嘴
光动嘴 不动腿
光动腿 不动嘴
不如不长腿和嘴
到底是那嘴说腿 还是腿说嘴