Dependent Origination

Archive for August 2012

the_hundred_days

这本书我是因为爸爸病情恶化 改票匆匆赶回北京的路上第一次看的 最近又看了一遍 因为第一次虽然理论上把每一页都读过了 但是一点都没往心里或者脑子里去 后来好几次拿起又放下了 很怕相关的回忆又回来 这次终于又看了一遍 觉得不是特别好看 只能是average Patrick O’Brian的说 看完的主要动力是我想完成Aubrey and Maturin的全集 当然average Patrick O’Brian is probably better than best of 90% books out there so don’t think it is bad — it is your expectations will be raised fairly high after a couple Patrick O’Brian’s.

I still miss Dad. 偶尔还会做梦梦见他 他总是很eager to please me, as usual 每次醒来 都很伤心 也很茫然 因为he won’t be in my real life any more 唯一欣慰的是 他每次出现 精神和气色都不错 穿着这件或者那件我很熟悉的衣服 看起来就是pre-cancer的样子 所以虽然伤心 我想他应该顺利的投胎到人道了 他一向愿意牺牲自己成全别人 看来积累了一些福报 只是不知道他投到了哪个人家 家道是否殷实 父母是否善良厚道 不知道他新的人生能不能少受点苦 能不能让他按照自己的意愿活一次 哪怕就几年 所以我的心里难免有些担心 怕他性子不改 还是瞎乐观 随便扔掉自己的所有 去赌一个未知 希望他新的生命里面至少能够赌到些东西吧 不要输太惨 如果遇到困境 希望有贵人去帮帮他 然后 运气好一点 过的开心多一点 想起来的时候 回来看看 梦中也有一个世界

没什么意思 最前面稍微有点意思 其他的太套路了 介绍一下人物 复述一下他的有名剧本大概是讲什么的 给个评语 我已经看不了这样的东西了

what i am really trying to do here is i want the output from mongodb all printed on a single line so that i can use mongoimport later to read them back.

<code>

var cursor = db.web.find({“created”:{$gt:timestamp}});
while (cursor.hasNext()) {
var str = tojson(cursor.next());
str = str.replace(/(\t|\r\n|\n|\r)/gm, “”);
str = str.replace(/\s+/, ” “);
print(str);
}

</code>

g — replace more than once

m — replace multiple lines

i don’t know why i keep getting ‘Syntax Error: missing ; at the end of statement’ for my single-line test javascript scripts i am planning to develop into a cron job to run regularly against mongodb.

it was puzzling, to say the least. i ended up deleting stuff, making the line shorter and shorter to a state it works with no grammar complaints, then added back the stuff i wanted. and it works in the end, with the same line, which was being complained about a few minutes ago.

still a mystery on what is going on.

reason why we need phpsh?

1. it is awesome 🙂

2. when we were using ubuntu 10, you can do php -a and it is a decent interactive shell for vanilla php. and i run into problems making phpsh recognizing our own database so i just get by php -a for a while. but now that we upgraded to xfce, it turns out there is licensing issues with read-line, so xfce (and some other distributions) comes with php without read-line support, which means php -a is now practically useless.

3. phpsh can work with your own codebase, which makes testing, prototyping orders of magnitude easier.

so here we go, installing phpsh.

the vanilla one (phpsh) works out quite easy. the trouble is always at (phpsh your_code_base_include_file_list). when you try to access your own php classes, functions etc, it is always class not found. why?

in fact, i don’t understand why. the way phpsh works, it is a python script that invokes a php script, and establishes pipes to the php processes. when you invoke the php script, it calls ‘php file options etc’ directly, which in turn should be reading the /etc/php5/cli/php.ini file, where you can change include_path so it would find your classes.

but it doesn’t work — for some reason, the installation on the network drive doesn’t seem to read in the php.ini on my drive at all. a really local installation in fact can read it.

anyway, how to make it work? lots of options.

1. you can change inside the phpsh.py script, the comm_base parameter, when invoking php, instead of ‘php’, put in ‘php -c /etc/php5/cli/php.ini’ –> this works, i tested. however, not sure if it works with the xdebug enabled version of phpsh.

2. alternatively, you can change the phpsh.php script, do ini_set(‘include_path’, ‘path_to_your_codebase’) and it works, i tested.

the benefits of these approaches are you can put in multiple include paths, in case the php code you want to play with scatters around. but these requires changes every time you update phpsh (if you do that at all).

3. the easiest approach doesn’t require you to do anything — just invoke phpsh include_file_list from the directory you would have put in include_path. –> for most cases, this should just work.

that is a fun few hours to figure out what is going on with phpsh 🙂

art_of_fielding

I like the first half, which is like five stars. It feels like the author loses his grip on the characters and plots in the second half of the book. For one thing, the architect showed up and ate dinner and were just gone, without any other splashes. For another thing, the great namesake of the fictional bible for a shortstop in the book showed up and ate dinner with the team and were just gone too, when I totally expected he would be cruicial in helping Henry to regain his confidence.

The build up to the climax is exceptional — fully developed characters (with very familiar cliche’s, sometimes) which draws you in. However, the climax is nowhere to be found. Don’t get me wrong — I love the premise of the book: self-doubt and its eradication. Who never has any doubts about themselves? Who never think of the question whether they are right or not? Or how did they do what they do? I was expecting quite some soul-searching, introspection on the way to confidence again but the book didn’t deliver on the solution, thought it describes the problem very well.

I think the author has potential. The book is full of literary references. Having not read Moby Dick, or the books or poems they were citing, I am sure I missed lots of the references. Had it had a better second half, I might go back to read the book once I finish reading all the classics 🙂

that is because it is the gnu ctags, not exuberant ctags.

user@hostname:~/source_directory$ ctags –version

ctags (GNU Emacs 23.4)
Copyright (C) 2012 Free Software Foundation, Inc.
This program is distributed under the terms in ETAGS.README

now do sudo apt-get install exuberant-ctags

you should see this:

user@hostname:~/source_directory$ ctags –version
Exuberant Ctags 5.9~svn20110310, Copyright (C) 1996-2009 Darren Hiebert
Compiled: Apr 14 2012, 13:09:28
Addresses: <dhiebert@users.sourceforge.net>, http://ctags.sourceforge.net
Optional compiled features: +wildcards, +regex

now run ctags -R *

with the ‘-e’ option you can use “\n”, “\t” etc with ‘echo’

Image

这个是2008年去危地马拉的时候开始的 还记得在semuc champey的hipster聚集的小木屋营地里面 外面一直下雨 我们只好在木屋里面聊天 后来在guatemala city上飞机的时候 机场安检的人一定要没收我的毛衣针 我只好站在安检那里收针 然后恋恋不舍地把我的昂贵毛衣针留给了他们 后来回来发现没有了stitch marker很难继续 我只好全拆了 重新开始 这么一折腾 我又开始了新工作 忙的天昏地暗 再也没有继续了 如今四年了 上个月我每天一个小时 居然很快就搞定了 而且很愉悦 是个fun pattern!

但是时隔四年最大的问题是我发现当年毛线团没有买够的时候 怎么办呢 网上都没有这个颜色了 我只好去local yarn store碰碰运气 my favorite local yarn store居然换了owner 现在是两个英国人 比以前好 走在los gatos downtown 止不住的回忆往心头涌 当年经常和同事们一起来买毛线 在街角的越南店吃午餐 聊天儿说话 如今这些同事纷纷去了不同的公司 很少再联系了 但是当年刚刚工作时 实在是一段快乐的时光

跑得太远了 🙂 话说my favorite local yarn store的人替我查了一下 发现店里还有十团和我同样色号 但是dye lot不一样的线 不在架子上面 在楼上仓库里 她说去看看 看到她下来手里拿了东西的时候 简直是七月份最开心的时刻 🙂 我买了两团 并且以惊人的motivation和execution完成了剩下的部分 因为我看见她们把剩下的八团马上就拿出去买了 我怕我要是慢悠悠的这两团用完了就真的没有地方再有了 🙂

很好看 但是找不到人给我拍一些披上的照片 以后再照!

用的是Rowan Wool Cotton, SH903 LOT17C6 123 yards/skein 大约七八团?之前用了几团不清楚所以这个数字就只能是个谜团了! 针是八号针(我认为啊:)


August 2012
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Twitter

Flickr Photos