socket connection time-wait

I frequently saw connection has TIME_WAIT status, for ex: 12345????netstat -ant|awk '/^tcp/ {++S[$NF]} END {for(a in S) print (a,S[a])}'LISTEN 35CLOSE...

Read More

channel-related-issues

there are 3 pits when we use channel. deadlock panic oom deadlock12345678910// 只有生产者,没有消费者func f1() { ch := make(chan int) ch <- 1}func main() { f1()} we w...

Read More

leetcode-1428-leftmost-col-with-at-least-a-one

leetcode 1428solution 1, traverseruntime 221ms, 9% 12345678910111213def leftMostColumnWithOne(self, binaryMatrix: 'BinaryMatrix') -> int: rows, cols = binaryMatrix...

Read More

go-iota-usage

keyword iota is used on const enum, it defines the auto-incremental counter starting from 0for ex 123456789const ( Sunday = iota // starting from 0 Monday // 1 Tuesday...

Read More

play-with-webssh

try with pipenvwebssh pipenv install virtualenv12345678910111213141516171819202122232425262728293031323334353637鉂??pipenv --python 3.8.9Creating a virtualenv for this project...Pip...

Read More

need-write-more

last time I come to this site is 2019, 3 years passed. I need to come here more often and write more. let’s see.

Read More

zookeeper-distributed-lock

Analysis of an implementation of zookeeper distributed lockreferencelink the mechanism of zookeeper distributed locklet’s assume there are two clients try to get the zk’s lockas we...

Read More

sql-select-null-usage.md

select null exampleI saw a sql code snippet as this: 123456789101112131415161718192021222324252627 select * from ( select v.empno,v.ename,v.job,v.mgr,v.hiredate, v.sal,...

Read More

word-break-ii.md

leetcode workd break II with scala solutiontop-down DP1234567891011121314151617181920212223242526272829303132def wordBreak(s: String, wordDict: List[String]): List[String] = {...

Read More

scala-foldLeft-vs-foldRight.md

Definition of foldLeft and foldRightfoldLeft please notice the definition of op : (op: (B, A) => B) here, A is the element of the caller, B is the intermedia result of function...

Read More