Video: Warren Buffett & Bill Gates – Keeping American Great

Posted in Everything with tags on November 15, 2009 by Hao

2012: L.A. Earthquake Featurette

Posted in 216496 with tags , , on October 26, 2009 by Hao

Some thoughts on Thunderbird and organizing emails

Posted in Computer on September 29, 2009 by Hao

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://chandlerproject.org/

Java program does not exit after closing AWT JFrame window

Posted in 216496 on September 29, 2009 by Hao

http://java.sun.com/j2se/1.5.0/docs/api/java/awt/doc-files/AWTThreadIssues.html

Compiling Media player classic (Guliverkli)

Posted in Computer with tags , , on September 27, 2009 by Hao

Some notes and resources

Preparing for qualifying exam

Posted in Research with tags on July 19, 2009 by Hao

Crying Angel

Posted in 胡言乱语 on June 11, 2009 by Hao

June 11, 2009 Thursday
Austin and Los Angeles

You tell me,
It’s raining very hard.

I know,
It’s my angel crying.

All the memory must be forgotten,
All the good old days.

No story will be told,
Even the magical night in Beijing,
When we melt.

Just one last dance

We meet in the night in the Spanish café
I look in your eyes just don’t know what to say
It feels like I’m drowning in salty water
A few hours left ’til the sun’s gonna rise
Tomorrow will come and it’s time to realize
Our love has finished forever
How I wish to come with you
How I wish we make it through
Just one last dance
Before we say goodbye
When we sway and turn round and round and round
It’s like the first time
Just one more chance
Hold me tight and keep me warm
Cause the night is getting cold
and I don’t know where I belong
Just one last dance
The wine and the lights and the Spanish guitar
I’ll never forget how romantic they are
but I know, tomorrow I’ll lose the one I love
… …

我们的纪念

数不清的泪
我又哭了好几回
幻化成蝶
停留在这片落叶
被风化的雪
埋藏在千年以前
我用尽一生的思念
只为等着你出现
回忆渐渐凋谢落在我身边
唤不醒原来还跳动的画面
就让我留在轮回的边缘
等一道光线
看见某年某月我们之间
曾经说过的预言
就让他带走你的那瞬间
成为我们的纪念
谁能发现我的世界
曾经有过你的脸

心只有你

在匆匆的处境
曾相识的背影
最远的人心里
留住了最近的呼应
多天真的眼睛
藏丝丝的笑声
我半生人希冀
爱着那原来的你
回头便知
我心只有你
沿途路斜
爱却在原地
平凡日子
令我一再度回味
想你
思想你
心只有你

对望

像一颗千里外的星光
我们只能对望
相信爱不会说谎
只是分开收藏
我等候的愿望
总是失望
像流星耀眼却会坠亡
你的爱的力量
如何飞向
遥不可及的远方
遥远的星光 只能凝望
你是否一样
会把爱挂在心上
满天的星光 就算给我
一千个愿望
我只想换你
一直陪在我
身旁
陪在我身旁

Following the Path of Memory

Posted in 胡言乱语 on June 10, 2009 by Hao

RIMG0277

RIMG0297

RIMG0307

RIMG0311

RIMG0317

RIMG0322

RIMG0008

RIMG0291


“Thy firmness makes my circle just,
And makes me end where I begun.”

Send mail with attachment in Linux terminal

Posted in Computer with tags , , on June 10, 2009 by Hao

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

More on Minipar – Java interface

Posted in Computer, ISI with tags , , , , , , on June 5, 2009 by Hao

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

Since this is an ongoing project, I’ll not publish the source code here. Please contact me if you need more details on accessing Minipar in Java.

Compile Minipar programs on Linux

Posted in Computer, ISI with tags , , , , , , , on June 3, 2009 by Hao

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)
)

Compile Minipar programs on Windows

Posted in Computer, ISI, Research with tags , , , , , on May 28, 2009 by Hao

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.)

Life is colorful

Posted in Everything on April 17, 2009 by Hao

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.

uefa_champions_league_logo_2
wizard-of-oz-dvdcover

Walt Disney Concert Hall, what a strange shape!
wdch-view_from_courthouse_low

All wood interior.
auditorium_stageview_low

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

Some images are taken from http://www.laphil.com/press/image_library/index.cfm

Summer is coming: Cooling my PC

Posted in Computer with tags , , , , on April 14, 2009 by Hao

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.

GoToTrafficSchool.com discount coupon code

Posted in Everything with tags , , , , , , , on April 14, 2009 by Hao

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

Writers on Writing

Posted in Everything with tags on March 2, 2009 by Hao

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.

http://www.nytimes.com/books/specials/writers.html

Generate high resolution graphs using R (2.8.1)

Posted in Computer with tags , , on February 15, 2009 by Hao

use linux, not windows

Anatomy of a Murder

Posted in Everything with tags , on February 3, 2009 by Hao

Some good articles from IBM developerWorks

Posted in Computer with tags , on January 31, 2009 by Hao

I love …

Posted in Everything on November 25, 2008 by Hao

Food

Catfish at University village

Panare bread

Javascript string trim function implementations and comparison

Posted in Computer with tags , , , on November 9, 2008 by Hao

I got lucky :)

Posted in Everything with tags , on November 7, 2008 by Hao

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’s special issue on Autism

Posted in Research with tags , , on November 7, 2008 by Hao

Cell, Volume 135, Issue 3, Pages 369-572 (31 October 2008)

http://www.sciencedirect.com/science/journal/00928674


Finally I got the front bumper impact strip installed; my BMW has accumulated 120,000 miles and is still in very good condition :)

Posted in Car with tags , , , , on October 27, 2008 by Hao

看到这些,我有一点失落,也许我该跟你说声对不起

Posted in Everything with tags , , , , on October 27, 2008 by Hao
From val

Start Firefox in safe mode

Posted in Computer with tags , , on October 23, 2008 by Hao

Yesterday, my firefox just won’t start, no error message. So I tried to start it in safe mode. Then close it and start it again in normal mode. It works perfectly now.

firefox.exe -safe-mode

Complex conditional Average in Excel

Posted in Computer with tags , , on October 8, 2008 by Hao

Reference http://www.mrexcel.com/archive/Formulas/21143.html

1. Use formula like this one,

=AVERAGE(IF((bigrams!$E$2:$E$81=FALSE)*(bigrams!$F$2:$F$81=TRUE)*(bigrams!$G$2:$G$81=FALSE),bigrams!$C$2:$C$81))

2. Press Control+Shift+Enter when input formula to make an array formula.

3. The same method can be used to do sum and other computation.

test

Posted in ISI on October 4, 2008 by Hao

test

Get most out of the data

Posted in Research on September 13, 2008 by Hao

Ontonotes stats page

Tagged CHILDES

Google Chart API

Posted in Computer with tags , , on September 12, 2008 by Hao

When I was browsing mininova.org, it’s using this Google Chart API to present its statistics now. Google Chart API is a very quick yet powerful way to create your own chart. You just have to pass your chart data in the URL, then you can get the a PNG file for the chart. There are also many libraries or wrappers for this API in various languages. Check the following link.

Related links

Examples,