2018年7月21日 星期六

[Video Game] Nintendo Switch




  • 還滿適合招待朋友玩樂 (可以8人同時遊玩) 



  • 馬力歐 


  • 賽車經典, like 跑跑卡丁車, 有道具  


  • 煮糊了啦, 燃燒吧廚房

  • 滿不錯玩的遊戲, 需要分工合作才能完成
  • [Friendship] afternoon activity


    • 桌遊
    • video game: PS4, Nintendo Switch

    [House] 決策參考


    • location, location, location
    • 教育
    • 生活機能 (便利商店、生鮮超市)
    • 地點參考
      • 基隆八斗子
        • 早安國
          • 13W/P, 室內 47P, total 65P, 也才 10xx, 相當不錯

    2018年7月19日 星期四

    [Visual Studio] Error C2471 cannot update program database xxx.pdb


    • Problem: 
      • MSVC下 build code時, 若出現 error C2471: cannot update program database 'xxx.pdb
    • Reason:
      • Program database 的 process 未正常關閉.
    • Solution:
      • Ctrl+Alt+Del 叫出 Task Manager
      • 強制關閉 mspdbsrv.exe (Microsoft Program Database)
    • Ref: mspdsrv living forever

    2018年7月18日 星期三

    [Shell] Bash 攻略

    分類 指令 用途
    移動 Ctrl-A 移到最前面
    Ctrl-a 移到最前面
    Ctrl-e 移到最後面
    Ctrl-u 清除游標前指令
    Ctrl-k 清除游標後指令
    螢幕操作 Ctrl-l 清除畫面
    常用指令 history 顯示歷史操作,
    !num
    可執行該行指令
    df -h 顯示空間容量
    ln -s fileName linkName 建立 symoblic link to fileName
    wc -lword count
    uname -ashow kernel info
    Ref:

    2018年7月7日 星期六

    [Software Engineering] use CMake to add version


    • Problem: 如何在軟體中加入版號?
    • How:
      • 工具: CMake (跨平台的 configuration tool, 可建立各平台的 build solution/project file)
      • 流程:
        • 在 project setting 檔案 (CMakeLists.txt) 內加入版號
        • set (APP_VERSION_MAJOR 1)
          set (APP_VERSION_MINOR 0)
          
        • 在 source code 中新增特定的預設 config.h.in 檔 (config.h 會是 build config.h.in 後的產物)
        • // the configured options and settings for App 
          #define APP_VERSION_MAJOR @APP_VERSION_MAJOR@
          #define APP_VERSION_MINOR @APP_VERSION_MAJOR@
          
        • CMakeLists.txt 中指定此 config.h 檔及預設的 config.h.in參考檔
        • configure_file (
              "${PROJECT_SOURCE_DIR}/config.h.in"
              "${PROJECT_BINARY_DIR}/config.h"
          ))
        • 如此就可以在 source code 中, include config.h 並使用 APP_VERSION_MAJOR, APP_VERSION_MINOR
        • 另外, 若 build成 shared binary 的話, 也可以像 linux一樣設計成 app_3.1.2 這樣的 binary, 然後 app為 symbolic link to app_3.1.2
          • CMakeLists.txt 中加入 target property VERSION 與 SONAME
          • set(APP_VERSION_STRING ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_PATCH})
            
            set_target_properties(App PROPERTIES 
                VERSION ${APP_VERSION_STRING} 
                SOVERSION ${APP_VERSION_MAJOR}
            )
            
    • Reference: CMake tutorial

    2018年7月5日 星期四

    [DRM] Content protection


    [Codec] Video Codec container format


    2018年2月2日 星期五

    [Astyle] Code Formatter

    # astyle setting
    # ref: http://astyle.sourceforge.net/astyle.html
    #alias astyle='astyle -A1 -C -S -K -Y -f -p -U -o -n'
    # options:
    # --style=allman / --style=bsd / --style=break / -A1    // { at new line
    # --indent=spaces=4 / -s4
    # --indent-col1-comments / -Y   // indent comments
    # --pad-oper / -p               // a=4 to a = 4
    # --pad-header / -H             // if(i = 4) to if (i = 4)
    # --delete-empty-lines / -xe
    # --align-pointer=name   / -k3  // char* a; int *b; to char *a; int *b;
    # --align-reference=name   / -W3
    # --attach-return-type      / -xf // void     foo(); to void foo();
    # --attach-return-type-decl / -xh
    # --max-code-length=#   / -xC#   // ref: https://google.github.io/styleguide/cppguide.html#Line_Length
    # --mode=c                      // only formatted on C/C++ files
    # --suffix=none / -n            // do not copy additional .orig file
    # --verbose / -v
    # --lineend=linux   / -z2
    # --indent-switches / -S
    # --break-blocks / -f           // add empty line before/after if/for/while blocks
    alias astyle='astyle -A1 -s4 -Y -p -H -xe -k3 -W3 -xf -xh -xC80 -n -z2 --mode=c -S -f'
    

    Reference: