Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Why Math.min() > Math.max() is true in JavaScript

...

6,096 2       MATH.MAX() MATH.MIN() JAVASCRIPT COMPARISON


  Useful git commands in daily work

In a developer's daily work, it is frequent to see lots of commits made. It would be a headache if one cannot use git commands well especially when in cases where some fixes need to be made on existing branches. There are some frequently used command such as git pull, git merge and git push. Apart from these, there are some other practical commands which may be useful for real use cases. This post will try to list some of them.git grep It will lists all files containing the searched keyword. This is similar to the Linux command grep.git blameIt will list the author and change time of each...

1,497 0       GIT LOG GIT COMMAND GIT


  When and Where to Use Pointers in Go

When declaring variables in Go, we usually have two syntax options: In some scenarios, pointers; in others, reference; sometimes, either. It’s great to have choices, but it is also confusing sometimes as to which one in which scenario.To be more reasonable in choice-making, I started from pointers, walked through their natures, and summarized some rules in using them in Go.from unsplash, Jordan LadikosPointersGo has pointers. A pointer holds the memory address of a value.— from A Tour of GoThe data is stored in the memory when the program runs and each has a num...

2,351 0       POINTER GOLANG


  Alibaba CEO Daniel Zhang is no longer president of Taobao Software Co. Ltd

According to a recent change record from Chinese company registration information portal, the Chinese e-commerce giant Alibaba Group CEO Daniel Zhang is no longer the president of TaoBao Software Co. Ltd. His successor is Shan Dai, who is one of the founders of Alibaba and now Taobao CEO.Along with the change, Daniel also quits as the president of Tmall technology company which is also one of the subsidiaries of Alibaba Group focusing on big brands.Taobao (China) Software Co., Ltd. was established in December 2004 with a registered capital of USD 690 million. Its business scope includes resear...

1,935 0       ALIBABA DANIEL ZHANG CEO TAOBAO


  Our Go Cache Library Choices

In Build a Go KV Cache from Scratch in 20 minutes, I walked you through what matters when writing a local cache, and eventually implemented one, whose performance was beaten badly by that of the popular go-cache on Github though. However, the bright side is that we can learn a lot from those excellent Github Go cache products, studying their features, applicable scenarios, and implementations, and extracting what we need.In this article, I will mainly analyze and compare the four cache libraries of go-cache, bigcache, golang-lru, and groupcache, which are all...

1,547 0       CACHE GOLANG GO-CACHE BIGCACHE GOURPCACHE


  golangci-lint to enable comment check for exported functions

golangci-lint is a command line tool which aggregates a list of different go linters to check whether the source code is in correct condition from different aspects. It is built to run during the CI pipeline so that there is no obvious coding issues before compiling and building the program.It is easy to run it with just below command$ golangci-lint run -vINFO [config_reader] Config search paths: [./ /Users /] INFO [config_reader] Used config file .golangci.yml INFO [lintersdb] Active 10 linters: [deadcode errcheck gosimple govet ineffassign staticcheck structcheck typecheck unused varcheck] I...

6,606 1       GOLANG GOLANGCI-LINT REVIVE GOLINT EXPORTED COMMENT


  The magic of go:linkname

When writing Go program, there is frequent need on using time.Sleep() function to pause the logic for some time. And if jumping to the definition of this function, can see below definition:// Sleep pauses the current goroutine for at least the duration d.// A negative or zero duration causes Sleep to return immediately.func Sleep(d Duration)I's strange that there is no function body defined here. What happened? The actual definition of the function body is residing at runtime/time.go indeed.// timeSleep puts the current goroutine to sleep for at least ns nanoseconds.//go:linkname tim...

12,172 0       TRICKS GOLANG GO:LINKNAME


  Some frequently used ES6 code snippets

Below are a list of ES6 code snippets which are used frequently. Hope that it will be helpful.1. Shuffle array elementslet arr = [67, true, false, '55']arr = arr.sort(() => 0.5 - Math.random())console.log(arr)// [ '55', 67, false, true ]2. Remove characters which are not numbersconst str = 'xieyezi 23213 is 95994 so hansome 223333'const numbers = str.replace(/\D/g, '')console.log(numbers)// 23213959942233333. Reverse sequence or wordsconst sentence = 'xieyezi js so handsome, lol.'const reverseSentence = reverseBySeparator(sentence, "")console.log(reverseSentence);// .lol ,emosdnah os sj ize...

1,470 0       ES6 JAVASCRIPT CODE SNIPPET TIPS