sl4j-log-string-interpolation-vs-concaternation

I am curious about the performance of log string concatenation vs interpolation, today I did some test. codetest code: 1234567891011121314151617181920212223242526272829303132333435...

Read More

big-endian-vs-little-endian

big endian, little endian and network byte orderBig-endian and little-endian are two byte order formats that define the order of bytes in a multi-byte data type, such as a word, do...

Read More

multiple-solutions-for-a-sql-problems

multiple solutions for a sql problemproblem descriptionproblem sol 1, using variable and subquery to calculate123456789101112131415# Write your MySQL query statement belowSELECT g...

Read More

Hello World

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask...

Read More

maximum-of-minimum-values-in-all-subarrays

descriptionproblem description analysisthis is a mono stack issue.check the pic below : for each number, we try to expand both left and right until we hit numbers on both end whic...

Read More

design-most-recently-used-queue

leetcode 1756 design most recently used queueproblem descriptionlc 1756 solution 1 - regular list time: O(N) space: O(N)1234567891011class MRUQueue: def __init__(self, n: int): ...

Read More

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