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

今日精选

HOT

最新资讯

共 23463 篇
第 247/1174 页
AI 资讯 Reddit r/programming

Coordinating a web app with an external workflow runner: callbacks vs polling task runs?

Offloading fan-out work to Render Workflows (docs linked above). Retries and parallel tasks live there. My problem is the web layer. First version: return 202, tasks POST back to /internal/events with a bearer token, UI subscribes over SSE. Added a reconciler that polls the Render API every 2s anyway because I didn't trust callbacks alone. Second version: skip callbacks entirely. One POST stays open, poll getTaskRun every 1.5s in an async generator, stream SSE until the digest finishes. Postgres at the end. Less wiring, but the HTTP request lives for the whole run. Both work on small traffic. I'm not sure which one I'd keep if this wasn't a demo. Restarting the API wipes in-memory viewer state in the callback version. Workflow keeps going, which is fine, but the UI looks stuck unless you reconcile. Polling version doesn't have that split because the request IS the session. Has anyone shipped callbacks + poll backup long term? Or do you pick one and accept the downsides? Callback handler: github.com/ojusave/dealhealth-playground/blob/main/services/api/src/routes/events.ts Poll loop: github.com/ojusave/read-it-for-me/blob/main/server/lib/orchestrator.ts submitted by /u/ojus_render [link] [留言]

/u/ojus_render 2026-07-11 08:31 6 原文
AI 资讯 Dev.to

How I Kept a Live Chat Feed Smooth at 3,700+ Messages

I built LiveShop , a mini live-shopping stream UI, to answer a question I kept running into as a frontend-curious grad: tutorials teach you how to render a list, but they never teach you what happens when that list gets hit with the kind of traffic a real live stream produces. So I built something that would force the problem to show up, then fixed it, then measured whether the fix actually worked. The setup LiveShop simulates a live-shopping broadcast - the kind of interface a small merchant might use to sell products while streaming. A mock event engine fires chat messages, reactions, and purchase notifications on an interval, standing in for what a real WebSocket connection to a streaming backend would deliver. On top of that sits a chat feed, a scrollable product carousel, and a floating reaction animation layer. None of that is unusual. The interesting part started once I asked: what happens when message volume spikes? Where it breaks A naive chat feed is just messages.map(m => <ChatRow key={m.id} {...m} />) . It's the first thing anyone reaches for, and it's fine — right up until it isn't. At 50 messages, nothing looks wrong. At a few hundred, every new message triggers a full re-render pass across every row in the DOM, including the hundreds that have already scrolled out of view and that nobody can see. The browser is doing layout and paint work for pixels that aren't on screen. In a real live stream, this is exactly the wrong failure mode, because message volume doesn't arrive evenly. It spikes — right after a product drop, right when something funny happens on stream, right when a popular creator says something quotable. That's precisely the moment a chat feed can't afford to stutter, and precisely the moment a naive implementation is most likely to. What I measured Rather than guess whether this mattered, I built a way to test it directly. LiveShop has a "Simulate spike" button that fires 500 messages instantly, plus a live FPS readout using requestAnimat

shrutictc2 2026-07-11 08:30 5 原文
AI 资讯 Dev.to

After the ingress-NGINX retirement, what your migration plan owes production

The status of the controller As of March 2026, the Kubernetes SIG Network stopped maintaining ingress-nginx. That is the controller a lot of clusters have been running for years. A CNCF blog post published July 9 walks operators through the state of play. The headline for anyone still on it is short: unpatched CVEs, and no more feature work. The post names two operational risks explicitly. New security issues will not receive upstream fixes. Feature updates and community support have stopped. If your ingress plane is a piece of infrastructure you have not touched in a while, this is the reason to pull it up in this quarter's planning doc. What it means at 3am An ingress controller sits between the internet and your services. When it drops a request, you find out from your users. When it takes a CVE and no one is patching, you find out from a scanner or from a report. Neither is a good discovery path. The controller also carries the exact set of annotations, TLS defaults and rewrite rules your workloads rely on. Nothing about a retirement changes the version you have in production today, so the immediate blast radius is zero. The risk is on the calendar, not on the pager. That is the kind of risk teams reliably defer until a scanner flags an unpatched CVE. The two paths CNCF lays out The post frames the choice as a fork. Path A is a lateral swap to another Ingress controller. The example named is Contour, described in the post as Envoy-based. This keeps you on the Ingress API and mostly moves the problem of who is patching. Path B is modernization to the Gateway API, described in the post as the upstream-backed successor to Ingress. The CNCF post points at ingress2gateway to automate the translation, and recommends an incremental rollout: run the new plane in parallel and move non-critical workloads first. The stopgap version is a mix. Adopt Contour to buy time on maintained code, then schedule the Gateway API move on your own calendar rather than under duress. What

Leo 2026-07-11 08:24 5 原文
AI 资讯 Dev.to

Quantified Self 2.0: Stop Guessing Your Health History—Build a Personal Medical Vector Database

Let's be real: our personal medical history is a mess. It’s a chaotic mix of PDF lab results, grainy scans of prescriptions, and cryptic Electronic Medical Records (EMR) scattered across different hospital portals. If you’ve ever tried to remember exactly when a specific symptom started or how your cholesterol has trended over the last decade, you know the "search" struggle is real. In this guide, we are moving beyond simple folders. We are architecting a Personal Health Knowledge Base using a modern Vector Database and RAG (Retrieval-Augmented Generation) pipeline. We’ll leverage Qdrant for high-performance similarity search, Unstructured.io for complex document parsing, and Sentence-Transformers to turn 10 years of medical jargon into searchable embeddings. By the end of this post, you'll have a system capable of cross-year symptom correlation and instant medical history retrieval. The Architecture: From Pixels to Insights 🏗️ The biggest challenge with medical records isn't storage; it's ingestion . Medical PDFs are notoriously difficult to parse because they often contain nested tables and checkboxes. Our pipeline handles this by isolating the layout before embedding. graph TD A[Raw Medical Data: PDFs, Scans, EMRs] --> B[Unstructured.io: Partitioning & OCR] B --> C[Text Chunking & Cleaning] C --> D[Sentence-Transformers: Vector Embedding] D --> E[(Qdrant Vector DB)] F[User Query: 'Show me my blood sugar trends since 2015'] --> G[FastAPI Interface] G --> H[Query Embedding] H --> I[Vector Search in Qdrant] I --> J[Contextual Results + LLM Synthesis] J --> K[Actionable Health Insight] Prerequisites 🛠️ To follow along, you'll need: Python 3.9+ Unstructured.io : For the heavy lifting of PDF/Image parsing. Qdrant : Our vector engine (run it via Docker: docker run -p 6333:6333 qdrant/qdrant ). Sentence-Transformers : To generate local embeddings without sending sensitive data to the cloud. FastAPI : To wrap it all in a slick API. Step 1: Parsing the Chaos with Unstructu

Beck_Moulton 2026-07-11 08:19 5 原文
AI 资讯 Dev.to

Your model didn't get worse — the wrapper around it did (and you can control that)

My GPT got dumber after the update" gets blamed on the model regressing, or on you prompting worse. Both are unfalsifiable, and both send you to fix the wrong layer. The layer that actually moved is the one you can pin. "The model" is two layers. The weights — the trained network, slow to change, and when they do change it's announced under a new name. And the wrapper — the router that picks which model answers, the system prompt, the default reasoning effort, verbosity caps. The wrapper changes silently, on its own schedule, per product. It's almost always what moved under you. So stop re-tuning prompts to chase it. Pin the wrapper: Force the route. Don't leave it on Auto — set Thinking (or say "think hard") so the router can't quietly demote your prompt to a faster, weaker model. OpenAI's own GPT-5 launch post describes exactly this router (it scores prompts "simple" vs hard); after the backlash they put the picker back (Auto/Fast/Thinking — TechCrunch, Aug 2025). Pin the version. If you build on a model, call its exact versioned ID via the API. A model ID's weights don't change — new versions ship under new IDs — so router and system-prompt churn can't reach you. Own the harness. Running agents? Set the system prompt, reasoning effort, and verbosity yourself instead of inheriting a default. Anthropic's own April 23 post-mortem is the proof: six weeks of "Claude Code got worse" traced to three wrapper changes (a reasoning-effort downgrade, a reasoning-history bug, a verbosity cap their ablations put at ~3% quality) — API weights never touched. A real weights change — a new model — will still move behavior. But that's announced, and you choose when to adopt it. The silent stuff is all wrapper, and the wrapper is the part you can pin. Sources: OpenAI GPT-5 launch (router + "think hard"); TechCrunch, Aug 2025 (model picker reinstated); Anthropic April 23 post-mortem (anthropic.com/engineering/april-23-postmortem); InfoQ and VentureBeat (corroboration); Claude platfor

Anisa 2026-07-11 08:18 5 原文
AI 资讯 Dev.to

The Evolution of a Software Engineer

The first year class HelloWorld { public static void main ( String args []) { // Displays "Hello World!" on the console. System . out . println ( "Hello World!" ); } } The second year /** * Hello world class * * Used to display the phrase "Hello World" in a console. * * @author Sean */ class HelloWorld { /** * The phrase to display in the console */ public static final string PHRASE = "Hello World!" ; /** * Main method * * @param args Command line arguments * @return void */ public static void main ( String args []) { // Display our phrase in the console. System . out . println ( PHRASE ); } } The third year /** * Hello world class * * Used to display the phrase "Hello World" in a console. * * @author Sean * @license LGPL * @version 1.2 * @see System.out.println * @see README * @todo Create factory methods * @link https://github.com/sean/helloworld */ class HelloWorld { /** * The default phrase to display in the console */ public static final string PHRASE = "Hello World!" ; /** * The phrase to display in the console */ private string hello_world = null ; /** * Constructor * * @param hw The phrase to display in the console */ public HelloWorld ( string hw ) { hello_world = hw ; } /** * Display the phrase "Hello World!" in a console * * @return void */ public void sayPhrase () { // Display our phrase in the console. System . out . println ( hello_world ); } /** * Main method * * @param args Command line arguments * @return void */ public static void main ( String args []) { HelloWorld hw = new HelloWorld ( PHRASE ); try { hw . sayPhrase (); } catch ( Exception e ) { // Do nothing! } } } The fifth year /** * Enterprise Hello World class v2.2 * * Provides an enterprise ready, scalable buisness solution * for display the phrase "Hello World!" in a console. * * IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED * TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER * PARTY WHO MAY MODIFY AND/OR REDISTRIVUTE THE LIBRARY AS * PERMITTED ABOVE, BE LIABLE TO YOU FOR DAM

Sean H 2026-07-11 08:18 4 原文
AI 资讯 Dev.to

Biot Number: How to Know When a Cooling Object Has a Single Temperature

Pull a hot steel bolt out of a furnace and quench it in oil, and a fair question is: does the bolt cool from the outside in, with a sharp temperature difference between its skin and its core, or does the whole thing drop in temperature more or less together? The answer is not obvious from the part itself. A thin copper washer and a thick ceramic block behave very differently in the same bath, even at the same starting temperature. The Biot number is the small calculation that settles this question before you commit to any heavy analysis. It tells you, in a single dimensionless figure, whether an object can be treated as having one uniform temperature or whether you must resolve a temperature gradient inside it. That distinction changes the math from a one-line exponential decay to a partial differential equation. Why this calculation matters Transient heating and cooling problems show up everywhere: heat-treating metal parts, quenching forgings, cooling electronics, baking or chilling food, warming up an engine block. In every one of these, the engineer wants to know how the temperature changes over time. The hard version of that question requires solving the heat conduction equation across the body, with position and time as variables. The easy version is the lumped-capacitance model, which treats the whole object as a single point at one temperature. It reduces the problem to a simple first-order exponential. The catch is that the lumped model is only valid when internal conduction is fast compared with surface convection. The Biot number is exactly the check that tells you whether that condition holds. Skip the check and apply the lumped model where it does not belong, and you can badly mispredict cooling times, residual stresses, and the risk of cracking from thermal gradients. The core formula The Biot number compares two thermal resistances. One is the resistance to conducting heat through the inside of the solid. The other is the resistance to carrying heat a

NovaSolver 2026-07-11 08:17 4 原文
AI 资讯 Dev.to

n8n review: I automated 12 saas.pet workflows with it in 6 months

n8n is the open-source workflow automation tool that competes with Zapier and Make. I have been running it for saas.pet's content pipeline for 6 months. Here is my honest take on self-hosting n8n versus paying Zapier, and whether it is worth the hassle. What n8n does that Zapier cannot n8n is an open-source workflow automation platform with 400+ built-in integrations. You connect nodes on a visual canvas: when X happens in one app, do Y in another. The killer difference from Zapier: you control where it runs. Self-host on a $5/month VPS or run on n8n Cloud at $20/month. No per-task pricing, no 'you hit your zap limit' emails. For high-volume workflows, the cost difference is dramatic. I run n8n on the same $6/month HK server that hosts my proxy. 12 workflows handle saas.pet's entire content pipeline: daily data fetch from GitHub Trending API, transform JSON, write to data files, trigger build, push to git, notify me on Telegram. The same workflows on Zapier would cost $73.50/month (Professional plan with 2,000 tasks). On n8n, $6/month for the server plus $0 for the software. The self-hosting overhead is real—updates, SSL certs, monitoring—but for 12+ active workflows, the savings are $800+/year. If you only have 2-3 simple zaps, stay on Zapier's free tier. If you have 5+ workflows with volume, n8n pays for the hosting in month 1. My 6-month setup for saas.pet I run n8n in Docker on the HK server. The initial setup: install Docker, pull n8n image, configure nginx reverse proxy, set up SSL via Certbot. That took about 2 hours the first time. Now I can deploy n8n in 15 minutes on a fresh server. The 12 workflows: (1) Daily GitHub trending fetch via saas.pet/api/trending, (2) data transform to unified JSON, (3) write to data/YYYY-MM-DD.json, (4) trigger build-ci.mjs, (5) git add + commit + push, (6) Telegram notification with commit SHA, (7) weekly sitemap health check, (8) monthly backup of reviews/ JSONs to S3, (9) uptime ping every 15 minutes, (10) DNS health check,

Alex 2026-07-11 08:17 4 原文
AI 资讯 HackerNews

One Wikipedia page costs your AI agent 68,000 tokens

i use claude code daily and measured what pages cost it while doing research. an average wikipedia article, for instance, is 68,240 tokens of raw html (tiktoken); nike's homepage is 353,000. claude code's built-in webfetch handles the easy case well. it summarizes wikipedia to about 950 tokens and clears cloudflare on some sites like indeed and ticketmaster. but, and there's always a but, on js-rendered and some anti-bot pages it returns nothing. quotes.toscrape.com/js gives "no quotes found"; n

arhamislam5766 2026-07-11 08:12 2 原文
科技前沿 The Verge AI

No, Flock isn’t threatening people for debating surveillance

On Thursday, the Instagram account for a lecture series in Newport Beach, CA posted a photo of what appeared to be a cease and desist letter from the surveillance technology company Flock Safety. Flock has received significant backlash over its technology and work with law enforcement agencies, and this letter kicked off yet another wave […]

Jay Peters 2026-07-11 08:10 6 原文
AI 资讯 Dev.to

How to usar Docker networks na pratica

Quando voce cria um container e depois outro, eles podem nao se enxergar. O motivo quase sempre e a rede. Entender os tipos de rede que o Docker oferece resolve isso de uma vez. Comece listando as redes que ja existem no seu Docker. docker network ls A rede bridge e a rede host vem de fabrica. Nenhuma delas oferece resolucao de nomes entre containers. Para isso voce precisa criar a sua propria rede. docker network create minha-rede Agora os containers que entrarem nessa rede conseguem se comunicar pelo nome do container. docker run -d --name app1 --network minha-rede nginx docker run -d --name app2 --network minha-rede alpine sleep 3600 Teste a comunicacao. docker exec app2 ping app1 -c 2 O ping funciona. O DNS interno do Docker resolve app1 para o IP interno do container. Isso resolve 90% dos problemas de comunicacao. A rede bridge padrao nao tem esse recurso. Crie sua propria rede sempre que precisar que containers se enxerguem. Agora a rede host. Ela elimina o isolamento de rede. O container usa a placa do host diretamente, sem NAT e sem mapeamento de porta. docker run -d --name web-host --network host nginx O nginx fica acessivel em http://localhost:80 direto. Sem -p 80:80. Mas so um container pode usar cada porta, porque a porta e a do host de verdade. Para ambientes com mais de uma maquina, existe a rede overlay. Ela precisa do Docker Swarm ou de um cluster. docker swarm init docker network create -d overlay rede-overlay docker service create --name api --network rede-overlay --replicas 3 nginx Os containers em maquinas diferentes se enxergam pelo nome como se estivessem na mesma maquina. No dia a dia, a rede bridge personalizada resolve quase todo caso de uso. Host e para performance ou casos especificos. Overlay e para quando voce escala para mais de uma maquina. That's all for now. Thanks for reading!

Isaias Velasquez 2026-07-11 08:08 5 原文
开发者 Dev.to

How to debug why your PCIe device doesn't enumerate during bring up

Notes from bringing up a PCIe WiFi module on i.MX8MQ; symptoms and how to diagnose them. Phy link never came up — what does this mean? This message is typically seen in dmesg as shown below. [ 3.828121] imx6q-pcie 33800000.pcie: iATU: unroll T, 4 ob, 4 ib, align 64K, limit 4G [ 4.807241] imx6q-pcie 33c00000.pcie: Phy link never came up [ 4.841482] imx6q-pcie 33800000.pcie: Phy link never came up [ 5.821279] imx6q-pcie 33c00000.pcie: Phy link never came up [ 5.830481] imx6q-pcie 33c00000.pcie: PCI host bridge to bus 0001:00 [ 5.854997] imx6q-pcie 33800000.pcie: Phy link never came up [ 5.862205] imx6q-pcie 33800000.pcie: PCI host bridge to bus 0000:00 It means one of the following The PCIe peripheral is not powered up. PCIe reset is not deasserted, so the chip is in reset. This could be because the DTB is deasserting an incorrect GPIO. Reference clock is not enabled Using the incorrect PCIe controller in the device tree. As we can see that both the PCIe controllers can report this. So first determine which controller is the peripheral hooked to. More on this in the next section. Which PCIe controller is my device on? ( &pcie0 vs &pcie1 ) The rule here is to match by address and not by label/name. If the schematic calls out controllers as PCIE1 and PCIE2, and the device tree lists pcie0 and pcie1, understand the mapping. The DTS label is arbitrary - match by register base ( @address in the node name), which is the same in the DTS reg and the reference memory map. For definitive addresses look in the .dtsi , as sometimes the manuals are misleading. Given below is a mapping table for i.MX8MQ DTS. | ADDRESS (in .dtsi) | Silicon (RM) Label &pcie0 | 0x33800000 | PCIe1 &pcie1 | 0x33c00000 | PCIe2 The addresses are listed in the chip’s memory layout are from processor reference manual. Below is snapshot from the i.MX8MQ reference manual, where the layout for the core A-53 is listed. Start Address | End Address | Size | Description 3381_0000 | 3381_3FFF | 4MB | PCIe-2 << inco

Ashwin 2026-07-11 08:07 5 原文
AI 资讯 Dev.to

How to add a changelog to any web app with one script tag

You ship all the time. A fix here, a new setting there, a feature you spent a whole weekend on. And your users mostly don't notice. That gap is expensive. When people can't see a product moving, it feels abandoned, even when you're shipping every week. They churn a little faster, they email asking for things you built a month ago, and all the momentum you're actually creating stays invisible. The fix is boring and old: a changelog. But not a changelog rotting in a Notion doc nobody opens. One that shows up inside your app , where users already are. Here's the approach I settled on. The idea: a widget, not just a page A "what's new" widget is a small button or badge in your UI. Click it, and a panel slides out with your latest updates. Users see it in the flow of using your product, not on some /changelog page they'd never visit. You really want three things: An in-app widget users actually see. A public page and RSS feed you can link from emails and docs. A way to write updates in plain language and publish in a click. The one-tag version I ended up building a tool for this (honest disclosure below), but the integration is the part worth showing, because it's the pattern any changelog widget should follow: <!-- Paste before </body> --> <script src= "https://cdn.patchlog.io/widget.js" data-project= "your-project-id" data-position= "bottom-right" async ></script> One script tag. No SDK, no npm install, no framework coupling. It behaves the same in React, Vue, Rails, or a plain HTML page. Two implementation details matter, whether you build one of these yourself or evaluate an existing one: Render it in a Shadow DOM. A changelog widget should not inherit or leak styles. If it uses the host page's global CSS, it will look broken on half the sites it lands on. Shadow DOM isolates it completely. Fail silently. A marketing widget must never break the host app. If the network call fails, it should quietly do nothing. What to actually write in it The tool is the easy part. T

Michael Yousrie 2026-07-11 08:05 5 原文