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

标签:#tutorial

找到 693 篇相关文章

AI 资讯

Notificar a varios canales sin que un fallo tumbe al resto

Quieres mandar la misma notificación a varios sitios: Slack, Discord, un webhook, un email. La primera versión es un for de tres líneas: for canal in canales : canal ( mensaje ) Y funciona en las demos. Hasta que un día Discord devuelve un 500, canal(mensaje) lanza, y el email y el Slack que iban detrás nunca salen . Peor: te enteras por el usuario que no recibió la alerta, no por un log. Dos cosas fallan en ese for : No aísla. La primera excepción corta el reparto entero. No reporta. O cada canal se traga su error en un try/except disperso, o el fallo se pierde. La forma correcta Aísla cada canal y recoge el resultado. Lo empaqueté como fanout-broadcast —Python puro, sin dependencias— porque lo reescribía en cada proyecto: from fanout_broadcast import Broadcaster bc = Broadcaster () bc . add ( " discord " , a_discord ) bc . add ( " telegram " , a_telegram ) bc . add ( " email " , a_email , enabled = False ) # apagado por ahora report = bc . broadcast ( " ¡Nueva versión publicada! " ) if not report . ok : for o in report . failed : log . error ( " %s falló: %s " , o . name , o . error ) broadcast llama a todos los canales habilitados, captura la excepción de cada uno por separado , y sigue con el siguiente. Un Discord caído ya no impide que salga el email. Al final tienes un reporte: report . ok # ¿ningún canal falló? report . delivered # los que entregaron report . failed # los que lanzaron (cada uno con su .error) report . skipped # los que estaban deshabilitados Encender y apagar sin ramificar el código Cada canal tiene un interruptor, en runtime o por variable de entorno: from fanout_broadcast import env_enabled bc . add ( " discord " , a_discord , enabled = env_enabled ( " discord " )) # mira DISCORD_ENABLED Esto importa más de lo que parece: separa qué canales existen de cuáles están activos hoy , sin comentar código ni meter if por todos lados. Apagas un canal problemático con una variable de entorno, no con un despliegue. Escalar, pero después de intentarlo

2026-08-16 原文 →
AI 资讯

Email to Slack: threading, Block Kit limits, and the duplicate-post trap

Start from the mismatch, because every bug in this integration comes out of it. Email hands you a MIME tree, an SMTP envelope, and a Message-ID chain that defines the conversation. Slack hands you a channel, a message of at most 50 blocks, and a ts that defines the conversation. The whole job is mapping one onto the other without dropping information — the reply chain, the authentication verdicts, the attachments — on the floor. Here's the whole inbound half, as a Cloudflare Worker. It runs as pasted with one KV namespace bound as SEEN and one dependency ( npm install mailkite ): // worker.js — inbound email → Slack. wrangler secret put SLACK_BOT_TOKEN / MAILKITE_WEBHOOK_SECRET import { MailKite } from " mailkite " ; const clamp = ( s , n ) => ( s . length > n ? s . slice ( 0 , n - 1 ) + " … " : s ); function blocksFor ( email ) { const subject = email . subject || " (no subject) " ; const trusted = email . auth . dmarc === " pass " ; const sender = trusted && email . from . name ? ` ${ email . from . name } < ${ email . from . address } >` : email . from . address ; return [ { type : " header " , text : { type : " plain_text " , text : clamp ( `📧 ${ subject } ` , 150 ) } }, { type : " section " , fields : [ { type : " mrkdwn " , text : `*From:*\n ${ clamp ( sender , 2000 )}${ trusted ? "" : " ⚠️ " } ` }, { type : " mrkdwn " , text : `*To:*\n ${ email . to [ 0 ]. address } ` }, ] }, { type : " section " , text : { type : " mrkdwn " , text : clamp ( email . text || " _no text part_ " , 3000 ) } }, { type : " context " , elements : [ { type : " mrkdwn " , text : `spf \` ${ email . auth . spf ?? " unknown " } \` · dkim \` ${ email . auth . dkim ?? " unknown " } \` · dmarc \` ${ email . auth . dmarc ?? " unknown " } \` ` }, ] }, ]; } export default { async fetch ( req , env ) { const raw = await req . text (); const sig = req . headers . get ( " x-mailkite-signature " ); // HMAC recompute, constant-time compare, ±5-minute replay window: one call if ( ! MailKite . verify

2026-08-16 原文 →
AI 资讯

I Built a RAG Pipeline in TypeScript Without LangChain — The Whole Thing in 200 Lines

Every RAG tutorial I found looked like this: const chain = RetrievalQAChain . fromLLM ( model , vectorStore . asRetriever ()); const res = await chain . call ({ query : " what is this document about? " }); Twelve lines, a Pinecone key, a screenshot of it answering one question about one PDF, and a confident closing paragraph about "production readiness." I read four of them and still couldn't have told you what an embedding actually was, why cosine similarity was the metric everyone used, or what would happen if my documents were 800 pages instead of 8. I could copy the code. I couldn't debug it. So I deleted the frameworks and wrote the whole thing by hand. No LangChain, no LlamaIndex, no hosted vector database, and no cloud LLM — the model runs on my laptop. Six files, a bit over 200 lines of TypeScript, and nothing imported that I can't explain. This post is the whole pipeline, the data structures behind each stage and why they were chosen, the four bugs that cost me the most time, and a debugging method that will save you an afternoon. Who this is for I'm assuming you write JavaScript or TypeScript, you're comfortable with async / await , arrays, and classes, and you've installed an npm package before. That's it. I am not assuming you know anything about machine learning, vectors, embeddings, or information retrieval. Every one of those is explained from zero as it comes up, and if a line of code does something non-obvious, I explain the line. If you already know what a vector store is, skip to the bug list at the bottom. What RAG actually is Strip the acronym away and RAG is one idea: Language models can't read your files. So find the relevant paragraphs yourself, paste them into the prompt, and ask the question. The rest of the pipeline exists to make that sentence practical. Finding the right paragraphs is the hard part. You can't keyword-search your way there, because a user asking "how do I stop duplicate rows" won't use the word "DISTINCT" that appears in

2026-08-15 原文 →
AI 资讯

CSS Gradients in One Screen: linear, radial, conic, and the rules nobody spells out

If you've only ever shipped linear-gradient(to right, blue, red) , you're using about one-third of what CSS gradients can do. There are only three functions, and the mental model for each is small. Here's the whole thing in one read. The one fact that makes everything click A gradient is not an image file. Per MDN , a <gradient> is a special kind of <image> that the browser generates at render time . So it: scales to any size without blurring (it's drawn, not sampled) weighs zero bytes (no file, no HTTP request) edits with one hex value instead of a re-export That's why gradients exist. Everything below is just how to steer them. Three functions, three shapes Function Shape Reach for it when linear-gradient() straight line along an axis backgrounds, buttons, overlays radial-gradient() outward from a center point spotlights, glows, vignettes conic-gradient() rotational sweep around a center pie charts, color wheels, spinners Linear - the workhorse background : linear-gradient ( to right , #ff7e5f , #feb47b ); /* orange→peach */ background : linear-gradient ( 135 deg , #6366 f1 0 %, #ec4899 100 %); /* indigo→pink */ Direction is an angle ( 45deg ) or a keyword ( to right , to top right ). Stops are a color plus an optional position. Radial - when the fade should read as light background : radial-gradient ( circle , #fff , #000 ); Shape ( circle vs ellipse ), center position, and sizing keywords ( closest-side , farthest-corner ) do the work. Because the fade tracks distance from a point, radial reads as depth - perfect for glows, vignettes, and spotlight effects. Conic - the one most people skip background : conic-gradient ( #f00 0 25 %, #0 f0 25 % 50 %, #00 f 50 % 75 %, #ff0 75 %); Conic sweeps by angle , not distance. That single difference makes it the right tool for pie charts and color wheels - effects that were hacky before conic-gradient() shipped. The rule that surprises everyone Two color stops at the same position don't fade - they make a hard edge: backgrou

2026-08-15 原文 →
AI 资讯

Private AI Inference with Homomorphic Encryption: A Practical Guide to Computing on Encrypted Data

In 2009, Craig Gentry proved that it is possible to compute on encrypted data without ever decrypting it, and the result was widely treated as a theoretical curiosity. Sixteen years later, homomorphic encryption has crossed from conference papers into production pipelines: banks screen transactions against encrypted watchlists, hospitals run diagnostic models on data that never leaves their custody, and in August 2026 Google announced private AI features built on the same primitives. The gap between "possible in theory" and "usable in practice" is still wide, but it is no longer an argument against trying. This guide walks through what homomorphic encryption actually computes, how the CKKS scheme turns encrypted vectors into a workable substrate for machine learning, and the cost model that decides whether a private inference pipeline is worth building at all. The Promise: Compute Without Reading Ordinary encryption has a hard property: a ciphertext reveals nothing about the plaintext. AES-CTR, ChaCha20, RSA — all of them scramble data so thoroughly that an attacker holding the ciphertext and a supercomputer cannot recover the message without the key. That property is also the problem. If a server stores customer data encrypted at rest, every query requires shipping the data (or the key) somewhere a human or a process can read it. The moment the data is decrypted for computation, the confidentiality boundary moves from the storage layer to the memory of whatever process is doing the work. Homomorphic encryption changes the terms. A homomorphic scheme is one where operations on ciphertexts correspond to operations on plaintexts: Enc(a) ⊕ Enc(b) = Enc(a + b) . A server can add, multiply, and combine encrypted values and return the encrypted result, and the client — the only party holding the key — decrypts the final answer. The server learns nothing about the inputs, the intermediate values, or the output. For inference, this is the entire ballgame: the model owner ne

2026-08-15 原文 →
AI 资讯

10 Days to Build a Voice AI Tutor: The Good, The Bad, and The "Why Is It Silent?!"

I Built a Voice-First AI Tutor for Bharat in 10 Days 🇮🇳 — Here’s My Complete Journey Over the past 10 days, I participated in the 10 Days of Voice Agents challenge hosted by Murf AI. I built Vidya Vani, an intelligent, low-latency, multi-agent voice tutor that helps users practice spoken English and Mathematics. It features dynamic LLM question generation, memory retention across sessions, live analytics, and seamless agent handoffs—all powered by the blazing-fast Murf Falcon TTS and LiveKit WebRTC. This is the full story of why I built it, the architecture that powers it, the intense roadblocks I hit, and how you can build one too! The Problem: The Education Gap in Bharat India is a country of incredible diversity, but when it comes to foundational education—specifically English literacy and Mathematics—there is a massive accessibility gap. Quality education is often concentrated in urban hubs, leaving learners in rural and semi-urban areas without access to dedicated, patient tutors for 1-on-1 practice. While there are plenty of ed-tech apps and text-based AI chatbots available, they all suffer from the same fundamental flaw for foundational learners: friction. Practicing spoken English with a text-based chatbot is intimidating. It requires spelling proficiency, typing speed, and it does absolutely nothing to help with conversational confidence or pronunciation. The Solution: We needed a voice-first approach. By leveraging voice, we entirely remove the friction of typing and screen-staring. Users simply speak to their phone or computer, making the interaction as natural, accessible, and human as talking to a real teacher. Meet Vidya Vani & Aryabhata I set out to build a 24/7 educational voice tutor for the Learning & Literacy track of the challenge. But as the days progressed, I realized a single AI prompt trying to act as a master of all subjects was prone to hallucinations and confusion. So, I split the persona into two distinct experts. Vidya Vani: The Orchestr

2026-08-15 原文 →
AI 资讯

The head of your CSV is lying: how 9,291 invoice numbers almost vanished

Real transaction data is never clean — and the worst part is that it looks clean. This is a short story from a real dataset (UCI Online Retail: 541,909 e-commerce transactions) about the quietest way to destroy data: silent type coercion. All numbers below come verbatim from an executed notebook. The head looks perfect Peek at the first rows of the file and InvoiceNo parses as clean integers — 100% parse rate, full confidence. Any type-inference step, mine included, would call it int64 and move on. Measure the whole file instead of the head, and the number drops to ~98%. The other 2%: invoice numbers starting with "C" — which in this dataset marks a cancellation . Coerce the column to numeric and every one of them becomes NaN : Invoice numbers destroyed by numeric coercion: 9,291 DextraLoaderWarning: load: ambiguous decision(s): column 'InvoiceNo': ambiguous - float64 at parse_rate=0.98 An entire class of business events — silently gone. No exception, no crash. That's what makes coercion the quietest bug in data work: the pipeline succeeds . Why those 9,291 rows matter They are not noise. They are the returns side of the business : cancelled orders worth 8.4% of everything sold. Lose them and every revenue number downstream is quietly wrong. One example of what they catch: the dataset's apparent #1 bestseller, "PAPER CRAFT, LITTLE BIRDIE" (168,470 GBP), is a phantom — a single 80,995-unit order entered at 09:15 and fully cancelled at 09:27 the same morning. Only the preserved cancellation rows expose it. The genuine bestseller is a cake stand. The fix: identifiers are labels, not quantities No library can know that "InvoiceNo" is an ID — that's domain knowledge. What a tool can do is disclose its guess and hand you a replayable plan you can correct: naive , plan = dx . load ( CSV_PATH , return_params = True ) # warns: ambiguous at 0.98 plan [ " columns " ][ " InvoiceNo " ][ " dtype " ] = " object " # invoices are labels plan [ " columns " ][ " StockCode " ][ " dtype

2026-08-15 原文 →
AI 资讯

Build a Token Ledger Before You Burn Through a Free Model Tier

Disclosure: This article was prepared as part of MonkeyCode's product outreach. Why this is worth reading: a free model endpoint with a large token allowance is a good place to validate a new CLI workflow, but it can burn through the allowance in a single retry loop before you notice. I built a small stateful budget guard that checks the projected cost before the call, records actual usage after the call, and refuses to touch the ledger when the endpoint sends an unexpected response. It works as a disposable first pass on a free endpoint and leaves you a clean exit when the shape changes. MonkeyCode's outreach describes an open-source project with a free model route and a free hosted server. I do not treat either as a permanent dependency. I treat them as a test target: an endpoint I can call without a contract while I am still changing prompts, timeouts, and schemas. The tool below is independent of MonkeyCode's exact model list; it assumes only an OpenAI-style chat completion path and usage accounting in the response. Swap one function if the free server does not follow that shape. The problem with a free allowance Most model dashboards report aggregate usage after the fact. That is enough for casual work, but it is not enough when you wire an endpoint into a loop. I have seen two avoidable failures in my own drafts. A retry-on-timeout wrapper restarted a slow request four times before the first response arrived, multiplying total token spend. A long context buffer kept sending the same 6k-token history on every turn because I forgot to trim old messages. The dashboard showed the total drop, but not which call caused it. A local ledger fixes that by refusing to send the request when the projected total exceeds the budget. It does not replace the provider dashboard. It makes the decision before the endpoint gets a chance to consume tokens. The artifact The script below does three jobs: load a budget and already-used amount from a JSON file make a conservative prefl

2026-08-15 原文 →
AI 资讯

Run Qwen 3.8 27B Locally: Real GGUF Sizes, the KV Cache Trick, and the Template Trap

Qwen 3.8 arrived as two different releases with two different licences, and only one of them is something you can put on a card you own. The 2.4 trillion parameter A95B opened up on 12 August under Alibaba's own qwen3.8-max terms. The one that matters for local work is Qwen 3.8 27B , whose safetensors went up on 13 August at 08:23 UTC with an Apache 2.0 LICENSE file following the next morning. Both dates are off the Hugging Face commit log, not a launch post. Here is the practical picture: what it needs, why its long context is unusually cheap, and the one setting that makes people think they downloaded a broken quant. The shape of the model decides everything 27B dense parameters across 64 layers, hidden size 5120. The interesting part is in config.json , where layer_types reads 48 linear attention layers and 16 full attention layers , alternating three to one ( full_attention_interval: 4 ). Only those 16 layers keep a KV cache. The rest of the shape: 24 attention heads with head_dim 256 and 4 KV heads , a 248,320 token vocabulary, and max_position_embeddings of 262,144 . It is a native vision language model, so images and video go in without a wrapper, and the ggml-org pack also ships a multi token prediction head as a separate file. The numbers Sizes below are the file sizes Hugging Face reports for unsloth/Qwen3.8-27B-GGUF , read on 14 August 2026. Packs differ by a few hundred megabytes, so check the repo you actually pull from. lmstudio-community has Q4_K_M at 16.8 GB and ggml-org at 19.0 GB for the same nominal quant. Quant Size on disk Realistic home UD-IQ2_XXS 9.0 GB 12 GB cards, visible quality cost UD-Q2_K_XL 10.7 GB 12 GB cards, almost no context left UD-Q3_K_XL 13.4 GB 16 GB cards Q3_K_M 13.8 GB 16 GB cards IQ4_XS 15.7 GB largest quant that stays whole on 16 GB Q4_K_M (sweet spot) 17.1 GB 24 GB cards Q5_K_M 19.8 GB 24 GB, less context headroom Q6_K 22.9 GB 24 GB barely, or 32 GB Q8_0 29.0 GB 32 GB or a two card split BF16 (from ggml-org ) 53.8 GB server

2026-08-15 原文 →
AI 资讯

Python Data Model - Part 2: Protocols and Special Methods

🌐 Leia a versão em português deste artigo aqui . 1. From Part One to Language Protocols In Part 1 , we established the foundation of Python's data model: objects possess identity, type, and value; names hold references to those objects; mutability determines what changes can occur without replacing the object; and containers store references to other objects. Now we advance another layer. The type of an object does not merely determine what values it can represent. It also determines which operations that object supports : whether it has a size, whether it can be traversed, compared, indexed, called as a function, used in a with statement, and so forth (PYTHON SOFTWARE FOUNDATION, 2026a). This is where special methods come in. An important observation before we continue: in Part 1 we used memory address as a mental model for identity. More rigorously, Python guarantees that an object's identity remains stable during its existence. In CPython specifically, id(obj) corresponds to the memory address of the object; this is a detail of the reference implementation, not a language guarantee (PYTHON SOFTWARE FOUNDATION, 2026a). The same distinction will be important when we discuss garbage collection and finalization: Python specifies the language's behavior; CPython is one implementation of that behavior . Reference Version The behaviors and references in this article were reviewed based on the official documentation of Python 3.14.7 . CPython-specific details will be explicitly identified. 2. What Are Special Methods In the official documentation, names like __len__ , __iter__ , and __add__ are called special methods . In the community, you will also commonly find the terms magic methods or dunder methods ( dunder comes from double underscore because of the __name__ pattern). They allow classes defined by us to participate in operations that are part of the language's own syntax and built-in functions. For example: You write Behavior Python must resolve Related methods r

2026-08-15 原文 →
AI 资讯

Modelo de Dados Python - Parte 2: Protocolos e métodos especiais

🌐 Read this article in English here . 1. Da primeira parte aos protocolos da linguagem Na Parte 1 , construímos a base do modelo de dados do Python: objetos possuem identidade, tipo e valor; nomes guardam referências para esses objetos; mutabilidade determina quais mudanças podem acontecer sem substituir o objeto; e containers armazenam referências para outros objetos. Agora vamos avançar uma camada. O tipo de um objeto não determina apenas quais valores ele pode representar. Ele também determina quais operações aquele objeto suporta : se possui tamanho, se pode ser percorrido, comparado, indexado, chamado como função, usado em um with e assim por diante (PYTHON SOFTWARE FOUNDATION, 2026a). É aqui que entram os métodos especiais . Uma observação importante antes de continuar: na Parte 1 usamos o endereço de memória como modelo mental para identidade. De forma mais rigorosa, Python garante que a identidade de um objeto é estável durante sua existência. No CPython , especificamente, id(obj) corresponde ao endereço de memória do objeto; isso é um detalhe da implementação de referência, não uma garantia da linguagem (PYTHON SOFTWARE FOUNDATION, 2026a). A mesma distinção será importante quando falarmos sobre garbage collection e finalização: Python especifica o comportamento da linguagem; CPython é uma implementação desse comportamento . Versão de referência Os comportamentos e referências deste artigo foram revisados com base na documentação oficial do Python 3.14.7 . Detalhes exclusivos do CPython serão identificados explicitamente. 2. O que são métodos especiais Na documentação oficial, nomes como __len__ , __iter__ e __add__ são chamados de special methods , ou métodos especiais, na comunidade também é comum encontrar os termos métodos mágicos ou dunder methods ( dunder vem de double underscore por causa do padrão __nome__ ). Eles permitem que classes definidas por nós participem de operações que fazem parte da própria sintaxe e das funções embutidas da linguagem. Po

2026-08-15 原文 →
AI 资讯

How I Accessed NVIDIA's AI API from Bangladesh Without Phone Verification

How I Bypassed NVIDIA's Phone Verification to Access 70+ Free AI Models from Bangladesh No VPN. No fake number. Just a browser console and an API call. If you are a developer in Bangladesh, you have probably hit the same wall I did. You go to build.nvidia.com , excited to try out the latest models on the NVIDIA NGC API. You click Generate API Key . And then — a phone verification gate appears. You look for your country code. Bangladesh is not on the list. NVIDIA says: "If your location isn't listed, please check again soon." I checked. It has been that way for a while. I am a student and independent builder from Dhaka, Bangladesh . I experiment with AI products and developer tools under the Alaminnna brand. I needed access to these models for a side project, not for enterprise production. Waiting for official support was not an option, so I looked for a legitimate workaround. Here is what I found. Table of Contents The Two Verification Gates Step 1: Create an Organization Account Step 2: Generate the API Key via Console Why This Works What You Actually Get Quick Test Final Thoughts The Two Verification Gates NVIDIA has two separate phone verification checkpoints: Account creation on the NVIDIA Build portal. API key generation inside the NGC dashboard. Both ask for a phone number. Both block Bangladesh. But here is the critical insight: the UI and the API are not the same system. The web interface enforces phone checks. The API itself does not. That gap is what makes this workaround possible. Step 1: Create an Organization Account (No Phone Needed) Personal NVIDIA accounts trigger phone verification immediately. Organization accounts, however, do not — at least not during the initial signup flow. Here is what I did: Go to build.nvidia.com/minimaxai/minimax-m3 . Click Generate API Key . Enter your email and create a password. Complete the hCaptcha verification. Check your email for a 6-digit verification code and enter it. On the "Almost Done" page, click Submit . You

2026-08-14 原文 →
开发者

Hoisting

Hoisting in JavaScript is the engine’s behavior of moving declarations to the top of their scope (global or local) before execution. Because of hoisting, you can reference functions or variables in your code before the lines where they are defined. 1.Function Declaration Function declarations are hoisted in their entirety—both the declaration and the body. This means you can call a function before it appears in the source code. hello (); //Output: hello! function hello (){ console . log ( " hello! " ) } 2.var Declaration When you use var, JavaScript hoists the variable declaration, but not its assignment. Until the execution line reaches the assignment, the variable holds undefined. console . log ( num ); //Output: undefined var num = 10 ; console . log ( num ); //Output: 10

2026-08-14 原文 →
开发者

Your Tableau Dashboard Needs Two or Three Views, Not Eight

By the end of this page you can look at a folder of eight finished sheets and say which two or three belong on the dashboard, which one goes in the upper-left corner, and which of Tableau's three sizing options to pick. You'll also have a one-sentence test that decides every one of those calls. It's about fifteen minutes. Here's the move to make today. Open your busiest dashboard and write the single question it answers, in one sentence, for one named person. Then remove every view that isn't part of answering it. Most people delete half, and the half that survives lands harder than the whole thing did. The short version: Tableau's own guidance is two or three views on a dashboard. Crowding is what happens when one dashboard is asked to serve several audiences at once. Where the surviving views sit is the second decision, and it has a known answer, so that gets the picture. The original carries a diagram here. In words: A single dashboard rectangle divided into three panes. One large pane occupies the whole upper-left area and spans most of the width. Two smaller panes sit below it, side by side. A curved arrow enters at the top-left corner of the large pane, travels right across it, then drops down and moves left to right across the two smaller panes, showing the order a reader takes them in. A small numeral one sits on the large pane, two and three on the smaller panes. The drawing shows that the first thing a reader meets is whatever occupies the upper left, so the most important view belongs there and the supporting views belong underneath. 1. Why two or three, and where that number comes from Before the explanation: you have eight finished sheets and one dashboard. How many of them would you put on it? Two or three. That's not a taste call, it's Tableau's published guidance: "In general, it's a good idea to limit the number of views you include in your dashboard to two or three." The reason is about attention rather than about screen space. A dashboard is read,

2026-08-14 原文 →
AI 资讯

AI Coding Agents Can Pass Tests and Still Make the Wrong Decision

A question I've been thinking about after discussing AI coding agents with several developers: Is passing the test suite enough to prove that an AI agent made the correct engineering decision? I don't think it is. And this isn't just a theoretical concern. Modern coding agents are increasingly working at the repository level rather than generating isolated code snippets. OpenAI's Codex documentation, for example, describes using repository-specific AGENTS.md instructions to tell the agent how to navigate a codebase, run tests, and follow project practices. Anthropic similarly describes Claude Code searching codebases, tracing dependencies, editing multiple files, and working with CI failures. ( OpenAI ) That changes what "correctness" means. Consider a simple scenario A project starts with: Architecture v1 API ↓ Service ↓ Database An AI agent learns this structure and implements a new feature correctly. The tests pass. Then the architecture changes: Architecture v2 API ↓ Event Bus ↓ Services ↓ Database The same task is requested again. If the agent continues following the old architecture, its code might still: compile, pass existing tests, satisfy the visible functional requirement, but still be wrong for the current system . This is the distinction I'm interested in: Code correctness ≠ Contextual correctness The Benchmark Problem Traditional coding benchmarks generally provide: Repository + Issue ↓ Agent ↓ Patch ↓ Tests / Evaluation This is valuable. SWE-bench, for example, was designed around real GitHub issues and repositories, and OpenAI created SWE-bench Verified with human validation because benchmark quality itself affects what we conclude about model capability. ( OpenAI ) But there is another dimension worth testing: What happens when the context changes? Recent research is already moving in this direction. SWE-ContextBench evaluates whether coding agents can reuse relevant experience across related tasks, while SWE-Explore focuses specifically on reposito

2026-08-13 原文 →
AI 资讯

Perry Mason in: The Case of the Drifting Timer

Perry Mason in: The Case of the Drifting Timer Opening Statement You need a reactive "current time" in your Vue 3 app. A schedule grid with a red line showing "now." A live clock. A dashboard that updates every minute. Every Vue developer reaches for setInterval first. It works. But "works" and "works well" are different things. This is the story of taking a naive timer from "it ticks" to production-grade — and the four iterations it took to get there. The prosecution calls four exhibits. Let's begin. Exhibit A: The Memory Leak const currentTime = ref ( new Date ()) onMounted (() => { setInterval (() => { currentTime . value = new Date () }, 60000 ) }) It works. Sort of. The defense rests — but the prosecution is just getting started. Exhibits of negligence: The interval is never cleared. When the component unmounts, the timer keeps firing every 60 seconds forever — updating a ref nothing reads anymore, and holding its closure (and everything the ref references) in memory for the lifetime of the page. Silent. Invisible. The kind of leak that shows up in production after a user navigates around your app for 20 minutes. Exhibit B: The Cleanup That Failed const currentTime = ref ( new Date ()) let timeInterval = null onMounted (() => { currentTime . value = new Date () timeInterval = setInterval (() => { currentTime . value = new Date () }, 60000 ) }) onUnmounted (() => { if ( timeInterval ) clearInterval ( timeInterval ) }) Now we clean up. The interval is stored in a variable, cleared on unmount. A step forward — but the prosecution has three more objections: Further evidence: This only works inside components. If someone calls this logic from a Pinia store or outside a component's setup() context, onUnmounted never fires. The timer leaks silently. (Composables called synchronously during setup() are fine — Vue's docs recommend exactly that. The problem is when there's no component instance at all.) The timer fires 60 seconds after load , not at the top of the minute

2026-08-13 原文 →
AI 资讯

Cross-Post a DEV.to Tutorial to Medium with a Formatting Check

Cross-posting a technical tutorial is easy to start and surprisingly easy to get wrong. A URL import can leave code blocks split, headings as plain text, or metadata incomplete. The result may look acceptable at a glance while damaging the parts readers need most. This tutorial shows a reviewable DEV.to to Medium workflow using publish-agents , an open-source TypeScript project by Fernando Paladini. Its medium-publisher package imports a public article through Medium's import flow, checks the editor against the source Markdown, and can repair a small set of common formatting problems. TL;DR Checkout the stable v0.2.3 release, build the @paladini/medium-publisher-mcp package, log in once, and create a Medium draft with publish-devto . Keep the default draft behavior while you inspect the title, code blocks, headings, lists, and metadata. Prerequisites You need: Node.js 20 or newer. A published DEV.to article with a public URL. A Medium account that can create stories. A terminal that can run npm and the browser installation step. The package uses Patchright browser automation and a saved browser session. It does not use a Medium write API key. The project documents Medium UI changes as a compatibility risk, so treat the browser session and the resulting draft as reviewable state rather than an unattended guarantee. Install the released source The repository's v0.2.3 release is the stable reference for this walkthrough. Installing from that tag keeps the commands separate from later changes on the default branch. git clone https://github.com/paladini/publish-agents.git cd publish-agents git checkout v0.2.3 npm install npm run build -w @ paladini/medium-publisher-mcp npm link -w @ paladini/medium-publisher-mcp The build produces the CLI and MCP server from the package source. The package declares Node.js 20 or newer and uses patchright as its browser automation dependency. Its post-install step may install the bundled Chromium browser. If that step was skipped in your

2026-08-13 原文 →
AI 资讯

Install Comfy MCP: Control Local ComfyUI from Claude Code or Cursor

Comfy MCP is Comfy's first-party local Model Context Protocol server. It lets an MCP-capable coding agent inspect the models and nodes in your ComfyUI installation, validate workflows, run them, and retrieve the outputs. The detail that prevents the most confusion is that two processes are involved : comfy launch starts ComfyUI. Your AI client starts comfy-mcp as a local stdio server. If you run comfy-mcp directly and it appears to do nothing, it is probably waiting for an MCP client. That is normal for a stdio server. Disclosure and verification scope: AI tools assisted with drafting and editing this adaptation. I reviewed the finished article and checked the commands and material claims against Comfy's official documentation, repository, and PyPI pages on 13 August 2026. I have not run a generation on my own hardware for this article, so this is a documentation-verified setup guide, not a hands-on performance test. Comfy's documentation currently labels the MCP offering a public beta, so tools and behaviour may change. What you need Before starting, have: Python 3.10 or newer. The examples below use Python 3.11. comfy-cli 1.14.0 or newer. A ComfyUI workspace, either created with comfy install or selected with comfy set-default . An MCP client that can start a local stdio server, such as Claude Code, Cursor, or Claude Desktop. The models and custom nodes required by the workflow you want to run. The MCP bridge is not what determines the hardware requirement; the selected ComfyUI workflow does. A small image workflow and a large video workflow can have very different memory needs. 1. Install comfy-cli and comfy-mcp I prefer a dedicated virtual environment. It keeps the executables in a predictable place and avoids mixing these packages with unrelated Python projects. Windows PowerShell mkdir comfy-mcp-guide cd comfy-mcp-guide py -3 . 11 -m venv . venv . \.venv\Scripts\Activate.ps1 python -m pip install --upgrade pip python -m pip install "comfy-cli>=1.14.0" comfy-mc

2026-08-13 原文 →
AI 资讯

Your rate limiter is broken behind a tunnel — the X-Forwarded-For problem

You put your app behind a tunnel (or any reverse proxy) to test webhooks. Everything works. Then you notice something odd in your logs: every single request comes from the same IP address. Congratulations, you've met the X-Forwarded-For problem. What actually happens When a request flows through a tunnel, the TCP connection to your app comes from the relay, not the real client. So request.remote_addr — the value your framework uses for rate limiting, IP logging, geo-blocking, brute-force detection — is the relay's address. For every request. From every user. The consequences are quiet and nasty: Your rate limiter now rate-limits the relay, not the client. One aggressive user trips the limit and everyone gets blocked. Or worse, the limit is per-IP and effectively unlimited, because each relay node looks like one "user." * Your access logs are fiction. Security review of an incident? Every entry says the same address. * IP allowlists silently break. "Only allow my office IP" now allows nothing, or everything, depending on how it's wired. The fix (and its trap) The proxy already tells you the real client IP — in the X-Forwarded-For header. Every framework has a setting to trust it. Flask: ProxyFix . Express: app.set('trust proxy', ...) . Rails, Django, Laravel: equivalents exist. Here's the trap: trust that header blindly and anyone can spoof it. A client can send X-Forwarded-For: 1.2.3.4 directly, and if your app believes headers from anyone, your rate limiter is bypassed with a curl flag. The correct setup has two halves: 1. Trust `X-Forwarded-For` only when the immediate connection comes from a proxy you control (your tunnel relay, your load balancer). 2. Strip or ignore the header on direct connections. Most frameworks express this as "trusted proxies" — a list of proxy IPs whose forwarded headers you believe. Set it. It's five minutes of config that determines whether your security features are real or decorative. Why this matters more in the tunnel era Tunnels us

2026-08-13 原文 →
AI 资讯

Warning Lines Are an Interface: Reading Bullet-Hell Hazards as Data

In a dense survival game, danger is not communicated only by the projectile itself. The warning that appears before impact is part of the interface. Its direction, duration, width, and overlap with other warnings determine whether a player can make a meaningful decision. No Humanity provides a useful compact example. The reviewed classic build places a tiny ship inside a vertically framed arena and measures survival time while lasers, projectiles, sweeping shapes, doodled faces, and radial bursts occupy the screen. The ship does not visibly attack in the reviewed footage; survival depends on reading hazards early and preserving room to move. Treat every warning as an event A guide or analysis tool can represent a warning with a small event record: type HazardEvent = { source : ' laser ' | ' radial ' | ' sweep ' | ' projectile ' telegraphRegion : Rect impactRegion : Rect leadTimeMs : number escapeSides : Array < ' left ' | ' right ' | ' up ' | ' down ' > } This is more useful than describing a screenshot as “chaotic.” It separates what the player can know before impact from what becomes visible afterward. A fair hazard may be difficult, but it gives the player a readable interval and at least one plausible escape route. Open space has option value Beginners often move toward the largest empty area. That is not always safe. A large pocket can be a trap if a sweep closes its only exit. Smaller central space can be more valuable because it preserves several escape directions. The strategy is therefore not “find empty pixels.” It is “preserve optional movement.” A rough evaluator might score a position by reachable space after the next known impact, not by current distance from a projectile. position score = future reachable area + escape directions - overlapping impact risk This framing explains why early movement matters. Waiting until the projectile is fully drawn converts a route-planning problem into a reaction-time test. Overlap changes the meaning of each signal T

2026-08-13 原文 →