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

今日精选

HOT

最新资讯

共 41519 篇
第 1828/2076 页
AI 资讯 Dev.to

The One TDD Habit That Saved My Sanity (and My Codebase)

The One TDD Habit That Saved My Sanity (and My Codebase) Quick context (why you're writing this) Here's the thing: I used to think I was doing TDD right. I’d write a test, watch it fail, then write just enough code to make it green. Rinse and repeat. Sounds textbook, right? But a few months ago I spent an entire afternoon chasing a bug that only showed up after I refactored a service class. The tests were all passing, yet the app was throwing NullReferenceExceptions in production. I was shocked. How could everything be green and still be broken? Turns out I was testing the inside of my code instead of what it actually did for the outside world. That realization hit me like a truck, and it completely changed how I approach TDD. The Insight Test behavior, not implementation. If your test is coupled to private fields, internal data structures, or the exact way a method accomplishes its goal, you’re not testing what matters—you’re testing how you happen to do it today. When you later refactor to improve performance, swap out a dependency, or even just rename a variable, those tests start failing for no good reason. You end up spending more time fixing tests than delivering value, and you lose confidence in the suite because it feels fragile. The payoff? A test suite that gives you confidence when you change code, not anxiety. You can refactor fearlessly because the tests only care about the contract: given these inputs, the system should produce these outputs or side‑effects . How (with code) Let’s look at a tiny but realistic example: a PasswordValidator service that checks whether a user‑chosen password meets our policy. ❌ The mistake: testing implementation details // PasswordValidator.cs public class PasswordValidator { private readonly IRegexProvider _regex ; // injected for testability public PasswordValidator ( IRegexProvider regex ) { _regex = regex ; } public bool IsValid ( string password ) { // implementation we might want to change later return _regex . IsMa

Timevolt 2026-06-05 23:36 17 原文
AI 资讯 Dev.to

The Website Was Working Fine. The CMS Wasn't: Understanding Drupalgeddon2

Imagine you're responsible for a company's website. Everything seems healthy. Pages load quickly. Users can log in. Content editors publish articles every day. Customers aren't reporting problems. From the outside, everything looks perfect. But then one day you discover something surprising: Attackers don't care whether your website looks healthy. They care whether the software behind it is vulnerable. That's exactly what happened with Drupalgeddon2. One of the most significant CMS vulnerabilities in recent years. And one that still teaches valuable lessons for developers, DevOps engineers, and security professionals today. The Building Manager Analogy Imagine a large office building. The company hires a building manager. The manager handles: Visitors Deliveries Maintenance Schedules Room Access The employees don't worry about these details. They trust the manager. A Content Management System (CMS) works similarly. Instead of manually managing every page and article, organizations rely on a CMS. Website ↓ CMS ↓ Content The CMS becomes the central control system. And that's why it becomes such an attractive target. What Is Drupal? Drupal is an open-source Content Management System. Organizations use it to manage: Corporate websites Government portals Universities Media platforms Enterprise applications A simplified architecture looks like: Visitor ↓ Drupal ↓ Database ↓ Content Every request passes through Drupal. Which means Drupal becomes part of the application's attack surface. Why Attackers Love CMS Platforms Suppose an attacker discovers a vulnerability in: Custom Internal Tool Maybe a few organizations are affected. Now suppose they discover a vulnerability in: Popular CMS Thousands of organizations may be affected. Potentially millions of users. One vulnerability. Many targets. That's why CMS platforms receive so much attention. Understanding Drupalgeddon2 Drupalgeddon2 refers to: CVE-2018-7600 A Remote Code Execution vulnerability affecting Drupal. The import

Arashad Dodhiya 2026-06-05 23:36 11 原文
AI 资讯 Dev.to

The Context Compression Pattern

Pattern Defined Precise Definition: Context Compression is an inference pattern that utilizes a specialized "selector" model or a ranker to distill large volumes of retrieved data into its most salient semantic components, removing redundant or irrelevant tokens before the final inference pass. Problem Being Solved We are currently fighting the "Lost in the Middle" phenomenon. Even with massive token windows, LLM performance degrades significantly when relevant information is buried deep within a context block; more data often leads to less accuracy. For a Director of Engineering, this is a direct threat to the Sovereign Vault's integrity. Every irrelevant token passed to the model is a potential point of failure for privacy airlocks and data governance. As established with the Sovereign Redactor , minimizing the noise isn't just about saving money—it is about shrinking the surface area for hallucinations and privacy leaks. Use Case Consider an Archival Intelligence system processing 1880s shipping ledgers. A single query about "cargo weights in 1884" might pull 20 pages of scanned text. Most of those pages contain sailor names and weather reports that have no bearing on the weight data. Without compression, the model has to "read" the entire ledger, leading to high costs and potential confusion. With the Context Compression pattern, a smaller, faster ranker identifies the specific sentences regarding "tonnage" and "cargo," passing only those 200 relevant words to the high-reasoning model. The Forensic Auditor gets a precise answer in half the time. Solution The pattern typically follows a three-step pipeline: Retrieve: Fetch the top documents using standard RAG. Compress: Use a technique like LongLLMLingua (a token-pruning method developed by Microsoft Research) or a Cross-Encoder to rank and prune tokens. Synthesize: Pass the condensed, high-signal prompt to the final model. flowchart LR A([User Query]) --> B[RAG Retrieval\nTop N Documents] B --> C[Compression Lay

Ken W Alger 2026-06-05 23:32 14 原文
AI 资讯 Dev.to

Our first offline app just shipped — and no one wrote a line of code

This week, the first offline-first PWA went live on WebsitePublisher.ai . A travel blog that works without internet. Write posts on a plane, attach photos, and everything syncs the moment you reconnect. Service Worker, IndexedDB, sync queue — the full stack. The twist: it was built entirely through conversation with an AI assistant. No IDE, no terminal, no deploy pipeline. How that works WebsitePublisher.ai exposes 92 integrations as building blocks via MCP (Model Context Protocol). Any AI assistant — ChatGPT, Claude, Cursor, Windsurf, Copilot, Gemini, Grok, Mistral — connects to the same runtime and assembles these blocks into working applications. The offline-first PWA is one of those blocks. The AI doesn't generate a Service Worker from scratch. It activates a proven, tested building block and configures it for the use case. We call this wave coding — one deliberate wave of proven pieces, instead of 15 fragile vibe-coding attempts. What shipped recently Offline-first PWA building block — push/pull sync, conflict handling, IndexedDB storage, works on iOS 92 integrations (up from 78) — 45 built-in, 47 bring-your-own-key Integration stacks — pre-composed combinations: e-commerce (13 integrations), lead generation, B2B prospecting, booking, content/blog 9 AI platforms supported — all via MCP, no vendor lock-in 416 API endpoints across the platform ## The architecture in short AI assistant (any) → MCP → WebsitePublisher runtime ├── PAPI (pages + assets) ├── MAPI (structured data) ├── SAPI (forms + auth + sessions) ├── IAPI (integration proxy) ├── VAPI (encrypted vault) └── AAPI (scheduled AI agents) Credentials never touch the AI. They're stored AES-256-GCM encrypted in the vault and injected server-side during execution. The positioning We're not competing with Lovable or Bolt on the chat interface. We're the Supabase + Vercel + n8n underneath — reachable via whichever AI you already use. The platform your AI builds on. websitepublisher.ai

Michael Egberts 2026-06-05 23:31 16 原文
AI 资讯 Reddit r/MachineLearning

I'm looking to join/form a team working on physical AI robotics challenge [P]

Hey all, I'm a robotics engineer by training turned ML/AI engineer because of passion right after school. I want to start combining these skills together and I think a competition is the best way of doing it. Here's an example of a challenge I'm talking about to set expectations : https://www.intrinsic.ai/events/ai-for-industry-challenge Anyone up for this? submitted by /u/Due_Pickle1627 [link] [留言]

/u/Due_Pickle1627 2026-06-05 23:31 8 原文
开发者 The Verge AI

New York lawmakers pass one-year ban on new data centers

The New York State legislature passed a one-year moratorium on new large data centers, the first statewide ban of its kind if Democratic Governor Kathy Hochul signs it into law. Lawmakers behind the bill say it's meant to give policymakers time to understand the impact of large data centers on the environment and energy prices. […]

Lauren Feiner 2026-06-05 23:25 15 原文
AI 资讯 HackerNews

Ask HN: What is your (AI) dev tech stack / workflow? (June 2026)

Hello, happy Friday! I am looking to do some in-person "developer boot-up" workshops, and seek your suggestions for "modern tooling". The background of the participants range from motivated newbie ("I heard you can make your own app with AI!") to existing software developers who want to get up to speed on modern development for the purposes of building stuff, and getting jobs where AI tools are being used. For those who have been doing software development & "tech" lately using AI tools, and fee

dv35z 2026-06-05 23:13 4 原文
开发者 Reddit r/artificial

Who are prominent people/groups opposing data centers?

I work on a podcast and we wanna do an episode where we have a proponent and opponent of data centers talk. We're looking for a good oppponent voice. Any names or organizations that are intelligent and well spoken and worth checking out? submitted by /u/BikeLaneHero [link] [留言]

/u/BikeLaneHero 2026-06-05 23:12 8 原文
AI 资讯 Reddit r/artificial

Feel like AI-generated 3D assets are changing what render challenges actually test

Hey guys. I saw a post on Instagram saying that tripo ai is holding a rendering challenge and the theme is “Out There”. This made me think about how AI-generated 3D models might change the rendering challenges. In a traditional rendering challenge most of the work focuses on modeling, resource creation, texture processing and scene setup. However with Tripo AI the process of generating 3D resources can become much faster. This made me think if the real challenges has shifted elsewhere. if everyone could generate models faster then what does the good rendering depend on? Art direction? Composition? Lighting? Camera position? storytelling? atmosphere? or clarity of idea communication? The rule of this challenge not only require to create objects with a beautiful appearance but also to create a scene that is larger, more profound, or more meaningful than what is actually before your eyes. I would really like to hear the opinions of those friends who are interested in AI-generated 3D. Do you think rendering challenge will be more dependent on technical ability or more focused on directionality and creativity? submitted by /u/babyb01 [link] [留言]

/u/babyb01 2026-06-05 23:03 8 原文