Dependent Origination

It was my first time solving a programming related problem yesterday, in over six years since I retired 🙂

The problem is how to get all the comments of this post. It is a post about a sick monk who has been in ICU for over a week. The post is asking for prayers and messages for him. And it got 800+ comments. So we want all the comments out of Facebook so that they can be read to the monk.

First things first, we did it, and for free. Below you can find some main steps about how.

  1. Graph API Explorer is a very good tool.  Use it. Explore its functions. I got all the comments by using it.
  2. This Reddit post from two years ago helped me get started greatly. At least, it tells me that this is a task that can be finished with a single HTTP GET.  And it has an example link (https://graph.facebook.com/244944385603396_1599585250139296/Comments) that I can directly copy in the API explorer. Hope!
  3. Bummer! It didn’t work. However, by checking out the explorer interface, the focus was soon on access token.
  4. Now, the entire game is about how do you generate an access token that the API is happy to accept and then give you all the comments.
  5. Use the account that is the Page admin. Three blue dots, you can play with their contents to get the desired access token. Don’t forget to “generate a token” again any time you change something.
  6. The final selection: “Page Comments” (app name), “get_app_token” (token type), “pages_read_user_content” (permission)
  7. Now we got comments!
  8. But not all of them? Change the “limit” parameter (in the top left window of the API explorer).
  9. And you can even select fields that you want in the JSON results.

Other helpful notes.

  1. If I use the “user token” to get comments, I can only get comments made by me. It will tell me how many comments are out there, but it will only return those comments made by me. The debug message reads it is a privacy issue.
  2. Cannot get the commenters’ names or user_id’s. “from” field is grayed out. I figure it must be the design of the api only to return aggregate information, with no identifying power.
  3. How to get your post id? Click on the published time under the post in your feed. It will go to another page. The url has the post id. You can safely ignore those Google analytics fields after the post id.
  4. Use filter (stream) can return comments in chronological order. “summary” in chronological order probably won’t work as you want.
  5. limit = 1000 then we got all 800+ comments in one go. No need to do pagination.
  6. Huge amount of thanks to two error messages. One tells me that I need an app token to continue. This (and looking at the interface for a long time) made me realize that I can change app name and token type, so the game could keep on going. Another error message tells me that manage_pages is deprecated and leaves me a link in documentation to read about it. Reading the documentation (and looking at the error message and interface, back and forth, for a long time) made me realize I don’t need to change the token type from app token to page token, I only need to change the permission type. Two significant steps in figuring out the final parameters. Hooray for those who write error messages with a compassionate heart 🙂
  7. It is ok to feel frustrated along the way. But press on. I can do it. Just need to calm down and think. Or look at it, for a long time 🙂
  8. later command used to get the comments from JSON result: grep “message” comments_raw.txt | cut -d: -f2 > comments.txt
  9. user friendlier way: JSON -> CSV

在Netflix上面看的。讲三个highschool seniors。在高中的最后一年,彼此爱上了。。。一个是Chinese 移民 Ellie Chu(这就是老美电影里面的移民了,其实连这位移民姑娘她爸爸,我觉得估计都是ABC,哈哈),形象非常老套,其貌不扬,看起来没有什么sexual attraction,但是是个很感性,很爱思考人生重大问题的小姑娘。副业就是替本年级的其他那些学校的风头人物写各种class essays, book reports等等。很能写,可以就一个主题,同时交上六篇不同的文章来。

另外一个是高中的运动明星,特别典型的美国人。在这个华盛顿州的小镇出生成长,从来没去过其他任何地方。家里世代是做香肠的。有四个兄弟姐妹,他是老小。表面上笨笨的,说话也说不出来什么。爱上了本校第一美女,可是也只会说She is pretty, I like her laugh, She is different。很不擅言辞。但是其实逼急了说的可好了。比方说被Ellie逼着说出了自己为什么不去外地上大学。妈妈非常在乎这个外婆传下来的香肠生意。可是他的哥哥姐姐们都没兴趣。如果他不继续做,就没人做了。It is breaking either her heart or mine。在好几个类似的关键时刻,都是这个看起来四肢发达头脑简单的Paul讲出了直达人心的语言。

本来Paul是找Ellie来帮他写情书给Aster的。Aster是本校第一美女,相当地popular。男朋友也是本校最有风头的任务。可是Aster其实是一个蛮有性格的姑娘,很爱看书,虽然知道自己与众不同,可是却一直按照大家认为她应该是怎样的在生活,交男朋友,和其他美女们厮混。

总之,一开始的时候是Paul爱上了Aster,找了枪手Ellie来代写情书。但是在写情书的过程中,Ellie自己爱上了Aster,Paul爱上了Ellie。

影片开始的时候的一小段动画蛮好看的。人本来是两个头,四只手,四只脚很高兴地生活着。但是God一分为二,每个人都要花掉一生的时间去寻找自己的另外一半。假如找到了,就圆满,高兴,快乐到了顶点。最后的结尾?显然不再同意这个结论了。

关于what is love。还挺好看的。最后的结论稍微弱了一点,但是还是比大团圆好看多了。

Samsung washer, displaying “nd” on its panel. A more official explanation.  The same nd error happened to me in 2017. Read for reference.

I did two things:

  1. find the plug near the bottom of the washer. find a shallow pan. unplug. water would rush out. Might be a lot of water. So be prepared. In my case, water even came out of two places. So my laundry room floor is flooded still. It would be a good idea to lay down some towels around the washer and dryer next time.
  2. find the hose behind dryer. It is together with another two cables. The two cables are screwed in. The hose is placed loosely. Adjust that hose, so there is no pinch or anything.

Then start an empty cycle to test out if water can drain out of the washer. Finger crossed it would.

昨晚在台北看的。还行。结尾太仓促。如果是个悲剧,传递的力量会要强大很多。最后怎么好起来的,一笔带过。怎样找到自己的声音,也是突然出现的。结尾要是水平再高一点,这就是女权主义的经典了。

前面很好看。这些经历,我们或多或少都经历过。没有这么严重。看起来韩国真的是重男轻女太严重了。但是韩国其实和中国北方差不多。基本上就是山东吧!看起来很恐怖😱 很多很多的女生就在这种环境的影响之下,一生之中,可能连自己都意识不到,成长,成熟,度过自己的一生。

很多人真的是意识不到。她自己其实是深深地被影响。平时的言语,行为都时刻在展现。比方说,今天没有男生在,没人能够带领共学,我们怎么办呢?她们自己完全认识不到的。告诉她,她都是全口否认的。能够检省自己的见解的人是非常少钱。首先遇境要想着检查自己的动机。其次要有分析出自己的见解的能力。这两条其实是很高的要求。

电影🎦里面的女主呢,我觉得是有点笨。其实别人说的话,没必要都take it in,别人觉得你不重要,那是他的看法,不是我真的不重要。其次,身边的人,就算是父母,公婆,其实假如他们不支持自己,不把自己的利益当回事儿,更有甚者,还经常要来改变你的决定,一定要你照着他们的意思来生活,就没必要把自己的事情告诉他们了吗😀 何苦来?一个词叫做阳奉阴违,另外一个词叫生米煮成熟饭,这是和十分强势的父母公婆来往的诀窍,尊敬归尊敬,照顾归照顾,体贴归体贴,自己该干嘛归该干嘛,早学会,早解决。学不会,那就且折腾几十年。

rules_of_civility

怎么知道这本书的?应该是看到A Gentleman In  Moscow在哪个书单上面。结果顺手看到了同一个作者的这本。就加了。结果前面那本还没看,因为看起来好长啊,就先看了这本比较短的。

好看。非常好看。故事很有转折。人物很有层次。语言非常犀利。这个作者用词生僻,我经常连见都没见过。读了会长很多volcabulary的。

我为什么这么喜欢这本书?因为它match了我的心境。The right choices by definition are the means by which life crystallizes loss. Loss可能包括一个曾经在自己心里的人。一段曾经很美好的回忆。一种曾经很快乐的生活方式。有舍才有得。得到的同时,心里却还有很多很多想说的话,想表达的感谢,歉意,无奈,和茫然。

女主有光环,屡屡开挂。但是真实的人生可能没有那么完美,常常是得到的很珍贵,失去的也很珍贵。可是偏偏一定要有所选择,偏偏就是不能二者兼得。

factfulness

很好看。应该是和Born A Crime同一年看到的。Bill Gates暑假书单上面的书。FB上面好多前同事们看。年初应该就开始了。但是开头显然没有那么引人入胜。作者一共解释了十个,还是十一个我们认知的误区,就是常常以为是什么样子的,但是其实完全错了。开始的Gap instinct我觉得没有那么有意思。可能因为我自己已经注意到了。常常把自己和别人之间划条线,然后自己(和自己的朋友们)就好高兴地对着那边指指点点。如果说学佛让我认识了很多人性的特点,这个特点简直是我印象太深刻的了。很多人都是这个样子,画地为牢,坐井观天,或者更形象的,带井观天。

前两天在等待之中,又拿起Kindle,看了几页,发现其实很有意思哎。看的是哪一个让我一下产生兴趣了呢?应该是Negativity的中间。我终于看进去了。大概花了两三天的时间,每天两个小时?就看完了。很好看。有些地方很有意思。比如作者形容Fear会给decision making造成怎样的影响。他才开始当医生,在急诊室。进来一个飞行员。手脚都在抽动。说话也说不清楚。地上有一滩血。他以为是Russian pilot被Norwegian打下来了,所以第三次世界大战就要爆发了。开始跟Pilot说Russian。结果这个pilot一下子就agitated起来,情绪激动,但是说话也听不懂。他想着这么严重的伤又不知道哪里受伤,拿了剪子打算把飞行员的衣服剪开。关键时刻,一个资深护士吃完饭回来了。说不要剪!这是G suit,很贵的,一万挪威币之类的。然后护士跟pilot说你刚才飞机crash,在水里面泡了二十几分钟,所以手脚在不由自主地抽动,说话也说不清楚,没关系,我们马上就会给你治疗的。然后回过头来跟作者说,你不要站在他的信号袋上面了!原来作者站在紧急信号袋上面,流出了很多红色颜料,看起来像一滩血。

还有在形容Blame instinct的时候,引的一个例子。Syphilis。梅毒。以前很难治疗的病。In Russia, it was called the Polish disease. In Poland it was the German disease; in Germany, the French disease; and in France, the Italian disease. The Italians blamed back, calling it the French disease. 很有意思吧?The instinct to find a scapegoat is so core to human nature that it is hard to imagine the Swedish people calling the open sores the Swedish disease, or the Russians calling it the Russian disease. That is not how people work. We need someone to blame and if a single foreigner came here with the disease, then we would happily blame a whole country. No further investigation needed.

书里很多内容其实平时大概都看到过。但是这本书写的很好。concise and  accurate。读起来很enjoyable。推理很清楚,难得看到脑子这么清楚的人。很多时候都是关于“中道”,既不能冷漠也不能不思考,既不能不行动也不能没有思考马上行动,既不能不接受新消息也不能全盘照收所有的新闻,总之我们自己的责任好好生活,不给别人添麻烦,不给自己添堵,最好还能够为人类社会做点正面贡献。

这是作者描述的十个instinct。后面是解决办法。

  1. Gap. Look for the majority.
  2. Negativity. Expect bad news.
  3. Straight Line.  Lines might bend.
  4. Fear. Calculate the risks.
  5. Size. Get things in proportion.
  6. Generalization. Question your categories.
  7. Destiny. Slow change is still change.
  8. Single. Get a tool box.
  9. Blame. Resist pointing your finger.
  10. Urgency. Take small steps.

二月份听了超级inspiring talk开始每天用善行记录的方式管理自己的生活。有些成效。

上次的五个条目:

  1. 全广不迟到
  2. 每天吃一顿正经饭
  3. 每天iPad screen time少于两小时
  4. 诵经
  5. 晨起皈依

其中诵经totally没有做到。可能诵了三四次吧。完全没有到Daily routine的地步。晨起皈依我做了两个星期就停止了。因为变成念诵之后,我觉得简直是在培养我对佛菩萨的没有感情。就停止了。但是法师说其实应该具体讨论一下究竟怎样修。所以这一条我要等到机会请教究竟如何每天修习皈依之后再说。另外我发现念诵其实不是师父说的方式。师父说的方式是观想。平时可以先练练观想。

其他三条还是蛮成功的。全广不迟到大约花了一个月就基本上做到了。现在还不是每天能做到。但是比开始的时候强了很多。就算迟到也就是两分钟这样子。这次还列出来。希望自己能够真的做到每天都不迟到。一分钟也不迟到。

每天吃正经饭也慢慢开始实现了。我又开始做饭了。有时候还挺认真。所以继续列出来。希望自己做饭的认真程度能够恢复到2007年。哈哈。恢复到十几年前的水平。好好照顾自己。好好照顾自己的身体。身体很辛苦。

iPad的使用时间也大幅下降。现在就是每天早上起来看新闻的时间。以前其实也不是在爬网。比如写日记。现在把写日记当成在电脑上完成的任务。用iPad的时间自然就少了很多。更加重要的是,其实用电脑写作的速度要快很多。所以也省了时间。

前面几个星期太hectic了。现在才把这个夏天的善行条目定出来。希望夏天能够继续进步,把自己的生活管理起来。

  1. 全广不迟到
  2. 每天吃一顿正经饭
  3. 每天iPad screen time少于两小时
  4. 诵经
  5. 拜忏
  6. 每天iPhone screen time少于五小时
  7. 供水
May 2020
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

Twitter

  • is loving shelter-in-place, in fact 2 days ago
  • is sleeping much better during shelter-in-place 2 weeks ago
  • is emotionally ready for the next chapter of life 7 months ago
  • is memorizing Himalaya keyboards and learning to type Tibetan. So exciting. Chinese, English, Spanish, now my fourth language Tibetan! 8 months ago
  • this is a special summer 11 months ago

Flickr Photos