今日已更新 420 条资讯 | 累计 20392 条内容
关于我们

标签:#Go

找到 560 篇相关文章

开发者

YouTube字幕突然消失?原来是节点的锅——一次极其小众的排障经历

问题降临:毫无征兆 那天和往常一样,打开YouTube准备看一个英文视频。习惯性地点开字幕按钮—— 没反应。 不是字幕延迟,不是字幕错位,而是整个字幕功能像是从这个世界上蒸发了一样。原始语言的字幕不可用,点进字幕设置一看,连翻译选项都是灰的。没有原始字幕,自然也就没有任何语言的翻译字幕。 一整个功能链,从根部断裂。 第一反应:一定是扩展插件搞的鬼 作为一个浏览器里装了不少扩展和油猴脚本的用户,我的第一直觉非常明确—— 肯定是哪个插件冲突了。 这个判断合情合理。浏览器扩展劫持页面元素、油猴脚本注入自定义代码,这些操作干扰YouTube的正常功能,实在是太常见了。之前遇到过播放器界面异常、按钮消失之类的问题,十次有八次都是扩展惹的祸。 于是我开始了标准排障流程: 禁用所有油猴脚本 → 刷新 → 字幕依然不可用 禁用所有浏览器扩展 → 刷新 → 字幕依然不可用 开无痕模式 (彻底排除扩展和缓存影响)→ 字幕依然不可用 三轮操作下来,扩展插件的嫌疑被彻底洗清。 但这还不是最让人困惑的部分。 真正的诡异之处:薛定谔的字幕 在反复测试的过程中,我发现了一个极其反直觉的现象: 字幕的可用性是随机的。 开着所有扩展 → 有时候字幕 有 ,有时候 没有 关掉所有扩展 → 有时候字幕 有 ,有时候 没有 这完全打破了因果逻辑。如果问题出在扩展上,那么"关掉扩展"就应该稳定地解决问题。但现实是,开和关都呈现随机状态,说明扩展根本不是变量—— 真正的变量藏在别的地方。 这种"薛定谔的字幕"状态让我一度非常迷茫。你没办法用常规的控制变量法去定位一个表现为随机的问题,除非你能找到那个真正在变化的隐藏变量。 灵光一闪:换个节点试试? 在排除了浏览器层面的所有可能之后,我突然想到了一个平时根本不会和"字幕"联系在一起的东西—— 网络节点。 抱着试一试的心态,我切换了代理节点,选了一个不同地区的服务器。 刷新页面。 字幕回来了。 原始字幕、自动翻译、多语言选项——一切恢复正常,仿佛之前的问题从未发生过。 我又切回原来的节点——字幕消失了。再切到新节点——字幕回来了。反复测试了好几次,结果完全一致。 真相大白:问题出在节点上。 恍然大悟:视频和字幕,原来是两套系统 这次经历让我意识到一个之前从未注意到的事实: YouTube的视频流和字幕数据,很可能是由不同的服务器(或CDN节点)分别提供的。 这意味着: 视频能正常播放 ≠ 字幕能正常加载 你的网络可以顺畅地连接到视频服务器,但与此同时,字幕服务器可能对你当前的IP/地区/节点不可达或响应异常 不同的代理节点连接到的Google后端服务器不同,某些节点恰好无法正常获取字幕数据 这也完美解释了之前"随机可用"的现象。我在测试扩展的过程中,代理工具可能在后台自动切换了节点(很多代理工具有负载均衡或自动切换功能),导致有时碰巧连上了能提供字幕的服务器,有时则没有。我一直以为变量是"扩展的开关",实际上真正在暗中变化的是"网络节点"。 技术推测 虽然Google没有公开YouTube的完整架构细节,但根据这次经历可以合理推测: YouTube使用分布式CDN架构 ,视频内容、字幕数据、评论、推荐信息等可能分布在不同的微服务和服务器集群上 字幕API的端点 可能与视频流的端点不同,它们的可用性、地理限制、负载状况都是独立的 某些地区的某些IP段可能因为各种原因(服务器维护、区域限制、DNS解析差异、临时故障)无法正常访问字幕服务 这种问题具有 高度的偶发性和地域性 ,这也是为什么它如此小众,在网上几乎搜不到相关讨论 写在最后 这大概是我遇到过的最小众、最反直觉的技术问题之一。 它小众到什么程度呢?你去搜索"YouTube字幕不可用",得到的答案几乎都是:清除缓存、禁用扩展、检查字幕是否被上传者关闭、换个浏览器试试。 没有人会告诉你"换个代理节点"。 因为在绝大多数人的认知里,"视频都能看"就等于"网络没问题",不会有人把字幕缺失和网络节点联系在一起。 但事实就是这么奇怪: 视频能播放,不代表字幕能加载,因为它们根本就不在同一条路上。 这次经历也给了我一个教训:当排障陷入死胡同的时候,不要只盯着最明显的嫌疑犯。真正的问题,有时候藏在你认为"完全不可能"的地方。 下次再遇到YouTube的某个功能莫名其妙消失,而视频本身却能正常播放的时候——先换个节点试试。说不定,答案就在那里。

2026-06-16 原文 →
AI 资讯

I built a game with zero asset files - everything is generated in code

Building a Game with Zero Assets in Godot This is the first game I've ever made. I'm not a developer by trade, I'd never touched Godot before, and I leaned on AI to help me get over the learning curve. But I gave myself one hard rule that ended up shaping the entire project: Zero external assets. No textures. No sprite sheets. No audio files. No music files. The whole repository contains none of them. Everything you see and hear in Reactor Panic - a small arcade game where you sort plasma cores before the reactor melts down - is generated at runtime in code. Here's how I did it, including the parts that went badly wrong. Why do this to myself? Two reasons. First, I can't draw or compose, so "make it all procedural" was weirdly easier than sourcing, creating, and licensing art assets. Second, and this is the part I didn't expect, when everything is code, everything can react to the game state for free. More on that later. Drawing the Reactor All of the 2D art is rendered using Godot's _draw() function. The most involved piece is the containment dome. It isn't a sprite at all - it's shaded per cell like a tiny software renderer. For each cell, I compute a hemisphere surface normal, perform Lambertian diffuse lighting with a specular hotspot, add Fresnel-style rim darkening, and then quantise the result into a handful of discrete steel bands so it reads as pixel art rather than a smooth gradient. # Hemisphere surface normal var sx : = ( mid_x - center_x ) * inv_half_w var sz : = sqrt ( maxf ( 0.0 , 1.0 - sx * sx - sy_sq )) var norm : = Vector3 ( - sx , sy , sz ) . normalized () # Lambertian diffuse var ndotl : = maxf ( 0.0 , norm . dot ( light3 )) var light_val : = 0.1 + ndotl * 0.9 # Fresnel rim darkening (surface curving away from viewer goes dark) light_val *= lerpf ( 0.4 , 1.0 , clampf ( sz * 1.8 , 0.0 , 1.0 )) # Quantise into discrete shade bands -> reads as pixel art var band : = clampi ( int ( round ( light_val * max_band_f )), 0 , num_bands - 1 ) var col : Colo

2026-06-16 原文 →
AI 资讯

Why do South Koreans love AI so much?

This story originally appeared in The Algorithm, our weekly newsletter on AI. To get stories like this in your inbox first, sign up here. When I landed in Seoul after a grueling 12-hour flight from San Francisco, I walked through an unmanned immigration checkpoint, where a machine scanned my face and passport. On the subway home,…

2026-06-16 原文 →
开发者

Challenges I Faced and How GoFr Helped

Why I Chose GoFr for My Backend Project When starting a new backend project, one of the first decisions I need to make is choosing the right framework. Over the years, I’ve experimented with different backend technologies, each offering its own strengths and trade-offs. For my latest project, however, I decided to try something different: GoFr. At first, I was simply exploring the Go ecosystem and looking for tools that could help me build production-ready services faster. What caught my attention wasn’t just that GoFr was built in Go—it was the philosophy behind it. Instead of forcing developers to spend days configuring infrastructure, wiring dependencies, and setting up observability, GoFr focuses on helping developers get from idea to deployment quickly. In this article, I’ll share the reasons why I chose GoFr for my backend project and what stood out during my experience. The Problem with Starting Backend Projects Every backend project begins with excitement. You have an idea, a feature roadmap, and a vision of what you’re trying to build. Yet before writing meaningful business logic, developers often spend hours or even days configuring: Logging Database connections Metrics Tracing Health checks API routing Environment management Deployment configurations While these tasks are necessary, they rarely contribute directly to solving the actual problem your application is meant to address. As a developer who frequently builds side projects and prototypes, I wanted a framework that reduced this setup overhead while still following good engineering practices. That’s where GoFr entered the picture. What Initially Attracted Me to GoFr The first thing I noticed was how quickly I could get a service running. Instead of navigating through multiple configuration files and third-party packages, GoFr provides many essential backend capabilities out of the box. This means less time deciding which libraries to install and more time focusing on application logic. The framework

2026-06-15 原文 →
AI 资讯

The FCC Wants to Eliminate Burner Phones

A proposed FCC rule would kill burner phones: phones whose accounts are not attached to a particular person. The FCC plans to do this by legally forcing the country’s telecoms to store a wealth of personal information about essentially all phone customers, including a government issued identification number and their physical address, alarming privacy advocates and civil rights activists who compare the measures to those from authoritarian countries where it can be difficult to buy a mobile phone plan without giving up your identity. The proposed change would drastically shake up how people obtain phone plans in the U.S., and have all sorts of privacy and cybersecurity knock-on effects. The FCC is proposing the data collection partly as a way to combat scammers, with telecoms being required to collect other information on business and foreign customers like the intended use case of their bulk phone plan purchase and their IP address. But the changes would mean telecoms collect data on all new and renewing customers, and the FCC provides a long list of other things that the collected data could help authorities with...

2026-06-15 原文 →
AI 资讯

Article: Governing AI in the Cloud: A Practical Guide for Architects

In this article, the author outlines a practical approach to AI governance in the cloud, covering discovery of shadow AI, data classification at creation, IAM-based enforcement, policy-as-code, and operational controls. The article shows how organizations can embed governance into delivery pipelines, balancing security, compliance, and developer productivity without relying on manual processes. By Dave Ward

2026-06-15 原文 →
AI 资讯

[System Design] Ride-Hailing Dispatch Algorithm: How Uber DISCO & Grab DispatchGym Match Drivers

Every time you tap "Book Ride," a system makes dozens of decisions in under two seconds: Which driver? What route? What's the real ETA? This article breaks down exactly how the dispatch algorithm works — from the greedy approach that fails at scale, to the bipartite graphs, batched matching, and surge pricing mechanics that power Uber, Lyft, Grab, and Gojek today. Why a Greedy Dispatch Algorithm Fails (Closest Driver Problem) The first instinct when designing a matching system is to pair every customer with their nearest driver. However, this Greedy approach causes massive losses at a system-wide scale: Example: 3 riders (R1, R2, R3) and 3 drivers (D1, D2, D3) Greedy Matching (closest driver): R1 ← D1 (ETA 2 mins) ✓ R2 ← D3 (ETA 8 mins) ← D2 was "taken" by R1, even though D2 is closer to R2 R3 ← D2 (ETA 10 mins) ← Terrible outcome Total ETA: 2 + 8 + 10 = 20 minutes Optimal Matching (global optimal): R1 ← D2 (ETA 3 mins) R2 ← D1 (ETA 3 mins) R3 ← D3 (ETA 4 mins) Total ETA: 3 + 3 + 4 = 10 minutes ← 50% better! Uber refers to this problem as Global Optimization — finding an assignment strategy that minimizes the total ETA of the entire system , rather than optimizing just for individual pairs. Bipartite Graph Matching: The Mathematical Foundation (Lyft) Before diving into the systems, it helps to understand the mathematical model that all ride-hailing matching engines share at their core. Lyft formalizes dispatch as a bipartite graph matching problem : Bipartite Graph: Set A (Riders): { R1, R2, R3, R4 } Set B (Drivers): { D1, D2, D3, D4, D5 } Edges: every possible Rider ↔ Driver pair Edge Weight: cost of that match (e.g., ETA, driver rating, distance) Goal: Find a set of edges (a "matching") where: - No rider is matched to more than one driver - No driver is matched to more than one rider - The total cost of all selected edges is minimized This is known as the Minimum Weight Bipartite Matching problem. The classical algorithm for solving it is the Hungarian Algorithm (

2026-06-15 原文 →
AI 资讯

I Built the Tool I Wish I Had When Learning DSA

After failing 3 coding interviews, I realized the problem wasn't practice it was how I was practicing. I spent 6 months grinding LeetCode before my first FAANG interview. 400+ problems solved. Every "Blind 75" problem is memorized. I felt ready. Then the interviewer asked a sliding window variation I hadn't seen before. I froze. Drew a blank. Bombed the interview. The problem wasn't that I hadn't practiced enough. The problem was that I had practiced incorrectly. I memorized solutions instead of understanding patterns. I can recite code, but I struggle to adapt when problems change slightly. So I built something different. Introducing AlgoPatterns A pattern-first DSA learning platform with visualizations that actually show you how algorithms work. algopatterns.in What Makes It Different 1. Pattern-First, Not Problem-First Most platforms throw 2000+ problems at you and say, "Good Luck." AlgoPatterns organizes everything around 17 core patterns: Two Pointers Sliding Window Binary Search BFS/DFS Dynamic Programming Backtracking And 11 more... Master the patterns, and you can solve any variation. 2. Visualizations That Actually Help We have 50+ interactive visualizers that show algorithms step-by-step: Watch two pointers converge in real-time See the DP table fill cell by cell Trace BFS spreading level by level Visualize the call stack during recursion Reading code is one thing. Seeing it executed is completely different. 3. Curated, Not Overwhelming 315 hand-picked problems organized by pattern. Each problem includes: Company tags (Google, Amazon, Meta, etc.) Frequency indicators Pattern classification Difficulty rating No more random grinding. Practice the right problems in the right order. 4. Real Code Templates Every pattern comes with: Java templates (copy-paste ready) "When to use" indicators Common mistakes to avoid Key insights from each pattern Who It's For Interview preppers who want to learn patterns, not memorize solutions CS students who find textbook expla

2026-06-15 原文 →
AI 资讯

Upcoming Speaking Engagements

This is a current list of where and when I am scheduled to speak: I’m giving a keynote at Cybernation 2026 in Berlin, Germany, on June 24, 2026. I’m speaking at the Potsdam Conference on National Cybersecurity at the Hasso Plattner Institut in Potsdam, Germany. The event runs June 24–25, 2026, and my talk will be the evening of June 24. I’m participating in a panel discussion at the Austrian Institute for International Affairs in Vienna on Thursday, June 25, 2026. I’m speaking at the Digital Humanism Conference in Vienna, Austria, on Friday, June 26, 2026...

2026-06-15 原文 →
AI 资讯

I Built a Web App That Finds the Fairest Meeting Spot for Any Group (and It's Free)

The Problem Nobody Talks About Picture this: You're trying to find a place to meet up with friends. Someone suggests a coffee shop. It's 8 minutes from their house. It's 45 minutes from yours. You say yes anyway, because suggesting a different place feels awkward. This happens all the time — with friends, with remote teams, with family scattered across a city. And the worst part? Most "meet in the middle" suggestions aren't actually in the middle. They're just the geographic midpoint, which completely ignores traffic, transit options, and the fact that roads don't go in straight lines. I got frustrated enough to build something about it. Meet Meetle Meetle is a free web app that finds the fairest meeting spot for any group of people — based on real travel times , not just distance. A Chrome Extension is coming soon so you'll have it one click away in your toolbar. You add everyone's starting location, choose how each person is traveling (driving, walking, or transit), hit Find Meeting Point , and Meetle does the math across every person simultaneously. It then surfaces the best nearby cafés, restaurants, parks, gyms, or whatever venue type you're looking for — ranked by actual fairness. No more "it's fine, I don't mind the drive." Now you have data. How It Actually Works Under the hood, Meetle uses three Google Maps APIs working together: Distance Matrix API calculates travel time from every person's location to every candidate venue, simultaneously. This is the core of the fairness scoring — you can't rank venues fairly without knowing everyone's actual travel time to each one. Places API finds candidate venues near the calculated center point. You can filter by type (coffee, food, parks, gyms, etc.), price level, minimum rating, and whether they're open right now. Maps JavaScript API renders everything visually — the map, the travel zones (isochrones), and the markers for each suggested venue. The scoring works two ways and you can toggle between them: Fairness mo

2026-06-14 原文 →
AI 资讯

Struct Embedding in Go: Composition That Bites When You Reach for Inheritance

Book: The Complete Guide to Go Programming Also by me: Thinking in Go (2-book series) — Complete Guide to Go Programming + Hexagonal Architecture in Go My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools Me: xgabriel.com | GitHub You come to Go from a language with classes. You see struct embedding for the first time, and it reads like inheritance. A field with no name, methods that "carry over" to the outer type, a base struct that your type extends. So you write code the way you always have, and most of it works. Then a method does something you did not ask for, a type satisfies an interface you never meant to implement, or two embedded types fight over a name and the compiler shrugs until the exact line that calls it. Embedding is not inheritance. It is composition with a syntax that promotes methods and fields up one level. Once you hold that distinction, the surprises stop being surprises. Here is where they come from. Embedding promotes, it does not subclass Write an embedded field by giving a type with no field name: type Engine struct { Horsepower int } func ( e Engine ) Start () string { return "vroom" } type Car struct { Engine // embedded Brand string } Car now has a Start method and a Horsepower field, both promoted from Engine . You can write car.Start() and car.Horsepower as if they were declared on Car . car := Car { Engine : Engine { Horsepower : 300 }, Brand : "Fiat" } fmt . Println ( car . Start ()) // vroom fmt . Println ( car . Horsepower ) // 300 This is where the inheritance illusion starts. car.Start() is sugar. The compiler rewrites it to car.Engine.Start() . The receiver of Start is still an Engine , never a Car . There is no base class, no super , no virtual dispatch. Engine does not know Car exists. That last point is the one that bites. A promoted method runs against the embedded value, not the outer struct. The method that ignores the outer struct Say you want a stringer on the embe

2026-06-14 原文 →