Searching txt.sour.is

Twts matching #1
Sort by: Newest, Oldest, Most Relevant

Go 實現的一個 bitset,設計思想非常棒,值得參考收藏!
這兩日讀了一個實現二維碼生成的庫。其中的 bitset 設計得非常好,就摘抄記錄下來,與大家一起分享。bitset 實現一個可擴展的 bit 集合,可以添加 bit 和查看 bit。它在二維碼生成中,用來將編碼後的內容協助生成位圖,然後通過位圖進行繪製二維碼。二維碼的黑白格子正好用二進制 0 和 1 來表示。 下面開始詳細講解這個功能設計: 一、我們使用一個結構體來存儲 bit 序列。Bits ⌘ Read more

⤋ Read More

Golang 中 JSON 操作的 5 個常見陷阱(建議收藏!)
JSON 是許多開發人員在工作中經常使用的一種數據格式。它一般用於配置文件或網絡數據傳輸等場景。由於其簡單、易懂、可讀性好,JSON 已成爲整個 IT 界最常用的格式之一。對於這種情況,Golang 和許多其他語言一樣,也提供了標準庫級別的支持, encoding/json[1]。就像 JSON 本身很容易理解一樣,用於操作 JSON 的編碼 / JSON 庫也非常容易使用。但我相信,很多開發者可 ⌘ Read more

⤋ Read More

Golang 狀態機設計模式
本文介紹了 Golang 狀態機模式的一個實現示例,通過該模式,可以解耦調用鏈,有助於實現測試友好的代碼,提高代碼質量。原文: Go State Machine Patterns[1]導言在我們開發的許多項目中,都需要依賴某種運行狀態從而實現連續操作。這方面的例子包括:解析配置語言、編程語言等 在系統、路由器、集羣上執行操作… ETL(Extract Transform Loa ⌘ Read more

⤋ Read More

The XMPP Standards Foundation: Scaling up with MongooseIM 6.2.1
MongooseIM is a scalable, extensible and efficient real-time messaging server that allows organisations to build cost-effective communication solutions. Built on the XMPP server, MongooseIM is specifically designed for businesses facing the challenge of large deployments, where real-time communication and user experience are critical. The main feature of the recently released [MongooseI … ⌘ Read more

⤋ Read More

Armbian 24.5.1: Emphasizing Stability & User Experience For Diverse Hardware Platforms
Armbian 24.5.1: Emphasizing Stability & User Experience For Diverse Hardware Platforms
The release of Armbian 24.5.1 Havier marks a significant update focusing on stability enhancements and user experience improvements for a variety of supported hardware platforms. This latest version introduces substantial modifications and updates as detailed in an extensive changelog. ⌘ Read more

⤋ Read More

在 Golang 中不要簡單的返回 err
相反, 添加相關的調試細節。有些人喜歡抱怨 Go 需要編寫大量的 “ iferr!=nil{returnerr}” 代碼塊。這些人並沒有真正理解 Go 的錯誤處理機制。實際上, 他們抱怨的正是處理 Go 錯誤的完全錯誤方式: returnerr是一種反模式。讓我通過一些示例代碼來解釋我的意思: 一個用於配置 mTLS[1] 連接的輔助庫。(“雙向 TLS” 是向服務器證明客戶端身份的一種方式。)p ⌘ Read more

⤋ Read More

探索 Go 語言數據庫查詢的終極指南:深入解析 GORM 的強大查詢功能
一、GORM 基本查詢1、基本查詢func (c UserController) UserSelect() { //1、查詢id=3的用戶 user := models.User{Id: 3} models.DB.Find(&user) //2、查詢所有數據 user := []models.User{} result := models.DB.Find(&user) //5 (統計 ⌘ Read more

⤋ Read More

名画pk决赛:当名画《清明上河图》PK《千里江山图》,你觉得哪幅画在你心中更胜一筹?
太巧了,这正是个把月前我在高中美术鉴赏课中抛给学生的一个辨析问题。学生们回答的很不错。我就直接搬运一下他们的答案吧。先说结果。52人的班级多过半数(有超过30人)投给了《清明上河图》,我也是。学生比较成熟的代表观点如下:

选《清明上河图》方:

1 题材稀缺,古代绘画中描绘祖国大好河山的作品比比皆是,关注民生反映现世生活的比较稀有,表现内容看似平常,但人间烟火的平凡朴实更能打动人心,相较古人胸中丘壑的理想,不仅具有丰富的艺术价值,历史价值更胜一筹。

2 画工超牛,几百个人物生动形象,细致描画,三教九流,神态各异。细节丰富耐看,画面节奏感强,突出高潮,故事性、趣味性,引人入胜。

3 画面有深刻内涵,通过特有的风俗画的艺术形式即实现了当时隐喻曲谏的政治目的,如今又是考证宋代社会经济,民生阶层,城市治理,对外贸易交流,国防政策及实效的第一手资料,比《东京梦华录》的记载更详实生动细致。

4 作品强烈的个 … ⌘ Read more

⤋ Read More

Top Stories: iOS 17.5.1 Fixes Concerning Photos Bug, All-New iPhone 17 Model Rumored, and More
It’s been quite a week of Apple news and rumors, ranging from a concerning bug with deleted photos reappearing on users’ devices to hot rumors about a new high-end iPhone model for 2025 and a MacBook with a foldable screen coming as soon as 2026.

Image

Other news and rumors this week included fresh expectations for iOS 18 fe … ⌘ Read more

⤋ Read More

高考志愿填报有哪些方法和技巧?
志愿填报方法其实也是这些年老生常谈的问题了,首先从填报模式上来看,目前志愿填报就是三种模式:

1.新高考的专业+院校模式,适用于2024年的浙江、山东、辽宁、河北、重庆、贵州以及2025年的青海。

2.新高考的院校+专业组模式,2024年适用于上海、北京、天津、海南、江苏、湖南、湖北、广东、福建、黑龙江、吉林、甘肃、广西、安徽、江西等省市和自治区;2025年第一年参加新高考的省份中,除青海外都采用该模式。

3.老高考模式,2024年适用于陕西、山西、宁夏、西藏、新疆、四川、云南、青海、河南等省份。

志愿填报的方法当然多种多样,我也只是一家之言,但可以肯定的是不同的志愿填报模式对志愿填报方法肯定会存在影响,我尽量从这一层面来给大家分享一些志愿填报的思路和注意事项。

对于专业+院校模式,这种模式优点很明显,没有调剂,而且志愿填报的灵活度非常大,可以充分考虑考生对专业、院校、城市等等各方面的需求,夸张点说几乎是想怎么填就怎么填。但同样也存在缺点 … ⌘ Read more

⤋ Read More

iOS 17.5.1 & iPadOS 17.5.1 Update Released to Fix Reappearing Deleted Photos Bug
Apple has released a small bug fix update for iPhone and iPad versioned as iOS 17.5.1 and iPadOS 17.5.1. The update specifically aims to fix a very strange bug where deleted photos would randomly reappear on some users devices. Sometimes the photos that reappeared on user devices were deleted many years prior, raising serious questions … [Read More](https://osxdaily.com/ … ⌘ Read more

⤋ Read More

ADHD需要哪些因素才能取得更高成就呢?
Garber将取得较高成就的ADHD的共同特征进行了归类,将之称为“复原力(resilience factor)”,可以被分为内部因素(internal)和外部因素(external)

Image

图片来自:https://www.linkedin.com/pulse/internal-innovation-versus-external-yaron-flint

内部因素:

1.控制(Control):关注如何获得并保持对自己生活的控制;

2.动机(Desire):积极或消极的动机都可以,比如“我希望我的理想可以实现”。

3.目标导向(Goal orientation):聚焦于特定的、明确的目标,当然这个目标应该是现实的、可行性的;

4.重构(Reframing):重新定义ADHD,找到自己的优势,从而克服困难和挑战;

5.持之以恒(Pers … ⌘ Read more

⤋ Read More

A人好书-社群书单分享

序言

在快节奏、充满干扰的世界里,找到一片宁静的阅读空间似乎是一项挑战。但阅读不应该是负担,它应该是一次冒险,一次发现,一次心灵的旅行。

今日书单 1.《为什么长大》 ​苏珊·奈曼

Image

《为什么长大》 ​苏珊·奈曼

“成长更多地关乎勇气而非知识:世界上所有的知识都无法代替你运用你自己的判断力的勇气。”

——很有启发的易读哲学书 by蘑菇

2.《射雕英雄传》 ​金庸

Image

《射雕英雄传》 ​金庸

“可是天下尽有聪明绝顶之人,文才武功,琴棋书画,算数韬略,以至医卜星相,奇门五行,无一不会,无一不精!只不过你们见不着罢了。”

_——傻小子初入社会遇到很多人心险恶的故事,不知为 … ⌘ Read more

⤋ Read More

Cloudflare 最佳實踐:如何通過 Go PGO 回收 CPU
Golang 1.20 在 go 編譯器引入了對配置文件引導優化 (PGO) 的支持。這允許指導編譯器根據系統的真實行爲引入優化。在 Cloudflare 的可觀察性團隊中,我們維護着一些基於 Go 的服務,這些服務在全球範圍內使用數千個內核,因此,即使宣傳的節省 2-7%,也能大幅減少我們的 CPU 佔用空間,而且實際上是免費的。這將減少我們內部服務的 CPU 使用率,釋放這些資源來滿足客戶請求 ⌘ Read more

⤋ Read More

QCS6490 Vision-AI Development Kit: Featuring 13 TOPs NPU and 8-Core Kryo 670 CPU
QCS6490 Vision-AI Development Kit: Featuring 13 TOPs NPU and 8-Core Kryo 670 CPU
Avnet has introduced the QCS6490 Vision-AI Development Kit, a sophisticated solution designed for vision-based AI applications. This kit includes an energy-efficient, multi-camera SMARC 2.1.1 compute module powered by the Qualcomm QCS6490 SoC. ⌘ Read more

⤋ Read More

使用 OpenTelemetry 實現 Golang 服務的可觀測系統
這篇文章中我們會討論可觀測性概念,並瞭解了有關 OpenTelemetry 的一些細節,然後會在 Golang 服務中對接 OpenTelemetry 實現分佈式系統可觀測性。Test Project我們將使用 Go 1.22 開發我們的測試服務。我們將構建一個 API,返回服務的名稱及其版本。我們將把我們的項目分成兩個簡單的文件(main.go 和 info.go)。// file: main. ⌘ Read more

⤋ Read More

你管这破玩意叫指针?
内存,通常被严谨地画成下面这个样子,一个下方是低地址上方是高地址的格子楼。

Image

但我今天换种画法,画成下面这个样子。

Image

每个格子代表内存中的 1 个字节(8 位),格子上的数字就代表内存地址,我也直接用 10 进制来表示了,免得 16 进制又算不明白了。

目前内存是完全空的,格子里没有任何内容。

试想一下,如果你忘掉所有的语法规则和编程规范,你会如何描述对这些内存格子的操作呢?

一、类型系统

很简单,往格子 3 处放个数字 29,往格子 6 处放个数字 38,就这么简单直接地描述即可。

![](https://pic3.zhimg.com/v2-d81f50bc28296aa1a5f6f4456ed4887a_ … ⌘ Read more

⤋ Read More

sqlx: 功能強大的數據庫訪問庫
sqlx[1] 是一個用於擴展標準庫 database/sql 的庫,它提供了一些額外的功能,使得在 Go 中使用 sql 更加方便。sqlx 的目標是保持 database/sql 的簡單性,同時提供更多的功能。sqlx 爲 Go 的標準 database/sql 庫提供了一組擴展。sqlx 中的 sql.Conn、sql.DB、sql.TX、sql.Stmt、sql.Rows、sql.Row ⌘ Read more

⤋ Read More

Release Candidate of iOS 17.5 & iPadOS 17.5 Available for Testing
Apple has issued release candidate builds for iOS 17.5, iPadOS 17.5, watchOS 10.5, tvOS 17.5, and visionOS 1.2. MacOS Sonoma 14.5 release candidate is not yet available. The release candidate versions arrived right after the new M4 iPad Pro debuted, and the final version of iPadOS 17.5 will almost certainly ship on that device. How … [Read More](https://osxdaily.com/2024/05/08/release-candidate-of-io … ⌘ Read more

⤋ Read More

Matter 1.3 Specification Adds Energy Reporting, Electric Vehicle Charging, Water Management Support and More
The Connectivity Standards Alliance (CSA) today announced the debut of a new Matter 1.3 specification that’s available for device makers and platforms. Matter is a smart home protocol that allows smart devices to work across multiple platforms, including HomeKit.

Image

Matt … ⌘ Read more

⤋ Read More

Go Heap Profile 怎麼了?
Go heap profile 是常常用來檢查內存泄露和內存佔用大問題的問題的手段,而且非常常用。而且,我們也經常創建兩個間隔較長的 heap profile, 獲取它們的差值來方便查看內存泄露: Hi, 使用多年的 go pprof 檢查內存泄漏的方法居然是錯的?! [1]今天,度廠的一位同學提出了一個很有意思的案例,讓我們對 heap profile 有了更深的理解。問題: heap prof ⌘ Read more

⤋ Read More

Celebrating 1 year of A11y Design Bootcamp: Takeaways and tips
A11y Design Bootcamp is a live educational program that consists of exercises, discussions, and knowledge shares to raise awareness of web accessibility best practices, the role designers play in creating accessible products, and how to advocate for accessibility with cross-functional partners.

The post [Celebrating 1 year of A11y Design Bootcamp: Takeaways and tips](https://github.blog/2024-05-02-celebrating-1- … ⌘ Read more

⤋ Read More

Erlang Solutions: Naming your Daemons
Within Unix systems, a daemon is a long-running background process which does not directly interact with users. Many similar processes exist within a BEAM application. At times it makes sense to name them, allowing sending messages without requiring the knowledge of their process identifier (aka PID). There are several benefits to naming processes, these include:

  1. Organised processes: using a descriptive and meaningful name organises the processes in the system. It cla … ⌘ Read more

⤋ Read More

Beta 4 of macOS Sonoma 14.5, iOS 17.5, iPadOS 17.5, Available for Testing
The fourth beta versions of iOS 17.5, macOS Sonoma 14.5, and iPadOS 17.5 have been released to users engaging in the beta testing programs for Apple system software. Additionally, new betas for watchOS 10.5, tvOS 17.5, and visionOS 1.2, are also available. While it’s not clear when the final versions of these system software versions … [Read More](https://osxdaily.com/2024/04/30/beta-4-of-m … ⌘ Read more

⤋ Read More

不可思議的快!加速 Docker 中構建 Golang 應用
這些天我在工作中正在進行一個 GoLang 項目。這與我們通常使用的 Java 和 Spring Boot 應用程序有很大不同, 感覺很不錯:)。和我們所有的其他組件一樣, 這個 GoLang 項目也需要被封裝在一個容器中, 才能在 Kubernetes 集羣中執行。所以我編寫了一個 Dockerfile:構建階段FROM golang:1.22.1-alpine AS buildWORKDIR ⌘ Read more

⤋ Read More

Golang 高效的切片拼接和 Go1-22 中新的拼接方法
在 Go 中,切片拼接是一種常見操作,但如果處理不當,可能會導致性能問題或意外的副作用。本文將詳細介紹幾種切片拼接的高效方法,討論它們的優缺點以及適當的使用場景。 基本的方法和其限制使用 append 函數最直接的方法是使用 append 函數,它將一個切片的元素添加到另一個切片的末尾。slice1 := []int{1, 2}slice2 := []int{3, 4}result := app ⌘ Read more

⤋ Read More

Go 語言將 PDF 轉爲 Word ,代碼怎麼實現?
將 PDF 轉換爲 Word 這是一個很常見的功能了,用 Go 語言實現,可以通過以下步驟完成:1 安裝 PDF 轉換工具庫:首先需要使用 Go 語言中的 PDF 轉換庫,比如 pdftoword 或 pdfcpu。你可以使用 Go 的包管理工具(如 go get)來安裝這些庫。2 導入依賴庫:在 Go 項目中導入你選擇的 PDF 轉換庫,並確保正確地導入了所有需要的依賴項。3 加載 PDF 文件 ⌘ Read more

⤋ Read More

使用 GitHub Actions 構建 Golang PGO
今年 2 月,我宣佈 Dolt 版本現已構建爲配置文件引導優化 (pgo) 二進制文件,利用 Golang 1.20 的強大功能將 Dolt 的讀取性能提高 5.3%。在我宣佈這一消息之前,我們的一位常駐 Golang 專家 Zach 試驗並測試了 Golang 的 pgo 功能,並寫下了他在使用 Dolt 構建後觀察到的性能提升,該配置文件首先針對 Dolt 運行我們的 Sysbench 基準測 ⌘ Read more

⤋ Read More

How Katalyst guarantees memory QoS for colocated applications
Member post originally published on Katalyst’s blog In the previous post[1], we introduced Katalyst – a QoS-based resource management system that helps ByteDance improve resource efficiency through colocation of online and offline workloads. In the colocation scenario, memory… ⌘ Read more

⤋ Read More

Beta 3 of iOS 17.5, macOS Sonoma 14.5, iPadOS 17.5, Available for Testing
Apple has issued the third beta versions of iOS 17.5, macOS Sonoma 14.5, iPadOS 17.5, watchOS 10.5, visionOS 1.2, and tvOS 17.5, to all users participating in the beta testing programs for Apple system software. The new beta builds are available to both developer beta and public beta testers on any actively enrolled device, though … [Read More](https://osxdaily.com/2024/04/24/beta-3-of-ios- … ⌘ Read more

⤋ Read More

Golang 異步編程方式和技巧
Golang 基於多線程、協程實現,與生俱來適合異步編程,當我們遇到那種需要批量處理且耗時的操作時,傳統的線性執行就顯得喫力,這時就會想到異步並行處理。下面介紹一些異步編程方式和技巧。作者:zvalhu一、使用方式1.1、最簡單的最常用的方式:使用 go 關鍵詞func main() { go func() {  fmt.Println(“hello world1”) }() go func( ⌘ Read more

⤋ Read More

從零到生產:Go 在 Google 的歷程 [譯]
2007 年 Go 誕生於 Google,2009 年 Google 正式對外宣佈了 Go 語言的開源!時至今日,距離 Go 開源已經過去了近 15 個年頭了 [1]!Go 在 Google 公司內部究竟是怎樣的一個狀態呢?前 Google 員工 Yves Junqueira 近期撰文從其個人所見所聞談了 Go 在 Google 的歷程 [2]!這裏簡單翻譯,供大家參考! 最近,Jeremy Ma ⌘ Read more

⤋ Read More

Been clearing out my pod a bit and blocking unwanted domains that are basically either a) just noise and/or b) are just 1-way (whose authors never reply or are otherwise unaware of the larger ecosystem)

Let me know if y’all have any other candidates you’d like me to add to the blocked domain list?

⤋ Read More