Searching txt.sour.is

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

Go 一文帶你喫透 HTTP 客戶端!
*1. HTTP 請求簡介HTTP(Hypertext Transfer Protocol) 是構建 web 應用通信的基石。HTTP 工作於客戶端 - 服務端架構上。HTTP 客戶端發起請求, 服務器接收請求並返回響應。HTTP 請求主要由請求行、請求頭、請求體組成請求行 GET /search?name=Golang HTTP/1.1請求頭部 Host: www.baidu ⌘ Read more

⤋ Read More

iOS 15.8.1 & iPadOS 15.8.1 Security Updates Released for Old iPhone, iPad, iPod Touch
Apple has released security updates to old model iPhone, iPad, and iPod touch devices running iOS 15 and iPadOS 15. Yes, you read that correctly and you do not need to check your calendar (or your eyes), iOS 15.8.1 and iPadOS 15.8.1 are new releases of system software for old hardware. iOS 15.8.1 and iPadOS … [Read More](https://osxdaily.com/2024/01/23/ios-15-8-1 … ⌘ Read more

⤋ Read More

golang 中如何使用 kafka
Kafka 是一種備受歡迎的流處理平臺,具備分佈式、可擴展、高性能和可靠的特點。在處理 Kafka 數據時,有多種最佳實踐可用來確保高效和可靠的處理。本文將介紹這些實踐方法,並展示如何使用 Sarama 來實現它們。Kafka 消費的最佳實踐取決於你的使用場景和需求,以下是一些建議:1 使用 Consumer Group: 在生產環境中,建議使用 Consumer Group,這樣可以確保多個消費 ⌘ Read more

⤋ Read More

DietPi January 2024 news (version 9.0)
DietPi’s latest release, version 9.0, rolled out today, marks a significant update for the lightweight Linux OS, renowned for its efficiency on single-board computers. This release phases out support for the older Debian Buster version, introduces compatibility with the new 1.5 GB Orange Pi Zero 3, and brings several enhancements and bug fixes across the […] ⌘ Read more

⤋ Read More

Ignite Realtime Blog: HTTP File Upload plugin 1.4.0 released
The HTTP File Upload plugin is a plugin for Openfire that allow users to easily share files (such as pictures) in a chat

A new release is now available for this plugin: version 1.4.0.

This release introduces a couple of interesting security improvements:

  • an additional guard has been added that should prevent scripts embedded in data to be executed without the recipient’s approval
  • It is now possible to configure a viru … ⌘ Read more

⤋ Read More

Ignite Realtime Blog: Presence Service plugin v1.7.2 release
The Presence Service plugin is a plugin for Openfire. It provides a service that provides simple presence information over HTTP. It can be used to display an online status icon for a user or component on a web page or to poll for presence information from a web service.

A new release is now available for this plugin: version 1.7.2.

In this release, an incompatibility with the recently released Openfire 4.8.0 was fixed. Als … ⌘ Read more

⤋ Read More

原來可以這麼使用 Protobuf
*1. Protobuf 簡介1.1 Protobuf 是什麼Protocol Buffers (簡稱 Protobuf) 是 Google 公司開源的一種輕便高效的結構化數據存儲格式, 以及用於序列化和反序列化結構化數據的代碼生成器。它可以用於通訊協議和數據存儲等領域。Protobuf 是以 .proto 文件形式定義結構化數據的方式和格式。並且通過代碼生成器生成各平臺 (Java、C++、Py ⌘ Read more

⤋ Read More

Go 插件機制詳解:原理、設計與最佳實踐
*1. Go 語言插件基礎1.1 插件概述插件是一種動態加載的代碼單元, 它可以在程序運行期間被動態加載和掛接到主程序上, 從而擴展主程序的功能。Go 語言從 1.8 版本開始, 通過 plugin 包提供了對插件的初步支持。利用插件, 可以在不需要重新編譯主程序的情況下, 動態地擴展主程序的功能, 做到高內聚低耦合。1.2 插件的定義和結構從實現上看, Go 語言的插件就是一個獨立編譯的 dyn ⌘ Read more

⤋ Read More

Go 1-18 泛型全面講解:一篇講清泛型的全部
序2022 年 3 月 15 日,爭議非常大但同時也備受期待的泛型終於伴隨着 Go1.18 發佈了。可是因爲 Go 對泛型的支持時間跨度太大,有非常多的以 “泛型” 爲關鍵字的文章都是在介紹 Go1.18 之前的舊泛型提案或者設計,而很多設計最終在 Go1.18 中被廢棄或發生了更改。並且很多介紹 Go1.18 泛型的文章 (包括官方的) 都過於簡單,並沒對 Go 的泛型做完整的介紹,也沒讓大家意 ⌘ Read more

⤋ Read More

Golang 實現程序優雅退出的方法有哪些?
在 Go 語言中,實現程序的優雅退出是一項重要的任務,特別是在涉及到 HTTP 服務器、gRPC 服務器、以及其他後臺工作的情況下。以下是一些常見的平滑關閉方法:1. HTTP Server 平滑關閉Go 1.8 及以上版本提供了 http.Server 結構的 Shutdown 方法,用於平滑關閉 HTTP 服務器。package mainimport (    ”context”    ”ne ⌘ Read more

⤋ Read More

Rust Embedded Working Group Announces Embedded-HAL v1.0
The Rust Embedded Working Group has announced a significant milestone with the release of embedded-hal version 1.0, marking a new chapter in the Rust embedded ecosystem. This release, alongside companion crates like embedded-hal-bus, embedded-hal-async, and embedded-hal-nb, represents a culmination of efforts since 2020 to stabilize and refine the embedded-hal traits. Embedded-HAL is a Rust-based framework […] ⌘ Read more

⤋ Read More

Bought some more fencing for the garden, need to make it a bit higher some places, so that our husky can spend more time there, a couple of places has been a bit flimsy, time to fix it :) If he really wanted - he could easily get over, but he just likes to stay in the garden, and does never mess with the fence (wire mesh fence, wooden poles in the ground). Also have a long chain as well (that’s as long as the garden) but he does not want to have that one one (and it’s under 1.5m of snow now). If he ever jumps over or digs himself out I’ll get one of long wires that goes overhead that I can attach one of those pulleys \ leash too, that’ll be better then a long chain.

⤋ Read More

Duo Display Series: Equipped with RP2040 and ESP32 Microcontrollers
SB-Components has recently introduced an innovative range of compact modules on Kickstarter, featuring the RP2040 and ESP32 S3 WROOM-1 microcontrollers. These devices are equipped with a 6-DoF IMU, interchangeable displays, and versatile options for storage and connectivity. The series showcases two primary models: the Dual Roundy and the Dual Squary. The Dual Roundy boasts a […] ⌘ Read more

⤋ Read More

沒想到,Go 語言垃圾回收是這樣工作的!
*1. 垃圾回收概述1.1 什麼是垃圾回收垃圾回收 (Garbage Collection,GC) 是一種自動內存管理的機制, 用於自動釋放那些不再被程序使用的內存。它的主要思想是程序在申請內存時不需要釋放, 而是由垃圾回收器在程序運行的過程中找出那些不再使用的內存並回收它們。這與 C/C++ 語言中的手動內存管理形成對比, C/C++ 程序員需要自己跟蹤內存的分配和釋放。而 Go 語言中內存的分 ⌘ Read more

⤋ Read More

FireBeetle 2 Upgraded with RISC-V Based ESP32-C6 SoC Featuring Zigbee 3.0 and Thread 1.3 Connectivity
DFRobot has announced the launch of the updated FireBeetle 2, now incorporating the latest ESP32-C6 System-on-Chip from Espressif Systems. This enhanced development board integrates standard I/Os, includes comprehensive battery support, and offers advanced connectivity options with Zigbee 3.0 and Thread 1.3. Unlike the FireBeetle 2 (ESP32-S3) … ⌘ Read more

⤋ Read More

Georg Lukas: Converse.js webchat for prosody-hosted chatrooms
The goal of this post is to make an easily accessible (anonymous)
webchat for any chatrooms hosted on a prosody XMPP
server, using the web client converse.js.

Motivation and prerequisites

There are two use cases:

  1. Have an easily accessible default support room for users having trouble with
    the server or their accounts.

  2. Have a working “Join using browser” button on
    [search.jabber.network … ⌘ Read more

⤋ Read More

Go 調用 C-C– 函數全攻略
*一、Go 語言調用 C/C++ 函數cgo 基礎及工作原理Go 語言通過 cgo 和 C 語言的 ABI(Application Binary Interface) 進行交互。cgo 會生成相應的 C 代碼, 與 Go 代碼一起編譯成可執行文件或動態庫。cgo 的工作流程主要分爲 3 步:(1) 預處理: 將 Go 源碼中的 C 代碼塊提取出來, 生成 .c 和 .h 文件(2) 編譯: 調用 ⌘ Read more

⤋ Read More

Go 運行時的併發原語
這篇文章我們來了解一下隱藏在 Go 運行時中的一些併發原語, 因爲運行時是底座和包循環依賴等原因,運行時中很少使用標準庫中的併發原語,它有自己的併發原語。mutex在 runtime/runtime2.go[1] 定義了一個互斥鎖,它的定義如下:type mutex struct { lockRankStruct key uintptr}它可是運行時中的大紅人了,在很多數據結構中都被廣泛的使用,凡 ⌘ Read more

⤋ Read More

Affordable $12.99 ESP32-S3 Gizmo with Compact USB Flash Drive Form-Factor
The Waveshare ESP32-S3 GEEK, designed as a compact and versatile embedded device, caters to both developers and hobbyists with its USB Flash drive form factor. Enhancing its functionality, this innovative gadget features a small yet interactive 1.14-inch LCD display, adding a visual component to its array of capabilities. At its core, the ESP32-S3 GEEK Board […] ⌘ Read more

⤋ Read More

一個例子,給你講透典型的 Go 併發控制
Go 中可以使用一個go關鍵字讓程序異步執行一個比較常見的場景:逐個異步調用多個函數,或者循環中異步調用func main() { go do1() go do2() go do3()}// 或者func main() { for i := range []int{1,2,3}{  go do(i) }}如果瞭解 Go 併發機制,就知道main在其他 goroutine 運行完成之前就已經結束了, ⌘ Read more

⤋ Read More

掌握 go test 命令,寫出可信賴的代碼
*1. test 命令概述在開發過程中,測試是確保代碼質量和穩定性的關鍵步驟。通過測試,可及早發現潛在的問題,確保代碼的正確性和可維護性。Go 語言提供了強大的測試工具,其中 go test 命令是一個不可或缺的利器。1.1 單元測試單元測試是驗證代碼中最小可測試單元的過程。在 Go 中,單元測試通常位於與被測試代碼相同的包中,以 test.go 結尾的文件中。go test 會執行這些文件中的測 ⌘ Read more

⤋ Read More

假如沒有 go install,編譯會多痛苦?
*1. go install 命令簡介go install 命令是 Go 語言的標準命令, 用於編譯和安裝 Go 語言程序。1.1 命令作用及基本原理go install 命令的主要作用是編譯和安裝 Go 語言的可執行文件或庫文件。它的基本原理是: 1. 按照包依賴關係編譯傳遞進來的 main 包及其所有依賴的包 2. 鏈接必要的包生成可執行文件 3. 將生成的可執行文件拷貝到 ⌘ Read more

⤋ Read More

Build 實戰指南:優雅編譯,高效開發
*1. Go Build 命令介紹1.1 基本語法格式Go 語言的 go build 命令用於編譯一個或多個 Go 源代碼文件,生成可執行文件或包。基本語法格式如下go build [標誌] [包名] 標誌:用於指定編譯時的選項和參數。 包名:可選,指定要編譯的包的路徑。如果省略包名,將編譯當前目錄下的所有 Go 源代碼文件。 go build 命令的工作原理包括以下步驟: 1. 分 ⌘ Read more

⤋ Read More

go run 命令核心技術詳解
*1. go run 命令簡介在 Go 語言開發中,go run 命令是一個非常常見且便捷的工具,它用於編譯並直接運行 Go 語言源代碼文件,而不需要生成可執行文件。本文將深入介紹 go run 的語法、常見用法實例、編譯命令行選項、注意事項,以及與 go build、go install 的區別和常見用途。2. go run 語法 go run 命令的基本語法爲:go run [文件名.go] ⌘ Read more

⤋ Read More

Go 測試的 20 個實用建議
2023 年 11 月初,Go 語言技術負責人 Russ Cox 在 GopherCon Australia 2023[1] 大會上進行了題爲 “Go Testing By Example”[2] 的演講:12 月初 Russ Cox 重新錄製了該演講內容的視頻,並在個人網站 [3] 上放了出來。這個演講視頻是關於如何編寫好的 Go 測試的,Russ Cox 介紹了 20 個實用建議,非常值得 G ⌘ Read more

⤋ Read More

go clean 命令 完全解析
*1. go clean 命令介紹命令作用和使用場景在 Go 語言開發中,go clean 命令是一個強大的工具,用於清除與 Go 構建相關的文件和目錄。它通常在項目維護、優化和 CI/CD 任務中發揮重要作用。使用場景包括但不限於: 在提交代碼前,清理本地構建產物,確保提交的是源代碼而非編譯文件。 在項目重構或遷移時,清理舊有構建產物,避免與新的代碼混淆。 在 CI/CD 流程中, ⌘ Read more

⤋ Read More

Go 配置文件大揭祕:INI 文件讀寫實戰詳解
*1. INI 文件簡介INI(Initialization)文件是一種簡單、文本文件格式,常用於配置文件。它由多個節(section)組成,每個節包含多個鍵值對。鍵值對的格式爲 key=value,節的格式爲 [section]。簡單示例如下://  示例INI文件[database]host = localhostport = 3306username = userpassword = sec ⌘ Read more

⤋ Read More

tar 歸檔文件處理操作指南
*1. tar 文件的概述打包和壓縮多個文件在文件處理中,經常需要將多個文件打包成一個歸檔文件以便傳輸或存儲。tar 文件就是一種常見的歸檔文件格式,它能夠將多個文件和文件夾組織成一個單一的文件。結構簡單,跨平臺特性好Tar 文件採用簡單的文件組織結構,這種結構使得 tar 文件在不同操作系統之間具有很好的兼容性。Go 語言通過標準庫內置了對 tar 文件的支持,使得在 Go 中處理 tar 文件 ⌘ Read more

⤋ Read More

基於 Go-Kit 的 Golang 整潔架構實踐
如何用 Golang 實現簡潔架構?本文介紹了基於 Go-Kit 實現簡潔架構的嘗試,通過示例介紹了簡潔架構的具體實現。原文: Why is Go-Kit Perfect For Clean Architecture in Golang?[1]簡介Go 是整潔架構 (Clean Architecture) 的完美選擇。整潔架構本身只是一種方法,並沒有告訴我們如何構建源代碼,在嘗試用新語言實現時 ⌘ Read more

⤋ Read More

基於 FX 構建大型 Golang 應用
Uber 開源的 FX 可以幫助 Go 應用解耦依賴,實現更好的代碼複用。原文: How to build large Golang applications using FX[1] 構建複雜的 Go 應用程序可能會引入很多耦合Golang 是一種流行編程語言,功能強大,但人們還是會發現在處理依賴關係的同時組織大型代碼庫很複雜。Go 開發人員有時必須將依賴項的引用傳遞給其他人,從而造成重用代碼 ⌘ Read more

⤋ Read More

Go 處理二進制文件這麼簡單
*1. 概述1.1 爲什麼學習二進制文件讀寫Go 語言內置了豐富的文件操作函數,可以很方便地處理文本文件。但對於音視頻、圖像等二進制文件,文本文件函數就不太適用了。學習 Go 語言的二進制文件讀寫操作,可以更高效地處理這些非文本文件,在實際項目中也很常用。1.2 Go 語言處理二進制文件的優勢Go 語言處理二進制文件具有以下優勢 1. 性能高,讀寫速度快 2. 支持跨平臺,代碼可以在多 ⌘ Read more

⤋ Read More

在 golang 中如何實現 WebSocket 的雙向通信
在 Go 語言中實現 WebSocket 的雙向通信通常需要使用第三方庫,其中 gorilla/websocket 是一個非常流行和廣泛使用的庫。以下是實現 WebSocket 雙向通信的步驟和簡單示例代碼:1 安裝 gorilla/websocket 庫:go get github.com/gorilla/websocket2 編寫 WebSocket 服務器:package mainimpor ⌘ Read more

⤋ Read More

將 go 代碼打包成 docker 鏡像
概述–在本教程中,你將生成一個容器映像。該映像包括運行應用程序所需的一切:編譯的應用程序二進制文件、運行時、庫以及應用程序所需的所有其他資源。前置條件—-若要完成本教程,需要滿足以下條件:golang 1.19+ 本地安裝了 docker Git 客戶端 程序–該應用程序提供兩個 HTTP endpoint:/ 返回符號 < 3 /health 返回 {“Statu ⌘ Read more

⤋ Read More

iOS 16.7.4 and iPadOS 16.7.4 Released for Older iPhone & iPad Models
Apple has released iOS 16.7.4 for older iPhone and iPadOS 16.7.4 for older iPad models that are not updating to iOS 17.2.1 or iPadOS 17.2.1. Specifically, iOS 16.7.4 and iPadOS 16.7.4 are available for iPhone 8, iPhone 8 Plus, iPhone X, iPad 5th generation, iPad Pro 9.7-inch, and iPad Pro 12.9-inch 1st generation. The software … [Read More](https://osxdaily.com/2023/12/20/ios-16-7-4-and-ipados- … ⌘ Read more

⤋ Read More

Gob 實踐全攻略,數據傳輸利器
*1. Gob 簡介1.1 Gob 概述Gob(Go binary)是 Go 語言中用於序列化和反序列化數據的編碼庫。它是 Go 語言的標準庫之一,專門設計用於在 Go 程序之間高效地傳輸數據。Gob 可以將複雜的數據結構編碼成二進制格式,便於在不同系統之間傳遞,並支持版本控制和演進。1.2 爲什麼選擇 GobGob 相比其他序列化格式(如 JSON、XML)具有更高的性能和更小的數據體積。它是專 ⌘ Read more

⤋ Read More

MacOS Sonoma 14.2.1 Update Released with Bug Fixes
Apple has released macOS Sonoma 14.2.1 as a software update for Mac users running the Sonoma operating system. The update is said to include important bug fixes and security updates, and is therefore recommended for all users to install. Separately, Apple has released iOS 17.2.1 for iPhone, iPadOS 17.2.1 for iPad, iOS 16.7.4 and iPadOS … Read MoreRead more

⤋ Read More

iOS 17.2.1 & iPadOS 17.2.1 Updates Released for iPhone & iPad with Bug Fixes
Apple has released iOS 17.2.1 for iPhone, and iPadOS 17.2.1 for iPad. The small point release updates are said to include important but unspecific bug fixes for those devices, and is therefore recommended for all users to install. Separately, Apple also released a similar update for Mac as macOS Sonoma 14.2.1, and for older iPhone … [Read More](https://osxdaily.com/2023/12/19 … ⌘ Read more

⤋ Read More

每個 Go 程序員必犯之錯
說起每個程序員必犯的錯誤,那還得是 “循環變量” 這個錯誤了,就連 Go 的開發者都犯過這個錯誤,這個錯誤在 Go 的 FAQ 中也有提到 What happens with closures running as goroutines?[1]:func main() {    var wg sync.WaitGroup    values := []string{“a”, ”b”, ”c”} ⌘ Read more

⤋ Read More

«М.Видео-Эльдорадо»: продажи игровых консолей увеличились в два раза по сравнению с 2022 годом
За 11 месяцев 2023-го продали больше 1 миллиона устройств.

Image

Read more

⤋ Read More

Today’s Advent of Code puzzle was rather easy (luckily), so I spent the day doing two other things:

  • Explore VGA a bit: How to draw pixels on DOS all by yourself without a library in graphics mode 12h?
  • Explose XMS a bit: How can I use more than 640 kB / 1 MB on DOS?

Both are … quite awkward. 😬 For VGA, I’ll stick to using the Borland Graphics Interface for now. Mode 13h is great, all pixels are directly addressable – but it’s only 320x200. Mode 12h (640 x 480 with 16 colors) is pretty horrible to use with all the planes and what not.

As per this spec, I’ve written a small XMS example that uses 32 MB of memory:

https://movq.de/v/9ed329b401/xms.c

It works, but it appears the only way to make use of this memory is to copy data back and forth between conventional memory and extended memory. I don’t know how useful that is going to be. 🤔 But at least I know how it works now.

Image

⤋ Read More

Isode: Red/Black – 2.1 New Capabilities

Overview

This release adds important new functionality and adds further device drivers to Red/Black, a management tool that allows you to monitor and control devices and servers across a network, with a particular focus on HF Radio Systems.  A general summary is given in the white paper Red/Black Overview.

![](https://www.isode.com/company/wordpress/wp-content/uploads/2023/12/red-black-bla … ⌘ Read more

⤋ Read More

Beta 1 of iOS 17.3, iPadOS 17.3, macOS Sonoma 14.3 Available for Testing
Apple has issued the first beta versions of iOS 17.3 for iPhone, ipadOS 17.3 for iPad, and macOS Sonoma 14.3 for Mac. The beta builds are available now to users enrolled in the beta testing programs on their compatible devices. iOS 17.3 will introduce a new feature called Stolen Device Protection which aims to help … [Read More](https://osxdaily.com/2023/12/12/beta-1-of-ios-17-3-ipados-17-3- … ⌘ Read more

⤋ Read More