分類彙整:未分類

git

git HEAD 一般指向一個 Branch 的最新一個 Commit,也是使用者目前所能看到的 Git 內容。新增的 Commit 必定接在目前 HEAD 後面。 Index Commit 前的過渡區,告知 Git 哪些檔案需要包含在此次 Commit 內。 Reset Soft reset –soft [commit] #[單純移動 HEAD 與其 Branch] ,這個模式下的 reset,工作目錄跟暫存區的檔案都不會被丟掉,所以看起來就只有 HEAD 的移動而已。也因此,Commit 拆出來的檔案會直接放在暫存區。 Hard reset –rard [commit] #[除了移動 HEAD 與其 … 繼續閱讀 →

發表於 未分類 | 發表迴響

mysql 指令

練習網站 https://sqlzoo.net/wiki/SELECT_basics/zh https://www.w3school.com.cn/sql/index.asp https://www.w3schools.com/sql/default.asp 連接資料庫 mysql -u username DATABASES_NAME -P 顯示所有 MySQL 資料庫 SHOW DATABASES; 顯示該資料庫資料表 SHOW TABLES; 顯示系統狀態 SHOW status; 變數 show variables; show variables like ‘%max%’ process show processlist; 全部權限 show priviledges;

發表於 未分類 | 已標籤 | 發表迴響

mikrotik 多線回流

/ip firewall mangle add action=accept chain=prerouting dst-address=192.168.1.0/24 src-address=192.168.1.0/24 add action=accept chain=prerouting dst-address-type=local src-address=192.168.1.0/24 add action=mark-routing chain=prerouting new-routing-mark=to_Route2 passthrough=yes src-address=192.168.1.0/24

發表於 未分類 | 發表迴響

virtualbox nat 效率慢

Nat 介面打開後 網路傳輸慢 需使用 VBoxManage modifyvm 修改 natdnshostresolver natdnsproxy 2個參數 $ VBoxManage modifyvm "" –natdnshostresolver1 on $ VBoxManage modifyvm "" –natdnsproxy1 on 前後可以使用 比較時間 time curl -s http://tw.yahoo.com

發表於 未分類 | 發表迴響

Delphi as is self

as (operator ) 運算子, 是用來 型態轉換 ,會將 左方運算元型態 轉為 右方運算元型態 語法: object as class 例: procedure TForm1.Button1Click(Sender:TObject); begin showmessage((Sender as TButton)).Name; end; is 運算子,檢驗 左方運算子物件實體 是否屬於 右方運算元類別 或 子類別,回傳值為 Boolen: True or False 語法: object is class 注意: is 回傳 … 繼續閱讀 →

發表於 未分類 | 發表迴響

zfs 陣列故障排除步驟

1. zpool status #查看陣列狀態,如有故障 有硬碟問題會出現 io delay,分區出現 faulted, zfs 陣列狀態為degraded 2. zpool offline zsysvol ata-OLD-HD #故障硬碟設定離線 zpool detach zsysvol ata-OLD-HD #故障硬碟設定離線(不建議此指令) detach與offline的差別: detach: 若沒有其它有效的備份碟的話,執行此指令會被拒絕。若此碟可能還會被加回此儲存池(pool)的話,請用offline來替代。 3. 再次用 zpool status 檢查硬碟是否離線,離線後更換硬碟 4. 用 hdparm -i /dev/sd? 查出新hd 代號 zpool replace -f zsysvol … 繼續閱讀 →

發表於 未分類 | 發表迴響

.vimrc vim 方便編輯

"####################################################### set nocompatible "####################################################### syntax enable set number set noruler set ignorecase set smartcase set incsearch set cindent set expandtab set tabstop=4 set softtabstop=4 set shiftwidth=4 set smarttab set confirm set backspace=indent,eol,start set history=500 set showcmd set showmode set nowrap … 繼續閱讀 →

發表於 未分類 | 發表迴響

Delphi建構函式和解構函式

delphi的建構函式的定義是: constructor create; delphi的解構函式的定義是: destructor destroy; 解構函式是不能過載的,但是建構函式是可以過載的。 建構函式在過載的時候要在後面加“overload”, constructor create;overload; constructor create(i:integer);overload; 注意,只有兩個建構函式以上才叫過載,只有一個就不用“overload;”了。 預設的建構函式是:constructor create; 如果有過載的話,那麼預設的建構函式後面也要加overload,正象上面的例子一樣。 delphi建構函式在類外定義在什麼位置呢?在implementation的後面。下面給出一個例項,可以從這個例項中看出建構函式的定義: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm)    Button1: TButton; procedure Button1Click(Sender: TObject); … 繼續閱讀 →

發表於 未分類 | 發表迴響

Delphi 分割字串函數 Extracestrings

//分割字符串 ExtractStrings var s: String; List: TStringList; begin s := ‘about: #delphi; #pascal, programming’; List := TStringList.Create; ExtractStrings([';',',',':'],['#',' '],PChar(s),List); //第一个参数是分隔符; 第二个参数是开头被忽略的字符 ShowMessage(List.Text); //about //delphi //pascal //programming List.Free; end;

發表於 未分類 | 發表迴響

Delphi常用系統函式總結

Delphi常用系統函式總結 字串處理函式 Unit System 函式原型 function Concat(s1 [, s2,..., sn]: string): string; 說明 與 S := S1 S2 S3 …; 相同. 將字串相加. 函式原型 function Copy(S: string; Index, Count: Integer): string;說明 S : 字串. Indexd : 從第幾位開始拷貝. Count : 總共要拷貝幾位. 從母字串拷貝至另一個字串. … 繼續閱讀 →

發表於 未分類 | 發表迴響