Alibaba, Datadog, and Quesma Join Forces on Go Compile-Time Instrumentation
Standards are only useful if they’re widely adopted, and adoption is only effective if the available tooling facilitates it. I imagine SI units would not have been too popular when they were introduced if you had to build… ⌘ Read more
@andros@twtxt.andros.dev I wouldn’t call it regular, but cyclical. Since, with the exception of Yarn (maybe?), clients are everything when it comes to twtxt, every now and then we see an increase of interest on new development. I have seeing them come and go, only few “beside remains”. :-)
To me it appeared that the failed attempts to ban NPD in the past actually helped them gain more supporters.
What makes AfD stronger for sure is just going “lol nah we’re not even going to try”:
https://www.tagesschau.de/inland/innenpolitik/afd-verbot-antrag-100.html
If they don’t try, then it means that “it can’t be that bad, it’s just a normal party”, right? 😡
context-Context - 構建高可用的 Go 應用
你是否有遇到過這樣的情況:意外的流量激增導致數據庫掛起 系統掛掉,用戶無法訪問 做爲開發人員,你忙於調試問題,事後還會被扣除績效和獎金 不受控制的 goroutines,長時間運行的任務,無響應的 API 這些都會對構建一個高可用的應用造成嚴重影響。這些問題通常源於缺乏適當的上下文管理。無論您是在處理 API 請求、管理數據庫操作,還是構建分佈式系統,掌握上下文都是每個 Go ⌘ Read more
@andros@twtxt.andros.dev Just before the pandemic, we watched Uncle Bob videos once a week in the lunch break. While almost all of my old teammates agreed with his views, I partially found them to be very odd and even counterproductive.
I didn’t come across John Ousterhout or any of his work before, at least not deliberately. So, this document is my first contact.
I only finished the chapter on comments and I totally agree with John so far. This document just manifests to me how weird Bob’s view is on certain subjects.
I always disagreed with the concept of a maximum method length. Sure, generally, shorter functions are probably better, but it always depends. And I’ve certainly seen super short methods that just made the code flow even worse to follow. While “one function should only do one thing” is a nice general rule, I’m 100% in team John with the shown examples. There are cases, where this doesn’t help readability at all. Not even close.
To me, a function always has to justify its existence. Either by reusing it at least at another place or by coming up with dedicated tests for it. But if it is just called once and there are no tests, I almost always decide against it. Personally, I don’t mind longer methods. We just recently had a discussion about that and I lost against two other workmates who are more in Uncle Bob’s camp, they refactored one medium sized method into three very short ones. Luckily, we agree on most other topics.
Lol, what!? The shorter the method, the longer the variables inside? I first thought I misread or the writeup mixed it up. I’ll always do it the other way around.
I’ve been also bitten badly by outdated comments in the past, but Bob must have worked on really terrible projects to end up with such an attitude to dislike comments. Oh well. No doubt, I’ve come across by several orders of magnitude more useless comments, in my experience (autogenerated) JavaDocs fall in the category more frequently than not. So, I know that there are different types of comments. A comment doesn’t automatically mean that it is good and justified.
But I also partially agree with Bob and John and think that a good name has a proper chance to save a comment. Though, when in doubt, I go John’s route and use a shorter name with a comment rather than use a kilometer long identifier. Writing good comments typically takes some time, sometimes much longer than writing the code. It regularly takes me several minutes. It’s a hard art.
I perhaps should read up on John’s work. He seems to be more reasonable and likeminded. :-) Let me continue to complete this document.
Donald Trump Has Launched a War Against the Working Class
Michael Arria, Staff Writer - truthout
_Stephan: As Trump’s fascist oligarch coup moves into its second month I confess I am surprised that Trump voters don’t yet seem to fully realize how severely Trump is going to damage the quality of their personal life, and the lives of their family. I keep seeing interviews with Trump voters, particularly White men, who just don’t seem capable of comprehending what is … ⌘ Read more
MCP 實戰:使用 Go 快速構建 MCP Server
MCP 簡介MCP 協議(Model Context Protocol,模型上下文協議)是由 Anthropic 於 2024 年 11 月底推出的一種開放標準,旨在統一大型語言模型(LLM)與外部數據源和工具之間的通信。官方地址 https://modelcontextprotocol.io 架構如下 MCP 協議的架構包含多個關鍵組件:Host(宿主程序)、MCP Client(M ⌘ Read more
Go 1-24 新特性:標準庫 os-Root 解析
背景 ——–Go 1.24 已進 release,其版本說明 [1] 中包含了多項新特性。本文將重點解析新增的標準庫 os.Root 功能,它能有效防禦目錄遍歷漏洞(Directory Traversal Vulnerabilities)。目錄遍歷漏洞是典型的安全問題,攻擊者通過提供相對路徑(如 ../../../etc/passwd)誘導程序訪問非授權文件。近期真實案例 CVE- ⌘ Read more
The Housing Loophole That Lets Wealthy Investors Raise Rents on Poor Tenants
Jesse Coburn, Staff Writer - ProPublica
_Stephan: An SR reader, who describes herself as a “retired teacher” wrote to tell me she was just notified her rent in an apartment building that was sold by its owner to an investment group will be going up 25%, and she is not sure she can afford it. That prompted me to do some research to see what is going on with rents for ren … ⌘ Read more
Trump Backs House GOP Bill Slashing $1 Trillion From Medicaid and Food Stamps
Chris Walker , Staff Writer - truthout
_Stephan: I was just told today by the office of one of my physicians that telemedicine, doing a video meeting with a physician, will no longer be covered by Medicare. That, for me, is a big deal. I live on an island and going to a medical appointment on the mainland when all that is involved is a conversation, is an all-day opera … ⌘ Read more
The big established parties are all bad traitors. I blame them and their actions to help raise AfD. They just [don’t?] give a fuck about the ordinary people, they’re only concerned about their private gain and power.
To a large degree, yes. But I think the media is also equally at fault. There was absolutely no reason to invite AfD people to every event and let them talk. This has been going on for over 10 years. When we give them a stage to spread their hate, are we really surprised that hate spreads … ?
I don’t know the answers to this desaster. I’m beginning to think that people literally just want an outlet for their frustration, nothing more. It’s not about what particular parties actually plan to do. At least I think this applies to people in their 30ies and 40ies.
Go 項目目錄結構指南
擁有一個井然有序的目錄結構非常重要,原因有幾個:層次分離:它將項目的不同部分——如業務邏輯、數據訪問和 API 處理——放在各自的文件夾中。這樣,開發人員可以專注於特定領域,而不會感到不知所措或困惑。 更好的組織: 通過整齊地整理你的代碼及其依賴項,較大的項目變得更容易導航。你總是知道在哪裏找到你需要的東西! 可重用性: 一個良好的結構讓你可以創建可以在項目不同部分使用的組件或包,從而 ⌘ Read more
golang 每日一庫 samber-lo
samber/lo 是一個非常流行的 Go 語言庫,它提供了一些常用的函數式編程風格的工具函數,使得 Go 代碼更加簡潔、優雅。該庫的設計理念是減少代碼冗餘,簡化開發過程,尤其是在處理常見的數據結構和算法時。lo 這個庫的名字來源於 “Lazily Optimized” 的縮寫,但它本身並不涉及延遲計算或優化策略。它的目標是提供一系列常見操作的簡便方法,尤其是集合類型(如切片、映射、通道等)的操作 ⌘ Read more
And, Ramadan is next week. So, we switched to UTC from UTC+1 in the weekend. As if it’s going to make the days any shorter 😅
Go 語言之在 Gin 框架中使用 Zap 實現高效日誌管理
在現代 Web 開發中,日誌管理是確保應用程序性能、穩定性和可維護性的關鍵因素之一。Gin 作爲輕量級的 Go Web 框架,自帶了簡單的日誌功能。然而,對於追求高性能和靈活性的開發者來說,Zap 日誌庫是一個理想的選擇。本文將深入探討如何在 Gin 框架中集成 Zap 日誌庫,實現高效、分級和結構化的日誌記錄。本文介紹瞭如何在 Go 的 Gin 框架中使用 Zap 日誌庫替換默認日誌功能,提供更 ⌘ Read more
golang 每日一庫之 pressly-goose
pressly/goose 是一個用於 Go 語言的數據庫遷移工具。它提供了一種簡單且高效的方式來管理數據庫 schema 的版本控制,適用於數據庫結構變更的管理和遷移。goose 的設計目標是讓數據庫遷移更加簡便、安全,並且在多環境下可以輕鬆應用。數據庫遷移通常用於在應用程序中管理數據模式的變化(例如添加表、修改列、刪除索引等),尤其在團隊協作開發、生產環境發佈等情境下,遷移工具幫助開發者和運維 ⌘ Read more
golang 每日一庫之 iancoleman-orderedmap
github.com/iancoleman/orderedmap 是一個 Go 語言庫,提供了一個有序字典(OrderedMap)實現,區別於 Go 語言內建的 map 類型,內建的 map 是無序的。該庫的 OrderedMap 能夠保持元素的插入順序,因此適用於需要按插入順序遍歷元素的場景。主要特點:有序性:OrderedMap 保證元素的插入順序,和內建的 map 類型不同, ⌘ Read more
Go 編程實踐 - Go Context
1、context 包的引入context 包是在 Go 1.7 引入的,它爲在多個 goroutine 之間傳遞請求範圍的上下文信息和控制 goroutine 的生命週期提供了一種標準的方式。2、context 包的主要作用傳遞上下文信息:context 可用於在 goroutine 之間傳遞請求範圍的數據,如請求的認證信息、請求的截止時間、請求的 ID 等。這些信息在 goroutine 之間 ⌘ Read more
golang 每日一庫之 swaggo
Go Swagger(Swaggo)是一個用於 Go 語言的開源工具集,它幫助開發者自動生成 API 文檔。它利用 Go 的註釋和結構體信息,通過解析代碼,生成符合 OpenAPI 規範的文檔。OpenAPI(也稱爲 Swagger)是一個廣泛使用的 API 規範,它使得 API 文檔更加標準化、易於理解和交互。Swaggo 主要的功能包括:1. 自動生成 OpenAPI 文檔Swaggo 通過解 ⌘ Read more
Go 事件驅動架構:從原理到實戰,徹底掌握高併發編程
在 Go 語言的世界裏,如何優雅地處理海量併發請求?事件驅動架構(Event-Driven Architecture, EDA)或許是你需要的答案。 🔥 爲什麼你需要關注事件驅動架構? ———————-在傳統的同步編程模式下,我們通常採用阻塞調用的方式來處理請求。然而,在高併發、高吞吐的場景下,這種方式可能帶來以下問題:線程資源浪費:大量 Goroutine 在 I ⌘ Read more
I am going to start using this one more, or exclusively, from now on. I need to get used to it, as “quark” will be gone, and “bender”, well, he is kind of tired of getting bent. :-D
@bender@twtxt.net @prologic@twtxt.net The outcome was to be expected but it’s still pretty catastrophic. Here’s an overview:
East Germany is dominated by AfD. Bavaria is dominated by CSU (it’s always been that way, but this is still a conservative/right party). Black is CDU, the other conservative/right party.
The guy who’s probably going to be chancellor recently insulted the millions of people who did demonstrations for peace/anti-right. “Idiots”, “they’re nuts”, stuff like that. This was before the election. He already earned the nickname “Mini Trump”.
Both the right and the left got more votes this time, but the left only gained 3.87 percentage points while the right (CDU/CSU + AfD) gained 14.72:
The Green party lost, SPD (“mid-left”) lost massively (worst result in their history). FDP also lost. These three were the previous government.
This isn’t looking good at all, especially when you think about what’s going to happen in the next 4 years. What will CDU (the winner) do? Will they be able to “turn the ship around”? Highly unlikely. They are responsible for the current situation (in large parts). They will continue to do business as usual. They will do anything but help poor/ordinary people. This means that AfD will only get stronger over the next 4 years.
Our only hope would be to ban AfD altogether. So far, nobody but non-profit organizations is willing to do that (for unknown reasons).
I don’t even know if banning the AfD would help (but it’s probably our best/only option). AfD politicians are nothing but spiteful, hateful, angry, similar to Trump/MAGA. If you’ve seen these people talk and still vote for them, then you must be absolutely filled with rage and hatred. Very concerning.
Correct me if I’m wrong, @lyse@lyse.isobeef.org, @arne@uplegger.eu, @johanbove@johanbove.info.
使用 Go Convey 做 BDD 測試的入門指南
前面在「Go 代碼測試時怎麼打樁?給大家寫了幾個常用案例」中我們介紹了在單元測試中使用gomonkey爲代碼進行打樁的各種方法。今天我們介紹在 Go 單元測試中另外一個很好用的工具庫goconvey,上面說的gomonkey屬於在 Test Double 方面提供能力,也就是我們通常說的mock,用它們可以自定義一套實現來替換項目中的代碼實現。而goconvey則是一個幫助我們組織和管理測試用例的 ⌘ Read more
@andros@twtxt.andros.dev yeah, sorry I couldn’t get back to you sooner. I’ve already made an account on codeberg in order to file in an issue but, I just can’t get myself to concentrate with everything going on with the family lately. I’ll do my best and get things done properly and soon
Trump orders justice department to fire all US attorneys appointed by Biden
Hugo Lowell , Staff Writer - The Guardian (U.K.)
_Stephan: The United States is no longer going to have a fair and legitimate legal system. The FBI has been corrupted into a personal internal army to pursue what “king” Trump wants pursued, and the lawyers of DOJ that are ethical men and women are resigning or, as this article describes, being fired. Like everything else T … ⌘ Read more
Trump talks of a third term amid growing concerns about a constitutional crisis
Brakkton Booker, National Political Correspondent - Politico
_Stephan: Trump clearly sees himself not so much as the President as an authoritarian king with sovereignty over the United States. And he has no plan to leave office. Nothing is going to stop this but millions of Americans out non-viollently protesting every day. Here’s something you can do. I got an em … ⌘ Read more
Mass firings continue across nation’s health agencies
Adam Cancryn, Megan Messerly and David Lim, Staff Writers - Politico
_Stephan: America’s already poor illness profit system is going to get much worse. I find it hard to believe that “king” Trump and the Republicans have such little concern for the people who voted them into office. It is going to be interesting, if tragic, to watch Trump voters face the reality of what they have done, as all the social systems that … ⌘ Read more
Hegseth’s proposed Pentagon cuts, firing of generals: What to know
Filip Timotija, Staff Writer - The Hill
_Stephan: Having worked in the Pentagon directly with two Chiefs of Naval Operations, as well as the other Joint Chiefs, I have a very real sense of the chaos Hegseth, who is appallingly unqualified to be Secretary of Defense, is going to cause as he and “king” Trump disrupt the command order, and attempt to cut the Defense Department budget by 40% over … ⌘ Read more
@eapl_en@eapl.me Your notes are amazing! I’m going to save them for when I do my implementation. Great job!
@off_grid_living@twtxt.net Oh, I’m ready for my retirement, too. :-D Still have some decades to go, unfortunately.
I always wanted to go and live in the country side, it seems I can’t manage to for financial reasons
@arne@uplegger.eu Hi! I love that you’re implementing it! Maybe, when we’re both done, we could test the clients by communicating both.
I don’t think I’m going to be able to help you much, my knowledge of OpenSSL and PHP is not as high as I’d like it to be.
Maybe the OpenSSL version uses SHA-1 by default in PHP. Or that the IV is derived together with the key (not generated separately). But I’m not able to answer your questions, sorry.
I’m invoking the commands directly, without any libraries in between. Maybe that would help you?
Some of the country’s most coveted voters are fed up with American democracy
John Sakellariadis, - Politico
_Stephan: This, I think, encapsulates where American voters stand in both parties. I think much of this is driven by the research paper on Humanity’s Precognition that I posted to SR a short while ago. If you haven;t read it I suggest you do (go to the SR archive). WHat I don’t understand is why the Democractic Party cannot seem to compreh … ⌘ Read more
Retry-Go:Go 優雅重試
在 Go 語言的開發過程中,我們經常需要執行可能失敗的操作,比如網絡請求。如果每次失敗都直接報錯並終止程序,用戶體驗就會很差。通常的做法是重試,即在失敗後等待一段時間再嘗試重新執行。retry-go (github.com/avast/retry-go) 是一個輕量級的 Go 語言重試庫,提供簡單易用的「重試機制」,支持:自定義重試策略(固定間隔、指數回退、隨機回退)。 最大重試次數(避免無 ⌘ Read more
HTTP-2 工作原理與 Go 實戰
在瞭解了上一篇文章的 net/rpc 內容(從 Go 應用中的 net/rpc 到 gRPC)後,現在是時候深入瞭解 HTTP/2 了,它是 gRPC 協議的基礎。HTTP/2 原理及 Go 實戰指南本文偏重理論講解,內容會比較密集。我們主要聚焦 HTTP/2 的核心概念,之後簡要介紹如何在 Go 中啓用它。建議泡杯咖啡,坐下來慢慢看,讓我們一步步拆解這個話題。HTTP/2 優勢——— ⌘ Read more
@prologic@twtxt.net I wish getting a static IP and a (more) stable internet connection wasn’t so hard over here. Then I could do proper self-hosting as well. But as it stands, I need some rented VPS.
I could go ahead and just use the VPS for the IP, i.e. forward all traffic through Wireguard to a box here at home. Big downside is that the network connection would be even slower than it already is and my ISP breaks down all the time for a few minutes … it’s just bad overall and much easier/better to rent a VPS. 🫤
Solar has taken off in red states. Trump’s funding freeze is causing panic
Stephen Starr , - The Guardian (U.K.)
_Stephan: Do not expect the United States to be prepared for the climate change disasters that are occurring with increasing frequency. Everything that “king” Trump and his administration can do to sabotage the preparation for what I think is going to be a civilization-threatening crisis within 15 years is being done. They are undercutti … ⌘ Read more
使用 Go 構建可擴展的 WebAssembly 應用
Go 1.24 通過新增 go:wasmexport 指令和構建 WASI 反應器(Reactor)的能力,顯著增強了其 WebAssembly(Wasm)支持。這些特性使開發者能夠將 Go 函數導出到 Wasm 模塊,實現與 Wasm 主機的深度集成,拓展了 Go 在 Wasm 應用開發中的可能性。WebAssembly 與 WebAssembly 系統接口(WASI)————- ⌘ Read more
golang 每日一庫之 govalidator
govalidator 是一個用 Go 語言編寫的輕量級的驗證庫,提供了豐富的驗證和清理功能,主要用於驗證和清理用戶輸入的數據(如表單數據、API 請求的 JSON 數據等)。它支持常見的數據驗證功能,如電子郵件、URL、IP 地址、信用卡號等的驗證,同時也支持自定義驗證規則。1. 安裝你可以通過 go get 來安裝 govalidator:go get github.com/asaskevic ⌘ Read more
Datatypes:Go 輕鬆支持數據庫 JSON 類型
GORM 是 Go 語言中最流行的 ORM 之一,它簡化了數據庫操作,提升了開發效率。然而,在某些情況下,標準的數據類型無法滿足複雜業務需求。例如,如何將 Go 中的結構體、切片、JSON 等類型映射到數據庫字段?如何方便地進行序列化和反序列化?爲了解決這些問題,GORM 提供了 datatypes (gorm.io/datatypes) 擴展庫,旨在簡化 Go 語言中複雜數據類型與數據庫字段之間 ⌘ Read more
Go 中的實時批處理: 高效數據處理的藝術
開篇:當實時性遇見批量處理 ————–在處理大量數據時,我們通常面臨兩個選擇:單條處理 和 批量處理。前者處理及時,但系統開銷大;後者吞吐量高,但可能增加延遲。那麼,有沒有一種方式能兼顧兩者的優勢?答案是——實時批處理(Real-time Batching)。爲什麼選擇 Go? ————-1.1 天生爲併發而生Go 的 Goroutine 和 Channel 機 ⌘ Read more
I’ll Dood your Cat😊 Let’s go!! ⌘ Read more
The GOP’s Taliban has a new message for women
Thom Hartmann, Commentator - Raw Story
_Stephan: As the MAGAt coup continues, as Thom Hartmann describes in this article, I think we are going to see an increasing trend to repress the voting capability of women and people of color. “king” Trump and the oligarchs who bought him his throne and control the government are largely genderists and White supremacy racists. They would prefer to have only ignorant White males voting because … ⌘ Read more
golang 面試官:for select 時,如果通道已經關閉會怎麼樣?如果只有一個 case 呢?
今天咱們聊點技術性的東西,具體說一下 Go 語言中的 for select 語句,特別是在面試中經常被問到的兩個問題。題目 1:for select 語句中,如果通道已經關閉了,會怎麼樣?這道題乍一聽簡單,但其實是面試官最喜歡用來考察你是否真正理解 Go 中通道機制的題目之一。假設你在寫一個需要從通道讀取數據的程序,然後突然有人關了通道,你會怎麼處理?程序會怎麼樣?如果你把這個問題想得很簡單,你可 ⌘ Read more
在 go 語言裏用 Redis 如何實現延時任務隊列,如何延時?
在 Go 語言中,使用 Redis 實現延時任務隊列可以通過 Sorted Set(ZSet) 結合 輪詢機制 或 Pub/Sub 實現。以下是詳細實現方案,以及延時任務與定時任務的區別和應用場景分析。一、延時任務隊列的實現(Go + Redis)核心思路存儲結構:使用 Redis 的 Sorted Set(ZSet),以任務的 執行時間戳 作爲分數(Score),任務內容作爲成員(Member) ⌘ Read more
American troops in Europe are not ‘forever,’ US defense chief Hegseth warns
Laura Kayali, - Politico
_Stephan: ”King” Trump and his vassals do not seem to understand the geopolitical relationships that for 80 years have kept us from world war. Sadly, I think we are going to see this structure wrecked by these morons. If the Ukrainian war ends in the Putin-Trump conclusion as it seems to be headed, I think we are going to see much more violence in t … ⌘ Read more
Corporate America’s Souring Profit Outlook Clouds Equity Rally
Jessica Menton, Staff Writer - Bloomberg
Stephan: Prices are going up and, as this assessment from Bloomberg makes clear, America’s economy is looking increasingly iffy. Given the trade war “king” Trump has created I don’t see how it could be otherwise. But let us hope.
Credit: BloombergBen … ⌘ Read more
理解 Go 語言中的 Graceful Shutdown 機制
當使用 Go 開發 Web 服務時,實現正確的關機處理對於維護系統可靠性和數據完整性至關重要。優雅關機能確保服務在終止前完成現有操作,而不是突然停止導致任務未完成。核心概念解析——優雅關機需要協調終止信號接收、進行中的操作和資源清理。在 Go 中,通常通過信號處理、goroutine 和基於上下文的取消機制來實現。以下是最小化實現示例:package mainimport ( ”co ⌘ Read more
Go 1-24 的 omitzero:JSON 處理的福音
使用 omitempty 忽略 JSON 中的可選字段 (Go 1.24 之前)——————————————當你有一個要轉換爲 JSON 的結構體時,你可能有一些字段是可選的。例如,我們採用以下結構體:type Response struct { ID string json:“id” // 其他字段省略 UpdatedA ⌘ Read more
用 Go 語言手撕 DNS 協議:從理論到 gothdns 的工程實踐
在互聯網基礎設施的基石中,DNS(域名系統)堪稱最優雅的分佈式系統設計典範。這個將域名轉換爲 IP 地址的魔法系統,每秒處理着數以億計的查詢請求。Go 語言憑藉其簡潔的併發模型和高效的網絡編程能力,成爲實現 DNS 協議的絕佳選擇。理解 DNS 協議需要把握三個核心要素:分層樹狀結構的域名空間 UDP/TCP 雙協議支持 資源記錄(RR)的二進制編碼規範 Go 語言標準庫中的ne ⌘ Read more
Go 語言反向代理實戰:零壓力承載百萬流量
在現代分佈式系統中,反向代理扮演着數字交通警察的角色。它不僅是客戶端與服務端之間的智能中介,更是系統架構中不可或缺的流量調度中心。典型的應用場景包括:負載均衡:智能分配請求到後端服務器集羣 安全防護:作爲安全邊界過濾惡意請求 協議轉換:統一處理不同通信協議 緩存加速:對靜態資源進行邊緣緩存 服務聚合:整合多個微服務的響應結果 Go 語言憑藉其獨特的併發模型和卓越的性能 ⌘ Read more
tt rewrite in Go and quickly implemented a stack widget for tview. The builtin Pages is similar but way too complicated for my use case. I would have to specify a mandatory name and some additional options for each page. Also, it allows me to randomly jump around between pages using names, but only gives me direct access the first, however, not the last page. Weird. I don't wanna remember names. All I really need is a classic stack. You open a new fullscreen dialog and maybe another one on top of that. Closing the upper most brings you back to the previous one and so on.
@doesnm@doesnm.p.psf.lt I’ll let you know once it reaches a point where it might be barely usable by someone else than myself. There are long ways to go, though. Right now, you don’t wanna even look at it. :-)
I’m continuing my tt rewrite in Go and quickly implemented a stack widget for tview. The builtin Pages is similar but way too complicated for my use case. I would have to specify a mandatory name and some additional options for each page. Also, it allows me to randomly jump around between pages using names, but only gives me direct access the first, however, not the last page. Weird. I don’t wanna remember names. All I really need is a classic stack. You open a new fullscreen dialog and maybe another one on top of that. Closing the upper most brings you back to the previous one and so on.
The very first dialog I added is viewing the raw message text. Unlike in @arne@uplegger.eu’s TwtxtReader, I’m not able to include the original timestamp, though. I don’t have it in its original form in the database. :-/
Next up is a URL view.
How it’s going? This is how it’s going: https://movq.de/v/b744b63cc1/oh-fuck-sleep.mp4
ok, sounds like a ‘large’ project to me.
Is it more an API (more oriented to developers), more oriented to UI/UX/Frontend? Perhaps both?
I’d go with prologic’s advice of measuring and prioritizing. Perhaps you have a budget or at least something like “let’s see how far can we reach in 6 months”, and possibly you won’t finish in the time you have (just guessing).
Something that has helped me was defining “Why do you we want to refactor this project?”.
Could it be to make it compile on newer versions, or making it easier to grow and scale, or perhaps they are trying to sell that product to another company. Every reason has a different path, IMO.
US relations with Europe will never be the same after Trump’s call with Putin
Stephen Collinson, Staff Writer - CNN
_Stephan: We, in the United States, are not only going through a coup that is destroying our democracy we are awash in corruption. Criminal Trump believes himself to be a king who can do whatever he wants. But the damage he is doing extends far beyond our borders. America has had status as a fair leader, and is has been seen as suc … ⌘ Read more
Vacuum with legs puts new spin on doing the chores
It can’t exactly go upstairs, but the Dreame X50 Ultra’s improvements and manoeuvrability put it well ahead of the competition. ⌘ Read more
[ANN] LocalMonero Clone (openmonero) is now open source
Going strong with a couple of forks will make openmonero more censorship-resistant. The reactjs codebase is now open source. Check out git repository.. (hosted on tor hidden service); contact: https://openmonero.com/support, contact II: @OM_HELP (telegram)
Links:
OpenMonero (Session ID) ⌘ Read more
[ANN] More vitamins for Monero with Carrot - part 1: Overview
A lot of interesting things go on right now in Monero development, but if you don’t happen to attend the two regular dev meetings on Mondays and Wednesdays or hang around in some of our Matrix rooms, you probably wouldn’t know much about it.
Link: https://farside.link/libreddit/r/Monero/comments/1iph8fz/
u/rbrunner7 (Github) ⌘ Read more
Definitely something going on with replies. This one was replying to the wrong twt and even when I got clever and pasted the right hash it didn’t work.
Consumer prices rise 0.5% in January, higher than expected as annual rate rises to 3%
Jeff Cox, Economics Editor - CNBC
Stephan:
_You have almost certainly noticed it. My wife and I certainly have. “emperor” Trump promised prices would go down if he were elected. They have, in fact, gone in the absolute opposite direction. And because of Trump’s ignorance and bullying they are going to go much further up. We will be in a different world … ⌘ Read more
i made a little twtxt feed fixer for when a feed uses other whitespace instead of tabs.
i made a little twtxt feed fixer for when a feed uses other whitespace instead of tabs.
Go 語言中如何高效地處理集合
在 Go 語言中,處理集合(如切片、映射等)時,可以通過多種方式提高效率。以下是一些常見的高效處理集合的方法,結合詳細的代碼例子進行講解。1. 使用切片(Slice)代替數組切片是 Go 中常用的集合類型,它比數組更靈活,因爲切片的長度是可變的。package mainimport “fmt”func main() { // 創建一個切片 numbers := []int{1, 2, ⌘ Read more
告別 WebSocket?探索 SSE 爲 Go 應用帶來的全新可能
在現代 Web 應用開發中,實時通信一直是一個重要的需求。傳統上,WebSocket 是實現實時雙向通信的首選方案。然而,隨着技術的發展,Server-Sent Events (SSE) 這一輕量級的單向實時通信技術正在獲得越來越多的關注。本文將深入探討 SSE 技術,並通過實例說明爲什麼在某些場景下它可能比 WebSocket 更適合您的 Go 應用。SSE 是什麼?——–Server ⌘ Read more
robots.txt file. only noticed it because the OpenAI bot was hitting me with a lot of nonsensical requests. here is the list from last month:
(I keep thinking that going back go Gopher or Gemini might be a good idea at this point. They don’t care about that, probably. 🫣)
10 Unbelievable Advertising Fiascoes
For various reasons, product advertisements sometimes go awry in a big way. A case in point: Budweiser Light’s ad campaign featuring transgender influencer Dylan Mulvaney resulted in a boycott that cost the company almost 1.5 billion dollars, as customers switched from Bud Light to competitors’ brands. As Harvard Business Review points out, companies learned that […]
The post [10 Unbelievable Advertising Fiascoes](https://listverse.com/2025/02/12/10-unbeliev … ⌘ Read more
Mom, please don’t go to work ⌘ Read more
I’ll doodle your Cat! Let’s go😻 ⌘ Read more
Go 併發控制:sync-Map 詳解
我們知道,Go 中的 map 類型是非併發安全的,所以 Go 就在 sync 包中提供了 map 的併發原語 sync.Map,允許併發操作,本文就帶大家詳細解讀下 sync.Map 的原理。使用示例sync.Map 提供了基礎類型 map 的常用功能,使用示例如下:package mainimport (“fmt”“sync”)func main() {var s sync.Map// 存儲鍵值 ⌘ Read more
Notary Project announces Notation v1.3.0 and tspclient-go v1.0.0!
The Notary Project maintainers are thrilled to announce the latest releases, including notation v1.3.0, notation-go v1.3.0, notation-core-go v1.2.0 and tspclient-go v1.0.0! These new versions are production ready and have successfully completed a comprehensive security audit. Check… ⌘ Read more
SCIENCE YOUTUBERS are going on a CRUISE ⌘ Read more
Go 併發控制 Wait - Cancel
Wait 和 Cancel 兩種併發控制方式,在使用 Go 開發服務的時候到處都有體現,只要使用了併發就會用到這兩種模式。在 Go 語言中,分別有 sync.WaitGroup 和 context.Context 來實現這兩種模式。sync.WaitGroup 等待多個線程完成對於要等待 n 個線程完成後再進行下一步的同步操作的做法,使用 sync.WaitGroup 來等待一組事件:func m ⌘ Read more
My baby died today. She was 19 years old. My god I’m going to miss her so much 💔 ⌘ Read more
Scientists used a computer to predict exactly when society will collapse
Lucy Devine, - LADBIBLE
_Stephan: I have been telling you, my readers, as well as anyone else who was interested and would listen that between 2040-2045 there was going to be a cataclysmic change in humanity’s cultures, including the United States. (See YouTube searching on my name, or my personal website, where you can hear or read me expoun … ⌘ Read more
‘So stupid!’ Prof. shares government threat to halt scientific studies mentioning ‘women’
David Edwards, Staff Writer - Raw Story
_Stephan: Research to improve your healthcare, particularly if you are female, is under assault as part of the “Republican” coup being led by “emperor” Trump, his co-president Elon Musk, and the spineless “Republicans” in Congress. They are going to stop any funding of research that deals with promoting wellbei … ⌘ Read more
@prologic@twtxt.net we need to remove: https://git.mills.io/yarnsocial/go-lextwt/src/branch/main/ast.go#L776-L784
apparently i can’t make the edit via gitea.. i am guessing its hitting one of your firewall rules.
@prologic@twtxt.net we need to remove: https://git.mills.io/yarnsocial/go-lextwt/src/branch/main/ast.go#L776-L784
apparently i can’t make the edit via gitea.. i am guessing its hitting one of your firewall rules.
From finding to fixing: GitHub Advanced Security integrates Endor Labs SCA
The partnership between GitHub and Endor Labs enables application security engineers and developers to drastically reduce time spent on open source vulnerabilities, and gives them the tools to go from finding to fixing.
The post [From finding to fixing: GitHub Advanced Security integrates Endor Labs SCA](https://github.blog/security/from-finding-to-fixing-github-advanced-security-integrates … ⌘ Read more
Notes to the American People — and Government Workers — on How to Stop Trump
Brendan Ballou, Former Federal Prosecutor and Contributing Writer - Politico
_Stephan: The only thing that is going to stop the authoritarian MAGAt coup which is underway is we ourselves. Please call or write your representative and both Senators and tell them your feelings about the coup, and ask them outright: What are you doing to stop the dismantlement of our democracy … ⌘ Read more
School district warns parents of border patrol agents boarding buses for citizenship check
David Edwards, Senior Editor - Raw Story
_Stephan: Militarily armed U.S. Immigration and Customs Enforcement (ICE) agents are going into apartments in the Denver area to drag possible illegal immigrants out of their homes. Texas is warning parents, as this report describes, that agents may board school buses to check children for their citize … ⌘ Read more
Go 併發 Bug 殺手鐧:如何正確處理 Goroutines 中的錯誤?
📌 引言—–你是否遇到過這樣的情況:明明 Goroutine 已經執行,但程序結果卻異常? 錯誤似乎消失了,日誌中卻找不到任何線索? Goroutine 發生 panic,主程序卻沒有任何反應? 這些問題的根本原因通常是 Goroutines 中的錯誤處理缺失。如果沒有正確捕獲和處理錯誤,Go 的併發機制可能會讓 Bug 變得難以察覺,甚至導致程序崩潰。本文將深入剖析 G ⌘ Read more
golang 每日一庫之 spf13-viper
spf13/viper 是一個非常流行的 Go 語言庫,主要用於處理應用程序的配置文件。它提供了一種靈活且強大的方式來讀取、解析和管理不同來源的配置數據,比如文件、環境變量、命令行參數等。Viper 以其簡潔、易用以及高度的可定製性在 Go 生態中廣受歡迎。1. Viper 的核心功能Viper 主要用於配置管理,它支持從不同來源加載配置、處理複雜的數據結構、以及提供對配置項的靈活訪問。以下是 V ⌘ Read more
在 Go 中如何將 [][]byte 轉爲 io-Reader ?
起因:在春節前的某一天,我在 ekit 項目的交流羣裏看到大明老師發了這樣一條消息: 各位大佬,問個小問題,有咩有誰用過 byte 轉爲 io.Reader 的東西?我以前搞過一次,但是我忘了是我手搓了一個實現,還是用的開源的,還是 SDK 自帶的並且大明老師還爲此開了一個 issue。看到這條消息,我想起了我在對 Go 還不太熟悉時,曾寫過一個 io.MultiReader 的實現(當時寫完了 ⌘ Read more
解密 Go 語言中的雙生函數:main– 與 init– 的隱祕世界
在 Go 語言的開發實踐中,main()和init()這兩個看似簡單的函數,承載着程序生命週期的核心邏輯。它們如同程序世界的守門人,一個負責搭建舞臺,另一個負責拉開帷幕。本文將通過深度剖析二者的差異,揭示它們在 Go 運行時系統中的運作機制,並提供多個完整代碼示例幫助開發者掌握正確使用姿勢。 函數本質與定位差異———main():程序的唯一入口main()函數是每個可執行 Go 程序的 ⌘ Read more
Go 項目裏的 API 對接,這樣做 Mock 測試才舒服
我們在開發項目的過程中總會遇到要調用依賴方接口的情況,如果依賴方的 API 接口還沒有開發好,通常我們會先約定好 API 接口的請求參數、響應結構和各類錯誤對應的響應碼,再按照約定好請求和響應進行開發。除了上面說的情況外,還有一種就是當你開發的功能需要與微信支付類的 API 進行對接時,因爲各種訂單、簽名、證書等的限制你在開發階段也不能直接去調用支付的 API 來驗證自己開發的程序是否能成功完成對 ⌘ Read more
Golang Option 模式看這一篇就夠了
在 Go 語言中,我們經常需要定義結構體,並通過構造函數初始化它們。然而,Go 不支持默認參數,如果一個結構體有很多可選參數,我們會面臨以下問題:構造函數參數過長,調用時不夠直觀。 需要維護多個 NewXXX 函數,擴展性較差。 代碼可讀性降低。 爲了解決這個問題,Golang 社區廣泛採用 Option 模式,讓我們可以優雅地管理可選參數。本文將詳細講解 Option 模式的 ⌘ Read more
@<url>. Submitting this writes @<domain url> instead of @<nick url> in the feed.
While I now have a somewhat working fix for it in yarnd (https://git.mills.io/yarnsocial/yarn/pulls/1232), I also have the feeling that I should fix literal formatting in lextwt as well. This also uncovered more bugs I believe: https://git.mills.io/yarnsocial/go-lextwt/pulls/28
But then there is also the question why the textarea is populated with @<url> in the first place rather than @<nick url> or yarnd’s own @nick@domain/@nick syntax. It indeed has to do something with whether I follow the mentioned feed or not.
Anyway, something to investigate for future Lyse or maybe @prologic@twtxt.net and/or @xuu@txt.sour.is. G’night!
@<url>. Submitting this writes @<domain url> instead of @<nick url> in the feed.
Righto, must be some caching thing that’s going on, too. Now, with JS enabled and a feed that I follow, hitting “Reply” actually automatically enters @nick@domain in the textarea. Submitting it correctly writes “@in the feed. Let's dig…
@movq@www.uninformativ.de So true! Either I’m hanging around with my direct teammates socializing in person in a meeting room or some other workmates are making so much noise in the open-plan office that I cannot concentrate at all. In any case, completely unproductive. :-D Luckily, I very rarely have to go to the office.
Every time I go to the office, I get nothing done. Unbelievable.
基於 Go 語言構建高性能併發鍵值存儲
在分佈式系統和高併發場景中,鍵值存儲(Key-Value Store)作爲基礎組件扮演着至關重要的角色。本文將通過 Go 語言實現一個線程安全的併發鍵值存儲系統,深入探討其設計原理、性能優化策略以及實際應用場景。 爲什麼選擇 Go 語言?————Go 語言憑藉其原生的併發模型(goroutine 和 channel)、高效的內存管理以及簡潔的語法,成爲構建高性能併發系統的理想選擇。 ⌘ Read more
Go channel 計數信號量
Go 併發設計的一個慣用法就是將帶緩衝 channel 用作計數信號量(counting semaphore)。帶緩衝 channel 中的當前數據個數代表的是當前同時處於活動狀態(處理業務)的 goroutine 的數量,而帶緩衝 channel 的容量(capacity)就代表了允許同時處於活動狀態的 goroutine 的最大數量。向帶緩衝 channel 的一個發送操作表示獲取一個信號量, ⌘ Read more
在 Go 中實現 TOTP 認證:實踐指南
時間性一次性密碼(TOTP)已成爲現代應用中實現雙因素認證(2FA)的標準。在本指南中,我們將探討如何在 Go 中使用流行的 github.com/pquerna/otp 庫實現 TOTP。 什麼是 TOTP?———TOTP 生成臨時密碼,這些密碼在短時間內(通常是 30 秒)有效。這項技術是 Google Authenticator、Authy 等認證器應用背後的核心技術。TOTP ⌘ Read more
Go 語言流式編程,實現高效數據處理!
在 Go 語言開發中,傳統的數據處理方式往往採用for循環配合切片操作的模式。但隨着業務複雜度提升,這種模式逐漸暴露出內存佔用高、代碼可讀性差、擴展性弱等問題。流式編程(Stream Processing)作爲一種聲明式編程範式,通過構建數據處理管道(Pipeline),爲這些問題提供了優雅的解決方案。流式編程的核心在於將數據處理過程分解爲多個獨立的操作階段,每個階段專注於單一職責。這種模式具有以 ⌘ Read more
Confusion over federal funding freeze prompts public health concerns
Alejandra O’Connell-Domenech , Staff Writer - The Hill
Stephan: The coup we are undergoing is putting millions of Americans at risk by screwing up their healthcare. There is confusion and chaos raging throughout the system, and I think we are going to very shortly see worsening health reports across the country.
![](https://www.schwartzreport.net/wp-content/uploads/2025/02/image-2.j … ⌘ Read more
10 Strange Yet True Historical Events
History is full of weird and wild things that most people go their entire lives without reading about. Stories about cat-related military operations or entire wars fought over pigs and emu. Here are 10 strange yet true historical events that are stranger than fiction. Related: 10 Bizarre Events in the Age of Reason That Defied […]
The post 10 Strange Yet True Historical Events appea … ⌘ Read more
@lyse@lyse.isobeef.org Thanks for sharing. I really enjoyed it. The beginning part about the history of life on Earth was fun to watch having just read Dawkin’s old book The Selfish Geene, and now I want to read more about archaea. The end of the talk about what might be going on on Mars made me a bit hopeful someone will find some good evidence.