Dependent Origination

Archive for November 2012

This is because you output stuff to the output buffer of php before you want to write Header lines.

Tags: , ,

let’s say you want such a map

unordered_map<pair<int, int>, pair<int, int>> m;

you have to provide a hash function, otherwise you are going to run into compiler complaints about std:hash<your customized key type> is not specialized or something like that. in fact, if your type is really customized, you have to provide an equality function too since the map needs to know which bucket to put a key in, and how to tell if a key is equal to another key.

since we are using pair, which has already defined == operators, we just need to provide a hash function to the definition of the map.

the function is defined like this. note we are using the first component of the pair to be the hash key. you can do any fancy algorithms here.

typedef struct {

long operator() (const pair<int, int> &k) const {

std::hash<int> hasher;

return hasher(k.first);


} PairKeyHash;


unordered_map<pair<int, int>, pair<int, int>, PairKeyHash> variable_;

and all done!


1. pair type reference

2. unordered_map reference

3. this article helps the most

I finally did it with my colleagues! About the same time (September/October) five years ago I first got the idea of a midnight hike to Mission Peak and tried to make one happen with a few new friends met then — it started raining and we had to cancel the hike one Friday night. Now the same thing, one random Friday afternoon, one lazy Friday afternoon at work, a few of us started talking and we decided to hike the Mission Peak that night! They picked me up after my weekly Buddhism study and off we went to Fremont!

It was a really nice hike — the sky was lit with stars and the new moon (waning gibbous to be exact 🙂 rose when we approached the peak for the last half mile. You can see stuff even if there is no lights around but you see the rolling hills, the occasional trees and the sleeping cows with such clarity that day or night it doesn’t make much difference — well, sans the penetrating California sun is probably an added bonus!

We even had s’mores at the peak — one of my colleagues is a serious hiker so he took stove, chocolate, ginger graham crackers and marsh mallows with him and we had a fun time~

The most remarkable thing is we almost stepped on a baby rattle snake — well, the visual designer discovered it! After his shout out, all headlights were pointed to the rock but it still took me likt a minute or two to recognize the snake. A bit scary, we were much more careful about where we were going and what we were stepping on after it. Baby rattle snakes are said to be the worst since they haven’t learned controlling the amount of venom to release so they just go all in — the adult rattle snakes usually just release enough venom to make the threat immobile, if they are not happy, like being stepped upon during sleep 🙂

Would love to do it again — so good an experience!

Io Sono Li 我是丽 英文名字 Shun Li and the Poet 我很喜欢 回国的飞机上看的 缓慢淡然而真实 电影自己就像一首诗 从时间和因为太多求而不得缩成一团得心上流过 流下一些温暖 带走一些向往 生活和命运是两个最任性的小孩子 他们给予同时拿走 你无法期待 也无法谈判 只能等待

Go Masao 也是飞机上看的 话说加航的娱乐设施不错 每人自己看自己的 电影的选择也很多 尤其世界各地的电影都有 还有一个专门的法国艺术电影专类 想到就算美国航空公司有这样的服务 里面肯定也全面的是好莱坞弱智喜剧 不要以为我不喜欢弱智喜剧啊 我很喜欢看弱智喜剧的 不过有时候还想看点儿别的而已 *_* 这个是个日本弱智喜剧 但是因为有一只狗是主角 所以不能和好莱坞弱智喜剧是一个档次的 要高一点:)

Rain Man是回到家这两天倒时差的时候看的 好看 好看 好看死了 小时候应该看过 虽然我想不起来是什么时候什么情况下看的了 还是我根本就没有看过全片?而只是在大众电影上面看了简介和剧照?或者在电视上面看短片?中国的电视现在还有很多类似的节目:几分钟给你看看 就知道是怎么回事儿了 出去朋友说起来你也可以跟着评论几句 事实上 从书到电影到电视节目 很多人其实什么都没看 但是绝不妨碍他们写长文论述它怎么好 如果没什么人知道的东西 或者怎么差 如果是很多人知道的东西 遇到得多了 我连话都懒得讲了 觉得我的人生 绝对不能没有看过就批判或者赞美 脸书的连接都包括在内

赵涛是我很喜欢的女演员 很会演戏 我是丽里面演得很好 和电影浑然一体 以后想起她来都会想到昏暗的小酒馆里面因为讨旧债被混混威胁不得已退后但是仍然倔强的拿起小本子去收债的她 达斯汀霍夫曼就更不用说了 自闭症患者都被他演神了

November 2012


Flickr Photos