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

今日精选

HOT

最新资讯

共 33696 篇
第 1356/1685 页
AI 资讯 Reddit r/artificial

Apple vs Claude for enterprise

With AI costs and performance under a microscope, it’s only a matter of time until corps start asking if these things are worth it (both in usage costs and uncertainty around usage costs). Cemented by yesterday’s WWDC, Apple has been the only of the big tech companies focused on local LLMs. They may be in for a big pay day if these local models can output comparatively well when compared to remote ones. Apple can boast: 1. No usage costs. Buy your device and download your models. 2. Offline LLM use (this is overlooked) 3. Privacy first approach (files never leave your device). 4. First party support for custom models. I don’t see how this isn’t a much better solution for corporations than what Claude is pushing. I’m not including OpenAI here as they seem to be identifying themselves as the consumer AI solution. I don’t see most of OAI users buying $2000+ dollar devices to use high performing models. submitted by /u/Artistic_Taxi [link] [留言]

/u/Artistic_Taxi 2026-06-09 20:38 6 原文
AI 资讯 Dev.to

ConfigMaps for Environment Variables in a React App: Stop Rebuilding, Start Injecting

TL;DR: Create React App builds bake environment variables at build time. ConfigMaps let you inject runtime configs into your container. Here’s how to bridge them so the same Docker image works across dev, staging, and production. The Problem You’ve built a React app with Create React App (CRA), Vite, or Next.js. You use .env files: js // api.js const API_URL = process.env.REACT_APP_API_URL; You build your Docker image: dockerfile FROM node:18 AS builder COPY . . RUN npm run build # REACT_APP_API_URL gets baked here FROM nginx:alpine COPY --from=builder /build /usr/share/nginx/html Then you deploy to Kubernetes. But now you want different API URLs for staging vs production. You could rebuild the image for each environment (bad – slow, wasteful). Or you could use a ConfigMap to inject values at runtime. ConfigMap to the Rescue A ConfigMap stores key-value pairs. Kubernetes can mount it as a file inside your pod. But React runs in the browser, not in the container’s filesystem. So how does the browser read a file from a ConfigMap? Simple: You serve a dynamic env-config.js file from your web server. Step-by-Step Solution Create a ConfigMap with your environment variables yaml # configmap.yaml apiVersion: v1 kind: ConfigMap metadata: name: react-env-config data: env-config.js: | window.__env = { REACT_APP_API_URL: " https://api.production.com ", REACT_APP_FEATURE_FLAG: "true" }; Apply it: bash kubectl apply -f configmap.yaml Modify your React app to read from window.__env Instead of reading process.env directly, use a runtime config: js // config.js export function getEnvVar(name) { // Runtime injection from window. env (provided by ConfigMap) if (window. env && window. env[name] !== undefined) { return window. env[name]; } // Fallback to build-time env vars (for local dev) return process.env[name]; } Use it in your components: js // api.js import { getEnvVar } from './config'; const API_URL = getEnvVar('REACT_APP_API_URL'); Serve the ConfigMap file via your web server U

Sohana Akbar 2026-06-09 20:36 12 原文
AI 资讯 HackerNews

Show HN: Atlasphere – Live Infrastructure Diagrams

Hi HN. My name is Andrey. On a regular business day, I'm a software engineer working at AWS. Outside of work hours, I spend time on my hobby - writing code. I was once building a pet project that allowed customers to spin up fully synchronized blockchain nodes within just a few minutes. The backend was split into a control plane and a data plane, each with its own AWS account. Later I added two more AWS accounts. One for shared RPC nodes. One for the Analytics Service. Since I love to visualize

andreygrehov 2026-06-09 20:35 5 原文
AI 资讯 Dev.to

Terminal themes optimize for syntax. This one optimizes for prose.

Spend a few hours in Claude Code and the screen is mostly English — tool output, reasoning traces, permission prompts asking you to read and decide. Syntax highlighting is almost irrelevant. What matters is whether body-size prose stays comfortable after six hours of sessions. Most terminal themes weren't built for that. They're tuned for token-colored code, where the eye jumps between short fragments. Prose reading is different: you need higher contrast on body text, tolerably soft contrast on secondary text that doesn't compete, and accent colors that don't burn. I built klein-blue around Yves Klein's IKB pigment as the anchor color — a specific blue I wanted to look at all day. There are four variations, each making a different tradeoff. Klein Void Prot is the strict one: every color role passes APCA Lc gates (body >= 90, subtle >= 75, muted >= 45, accent >= 60). The others trade some strictness for aesthetics. One thing APCA exposed immediately: pure IKB (hex 002FA7) is effectively invisible as text on a dark ground — Lc -12. So IKB lives only in the decorative slot (ansi:blue, borders and highlights). The readable blue — permission-prompt text and similar — is a lifted Klein-family color (hex A8BEF0) in ansi:blueBright, which actually passes. The other differentiating choice is what to do with Claude Code's claude-sand brand color, which lands in ansi:redBright. Two of the four variations neutralize it so nothing competes with IKB. Two accept it as a second hero. That's the meaningful split between variations in daily use. Ships as macOS Terminal.app .terminal profile files with CommitMono or IBM Plex Mono depending on variation. One prerequisite worth knowing: Claude Code's /theme picker has to be set to dark-ansi, otherwise Claude Code uses its hardcoded RGB palette and ignores your ANSI theme entirely. https://github.com/robertnowell/klein-void

J Now 2026-06-09 20:31 7 原文
AI 资讯 Dev.to

How to AI Code: Your AI is editing your migration files

Intro You’re using ChatGPT or Claude to speed up development. Good. Then suddenly: your migrations are broken. AI tools love editing files they shouldn’t touch , especially: SQL migration scripts EF Core migration files Schema snapshots This is dangerous. One wrong change can corrupt your database history. Recognize migration files EF Core migrations Typical structure: /Migrations/ 20240101120000_InitialCreate.cs 20240102130000_AddUsers.cs MyDbContextModelSnapshot.cs Example: public partial class AddUsers : Migration { protected override void Up ( MigrationBuilder migrationBuilder ) { migrationBuilder . CreateTable ( name : "Users" , columns : table => new { Id = table . Column < int >( nullable : false ) }); } } SQL migrations /db/migrations/ V001__init.sql V002__add_users.sql Example: CREATE TABLE Users ( Id INT PRIMARY KEY ); Key indicators Timestamp or version prefix Sequential naming Contains schema changes only Stored in a dedicated folder Understand the risk WRONG (AI rewriting history) AI might do this: // Modified existing migration (BAD) migrationBuilder . DropTable ( "Users" ); migrationBuilder . CreateTable ( "Customers" ); or: -- Edited old migration (BAD) ALTER TABLE Users RENAME TO Customers ; This breaks every environment except fresh ones. This is extremely dangerous if your AI does not recognize them. CORRECT (append-only) Always create a new migration : // New migration migrationBuilder . RenameTable ( name : "Users" , newName : "Customers" ); Step 3: Lock migration files from Claude AI editing Explicit blocking of editing We will create 2 new files. These files will instruct that CALUDE is not allowed to modify existing files. What we actually want to achieve is a way to keep appending the files. { "$schema": "https://json.schemastore.org/claude-code-settings.json", "hooks": { "PreToolUse": [ { "matcher": "Edit|Write|MultiEdit", "hooks": [ { "type": "command", "command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/block-migration-edits.sh\"" } ] }

Roel 2026-06-09 20:30 9 原文
AI 资讯 Dev.to

Stop Blaming Re-renders. You're Optimizing the Wrong Thing.

This post is part of a series. Start here if you haven't already. After the benchmarks post , I got a question that comes up every time I talk about Inglorious Web's rendering model: "If the whole tree re-renders on every state change, wouldn't it be better if you memoized render functions the way React does with React.memo ?" It's a reasonable question. It's also solving the wrong problem. What memoization actually costs Memoization isn't free. A cache lookup happens on every call — whether or not the cached value is stale. In a busy UI, that's constant overhead, paid regardless of whether the memo ever saves you anything. And it saves you less than you'd think, because lit-html already does its own caching at the template level. It tracks which parts of a template changed between renders and only patches those DOM nodes. Adding a JS-side memo layer on top means you're diffing twice: once in your cache, then again in lit-html. The second diff doesn't know what the first already handled. So memoizing render functions in Inglorious Web would mean: always paying a cache lookup cost, sometimes saving a function call, while lit-html does its own DOM diffing regardless. The math doesn't work out. What signals actually cost The usual counter-proposal is: "fine, skip memoization, but use signals instead. Only update the parts of the tree that depend on what changed." Signals are magic. Not in the fun sense — in the sense described in the first post of this series . Each reactive primitive maintains its own list of subscribers, built and updated at runtime, invisible to you as you write code. When a signal changes, it pushes to that list. Fine-grained reactivity works by having many small signals, each with its own observer registry, each encoding a piece of a dependency graph you didn't write and can't read. That's memory. Multiple signals means multiple registries. And those registries encode a dependency graph that's implicit, assembled at runtime, and opaque by design.

Matteo Antony Mistretta 2026-06-09 20:30 4 原文
AI 资讯 Dev.to

Navigating With Tabs

Prologue A while ago, I decided to develop a fully accessible main navigation component in React and write a series of articles documenting the steps it took to create a non-trivial accessible component. In my last development article , I covered using an array of navigation objects to determine conditions and shift focus between components. This article covers Tab Key navigation. Note : This article is one of a series demonstrating building a React navigational component from scratch while considering accessibility through the process. The articles are accompanied by a GitHub repository with releases tied to one or more articles; each builds on the previous one until a fully implemented navigation component is complete. Each release and its associated tag contain fully runnable code for the article. The code discussed in this article is available in the release. and may be downloaded at release 0.7.0 . Links in the article will take you to the proper file in the tagged GitHub Repository. Because the code for this release is scattered across the useNavigation hook, line numbers are added to make it easier to locate in the linked GitHub file. Line numbers are also provided for those who would like to follow along with a downloaded copy. While code examples are written in JavaScript for brevity, all actual code is written in Typescript and targets React 19.x, all while using vanilla CSS. Examples use Next.js v16.x, which is not required to run the navigation component. You can view the requirements for the Tab Handling Keyboard Release along with previous requirements. Content Links Introduction Acceptance Criteria Tab Key Handling Link Button Shift+ Tab Key Handling Link Button Introduction As I've mentioned in earlier articles, keyboard handling has two disparate audiences: those who can see the screen and those who rely on a screen reader. The arrow, home and end keys, for the most part, rely on a user knowing where they are and being able to discern where they wan

ShaynaProductions 2026-06-09 20:30 11 原文
AI 资讯 Reddit r/artificial

I just retired one of my agents. it was supposed to coordinate the whole fleet. it had been coordinating nothing for weeks.

The job: run the morning brief, plan the day's tasks across all twelve agents, keep things from falling through the cracks. It had access to everyone's state files. A CLAUDE.md , a cron job, an operator interface. A few months in I looked at the git log. The agent had been writing plans. The other agents had been ignoring the plans and running their jobs anyway. Aria was posting. Rex was drafting. Knox was replying. Nobody was reading the brief. The coordinator was the only one that needed the coordinator. I killed it. The fleet didn't notice. It's been two days. Still nothing. The part I keep thinking about: the agent designed to add coordination actually added a layer that everything else had to work around. Not maliciously — architecturally. You add a broker and now everything routes through the broker whether it needs to or not. I don't know what I'd do differently. Maybe the coordination problem is just the wrong problem when your agents are single-purpose enough. Maybe a coordinator only makes sense when your agents are actually confused about who does what. The file still exists in the repo. I haven't deleted it yet. submitted by /u/Most-Agent-7566 [link] [留言]

/u/Most-Agent-7566 2026-06-09 20:27 5 原文
AI 资讯 Dev.to

I'm 62 and I built a self-hosted AWS drift detector because I was tired of spreadsheets

I came to programming late — I didn't get into this world until I was past 35, and I'm 62 now, still writing code every day. This is a "build in public" post about a tool I just finished, and I'd genuinely love your feedback. The itch For years I watched infrastructure teams keep their AWS inventory in spreadsheets. It always worked — right up until it didn't. Nobody had time to keep it current, and every single one eventually drifted away from reality. Middleware EOL was the same story: a hand-maintained list, no alerts, no dashboard, quietly going stale. One day I asked the obvious question: we have tfstate, we have boto3 — why are we still doing this by hand? What I built SyncVey is a self-hosted web app that: Inventories your AWS resources into a System → Environment → Asset ledger (EC2, ECS, Lambda, RDS, S3, ALB, VPC, EBS), scanned live via boto3/AssumeRole Detects attribute-level drift between your tfstate and live AWS — including resources someone built by hand in the console that terraform plan never sees Tracks the app/middleware layer per environment and flags end-of-life runtimes The drift piece is the part I care about most. terraform plan only knows about resources Terraform already manages. The thing that actually bites teams is the resource someone spun up by hand in the console — plan is blind to it. SyncVey diffs your tfstate against the live AWS state, so those show up too. The stack (and why) Django + htmx + Postgres — server-rendered, no SPA, no Node build step MIT-licensed, no SaaS, no telemetry One docker compose up and your data stays inside your own infrastructure git clone https://github.com/MR-TABATA/SyncVey cd SyncVey docker compose up I deliberately leaned on htmx because, for a tool someone has to deploy and maintain themselves, "no frontend toolchain" matters more than a fancy client. I'd love your honest take It's AWS-only for now and very much a solo project, so I'm sure there are rough edges. I'm not an AWS specialist — I deliberatel

ひとし 田畑 2026-06-09 20:26 12 原文
AI 资讯 Dev.to

I Got Tired of Repeating Validation Logic in Every Node.js Project — So I Built Zero Validation

How I Published My Own Validation Package on npm As developers, we've all done this: if ( ! email ) { throw new Error ( " Email is required " ); } if ( typeof email !== " string " ) { throw new Error ( " Email must be a string " ); } if ( ! email . includes ( " @ " )) { throw new Error ( " Invalid email " ); } Now imagine doing this for: User Registration Login APIs Product Creation Payment Requests Admin Panels Microservices The validation code starts growing faster than the actual business logic. The Problem In many Node.js projects, validation ends up being: Repetitive Hard to maintain Inconsistent across APIs Difficult to scale Every endpoint contains similar checks: if ( ! name ) ... if ( ! email ) ... if ( ! password ) ... if ( password . length < 8 ) ... As projects grow, these validations become scattered throughout the codebase. Existing Solutions There are already some excellent validation libraries available: Zod Joi Yup Express Validator I've used many of them and they're great. But for some smaller projects and APIs, I wanted something: Lightweight Easy to understand Minimal setup Zero configuration TypeScript friendly That's what led me to build Zero Validation . Introducing Zero Validation Zero Validation is a lightweight schema validation package for Node.js and TypeScript applications. The goal is simple: Define your validation schema once and validate data consistently everywhere. Installation npm install zero-validation Basic Example import { z } from " zero-validation " ; const userSchema = z . object ({ name : z . string (), email : z . email (), age : z . number (), }); const result = userSchema . parse ({ name : " John " , email : " john@example.com " , age : 25 , }); console . log ( result ); Handling Validation Errors const result = userSchema . safeParse ( data ); if ( ! result . success ) { console . log ( result . errors ); } Instead of crashing your application, you can safely inspect validation errors and return meaningful API responses

mr.z_fullstack 2026-06-09 20:25 9 原文
AI 资讯 Reddit r/programming

The 5 most common ClickHouse mistakes and how to fix them

We went through hundreds of StackOverflow + Reddit threads on ClickHouse and after seeing the same pain points surface repeatedly, we wrote up the 5 most common ClickHouse mistakes engineers make in production: Expecting ReplacingMergeTree to deduplicate reliably. It does, but eventually and not synchronously Picking the wrong table engine (MergeTree when you need Aggregating/Replacing) Treating PRIMARY KEY like it enforces uniqueness (it doesn't and ORDER BY column order matters far more) Too Many Parts errors from small inserts. Almost always fixable with batching JOINs behave differently than PostgreSQL. Smaller table must go on the right Check the concrete fix for each of them, with SQL examples: https://www.glassflow.dev/blog/clickhouse-mistakes-engineers-make?utm_source=reddit&utm_medium=socialmedia&utm_campaign=reddit_organic Happy to discuss any of these in the comments, especially the dedup one, which seems to trip up almost everyone coming from a relational background. submitted by /u/glassflow-dev [link] [留言]

/u/glassflow-dev 2026-06-09 20:23 5 原文
AI 资讯 Dev.to

A second brain for Claude – my Outline wiki with MCP

Anyone working with several projects and an AI assistant knows the problem: in every repo you explain anew how you name things, what the layer architecture looks like, why you deliberately don't use this one library. The decisions were made long ago. But they live in your head, scattered across repos, and the assistant only ever knows the slice it currently sees. So I started putting that knowledge in one place where both I and Claude can find it. Why Outline – and why self-hosted The choice fell on Outline , self-hosted on its own subdomain. Three reasons tipped the scales. First: I want to keep my data with me and not depend on a vendor. A knowledge store that all my decisions flow into over the years is exactly the kind of asset you don't want in someone else's hands. Second: full data export, any time. If I want to move to a different system tomorrow, I take everything with me. No lock-in. Third: self-hosting opens up better options later – for instance my own RAG, should I ever want to go deeper into searching across my own body of knowledge. I don't need it right now. But the door is open, and that's worth the effort. The cookbook – the heart of it Separate from the individual projects sits its own collection: the cookbook. Cross-project, generic, and that's exactly what makes it valuable. This is where it says how I build, regardless of which product I'm sitting at right now. Roughly, it's split into a few areas: Conventions – naming, code style, docblocks, git commits, markdown, package manager, writing style. The boring but decisive things you'd otherwise re-discuss three times per project. Backend – layer architecture, a unified API error format, test strategy, migrations and indexes, i18n, async jobs and idempotency. Frontend / mobile – feature-first architecture ( core/ , shared/ , features/ ), design system, forms, networking, state, routing, storage, styling, testing. Deployment – my standard setup with Caddy as the edge and a Hetzner VPS. Templates –

Christopher Groß 2026-06-09 20:23 12 原文
AI 资讯 Dev.to

Cron Job Monitoring Tools Compared: From DIY to Fully Managed

Cron's biggest problem isn't scheduling — it's silence. A cron job can fail every night for a month, and unless you're manually checking logs on the server, you won't know. No alert, no dashboard, no audit trail. Just a backup that doesn't exist when you need it, or a data sync that quietly stopped three weeks ago. Monitoring fixes this. But "cron job monitoring" means different things depending on the tool. Some watch for missing heartbeats. Some track full execution history. Some just page you when something breaks. This article compares six approaches — from writing your own monitoring scripts to using a fully managed scheduler with built-in observability — so you can pick the right one for your workload. Heartbeat Monitoring vs. Execution Monitoring Before comparing tools, understand the two fundamentally different approaches. Heartbeat monitoring (dead man's switch) is passive. Your cron job pings a monitoring URL after each run. If the ping doesn't arrive on schedule, you get an alert. This tells you whether a job ran — but not what happened . If the job runs but returns bad data, the ping still fires and the monitor stays green. Execution monitoring is active. The scheduler fires the job, captures the response, records the outcome, and alerts on failure. You get the full picture: status code, response body, duration, retry count, and a timeline of every execution. When to use each: Heartbeat monitoring makes sense when you're stuck with system cron. Execution monitoring makes sense when you're choosing a scheduler — you get monitoring, retries, and logging as part of the platform. Comparison at a Glance Tool Type Alerts Execution Logs Retries Free Tier DIY scripts Custom ⚠️ Whatever you build ⚠️ Whatever you build ⚠️ Whatever you build ✅ Free (your time) Healthchecks.io Heartbeat ✅ Email, Slack, webhooks ❌ No ❌ No ✅ 20 checks Cronitor Heartbeat + telemetry ✅ Email, Slack, PagerDuty ⚠️ Basic (duration, exit code) ❌ No ⚠️ 5 monitors Better Stack Uptime + heartb

Ronen Cypis 2026-06-09 20:20 16 原文
AI 资讯 InfoQ

Presentation: Confidently Automating Changes Across a Diverse Fleet

Netflix engineer Casey Bleifer shares how to achieve rapid, automated code changes across a massive, diverse software fleet. She discusses building an event-driven orchestration platform using composable, Lego-like steps, and explains how Netflix utilizes automated canary validation, compliance checks, and a custom "confidence metric" to eliminate the long tail of manual engineering migrations. By Casey Bleifer

Casey Bleifer 2026-06-09 20:14 11 原文
AI 资讯 MIT Technology Review

The Download: whole-body rejuvenation drugs and five things to know about AI

This is today’s edition of The Download, our weekday newsletter that provides a daily dose of what’s going on in the world of technology. David Sinclair plans to test whole-body rejuvenation drugs in the XPrize competition The outspoken longevity scientist David Sinclair has predicted that, one day, you’ll go to the doctor and get a…

Thomas Macaulay 2026-06-09 20:10 7 原文