Monthly Archives: September 2019

Calculate string length by bytes

“中文”.length in javascript will return 2 which is not the result I want, here is the replacement:

byteLength(‘中文’); will return 6.

每個中文字算2個字

Reference:

FTP in IIS 10

Notes:

  1. 如果要設定虛擬目錄,從FTP根目錄指到別的資料夾,虛擬目錄的名稱要和實際資料夾的名稱一模一樣
  2. 所有目錄都要設定權限給FTP user

Dump Partial data of each table

//先切換到bin資料夾,因為沒有設定環境變數path
cd c:\program files\mariadb 10.4\bin

//目前限制100筆資料
mysqldump -u root -p –single-transaction –opt –where=”1 limit 100″ huede_hai > d:\backup\dump_hai_20190719.sql