From http://superuser.com/questions/249045/x11-forwarding-from-amazon-ec2-ami
sudo yum install xorg-x11-xauth.x86_64 xorg-x11-server-utils.x86_64
From http://superuser.com/questions/249045/x11-forwarding-from-amazon-ec2-ami
sudo yum install xorg-x11-xauth.x86_64 xorg-x11-server-utils.x86_64
Copied from http://jerrywaller.wordpress.com/2010/01/07/batch-find-and-replace-with-the-linux-command-line/
perl -pi -w -e ‘s/wrong/right/g;’ *.html
Replaces all instances of ‘wrong’ with ‘right’ in html files within the current working directory.
grep -rl “wrong” /home/jerrywaller | xargs sed -i ‘s|wrong|right|g’
Recursively replaces ‘wrong’ with ‘right’ within the designated directory.
前两天接到国航电话,像LAX-PEK-HKG这种机票是要有有效的证件(比如香港旅行证)才能飞PEK-HKG这一段。正好前两天去洛杉矶领馆办了香港旅行证,使馆网站和香港政府网站上对于像我这种情况的资料都不太全,在这里把过程和材料总结一下,希望能对大家有所帮助。
我是中国护照,学生签证,去之前填了使馆网站上的ID1003A表,到使馆之后被告知不用填这个表,他们有一个类似的表,内容跟ID1003A差不多但是简短一些(正反两页)。填表的时候可以选一次,两次或者一年内多次入境。照片的要求跟ID1003A一样。手续费$10,取证的时候用credit card付。其他材料包括I-20原件和复印件,护照复印件,签证复印件,I-94复印件。办证很快,我的在4个工作日之后就取到了,一年多次入境,跟签证一样是贴在护照里。
前天打这个公司的电话,接电话的是Kevin,价格和时间都说好了,结果第二天到约的时间没人来,打电话过去Kevin说是工人挑肥拣瘦嫌我这边的钱太少不愿意来了,然后不停的劝我找其他家公司,写出来给大家提个醒,不要再被他们晃点了。
1. Automatic save frequent searches. Search history.
2. Provide related messages as context when viewing an email, like previous messages in the same thread, messages from the same group of authors, and messages with similar content. However, reading some emails like advertisement and newsletter don’t need context. This idea, in general, is organizing emails by similarity of contents rather than by time or threads. This organization probably is more close to the representation of concepts, lexicons, events and other things. Therefore, people will find it more natural to work with email client program in this way.
3. To achieve the above goal, a topic classifier is needed to index all the messages in Inbox, Sent and etc.
Related resources
http://java.sun.com/j2se/1.5.0/docs/api/java/awt/doc-files/AWTThreadIssues.html
Some notes and resources
数不清的泪
我又哭了好几回
幻化成蝶
停留在这片落叶
被风化的雪
埋藏在千年以前
我用尽一生的思念
只为等着你出现
回忆渐渐凋谢落在我身边
唤不醒原来还跳动的画面
就让我留在轮回的边缘
等一道光线
看见某年某月我们之间
曾经说过的预言
就让他带走你的那瞬间
成为我们的纪念
谁能发现我的世界
曾经有过你的脸
在匆匆的处境
曾相识的背影
最远的人心里
留住了最近的呼应
多天真的眼睛
藏丝丝的笑声
我半生人希冀
爱着那原来的你
回头便知
我心只有你
沿途路斜
爱却在原地
平凡日子
令我一再度回味
想你
思想你
心只有你
像一颗千里外的星光
我们只能对望
相信爱不会说谎
只是分开收藏
我等候的愿望
总是失望
像流星耀眼却会坠亡
你的爱的力量
如何飞向
遥不可及的远方
遥远的星光 只能凝望
你是否一样
会把爱挂在心上
满天的星光 就算给我
一千个愿望
我只想换你
一直陪在我
身旁
陪在我身旁








Source: http://www.shelldorado.com/articles/mailattachments.html
$ mutt -s “Birthday celebration” -a citymap.jpg all@friends.org < invitation.txt
$ mutt -a syslogs.tar.gz admin@domain.org < /dev/null
$ echo | mutt -a syslogs.tar.gz admin@domain.org
As I mentioned in my last post, I was trying to access the Minipar library from Java. Our current approach which uses the pdemo program to parse each sentence has a performance problem. It took more than an hour to parse 28 research articles (about 265ms per sentence). Most of time may be spent on creating the pdemo process and loading the data files, which were done before parsing every sentence. So, I wrote a Java proxy class which calls a C++ proxy class which then calls the Minipar library. The initialization code is only called once at the beginning and there is no need to create a process. The Java code calls the C++ library through the Java Native Interface (JNI). The illustration below shows the basic process of a call of parsing a sentence.
Main Java program -> MiniparProxy.java -> MiniparProxy.cpp -> Minipar library
The improvement on performance is significant. See the table below for a comparison. 28 research articles are processed (17558 sentences, 341980 word tokens). The current method is about 20 times faster than the original one.
| New Minipar2.java | Original Minipar.java | |
| Total time (min) | 3.90 | 77.77 |
| Time per document (s) | 8.37 | 166.66 |
| Time per sentence (ms) | 13.34 | 265.77 |
| Time per token (ms) | 0.68 |
13.65 |
I found a performance problem in a bigger project which uses Minipar as our dependency parser. Since our project is written in Java and Minipar only provides a static library for Linux, every sentence is process with the pdemo program comes with Minipar. When process each sentence, the pdemo program has to load, process and exit. Apparently, many time are wasted on loading pdemo. In addition, our Java program communicates with pdemo through reading the console input and output streams, which may be not so efficient. So, I decided to write a wrapper library for Minipar using C++, which then can be called in Java through JNI.
The first thing is to get the pdemo program compiled and linked to Minipar static library. Then I can write my own wrapper code. And I decided to do this on our Linux box.
Fedora Core 6
Kernel 2.6.22.14-72.fc6 on an i686.
gcc version 4.1.2 20070626 (Red Hat 4.1.2-13)
There are a lot of linking problems come out during the process. First, the Minipar static library was compiled on an older gcc version (3.2.2). You’ll see when you open libminipar.a with a text editor. I tried many options with the current gcc. I am still not able to successfully link pdemo.o to the Minipar library. The problem, I think, is to link code compiled with different versions of gcc.
So, I downloaded gcc 3.2.3 and tried to compile and install it. It wasn’t going to make through the build process. Some errors came out again. After a little bit googling, it seems the problem is compiling older gcc with newer one. A suggested solution is to install a version of gcc between these two as a way of bootstrap. Following this method, I tried gcc 3.3.6 which also failed to build. Finally, I successfully build gcc 3.4.0 and was able to build gcc 3.2.3 using gcc 3.4.0.
Then, I tried to statically link pdemo to Minipar library. Some errors with glibc and libz poped out. It looks like that those two libraries are compiled with newer gcc on the system so they had problem linking to library compiled with older gcc.
5AM in the morning, I built the glibc and libz which is such a long process. I went to bed; when I got up, the build finished. With all the libraries compiled with gcc 3.2.3, I finally linked pdemo to Minipar library. Cheers!
As I was trying statically link, the generated pdemo executable is about 20Mb. No doubt, I removed “–static” option. This time, it successfully linked even without my glibc and libz. In conclusion, if you are going to link a program to Minipar library, use the right version of gcc to compile your program and link without “–static” option.
Running pdemo
libretto 31% ./pdemo -p ../data/ > This is a test sentence. ( E0 (() fin C * ) 1 (This ~ N 2 s (gov be)) 2 (is be VBE E0 i (gov fin)) E2 (() this N 5 subj (gov sentence) (antecedent 1)) 3 (a ~ Det 5 det (gov sentence)) 4 (test ~ A 5 mod (gov sentence)) 5 (sentence ~ N 2 pred (gov be)) 6 (. ~ U * punc) )
I was trying to compile the pdemo program comes with Minipar on both Linux and Windows XP. Minipar supplied a library file to be linked to your program, which is minipar.lib for Windows and libminipar.a for Linux.
I created a project using Visual Studio 2008. When building the project, many link errors showed up. Finally I found out that the Minipar library was compiled long time ago with Visual Studio 2003. In VS2008, the definitions of some standard library string functions have changed a little bit. (The difference is between “thiscall” and “_cdecl“.) So I have to find a copy of VS2003 and successfully compiled the pdemo program.
error LNK2001: unresolved external symbol “public: void __thiscall std::_String_base::_Xran(void)const ” (?_Xran@_String_base@std@@QBEXXZ) minipar.lib
Here are something to remember.
1. Use Multi-threaded option in Code Generation in the Project Property Page.
2. Add the following line to the beginning of your program.
#pragma comment(lib, “ws2_32.lib”)
Otherwise, you will have some link errors of _htonl, which look like
minipar.lib(strbufs.obj) : error LNK2019: unresolved external symbol _htonl@4 referenced in function “public: void __thiscall StrBufs::push_int(int const &)” (?push_int@StrBufs@@QAEXABH@Z)
If you would like to download the pdemo.exe, you can find it here. (Note, you still need the data files from Minipar to run this program.)
Seeing so many wonderful things this week, UEFA Champions League quarter finals, a really old classic film – the wizard of Oz, and Salonen Conducts Stravinsky: The Final Concerts at Walt Disney Concert Hall.


Walt Disney Concert Hall, what a strange shape!

All wood interior.

Frank Gehry and Esa-Pekka Salonen in front of Walt Disney Concert Hall

Some images are taken from http://www.laphil.com/press/image_library/index.cfm
Suddenly, I found that my CPU run between 60 °C to 80 °C, which is quite high. I noticed this because the CPU fan was becoming really noisy and, of course, annoying. I used several software to watch the CPU and motherboard temperatures, including SpeedFan, Core Temp and PC Probe II for Asus motherboard.
I would strongly recommend SpeedFan if you want to monitor your system temperatures. It’s really powerful yet small and easy to use, as you can see below all the temperatures and fan speeds it displayed.
My PC configuration is
CPU: Intel E6300 1.8GHz
Motherboard: Asus P5B Deluxe with Wifi AP
Memory: 3 x 1G Corsair 6400
Here are two pictures of temperatures when CPU is idle and full.
![]() |
| From Cooling project |
![]() |
| From Cooling project |
A lot of dust was on the stock Intel CPU fan. And one of the hard drivers was also hot. So I bought this Freezer 7 Pro and a 5.25 in. hard drive cooler from newegg. The hard drive cooler is very good in that it can mount my 3.5 in. hard drive to the empty 5.25 slots, since I already got several hard drives crowded at the 3.5 in. slots. The installation for the new CPU fan was easy. But this cheap hard drive cooler took me more than an hour to properly install it. It just didn’t fit well in the slot.
| From Cooling project |
| From Cooling project |
| From Cooling project |
| From Cooling project |
So, what is the temperatures now?
CPU idle, fan in full speed
![]() |
| From Cooling project |
CPU full, fan in full speed
![]() |
| From Cooling project |
The summer is going to be cool! See here for more pictures.
If you, unfortunately, like me, need to complete an online traffic school course, consider GoToTrafficSchool.com. They got competitive price and pretty nice web pages (Believe me, I have done many searches before I took one two months ago). Use this referral code to save you $2 and some commission for me
XME-CC6-588
This a series of articles about writing from NY Times. I have read the one by Susan Sontag which has very practical suggestions on writing.
use linux, not windows
These are 10 best articles from IBM developerWorks in 2008. They are really useful. Why didn’t I see it earlier?
I was attending the BUCLD conference at Boston from Oct 30 to Nov 2. Some press companies have exhibition at the conference site. One of them, Psychology Press had a raffle and I was noticed yesterday I got a $100 worth of book
Cell, Volume 135, Issue 3, Pages 369-572 (31 October 2008)
http://www.sciencedirect.com/science/journal/00928674