MSNBC Loses Almost HALF Its Viewers in Stunning Post-Election Ratings Report
David Gilmour, - MEDIAite
_Stephan: Something important and sad is taking place at MSNBC. First MSNBC and CNBC are being split off from NBC News, and it is not at all clear whether what will become two companies will cooperate, and in what way. If MSNBC loses access the the worldwide NBC network of reporters, it is going to change them fundamentally. Viewers, as this a … ⌘ Read more
Mercedes reinvents the brakes for electric vehicles
Joe Salas, - New Atlas
_Stephan: Here is some good news about an important new development for braking in EVs. Sadly, American automakers are falling further behind technologically, and this is going to be seriously exacerbated if Trump carries through with his Mexican, Canadian, and Chinese tariff schemes. American automakers are heavily dependent on those countries to produce their cars and trucks, and thousands of … ⌘ Read more
設計模式 in Go: Decorator
結構模式關注代碼、組件以及接口的有效組織與調用,主要解決如對象間的關係管理、提供必要抽象與具體實現相分離,以及將多個不同的庫或框架集成爲一個統一且連貫的系統等問題。今天我們開始第 4 個結構模式的學習 —— Decorator(裝飾器)。問題背景:我們希望在運行時增強或修改特定對象的功能。由於對象存在一定的類繼承關係,所以開發者可能首先想到通過修改基類的功能來實現,以希望這些修改可以同時在所有 ⌘ Read more
Go 協程與通道
在談論 goroutines 時,我們需要記住 Go 語言的簡潔性,並且它非常強調併發處理。併發是指能夠獨立地處理多個任務,一項接一項地進行,這與並行不同,後者是指任務同時執行。我在之前的文章中已經討論過併發和並行的區別,所以這裏不再深入探討。Goroutines 的基本概念—————-讓我們直接進入 Go 中 goroutines 的主題,這是在代碼中實現併發處理的一種方式。 ⌘ Read more
Go ahead, ban kids from social media, but please outlaw these grown-ups too
Curtail under-16s, by all means, but let’s not forget the adult Insta-imbeciles, LinkedIn humble braggarts, Twitter twits and the rest. ⌘ Read more
Why Mass Deportations Would Cripple California’s Economy
Mark Kreidler, - The American Prospect
_Stephan: When you combine Trump’s tariffs and his deportation schemes, what you get is that you and I are, by Robert Reich’s estimate, going to face about $6,000 in additional annual expenses. It is going to particularly impact Trump working and middle-class voters in Red states. And that doesn’t even address the massive social disruption that will arise from ripping im … ⌘ Read more
NASA Satellites Show Major Drop in Global Freshwater Since 2014
Paige Bennett, Contributing Writer - EcoWatch
_Stephan: Here is an aspect of climate change I have not seen previously. It is going to have a significant impact on countries all over the world, particularly developing nations with poor infrastructure. It will though impact large parts of the United States. Humanity is simply not doing what needs to be done, and Trump doesn’t even seem to think c … ⌘ Read more
The future of customer service is here, and it’s making customers miserable
Emily Stewart, Senior Correspondent - msn | Business Insider
Stephan: Another AI problem. I have personally experienced this problem, have you? Not with insurance, but with medical group practices, setting up appointments. I think this trend is going to get much worse.
… ⌘ Read moreGo 1-23 Timer Channel 的改變
官方的介紹。https://go.dev/wiki/Go123Timer Go 1.23 引入了一個新的實現方案,用於由 time.NewTimer、time.After、time.NewTicker 和 time.Tick 創建的基於通道的定時器。這個新實現帶來了兩項重要改變:未停止但不再被引用的定時器和週期計時器現在可以被垃圾回收。在 Go 1.23 之前,未停止的定時器在觸發之前無法被垃圾回 ⌘ Read more
Go 語言高性能協程池實現與原理解析
前言—–在 Go 語言中, 雖然協程的創建成本相對較低, 但在高併發場景下, 無限制地創建協程仍可能導致系統資源耗盡。協程池通過複用一組預創建的協程來處理任務, 可以有效控制協程數量, 提升系統性能和穩定性。協程池的核心原理———–協程池的核心思想是維護一個固定大小的協程隊列, 這些協程會持續從任務隊列中獲取任務並執行。主要包含以下組件:任務隊列: 存儲待執行的任務 工 ⌘ Read more
Monero Tech meeting scheduled for 2 December 2024 1800 UTC
The next Monero Tech meeting is scheduled to take place on Monday, December 2 2024 at 18:00 UTC, in the #no-wallet-left-behind 1 IRC-Libera/Matrix channels:
Based on the opinions given here2 I decided to go back to the No Wallet Left Behind Matrix room and IRC channel for the next i.e. coming Monday’s meeting, and to not contiune to hold meetings like the last one in the -dev Matrix room and IRC channel.
This meeting’s chai … ⌘ Read more
The Rise of Trump and the Fall of American Empire
Alfred McCoy, Fred Harvey Harrington Professor of History at the University of Wisconsin–Madison - truthdig
_Stephan: This geopolitical analysis of what is likely to happen during the upcoming Trump administration, in my opinion, is accurate. I think Alfred McCoy describes the American future with brutal insight. Trump and his gang of MAGAt mafioso, I believe are going to leave office with China the leading nation in the … ⌘ Read more
COP29: Key outcomes agreed at the UN climate talks in Baku
, - Carbon Brief
_Stephan: This is by far the best analysis of what happened at the just closed COP29 summit in Baku, Azerbaijan. IT is kind of semi-good news. Rich countries, as the article describes are going to underwrite $300 billion in aid to help developing countries deal with climate change. A not insignificant sum, but a fraction of what is actually needed. Two things stand out for me from COP29: … ⌘ Read more
設計模式 in Go: Flyweight
結構模式關注代碼、組件以及接口的有效組織與調用,主要解決如對象間的關係管理、提供必要抽象與具體實現相分離,以及將多個不同的庫或框架集成爲一個統一且連貫的系統等問題。今天我們開始第 6 個結構模式的學習 —— Flyweight(享元模式)。問題背景:程序執行時會創建太多相似的對象副本,所以內存消耗會非常高。觀察這些這些對象定義發現,它們包含了若干的共同屬性(字段值相同),而其他字段則不同。這些 ⌘ Read more
認識一下 Golang 定時框架
cron,相信玩過 Linux 的朋友應該都對這個很熟悉吧,這不就是計劃任務嘛,當你需要某個時間段去執行某一件事的時候,普通的執行方式已經不能滿足我們的需求了,這個時候就需要一個定時任務了,那麼下面我就來介紹一個 Go 的開源定時任務框架。一、安裝—- 下載go get github.com/robfig/cron/v3@v3.0.0 導入:這裏後面加個v3意味着這是v3版本,注意不要搞錯 ⌘ Read more
一文搞懂如何在 Go 包中支持 Hash-Based Bisect 調試
bisect 是一個英文動詞,意爲 “二分” 或“分成兩部分”。在數學和計算機科學中,通常指將一個區間或一個集合分成兩個相等的部分。對於程序員來說,最熟悉的 bisect 應用莫過於下面兩個:算法中的二分查找 (binary search) 二分查找是一個經典且高效的查找算法,任何一本介紹數據結構或計算機算法的書都會包含對二分查找的系統說明。所謂二分查找就是通過不斷將搜索區間一分爲二來找到目 ⌘ Read more
Last week at The Lunduke Journal (Nov 10 - Nov 23, 2024)
Mozilla Nearing EOL, Linux CoC Insanity, Red Hat Ditching Linux for AI, & … Pokémon Go? ⌘ Read more
Go 併發控制:singleflight 詳解
singleflight 是 Go 官方擴展庫 x 中提供的擴展併發原語,能夠將多個併發請求合併爲一個,降低服務端壓力。本文就來介紹下它的用法和實現原理。請求合併singleflight 主要用於抑制重複的併發調用,從而避免對同一資源進行重複操作,提升系統性能。比如,當我們有多個 goroutine 併發調用一個同一個函數時,singleflight 能夠實現只讓一個 goroutine 發起調用 ⌘ Read more
Go 中祕而不宣的數據結構 maphash:性能之王
哈希算法 (也稱散列算法) 是一種將任意長度的輸入數據轉換成固定長度輸出的數學算法。Hash 算法的應用場景Hash 算法常常用在以下的場景中:數據完整性驗證 可以爲文件生成唯一的哈希值,用於檢測文件是否被篡改 常見場景如軟件下載時的 MD5 校驗、區塊鏈中的數據驗證 密碼存儲安全 不直接存儲用戶密碼原文, 而是存儲密碼的哈希值 即使數據庫被攻破, 黑客也無法直接獲取 ⌘ Read more
Gin 框架 JSON 格式返回結果的使用方式
大家好,我是 frank。「Golang 語言開發棧」公衆號作者。01 介紹Gin 框架爲 JSON、XML 和 HTML 渲染提供了易用的 API。本文我們主要介紹 JSON 的使用方式。02 JSON在 Go 項目開發中,當開發 HTTP API 時,我們通常提供 JSON 格式的返回結果。Go 框架爲 JSON 渲染提供了易用的 API。普通 JSON示例代碼:func main() { ⌘ Read more
go build is working but not go build main.go
Termux same thing @doesnm uses and it worked 👍 Media
@doesnm@doesnm.p.psf.lt No it’s all good… I’ve just rebuilt it from master and it doesn’t look like anything is broken:
~/GitRepos> git clone https://github.com/plomlompom/htwtxt.git
Cloning into 'htwtxt'...
remote: Enumerating objects: 411, done.
remote: Total 411 (delta 0), reused 0 (delta 0), pack-reused 411 (from 1)
Receiving objects: 100% (411/411), 87.89 KiB | 430.00 KiB/s, done.
Resolving deltas: 100% (238/238), done.
~/GitRepos> cd htwtxt
master ~/GitRepos/htwtxt> go mod init htwtxt
go: creating new go.mod: module htwtxt
go: to add module requirements and sums:
go mod tidy
master ~/GitRepos/htwtxt> go mod tidy
go: finding module for package github.com/gorilla/mux
go: finding module for package golang.org/x/crypto/bcrypt
go: finding module for package gopkg.in/gomail.v2
go: finding module for package golang.org/x/crypto/ssh/terminal
go: found github.com/gorilla/mux in github.com/gorilla/mux v1.8.1
go: found golang.org/x/crypto/bcrypt in golang.org/x/crypto v0.29.0
go: found golang.org/x/crypto/ssh/terminal in golang.org/x/crypto v0.29.0
go: found gopkg.in/gomail.v2 in gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
go: finding module for package gopkg.in/alexcesaro/quotedprintable.v3
go: found gopkg.in/alexcesaro/quotedprintable.v3 in gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc
master ~/GitRepos/htwtxt> go build
master ~/GitRepos/htwtxt> ll
.rw-r--r-- aelaraji aelaraji 330 B Fri Nov 22 20:25:52 2024 go.mod
.rw-r--r-- aelaraji aelaraji 1.1 KB Fri Nov 22 20:25:52 2024 go.sum
.rw-r--r-- aelaraji aelaraji 8.9 KB Fri Nov 22 20:25:06 2024 handlers.go
.rwxr-xr-x aelaraji aelaraji 12 MB Fri Nov 22 20:26:18 2024 htwtxt <-------- There's the binary ;)
.rw-r--r-- aelaraji aelaraji 4.2 KB Fri Nov 22 20:25:06 2024 io.go
.rw-r--r-- aelaraji aelaraji 34 KB Fri Nov 22 20:25:06 2024 LICENSE
.rw-r--r-- aelaraji aelaraji 8.5 KB Fri Nov 22 20:25:06 2024 main.go
.rw-r--r-- aelaraji aelaraji 5.5 KB Fri Nov 22 20:25:06 2024 README.md
drwxr-xr-x aelaraji aelaraji 4.0 KB Fri Nov 22 20:25:06 2024 templates
Termux same thing @doesnm uses and it worked 👍 Media
I’m cloned repo and go mod init/go mod tidy/go build, only master are broken?
應用性能優化:如何有效地分析和優化 pprof CPU 性能分析數據
pprof 是一個用於分析 Go 程序性能數據的工具,幫助開發者找出 CPU、內存和其他瓶頸。本文提供了一個詳細的分步指南,介紹如何分析 .pprof 文件,包括設置、生成文件和解釋結果。第一步:安裝必要工具———-要分析 .pprof 文件,請確保安裝以下工具:Go 編程語言: 從官方網站安裝 Go。 驗證安裝:go version pprof 工具: ppr ⌘ Read more
爲 Nintendo Switch™ 編譯 Go 程序
之前,我們將 Go 程序編譯爲 WebAssembly,然後轉換爲 C++ 文件以在 Nintendo Switch 上運行。現在,我已成功將 Go 程序編譯爲 Nintendo Switch 的原生二進制文件,並在那裏運行遊戲。我使用-overlay選項用 C 函數調用替換系統調用。此外,我開發了一個新的包 Hitsumabushi[2] 來生成此內容的 JSON。注意–本文及文中的開源項目僅 ⌘ Read more
Silent messengers also go down X(
Go 包構建:專家也未必瞭解的文件選擇細節
在 Go 語言開發中,包(package)是代碼組織的基本單位 [1],也是基本的構建單元。Go 編譯器會將每個包構建成一個目標文件 (.a),然後通過鏈接器將這些目標文件鏈接在一起,形成最終的可執行程序。儘管 Go 包的構建過程看似簡單,但實際上蘊含着許多值得深入瞭解的細節。例如,當我們執行 go build 命令時,Go 編譯器是如何選擇需要編譯的源文件的?你可能會回答:“不就是通過文件名中的 ⌘ Read more
Hehe, although it isn’t a fancy language PHP has improved a lot since the old PHP 5 days ¯_(ツ)_/¯ It’s 3 to 5 times slower than Go, so I think that’s not too bad
The Pokemon Go Spying Conspiracy Theory? Yeah. It’s Verified.
Pokemon Go using your phone camera to build a CIA-backed 3D Map AI system. ⌘ Read more
Gopherholes come and go. It’s normal. Got no answer to my mail (No garantee that it’s not sitting in a spam folder).
@doesnm@doesnm.p.psf.lt up to you. I have mine to rotate at 1,000 twtxts. I have vomited over 400, so far. I have some way to go till rotation. :-D
Apple Seeds Third Beta of visionOS 2.2 to Developers With Ultrawide Mac Virtual Display
Apple today seeded the third beta of an upcoming visionOS 2.2 update to developers for testing purposes, with the beta coming a week after the second visionOS 2.2 beta.
visionOS 2.2 can be installed by going to the Software Update section of the Settings app … ⌘ Read more
Go 語言實現守護進程的技術詳解
引言–在後端開發中, 守護進程 (Daemon) 是一個非常重要的概念。它是一個在後臺運行的長期存在的進程, 不受終端控制。本文將詳細介紹如何使用 Go 語言實現守護進程, 並探討其中的關鍵技術點。什麼是守護進程?——–守護進程具有以下特徵:在後臺運行 與終端會話無關 通常在系統啓動時啓動, 在系統關閉時關閉 沒有控制終端 作爲服務運行 守護進程的啓 ⌘ Read more
Go sync-Cond:最容易被忽視的同步機制
引言在探討 Go 語言中的同步機制時,大多數開發者都熟悉 sync.Mutex 和 sync.RWMutex。然而,還有一個強大但經常被忽視的同步原語:sync.Cond。本文將詳細介紹 sync.Cond,解釋它的工作原理,並通過實際示例說明其應用場景。什麼是 sync.Cond?當一個 goroutine 需要等待一些特定的事情發生時,例如一些共享數據發生變化,它就會 “阻塞”,這意味着它只是 ⌘ Read more
eBPF on Go
本篇內容是根據 2021 年 10 月份#201 eBPF and Go[1] 音頻錄製內容的整理與翻譯eBPF(已有 7 年曆史)是一個可以在 Linux 內核中運行代碼的沙箱。它最初是一種構建防火牆的技術,隨着時間的推移不斷髮展,包含一系列新功能。本期大家討論了 eBPF 的起源及其工作原理,並深入研究了一些實際用例。雖然 eBPF 程序本身不是用 Go(更像 C)編寫的,但我們將瞭解如何從 ⌘ Read more
Monero Tech meeting scheduled for 25 November 2024 1800 UTC
The next Monero Tech meeting is scheduled to take place on Monday, November 25 2024 at 18:00 UTC, in the #no-wallet-left-behind 1 IRC-Libera/Matrix channels:
Based on the opinions given here2 I decided to go back to the No Wallet Left Behind Matrix room and IRC channel for the next i.e. coming Monday’s meeting, and to not contiune to hold meetings like the last one in the -dev Matrix room and IRC channel.
This meeting’s c … ⌘ Read more
使用 go-jsonstruct 快速生成 Go 結構體,支持 JSON 或 YAML!
在 Go 語言開發中,我們經常需要處理 JSON 或 YAML 格式的數據。爲了方便地解析和操作這些數據,通常會定義相應的 Go 結構體與之對應。然而,手動編寫這些結構體定義可能會非常繁瑣,尤其是在處理複雜數據結構時。go-jsonstruct 工具應運而生!它可以幫助我們自動生成 Go 結構體定義,從而節省時間和精力,提高開發效率。本文將深入探討 go-jsonstruct 的功能、使用方法以及 ⌘ Read more
Go 項目實戰 - API 路由的分模塊管理
隨着項目開發的迭代,我們寫的接口往往會越來越多,如果都把 API 的路由寫到一個文件裏,那麼整個路由文件就會變得又亂又長,所以我們最好在項目開始階段就給路由的分模塊管理做好規劃。今天這個文章給大家介紹一下 Web 項目 API 路由的分模塊管理,我們的項目使用的是 Gin 框架,但基本上所有的 Web 框架都能按照這個方式來分模塊管理 API 接口的路由。 一些路由管理混亂的例子——– ⌘ Read more
Go 併發控制:sync-Once 詳解
在 Go 語言的併發編程中,常常會遇到需要確保某個操作僅執行一次的場景。sync.Once 是 Go 標準庫中的一個簡單而強大的工具,專門用於解決這種需求。本文將深入解析 sync.Once 的使用方法和原理,幫助你更好地理解 sync.Once 在併發控制中的用法。sync.Oncesync.Once 是 Go 語言 sync 包中的一種同步原語。它可以確保一個操作(通常是一個函數)在程序的生命 ⌘ Read more
Go 編譯的幾個細節,連專家也要停下來想想
在 Go 開發中,編譯相關的問題看似簡單,但實則蘊含許多細節。有時,即使是 Go 專家也需要停下來,花時間思考答案或親自驗證。本文將通過幾個具體問題,和大家一起探討 Go 編譯過程中的一些你可能之前未曾關注的細節。 注:本文示例使用的環境爲 Go 1.23.0、Linux Kernel 3.10.0 和 CentOS 7.9。Go 編譯默認採用靜態鏈接還是動態鏈接?————— ⌘ Read more
Go 中祕而不宣的數據結構 CacheLine:精細優化
在現代多核處理器中,高效的緩存機制極大地提升了程序性能,而 “僞共享” 問題卻常常導致緩存機制的低效。背景----- cacheline 本文中有時又叫做 緩存行在現代多核處理器中,三級緩存通常分爲三級:L1、L2 和 L3,每一級緩存的大小、速度和共享方式都不同:L1 緩存:這是速度最快的緩存,通常每個 CPU 核心都有獨立的 L1 緩存。L1 緩存分爲兩個部分:一個用於存儲指令(L1I),另 ⌘ Read more
用 Go 語言如何實現將中文轉化爲拼音
有這麼一個需求:新用戶入職 創建一系列賬號比較麻煩,打算通過接口傳入姓名進行初始化。想把姓名轉化成拼音。因爲有些賬號即需要中文也需要英文。下面看看用 Go 語言如何去解決的。要將用戶的姓名轉換爲拼音,可以使用 Go 語言的第三方庫,比如 github.com/mozillazg/go-pinyin,這是一個流行的庫,專門用來將漢字轉換爲拼音。你可以通過它生成拼音格式的英文名稱,用於初始化賬戶時的多 ⌘ Read more
只改變一個字符就能使 Golang 程序提速 42-
虎哥來聊聊怎麼用一個小小的改動,給你的 Golang 代碼提速 42%!很多時候,程序性能優化就是這樣:只要動一個字符,就可能帶來出人意料的提升。今天咱們就從切片傳遞優化、變量聲明優化和字符串拼接優化入手,看看怎麼改動這麼一個字符能讓 Golang 飛起來!🚀切片傳遞優化先來說說切片。切片在 Go 語言中用得特別多,因爲它們既靈活又方便。然而,切片的傳遞會帶來性能問題,尤其是當切片非常大時。原始代 ⌘ Read more
MoneroKon 2025 event to be held June 20-22 in Prague at La Fabrika/Second Culture
The fifth edition of the Monero Konferenco 1 annual meeting is set2 to take place place in Prague, Czech Republic on June 20-22 at the La Fabrika/Second Culture 3 venue (previously known as Paralelni Polis):
Save the date: MoneroKon will be held 20th - 22nd June 2025 [..] Sign up to our mailing list to be notified when tickets go on sale
The previous conference was also held in Pragu … ⌘ Read more
@eapl.me@eapl.me Neat.
So for twt metadata the lextwt parser currently supports values in the form [key=value]
https://git.mills.io/yarnsocial/go-lextwt/src/branch/main/parser_test.go#L692-L698
@eapl.me@eapl.me Neat.
So for twt metadata the lextwt parser currently supports values in the form [key=value]
https://git.mills.io/yarnsocial/go-lextwt/src/branch/main/parser_test.go#L692-L698
@eapl.me@eapl.me here are my replies (somewhat similar to Lyse’s and James’)
Metadata in twts: Key=value is too complicated for non-hackers and hard to write by hand. So if there is a need then we should just use #NSFS or the alt-text file in markdown image syntax
if something is NSFWIDs besides datetime. When you edit a twt then you should preserve the datetime if location-based addressing should have any advantages over content-based addressing. If you change the timestamp the its a new post. Just like any other blog cms.
Caching, Yes all good ideas, but that is more a task for the clients not the serving of the twtxt.txt files.
Discovery: User-agent for discovery can become better. I’m working on a wrapper script in PHP, so you don’t need to go to Apaches log-files to see who fetches your feed. But for other Gemini and gopher you need to relay on something else. That could be using my webmentions for twtxt suggestion, or simply defining an email metadata field for letting a person know you follow their feed. Interesting read about why WebMetions might be a bad idea. Twtxt being much simple that a full featured IndieWeb sites, then a lot of the concerns does not apply here. But that’s the issue with any open inbox. This is hard to solve without some form of (centralized or community) spam moderation.
Support more protocols besides http/s. Yes why not, if we can make clients that merge or diffident between the same feed server by multiples URLs
Languages: If the need is big then make a separate feed. I don’t mind seeing stuff in other langues as it is low. You got translating tool if you need to know whats going on. And again when there is a need for easier switching between posting to several feeds, then it’s about building clients with a UI that makes it easy. No something that should takes up space in the format/protocol.
Emojis: I’m not sure what this is about. Do you want to use emojis as avatar in CLI clients or it just about rendering emojis?
Two years with my new laptop 💻
It’s now about two years since I got my new laptop and replaced my Surface Go and my desktop computer with it to be more flexible when commuting. Here’s a small recap on why I’m so happy about my companion. ⌘ Read more
使用 Go 構建 Web 應用:MVC 模式、Gin 框架、GORM 和 JWT
在本文中,我們將使用 Go 編程語言構建一個 Web 應用程序,利用 Gin 框架進行路由,GORM 進行數據庫交互,並使用 JWT(JSON Web Tokens)進行身份驗證。應用程序將採用 MVC(模型 - 視圖 - 控制器)設計模式,以促進關注點的清晰分離。前置條件—-在開始之前,請確保您具備以下條件:已在您的計算機上安裝 Go(版本 1.16 或更高)。 已設置 Postgre ⌘ Read more
Righto, @eapl.me@eapl.me, ta for the writeup. Here we go. :-)
Metadata on individual twts are too much for me. I do like the simplicity of the current spec. But I understand where you’re coming from.
Numbering twts in a feed is basically the attempt of generating message IDs. It’s an interesting idea, but I reckon it is not even needed. I’d simply use location based addressing (feed URL + ‘#’ + timestamp) instead of content addressing. If one really wanted to, one could hash the feed URL and timestamp, but the raw form would actually improve disoverability and would not even require a richer client. But the majority of twtxt users in the last poll wanted to stick with content addressing.
yarnd actually sends If-Modified-Since request headers. Not only can I observe heaps of 304 responses for yarnds in my access log, but in Cache.FetchFeeds(…) we can actually see If-Modified-Since being deployed when the feed has been retrieved with a Last-Modified response header before: https://git.mills.io/yarnsocial/yarn/src/commit/98eee5124ae425deb825fb5f8788a0773ec5bdd0/internal/cache.go#L1278
Turns out etags with If-None-Match are only supported when yarnd serves avatars (https://git.mills.io/yarnsocial/yarn/src/commit/98eee5124ae425deb825fb5f8788a0773ec5bdd0/internal/handlers.go#L158) and media uploads (https://git.mills.io/yarnsocial/yarn/src/commit/98eee5124ae425deb825fb5f8788a0773ec5bdd0/internal/media_handlers.go#L71). However, it ignores possible etags when fetching feeds.
I don’t understand how the discovery URLs should work to replace the User-Agent header in HTTP(S) requests. Do you mind to elaborate?
Different protocols are basically just a client thing.
I reckon it’s best to just avoid mixing several languages in one feed in the first place. Personally, I find it okay to occasionally write messages in other languages, but if that happens on a more regularly basis, I’d definitely create a different feed for other languages.
Isn’t the emoji thing “just” a client feature? So, feed do not even have to state any emojis. As a user I’d configure my client to use a certain symbol for feed ABC. Currently, I can do a similar thing in tt where I assign colors to feeds. On the other hand, what if a user wants to control what symbol should be displayed, similar to the feed’s nick? Hmm. But still, my terminal font doesn’t even render most of emojis. So, Unicode boxes everywhere. This makes me think it should actually be a only client feature.
一文帶你看懂 Golang 最新特性
作者:騰訊 PCG 代碼委員會 經過十餘年的迭代,Go 語言逐漸成爲雲計算時代主流的編程語言。下到雲計算基礎設施,上到微服務,越來越多的流行產品使用 Go 語言編寫。可見其影響力已經非常強大。一、Go 語言發展歷史介紹Go 語言起源於 2007 年的 Google;創始人有三位,分別是 Ken Thompson、Rob Pike、Robert Griesemer;他們可謂是大佬中的大佬。最初的構 ⌘ Read more
Golang 編譯:靜態鏈接和動態鏈接
本文介紹了 Go 語言中靜態鏈接和動態鏈接的概念,解釋了它們的區別和各自優勢。通過示例,展示瞭如何生成靜態或動態鏈接的二進制文件,以及使用工具進行檢查。文章還討論了內部和外部鏈接器的區別,如何在編譯時選擇鏈接方式,以及在交叉編譯時處理 cgo 的方法。最後,提到了減小二進制文件大小的技巧和安全性方面的考慮。概述–Go 語言最大的優勢之一就是它的編譯器,它爲程序員抽象了許多細節,讓你可以輕鬆地爲幾 ⌘ Read more
After testing Vivaldi for a couple of weeks I am convinced this is a great browser and to support the team behind it, I decided to start sending them a couple of Euro monthly, just to keep the momentum going.
Go 語言 bufio 包入門:10 分鐘掌握高性能 I-O 操作
大家好,今天我們來聊一個 Go 語言中非常實用的包 - bufio。不管你是剛入門的新手還是有經驗的開發者,這篇文章都能幫你快速掌握 bufio 的使用!🌟 什麼是 bufio?————-bufio 是 Go 語言提供的一個帶緩衝的 I/O 包,它像是給 I/O 操作加了一個 “加速器”,通過減少系統調用次數來提升性能。想象一下:不用緩衝:每次讀寫都直接操作硬盤,就像我們一次只買一 ⌘ Read more
Golang 解釋器:Yaegi 內部實現
Yaegi[2] 是一個用 Go 語言編寫的 Go 語言解釋器。這個項目最初是在 Traefik-Labs 啓動的, 目的是爲 traefik 反向代理提供一個簡單實用的嵌入式插件引擎。現在, 社區貢獻的 200 多個插件已經列在 plugins.traefik.io[3] 的公共目錄中。Yaegi 的使用也擴展到其他領域, 例如 數據庫 [4] 、 可觀察性 [5] 、 容器安全 [6] ⌘ Read more
完全用 Go 編寫的 JS 引擎
背景介紹隨着互聯網技術的迅猛發展,JavaScript 已經成爲幾乎所有現代網頁和應用開發中不可或缺的組成部分。但是,JavaScript 的執行環境通常侷限於瀏覽器或者 Node.js,這爲那些希望在不同環境下運行 JavaScript 代碼的開發者帶來了限制。特別是在 Go 語言環境中,開發者面臨着將 JavaScript 與 Go 通信的挑戰,因爲二者運行時不一致可能導致性能下降和開發效率降 ⌘ Read more
萬字長文講透 Go 程序性能優化
性能分析和優化是所有軟件開發人員必備的技能,也是後臺大佬們口中津津樂道的話題。Golang 作爲一門 “現代化” 的語言,原生就包含了強大的性能分析工具 pprof 和 trace。pprof 工具常用於分析資源的使用情況,可以採集程序運行時的多種不同類型的數據(例如 CPU 佔用、內存消耗和協程數量等),並對數據進行分析聚合生成的報告。trace 工具則關注程序運行時的事件(例如協程狀態切換,G ⌘ Read more
Go 中祕而不宣的數據結構 BitVec:位向量 125MB 存儲 10 億個數據
位圖 (bitmap) 是一種優雅而高效的數據結構, 它巧妙地利用了計算機最底層的位運算能力。你可以把它想象成一個巨大的開關陣列, 每個開關只有打開和關閉兩種狀態 —— 這就是位圖的本質。每一位都可以獨立控制, 卻又可以通過位運算實現羣體操作。在實際應用中, 位圖的威力令人驚歎。設想你需要在海量數據中查找重複的數字, 傳統的哈希表或數組都會佔用大量內存。而位圖卻能巧妙地用一個比特位標記一個數字的 ⌘ Read more
一個比較 tricky 的 Golang 問題: 最大協程數量
在 Go 語言面試中, 關於 “可以產生的最大協程數量” 這個問題有時會讓候選人措手不及。答案並不是簡單地給出一個具體數字。面試官通常用這個問題來評估你對 Go 併發模型、內存管理以及協程實踐經驗的理解。理解 Go 的併發模型和協程效率首先需要明確以下幾點:協程是由 Go 運行時管理的輕量級用戶空間線程, 比傳統的操作系統線程更高效 Go 並沒有對協程數量設置嚴格限制, 在合適的條件下, 你可以同 ⌘ Read more
5 Helpful Uses for Apple Intelligence on Mac, iPhone, & iPad
Apple Intelligence is here on Mac, iPhone, and iPad, and while the system requirements are strict, the Apple devices that are new and powerful enough to use the AI tools now gain some really fantastic features. We’re going to show you six helpful Apple Intelligence features and uses that you’ll find beneficial to your workflow, … [Read More](https://osxdaily.com/2024/11/04/5-helpful-uses-for-apple-intelligence-o … ⌘ Read more
Its going to be a crazy week in USA.
I will not go to the elections because I do not live in the United States and I am not a US citizen.
10 個最佳 Golang 庫
10 個最佳 Golang 庫—————在 Golang 中,我們可以找到垃圾回收、可接受的庫和標準的類型系統。Golang 適用於系統編程,也被稱爲包。Go 語言被稱爲 Golang 是因爲它在編程語言 GO 中收集了一些可重用的代碼組件。在 Go 語言中,包在組織和結構化代碼方面起着重要作用,還提高了可讀性、代碼可重用性和可維護性。這裏爲你介紹十個最佳 Golang 庫。這 ⌘ Read more
一個小例子,給你講透 Go 配置管理,輕鬆將其融入到項目中
在軟件開發中,配置管理是一個不可或缺的部分。無論是開發環境、測試環境還是生產環境,我們都需要一種方法來存儲和讀取配置信息。在 Golang 項目中,Viper 是一個非常流行且功能強大的庫,用於處理配置文件。下面我會寫一些例子,幫助大家快速上手。什麼是 Viper?———-不賣關子,直接上 GitHub 地址:https://github.com/spf13/viper 大家可以直接去 ⌘ Read more
Let’s go Minnesota Vikings. Beat the Colts!
Monero Tech meeting scheduled for 18 November 2024 1800 UTC
The next Monero Tech meeting is scheduled to take place on Monday, November 18 2024 at 18:00 UTC, in the #no-wallet-left-behind 1 IRC-Libera/Matrix channels:
Based on the opinions given here2 I decided to go back to the No Wallet Left Behind Matrix room and IRC channel for the next i.e. coming Monday’s meeting, and to not contiune to hold meetings like the last one in the -dev Matrix room and IRC channel.
This meeting’s c … ⌘ Read more
Kubectl logs tail: a guide to tailing Kubernetes logs
Member post originally published on Middleware’s blog In the world of cloud-native applications, Kubernetes stands as the go-to platform for container orchestration (the automated process of managing, scaling, and maintaining containerized applications across multiple hosts). As applications grow… ⌘ Read more
Golang 隨機公平庫 satmihir-fair
FAIR 是一個 Go 庫, 旨在確保資源受限環境中的公平性。它有助於在資源短缺時將有限的資源 (例如數據庫 / blob 存儲吞吐量、作業執行資源等) 均勻分配給多個客戶端, 防止基於客戶端行爲的過度分配和飢餓。 簡介–FAIR 的核心算法基於 隨機公平 BLUE[1] , 這種算法通常用於網絡擁塞控制, 但做了一些修改。FAIR 的理念是隻在真正資源短缺時進行限制, 而不是像令牌桶或漏桶等 ⌘ Read more
構建無密碼認證:passkey 入門與 Go 實現
傳統的密碼認證一直以來都是數字時代的主流身份驗證方式。然而,用戶常常選擇易記的弱密碼並重復使用,導致賬號易受攻擊。密碼泄露、釣魚攻擊等安全問題層出不窮,超過 80% 的數據泄露與密碼相關。與此同時,頻繁的密碼管理和忘記密碼情況嚴重影響用戶體驗。服務商在安全保存用戶密碼方面的責任也增加了系統建設和維護的成本。爲了應對這些問題,科技行業開始積極探索無密碼認證的方法。無密碼認證利用設備生物識別、硬件加密 ⌘ Read more
SwarmGo:一個用於構建可擴展 AI Agent 工作流的 Go 模塊化框架
AI 領域正在快速發展,新的應用層出不窮。然而,創建能夠有效協調多個 AI 任務或 Agent(每個 Agent 處理複雜工作流的一部分)的系統仍然具有挑戰性。SwarmGo 應運而生,這是一個功能強大且輕量級的 Go 包,旨在使 AI 應用中的 Agent 編排更易於訪問和擴展。本文將深入探討 SwarmGo 的特性、優勢和結構,並展示如何使用它輕鬆創建智能的模塊化 AI 工作流。什麼是 Swa ⌘ Read more
解密 Go runtime-SetFinalizer 的使用
如果我們想在對象 GC 之前釋放一些資源,可以使用 returns.SetFinalizer。這就像在函數返回前執行 defer 來釋放資源一樣。例如:1:使用 runtime.SetFinalizertype MyStruct struct { Name string Other MyStruct } func main() { x := MyStru ⌘ Read more
Wayback Machine & Google Website Cache Go Offline Weeks Before 2024 Election
With a Presidential election days away, the biggest ways to record online statements are conspicuously broken. ⌘ Read more
使用 Go 構建分佈式系統:基於 gRPC 的主從節點架構
在現代軟件開發領域,分佈式系統已經變得至關重要。它們使服務能夠擴展、處理大量數據並提供高可用性。本文將指導您使用 Golang 構建一個簡單的分佈式系統,該系統利用主節點和單個工作節點,並使用 gRPC 協議進行通信。這種架構非常適合數據處理、並行計算和大規模處理工作負載等分佈式任務。我們將介紹如何設置主從結構、建立基於 gRPC 的通信,以及實現簡單的任務分配和執行流程。系統概述—-我們的分 ⌘ Read more
@prologic@twtxt.net yeah short Nick is going to be unique enough. There is always olong Nick that adds the domain for differentiation.
@prologic@twtxt.net yeah short Nick is going to be unique enough. There is always olong Nick that adds the domain for differentiation.
Golang 常用的五種創建型設計模式
在 Go 中,創建設計模式有助於管理對象的創建,並控制對象的實例化方式。這些模式在對象創建過程複雜或需要特殊處理時特別有用。以下是 Go 中常用的主要創建模式:單例模式單例模式確保一個類只有一個實例,並提供一個全局訪問點。如何實現定義一個結構,並將其作爲單個實例。 爲該結構創建一個全局變量,但不要立即將其初始化。 使用 sync.Once 確保實例只創建一次,即使在多線程情況下也是如此 ⌘ Read more
For .onion gophersites you can install Orbot App on android for VPN, than go by lynx or overbite app to gopher://magical.fish, then you can open the .onion site of magical.fish.
Go 中祕而不宣的數據結構 Treap:平衡樹不一定就用紅黑樹
treap 是一棵二叉樹,它同時維護二叉搜索樹 (BST) 和堆的屬性, 所以由此得名 (tree + heap ⇒ treap)。從形式上講,treap (tree + heap) 是一棵二叉樹,其節點包含兩個值,一個 key 和一個 priority,這樣 key 保持 BST 屬性,priority 是一個保持 heap 屬性的隨機值(至於是最大堆還是最小堆並不重要)。相對於其 ⌘ Read more
Go 語言的組合之道
在軟件開發領域,”組合優於繼承” 的原則常常被奉爲圭臬,因爲它能夠帶來更靈活、更易維護的代碼。Go 語言以其獨特的面對對象設計理念,堅定地選擇了組合而非繼承。本文將深入探討 Go 語言爲何偏愛組合,並闡述其在實際應用中的優勢。繼承的弊端與組合的優勢———–傳統的面對對象編程語言通常依賴繼承機制,允許一個類繼承另一個類的行爲和屬性。然而,這種方式容易導致代碼結構僵化,難以應對需求變化。 ⌘ Read more
Monero Tech meeting scheduled for 4 November 2024 1800 UTC
The next Monero Tech meeting is scheduled to take place on Monday, November 4 2024 at 18:00 UTC, in the #no-wallet-left-behind 1 IRC-Libera/Matrix channels:
Based on the opinions given here2 I decided to go back to the No Wallet Left Behind Matrix room and IRC channel for the next i.e. coming Monday’s meeting, and to not contiune to hold meetings like the last one in the -dev Matrix room and IRC channel.
This meeting’s chai … ⌘ Read more
After the behaviour of a clearly very angry feed author over the past few days, I’m very tempted to give up on Twtxt and allow it to go back to being dead. What really is the point of building and supporting a way to exchange little pieces of text with one another in a completely decentralized way, if you’re just going to keep bumping up against such hostility? I don’t know why I do this anymore.
依賴注入:讓 Go 語言更加優雅
依賴注入:讓 Go 語言更加優雅—————-在軟件工程中,依賴注入(Dependency Injection,簡稱 DI)是一種設計模式,它允許我們在不修改類的代碼的情況下向類中注入依賴。這種方式有助於降低代碼間的耦合度,使得各個組件更容易獨立開發和測試。雖然 Go 語言以其簡潔和高效的特性著稱,但在構建大規模應用時,手動管理依賴關係可能會變得複雜和難以維護。這就是 Pa ⌘ Read more
從 Go channel 中如何批量讀取數據 ?
在 Go 語言中,我們可以利用 channel 作爲數據的傳輸通道,通過定期批量讀取 channel 中的數據,並將這些數據批量發送到 Kafka 或者進行網絡寫入。這樣可以提高系統的性能,減少單個請求的網絡開銷。批量處理的主要邏輯是:從 channel 中接收數據,積累到一定數量或者達到時間限制後,將數據批量處理(例如發送到 Kafka 或者寫入網絡)。下面我將展示一個從 Go channel ⌘ Read more
How’s everyone? I go on Gemini/gopher for a hobby. Still learning.
解析 Golang sync-Once 用法和原理
Once is an object that will perform exactly one action.sync.Once 是 Go 標準庫提供的使函數只執行一次的實現,常應用於單例模式,例如初始化配置、保持數據庫連接等。它可以在代碼的任意位置初始化和調用,因此可以延遲到使用時再執行,併發場景下是線程安全的。對外接口Once 對外僅暴露了唯一的方法 Do(f func()),f 爲需要執行的 ⌘ Read more
Go 語言的 RSA 加密與解密:方法與最佳實踐
一般對接過支付業務的都知道,RSA 算法。RSA 是一種廣泛應用於安全通信領域的非對稱加密算法。它使用一對密鑰(公鑰和私鑰)來加密和解密數據,在互聯網通信、數字簽名等場景中具有重要作用。咱們一起看一下,在 Go 語言中,如何使用 RSA 算法。一、RSA 加密與解密的基礎知識1. 非對稱加密RSA 屬於非對稱加密算法,主要特點是密鑰成對使用:一個用於加密(公鑰),另一個用於解密(私鑰)。使用公鑰加 ⌘ Read more
Go 邏輯分支優化實戰
TL;DR通過函數式編程和 map 結構可以優化複雜的 if-else 邏輯 提前返回可以避免不必要的資源消耗,防止全表掃描等問題 避免在循環中使用 defer 語句,可能導致資源泄露 使用 for 循環對相同邏輯進行壓縮,提高代碼的簡潔性和可擴展性 代碼的世界,將自然語言的需求轉換成執行的邏輯。如何轉化成代碼之後仍然儘可能接近自然語言的可理解性,是我們一直探求的內容。 ⌘ Read more
探索 Go slog 標準庫:設計與應用
本文主要介紹了 Go 語言新引入的 log/slog 標準庫的設計理念、使用方法以及如何進行定製化開發,以提高日誌操作的性能和靈活性。原文: Explore the Go slog Standard Library: Design and Usage[1]在 Go1.21[2] 中引入的 log/slog[3] 軟件包試圖彌補原有日誌軟件包的不足,即日誌缺乏結構化和級別特性。正如提案 [4] ⌘ Read more
揭祕 Go sync-Map 設計與實現
什麼是 sync.Map————我們都知道在 Go 語言中,普通的 Map 是非併發安全,併發讀寫時會 panic,sync.Map 則是官方庫提供的一種特殊的併發安全的映射類型,能保較高的性能的同時,還能保證併發安全。sync.Map 有以下幾個特點:sync.Map 特點併發安全: sync.Map 無需額外的鎖機制即可在多個 goroutine 中安全地進行讀寫操作。這對於高 ⌘ Read more
Go 項目使用 Makefile 構建版本信息完整教程
目錄結構我們以最小目錄結構爲例進行說明,如下這是我們此次示例的目錄結構。$ tree -L 3.├── main.go├── Makefile├── pkg│ └── version│ └── version.go├── README.md代碼內容主要有兩部分代碼,分別爲 main.go,內容如下:package mainimport ( ”eastMoney/pkg/ver ⌘ Read more
Go 語言實現高性能文本壓縮算法 Brotli
在信息爆炸的時代,數據如同洪流般湧現,如何高效地存儲和傳輸這些數據成爲了一項至關重要的技術挑戰。壓縮技術應運而生,它如同一位技藝精湛的魔術師,能夠將龐大的數據文件 “化繁爲簡”,在不損失信息或損失極少信息的情況下將其壓縮成更小的體積,從而節省存儲空間、提高傳輸效率。壓縮技術主要分爲兩大類:無損壓縮和有損壓縮。無損壓縮:顧名思義,這種壓縮方式能夠在解壓縮後完全恢復原始數據,不會造成任何信息損失。常見 ⌘ Read more
Apple Seeds watchOS 11.1 Release Candidate
Apple today seeded the release candidate version of an upcoming watchOS 11.1 update to developers and public beta testers for testing purposes. The new software comes approximately week after Apple released the fifth beta.
watchOS 11.1 can be installed by going to the Apple Watch … ⌘ Read more
Go 中祕而不宣的數據結構 runq- 難怪運行時調度那麼好
首先,讓我們先來回顧 Go 運行時的 GPM 模型。這方面的介紹網上的資料都非常非常多了,但是我們也不妨回顧一下: GPM 模型中的 G 代表 goroutine。每個 goroutine 只佔用幾 KB 的內存, 可以輕鬆創建成千上萬個。G 包含了 goroutine 的棧、指令指針和其他信息, 如阻塞 channel 的等待隊列等。 P 代表 processor, 可以理解爲一個抽 ⌘ Read more
解讀 Golang 標準庫裏的 varint 實現
最近發現 Golang 標準庫竟然自帶了 varint 的實現,代碼位置在 encoding/binary/varint.go。剛好藉助 golang 標準庫的 varint 源碼,我們來系統地學習和梳理下 varint。熟悉 protobuf 的人肯定對 varint 不陌生,protobuf 裏面除了帶 fix (如 fixed32、fixed64) 之外的整數類型, 都是 varint 編碼 ⌘ Read more
Monero Tech meeting scheduled for 28 October 2024 1800 UTC
The next Monero Tech meeting is scheduled to take place on Monday, October 28 2024 at 18:00 UTC, in the #no-wallet-left-behind 1 IRC-Libera/Matrix channels:
Based on the opinions given here2 I decided to go back to the No Wallet Left Behind Matrix room and IRC channel for the next i.e. coming Monday’s meeting, and to not contiune to hold meetings like the last one in the -dev Matrix room and IRC channel.
This meeting’s chai … ⌘ Read more
How to Re-Enable Slow Motion Effects on MacOS
If you’re a long time Mac user, you might recall the Slow Motion effect that could be applied by holding the Shift key while minimizing and maximizing windows, as well as for other animations like opening Launchpad or using Mission Control. Some of the fun eye-candy effects on Mac go way the early days of … Read More ⌘ Read more
Go 信號處理:優雅地關閉你的應用
在構建健壯且可靠的應用程序時,優雅地處理系統信號至關重要。系統信號,如 SIGINT(中斷信號,通常由 Ctrl+C 觸發)和 SIGTERM(終止信號),允許我們以可控的方式關閉應用程序,執行必要的清理操作,例如關閉連接、釋放資源和保存狀態。本文將深入探討在 Go 語言中如何處理系統信號。我們將涵蓋以下主題:理解系統信號 使用 os/signal 包捕獲信號 實現優雅的關閉機制 ⌘ Read more
Go 每日一題:併發下載與合併
答案–實現思路:文件分割: 將目標文件分割成多個大小相等的塊(例如 10MB / 塊)。 併發下載: 爲每個文件塊創建一個 goroutine,每個 goroutine 負責下載對應塊的內容並保存到臨時文件中。 同步與合併: 使用 channel 來同步所有 goroutine 的下載進度,並在所有塊下載完成後,按順序合併所有臨時文件,最終得到完整的原始文件。 代碼示例:pac ⌘ Read more
一文掌握 Go 語言 I-O 操作中的 io-Reader 和 io-Writer
在 Go 語言中,io.Reader 和 io.Writer 是兩個至關重要的接口,它們爲處理輸入輸出操作提供了強大且靈活的抽象。本文將深入探討這兩個接口的機制、常見用例、潛在陷阱以及一些高級應用,幫助你更好地掌握 Go 語言的 I/O 操作。io.Reader 接口:數據讀取的基礎———————-io.Reader 接口定義了讀取數據的通用方法:type Reader ⌘ Read more
Hot chips: The split that sparked a $97 billion meltdown
It is an industry crucial to the 21st century but two of its biggest players are going in opposite directions. ⌘ Read more