Feeds:
Posts
Comments

去年寒假在纽约遇到超级暴风雪,今年学乖了去四季如春的西部,12天的旅程,Las Vegas到Los Angeles,然后遵循Sheldon的教诲坐amtrack的coast starlight去San Francisco

1. 沙漠中的Vegas总是表达得那么直白,也算是人类史上的一朵奇葩,不过治安倒是与之产业结构不相称的好

2. Circus Circus的门口的标志小丑,Vegas是个不夜城,睡个懒觉,吃个buffet,晚上开始活动了

3. 大概是童年看了太多《三国演义》中的打打杀杀,对米国的Disneyland实在是提不起兴趣,不过晚上的水幕表演倒是给了我很多的启发,中国古代文化中那么多的素材,如果建一个theme park来好好包装展现,显然要比这个Disney有意思的多,老祖宗给我们留下了许多东西,我们却白白得浪费掉了。

4. 去Mulholland Dr. 全然是为了向当年David Lynch的同名电影致敬

5. 去Beverly Hills则是去偷窥一下美国的高帅富们究竟过着怎样的一种生活

6. 真的到了Hollywood的中心地带,除了那个中国戏院算是一个亮点,其他实在是很搓,盛名之下其实难副啊!

7. Griffith Observatory可以看到LA的夜景,但是LA太大了,远不及NYC和芝加哥的downtown夜景漂亮,只能快门加长拉个线了

8. 第一天的三藩大雾封城,不过有这样的肃杀气氛,Alcatraz就反而有意境了

9. 远处的若隐若现的Bay Bridge,不知PM 2.5多少,是雾是霾

10. 第二天的三藩天气出奇的好,否则印象岂不是要大打折扣了。 三藩建在山上,这样的路比比皆是,对车技绝对是一大考验。

11. 天空一扫昨天的阴霾

12. 不能免俗得来一张明信片

13. 不能免俗得再来一张

14. 三藩华人占20%,亚裔更是占到了三成,公车上的广东话报站就能看出这座城市族群的多寡。每到一个城市,我们都会去一下当地的唐人街,一来为了解个嘴馋,二来可以看到一些中国大陆已经消亡的了几十年的场景,繁体字,青天白日旗,福建会馆,x氏宗亲会,就像那一部下档多年的民国老电影

Madrid & Toledo

开conference, 第一次去欧洲, 跟着rossetta stone学了一周的西班牙语貌似也没派上什么用场,听是完全的不行,说偶尔可以蹦一两个单词,读倒是还好, 基本能猜个八九不离十。

1. 在Puerta del Sol看到的隐身人,第一次看到的时候觉得挺神奇的,后来发现马德里到处都是,看来也是有模板的。

Puerta del Sol

2. Royal Palace of Madrid门口骑马的警察

Royal Palace of Madrid

3. 街头随处可见香烟店,果然是美国人酗酒,欧洲人嗜烟,不过有那么高比例的女人抽烟我还是有点诧异的

Tabacos

4. Prado门口的剪刀手爱德华,看过Prado和Reina Sofía,才知道Velázquez,Goya, Picasso,Dalí这种西班牙本土画家都可以大白菜式的展示的。

Museo del Prado

5. 旅馆里正在放西班牙语版的机器猫

Doraemon

6. Las Ventas斗牛场,昨天刚看到一个被牛角戳爆左眼的斗牛士的新闻,太血腥了。

Las Ventas

7. 最后一天去了Toledo,那遇到学生游行抗议削减公共教育经费,想到后来10月15日在Sol的Occupy Madrid,可惜了,没赶上

Toledo

select

http://www.lowtek.com/sockets/select.html
One traditional way to write network servers is to have the main server block on accept(), waiting for a connection. Once a connection comes in, the server fork()s, the child process handles the connection and the main server is able to service new incoming requests.

With select(), instead of having a process for each request, there is usually only one process that “multi-plexes” all requests, servicing each request as much as it can.

So one main advantage of using select() is that your server will only require a single process to handle all requests. Thus, your server will not need shared memory or synchronization primitives for different ‘tasks’ to communicate.

One major disadvantage of using select(), is that your server cannot act like there’s only one client, like with a fork()‘ing solution. For example, with a fork()‘ing solution, after the server fork()s, the child process works with the client as if there was only one client in the universe — the child does not have to worry about new incoming connections or the existence of other sockets. With select(), the programming isn’t as transparent.

http://ozark.hendrix.edu/~burch/cs/230/cso/ch13-sub/index.html

Assembly programmers divide the registers into caller-save registers and callee-save registersCaller-save registers are those that the subroutine may change, such as R0 through R3 in the ARM convention described above: They are caller-save because since a caller of a subroutine must save the registers’ values if it wants the values after the subroutine completes. Callee-save registers are those that a subroutine must leave unchanged, like R4 through R12 is the convention described above: Upon being called, the subroutine (the callee) must save the registers’ values if it wishes to use them.

It’s beneficial for a calling convention to designate both caller-save registers and callee-save registers. If the convention designated all registers as callee-save, then subroutines would not be able to use any registers at all without saving them onto the stack first — which would be a waste, since some of the saved registers would be transient values that the calling subroutine did not care about long-term. And if the convention designated all registers as caller-save, then programmers would be forced to save many registers before every call to a subroutine and to restore them afterwards, lengthening the amount of time to call a subroutine.

/************       comment      ******************/

Caller only needs to save the caller-save registers that is live *across* the subroutine call. If it will not be used after the calling, there is no need to save/restore them.

Callee only needs to save the callee-save registers that are used in the body of its subroutine.

If it is a leaf procedure, just use the caller-save registers as often as possible. If it is a non-leaf procedure, if the variable is live across the call, callee-save register is preferred.  Otherwise, just use the caller-save registers.

http://classes.engr.oregonstate.edu/eecs/spring2009/cs472/MIPSXCallingXConventionsXSummary.pdf

For MIPS, argument registers $a0 ~ $a3 are used to pass the first four
arguments to a subroutine. These arguments are not copied into the Argument Section by the calling subroutine, but the space is reserved. If this procedure is non-leaf, before calling other subroutine, it should save the argument registers(the number is according to its own argument number) in the reserved area of caller’s stack frame. Then it can reuse the argument registers to pass the arguments to the callee.

gnome-terminal -e “ssh -t username@remote_machine ‘command; bash -l’”

BOSTON:

MIT CSAIL 所在的Stata Center,这大概是MIT无聊乏味枯燥的建筑风格体系中唯一的亮点了,不过看到实体之后,还是感觉憋得慌,每天要看到这幢楼的计算机系的人们,会不会神经特别紧张?

MIT的Mechanical Engineering系一个professor的门口看到的,这个名字很有意思,MIT+SOS

 

NEW YORK CITY:

纽约的生活比波士顿精彩了许多,但是对于我们这种习惯农村的人们来说,人还是太多了一点,地铁还是太脏了一点,黑哥们还是太吓人了一点。

光鲜的时代广场

自由女神前的小鸟

曼哈顿华埠的Beatles

What’s going on here? @ Brooklyn Bridge

大都会博物馆的素描先生

帝国大厦下躁动的大苹果

暴风雪之后的哥大地铁站

 

PHILADELPHIA:

亲历纽约那场20年不遇的暴风雪,看到费城的好天气那是相当的感动

UPenn附近的medical center

Benjamin Franklin Bridge下的移民壁画

 

WASHINGTON DC:

DC很像北京城,规整而干净,可是找家吃饭的地方却是那么的麻烦

Jefferson memorial,像不像黄金圣斗士的十二宫?

受诅咒的Hope Diamond

被遗忘的韩战

When writing the bib for a cite and there are multiple authors for a paper, they should be separated with “and”, not with commas. This example is from wikipedia

@Book{Torre2008,
 author    = "Joe Torre and Tom Verducci",
 publisher = "Doubleday",
 title     = "The Yankee Years",
 year      =  2008,
 isbn      = "0385527403"
}

Otherwise, BibTex will rearrange the names. The first author will be depressed and feel unfair in that case. LOL.

上周末

小小摄影师亚克西和她的助手小松鼠

背后总是充满了不经意的喜感

在St. Joseph的Michigan Lake旁

当我们走到这家店port412门口的时候, iphone上的yelp也指到了它

恩,过往只是前言

sudo redirect

If you use the command like

sudo echo 3 > /proc/sys/vm/drop_caches

it will not work because pipe does not allow privilege escalation.

There are two alternatives for this

1. use sh

sudo sh -c ‘echo 3 > /proc/sys/vm/drop_caches’

2. use sudo tee

echo 3 > sudo tee /proc/sys/vm/drop_caches

via tee(command)

The usage of tee: The output of ls -l is redirected to tee which copies them to the file file.txt and to the pager less. The name tee comes from this scheme – it looks like the capital letter T

第一次去Chicago,是那个刚来美国寒冷的夜晚,打了个匆匆的照面,苦等机场门口的aircoach,管bus的黑人小妞蛮横的样子,给了那个来自遥远东方的迷茫小孩狠狠的下马威。

第二次去Chicago,逛field museum,走Michigan Ave,看老朋友,又一次回到大城市的生活,甚是好奇,充满感动。

第三次去Chicago,走了个遍,却又重新怀念起拉法叶的小镇生活,安宁平和而温暖。

1. 经过Hancock 附近的bus

2. Sears Tower俯瞰,华灯初上

3. Downtown的夜晚

4. 沙滩的阅读

5. 记得小时候我也这么骑在老爸的肩膀

6. Art Institute前的卖艺人

7. 画中人

8. 东西方女性

Older Posts »

Follow

Get every new post delivered to your Inbox.