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

标签:#m

找到 8756 篇相关文章

AI 资讯

Day 23/30: Expose Tools with MCP

I still remember the frustration when our team's support bot, powered by LangGraph and MCP, couldn't retain context between user interactions. It was as if the bot had a case of conversational amnesia, forcing users to repeat themselves over and over. We later discovered that the issue stemmed from our lack of a centralized tooling server, making it impossible for the bot to access and leverage external tools in a scalable manner. This experience taught us the importance of building a robust MCP server to expose tools to our AI applications. In this post, we'll walk through the process of setting up an MCP server, focusing on exposing a single tool to any MCP-compatible AI app. Let's consider a simple tool that performs sentiment analysis on text input. We want this tool to be accessible from our support bot, allowing it to gauge user sentiment and respond accordingly. The first step in building an MCP server is to define the tool and its interface. MCP provides a set of APIs and protocols for tool definition, including the Tool class and the MCPTool interface. We'll use these to create our sentiment analysis tool. Here's a simplified example of how we might define this tool in Python: from MCP import Tool , MCPTool class SentimentAnalysisTool ( Tool , MCPTool ): def __init__ ( self ): super (). __init__ () self . name = " SentimentAnalysis " self . description = " Analyzes the sentiment of the input text " def execute ( self , input_text ): # Simplified sentiment analysis logic for demonstration if " love " in input_text or " great " in input_text : return " Positive " elif " hate " in input_text or " bad " in input_text : return " Negative " else : return " Neutral " # Create an instance of our tool sentiment_tool = SentimentAnalysisTool () Next, we need to set up an MCP server to host our tool. MCP servers can be configured to expose tools over various interfaces, including REST and gRPC. For simplicity, let's use a basic REST server. We'll use Flask, a lightweig

2026-08-02 原文 →
开发者

"iota ใน Go — อักษรกรีกตัวจิ๋วที่กลายเป็นเครื่องมือทรงพลัง"

📅 เขียนเมื่อ: กรกฎาคม 2026 ⚠️ ตรวจสอบข้อมูลจาก Go Specification, APL documentation, และบันทึกของผู้พัฒนา ถ้าคุณเขียน Go มาระยะหนึ่ง คุณคงเคยเห็น iota — เจ้า identifier ประหลาดที่ไม่มีใครรู้ว่ามันคืออะไรตอนเจอครั้งแรก const ( Monday = iota + 1 // 1 Tuesday // 2 Wednesday // 3 ) มันไม่ใช่ keyword, ไม่ใช่ type, ไม่ใช่ function — มันคืออะไรกันแน่? และที่สำคัญ — ทำไมต้องชื่อ iota ? คำตอบพาเราย้อนกลับไปถึงปี 1962 — ถึงนักคณิตศาสตร์ชาวแคนาดาคนหนึ่ง และภาษาโปรแกรมมิ่งที่เปลี่ยนโลก iota คืออะไรใน Go ใน Go spec — iota คือ predeclared identifier ที่ใช้ เฉพาะใน const declaration เท่านั้น มันทำสิ่งเดียว: นับเลขให้อัตโนมัติ const ( _ = iota // 0 (skip) KB = 1 << ( 10 * iota ) // 1 << 10 = 1024 MB // 1 << 20 = 1,048,576 GB // 1 << 30 ) ค่า iota เริ่มที่ 0 และเพิ่มทีละ 1 ทุกครั้งที่เจอบรรทัดใหม่ใน const block — แม้ว่าบรรทัดนั้นจะไม่ได้ใช้ iota ก็ตาม สิ่งที่ทำให้ iota ทรงพลังคือมันเป็น expression (ไม่ใช่แค่ตัวเลข) — คุณเอาไปคูณ บวก ลบ shift ได้หมด const ( Read = 1 << iota // 1 << 0 = 1 Write // 1 << 1 = 2 Execute // 1 << 2 = 4 ) นี่คือวิธีมาตรฐานในการสร้าง enum, bitmask, และ constant series ใน Go — ทั้งหมดด้วย keyword เดียว iota — อักษรกรีกตัวเล็กที่สุด ก่อนจะเป็นชื่อใน Go — ιώτα (iota) คืออักษรตัวที่ 9 ของกรีกโบราณ: ι มันคืออักษรที่ เล็กที่สุด ในภาษากรีก — แค่เส้นตรงหนึ่งเส้น ไม่มีหาง ไม่มีขีด ในพระคัมภีร์ไบเบิล มีวลี famous: "not one iota" — แปลว่า "ไม่แม้แต่นิดเดียว" — เพราะ iota คือสิ่งที่เล็กที่สุด และมันคือชื่อที่สมบูรณ์แบบสำหรับสิ่งที่ "เพิ่มทีละหนึ่ง" จุดเริ่มต้น — APL และ Kenneth Iverson นักคณิตศาสตร์ผู้สร้างภาษา ปี 1962 — Kenneth E. Iverson ตีพิมพ์หนังสือ "A Programming Language" (ที่มาของชื่อ APL) Iverson เป็นนักคณิตศาสตร์ชาวแคนาดา (ต่อมาได้ Turing Award ปี 1979) — เขาไม่ได้แค่ออกแบบภาษาใหม่ แต่ปฏิวัติวิธีคิดเรื่อง programming แทนที่จะเขียน for i = 1 to 10 — Iverson คิดว่า programming ควรเหมือนคณิตศาสตร์: สั้น, สัญลักษณ์, และทรงพลัง เกิดเป็น ⍳ (iota) ใน APL, Iverson สร้าง operator ⍳ — เรียกว่า iota — ที่ทำสิ่งเดียว: สร้างลำดับเลข ⍳ 5 → 1 2 3 4 5 ⍳ 10 → 1 2 3 4 5 6 7 8 9 1

2026-08-02 原文 →
AI 资讯

LLM中如果一个问题容易验证 那么AI就容易学会解决!说说这个特性与P与NP问题的关联性

大模型来了,有个说法是如果一个问题容易验证 那么ai就容易学会解决!说说这个特性与p np问题的关联性 这个说法听起来很直观,但其实 混淆了"验证的复杂性"和"学习/求解的复杂性"这两件不同的事 。我们把它拆开看。 先把"容易验证"在 P/NP 里的精确定位理清 在计算复杂度理论中: NP = 给定候选解(证书),能在多项式时间内验证其正确性的问题 P = 能在多项式时间内直接求解的问题 P ≠ NP ? = 是否所有容易验证的问题,也都容易求解? 所以"容易验证"在 CS 里的严格含义是: 验证者在多项式时间内工作 , 不是说 AI 训练成本低 。 "容易验证 ⇒ AI 容易学会"——部分成立,但有重要的限定 这个直觉 在某些场景下确实成立 ,原因是"验证"提供了 稠密的训练信号 : ✅ 成立的情形:验证器可作奖励/过滤 当一个问题具备"易于验证"的结构时,我们可以用它来: 生成训练数据 :比如 SAT 问题,随机生成一个赋值,代入公式验证,正确就得到一对 (公式, 赋值) 训练样本—— 数据无限且免费 RL 中的奖励塑形 :LLM 生成代码 → 编译器/单元测试验证 → immediate reward Self-play / 自我蒸馏 :AlphaGo 等用模拟器验证落子结果 Verifier-Guided Search :用"易于验证"的判据引导 beam search / MCTS,如 AlphaCode、AlphaGeometry 💡 这就是为什么像 代码生成、形式化证明、数学解题 这些领域近期进展飞快——它们都有"相对容易的验证器"(单元测试、类型检查器、证明校验器)。 ❌ 但这个推论远非普遍成立 "容易验证"≠"AI 容易学会",有几个关键原因: 1. 验证器只给二值信号,梯度稀疏 验证器通常只输出 0/1(对/错),而深度学习需要平滑的损失曲面。对于复杂的 NP 问题,绝大多数随机猜测都是错的 → 奖励恒为 0 → 梯度消失,学不到东西 。这就是"稀疏奖励"难题。 2. P ≠ NP 意味着:验证简单 ≠ 求解简单 即使验证是 O(n),找到那个能通过验证的解可能仍需 O(2ⁿ)。AI 模型本质上是在做启发式搜索,面对组合爆炸, 没有 free lunch 。例如: 数独:验证 O(n²),但最难的数独对人类和 AI 都极具挑战 TSP:验证一条回路 O(n),但找最优回路是 NP-Hard 3. 分布偏移与泛化 NP 问题的"容易验证"是** worst-case 复杂度**意义下的。AI 学到的是训练分布的统计规律,遇到分布外的实例会失效。比如 LLM 在数学竞赛题上表现好,但换个数字或换种表述就可能崩。 4. 验证本身也可能不在 NP 里 很多现实问题是 PSPACE 或更难 (如围棋先手胜负),验证一个"策略"需要指数时间——这种问题连"提供证书让 AI 模仿"都很困难。 一张对照表 问题类型 验证复杂度 AI 易学吗? 例子 P 类 多项式 通常容易 (有高效算法可直接教) 排序、最短路径 NP-Complete,且有稠密验证信号 多项式 中等 (RL + 验证器有效) SAT、数独、TSP 近似 NP-Complete,但验证信号稀疏 多项式 困难 (奖励太稀) 某些密码学难题 超出 NP(PSPACE 等) 超多项式 极难 (验证本身就很贵) 围棋先手胜、QSAT 不可判定 不存在 不可能 (理论上限) 程序等价性 真正的关联在哪里 "容易验证 ⇒ AI 容易学会"更准确的说法应该是: 📌 如果一个问题有"多项式时间的验证器",并且我们能从中提取稠密的训练信号(如 partial credit、逐步验证),那么 AI 可以通过"生成 + 验证"的循环去逼近求解。 这本质上就是 用 NP 的"验证侧"去攻击"求解侧" ——也是当前 LLM + Verifier 范式(如 RLHF 中的 reward model、AlphaProof 的 formal verifier)的理论基础。 但要注意: 这不是 P=NP 的证明,AI 找到的解在 worst-case 仍可能不是最优的 AI 解决的是 平均情况(average-case) 或 特定分布 ,而非 worst-case 一旦问题规模增大到超出训练分布,性能会急剧下降 一个更深的视角:平均-case 复杂度 理论计算机科学里有个分支叫 Average-Case Complexity ,研究"典型实例"的难度。很多 NP-Complete 问题在 average-case 下其实有不错启发式算法——这也解释了为什么 AI 在某些 NP 问题上表现惊喜,但在 adversarial 构造的 hard instance 上翻车。 所以回到你的说法: "

2026-08-02 原文 →
AI 资讯

I built CleanSlate, an open-source coding agent for the IDE, CLI, and SDK

CleanSlate is an open-source platform for running coding agents across your local machine and the cloud. Today, it works through an IDE, CLI, and SDK. Agents can understand a codebase, make changes, run commands, browse the web, and verify their work. We are now building longer-running autonomous cloud agents that can continue working without keeping your machine active. CleanSlate supports multiple model providers and is not tied to a single ecosystem. GitHub: https://github.com/TheWariend/CleanSlate Website: https://thewariend.com/cleanslate The project is still early, and I would appreciate honest feedback from developers who use coding agents.

2026-08-02 原文 →
AI 资讯

Architecting Mainline-Friendly Products

Mainline-friendly products are designed so their board support lives in upstream Linux, U-Boot, and standard build systems instead of a vendor fork. The decision is architectural, not aspirational: it is made when you choose the SoC, design the add-on connectors, and write the device tree — not when the product is already shipping. This article gives the strategic case, the product design rules that follow from current kernel work on hot-pluggable add-on boards, a vendor checklist for tech leads, and the concrete steps to upstream your own board support. We have covered why silicon vendors are moving to upstream-first BSPs . This article covers the product team's side of that shift: what you should do about it. Building mainline-friendly products means making a set of design decisions — SoC selection, connector design, device tree structure, and an upstreaming plan — so that mainline Linux and U-Boot treat your board as a normally supported board rather than as a permanent private port. Each section below turns one of those decisions into rules you can apply on your next board. Why mainline-friendly products are a strategic decision The cost of a vendor-fork BSP is not paid at bring-up; it is paid for the life of the product. Every kernel upgrade becomes a forward-port of private patches. Every security fix arrives on the vendor's schedule, not the kernel's — and for devices in scope of regulations such as the EU Cyber Resilience Act, patch latency is now a compliance question, not just an engineering one. Hiring is harder, because engineers must learn your fork before they can touch it, and the knowledge they build does not transfer in either direction. Board support that lives in mainline inverts each of these. New kernels are more likely to boot your board without forward-porting private support patches, because your board is part of the kernel's own build-and-test surface; LTS security fixes are easier to consume because the code paths you depend on are already

2026-08-02 原文 →
AI 资讯

Confident Is Not Correct: Three Signs That Claude Is Guessing

The answer arrives clean, well-formatted, and certain. You run it. The config flag doesn't exist. Nothing in the response told you the difference between the parts it was sure about and the parts it filled in. The syntax was right. The explanation was reasonable. The flag had a sensible name and a clear purpose. It just wasn't real. This is a calibration problem, not a trust problem. "Don't trust AI" is useless advice. It tells you to doubt everything, which is the same as doubting nothing, because you can't actually work that way. What you need instead is a way to tell which parts of an answer are grounded and which were filled in. There are patterns to look for, and once you know them, they are hard to miss. 🔍 Why this affects beginners specifically This isn't about intelligence. It's about experience. An engineer with a few years behind them has already lost time to a function that didn't exist. They have wasted an afternoon on a config parameter that turned out to belong to a different engine. They have built up a collection of "that looked right but wasn't" memories, and those memories now activate automatically. A small feeling that says check this one before they run it. Beginners haven't had those afternoons yet. The pattern recognition that comes from repeated failures doesn't exist, because the failures haven't happened. Everything arrives in the same confident tone, and without past mistakes to compare against, there is no internal signal separating a grounded answer from a made-up one. That's not a character flaw. It's missing experience, and it can be partly replaced with three concrete things to look for. ✅ The three signs These aren't perfect. They are a minimum standard, and they catch the common cases. I'll be clear about what they miss at the end. Sign 1: Very specific details with no source When the answer includes a precise detail (a specific config flag, a particular function signature, an exact version number) and doesn't say where that detail

2026-08-02 原文 →
开发者

Variations on a theme of sorting

Semisort Reorder an array so that identical keys are grouped contiguously Keys do not need to be in sorted order Stable Partition Group by predicate, preserve order K-smallest selection, single Get the k-smallest key from the array K-smallest selection, list Get the k-smallest key from the array, and everything smaller (or equal), in any order K-smallest selection, list sorted Get the k-smallest key from the array, and everything smaller (or equal), in sorted order submitted by /u/Grouchy-Trade-7250 [link] [留言]

2026-08-02 原文 →
AI 资讯

[D] Self-Promotion Thread

Please post your personal projects, startups, product placements, collaboration needs, blogs etc. Please mention the payment and pricing requirements for products and services. Please do not post link shorteners, link aggregator websites , or auto-subscribe links. -- Any abuse of trust will lead to bans. Encourage others who create new posts for questions to post here instead! Thread will stay alive until next one so keep posting after the date in the title. -- Meta: This is an experiment. If the community doesnt like this, we will cancel it. This is to encourage those in the community to promote their work by not spamming the main threads. submitted by /u/AutoModerator [link] [留言]

2026-08-02 原文 →
AI 资讯

How Is ""2" > "10"" "true" in JavaScript?

What is output of ""2">"10"" true or false At first glance, this looks completely wrong. We all know that: 2 > 10 is obviously: false Because 2 is smaller than 10. But what happens when we add quotation marks? "2" > "10" The result is: true 😱 Wait… how can 2 be greater than 10? The answer is simple: ""2"" and ""10"" are not numbers. They are strings. 🔢 Numbers vs. Strings In JavaScript, these two values are different: 2 This is a number. While: "2" This is a string. The quotation marks tell JavaScript that the value should be treated as text. So: 2 > 10 compares two numbers: 2 > 10 → false But: "2" > "10" compares two strings. And that's where things get interesting! 🔤 How Does JavaScript Compare Strings? When JavaScript compares two strings, it uses lexicographical comparison. You can think of this as comparing text in a dictionary-like order, based on the character values. Let's compare: "2" "10" JavaScript looks at the first character of each string: "2" → first character is 2 "10" → first character is 1 Since the character ""2"" comes after ""1"" in the ordering used for the comparison, JavaScript determines: "2" > "10" as: true So: console.log("2" > "10"); outputs: true 🧪 Let's Compare Both Cases Case 1: Numbers console.log(2 > 10); Output: false Because JavaScript compares the actual numerical values: 2 is less than 10 Case 2: Strings console.log("2" > "10"); Output: true Because JavaScript performs a string comparison. The important thing is: 2 → Number "2" → String The quotation marks can completely change how JavaScript interprets the value. ⚠️ What About Mixed Types? Now look at this: console.log("2" > 10); Here, one value is a string and the other is a number. JavaScript handles this differently. In this case, it converts the string ""2"" into a number for the comparison. So the comparison effectively becomes: 2 > 10 The result is: false This is why understanding data types is extremely important when programming. 💡 The Big Lesson These three comparisons

2026-08-02 原文 →
AI 资讯

Gotcha: chasing a bug that was never in my code

This is a submission for DEV's Summer Bug Smash: Smash Stories powered by Sentry . The build was done. Themis Lex worked on my machine, and not in the "works if you squint" way. A court clerk enters their role, describes their workflow, picks a data sensitivity level, and gets back a PDF with two sections: where AI can safely support the work, and where it must never touch it. Claude via Bedrock generates the assessment. Server-side PDF render. No accounts, no storage, session ends when the download does. Three weeks solo, for the Women in AI Accelerator Spring 2026 Build Challenge. Initial commit went in at 7:06pm on May 9. I pushed to AWS Amplify . Build went green. I opened the live site, filled out the form, hit submit. Nothing. Twenty eight seconds later, "Request timed out." I told myself the bug was not in my code. Everything ran locally. This had to be a platform problem. That belief carried me all night. It mostly held up. The exception was the first thing I should have checked. Here is the commit log, because it tells the story better than I can: 19:06 Initial commit: Themis Lex MVP 20:31 refactor: migrate Bedrock auth to IAM compute role 22:29 diag: log credential env vars at runtime (booleans only, remove after fix) 22:40 fix: forward BEDROCK_MODEL_ID to SSR runtime via next.config.js env 22:50 fix: switch to InvokeModelWithResponseStreamCommand to beat 28s Lambda timeout ... 06:28 fix: remove unused type export that broke isolatedModules build 06:37 fix: end-to-end response streaming to beat Amplify 28s gateway timeout 06:48 fix: reduce max_tokens to 3000 to fit Amplify 30s timeout 06:52 fix: reduce max_tokens to 2000, 3000 still exceeded 30s timeout 07:00 fix: switch to Claude Haiku 4.5 to fit Amplify 30s timeout Ten and a half hours from first deploy to the fix that shipped it. That gap between 22:50 and 06:28 is me sleeping on it, which turned out to be the second most productive thing I did. The error message was the absence of an error message My f

2026-08-02 原文 →
AI 资讯

The Open-Weight Inflection Point: Kimi K3, Claude Opus 5, and Microsoft MAI Signal a Market Shift

The Open-Weight Inflection Point: Kimi K3, Claude Opus 5, and Microsoft MAI Signal a Market Shift Subtitle: Three major releases in one day point to the same conclusion — the AI industry is shifting from "who can build the strongest model" to "who can build the most cost-effective one." July 28, 2026, might be remembered as the day the AI industry's center of gravity shifted. Three announcements — from Moonshot AI, Anthropic, and Microsoft — each independently signaled the same underlying trend: open and cost-efficient models are becoming the new competitive baseline. Here's what happened and why it matters. 1. Kimi K3 Goes Open-Weight: First 3T-Class Open Model Moonshot AI publicly released Kimi K3's full model weights on HuggingFace — a 2.8-trillion-parameter Mixture-of-Experts model with 104B activated parameters. This is the first 3T-class model ever made openly available to the public. Key technical highlights: Architecture: Kimi Delta Attention (KDA) + Attention Residuals (AttnRes), 896 experts with 16 activated per token Native Multimodality: Text, images, and video understanding via MoonViT-V2 vision encoder Context Window: 1,048,576 tokens (~1M tokens) Benchmarks: Terminal-Bench 2.1: 88.3, BrowseComp: 91.2, MCPMark-Verified: 94.5 — competitive with Claude Fable 5 and GPT-5.6 Sol Why it matters: Kimi K3 raises the "open-source model ceiling" to an unprecedented level. For the first time, a model that competes with top-tier closed-source models is available with fully public weights — giving startups, researchers, and enterprises a genuine alternative to API-dependent workflows. For developers, this is the practical part: you can now self-host a model that holds its own against frontier closed models. That changes cost models, data-privacy decisions, and vendor lock-in math overnight. 2. Claude Opus 5: Anthropic's "Daily Driver" Strategy Anthropic launched Claude Opus 5 — a mid-premium model positioned as the "daily driver" for 90% of knowledge work. The key

2026-08-02 原文 →
AI 资讯

136 raw removals, 17 real ones: what a spec diff over-reports

Originally published at mendapi.com . Between two published snapshots of the Cloudflare OpenAPI schema — 7abe88500e55 (2026-03-31) → c92b9b0fde23 (2026-07-27) — a raw structural diff produced 6,354 change records. 136 of them were endpoint path removals, the scariest kind a diff can report: the route your code calls is simply gone from the spec. Except 119 of those 136 were not gone at all. This is the accounting of how we know, per record, with machine evidence. The trap in a raw diff A path removal in a spec diff means one thing: the string key disappeared from the paths object. It does not mean the runtime URL stopped working. Specs get refactored — concrete routes collapse into templated ones, path parameters get renamed, methods get merged — and every one of those refactors shows up as a "removal" if you only look at one side of the diff. An alerting tool that pages you 136 times for this corridor is training you to ignore it. The whole job of the curation layer is to keep that from happening without silently dropping a real break. The ledger: 17 + 119 = 136 Every one of the 136 raw removals has an adjudicated destination. 17 were kept as genuinely client-breaking: the runtime URL or method really disappeared, with no surviving successor. The other 119 were excluded, each with machine evidence from the two spec snapshots that the surface actually survives: Template consolidation — 107 records. Concrete Workers AI model routes like /ai/run/@cf/baai/bge-m3 collapsed into the pre-existing generic /ai/run/{model_name} route. The runtime URL a client sends never changed; the spec just stopped enumerating each model. The evidence rule requires the templated route to exist in both snapshots and to swallow the removed path with a literal-anchored match, so a template that is merely a shape prefix of a genuinely removed endpoint does not count. Parameter rename, runtime-identical — 11 records. Path parameters renamed ( {postfix_id} to {investigate_id} and friends). Afte

2026-08-02 原文 →
AI 资讯

Why I Fell in Love with Rust’s Memory Model (Even Though It’s Hard)

I’ve worked with languages like JavaScript and Go , and I enjoyed both for different reasons. JavaScript gave me speed and flexibility. Go gave me simplicity and practical concurrency. Then I met Rust and at first, it felt difficult. But once I understood how Rust handles memory without a garbage collector , I fell in love with it. Memory Safety Without a Garbage Collector Most modern languages solve memory management with a garbage collector (GC) . A GC periodically finds memory that is no longer used and frees it automatically. Rust takes a different path: No runtime garbage collector No manual free() like in C Memory safety guaranteed at compile time (in most cases) Rust uses three core ideas: Ownership Borrowing Lifetimes These rules are checked by the compiler before your program runs. 1) Ownership: One Owner at a Time In Rust, every value has a single owner. When the owner goes out of scope, Rust automatically drops the value and frees memory. { let s = String :: from ( "hello" ); // s owns the string memory here } // s goes out of scope, memory is freed automatically This avoids memory leaks and double-frees in normal code paths, without needing a GC pause. 2) Borrowing: Use Data Without Taking Ownership Instead of copying or transferring ownership all the time, Rust lets you borrow references: Immutable borrow: &T Mutable borrow: &mut T But Rust enforces strict aliasing rules: Many immutable references OR One mutable reference Not both at the same time This rule prevents data races at compile time. 3) Lifetimes: References Must Always Be Valid Lifetimes describe how long references are valid. Often, Rust infers lifetimes automatically. When needed, you can annotate them. This helps prevent dangling references references to memory that no longer exists. How Rust “Behaves” in Practice When writing Rust, you feel the compiler acting like a strict mentor: “Who owns this value?” “How long does this reference live?” “Are you mutating while also sharing?” “Could th

2026-08-02 原文 →
AI 资讯

Fly.io vs Railway: Deployment, Pricing, and Features Compared

Two usage-based cloud platforms with different defaults — a CLI-and-primitives approach versus a repo-first, visual-canvas workflow. Here is how they line up as of 2026-07-29. Fly.io and Railway both let you deploy apps and services and pay for what you use, but they start from different defaults. Railway centers on connecting a Git repository and letting the platform read your code and configure the deploy, all viewed on a visual canvas. Fly.io centers on the flyctl command line and a documented catalog of infrastructure primitives, from machines to managed databases and GPUs. This comparison walks through how each platform handles deployment, pricing, databases, networking, and scaling, using each vendor page as of 2026-07-29. Plan details and prices change often, so treat the figures here as a snapshot and confirm the current terms on each site before you commit. At a glance In short Both are usage-based platforms for shipping apps. Pick Railway to connect a repo and let the platform configure, preview, and roll back deployments from a visual canvas. Pick Fly.io for CLI-driven control plus a documented catalog of Managed Postgres, GPUs, Kubernetes, and HIPAA-ready hosting. Pricing and features noted here are as of 2026-07-29. Head to head Key differences side by side. Feature Fly.io Railway Billing model Usage-based, pay-as-you-go for micro VMs and storage; pricing calculator (as of 2026-07-29) Usage-based, billed per second (as of 2026-07-29) Plan tiers No named consumer tiers; usage plus paid add-ons (as of 2026-07-29) Free $0, Hobby $5/mo min, Pro $20/mo min, Enterprise custom (as of 2026-07-29) Deploy & configuration flyctl CLI and fly launch; config in fly.toml (as of 2026-07-29) Connect repo, auto-config from your code, visual canvas, YAML optional (as of 2026-07-29) Global footprint 18+ regions, sub-second machine boot, 99.9% uptime SLA (as of 2026-07-29) Global deployment, run closer to users; homepage listed no region count (as of 2026-07-29) Managed dat

2026-08-02 原文 →
AI 资讯

Where to Publish a Web Game in 2026

A finished browser game is a bundle of static files. Whether you built it in Phaser, Three.js, Babylon.js, Godot, or plain canvas code, the output uploads anywhere, which is exactly why the publishing decision trips people up. Every channel accepts the same build, so the choice is never technical. It is about who owns the audience, who owns the money, and who owns the URL. Here is how the three channels actually compare once you have shipped to all of them. The Three Channels Game portals aggregate thousands of titles, monetize with ads, and share revenue. Indie platforms like itch.io act as storefronts you control, with community feedback attached. Self-hosting on your own domain gives you everything except an audience. Most developers who do this well use more than one at the same time. The marginal cost of adding a channel is usually just reading the submission guidelines and wiring up an SDK, so treating them as either/or leaves reach on the table for no reason. What Portals Actually Require CrazyGames reaches over 20 million monthly players and runs a two stage process. Basic Launch takes your game with minimal integration and tests it with a limited audience for around two weeks. Hit their engagement benchmarks and you are invited to Full Launch, which needs the full SDK for ads, auth, cloud saves, and analytics. Their technical bar for Basic Launch is an initial download under 50 MB, fewer than 1,500 files, and PEGI 12 content. Poki is curated and editorially reviewed, leans mobile-responsive, and pulls strong search traffic with a younger audience. GameDistribution syndicates across hundreds of publisher sites through an embed widget, so you get reach but little brand visibility. Newgrounds still rewards experimental work with a community that engages rather than an SDK that monetizes. The trade in all four cases is the same: the portal brings the players, and in return it owns the player relationship and can change terms whenever it wants. Self-Hosting With

2026-08-02 原文 →
AI 资讯

Optimizing Large-Scale MongoDB Aggregation Pipelines for Performance

Originally published on tamiz.pro . MongoDB aggregation pipelines are powerful tools for processing and transforming data directly within the database. However, when dealing with large datasets, poorly optimized pipelines can become a significant performance bottleneck. This deep-dive explores advanced strategies and best practices to ensure your large-scale MongoDB aggregation pipelines run efficiently and effectively, transforming raw data into actionable insights without grinding your system to a halt. Table of Contents Understanding the Aggregation Pipeline Lifecycle The Critical Role of Indexing Indexes for $match and $sort Stages Compound Indexes and Covered Queries Partial Indexes for Specific Workloads Strategic Stage Ordering Pushing $match and $project Early Leveraging $sort and $limit Together Memory Management and Disk Spills allowDiskUse and its Implications Strategies to Minimize Disk Spills Leveraging the Query Optimizer and Explain Plan db.collection.explain() Interpreting Explain Plan Output Sharding Considerations for Aggregations Shard Key Design for Aggregation Workloads Targeted vs. Broadcast Aggregations Advanced Optimization Techniques Using $lookup for Joins and its Performance Impact Optimizing $group Stages Batching and Incremental Aggregations Production Best Practices Frequently Asked Questions Understanding the Aggregation Pipeline Lifecycle Before diving into optimizations, it's crucial to understand how MongoDB processes aggregation pipelines. An aggregation pipeline is a sequence of stages that process documents from a collection. Each stage performs an operation on the input documents and outputs a stream of documents to the next stage. This stream-based processing is key to its efficiency, but it also means that the output of one stage directly impacts the performance of subsequent stages. The MongoDB query optimizer attempts to reorder certain stages for efficiency, but it's not omniscient. Your strategic design choices profoundly

2026-08-02 原文 →
AI 资讯

🐍 Fixing a `google-genai` Version Mismatch and Verifying the Behavior with pytest [1/3]

Introduction Hello from Japan! 🇯🇵 I am tosane932 , a professional truck driver working in logistics while teaching myself Python. In my previous article, I tested a Docker multi-stage build and measured the actual change in image size. At the end of that article, I said that I would write next about pytest and CI/CD. This article was supposed to be the practical follow-up. However, while preparing for that work, I encountered an unexpected side issue. I only intended to introduce Flask-Migrate. Instead, the pip installation logs revealed that the version of a library in my local development environment had been changed without me noticing. The library was: google-genai From there, I went through the following process: Identify the version mismatch Restore the version that had already been tested locally Update requirements.txt Manually verify the Gemini API functionality Run pytest to check for regressions This article records that process without hiding the inconvenient parts. https://github.com/tosane932/sales_data_app Overview While installing Flask-Migrate, I noticed a mismatch between: The version of google-genai installed in my local development environment The version declared in requirements.txt The local environment had been using: google-genai 2.10.0 However, requirements.txt still specified: google-genai==2.4.0 When I ran: pip install -r requirements.txt pip followed the configuration file and replaced the newer local version with the older declared version. This article explains how I discovered the issue, synchronized the environments, and verified the application behavior with automated tests. 1. The Problem and Its Background I was preparing to introduce Flask-Migrate. During that work, I ran: pip install -r requirements.txt The installation log contained the following lines: Attempting uninstall: google-genai Found existing installation: google-genai 2.10.0 Uninstalling google-genai-2.10.0: That message caught my attention. After checking the environ

2026-08-02 原文 →
AI 资讯

The Shape of Failure: Before You Blame the AI

Every automated system receives a particular shape of the world. That shape is expressed through records, documents, events, exceptions, and missing values. If the designers have not identified those forms—and the ways they can become malformed—the machine inherits their ignorance and reproduces it at scale. The question is not simply whether the AI failed. The useful question is whether the human-built system knew what success meant, knew the shape of its data, and knew how to recognize when it was wrong. Start with the shape of the data Before selecting a model, draw the workflow as a sequence of data transformations. What enters each stage? In what form and from what source? Which values are valid, absent, duplicated, stale, delayed, or contradictory? How will each violation be detected? What must the workflow do next? Each data shape needs a corresponding failure model. An unknown here is not merely uncertainty for the machine; it is a measurement failure in the organization. The remedy is to collect the missing data or explicitly design for its absence. Otherwise, the system is being asked to operate in a world its designers have not described. Stabilize the deliverable A system cannot be stabilized around a target that continues to move. The deliverable must be more than an aspiration written in a prompt. It should be expressed as observable conditions and anchored to a representative corpus: examples that are acceptable; examples that are unacceptable; examples that are genuinely ambiguous. Human reviewers should first demonstrate that they can apply those distinctions consistently. If they cannot agree on what success looks like, the model is not being measured against a specification. It is being measured against human disagreement disguised as one. The model is not the system Only then does it become meaningful to place an AI model inside the workflow. The model is one transformation among many: Input → validation → retrieval → normalization → model infere

2026-08-02 原文 →