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

标签:#t

找到 19975 篇相关文章

AI 资讯

The Biggest Problem With AI-Generated Code Isn't Bad Code. It's Unfamiliar Code.

A developer opens a pull request. The feature works. The tests are green. The implementation looks reasonably clean. Then they realize the PR changes 17 files for what should have been a relatively small feature. There is a new abstraction nobody on the team has seen before. A dependency has been added for functionality the project already had. Two similar utilities now exist in different parts of the codebase. The tests are extensive, but nobody is completely sure what assumptions they are actually testing. And the author didn't write most of it manually. AI did. This is one of the less obvious problems created by AI coding tools. The problem isn't necessarily that AI generates bad code. Sometimes it generates perfectly valid code. The problem is that it can generate code faster than a team can develop an understanding of it. That changes the bottleneck in software engineering. The Cost of Writing Code Has Changed For a long time, engineering teams were constrained by how quickly developers could implement things. A developer had to understand the requirement, design the solution, write the code, debug it, and test it. AI changes the economics of that process. A developer can now describe a feature, generate an implementation, ask for tests, refactor it, and generate supporting code in a fraction of the time it might previously have taken. That's useful. But the amount of code entering the system can increase faster than the team's ability to review and understand it. Consider a simple feature that requires modifying four files. An AI coding assistant might produce a solution that touches twelve. It may introduce a service layer, a helper abstraction, a configuration object, several interfaces, and a new package. None of these things are necessarily incorrect. But every additional abstraction creates another thing a future developer has to understand. This is where code familiarity becomes an engineering concern. Working Code Isn't the Same as Understandable Code A

2026-09-04 原文 →
AI 资讯

Refactoring Safely: A Step-by-Step Guide

Refactoring Safely: A Step-by-Step Guide We all know that feeling: a function that's 200 lines long, a class that does too many things, or a variable named data2 . Refactoring is the cure, but doing it recklessly can break your app and your confidence. Here's how I approach refactoring safely, step by step. 1. Start with a Safety Net Before touching any code, make sure you have tests. If your project lacks tests, write a few key ones first. Focus on the behavior you're about to change. The goal is to have a safety net that tells you when you've broken something. # example test for a function we'll refactor import unittest from mymodule import calculate_total class TestCalculateTotal ( unittest . TestCase ): def test_with_discount ( self ): self . assertEqual ( calculate_total ( 100 , discount = 0.1 ), 90 ) If tests aren't feasible, at least have a manual checklist. But automated tests are worth the effort. 2. Make Small, Atomic Changes Don't try to refactor everything at once. Pick one logical change. For instance, extract a method or rename a variable. Each change should be small enough that if it breaks, you know exactly what caused it. // before function processOrder ( order ) { const total = order . items . reduce (( sum , item ) => sum + item . price , 0 ); const tax = total * 0.08 ; const final = total + tax ; return final ; } // after step 1: extract tax calculation function processOrder ( order ) { const total = order . items . reduce (( sum , item ) => sum + item . price , 0 ); const final = total + calculateTax ( total ); return final ; } function calculateTax ( amount ) { return amount * 0.08 ; } Run your tests after each tiny step. If they pass, move on. If they fail, you know the last change caused it. 3. Use Your IDE's Refactoring Tools Modern IDEs can rename variables, extract methods, and change signatures safely. They update all references automatically. This reduces human error. For example, in VS Code, right-click a function and choose "Extract to

2026-09-04 原文 →
AI 资讯

I Wanted "agy ." for Google Antigravity on WSL2 — So I Built "wagy"

I use WSL2 as my main development environment on Windows. My projects live in Linux: /home/user/Projects/... Node.js, pnpm, Git, Docker, and the rest of my toolchain also run inside WSL. When I started using Google Antigravity IDE, I wanted the same workflow I already had with VS Code: code . Something like: agy . That would have been the obvious command. But agy is already the official Antigravity CLI, so reusing it as a launcher for the Windows IDE would be confusing. So I needed another name. I ended up with: wagy . You can read it as WSL + agy or Windows + agy — both actually describe what it does pretty well. The goal was simple: WSL2 └── ~/Projects/my-project │ │ wagy . ▼ Antigravity IDE on Windows │ └── Remote WSL └── /home/user/Projects/my-project I wanted to launch the Windows Antigravity IDE directly from my WSL terminal, while keeping the project, terminal, and development toolchain inside WSL. Not opening the project through \\wsl.localhost . Not moving the project to C:\ . And ideally, not patching Antigravity every time it gets updated. After a bit of digging, the solution turned out to be quite small. The setup This was tested with: Antigravity IDE 1.107.0 Windows 11 WSL2 Ubuntu zsh Antigravity was installed on Windows under: C:\Users\<user>\AppData\Local\Programs\Antigravity IDE From WSL, that becomes: /mnt/c/Users/<user>/AppData/Local/Programs/Antigravity IDE The missing piece: --remote Antigravity IDE already supports remote targets. From WSL, this works: "/mnt/c/Users/<user>/AppData/Local/Programs/Antigravity IDE/Antigravity IDE.exe" \ --remote "wsl+ $WSL_DISTRO_NAME " \ " $( pwd ) " That was the missing piece. It launches the Windows Antigravity IDE while opening the project through the current WSL distribution. So instead of opening: \\wsl.localhost\Ubuntu\home\user\Projects\my-project the IDE works with the actual WSL environment: /home/user/Projects/my-project This means the integrated terminal can keep using the Linux toolchain: node pnpm git

2026-09-04 原文 →
开源项目

This ultra-thin Lenovo laptop concept uses solid-state cooling

Lenovo is announcing a new concept laptop for IFA 2026 that uses solid-state cooling instead of traditional fans, making it incredibly thin and super light. The 14-inch Project AeroBlade concept laptop is less than 10mm thick and weighs under 1.8 pounds / 830g. For reference, recent ThinkPad X1 Carbons are around 14mm at their thickest […]

2026-09-04 原文 →
AI 资讯

The Moto Watch Ultra is a return to Wear OS

Just a few months after getting back into the smartwatch game, Motorola is targeting the premium end of the market with the first Moto Watch Ultra. It comes with some upgrades from the recent Moto Watch - most obviously the jump to Wear OS - but lacks the outdoorsy features that would make it a […]

2026-09-04 原文 →
开发者

I held the first truly bezel-free phone

Cast your mind back a decade or so, and smartphone makers were obsessed with shrinking the bezel on phones. Screens got bigger, the black bars around them got smaller, and for a while it looked like truly edge-to-edge displays were imminent. Then, progress just stopped. The bezel shrunk down until it was a millimeter or […]

2026-09-04 原文 →
AI 资讯

I Tested Whether cdkd Really Deploys Faster Than cdk deploy

A tool claiming "up to 15x faster than cdk deploy" showed up in my feed a while back. Drop-in replacement, it said: keep your CDK app exactly as it is, just swap cdk deploy for cdkd deploy . I've learned to be skeptical of "Nx faster" claims. So I actually deployed something real to AWS with both tools and timed it. Short version: it really is that fast. What cdkd actually is cdkd deploys an existing AWS CDK app without going through CloudFormation. It calls the AWS SDK directly instead. It's built by go-to-k (Kenta Goto), an AWS DevTools Hero and CDK top contributor who also maintains cls3 (a fast S3 bucket emptier) and delstack (for cleaning up stuck CloudFormation/CDK stacks) — tools that quietly fix the annoying parts of working with AWS. cdkd feels like the biggest one yet, and I mean that as a compliment grounded in actually using it, not a throwaway one. The mechanism is straightforward. cdkd runs the exact same CDK synth step as the CDK CLI, producing the same CloudFormation template. What changes is everything after that: instead of handing the template to CloudFormation, cdkd's own engine reads the resource dependency graph ( Ref , Fn::GetAtt ), builds a DAG, and fires AWS SDK / Cloud Control API calls directly, in parallel, as soon as each resource's dependencies are satisfied. Worth saying up front: cdkd calls itself not production-ready, dev/test only. This isn't a "replace CloudFormation in prod" pitch. I actually ran both, on real AWS cdkd's own README backs up the 15x number with a VPC + Lambda + SQS + CloudFront benchmark. So I wrote that same stack as a CDK app and deployed it twice — DeployRaceCfn via cdk deploy , DeployRaceCdkd via cdkd deploy — to the same AWS account, same region (ap-northeast-1). The stack: VPC (2 AZ + NAT Gateway) with a Lambda inside it, fronted by a Function URL CloudFront, origin set to that Function URL SQS + EventSourceMapping + a consumer Lambda First attempt failed. The account had hit its VPC limit (five, the default)

2026-09-03 原文 →
AI 资讯

Write a Blast-Radius File Before Your First AI Patch

Your first AI patch should fail closed today. Do not ship a feature on day one. Prove one target file can revert cleanly now. You joined a messy repo this morning. The assistant wants a wide rewrite. Your job is a tiny reversible cut only. This drill gives you a blast-radius file first. You fill it before any model writes code. Then a short script checks the revert path. Why day-one AI diffs explode Cheap code is not cheap to unwind. One extra import can touch auth. One extra migration can lock deploys. You will not know the architecture yet. You also should not pretend otherwise. A blast-radius file makes unknowns explicit fast. If the file cannot name a revert, stop. You do not prompt for more code. You shrink the change until revert is boring. What you will build today You will add two artifacts on your branch. Keep both files in the first PR. blast_radius.py — the contract for this change. scripts/check_blast_radius.py — the fail-closed proof. The contract is the source of truth. The checker is the only merge gate. No green checker means no review yet. Step 1: Freeze one target file Pick one production file you can read. Do not pick a whole folder. Do not pick generated vendor code. git ls-files '*.py' '*.ts' '*.go' | head -n 40 TARGET = src/billing/invoice.py wc -l " $TARGET " git log -n 5 --oneline -- " $TARGET " Read the last five commits on that file. Write two plain sentences in notes. Pick a smaller file if you cannot yet. You now have a hard fence. Everything outside that fence is forbidden. Your assistant may not cross it. Step 2: Write the blast-radius contract Create blast_radius.py at the repo root. Keep the dict small. Fill every field with your own hands. # blast_radius.py # Day-one contract. Humans edit this. Models do not. BLAST = { " change_id " : " day-one-001 " , " intent " : " Add a fail-closed guard on invoice totals. " , " target_files " : [ " src/billing/invoice.py " , " tests/billing/test_invoice_flag_off.py " , " blast_radius.py " , " scr

2026-09-03 原文 →
AI 资讯

FSCSS Component Architecture: A Modular, Composition-First Approach to CSS

FSCSS component architecture is built around a modular, composition-first model that compiles to plain CSS. It emphasizes reusable style units, design tokens, conditional logic, and selective imports—with almost no runtime JavaScript required for the final output. Components in FSCSS are treated as pure style definitions rather than framework-specific widgets, keeping stylesheets readable, highly reusable, and free of classic “mega-stylesheet” problems while still producing standard CSS that any browser understands. Core Building Blocks FSCSS provides a focused set of primitives for defining and composing styles: Primitive Purpose Best for Introduced / Key version str(name, "…") Named blocks of CSS declarations Simple reusable style snippets Core @fun(name){…} Key-value stores (design tokens) Spacing scales, color palettes, property groups Core @define name(params) Parameterized mixins Themed components, variants, full structures 1.1.15+ pattern(threshold: "desc", "…") Semantic / fuzzy matching Natural-language style injection 1.1.25+ @event name(param) Conditional value functions Themes, states, calculations Core @arr(name[…]) Arrays + iteration Generated classes, loops, scales Core @import Selective / wildcard module loading Modular architecture & ecosystem modules Core How Components Are Structured 1. Atomic / Token Layer ( @fun + variables) Design tokens sit at the foundation so every component draws from a single source of truth: @fun(tokens) { primary: #2563eb; radius-md: 8px; space-4: 1rem; shadow-sm: 0 1px 3px rgba(0,0,0,.1); } 2. Base Style Blocks ( str() or @fun full-block) Related declarations are grouped into reusable blocks that can be dropped into any selector: str(card-base, " padding: @fun.tokens.space-4.value; border-radius: @fun.tokens.radius-md.value; box-shadow: @fun.tokens.shadow-sm.value; background: white; ") 3. Parameterized Components ( @define ) True mixins accept arguments and can be composed freely: @define button(bg: #2563eb, fg: white,

2026-09-03 原文 →
AI 资讯

Don't Merge on Green: A Fixture Contract, a Pre-Push Hook, and a Merge Packet

A green required check is not a merge decision. It is a signal that one job graph finished without a red X. If a pre-push hook was skipped, or a snapshot fixture was regenerated without a reason, you can still ship a lie. This article walks through a merge packet: a small JSON artifact your CI publishes next to the check. The packet records hook results, fixture drift, and required-job status. A model may write the eight-line brief. It does not get a vote. Why green still lies CI dashboards collapse many facts into one glyph. You see green. You click merge. You miss three common failures. First, someone pushed with --no-verify and skipped the hook that keeps fixture hashes honest. Second, a test helper rewrote golden files because a serializer added a field. Third, a retry job went green on the second attempt and nobody recorded that the first attempt failed. You do not need a platform rewrite to catch this. You need a contract the merge button cannot ignore. Cheap code generation makes the second failure more common. When it is easy to regenerate tests, it is easy to regenerate the fixtures those tests pin. The pin becomes a moving target. Treat unexplained fixture diffs as merge blockers, the same way you treat a failed unit job. What the merge packet contains Keep the packet boring. One file. One schema. Commit it as a CI artifact, not as a comment that can be edited after the fact. { "commit" : "REPLACE_WITH_SHA" , "generated_at" : "2026-09-03T00:00:00Z" , "hooks" : { "pre_push_fixture_guard" : "passed" }, "fixtures" : { "manifest_path" : "tests/fixtures.sha256" , "changed_paths" : [], "unexplained_paths" : [] }, "required_jobs" : [ { "name" : "unit" , "conclusion" : "success" }, { "name" : "contract" , "conclusion" : "success" } ], "merge_ready" : false , "brief" : null } merge_ready is computed by a script you own. Not by a prompt. The brief is optional prose for humans who will not open the JSON. Step 1: Pin fixtures with a manifest Pick a directory you alrea

2026-09-03 原文 →
AI 资讯

I Built a Full IT Ticket System in Power Apps — Here's the SLA Engine That Runs Without Power Automate

I recently built a complete IT ticket management system in Power Apps — 9 screens, role-based access, live SLA tracking, and automatic email notifications. The part I want to actually talk about here isn't the UI, it's the SLA engine, because I built it to work without Power Automate , and the trick is simpler than it looks. The problem SLA tracking normally means: a ticket is "Critical" → 60 minute target → somebody needs to know if it's about to breach or already has. The obvious way to do this is a scheduled Power Automate flow that checks every ticket on a timer and flags the ones in trouble. I wanted this app to run on Power Apps collections only — no flow, no external data source — so a scheduled flow wasn't an option. The question was: can you get "live" SLA status without a background job? The trick: recalculate on every read, not on a timer Instead of a flow updating a SLAStatus field periodically, I recalculate it every time the app or a screen is opened, using Now() against the stored due date: \ UpdateIf( colTickets, Status <> "Resolved" && Status <> "Closed", { SLAStatus: If( Now() > DueDate, "Breached", DateDiff(Now(), DueDate, TimeUnit.Minutes) <= SLAMinutes * 0.2, "At Risk", "On Track" ) } ); UpdateIf(colTickets, Status = "Resolved" || Status = "Closed", {SLAStatus: "Met"}) \ \ This runs in App.OnStart , at the top of every screen's OnVisible , and behind a manual "Refresh SLA" button. The At Risk threshold is 20% of the SLA window remaining — so a Critical ticket (60 min target) goes At Risk with 12 minutes left; a Low ticket (1440 min / 24 hrs) goes At Risk with 4.8 hours left. The honest tradeoff: this only updates when someone has the app open. A ticket breaching at 2am with nobody looking won't trigger anything until the next visit. For a real production deployment I'd pair this with a scheduled flow for after-hours detection — but for a demo, an internal tool with regular traffic, or anything where "eventually consistent within the next visit"

2026-09-03 原文 →