Stockdale Paradox

You must never confuse faith that you will prevail in the end—which you can never afford to lose—with the discipline to confront the most brutal facts of your current reality, whatever they might be. — James Stockdale

Ref:
https://en.wikipedia.org/wiki/James_Stockdale

Set the maximum line length in PyCharm

This is how I do it for PyCharm Community Edition 2018.1 on osx.

PyCharm -> Preferences -> Editor -> Code Style -> Visual guides

I set it to 79 chars.

Screen Shot 2018-05-17 at 12.35.28 PM copy

Ref:
https://stackoverflow.com/questions/17319422/how-do-i-set-the-maximum-line-length-in-pycharm
https://stackoverflow.com/questions/15438326/python-pep-8-docstring-line-length

In a bad state in git

After some rebase, merge and git stash, sometimes I found myself in a bad git state, like a detached head state or in the middle of some messy conflict resolving, whatever that means. What to do?

First question to ask yourself, can I afford to throw away my current changes?


If the answer is yes, then there are many options. Here are a few:

rm -rf git_dir/
git clone https://some.git.clone.path

This is probably the most noob way to back out from a bad state.

git reset --hard HEAD

With git reset, you go back in history to the beginning of your current branch.


If the answer is no, then here are a few options:

Use whatever cmds to tar/gzip your git directory. 

Then assuming you are on your current branch called bad_branch, try

git checkout master
git checkout -b new_branch
git checkout bad_branch -- .

The last command will copy the changed files (instead of commits) over to your new_branch. Then you can do your clean up there. Your current new_branch will be one commit away from master (change this accordingly).

Hold on, Hold Off

Hold on: to wait
E.g. Hold on until mom is here.

Hold off: to postpone, cancel, or stop an action
E.g. He held off preparation for the business trip.

Just to confuse you more…

Hold off on:
E.g. She decided to hold off on her vacation plan.

Hold off from:
E.g. He held off from entering the house.

Ref:
http://www.differencebetween.net/language/difference-between-hold-on-or-hold-off/
https://www.merriam-webster.com/dictionary/hold%20off%20on

How fake handbags fund terrorism and organized crime

Visualizing Pandas’ Pivoting and Reshaping Functions

This will come in handy someday.

http://jalammar.github.io/visualizing-pandas-pivoting-and-reshaping/

pandas_reshape_and_pivot

Same life

“If you keep living like the way you are now, you will continue to produce the same life you already have.”

– Jim Rohn