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

标签:#ev

找到 5184 篇相关文章

AI 资讯

Typing Vue 3 provide/inject Without Losing Autocomplete

Strict prop types and typed emits get most of the attention in Vue 3 + TypeScript setups, but provide / inject is where type safety quietly falls apart if you use the API the way the docs show it by default. inject() without a type hint returns unknown , which means every consumer of an injected value either casts it blindly or loses autocomplete entirely — and a typo in the injection key becomes a runtime undefined instead of a compile-time error. The Default Setup Is Untyped by Construction The naive version compiles, but gives you nothing: // Provider provide ( ' theme ' , currentTheme ); // Consumer const theme = inject ( ' theme ' ); // type: unknown Nothing here catches a typo in the key string, and nothing tells the consumer what shape theme actually has. Both problems come from using a plain string as the injection key. InjectionKey Fixes Both Problems at Once Vue exports an InjectionKey<T> type specifically for this. Define it once, typed, and both provide and inject become fully type-checked against the same symbol: // keys.ts import type { InjectionKey } from ' vue ' ; export interface Theme { mode : ' light ' | ' dark ' ; accentColor : string ; } export const ThemeKey : InjectionKey < Theme > = Symbol ( ' theme ' ); // Provider import { ThemeKey } from ' ./keys ' ; provide ( ThemeKey , { mode : ' dark ' , accentColor : ' #4f46e5 ' }); // Consumer import { ThemeKey } from ' ./keys ' ; const theme = inject ( ThemeKey ); // type: Theme | undefined The | undefined in that last type isn't a quirk — it's inject being honest that a consumer might render without a matching provider above it in the tree, which is a real runtime possibility TypeScript is right to force you to handle. Handling the undefined Case Without Littering ?. Everywhere The common mistake is providing a default value to silence the undefined type instead of actually checking for it: const theme = inject ( ThemeKey , { mode : ' light ' , accentColor : ' #000 ' }); // default masks missing pro

2026-08-07 原文 →
AI 资讯

Google Quietly Dropped 12 Free AI Tools. Developers Should Probably Care.

Hello, I'm Maneshwar. I'm building git-lrc, a Micro AI code reviewer that runs on every commit. It is free and source-available on Github. Star git-lrc to help devs discover the project. Do give it a try and share your feedback. A few years ago the AI conversation looked like this. "Should I pay $20?" "No, $200." "Actually this new tool is $39/month." My wallet started looking like it had gone through a startup funding winter. Then Google quietly walked into the room and started dropping free AI tools like Oprah handing out cars. "You get an AI IDE!" "You get a workflow builder!" "You get a GitHub coding agent!" ...except nobody really noticed because Google announced them across five different events, Labs pages, GitHub repos, and random blog posts. So I spent some time collecting the ones developers will actually find useful. No "AI that writes your wedding speech." No "AI that guesses your spirit animal." Just tools that can actually help you ship software. Bookmark this one. 1. Pomelli https://labs.google/pomelli If you've ever launched a side project, you already know the painful truth. Building the product is fun. Writing 37 LinkedIn posts explaining the product... not so much. Pomelli takes your website, understands what your product does, builds a brand profile, then generates social posts around it. Think of it as hiring an intern that actually reads your landing page before tweeting. Would I let it post automatically? No. Would I happily let it generate the first draft so I don't stare at a blinking cursor? Absolutely. Perfect for: Indie hackers SaaS founders Open-source maintainers pretending they enjoy marketing 2. Stitch https://stitch.withgoogle.com Remember when designing an app meant opening Figma... ...moving a button 3 pixels... ...asking for feedback... ...moving it back 3 pixels? Stitch skips a surprising amount of that. You describe the interface. Or upload a sketch. Or even paste a wireframe. It generates modern UI designs and can even produce

2026-08-07 原文 →
AI 资讯

I built a Markdown resume builder for the AI-paste workflow — here's everything that broke

There's a workflow that basically didn't exist three years ago and now half the job-seekers I know use it: ask ChatGPT, Claude, Gemini, or any AI to write your resume bullets, get back beautifully structured text… and then spend forty minutes mangling it into Word or a drag-and-drop resume builder, fixing bullet indentation and font sizes by hand. Here's the thing that bugged me: LLMs already speak Markdown. Ask any chatbot for a resume and you get ## Experience , **Senior Engineer** , - Shipped X — clean, structured Markdown. Then every resume tool on earth makes you throw that structure away and re-enter it into form fields. So I built ResumeMD: a split-pane editor where you paste Markdown on the left, see a typeset resume on the right, pick a template, and download a PDF. No signup to start, everything in localStorage by default. This post is about the parts that fought back. Decision 1: Markdown is the source of truth Most resume builders store your resume as a proprietary JSON blob mapped to form fields. I wanted the document itself to be portable text. That means the entire product is "just" a Markdown renderer with opinions: h2 = section headers (Experience, Education) — these get the decorative treatment per template: uppercase, border, background, prefix glyphs. h3 = job titles — plain, bold, primary color. One weird trick I'm genuinely fond of: the sidebar template splits a single Markdown document into main column and sidebar using an HTML comment ( <!-- sidebar --> ) as the split marker. Content above the marker is the main column; below is the sidebar. It keeps the document valid Markdown everywhere else. The preview is react-markdown + remark-gfm with a 300ms debounce, styled by a template system that turned out to need three parallel implementations of every template: CSS classes for the live preview, inline-style functions shared between preview and template cards, and pure-JS styles for the PDF renderer. Thirty-two templates, three layers each. When

2026-08-06 原文 →
AI 资讯

Building a Reliable AI Image Pipeline: Tasks, Failures, and Credit Refunds

Most AI image generators look like a prompt box with a Generate button. That is also how my first version started. But once real users entered the workflow, the difficult problems appeared somewhere else: browser refreshes, external task IDs, reference images, partial failures, credit refunds, private assets, and public artwork moderation. While building Magggic , I learned that an AI image generator is less like a form submission and more like a small distributed job system. This article covers the decisions that made that workflow more reliable. The code samples below are intentionally simplified. The important part is the shape of the workflow, not a specific database or image provider. The prompt box is only the beginning A synchronous prototype is easy to imagine: const images = await provider . generate ( prompt ); return images ; That version works until the request takes a minute, the provider times out, one of four requested images fails, or the user refreshes the page. The production workflow I needed looked more like this: Prompt + references ↓ Create a local queued task ↓ Charge credits with an idempotency key ↓ Submit work to the image provider ↓ Persist every completed output immediately ↓ Finalize the task and refund failed outputs ↓ Keep the result private until the user publishes it The provider request is only one step. The local task is the source of truth for what the user sees. 1. Persist the task before calling the provider The first important decision was to create a generation record before making the external API request. A generation stores the information needed to reconstruct the job: type Generation = { id : string ; userId : string ; idempotencyKey : string ; prompt : string ; referenceImages : string []; model : string ; ratio : string ; resolution : string ; count : number ; cost : number ; status : " queued " | " generating " | " completed " | " failed " ; outputs : string []; providerRequestIds : string []; failureReason : string |

2026-08-06 原文 →
AI 资讯

How to Turn Any Android Tablet into a Production-Grade Dev Rig in 5 Minutes. Published in #developer #android #terminal #productivity

If you've ever tried coding on an iPad, Galaxy Tab, or Chromebook, you know the frustration: Standard desktop tutorials assume a Mac or high-spec Linux laptop. Neovim configuration takes 4 hours of plugin debugging. Touch input on mobile terminals sucks without a dedicated extra-keys bar. I built DevDock (dock) to solve this permanently. What is DevDock? DevDock is a turnkey developer environment manager built specifically for mobile devices, Termux, Chromebooks, and low-spec hardware. Instead of fighting configuration files, one command installs a complete, high-performance terminal stack: bash curl -fsSL https://get.devdock.io | bash -s -- --profile=fullstack ⚡ Key Features Sub-5ms Terminal Rendering: Uses Starship prompt + Zsh lazy-loading tuned for ARM chips. Termux Touch Optimization: Automatically injects an ESC/TAB/CTRL touch bar and enables mouse scrolling in Tmux. Low-Memory Neovim: Starts in <50ms and uses under 50MB RAM while providing full Language Server Protocol (LSP) support for TS, Go, Python, and Rust. Curated Profiles: fullstack: Web + API tools frontend: React, TS, Vite & Tailwind preset backend: Go, Rust, Python, Postgres & Redis CLI tools devops: Kubectl, Helm, Terraform, and Cloud CLIs 🛠 Trying It Out bash Check your mobile terminal health: dock doctor View available developer stacks: dock profiles Initialize a frontend stack: dock init frontend 🔗 Open Source & Community DevDock is 100% open source under the MIT License! GitHub Repo: github.com/devdock/devdock Web Showcase: devdock.io Give it a spin on your Android phone, tablet, or cloud shell and let me know what you think in the comments below!

2026-08-06 原文 →
AI 资讯

I made stale coding-agent context fail CI instead of failing silently

A coding agent with no context usually hesitates, searches, or asks a question. A coding agent with stale context can be much more confident. That is the dangerous case. The file still exists. The instructions look deliberate. The generated JSON is valid. The agent follows it exactly — into a package that stopped owning the feature two weeks ago. Nothing looks broken until the edit is already in the wrong place. I wanted repository context to have an expiration signal that CI could verify, not a date someone had to remember to check. The failure is not missing documentation Imagine a monorepo where packages/auth owns token validation. The repository publishes a machine-readable handoff: { "startHere" : "docs/for-agents/packages/auth.md" , "editRoots" : [ "packages/auth" ], "checks" : [ "pnpm --filter @example/auth test" ] } Later, token validation moves to packages/security . A maintainer updates the source documentation but forgets to regenerate the handoff index. There are now two internally consistent answers in the same repository: the source documentation says packages/security ; the generated agent context still says packages/auth . The old answer is not malformed. That is precisely why it is risky. I reproduced the drift with one edit I tested this against the public fixture in Doc Bridge , using version 1.2.6. The first index and freshness check passed: Index is fresh expected: 359355e5... actual: 359355e5... Then I changed one agent-facing source document: - Package: packages/os-core - Layer: L1 + +Token validation now belongs to packages/security. I did not touch the generated index. The next check returned exit code 1: ak-docs gate run index-freshness Index is stale. Run: ak-docs index expected: b099695d... actual: 359355e5... After I ran ak-docs index , reviewed the generated change, and ran the gate again, both hashes matched and the check passed. The hashes are not trying to prove that the documentation is true. No checksum can do that. They prove a na

2026-08-06 原文 →
AI 资讯

Is Java still relevant today?

Being a Java Developer, I always thought about the programming language i'm working in, if it's the right one for all along the career ahead. I went through some web-based studies and, completely satisfied with the information I got to know. So, the short answer to the prime question is: Yes, Java is absolutely relevant and, here's why:- Still a Top Language Java has been in the top 3 programming languages worldwide for 2+ decades. Historical Dominance: The Backbone of Enterprise Systems: Since its inception, Java’s mantra of "Write Once, Run Anywhere" (WORA) revolutionized software development. It quickly became the foundation for global financial systems, insurance platforms, healthcare infrastructure, and e-commerce giants. Unrivaled Stability: Indexes like TIOBE and GitHub Octoverse have consistently ranked Java among the top most used languages for over 20 years. Companies do not shift their backend infrastructure on a whim; billions of dollars of existing, mission-critical infrastructure rely on the Java Virtual Machine (JVM). Enterprise Backbone Banks, insurance, e-commerce, and global-scale companies still rely heavily on Java. 95% of enterprise systems use it in some form. Banking and Financial Services (FinTech): Transactional Integrity: Mega-banks require high concurrency and absolute compliance with ACID (Atomicity, Consistency, Isolation, Durability) properties. Java's robust memory management and strict type safety prevent multi-threading errors that could result in catastrophic financial discrepancies. Legacy Settlement Layers: Systems managing global wire transfers, electronic clearing houses (ACH), and high-frequency trading platforms were built on the Java Virtual Machine (JVM) over the last 30 years. Rewriting these multibillion-dollar codebases carries massive operational risk with zero business incentive. Insurance Platforms: Complex Risk Modeling: Insurance giants process enormous volumes of historical actuarial tables and continuous risk data.

2026-08-06 原文 →
AI 资讯

Why Flaky Tests Are Rarely About the Test

We had a checkout test at my last job that everyone called "the coin flip." Green for a week, red twice on a Tuesday, green again. Someone eventually wrapped it in a retry and it sat like that for eight months before anyone looked at it again. Turned out the real bug was a webhook that occasionally fired before the order record finished writing to the DB - a two-hundred-millisecond gap that only showed up under load. The test wasn't broken. It was the only thing in the entire pipeline that noticed. That's usually the story. Someone blames the test - bad selector, missing wait, a sleep(2) some intern left in there three years ago, and half the time they're right. But when a test flakes repeatedly and nobody can explain why, the test is rarely the actual problem. It's just the part of the system rude enough to say something. A few places I keep finding the real cause hiding. Tests that quietly depend on each other Test A writes a row, Test B reads it and never knew it needed to. Run B by itself, it passes. Run the suite in a different order, or in parallel, and B fails for no reason anyone can point to. I've lost a full afternoon to this exact thing more than once - a cache value from Test 12 leaking into Test 47. The actual fix is annoying and unglamorous: every test gets its own fixtures, its own scoped data, no assumptions about what ran before it. If your suite only goes green in one specific order, you don't have a flaky test. You have an undocumented dependency graph, and it's going to bite someone eventually. The app is racing, not the test Click a button, immediately assert on the result - that's a bet that the UI update lands the instant the click handler returns. It usually does, on your machine, on a good day. Add a debounce, a background job, or just enough network latency and that bet stops paying off. This one's frustrating because the test isn't being paranoid. The app genuinely has a race condition. The test just runs the interaction often enough, acro

2026-08-06 原文 →
AI 资讯

Cybersecurity Meets Patient Safety: Building an ECG STRIDE Threat Model

* *The purpose of this light version threat model is to demonstrate how STRIDE can be applied to an ECG device. It is intended for readers learning system decomposition and threat modelling techniques. The example includes a simplified set of components, threats, and mitigations for educational purposes and is not intended to represent a comprehensive medical device cybersecurity assessment or any regulatory submission. **Assumption: This example models a typical ECG device, which may include network connectivity in a clinical environment. Trust Boundaries: Trust boundaries exist between the ECG device, hospital network, and external clinical systems. System Definition: ECG is the abbreviation for an Electrocardiogram. It is used to detect electrical activity of the heartbeat in the form of P wave, QRS complex and T wave to identify and diagnose irregularities in heartbeat. Electrodes are placed on patient’s limbs and chest to measure the electrical potentials. It translates tiny electrical signals into digital wave patterns. These waveforms are used by the doctors to evaluate the heart rhythm and check for cardiac damage. Components • Electrodes • Lead wires • Amplifier and filters • Analogue-to-Digital Converter (ADC) • Main processing unit • Display/printer • Local storage • Network interface (Ethernet/Wi-Fi/Bluetooth), if supported. Data Flow Diagram: Electrodes → Lead wires → Amplifier and filters → Analogue-to-Digital Converter (ADC) → Main processing unit → Display / Printer / Local storage / Network interface (if supported) |TRUST BOUNDARY|→ Electronic Health Record (EHR) / Clinical Information System 2. STRIDE Threats: Threats Description Spoofing in general ** - Spoofing is the act of impersonating a legitimate user, device, or system to gain unauthorized access to resources or services. Violates authentication. * Spoofing in ECG * - An attacker may impersonate an authorized clinician, connected medical device, or trusted clinical system to gain unauthoriz

2026-08-06 原文 →
AI 资讯

CSS Specificity Isn't Your Biggest Problem

Also available in Español The Problem A team ships clean CSS. Every selector is deliberate. Every class name means something. Code review catches the sloppy stuff before it merges. Six months later, someone adds !important to fix a button. A year later, three more !important s exist — each one written to fix the last one. Nobody planned this. Nobody stopped caring. The team is exactly as disciplined as it was on day one. The codebase didn't get sloppy. The architecture never had a way to stay clean. That's the part worth sitting with. Specificity problems get treated as a discipline failure — bad naming, careless nesting, someone in a hurry. But teams with excellent discipline hit this wall too. Given enough time and enough contributors, almost every CSS codebase drifts toward the same place: overrides stacked on overrides, each one a patch for the last. Something structural is happening here. Not a people problem. A tooling gap. Why the Problem Exists CSS specificity was built to answer one narrow question: if two rules target the same element, which one wins? The browser calculates an answer. Count the IDs. Count the classes and attributes. Count the elements. Higher count wins. If the count ties, whichever rule appears later in source order wins. That's the entire mechanism. It's fast, deterministic, and was never meant to do more than that. Notice what it doesn't ask. It doesn't ask whether a rule is a foundational default or a one-off exception. It doesn't ask whether a rule was written to be overridden, or written to never be touched again. It doesn't know the difference between a base style and a utility class — it only knows how many selectors each one used. Specificity resolves conflicts. It was never given a way to encode intent. That gap is old. It predates component-based frontend architecture, design systems, and teams of a hundred engineers touching the same stylesheet. The web platform gave developers a scoring system for which rule wins by the number

2026-08-06 原文 →
AI 资讯

Matching 90M+ music tracks across six platforms: ISRCs, fuzzy matching, and what breaks

I run a music metadata API as a solo developer. Under it sits a catalog of 90M+ recordings aggregated from six platforms: Spotify, Apple Music, Tidal, Beatport, Discogs, and MusicBrainz. The core job is cross-referencing: take whatever you know about a track (an ISRC, a platform ID, or a messy "artist + title" string from a DJ export) and resolve it to one canonical recording with everything else attached. When I started, I assumed this was mostly a plumbing problem. Every platform has an API, recordings have a standard identifier, join on it, done. Almost none of that survived contact with real data. This post is the parts I had to learn the hard way: why one song legitimately carries many ISRCs, how fuzzy matching on artist and title actually has to work, why recording-to-composition mapping is many-to-many in both directions, and the failure modes I now check for routinely. The ISRC almost solves it The ISRC (International Standard Recording Code) is a 12-character identifier for a specific recording. Daft Punk's "One More Time" is GBDUW0000053 : country prefix GB , registrant code DUW , year 00 , then a designation number. Every commercially released recording is supposed to have one, and most platforms expose it. So the naive architecture writes itself: one isrc column on the track table, join all six platforms on it, ship. That was my first schema, and it was wrong in a way that took a while to surface. Labels mint a fresh ISRC for every commercial variant of a recording. The radio edit gets one. The extended mix gets one. The 2001 release and the anniversary remaster get different ones. A reissue through a new distributor often gets one even when the audio is bit-identical. Regional releases sometimes get their own. None of this is an error; it is how the system is designed to work, because each of those is a distinct commercial product even when it is the same performance. The consequence: one canonical recording legitimately carries many ISRCs, and differen

2026-08-06 原文 →
开源项目

From Projects to Products: Turning Platforms into Products People Use

Having a platform is not enough; the real challenge is ensuring that it is understandable, usable, and actually adopted by its users. A capability is done when it can be reliably used by others. To evaluate progress, you can ask yourself “Is this being used?” and “Does it reduce friction for users?” This can help align development work with actual user value rather than delivery, By Ben Linders

2026-08-06 原文 →
开发者

Un dev loop tipo Vite para un lenguaje compilado: hot reload + preservación de state + manifest en vivo

Parte 13 de la serie Fitz . Se abre el capítulo del frontend: Fitz compila componentes .fitzv a WebAssembly, y este es el dev loop que hace que editarlos se sienta instantáneo — la misma experiencia "guardar y verlo" que te da Vite, sobre un lenguaje que compila a binario nativo. El setup: un lenguaje compilado con frontend Fitz es un lenguaje compilado — HTTP, async, Postgres, JWT viven en la sintaxis y emite un binario nativo vía Rust. La historia del frontend es un formato de componentes single-file, .fitzv (state + events + <template> , al estilo Vue/Svelte), que compila a WebAssembly : fitz build --bin web --target wasm-client # → target/wasm/web/{web.js, web_bg.wasm} Sin npm install , sin config de bundler, sin framework externo — el componente se vuelve un bundle WASM autocontenido (el demo del contador pesa 11.4 KB gzipped). Acá viene la objeción refleja: compilado = feedback lento . Editás, esperás una compilación entera, refrescás el browser a mano. Es lo opuesto a lo que un loop de frontend debería sentirse. Por eso Fitz tiene fitz dev . El loop Apuntá fitz dev a un bin wasm-client y deja de ser un compilador para ser un dev server: fitz dev # sirve en http://127.0.0.1:1234/ Qué hace: Rebuild incremental con wasm-pack --dev (sin wasm-opt ), reusando un crate estable así la cache de cargo queda caliente — el primer build compila las deps, cada save siguiente es de ~1-2 segundos . Un dev server que sirve el root de tu proyecto como python -m http.server : tu index.html , tu CSS, el bundle en target/wasm/<bin>/ . ¿Sin index.html ? Genera uno mínimo en el punto de mount . Auto-refresh del browser por WebSocket : guardás un .fitzv / .fitz / fitz.toml y la página se recarga sola. Sin F5 a mano. Guardás, y ~2 segundos después el browser muestra el cambio. En un lenguaje compilado. El detalle que importa: el state sobrevive el reload La mayoría de los hot-reload pierden tu estado en un reload completo — ibas tres clicks adentro de un contador, editás el template,

2026-08-06 原文 →