Dependent Origination

Archive for July 2012

user@hostname:~/$ ifconfig
bash: ifconfig: command not found

it turns out that you need sudo to do it on xfce.

* make sure you run sudo apt-cache search net-tools so that net-tools is installed on the machine

Haven’t done this for a long time: a collection of recent skincare products I have used — none of them were strikingly good — in fact most of them were not as good as some of my stellar products in the past. I like the Clarins eye contour balm, which I bought and used up several times.


I am spending less time on an airplane to read so the amount of reading is dropping significantly — it used to be a plane ride = a book read. I came across this guide on weibo about how you should kill the however many hours of flight between China and US — i cannot stop feeling fidgetting after reading it — do people lose their capabilities of spending sometime with themselves??? I don’t understand why you need a guide to kill time and I don’t understand why that ten, twelve, fifteen hours can be so intolerable to some people that after reading what they write i feel as if i was spending some intolerable time myself.

Anyway, back to the novel. The first chapter or so was a bit dragging, with a young hand at writing — I think this gotta be an early work in Murdoch’s career that you can sense the naivety with which she wrote and planted plot devices. However, everything changed a few chapters into the book and it became a page turner, plot wise. I don’t exactly like the ending, since it is too much, too impossible for a person to be in such position. All in all, I like the Bell a lot better but I will keep on reading Murdoch since she appears to be writing about our weaknesses more frequent than other people.

date +%s

This solution isn’t found by me — it is found by my teammate. But since we have spent quite some hours trying to get our thing compiled together, I took the liberty of writing it down here 🙂

The problem is when we include header files from mongo they have macros defined and undefined in their module. Classes are fine since they are in a separate namespace. Macros are really messy. I tried to include our own headers after theirs so we have those macros available after they undefined theirs (which have the same name as ours, such as LOG!). But it only works to a certain extent, we soon faced mysterious error messages that a template parameter is not instantialized or something like that. My teammate realized that instead of using their classes, you can use them as pointers and that way you only need to forward declaration without include the actual header files. Then you include the actual header files in the implementation files. This way their module is only pulled in during compile time which isn’t polluting everyone else’s namespace with their macros. Well that is the theory we will probably encounter more problems but I think the solution got us really far and is clever and warrants a note 🙂

I saw code like this in a header file:

namespace X {

class Y;


I thought that was wieldy and changed it to

class X::Y;

Guess what? It wouldn’t compile!

The reason? Here. In short, C++ only allows fully-qualified names refering to existing (previously declared) entities. They cannot be used to declare new entities. Once you have this wieldy forward declaration, you can reference it in fully qualified name subsequently. I guess the tricky point here is the compiler couldn’t figure out whether X is a class or a namespace for a form of X::Y.

After I came back from vacation, alas, my team members changed our source control system from svn to git. While I have always wanted to learn git for two years, now it is really thrown upon my face 🙂 I discovered git tutorials and git books are better written (more understandable) than two years ago when I tried the first time late 2009. At that time they were using indexing instead of staging area and i am not sure after reading and experimenting i really got what indexing was for.

Now it is all different. Here is a great summary of Git in 5 minutes.

This page of the tutorial that comes with git is really helpful when you merge branches.

Hence, this is ‘Git in 1 minute’ 🙂

July 2012


  • 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