2023/10/19

git,commit,branch ,cherry-pick ,merge

commit is snapshot of all filesnot a change set to store the hash ID of the latest commit in a branch name.branch name is just the lastest hash of commi branch name is just the lastest hash of commitIn fact, this is the very definition of a branch name: a name like master simply stores the hash ID of the commit we want to call the latest for that branch. So given the A--B--C string of commits, we just add the name master, pointing to commit C:To remember which branch...

2023/10/12

2023/07/06

vscode ,gvm ,GOROOT

gvm install go19.2gvm listgvm use go19.2 --default=>GOROOT、GOPATH will be set by gvm automaticallyvsCode will use the go defined by $GOR...

2023/06/26

kotest -

 "someContainer " - { "someTest" { } "someTest" { }}- はContainerの意味であり、その中に、別のScopeが必要ない場合は、実行され...

2023/05/31

mysql explain select

 ## explain select- access_type: - all(全件検索)/index(indexの全件検索)はfull-scanであり、要注意。 - indexはallより良い。- possible_keys: 使用可能なindex(primary-key is index)- key: 実際使ったindex- ref: indexのKeyと比較するcolumn- patition: 使ったpatition. patationは何?大きなテーブルを分解すること - patitionは使えるかも! - 分解のtypeは:RANGE,LIST,HASH,KEY- rows: 大体の件数を推測した結果- filtered: 条件が効いて、次の層に行く件数の割合。小さい方が...

2023/05/26

rails,where or

 def check @spec = Hash.new @spec = Spec.merge(Spec.where(a:1).or(Spec.where(b:0))) .merge(Spec.where(c:0).or(Spec.where(d:0))).first...

2023/05/17

change git http to ssh

 - git add ssh key        - ssh-keygen -t rsa         - update to github ssh key        - ssh -T git@github.com     - add to .ssh/configHost github github.com HostName github.com IdentityFile ~/.ssh/id_git_rsa #ここに自分の鍵のファイル名 User gitssh -T github- change git repository from http to ssh    git remote -v    git remote set-url origin git@github.com:xx/xx.git git remote -v...

2023/01/29

mysql lock

 - mysql lock  - lock mode - share lock , 略S, for read - exclusive lock, 略X,for update or delete。even read have to wait the lock. - lock granularity(粒度) - table lock - row lock(record lock) - A record lock is a lock on an index record. - if no index, innodb will create a hidden cluster index to lock. - show engine innodb status; ``` RECORD LOCKS space id 58 page no 3 n bits 72 index `PRIMARY` of table `test`.`t` trx id 10078 lock_mode X locks rec but not gap Record lock, heap no...