go-cache: 採用 Cache-Aside 模式的多層 Go 緩存
在現代的應用程序開發中,緩存是提高性能和擴展性的關鍵技術之一。在 Go 語言的生態系統中,有許多優秀的緩存庫,其中之一便是go-cache。本文將詳細介紹go-cache庫及其使用方法,旨在幫助開發者更好地利用緩存提高應用程序的性能。什麼是 go-cache?————-go-cache是一個靈活的多層緩存庫,設計用於處理內存緩存和共享緩存。它採用了 Cache-Aside(旁路緩存 ⌘ Read more

⤋ Read More

如何架構優秀的 Go 後端 REST API 服務
REST(Representational State Transfer)是 Web 服務中廣泛使用的一種架構風格,其核心思想是使用 HTTP 協議出色地創建、讀取、更新和刪除(CRUD)資源。作爲一種靜態類型、編譯型語言,Go 在構建高效、可靠的 Web 服務時具有顯著優勢。使用 Go 語言構建 REST API 服務需要我們從多個方面入手,包括項目結構、框架選擇、數據庫操作、路由設計等。以下將 ⌘ Read more

⤋ Read More

Go 使用 interface 時的 7 個常見錯誤
寫在正文之前閱讀本文之前我們來先熟悉以下的代碼原則,如果你已經很熟悉這些內容,可以直接跳到正文。接口隔離原則:絕不能強迫客戶實現其不使用的接口,也不能強迫客戶依賴其不使用的方法。 多態性:代碼變化會根據接收到的具體數據改變其行爲。 里氏替換原則:如果你的代碼依賴於一個抽象概念,那麼一個實現可以被另一個實現所替代,而無需更改你的代碼。 抽象的目的不是爲了含糊不清,而是爲了創造一 ⌘ Read more

⤋ Read More

Vue 入門指南:從基礎到實踐
Vue.js 是一個流行的 JavaScript 框架,用於構建用戶界面和單頁應用程序。它以簡潔、易用和高效而著稱,使得開發者能夠快速上手並開發出功能豐富的 Web 應用。本文將帶你走進 Vue 的世界,從基礎知識到實踐應用,一步步引導你掌握 Vue 的核心概念和開發技巧。一、Vue 簡介Vue.js(通常簡稱爲 Vue)是一個用於構建用戶界面的漸進式 JavaScript 框架。與其他重量級框架 ⌘ Read more

⤋ Read More

基於內網高可用 VIP 實現生產、容災環境切換
開篇之前,老周覺得有必要先鋪墊一下,我們先來說一說 VIP (Virtual IP) 相關的技術。一、虛擬 IP 概述———-1.1 VIP 是什麼 虛擬 IP(Virtual IP Address,簡稱 VIP)是一個未分配給真實彈性雲服務器網卡的 IP 地址。彈性雲服務器除了擁有私有 IP 地址外,還可以擁有虛擬 IP 地址,用戶可以通過其中任意一個 IP(私有 IP / 虛擬 ⌘ Read more

⤋ Read More

macOS Sequoia Supports HDMI Passthrough for Dolby Atmos Content
In macOS Sequoia, several Apple apps have gained a new HDMI Passthrough feature that enables a Mac to send an unaltered Dolby Atmos audio signal to a connected AV receiver or soundbar.

Image

The new functionality appears in various places in macOS 15, including Apple’s TV, Music, and QuickTime P … ⌘ Read more

⤋ Read More

rust 基於 kvm 實現虛擬機
之前寫過用 rust 實現一個虛擬機的文章 (收藏,用 rust 實現一個迷你虛擬機,模擬 CPU 執行指令),該虛擬機是基於代碼解釋執行的,效率較低。評論區大神告知目前主流的實現方案是基於 kvm(Kernel-based Virtual Machine) 的,直接由系統調度,性能強悍,並且在 github 上開源了一個 kvmsample 例程。https://github.com/BillXRead more

⤋ Read More

微服務粒度難題:找到合適的微服務大小
序言在微服務架構風格中,微服務通常設計遵循 SRP(單一職責原則),作爲一個獨立部署的軟件單元,專注於做一件事,並且做到極致。作爲開發人員,我們常常傾向於在沒有考慮爲什麼的情況下儘可能地將服務做得小。這種關於什麼是和不是什麼是單一職責的主觀性是我們開發人員在服務粒度方面容易犯錯誤的地方。爲了克服開發團隊在微服務尺寸上面臨的這種困境,理解粒度驅動因素至關重要。粒度在微服務中,我們有兩個概念——模塊化 ⌘ Read more

⤋ Read More

qsv:Rust 實現一個處理 CSV 文件的簡單,快速和可組合的命令行工具
隨着數據科學和數據分析的發展,CSV(Comma-Separated Values)文件依然是數據存儲和交換中最常見的格式之一。然而,對 CSV 文件進行有效、快速的操作和分析一直是一個挑戰。本文將詳細介紹一個名爲qsv的工具,它可以幫助我們高效地處理和分析 CSV 文件。什麼是 qsv?——–qsv是一個基於 Rust 編程語言開發的命令行工具,用於對 CSV 文件進行切片、切丁和分析 ⌘ Read more

⤋ Read More

Britain’s Brewing Battle Over Data Centers
The Labour Party, which is leading in UK election polls, has proposed making it easier for companies to build new server farms—risking a new type of conflict in communities across the country. ⌘ Read more

⤋ Read More

Scientists pinpoint strategies that could stop cats from scratching your furniture
Many cat owners are familiar with torn cushions, carpets, and couches. The feline instinct to scratch is innate, but is often perceived as a behavioral problem by cat owners, and sometimes leads to interventions that are not cat-friendly. ⌘ Read more

⤋ Read More

rottenwheel submits CCS proposal to maintain ‘official’ Monero website for 3 months
rottenwheel1 has submitted a new CCS proposal2 looking to maintain the Getmonero.org3 website for 3 months (July-September 2024):

I will maintain the “official” Monero website (https://www.getmonero.org/) for the next 3 months (2024 Q3): July, August and September. Aid in general project endeavors assistance, such as Matrix/IRC moderation, assist plowsof’s CC … ⌘ Read more

⤋ Read More

Monero Research Lab meeting scheduled for 10 July 2024 1700 UTC
The next Monero Research Lab1 meeting is scheduled to take place on Wednesday, July 10th 2024 at 17:00 UTC on IRC-Libera/Matrix2 in the #monero-research-lab channels.

Agenda overview (unconfirmed)
  • Updates. What is everyone working on?
  • Potential measures against a black marble attack3
  • Research Pre-Seraphis Full-Chain Membership Proofs4
    - Discuss hiring Cypher Stack for 4 days of work (38 X … ⌘ Read more

⤋ Read More

The history of Alt+number sequences, and why Alt+9731 sometimes gives you a heart and sometimes a snowman
Once upon a time, the IBM PC was released. In the IBM PC BIOS, you could enter characters that weren’t present on the keyboard by holding the Alt key and typing the decimal value on the numeric keypad. For example, you could enter ñ by holding Alt and typing Numpad1 Numpad6 Numpad4, then releasing the Alt key. ↫ Raymond Chen … ⌘ Read more

⤋ Read More

Hurricane Beryl Isn’t a Freak Storm—It’s the Exact Nightmare Meteorologists Predicted
A hot ocean provides the energy hurricanes need to grow—and can limit the cooling that happens in their wake, making it likelier that the storms that follow will be powerful ones. ⌘ Read more

⤋ Read More

European Commission shoots down Facebook’s “pay or consent” model
The European Union’s Digital Markets Act is the gift that keeps on giving. This time, it’s Facebook’s turn to be slapped on the fingers with a ruler – a metric ruler, of course – because of its malicious compliance with the DMA. Today, the Commission has informed Meta of its preliminary findings that its “pay or consent” advertising model fails to comply with the Digital Markets Act (DMA). In the Commiss … ⌘ Read more

⤋ Read More

Google Search Ranks AI Spam Above Original Reporting in News Results
Google adjusted its policies to target AI spam earlier this year, but plagiarizing content still comes up higher in search results months later—and SEO experts aren’t sure why. ⌘ Read more

⤋ Read More

Durian genome upgrade reveals the role of chromosome reshuffling
In a study published in the journal Science China Life Sciences, Jianing Yu’s group from Shaanxi Normal University and Yuxian Zhu’s group from Wuhan University assembled a reference durian genome of 777.8 Mb with 28 chromosomes and 38,728 protein-coding genes. ⌘ Read more

⤋ Read More

Study: More complaints, worse performance when AI monitors employees
Organizations using AI to monitor employees’ behavior and productivity can expect them to complain more, be less productive and want to quit more—unless the technology can be framed as supporting their development, Cornell research finds. ⌘ Read more

⤋ Read More

The Genius Behind @OKWildlifeDept’s Most Viral Tweets Is Signing Off
Sarah Southerland used the Oklahoma Department of Wildlife Conservation’s social media feeds to warn you about mountain lions and Halloween candy, leaving behind one of the internet’s great legacies. ⌘ Read more

⤋ Read More