2021年2月1日 星期一

Python - What do << and >> mean?

1. "<<" Shift left for binary bit.

100 -> Decimal 100
    -> Binary 1100100
Result:
400 -> Decimal 400
    -> Binary  110010000


2. ">>" Shift left for binary bit.

100 -> Decimal 100
    -> Binary 1100100
Result:
25 -> Decimal 25
   -> Binary  11001



2021年1月17日 星期日

Sublime Text - How to create snippet code with quick key?

*Sublime version:3.2.2 build 3211 

Step1. Tools → Developer → New Snippet



Step2. Snippet sample file opened after "New Snippet".
    ⓵ Input snippet code
    ⓶ Input quick key (keyword)
    ⓷ Input Description




















Step3. Save your syntax file with ctrl+s
    Name Rule:<FileName>.sublime-snippet
    Save to User folder: ..\Sublime Text Build 3211 x64\Data\Packages\User\
    * You can create snippet folder below User if you want. Sublime will load snippet settings by file extension.



Step4. Snippet code quick key created. Let's try it!
    ⓵ Input quick key (step2's quick key)
     Quick key and description shows up


    ⓷ Select the quick function then snippet code created.