Plants Are Becoming Less Nutritious Because of Climate Change, Impacting Herbivores From Insects to Giant Pandas
Cristen Hemingway Jaynes, Contributing Writer - EcoWatch
Stephan: We are destroying the ecosystems of Earth, and making wholy inadequate attempts to restore Earth’s matrix of life. For that reason humanity is going to have a horrible planet-wide catastrophe occur about 2040, 15 years from now.
![] … ⌘ Read more
設計模式 in Go: Observer
行爲模式旨在解決對象間通信和交互相關的問題,專注於定義那些複雜到無法靜態設計的協作策略,這些協作策略使得程序可以在運行時動態地進行職責派遣以實現更好的擴展。今天我們開始第 8 個行爲模式的學習 —— Observer(觀察者模式)。問題背景:—–觀察者模式用於當對象之間存在一對多關係時,即一個對象的變化需要傳播給多個其他對象。它允許被觀察對象的狀態發生變化時,其他依賴對象能自動收到通知並進行 ⌘ Read more
What to Expect From Apple in 2025
Apple is going to have a busy year in 2025, based on the rumors that we’re hearing right now. All of the rest of the Mac lineup will be updated with M4 chips, plus there’s a new iPhone SE coming, and a whole new iPhone 17 “Air” that’s slimmer than any iPhone to date.
_[Subscribe to the MacRumors YouTube channel](https://www.youtube.c … ⌘ Read more
Go Protobuf 新增全新不透明 API
Protobuf 是 Google 的語言中立的數據交換格式。早在 2020 年 3 月,就發佈了 google.golang.org/protobuf 模塊,這是對 Go protobuf API 的重大修訂。該包引入了對反射的一流支持、一個 dynamicpb 實現和 protocmp 包,以便於測試。現在,我們將爲生成的代碼發佈一個新的 API,我們將說明創建新 API 的動機,並展示如何在 ⌘ Read more
高性能 Gin 框架原理學習教程
作者:jiayan 工作中的部分項目使用到了 gin 框架,因此從源碼層面學習一下其原理。1. 概述Gin 是一款高性能的 Go 語言 Web 框架,Gin 的一些特性:快速 基於 Radix 樹的路由,小內存佔用,沒有反射,可預測的 API 性能。 支持中間件 傳入的 HTTP 請求可以由一系列中間件和最終操作來處理,例如:Logger,Authorization,GZIP,最終操作 D ⌘ Read more
‘Concentration Camps’: Border Czar Says Trump to Detain Migrant Families
Jessica Corbett, Staff Writer - Common Dreams
_Stephan: Tom Homan looks like a thug and, I suspect, has been chosen by Trump because he has no qualms about behaving like one. I fear that on 21 January Homan will start the trend Trump has constantly promised, and that it is going to provoke a civil uprising in Blue states and in Red states it may become so intense that, as in the K … ⌘ Read more
Where Will All of Big Tech’s Nuclear Waste Go?
Matthew Gault, - Gizmodo
_Stephan: What few know today is that civilian nuclear power came about because Admiral Hyman Rickover figured out how to create nuclear-powered ships and submarines, and General Electric and Westinghouse which he was working with wanted a civilian market so they could develop a large enough corps of engineers and civilian nuclear reactors so that the whole effort would be as profitable as possible. What … ⌘ Read more
Merrick Garland’s DOJ criticized for impeding Ethics Committee’s Matt Gaetz investigation
Sarah K. Burns, Senior Digital Editor - Raw Story
_Stephan: It is my belief that in the future historians are going to see Senator Mitch McConnell and Attorney General Merrick Garand as two of the worst villains and the weakest men of this period. Biden is an institutionalist and he has been weak in dealing with Garland whom he should have replac … ⌘ Read more
Spain’s MetroCHARGE Powers EVs With Energy Recovered From Barcelona Subway Train Brakes
Paige Bennett, Contributing Writer - EcoWatch
_Stephan: Here is some good news although, once again, it is not a development in the United States. While we are about to go backwards to sustain the carbon era to the profit of the oligarchs that have supported criminal Trump’s election, the other democracies of the world are trying to exit that era, a … ⌘ Read more
Ten Mythical German Beasts Guaranteed to Give You Nightmares
Pretty much every country and culture around the world has a set of creepy mythical beasts as part of their ancient folklore. All over the globe, our ancestors have passed down oral traditions and tall tales about strange things that go “bump” in the night. Just as much as anywhere else on earth, Germany has […]
The post [Ten Mythical German Beasts Guaranteed to Give You Nightmares](https://listverse.com/2024/12/ … ⌘ Read more
Golang 中的 Context 如何讓代碼更智能、更安全、更易於擴展
Go 開發中,context 包已經成爲一個必不可少的工具。它提供了一種在不同的 goroutine 之間傳遞請求範圍內變量、取消信號和截止時間的方法。通過合理地使用 context,我們可以使代碼變得更智能、更安全,並且更易於擴展。本文將詳細探討 context 的作用以及如何在實際開發中應用它。什麼是 Context?————context 是 Go 1.7 引入的一個標準庫 ⌘ Read more
設計模式 in Go: Strategy
行爲模式旨在解決對象間通信和交互相關的問題,專注於定義那些複雜到無法靜態設計的協作策略,這些協作策略使得程序可以在運行時動態地進行職責派遣以實現更好的擴展。 今天我們開始第 9 個行爲模式的學習 —— Strategy(策略模式)。問題背景:—–策略模式用於當有多種可以互換的算法或策略來完成特定任務時。使用這些算法的客戶端不需要知道算法的具體實現細節。解決方案:—–定義一個所 ⌘ Read more
@bender@twtxt.net Bahahaha in hindsight I got rid of that 🤣 Just silly nonsense, just one of those things when you create an account on yet-another silly centralized platform(s) and go “fuck” someone’s already taken the username I want 😅
and going back to a handle you could input in your client to look for the user/file, like @nick@domain.tls I think Webfinger is the way to go. It has enough information to know where to find that nick’s URL.
@prologic@twtxt.net does that webfinger fork made by darch work OK with yarn as it is now? (I’ve never used it, so I’m researching about it)
https://darch.dk/.well-known/webfinger/
Panama’s president and Trump spar over Panama Canal
Eric Bazail-Eimil and Mia McCarthy, Staff Writers - Politico
Stephan: Fascist Trump is giving the world a heads-up on the kind of international crises he is going to create as soon as he is sworn into office. He is making it clear that he isn’t going to address any of the geopolitical problems, he is going to bully little countries that have no means to oppose him. Trump is first and last a coward and a bully.
。問題背景:—–中介模式用於當一組對象需要以鬆散耦合的方式相互通信時。在複雜系統中,對象之間的直接通信會導致緊耦合和增加複雜性。中介模式有助於集中和控制對象間的通信 ⌘ Read more
Golang workspace 多模塊工作區是真的好
最近,使用了 Golang workspace,它是真的好。今日推薦給大家。Golang 在 1.18 版本開始支持多模塊工作區。使用多模塊工作區,可以幫助您同時在多個模塊中編寫代碼,並在這些模塊中輕鬆構建和運行代碼。要創建多模塊工作區,請確保你安裝的 Go 版本在 1.18 及以上纔行。我們以 Windows 爲例,演示如何創建工作區。一、創建一個目錄叫 workspace,這個是工作區的名稱。 ⌘ Read more
微服務的終極 Golang 框架:GoFr
前言–Go 語言因其出色的併發處理能力和簡潔的語法,成爲開發微服務的理想選擇。而 GoFr 框架則是一個專門爲構建 Go 微服務而設計的框架,它提供了一套完整的工具和最佳實踐,幫助開發者快速構建可靠的微服務應用。GoFr 框架簡介———GoFr 是一個專注於簡單性和性能的微服務框架。它的主要特點包括:零依賴:框架本身不依賴於任何第三方包 高性能:經過優化的路由和中間件系統 ⌘ Read more
使用 Buf 和 Nix 構建 Go 語言 gRPC 服務
在本文中,我們將探討如何在 Go 中構建一個可擴展且易於管理的 gRPC 服務。我們將使用 Buf 來管理 Protocol Buffers(Protobuf),並藉助 Nix 創建一個一致且可復現的開發環境。Buf 提供了一種高效且有組織的方式來管理 Protobuf,而 Nix 則確保開發環境在不同系統之間的一致性。通過本指南的學習,你將能夠構建一個具有清晰代碼結構和良好可維護性的完整 gRP ⌘ Read more
Monero Tech meeting scheduled for 30 December 2024 1800 UTC
The next Monero Tech meeting is scheduled to take place on Monday, December 30 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
Man, I love Gopher. I also love that I can use Termux to get Lynx and Gopher on the go. As much as I like Floodgap, Overbite on Android needs more features (like downloads).
Here’s what happens when the world’s richest man buys the presidency
Sabrina Haake, Contributing Writer - Raw Story
_Stephan: Here are the four things I think citizens should be demanding, with tens of millions going into the streets across the nation to demonstrate for them. First, the Supreme Court Citizens United decision has to be rendered meaningless by the Congress passing legislation that can overcome Trump’s veto. Second, Congress should pass le … ⌘ Read more
[ANN] Brave Wallet poll: ‘Should Monero be integrated?’ - Go vote!
Link: https://farside.link/nitter/lukemulks/status/1870239086231044598
u/Unimamo (Reddit) ⌘ Read more
Monero Tech meeting scheduled for 23 December 2024 1800 UTC
The next Monero Tech meeting is scheduled to take place on Monday, December 23 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
Top 5 Apple Products to Look Forward to in 2025
It’s looking like 2025 is going to be an important year for Apple, with the company planning to revamp the iPhone, push further into smart home products, and improve Apple Intelligence. There are tons of new products rumored for 2025, including new iPhones, M4 Macs, a smart home command center, and much more.
。問題背景:—–在設計一系列步驟的算法時,有些步驟可能在各個子類中都是通用的,而其他步驟則會有所不同。如果我們每個子類都實現所有步驟,將會產生大量重複代 ⌘ Read more
A new addition to my domain collection
My list of domains is constantly changing. Sometimes it grows, and sometimes it shrinks as I let go of a domain I no longer need. The good thing is that letting go of a domain makes room for new ones. Just yesterday I made a spontaneous purchase of another .de domain: jan-lukas.de, to go along with janlukas.de, which I already own and sometimes use for emails. ⌘ Read more
Republicans cry foul with some judges ‘unretiring’ before second Trump term
Anthony Adragna, Staff Writer - Politico
Stephan: The Republicans have been trying to take over the nation’s judiciary for several decades led by Leonard Leo and the Federalist Society. This “unretiring” of Democratic judges, blocks Trump as this article describes. This isn’t getting much media attention, but it is going to have an interesting positive effect.
進行通信。相比傳統的單體架構,微服務架構具有高靈活性和擴展性,使團隊可以在開發、測試和部署上實現高度的自治。要深度理解微服務架構的基礎和設計。一. 微服務基礎1. 微服務架構的核心基礎—————–服務劃分(Service Partitioning) 微服務的核心是將應 ⌘ Read more
Dr. Oz Exposed for Colossal, Multimillion Dollar Conflict of Interest
Edith Olmsted, Staff Writer - The New Republic
_Stephan: Out of half a dozen stories I saw today reporting the organized corruption that constitutes the incoming Trump administration, I picked this one because it is going to directly affect your life if you are a recipient of Medicare of Medicaid. But I thought I should also mention that Elon Musk spent $277 million buying Trump the Pr … ⌘ Read more
NSQ 分佈式消息隊列的最佳實踐 - Go 語言實戰指南!
NSQ 是由 Go 語言編寫的一個分佈式實時消息隊列系統,以其簡單、高性能和可擴展性著稱。今天咱們就來深入瞭解如何在實際項目中最佳地運用 NSQ,讓你的系統既穩定又高效!NSQ 架構簡介——–NSQ 採用分佈式架構,主要包含以下核心組件:nsqd: 接收、排隊、投遞消息的守護進程 nsqlookupd: 管理拓撲信息並提供發現服務 nsqadmin: Web 管理界面,用於實 ⌘ Read more
設計模式 in Go: State
行爲模式旨在解決對象間通信和交互相關的問題,專注於定義那些複雜到無法靜態設計的協作策略,這些協作策略使得程序可以在運行時動態地進行職責派遣以實現更好的擴展。今天我們開始第 4 個行爲模式的學習 —— State Pattern(狀態模式)。問題背景:———當一個對象的行爲需要根據其內部狀態的變化而變化時,通常的做法是使用 if-else 語句來處理不同的情況。然而,隨着狀態和行爲數量的 ⌘ Read more
golang 新一代標準日誌庫 slog
log/slog 是 Go 1.21 引入的一個新的日誌記錄包,旨在提供比傳統 log 包更靈活和現代化的日誌功能。它支持結構化日誌、可配置的日誌級別、靈活的日誌輸出格式等功能,彌補了舊版 log 包的不足。對比舊版 log 包 | 特性 | log | slog || — | — | — || 日誌級別支持 | 無 | 內置支持(Debug、Info 等) || 結構化日誌 | ⌘ Read more
Go 語言中嘗試延遲執行一個函數
Go 編程語言提供了豐富的特性,使得像 Google 這樣的大型公司能夠高效地進行軟件開發。它爲許多雲服務提供商和分佈式服務的底層基礎設施提供支持,同時保持了簡單易學的特點。在 Go 中,我們可以根據需要使用指針類型和值類型。在本文中,我們將探討一個有趣的使用場景。函數調用中的切片和映射傳遞————-通常,在 Go 中調用函數時,切片(slice)和映射(map)並不是通過指針傳遞 ⌘ Read more
用 Option 模式和對接層簡化和管理 Go 項目的外部 API
在項目開發實現功能需求的過程中不可避免的要與外部第三方系統進行交互,這些交互大部分是通過請求 API 接口來完成的。前幾節提到但一直沒帶大家用代碼過一遍的 Lib 層就是負責寫第三方對接邏輯的,通過把跟第三方對接的邏輯限制在 Lib 層裏,讓項目的其他部分不需要關注第三方的邏輯,從而達到每部分都職責分明,這樣項目的代碼多起來後纔不會變得臃腫和雜亂。不過在演示 Lib 層的使用前我們需要先一起給項目 ⌘ Read more
Go 源碼是如何解決測試代碼循環依賴問題的?
最近我寫了一篇講解 context 包源碼的文章《Go 併發控制:context 源碼解讀》,在閱讀源碼的過程中,我在 context 包測試代碼中發現了一個解決循環依賴的小技巧,在此分享給大家。xtest.go 解決循環依賴context 包源碼目錄結構如下: https://github.com/golang/go/tree/go1.23.0/src/context$ tree contex ⌘ Read more
Go 語言五種實現 broadcaster 的方法,你喜歡哪一種?
昨天看到 Jaana Dogan 創建了一個 broadcaster 的庫, 話說美女 Jaana Dogan 又回到了 Google 了麼。她的實現我們就當做 broadcaster 的第一個實現吧。什麼是 broadcaster?就是村口的大喇叭,一播音,全村都知道了。Jaana Dogan 實現的這個 broadcaster 只有通知的功能,沒有傳遞消息,也不能重用。我們就以這個庫爲基準,看 ⌘ Read more
since twtxt is based on text files, I think you can consider @domain.tld as an alias of http://domain.com/twtxt.txt (or https://domain.com/tw.txt, among other combinations in the wild).
Or perhaps you can use DNS TXT records?
Although I think that’s a bit more complicated for some environments and users, I’d go with looking for a default /tw*.txt
One benefit with bluesky is your username is also a website. And not a clunky URL with slashes and such. I wish twtxt adopted that. I have advocated for webfinger to for twtxt to let us do something like it with usernames. Nostr has something like it
By default the bsky.social urls all redirect to their feeds like: hmpxvt.bsky.social
Many custom urls will redirect to some kind of linktree or just their feed cwebonline.com or la.bonne.petite.sour.is or if you are a major outlet just to your web presence like https://theonion.com or https://netflix.com
Its just good SEO practice
Do all nostr addresses take you to the person if typed into a browser? That is the secret sauce.
No having to go to some random page first. no accounts. no apps to install. just direct to the person.
One benefit with bluesky is your username is also a website. And not a clunky URL with slashes and such. I wish twtxt adopted that. I have advocated for webfinger to for twtxt to let us do something like it with usernames. Nostr has something like it
By default the bsky.social urls all redirect to their feeds like: hmpxvt.bsky.social
Many custom urls will redirect to some kind of linktree or just their feed cwebonline.com or la.bonne.petite.sour.is or if you are a major outlet just to your web presence like https://theonion.com or https://netflix.com
Its just good SEO practice
Do all nostr addresses take you to the person if typed into a browser? That is the secret sauce.
No having to go to some random page first. no accounts. no apps to install. just direct to the person.
UK Government Announces Plan for 95% Green Energy by 2030
Cristen Hemingway Jaynes, Staff Writer - EcoWatch
Stephan: The science on the negative effects of carbon energy on Earth’s wellbeing is irrefutable. But still, the United States under the worst President in the country’s history is preparing to emphasize its commitment to carbon energy. In contrast the rest of the world’s democracies are going in the opposite direction. Here is the latest from the U.K.
![ … ⌘ Read more
As Trump escalates war on facts, scientists warn “we are going to get screwed”
Matthew Rozsa, Staff Writer - Salon
_Stephan: So many Americans, including a large number of Republican Congress members, led by Trump, are so poorly educated that they have become convinced environmental science is some kind of conspiracy, not the actual truth. Every scientist I know, including myself, sees this Trumpian war on facts as an ongoing catastrophe for Amer … ⌘ Read more
用 Go 實現 TCP 連接的雙向拷貝
在做網絡編程時,我們常常會遇到各種性能問題,尤其是在面對大量連接和高併發的情況下。今天,我就來聊聊如何用 Go 實現一個高效的 TCP 連接的雙向拷貝機制,幫助你減少延遲、提高吞吐量。這篇文章既適合對網絡編程有一定了解的開發者,也適合那些想要進一步提升性能的程序員。首先,給大家簡要介紹一下 “TCP 連接的雙向拷貝” 是什麼意思。簡單來說,這就是將來自一個連接的數據拷貝到另一個連接,通常這種操作是 ⌘ Read more
設計模式 in Go:Prototype
建造模式,處理與創建對象及對象實例化過程相關的問題,通常尋求以分離業務代碼和對象創建邏輯,或將複雜的構造邏輯封裝在可重用組件中的方式。讓我們來探討第四種創建模式——原型模式。問題背景: 我們有一個對象,你要創建它的一個拷貝。您可以採用什麼方法來實現這一點?也許您需要知道該對象所屬的類型,從而能夠創建新的同樣類型的對象,然後將原始對象中每個字段值複製到新對象中。該類包含一些隱藏字段,因此你無法複製 ⌘ Read more
asyncgo,純 Go 編寫的異步執行器
Asyncgo[1] 是純用 Go 編寫的零依賴異步任務執行器,優先考慮速度和易用性。特徵–異步任務執行:提交任務以異步執行並檢索結果。 無需手動管理 Goroutine :抽象化管理 Goroutine 的複雜性,並簡化代碼。 工作池管理:Asyncgo 仔細處理工作池創建和任務執行。 正常關閉:確保在關閉工作線程之前完成所有現有任務。 任務取消:支持終端終止任務。 ⌘ Read more
設計模式 in Go: Memento
行爲模式旨在解決對象間通信和交互相關的問題,專注於定義那些複雜到無法靜態設計的協作策略,這些協作策略使得程序可以在運行時動態地進行職責派遣以實現更好的擴展。今天我們開始第 3 個行爲模式的學習 —— Memento(備忘錄模式)。問題背景:在我們需要記錄和恢復對象的內部狀態,而又不希望破壞封裝原則時,可以使用備忘錄模式。有時,我們需要在特定時間點保存對象的狀態,並能夠在以後恢復該狀態。然而,直接暴 ⌘ Read more
No. 2025 Won’t Be The Year of The Linux Desktop.
Programmers banned. Bankruptcy & Funding problems. Lawsuits galore. 2024 was the worst year for Linux. Ever. And 2025 isn’t going to save us. ⌘ Read more
Here’s what happens when the world’s richest man buys the presidency
Sabrina Haake, Contributing Writer - Raw Story
_Stephan: Here is what I think is a very insightful commentary on what is going to happen starting 21 January when the United STates becomes an authoritarian oligarchy instead of a democracy. All the weak-minded Trump voters are about to discover what they have done to themselves as they, and the rest of us, experience the worst and most bia … ⌘ Read more
Are posts here still going to twtxt?
haha, that’s gold xD.
#randomMemory I remember when I was starting to code, like 30 years ago, not understanding why my Basic file didn’t run when I renamed it to .exe
And nowadays, I’ve seen a few Go apps in a single executable, so twtxt.exe could be a thing, he!
The Uniform
[Based on a story I wrote during upper-secondary school based on real
events. I translated it recently from Swedish and edited some of it. I
removed most (all?) elements of fiction.
Not a typical night, since it’s at an event in another city, but it
gives a taste of what partying in, say, 1989(?) was like. And yes, I
really usually drank two bottles of wine during a pre-party in those
days. Not unusual in the crowd I was hanging out with, I’m afraid.]
I was maybe 17 or 18. I was going to Härnösand, two train sto … ⌘ Read more
Trump’s policies ‘should be turning off farmers’ – why did so many vote for him?
Stephen Starr, Staff Writer - The Guardian (U.K.)
_Stephan: As I read or watch American journalism media I have been struck by the interviews with Trump voters who, if Trump does what he says he will, are going to be severely impacted, but don’t seem to think that will happen to them. It is very weird, but it seems to be the case. So by March, I think we are going to … ⌘ Read more
Monarch butterflies to be listed as a threatened species in US
Todd Richmond, Reporter - Associated Press
_Stephan: This is good news about a bad situation. The annual Monarch butterfly migration that has been going on for thousands of years in the past several decades was seriously endangered by human greed and stupidity. But these iconic butterflies have now been placed on the endangered species list and will receive protection as described in this article. … ⌘ Read more
HeapMap: 一個混合功能的數據結構 Go 語言實現
今天在準備《祕而不宣》系列下一篇文章時,思緒飄散了,突然想到使用 Heap 的功能再加 HashTable (Map) 的功能,可以構造一種新的數據結構,然後把我聚合程序中的數據聚合數據結構替換掉,總之思緒翩翩。然後在網上搜了一下,這種數據結構其實早就有了,名字叫 HeapMap。HeapMap (也叫做 PriorityMap) 是一種結合了堆和哈希映射的數據結構,常用於需要按鍵排序並進行高效查 ⌘ Read more
Go 高級構建指南
本文將探索 Golang 高級構建技巧,從而有助於創建更高效的二進制文件。原文: Advanced Go Build Techniques[1]構建選項以下是 go build 命令最常用的一些選項:-o: 指定輸出文件名。默認輸出文件名是主軟件包的名稱,在 Windows 系統中會自動添加 .exe 後綴。 -v: 詳細輸出。該選項會在編譯時打印軟件包的名稱。 -work: 打印 ⌘ Read more
Weakened US public broadcasters will fight for their lives in 2025
Max Tani, Staff Writer - SEMAFOR
_Stephan: If you watch PBS/NPR, or listen to it on the radio as my wife and I do, I am sure you have noticed a significant increase in time spent on fundraising. This article describes why this is happening, and where it is headed. The Trump autocracy and their Republican servants in Congress, I think, and this article confirms, are going to try and cut off … ⌘ Read more
ROG:高性能 Go 實現
本文根據字節跳動服務框架團隊研發工程師在 CloudWeGo 技術沙龍暨三週年慶典中演講內容《ROG——高性能 Go 實現》整理。 作者|不願意透露姓名的小劉市民ROG 之緣起ROG 的誕生是因爲我們一部分業務使用 Rust 重寫之後,獲得了非常好的收益,比如 AVG、CPU、MEM、P99,這些數據表現非常好,大約節省了接近 50% 的 CPU,內存大大降低。這個性能數據讓人眼紅,因此 ⌘ Read more
Go - Ollama 在本地構建你的 RAG 應用
這篇文章會引導大家使用 Golang 設置本地大型語言模型 (LLM) 並與之交互,以此在本地構建你的 AI 應用。設置本地 LLM首先,我們需要在本地計算機上運行 LLM。爲此,我們將使用 Ollama(可在 GitHub ollama[1] 上獲取)。雖然本地加載模型有多種選擇,但我發現 Ollama 是相對容易使用的。Ollama 支持 macOS、Linux 和 Windows。本文的代碼 ⌘ Read more
從理論到實踐:Go 項目中的整潔架構設計
前言你維護的Go 項目代碼架構是什麼樣子的?六邊形架構?還是洋蔥架構?亦或者是DDD?無論項目採用的是什麼架構,核心目標都應是一致的:使代碼能夠易於理解、測試和維護。本文將從Bob 大叔的整潔架構(Clean Architecture)出發,簡要解析其核心思想,並結合go-clean-arch 倉庫,深入探討如何在Go 項目中實現這一架構理念。準備好了嗎?準備一杯你最喜歡的咖啡或茶,隨着本文一探究 ⌘ Read more
推薦一個 Go 版本的支付庫
gopay 是一個使用 Golang 編寫的支付庫。現在支持微信、支付寶、QQ、通聯支付、拉卡拉、PayPal。使用方法如下:引入 gopay 庫go get -u github.com/go-pay/gopay使用示例:import ( “github.com/go-pay/gopay” “github.com/go-pay/xlog”)func main() { xlog.I ⌘ Read more
kcp 協議的 Golang 實現庫
kcp-go 是 Golang 實現的 kcp 協議庫,它是可靠的 UDP 庫。該庫 kcp-go 旨在通過 UDP 數據包提供流暢、有彈性、有序、經過錯誤檢查和匿名的流傳遞。該庫和開源項目 kcptun 經過了戰鬥測試。從低端 MIPS 路由器到高端服務器,數以百萬計的設備在各種應用中部署了基於 kcp-go 驅動的程序。包括在線遊戲、直播、文件同步和網絡加速。我們介紹一下 kcp 協議,kcp ⌘ Read more
Go 併發控制:context 源碼解讀
context 是 Go 語言的特色設計之一,主要作用有兩個:控制鏈路和安全傳值,並且 context 是併發安全的。context 在 Go 1.17 版本被引入,經過數年的迭代,在設計和用法上已經趨於穩定,本文以最新的 Go 1.23.0 版本源碼爲基礎,帶你深入理解 context 的設計和實現。context 設計context 被設計爲一個接口,名爲Context。爲了支持不同特性,這個 ⌘ Read more
Borgo:像寫 typescript 一樣來寫 Go,爽飛了
最近,我發現了一個有趣的新編程語言——Borgo。如果你是一個對編程語言感興趣的開發者,或者在使用 Go 開發應用時曾想過 “如果 Go 能多點現代語言特性會怎樣”,那這篇文章一定值得你讀下去!Borgo 的定位非常清晰:它是一種以簡潔和高效爲核心的語言,最終編譯成 Go 代碼。這意味着什麼?你不僅能獲得 Go 語言的性能優勢,還能享受到現代編程語言帶來的靈活性和便捷性。今天我們來聊聊 Borgo ⌘ Read more
fullmetalScience submits CCS proposal for ‘NoShore’ project
fullmetalScience1 has submitted their first CCS proposal2 looking to complete work on NoShore, a project dedicated to on-the-go offline payments:
TL;DR The document proposes a shell-based environment that users can run to enable offline payments with supporting merchants, whereas the actual signing device will be developed separately in an upcoming iteration.
”`
Total funding: 45 XMR.
ETA: Read more”`
Arctic Refuge Is One of Earth’s Last Truly Wild Places. Trump Calls it America’s “Biggest Oil Farm.”
Maanvi Singh, Staff Writer - Mother Jones
_Stephan: The Trump authoritarian oligarchy is going the significantly increase the use of carbon energy and the destruction of the environment. Nothing I am seeing in this transition period suggests the future holds much good news. Quite the contrary. I think by March we are going to se … ⌘ Read more
在 Go 中如果獲取 goroutine 的 id?
如果你使用過如 Python、Java 等主流支持併發的編程語言,那麼通常都能夠比較容易的獲得進程和線程的 id。但是在 Go 語言,沒有直接提供對多進程和多線程的支持,而是提供了 goroutine 來支持併發編程。不過在 Go 中,獲取 goroutine 的 id 並不像其他編程語言那樣容易,但依然有辦法,本文就來介紹下如何實現。獲取當前進程的 id首先,雖然 Go 沒有提供多進程編程,但啓 ⌘ Read more
[ANN] [CCS Draft] NoShore: Groundwork for on-the-go offline payments
Please feel free to review the linked CCS-draft - any workable feedback is welcome!
Link: https://repo.getmonero.org/fullmetalScience/ccs-proposals/-/blob/noshore/fullmetalscience-noshore.md
u/fullmetalScience (monero.town) ⌘ Read more
@bender@twtxt.net I wonder where that dude who was hosting his twtxt feed in a google drive go? 😆 that was hilarious!!
Monero Tech meeting scheduled for 16 December 2024 1800 UTC
The next Monero Tech meeting is scheduled to take place on Monday, December 16 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
Republican senator prepares ‘DOGE Act’ targeting agencies
Kevin Bogardus, - Politico
_Stephan: Tennessee MAGAt Republican Senator Marsha Blackburn has always been a notably inferior and incompetent member of the Senate, although the people of Tennesse don’t seem to see this. She has also always been a submissive doxy to Trump, and I am not surprised that he chose her to introduce legislation to legalize his previously non-existent DOGE agency that is going to gut d … ⌘ Read more
The Right Has a 150-Page Battle Plan to Shut Down Progressive Civil Society
Negin Owliaei and Maya Schenwar , - truthout
_Stephan: The MAGAt Republicans under Trump’s guidance first with Project 2025 and now with legislation like HR 9495 have made it very clear what they intend, and this is what I think is going to happen to the United States. By March, I think America will have become a plutocracy with Trump as an authoritarian leader. What I w … ⌘ Read more
Editor’s Note – Can You Help
, -
Stephan:
Two readers wrote me, and my wife told me, I should have left this note up for a couple of more days. And so I do.
First of all, I want to thank all who have been sending in monthly contributions or have sent in support over the past two days. This makes a great deal of difference to me. I am going to run this one more day.
I have been doing SR now for 33 years; I give it away freely and don’t permit advertising because I don’t have time to dig out … ⌘ Read more
This is how many animals could go extinct from climate change
Benji Jones, Environmental Correspondent - Vox
_Stephan: Nothing I see suggests to me that the coming christofascist autocracy is going to do anything substantial about protecting the matrix of life from the devastation of climate change. Here is a sense of what is coming. I urge you to get involved with some citizens’ movement that works to protect democracy and prepare meaningfully to change the … ⌘ Read more
How climate risks are driving up insurance premiums around the US – visualized
Oliver Milman , Environment Reporter - The Guardian (U.K.)
_Stephan: I have given you a number of articles about what climate change is doing, and is going to do to the cost of home and business insurance if you can get it at all. The insurance industry, both healthcare and real estate, poured millions of dollars into getting Trump elected, so I doubt he is going to d … ⌘ Read more
Go 語言中的併發模式
Go 語言以其併發性和輕量級的 goroutine 而聞名,學習如何使用和處理它們是最具挑戰性的任務。在本文中,我將展示一些併發模式及其使用場景,以幫助您識別所需場景的模式。Goroutine————package mainimport ( ”fmt” ”time”)func main() { go sayHello() // 啓動goroutine tim ⌘ Read more
Go sync-Pool 性能優化的利器
sync.Pool 簡介————sync.Pool 是什麼sync.Pool 是 Go 語言標準庫中提供的一個用於對象複用的工具,它具有以下特點:對象緩存:使用 Get、Put 方法可以獲取和歸還 sync.Pool 中的數據,從而減輕內存分配與垃圾回收的壓力; 自動回收:sync.Pool 中的對象可能會被自動回收。這意味着即使你將對象放入池中,也不能保證該對象會一直存在於 ⌘ Read more
Walmart rolls back DEI programs after right-wing backlash
y Nathaniel Meyersohn, Reporter - CNN
Stephan: As MAGAt world becomes increasingly dominant in the United States the emerging trend is we are becoming an increasingly nasty country, and I predict it is going to get much worse, particularly in states controlled by the Republican MAGAt Party.
NEW YORK, NEW YORK — Walmart, the largest private employer in the United States, will curb some [diversity, equity … ⌘ Read more
Editor’s Note – Can You Help
, -
Stephan:
First of all, I want to thank all who have been sending in monthly contributions or have sent in support over the past two days. This makes a great deal of difference to me. I am going to run this one more day.
I have been doing SR now for 33 years; I give it away freely and don’t permit advertising because I don’t have time to dig out whether a potential advertiser fosters wellbeing. Over the years it has taken longer and longer each day to researc … ⌘ Read more
Erlang Solutions: Advent of Code 2024
Welcome to Advent of Code 2024!Like every year, I start the challenge with the best attitude and love of being an Elixir programmer. Although I know that at some point, I will go to the “what is this? I hate it” phase, unlike other years, this time, I am committed to finishing Advent of Code and, more importantly, sharing it with you.
I hope you enjoy this series of December posts, where we will discuss the approach for each exercise. … ⌘ Read more
設計模式 in Go: Iterator
行爲模式旨在解決對象間通信和交互相關的問題,專注於定義那些複雜到無法靜態設計的協作策略,這些協作策略使得程序可以在運行時動態地進行職責派遣以實現更好的擴展。今天我們開始第 2 個行爲模式的學習 —— Iterator(迭代器模式)。問題背景:設想我們定義了一個新的數據類型,它包含了一系列數據元素,可能是以 list、array、set 或其他據結構進行存儲,重要的是我們後續會出於性能、功能方面 ⌘ Read more
理解 Go 協程調度的本質
作者:jiayan golang 的一大特色就是 goroutine,它是支持高併發程序的重要保障;通過 go 關鍵字我們就能輕易創建大量的輕量級協程,但它和我們認知中的線程有什麼區別呢,輕量在哪裏,具體是如何進行調度的….. 本文將從涉及到的一些基礎知識開始,逐步介紹到 go 協程調度的核心原理,希望你能有所收穫~ 函數調用棧進程在內存中的佈局首先回顧下進程的內存佈局~ 操作系統把磁盤上 ⌘ Read more
Go 開發者的密碼學導航:crypto 庫使用指南
Go 號稱 “開箱即用”,這與其標準庫的豐富功能和高質量是分不開的。而在 Go 標準庫中,crypto 庫(包括 crypto 包、crypto 目錄下相關包以及 golang.org/x/crypto 下的補充包) 又是 Go 社區最值得稱道的 Go 庫之一。crypto 庫由 Go 核心團隊維護,確保了最高級別的安全標準和及時的漏洞修復,爲開發者提供了可靠的安全保障。crypto 還涵蓋了從基 ⌘ Read more
精通 Go 併發:上下文傳播與取消的奧祕
Go 的併發模型堪稱一場革命,但管理複雜的併發操作並非易事。這時,context 的傳播與取消機制便成爲了強有力的工具。通過這些機制,我們可以構建健壯的、可取消的操作,甚至跨越多個 goroutine 和網絡邊界。基礎知識—-context 包提供了一種方法,用於在 API 邊界和進程之間傳遞截止時間、取消信號以及請求範圍的值。這是控制長時間運行操作和優雅關閉服務的關鍵。以下是一個使用 con ⌘ Read more
使用 Go 開發 AI Agent 的選擇:Genkit for Go
什麼是 Genkit———-Genkit[1] 是一個 Google Firebase 團隊開發的 AI Agent 開發框架,用於構建現代、高效的 AI 應用。它目前包含一個 Node.js 的實現 [2] 和一個 Go 語言的實現 [3]。之所以注意到這個框架是因爲 Go 團隊在他們的十五週年博客 [4] 中提到了它。Go 團隊在博客中提到,他們正在努力使 Go 成爲構建生產 AI ⌘ Read more
SNeedlewoods completes first part-time Monero dev work CCS
SNeedlewoods1 has posted a Monero dev update2 after working part-time on Monero development for 1 month (~65 hours) during their first CCS proposal3:
Thanks for all the support from CCS coordinators, upvoters, donors and dev colleagues. It’s an honor to be able to work with you. [..] Will continue to work on the wallet API and will try to solve review comments ASAP, but since I’ll go take some days off … ⌘ Read more
5 分鐘搞懂 Golang 數據庫連接管理
本文介紹瞭如何在 Golang 中優化數據庫連接,通過有效管理連接來提高應用程序吞吐量。原文: Optimizing Database Connections in Go: Improving Throughput by Managing Open Connections Efficiently[1]Go 的 database/sql 軟件包提供了自動化數據庫連接池,能夠幫助開發人員有效管理連 ⌘ Read more
用 Go 寫 GUI?這套跨平臺工具箱真香:Tk9-0
大家好!今天我想聊聊用 Go 語言開發 GUI(圖形用戶界面)應用的一個輕量級工具 —— Tk9.0。如果你曾經嘗試用 Go 開發過桌面應用,可能會覺得有些難下手:傳統的工具太 “重”,需要額外安裝依賴,還經常跟操作系統深度綁定,跨平臺開發的成本也不低。而 Tk9.0 正好解決了這些痛點。什麼是 Tk9.0?Tk9.0 是一個 CGo-free(無 C 綁定)、跨平臺的 GUI 工具包,由 mod ⌘ Read more
GORM 分頁新方案
Gorm 是 Go 語言中最常用的 ORM(對象關係映射)包之一,但它在某些功能上仍有不足,其中之一就是分頁。分頁是管理 Web 應用程序中大數據集的基本功能。通過分頁,可以限制和顯示數據庫中的部分數據,而不必一次性檢索整個表的數據。雖然 Gorm 的文檔中介紹瞭如何使用 Scopes 來實現分頁,但在靈活性和可用性上仍有改進空間。本文介紹了一種利用 Gorm 的 Clauses 特性來簡化分頁並 ⌘ Read more
Trump is taking the mask off after lying to us for more than a year
Thom Hartmann, Commentator - Raw Story
Stephan: Thom Hartmann and I usually agree, and we certainly do about this. I think by March we are going to have a pretty good idea whether we will remain a genuine democracy or whether we are on the path to becoming a pseudo-democracy like Hungary and Russia.
。 問題背景: 創建的對象有時比較複雜,可能需要按照特定順序對所有依賴項進行逐一構建,創建依賴項後再最終構建期望的對象。創建這些最終對象及依賴對象,需要很多參數。如果通過構造函數的參數列表 ⌘ Read more
Go 協程正確用法基礎與進階
在 Go(Golang)的世界中,goroutines 是語言的瑰寶之一。它們輕量、高效,使開發者能夠輕鬆編寫併發和並行程序。但正如俗話所說,能力越大,責任越大。濫用 goroutines 可能導致內存泄漏、性能下降,甚至導致生產服務器崩潰。在這篇文章中,我們將介紹 goroutines 的基礎知識、最佳實踐,以及每個開發者應該瞭解的重要 “注意事項”。讓我們深入瞭解吧!Goroutines 概覽 ⌘ Read more
Monero Tech meeting scheduled for 9 December 2024 1800 UTC
The next Monero Tech meeting is scheduled to take place on Monday, December 9 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
Elon Musk Targets Consumer Protection Agency for Deletion
Nicholas Liu , Staff Writer - truthout
Stephan: The oligarchs are becoming more and more explicit in what they are trying to do to America’s democracy. I think that by March we are going to be living in a very different and strange country and the Republican voters are going to be totally unprepared for what they have allowed to happen by how they voted.
![](https://www.schwartzreport.net/wp-content/uplo … ⌘ Read more
White button mushroom extract shrinks tumors and delays their growth
Paul McClure, - New Atlas
_Stephan: Here is some interesting good news about the benefits from eating white button mushrooms. To read the actual peer-reviewed research study. To read the peer-reviewed paper go to: [Reduction of myeloid-derived suppressor cells in prostate cancer murine models and patients following white button mushroom treatment](https://onlinelibrary.wiley.com/doi/ … ⌘ Read more
Merrick Garland and his ‘Justice’ Department should never be forgiven
D. Earl Stephens, Contributing Writer - Raw Story | Commentary
Stephan: I completely agree with this article. I think in the future historians and legal scholars are going to condemn Merrick Garland’s weakness and incompetence as Attorney General. As a result of Garland’s mismanagement of DoJ Trump is getting away scot-free from literally dozens of crimes and traitorous activity.
! … ⌘ Read more