Friday, June 12, 2009

Summer

Here comes summer, a season of departures, when the Welly lads are setting out for Hong Kong and New York; and a start of adventures, when two dear friends have just got married and are leaving Beijing for the South. Wish you all good luck!

Monday, May 04, 2009

Congrats to Zhenyu

... who has successfully and completely turned into a family man!

It seems that everyone is getting married in 2009...

Sunday, March 01, 2009

maxrss

The ru_maxrss field in struct rusage provides a convenient way to measure peak memory usage of a program (via getrusage, wait4, or simply `/usr/bin/time -p') on BSD systems, including Mac OS X. According the man page, ru_maxrss represents `the maximum resident set size utilized (in kilobytes)'.

Let's try it on Mac OS X (Leopard, 10.5.6).
$ /usr/bin/time -l uname -v
Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386
0.00 real 0.00 user 0.00 sys
385024 maximum resident set size
...

Do you really think the simple `uname' could take 385,024 KB (376 MB) memory ? It also reports 282624 maxrss for a small C program that only contains an empty main and is compiled by `gcc -O2'.

Here is a comparison.

FreeBSD 7.1, kern_clock.c
 527 rss = pgtok(vmspace_resident_count(vm));
528 if (ru->ru_maxrss < rss)
529 ru->ru_maxrss = rss;
Note pgtok is often defined as follows.
#define pgtok(x) ((unsigned long)(x) * (PAGE_SIZE / 1024))

Mac OS X 10.5.6, kern_exit.c
 612 p->p_ru->ru_maxrss = tinfo.resident_size;
task.c
1205 if (flavor == TASK_BASIC2_INFO_32) {
...
1210 basic_info->resident_size = pmap_resident_max(...);
1211 } else {
1212 basic_info->resident_size = pmap_resident_count(...);
1213 }
1214 basic_info->resident_size *= PAGE_SIZE;

Does Apple forget `/ 1024' or something? Hope Linux would not give a strange number.

Saturday, November 29, 2008

Washington, D.C.

I visited the turbo couple at Silver Spring, MD for thanksgiving (zig happened to be there, too). After enjoying a perfect homemade hot pot, we went to Washington, D.C. the next day. It was so crowded everywhere, from metro stations to museums. It made me feel even sicker when facing crazy drivers and policemen carrying guns...

The Washington Monument and the Reflecting Pool, as well as the Capitol Hill far behind and the National Museum of Natural History on the left (where we had lunch).


Another shoot.


The Lincoln Memorial and the National World War II Memorial.


The names of the States in the entablature of the Lincoln Memorial. Here goes Massachusetts, MDCCLXXXVIII (1788), when it became the sixth state to ratify the Constitution.


Squirrels everywhere. Here is one near the Reflecting Pool.


The White House and a Christmas tree.


Another Christmas tree in the Reagan airport.

Monday, November 17, 2008

One Day Off

Ah, take a breath of fresh air around Boston and Cambridge (with a visitor, amber) after the deadline, more to come though. It is getting so old in Boston. (but why 20 °C yesterday!)

Harvard Memorial Church (bird's eye).


The harbor (near the Maverick station, blue line).


Pity that I have missed shooting the colorful fall...

Thursday, October 16, 2008

When You Believe

Just can't believe some boy can sing the Oscar-winning song "When You Believe" (the main theme of the film "The Prince of Egypt") so well.

David Archuleta


Whitney Houston and Mariah Carey


He has this incredible voice. Enjoy more in Heaven and his new single Crush.

Time for the 90's.

Sunday, October 12, 2008

Mad World

This is actually a pretty old song. I like the version performed by Gary Jules.
All around me are familiar faces
Worn out places
Worn out faces
Bright and early for the daily races
Going no where
Going no where

Their tears are filling up their glasses
No expression
No expression
Hide my head I wanna drown my sorrow
No tomorrow
No tomorrow

And I find I kind of funny
I find it kind of sad
The dreams in which I’m dying are the best I’ve ever had
I find it hard to tell you
I find it hard to take
When people run in circles its a very very
Mad world
Mad world

Children waiting for the day they feel good
Happy birthday
Happy birthday
And I feel the way that every child should
Sit and listen
Sit and listen

Went to school and I was very nervous
No one knew me
No one knew me
Hello teacher tell me what’s my lesson
Look right through me
Look right through me

And I find I kind of funny
I find it kind of sad
The dreams in which I’m dying are the best I’ve ever had
I find it hard to tell you
I find it hard to take
When people run in circles its a very very
Mad world
Mad world
Enlarging your world
Mad world

Can't believe being a nearly 30-year-old, rotten guy, he is eating rubbish, taking classes, and even doing homework every day!

Tuesday, September 23, 2008

Gloucester

Had a nice day for the CSAIL Student Workshop at Gloucester, MA, though pity bad weather again. Thanks to the organizers!

The workshop was held here, pretty cold even inside!


Some CSAILers.


Birds in fall.


Last but not least, the lobster dinner!


It was also great to see several 9#ers there: justin, sola, theorist, and zig.

Friday, September 12, 2008

Newbury

Here's the group outing today, at Newbury, NH, about two hours drive from Boston. Thanks to Silas for driving! Thanks to Frans for inviting us!

Lake Sunapee, pity the bad weather though. Actually that's just an island faraway in the photo; the lake is pretty large.

Aleksey was sailing.

Tubing is absolutely an awesome sport! Frans drove his motorboat and one tuber grabbed a tube behind it. Jeremy, Neha, I, Yandong, and Aleksey enjoyed it in turn, reeeeally cool! Besides advising students the almighty Frans was so good at cycling and making waves to throw them off!

Saturday, August 16, 2008

Newport

Just enjoyed a nice weekend at Newport, Rhode Island with mystery and riki. Many thanks to mystery for driving.





We took the Cliff Walk, which starts from Memorial Blvd. We exited around Marine Ave. There are many beautiful mansions along the way.





BTW, we even saw a rainbow on the way back to Boston. :-)

Saturday, August 09, 2008

The Longest Day

36 hours for the Saturday: 12:00 pm at Beijing, 9:00 am at San Francisco, 8:00 pm at Boston.

On the way to SF, i saw the second sunrise today.

Saturday, August 02, 2008

Haikou Bay

A walk along the shore with my family.



I love sunsets. :-)

Tuesday, July 29, 2008

Replay

It's so perfect that our replay work R2 finishes with an OSDI acceptance. Just got the news right before saying goodbye to my friends at MSR Asia. Awesome the past two years!

Silas's paper on multicore OS was also accepted. Congratulations!

Welly: Rethink the BBS

In the past month I have been hacking the Welly BBS term client while waiting for the visa approval. I was fortunate to work with some amazing people: aqua, gtCarrera, and KOed, who are nice, young, and smart. I envy them. :-)

The project was initially a fork of Nally, which was developed by yllan and now is maintained by jjgod. It uses Core Text for rendering, much faster than state-of-the-art (ATSUI based) BBS terms on Mac OS X. Nevertheless, we don't want a general terminal application; there are enough good ones. Welly is tailored for exploring BBS, where we can also try fancy stuff for fun, such as Cover Flow and Quick Look integration that I finished recently.




One day Geoff asked me why Chinese prefer such old-fashioned term BBS sites. Yes, this is a little bit weird. It seems that most people, particularly on-campus students, prefer telnet access and the terminal way to present and exchange ideas. Some even spend hours there every day, as I did. We are using terminal emulators that have a history of more than 20 years, though they may be implemented via modern technology. Many term BBS sites also provide Web access and may use AJAX extensively, however, the core parts are derived from aged systems, mostly either Firebird or Maple.

I can still remember the days in 2005, which consequently drove me to get down to preparing for GRE and brought me two awesome years at MSR Asia as well. It changed anything, as least to myself --- I once had a dream of having a good job and a stable life in the city but gave up after the hard time. Thanks to better who stood with me. The immediate issue of Sci-Fi World, the most popular Chinese sci-fi magazine, came up with a Ma Boyong's novel titled The City of Silence, which quoted from the famous song by Paul Simon:
People talking without speaking
People hearing without listening

I guess I might be overacted at that time, but there is no turning back.

Here is the move within a couple of weeks: Beijing => Haikou => Beijing => San Francisco => Boston.

Sunday, June 01, 2008

Apologize

Apologize, a song.
I'm holding on your rope
Got me ten feet off the ground
And I'm hearing what you say
But I just can't make a sound

You tell me that you need me
Then you go and cut me down, but wait
You tell me that you're sorry
Didn't think I'd turn around, and say

That it's too late to apologize, it's too late
I said it's too late to apologize, it's too late

I'd take another chance, take a fall
Take a shot for you
And I need you like a heart needs a beat
But it's nothing new

I loved you with the fire red
Now it's turning blue, and you say
Sorry like the angel
Heaven let me think was you, but I'm afraid

Thursday, May 22, 2008

Once

May 19-21 is the mourning period for quake victims, who speak the same dialect as I do. I was born there and sometimes lived in Chengdu during childhood. My cousins there have been telling me all about the horrible days. I wish them the best of luck.

Btw, got a nice birthday gift this morning, the music CD and DVD of the film Once including the song Falling Slowly. Thank you, my friend.

Thursday, April 17, 2008

Falling Slowly

Falling Slowly, performed by Glen Hansard and Markéta Irglová in the movie Once, is the recent Oscar winner, the Academy Award for Best Original Song.
I don't know you
But I want you
All the more for that
Words fall through me
And always fool me
And I can't react
And games that never amount
To more than they're meant
Will play themselves out

Take this sinking boat and point it home
We've still got time
Raise your hopeful voice you have a choice
You've made it now

Falling slowly, eyes that know me
And I can't go back
Moods that take me and erase me
And I'm painted black
You have suffered enough
And warred with yourself
It's time that you won

Falling slowly sing your melody
I'll sing along

The second sleepless night this week, after listening to such amazing movie songs. Smile with tears, and sing with thanks and hope.

Friday, April 11, 2008

Building CIL on Leopard

Following the standard configure/make approach to build CIL on Mac OS X Leopard (10.5), one may encounter the following error:
Compiling obj/x86_DARWIN/feature_config.ml to bytecode
File "obj/x86_DARWIN/feature_config.ml", line 4, characters 1-2:
Unbound value n
make: *** [obj/x86_DARWIN/feature_config.cmo] Error 2


It is due to the echo command in the file Makefile.in (around line 230):
echo -n " (* EXTRAFEATURES: *)" >> $@
Because Leopard follows the UNIX specification more strictly, the syntax echo -n is no longer supported by /bin/sh.

To fix it, replace echo -n with printf, or use /bin/echo, or just omit the -n option.

See #1940018.

Monday, April 07, 2008

Gong Qi

Some pictures shot on Feb 10 during the Chinese new year, at Baoluo, Wenchang, Hainan. It's my friend Feng's hometown; I went there with him to see the famous "Gong Qi" ceremony.

"Gong" (literally, "lord") may refer to a chief or a leader of the early migrates to the Hainan island from the Mainland (one thousand years ago? not sure), as some people tell. If so, I guess the purpose of the ceremony may be similar to the thanksgiving. But some other people say it is related to Xian Furen (Madam Xian), a leader of the Yue peoples in southern China (in the 6th century), and the Feng family is her descendants.

Every year a lot of people come back from cities and share the time.


Fireworks after the ceremony.


Feng's little boy. Cute? :-)


The quiet village.

Wednesday, March 19, 2008

New Labels

To be consistent with the name of this blog that embraces a filesystem naming style, I am introducing the following labels for my posts.

/dev/random, replaces "code", which is inspired by the homonymous column in the USENIX magazine ;login:.

/media, replaces "movies" and "music" for entertainment.

/mnt, for mount points, replaces "travel". Of course it includes trips more than those to mountains.

/usr/X11R7, where the X Window System resides, replaces "photos". When will it be replaced by "/usr/X11R8"?

/var, replaces "uncategorized" for scribblings, e.g., the current post.