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

 ALL


  Singleton Pattern in Golang

Singleton pattern is the simplest design pattern in software design. It ensures that only one instance of an object exists globally, regardless of how many times the object is instantiated. Based on the characteristics of the singleton pattern, it can be applied to scenarios such as global unique configuration, database connection objects, file access objects, etc. In Go language, there are multiple ways to implement the singleton pattern. Today, let's learn together about some of these approaches.Eager InitializationImplementing the singleton pattern using eager initialization is very simple....

1,926 0       GOLANG SINGLETON PATTERN TUTORIAL


  What can select do in GoLang

In Go language, select is a keyword used to listen to and perform IO operations related to channels.With the select statement, we can simultaneously listen to multiple channels and perform corresponding operations when any of the channels are ready.This article will summarize the common uses of the select statement and provide some considerations when using it.Basic syntaxThe basic syntax of the select statement is as follows:select {case <-channel1: // when channel1 has data to processcase data := <-channel2: // when channel2 has data to processdefault: // if no channel has dat...

1,101 0       GOLANG SELECT USAGE SYNTAX TUTORIAL


  LinkedIn ceases operations in China

Microsoft's social platform LinkedIn announced on Wednesday, August 9th, that it would cease its operations in China, ending its nearly decade-long presence in the Chinese market. This move signifies the departure of a major Western social media platform from China.Currently, when accessing LinkedIn's domain within China, users are redirected to a page that provides services for corporate clients. The mobile app for "LinkedIn Workplace" displays a message stating, "Unable to load data."As one of the few successful social media platforms operated by a U.S. tech company in China, LinkedIn, as th...

864 0       MICROSOFT LINKEDIN CHINA


  Goodbye Manual Processes, Hello Automation Certificate Lifecycle Management Like It’s Supposed to Be

At the heart of every story lies a villain and a hero. In the never-ending story of certificate lifecycle management, there’s no bigger villain than manual effort. Destructive, irrepressible, and risk-laden, this villain causes nothing but mayhem and loss. Automation, the hero, is the complete opposite of manual effort. Proactive, solution-oriented, and breach-proof, this hero deserves recognition, allegiance, and attention, yet they get none of that from a majority of today’s organizations. It’s time for a script change. Here’s why you should automate your certifi...

779 0       CERTIFICATE DATA SECURITY


  errGroup in GoLang explained

Today, let's talk about the usage and applicable scenarios of errGroup, which is often used. Why is it useful? Generally, when we use goroutine, we cannot return a value. If you want to pass out the result of the goroutine execution, you usually have to use the channel. The errGroup package is suitable if you want to know when the goroutine you opened encounters an error during execution and stop working, and I need to know the error value.errGroup usageThe package needs to be downloaded and installed first. go get -u golang.org/x/syncAn example of using it would bepackage mainimport ( ...

4,804 0       CONCURRENCY GOLANG ERRGROUP WAITHROUP


  How long does the heuristic cache of the browser actually cache?

Heuristic cacheHeuristic caching is the default behavior of browser caching (i.e., for responses without Cache-Control), which is not simply "not caching", but implicitly caching based on the so-called "heuristic cache". HTTP is designed to cache as much as possible, so even if Cache-Control is not specified, the response will be stored and reused if certain conditions are met. This is called heuristic caching.HTTP/1.1 200 OKContent-Type: text/htmlContent-Length: 1024Date: Tue, 22 Feb 2022 22:22:22 GMTLast-Modified: Tue, 22 Feb 2021 22:22:22 GMTCache durationThe formula for calculating the cac...

2,063 0       WEB DESIGN HEURISTIC CACHE


  Deep Understanding of ReentrantLock: Unlocking the Mysteries of Java Concurrent Programming

ReentrantLock introductionReentrantLock is a class in the Java concurrent package, java.util.concurrent.locks, and is an implementation of the Lock interface. As its name suggests, it is a reentrant mutual exclusion lock.A mutual exclusion lock is a synchronization tool used to protect shared resources, ensuring that only one thread can access the resource at a given time. Reentrant means that a thread can acquire the same lock multiple times without causing a deadlock.This lock provides some basic behaviors that are the same as those of the built-in synchronization mechanism. For example, a t...

2,823 0       MULTITHREADING CONCURRENCY REENTRANTLOCK JAVA


  Linux的早期岁月

我的名字是 Lars Wirzenius,我曾经见证了Linux的起点。Linux现在是一个全球成功的操作系统,但它的开始却非常谦逊。这些是我对Linux最早的日子、它的创造以及它走向今天的记忆。我于1988年秋季开始在赫尔辛基大学攻读计算机科学,并认识了 Linus Torvalds,他也是当年计算机科学专业的新生之一,而且和我一样说瑞典语。在那个学年的末尾,我们得到了一台Unix服务器的访问权限,然后我无意中发现了Usenet,这个讨论系统,因为我误将rm打成了rn,即Usenet阅...

1,326 0       LINUX HISTORY STORY