Chen Gao

Ph.D. student | chengao@vt.edu



Humble yourselves, therefore, under the mighty hand of God so that at the proper time he may exalt you, casting all your anxieties on him, because he cares for you.

1 Peter 5: 6-7

Chen's Rubik's Cube - Cheatsheet

Today I grabbed my Rubik's cube, and realized I forgot how to do those fancy patterns. So I made this cheatsheet, in case I forget again...

大中小:

  • 大: U2 L2 F2 U' B2 D R F' R F' R F' D' B2 U'
  • 小: F2 (L' U' L U' L' U2 L) (R U R' U R U2 R') F2

Tilt-Shift Lens

I always want a tilt-shift lens, especially for the tiny-world effect. Thus, I decide to learn the concepts behind this specialty lens, and then buy myself this expensive toy. Hope Google won't cancel my summer intern, cuz this is a really really expensive toy ...

The first function is called tilt. You can tilt your lens to change the shape of the depth of the field. We know the plan of focus is in parallel with the camera's image sensor. The depth between the plan of focus and the camera's image sensor is constant. However, tilting the lens will change the position of the plane of focus. As a result, you can have more or fewer subjects in focus.

Say you want to take a photo of a book from a higher level. So your camera is facing down. Typically the bottom of the book will be in focus, if we have a shallow depth of field. The top of the book will fall out of focus. What if we want to put the whole book in focus?

We can tilt the lens down so that the plan of focus is in parallel with the book. Boom! The whole book is in focus.

If we tilt to the opposite of the right direction, then here comes the tiny-world effect. This is called reverse tilt-shift (反向移轴).

The second function is called shift. You can shift your lens to have extra field of view without distortion.

Say you want to take a photo of a skyscraper. In order to have the top of the skyscraper in the field of view, you need to face up. It will look like the skyscraper is falling backward, caused by distortion.

To eliminate the distortion artifact, you have two options:

  1. Grow a pair of wings and fly in the air to take the photo.
  2. Shift your lens up.

Well, your choice :)

Useful Github commands

Recently I am collaborating on a project, and we need to take care of the version control.

I actually never fully understand how those Github commands work. Thus, I'll take this opportunity and learn from scratch.

There is no better choice than this guy to learn from. Actually, he is always my go-to person.

If working along, I can simply do git add, git commit and git push. Done. But working together means I need somebody else to do code review for me. Thus, I need to the following:

  1. Create a branch on master.
    • git checkout -b [branch-name]
  2. Commit and submit all my changes.
    • git add -A
    • git commit -m ['message']
    • git push -u origin [branch-name]
  3. Go to Github webpage and make the pull request.
  4. You collaborator will review and approve the code.
  5. At this point, the pull request has been merged to master. And we can delete all the redundant branches.
    • git checkout master
    • git pull
    • git branch -d [branch-name] (delete local branch)
    • git push -u origin :[branch-name] (delete remote branch, online branch)
  6. One last thing, what if I kept working on this branch after making the pull request? Master doesn't have my latest changes. We need to rebase to the latest master. (might be incorrect. Avoid this for now.)
    • git checkout [branch-name]
    • git rebase master
    • git push -f

Hello World!

Hey there! Glad you find my blog. I hide it intentionally so I can record my thoughts, useful stuff, or just rant.