Monday, 25 May 2015

Create a Git patch file that you can apply it

$ git diff --no-prefix > save.patch
$ patch -p0 < save.patch

Git rebase a topic branch

When you work on your own branch and finished the work it should 'put' back to the master branch without create a merge commit that is very disgust.

Our branch name is 'topic'.

git checkout topic
git rebase master
git checkout master
git merge topic  - this create a fast forward merge

And now we're happy.

Visual Studio compiler flags

Here are some compiler flag that is can be useful:

-D_CRT_SECURE_NO_WARNINGS
-D_HAS_ITERATOR_DEBUGGING=0
-D_SECURE_SCL=0
-D_SECURE_SCL_THROWS=0
-D_SECURE_SCL_DEPRECATE=0

C++11 features that I should use it

Delegating constructors
Uniform Initialization

Saturday, 23 May 2015

Fix crappy VS Find&Replace

Tools -> Options -> Environment -> Find and Replace -> Automatically populate Find What with text from the editor

Win32PrioritySeparation

You can set up the CPU schedule via
HKLM\SYSTEM\CurrentControlSet\Control\PriorityControl\Win32PrioritySeparation

2A Hex = Short, Fixed , High foreground boost.
29 Hex = Short, Fixed , Medium foreground boost.
28 Hex = Short, Fixed , No foreground boost.

26 Hex = Short, Variable , High foreground boost.
25 Hex = Short, Variable , Medium foreground boost.
24 Hex = Short, Variable , No foreground boost.

1A Hex = Long, Fixed, High foreground boost.
19 Hex = Long, Fixed, Medium foreground boost.
18 Hex = Long, Fixed, No foreground boost.

16 Hex = Long, Variable, High foreground boost.
15 Hex = Long, Variable, Medium foreground boost.
14 Hex = Long, Variable, No foreground boost.