原创 C# Console.Beep

using System; namespace ConsoleApp { public class Program { public static void Main(string[] args)

原创 C# 代碼學習

原创 ASP.NET Core 依賴注入中的Scope

每個請求是一個Scope 爲什麼不能直接從Root Scope中Resolve實例,會造成內存泄漏,原因是Root Scope不會Dispose,長命持有短命問題 注意CreateScope() Scope的範圍 Ref https:

原创 CDN是如何工作的?

Ref https://humanwhocodes.com/blog/2011/11/29/how-content-delivery-networks-cdns-work/ https://medium.com/globant/con

原创 有鎖編程 vs 無鎖編程

什麼是無鎖編程? 簡單來說就是有沒有block住其他線程,沒有,那就是無鎖編程。 https://preshing.com/20120612/an-introduction-to-lock-free-programming/ 區別

原创 奇怪的bug之只有下雨天才能用的WI-FI

Ref https://predr.ag/blog/wifi-only-works-when-its-raining/ LOS 文中提到的網絡機構大概是這樣:

原创 Cancellation of Tasks

Ref https://knowyourtoolset.com/2023/05/cancellation-tokens/ https://medium.com/@mitesh_shah/a-deep-dive-into-c-s-cance

原创 C# 泛型中的協變和逆變

Ref https://medium.com/@hazemu/covariance-and-contravariance-demystified-in-c-5b37543bfa2

原创 Writers can write anything. Programmers can't.

Ref https://www.mahendraker.com/blog/writing

原创 How To Be A Good Listener

Ref https://tomblog.rip/the-myth-of-the-good-listener/

原创 finding a balance while coding

Ref https://breadchris.com/thinkies/finding-a-balance-while-coding/

原创 Soft Deletion Probably Isn't Worth It

Ref https://brandur.org/soft-deletion

原创 C# PKCS8

背景 C#項目要攜帶用戶信息,通過JWT, 跳轉到Java項目。爲了驗證Token,所以用於簽名的key和算法必須一致。 Java項目JWT的實現 String secret = "PKCS8 encode private key"; PK

原创 How does B-tree make your queries fast?

原文 https://blog.allegro.tech/2023/11/how-does-btree-make-your-queries-fast.html

原创 Java 爲未考慮的業務異常返回用戶友好的error message

背景 項目早期底層方法捕獲了能考慮到的業務異常,但即便如此,生產環境還是會產生各種難以預料的結果,所以在上層調用的時候,這些異常就進入了Exception中,返回到UI上就是“System error” try { } catch(biz