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

标签:#programming

找到 1663 篇相关文章

AI 资讯

AI Coding Tools Compared: Copilot vs Cursor vs Claude Code vs Gemini CLI

AI coding tools are no longer just autocomplete. In 2026, they are becoming coding assistants, terminal agents, code reviewers, and sometimes full workflow helpers. But the real question is: Which AI coding tool should developers actually use? Here is a short, practical comparison. Quick comparison Tool Best for Main strength Watch out for GitHub Copilot Daily coding inside IDE Fast autocomplete and GitHub workflow support Can feel limited for deep architecture work Cursor Full AI-first coding experience Great for editing across files and working inside a project You may rely on it too much without reviewing code Claude Code Terminal-based agentic coding Strong reasoning, repo understanding, and command execution Needs careful review before running changes Gemini CLI Open-source terminal AI agent Good for terminal workflows, debugging, and automation Output quality depends heavily on task clarity 1. GitHub Copilot GitHub Copilot is the safest default choice for most developers. It works well inside common IDEs and is useful for: Autocomplete Small functions Unit tests Refactoring Explaining code GitHub-based workflows GitHub also has Copilot coding agent support, which can work on assigned tasks, make code changes, and open pull requests from GitHub workflows. :contentReference[oaicite:0]{index=0} Use Copilot if: You want AI help without changing your full coding workflow. Best for: Junior to senior developers Teams already using GitHub Everyday coding productivity 2. Cursor Cursor is best when you want an AI-first editor experience. Instead of only helping with one line or one function, Cursor is useful when you want to ask questions about your whole project and make multi-file changes. Use Cursor if: You want your editor to feel like an AI coding workspace. Best for: Building features quickly Editing multiple files Understanding unfamiliar codebases Indie hackers and startup builders My honest take: Cursor is very productive, but developers should avoid blindly ac

2026-05-30 原文 →
AI 资讯

The Ghost in the Veltrix: Why Our Treasure Hunt Engine Was Sending Operators Down the Wrong Rabbit Hole

In November 2023 we ran our first global Hytale servers on Google Kubernetes Engine using Veltrix 3.2 as our configuration orchestrator. The Treasure Hunt Engine—a service that fans spawn to claim event loot—started crashing every time search volume exceeded 12 k RPM. Grafana showed a steady climb of 503 errors on /hunt/claim until the autoscaler maxed out at 32 G1 CPU cores and still couldnt keep up. Operators kept filing tickets that boiled down to one sentence: We click the map, nothing happens. We never saw the actual error because the ingress controller was swallowing it and returning a generic Too many requests. What we tried first (and why it failed) Our first move was to crank up the nginx-ingress-controller replicas from 3 to 12 and switch the load-balancer tier from GKE Standard to Premium. The 503 rate dropped to 8 k RPM, but now the p99 latency on claims spiked from 80 ms to 420 ms. The culprit was a recursive call in the hunt service: every claim required a round trip to the player-profile service to validate tier eligibility, and that service was on a shared Postgres 15.4 cluster with 3 k TPS of unrelated traffic. The error stack in Jaeger was literally tracing_id=7f3a1c8… server=profile-db pool_timeout . We tried adding connection pooling with PgBouncer, but the hunt service was using raw libpq and refused to reuse connections—no matter how many times we told it. The Architecture Decision We ripped the validation out of the synchronous path and made the hunt engine publish an event called HuntTierCheckRequired to a dedicated Kafka topic player-events-tier . The hunt service would respond to the client with a 202 Accepted immediately, then the loot-claim worker would listen to that topic and, if the tier passed, publish HuntLootReady . The worker ran in the same pod but on a separate goroutine with a 60-second TTL so we didnt leak memory if the tier service hung. We moved the player-profile service to an SSD-backed CloudSQL instance and gave it 32 GB R

2026-05-30 原文 →
AI 资讯

Quark's Outlines: Python User-defined Functions

Quark’s Outlines: Python User-Defined Functions Overview, Historical Timeline, Problems & Solutions An Overview of Python User-Defined Functions What is a Python user-defined function? You can define your own function in Python using the def keyword. A Python user-defined function is made when you write a def block in your code. When Python runs this block, it creates a function object. A function object has special parts. These include its name, its list of default values, and its code. It also keeps a link to the global names from the file where it was made. You can use this object to call the function later with any valid input. Python lets you create named function objects with the def keyword. def greet ( name = " friend " ): return " Hello, " + name print ( greet ()) print ( greet ( " Mike " )) # prints: # Hello, friend # Hello, Mike The function greet is now a user-defined function. Python stores its name, code, and default values for later use. What are the special parts of a Python function? A Python function holds many facts about itself. These are called attributes. For example, __name__ holds the function name. __defaults__ is a tuple of default values. __globals__ holds the global names it can see. __code__ is a special object that stores the function’s bytecode. Python functions store their details in special attributes. def square ( x = 2 ): return x * x print ( square . __name__ ) print ( square . __defaults__ ) print ( square . __code__ . co_varnames ) # prints: # square # (2,) # ('x',) These parts let Python understand and run your function later. A Historical Timeline of Python User-Defined Functions Where do Python’s user-defined functions come from? User-defined functions in Python build on ideas from earlier languages. They let you name blocks of code and reuse them. Over time, Python added new parts to function objects—like closures, default values, and metadata—to make them more powerful. People designed ways to name and reuse logic 1958 — Fu

2026-05-30 原文 →
AI 资讯

Why the Treasure Hunt Demo Broke Every Query Tool We Fed It

The Problem We Were Actually Solving We were not building a demo. We needed to let Veltrix operators run A/B experiments on synthetic user journeys without melting the underlying SQL warehouse. The real question was: how close could we push the warehouse to the AI inference layer before the planner started dropping predicates and the warehouse returned rows that made no sense for the user journey. The warehouse in question was a Snowflake XL on AWS, billed by the second. Our synthetic user model generated 250 k journeys per minute during peak. The AI layer had to annotate each journey with intent tags (shopping, support, fraud) within 200 ms to stay ahead of the next batch. That was the operating envelope, not the sales slide. What We Tried First (And Why It Failed) First cut: put the intent model in a sidecar container next to the Spark cluster that generated the journeys. We picked ONNX Runtime v1.14 with a DistilBERT fine-tuned on our own corpus because the latency slide said 30 ms. Reality: ONNX packaged the tokenizer as a separate DLL. Tokenization alone took 85–110 ms on c6i.large instances, pushing the total inference time to 190 ms when the warehouse was cold and 280 ms when Snowflake decided to spike the warehouse cluster. The operator dashboards immediately showed orange pings; the business called it a red fire drill. Worse, the tokenizer DLL leaked memory. After two hours on a 64-core cluster, each pods RSS climbed to 2.4 GB, and the Kubernetes scheduler evicted five pods in a row. The warehouse downstream received duplicate rows with NULL intents, so every metric we exported was off by 7–12 %. The Architecture Decision We ripped out the sidecar entirely. Instead, the Spark jobs write raw event JSON to an S3 bucket every 60 seconds. A Lambda function (Python 3.12 runtime) picks up the bucket, tokenizes offline, and stores the tokenized blobs back in S3. A nightly Kubernetes job then loads the tokenized chunks into Snowflake as temporary tables. The AI inf

2026-05-30 原文 →
AI 资讯

I Needed to Remove a QR Code from an Image, But Every Solution Was Complicated

A few weeks ago, I was updating some marketing assets for one of my projects. Everything looked good until I noticed a small problem. The image contained an old QR code. The QR code was pointing to an outdated page, and I needed to remove it before publishing the image again. My first thought was, "This should be easy." I opened a few image editing tools and quickly realized it wasn't as simple as I expected. Most solutions required installing software, learning editing techniques, or manually covering the QR code with another object. Some AI tools could do it, but they were either paid or required creating an account. For a task that should take a few seconds, I was spending far too much time. That's when I started wondering: "Why isn't there a simple tool that only removes QR codes?" The Problem With QR Codes QR codes are everywhere. They're on flyers, product images, posters, presentations, screenshots, and social media graphics. The problem is that QR codes don't always stay relevant. Businesses change landing pages. Campaigns expire. Links break. Sometimes you simply want to reuse an image without the QR code. Yet removing one often requires using software designed for professional designers. Building a Simpler Solution Instead of continuing to search for a solution, I decided to build one. The goal was simple: Upload an image Detect QR codes automatically Remove them Download the cleaned result No accounts. No complicated editing. No learning curve. Just a tool that solves one problem well. After several iterations, the result became the Remove QR Code tool on ConvertKR. What I Learned One thing I've learned from building developer tools is that users don't always need more features. Sometimes they just need fewer steps. The best tools are often the ones that remove friction from a small but frustrating task. Removing a QR code is not something people do every day. But when they need it, they want the process to be fast. Try It Yourself If you've ever found yo

2026-05-30 原文 →
AI 资讯

How to build a reusable Excel export service in ASP.NET Core

This article will teach you how to export any list into Excel in C# using the ClosedXML library. Steps to complete Create the data model with dummy data that we'll export into Excel. Create ExportExcel interface methods that accept any type of List (using IEnumerable<T> ) and a Dictionary List and export a byte array. Create extension methods and convert the provided data into rows and columns (using DataTable ). Create a service class that implements the interface methods and export the data table into a Memory Stream (byte array) using ClosedXML . Create one API endpoint that exports data in memory into Excel. Create another endpoint that exports incoming (custom) request data into Excel. Wire up dependencies. Project structure ├── Program.cs ← Project startup & dependency injection │ ├── controllers / │ └── ExportToExcelController.cs ← API entry point ├── services / │ ├── IExportToExcelService.cs ← Export Excel interface │ └── ExportToExcelService.cs ← Export Excel concrete class │ ├── models / │ ├── Car.cs ← Car class definition & dummy data │ ├── ExcelResponse.cs ← Wrapper class for excel file name and data │ └── ExportExcelRequest.cs ← Request class for that accepts any kind of list that will be exported │ └── extensions / └── IEnumerableExtensions.cs ← Extension methods for List<T> and List<Dictionary> 1️⃣ Data model I've created the dummy data model to demonstrate the dynamic implementation. public enum FuelType { Petrol, Diesel, Electric, Hybrid } public class Car { public Guid Id { get; set; } public string Name { get; set; } public string Manufacturer { get; set; } public int YearProduced { get; set; } public string Color { get; set; } public FuelType FuelType { get; set; } public int HorsePower { get; set; } public int NumberOfDoors { get; set; } public bool AutomaticTransmission { get; set; } public double AverageFuelConsumption { get; set; } public int MaxSpeed { get; set; } public decimal Price { get; set; } public static List<Car> GetCars() { ... } }

2026-05-30 原文 →
AI 资讯

You Accumulate Technical Debt When You Skip Code Review. Here's What You Accumulate When You Skip the Human.

You Accumulate Technical Debt When You Skip Code Review. Here's What You Accumulate When You Skip the Human. There's a concept in software engineering called Technical Debt. You skip the right abstraction, move fast, ship. Someday you pay it back in refactoring hours. I've been thinking about a different kind of debt. One that doesn't show up in your codebase. Human Debt: When you build with AI as your only collaborator, you remove the one thing that makes you feel obligated to show up. Not accountability in the corporate sense — the simpler thing. Someone is reading your work. You don't want to waste their time. That's not a productivity hack. It's closer to a structural property of how humans behave when observed. The Research Didn't Start With AI In 2015, Gail Matthews ran a study on 267 professionals tracking goal completion. One group wrote their goals. Another group wrote their goals and sent weekly progress reports to a real person. The second group completed 76% more of their goals . Not 10% more. Not "statistically significant at p<0.05." Seventy-six percent. The mechanism is what Gouldner called reciprocity norm in 1960 (doi: 10.2307/2092623): when someone gives you their attention, you owe them something back. Not contractually. Biologically. You don't want to disappoint someone who showed up for you. Harkin et al. confirmed this across 138 studies, 19,951 participants — the effect holds across cultures, domains, and formats. None of this was discovered because of AI. It was hiding in plain sight for 65 years. AI Has No Concept of Day 14 Here's what changed. For most of the history of side projects, your "collaborator" was a rubber duck or Stack Overflow. Those tools don't simulate accountability. Nobody was surprised. Then came AI pair programming. Which is genuinely useful. But it introduced a specific failure mode: you now have a collaborator that responds, scaffolds, and generates — but doesn't notice when you stopped. AI has no concept of Day 14. It

2026-05-30 原文 →
AI 资讯

Anthropic Just Dropped Claude Opus 4.8: What It Means for Developers 🚀

Anthropic just announced Claude Opus 4.8 , a major upgrade to their flagship AI model. If you use AI tools to help you write, debug, or architect software, this release has some huge updates that will change your daily workflow. The best part? It is available right now for the exact same price as Opus 4.7. Here is a quick, no-nonsense breakdown of what is new and why you should care. 1. Smarter Coding and "4x Better Honesty" We have all been there: an LLM confidently hands you a block of code, claiming it’s perfect, only for you to find out it breaks completely. Anthropic spent a lot of time fixing this "false confidence" problem. According to their internal testing, Opus 4.8 is four times less likely to let bugs or flaws in its written code pass by unremarked. It has better judgment, meaning it will actually question a bad plan, catch its own mistakes before showing them to you, and admit when it is uncertain about an edge case. 2. Parallel Coding with "Dynamic Workflows" Available in research preview for Claude Code (Enterprise, Team, and Max plans), Dynamic Workflows allows Claude to break a massive programming task down into smaller pieces. Instead of tackling a codebase line-by-line, it can spin up and run hundreds of parallel subagents at the same time to solve large problems. Anthropic notes that it can manage codebase-scale migrations across hundreds of thousands of lines of code from start to merge, verifying everything against your existing test suites. 3. New "Effort Control" Slider You can now manually choose how much processing power Claude puts into a task on Claude.ai and Cowork: High Effort: Claude thinks longer, reasons deeper, and double-checks its work. Best for complex architecture, tricky debugging, or heavy logic. Low Effort: Claude replies much faster and conserves your token rate limits. Best for quick syntax checks, simple explanations, or boilerplate code. 4. Developer API Upgrades If you are building products on top of Claude's API, Amazon

2026-05-30 原文 →
AI 资讯

How I Built CoralSec Copilot: A Unified Enterprise SOC with Coral & Next.js in 4 Days

The tech industry is currently in a frenzy. Everyone is rushing to build the next big AI application, slapping a chatbot interface onto a database and calling it a day. But in this gold rush, we are leaving something critical behind: Enterprise Security. Living in a Kali Linux environment and spending time hunting vulnerabilities teaches you one fundamental truth: security is entirely about context. Hardcoded API keys, undocumented access escalations, and compliance blind spots remain the number one cause of major data breaches. Security teams don’t just need a chatbot that can answer questions; they need a single pane of glass. They need a Security Operations Center (SOC). For the Pirates of the Coral-Bean Hackathon (hosted by Coral and WeMakeDevs), I decided to tackle this massive industry problem. Over the course of 4 sleepless nights, I built CoralSec Copilot—an AI-powered, unified Enterprise SOC platform. Here is the complete Captain's Log of my entire journey, the architecture, the roadblocks, and a reproducible guide so you can build and run it yourself. Day 1: The Brainstorm, Grok, and Cursor AI When the hackathon was announced, my initial thought was basic: "I'll build a CLI agent that scans code." I fired up my IDE, opened Cursor, and started bouncing ideas around. I even looked into some AI models like Grok to understand how they process vast amounts of real-time data. But while brainstorming the architecture, I hit a wall. Scanning a GitHub commit for a leaked AWS key is great, but what if the AI also knew whether the developer who pushed that commit had recently escalated their admin privileges? What if it knew the exact SOC2 compliance policy from our company’s Notion workspace? To do this traditionally, I would have to write dozens of messy REST API integrations. I'd have to handle rate limits, write custom Python scripts for GitHub, another set for Slack, another for Notion, and then build fragile ETL (Extract, Transform, Load) pipelines to bring all

2026-05-30 原文 →
AI 资讯

OpenAI Codex vs Google Antigravity: Architecture, Workflow, and Key Differences

AI coding tools are no longer just autocomplete engines. For the last few years, developers used AI mainly to write faster: generate a function, explain an error, complete boilerplate, or suggest a code snippet. That was useful, but the human developer still controlled almost every step. Now the shift is toward agentic software development. Tools like OpenAI Codex and Google Antigravity are not only helping developers write code. They are starting to inspect repositories, understand tasks, edit files, run commands, verify outputs, and return work for human review. But Codex and Antigravity are not the same kind of product. They represent two different architectures for the future of software development. Codex: Delegated Engineering Agent OpenAI Codex is best understood as a delegated software engineering agent. The developer gives it a scoped task: fix a bug, review a pull request, write tests, refactor a module, or implement a defined feature. Codex then works through the codebase, makes changes, runs checks where possible, and returns a result that the developer can review. Its natural workflow is close to how software teams already work: Task → Repository Context → Code Changes → Tests/Checks → Pull Request or Reviewable Output This makes Codex useful for structured engineering work. It fits naturally into GitHub-style workflows, pull requests, code reviews, tests, and CI/CD practices. In simple terms, Codex feels like assigning work to an AI engineer. Antigravity: Agent-Orchestration Environment Google Antigravity takes a different approach. It is better understood as an agent-first development environment. Instead of focusing only on one delegated task, Antigravity is designed around supervising agents inside the development workspace. Agents can operate across the editor, terminal, browser, and artifacts. They can help plan, build, verify, and explain the work. Its workflow looks more like this: Goal → Agent Orchestration → Workspace Execution → Browser Verif

2026-05-30 原文 →
AI 资讯

Tauri Sandbox Permissions — Why Your Command Silently Does Nothing

All tests run on an 8-year-old MacBook Air. All results from shipping 7 Mac apps as a solo developer. No sponsored opinion. The most common Tauri v2 frustration: you write a command, invoke it from the frontend, and nothing happens. No error. No crash. Just silence. It's almost always permissions. How Tauri v2 permissions work Tauri v2 introduced a capability system. Every plugin action — reading files, executing shell commands, sending notifications — requires an explicit permission declaration in your config. Without the permission, the plugin call fails silently on the frontend. The Rust code never runs. // src-tauri/capabilities/main.json { "identifier" : "main-capability" , "description" : "Permissions for main window" , "windows" : [ "main" ], "permissions" : [ "core:default" , "fs:read-all" , "fs:write-all" , "shell:allow-execute" , "opener:allow-open" , "global-shortcut:allow-register" , "global-shortcut:allow-unregister" ] } Note: As of Tauri v2.1, shell:allow-open is deprecated. Use tauri-plugin-opener and opener:allow-open instead. The debugging flow When a command does nothing: Open DevTools ( Cmd+Option+I in dev mode) — check the console for a rejected Promise or permission error Check your terminal output — the Rust side logs errors directly in the tauri dev terminal; look for lines like [tauri] permission denied or not allowed Enable verbose logging — set RUST_LOG=tauri=debug before running tauri dev for more detailed backend output Check your capabilities file — missing or misspelled permission identifiers are the #1 cause Permission errors in the console typically look like a rejected Promise with a message such as plugin:shell|execute not allowed . The capabilities file is always the first thing to check. Common permissions you'll need "permissions" : [ "core:default" , "fs:read-all" , // read any file "fs:write-all" , // write any file { "identifier" : "shell:allow-execute" , "allow" : [{ "name" : "my-cmd" , "cmd" : "adb" , "args" : true }] }, "op

2026-05-30 原文 →
AI 资讯

Rust Was Not the Silver Bullet I Expected for Our Treasure Hunt Engine

The Problem We Were Actually Solving I still remember the day our treasure hunt engine started to show its weaknesses. We had been using a custom-built solution written in Java, and it had served us well until our user base grew exponentially. The engine, which relied heavily on recursive searches and dynamic memory allocation, began to cause performance issues and occasional crashes. Our team was under pressure to find a solution that would allow our server to scale without sacrificing the user experience. After some research, I became convinced that Rust was the answer to our problems. Its focus on memory safety and performance seemed like the perfect fit for our needs. What We Tried First (And Why It Failed) Our first attempt at solving the problem was to simply translate our Java code into Rust. We thought that the language's built-in features would automatically solve our performance and memory issues. However, we quickly realized that this approach was not going to work. The Rust compiler was complaining about lifetime issues and borrow checker errors, which we did not fully understand at the time. We spent weeks trying to fix these issues, but our code was still not stable. I recall one particularly frustrating error message from the Rust compiler: error: cannot borrow self.list as mutable because it is also borrowed as immutable. It was then that I realized we needed to take a step back and rethink our approach. The Architecture Decision We decided to start from scratch and redesign our treasure hunt engine with Rust's strengths in mind. We chose to use a graph-based data structure, which allowed us to take advantage of Rust's ownership model and avoid common pitfalls like null pointer dereferences. We also made use of the crossbeam crate for parallelism and the tokio crate for async I/O. This new design required us to think differently about our problem domain, but it ultimately led to a more efficient and scalable solution. I was impressed by the level of

2026-05-30 原文 →
AI 资讯

AI Code Drift in the Wild: A Scarab Diagnostic Repair Pass

Scarab Field Test: Repairing an AI-Generated App Without Guessing Its Intended Baseline I’ve been building Scarab Diagnostic Suite around a problem I keep seeing in AI-assisted development: the app may look close, the code may be mostly there, and some checks may even pass — but the repo still isn’t in a trustworthy state. So I tested Scarab against a public GitHub repo that was explicitly asking for help with an AI-generated web app. The app had been created through a generated/vibe-coded workflow and the owner was looking for help cleaning it up, fixing broken behavior, and making it more stable. The interesting part wasn’t just “can the code be fixed?” The interesting part was: what does fixed mean for this repo? Scarab’s repair pass surfaced that there were actually two valid repair postures: TypeScript intended — treat npm run typecheck as a real acceptance gate. Build/lint only — treat the app as a generated JavaScript React export, where build + lint are the intended acceptance boundary. That distinction matters because a diagnostic suite should not blindly impose a standard the repo never chose. Sometimes the repair is not just technical. Sometimes the repair is clarifying the repo’s actual operating baseline. Both repaired versions now: build successfully lint successfully run locally in the browser render the app correctly include saved runtime evidence/screenshots pass browser smoke checks across key routes One of the more useful findings was that static checks were not enough. A governance/static pass could look clean while the browser runtime still revealed real problems: stray generated stub text, React not mounting meaningful app content, and missing local Base44 helper behavior outside the hosted runtime. That is exactly the kind of failure I’m interested in. Not just “does the code pass a command?” But: does the app actually render? does the local runtime behave? did the repair preserve the app’s intent? did the repo become more coherent afterward?

2026-05-30 原文 →
AI 资讯

fd vs find vs ripgrep: I Created 10,000 Files to Settle This Debate

fd vs find vs ripgrep: I Created 10,000 Files to Settle This Debate TL;DR: fd is ~2.5x faster than find for filename searches, rg demolishes grep by ~3x for content searches, and find + grep combined lose on every single benchmark I ran. But there's a catch: both fd and rg skip hidden files by default, which can bite you if you're not paying attention. Here are the receipts. Why I Did This Every time someone posts a shell one-liner using find on Reddit, there's always that guy in the comments: "jUsT uSe fD, iT's fAsTeR." Then someone else chimes in with "actually ripgrep can do that too." I got tired of the anecdotes. I wanted numbers. Real ones. On real files. So I fired up WSL, generated 10,900 files across 1,506 directories (~143 MB of mixed content), and ran actual benchmarks with hyperfine . No synthetic microbenchmarks, no "I feel like X is faster" — just cold, hard terminal output. Methodology The Test Bed I created a directory at /tmp/fd-benchmark containing: Category Count Details Plain text files 2,000 file_*.txt — 20 bytes each, contains "test content line N" Binary files 2,000 data_*.bin — 15 bytes each Log files 1,500 match_*.log — contains unique "match_this_test_N" strings Config files 1,000 nested_file_*.cfg Nested dir files 1,000 level1_*/level2/level3/deep_*.txt + level1_*/shallow_*.txt Hidden root files 1,500 .hidden_* + .config_*.yml Hidden dir files 500 .hidden_dir/subdir/deep_hidden_*.txt Git objects 500 .git/objects/obj_* Multi-ext source files 800 src_*.{py,js,ts,rs,go,java,rb,php,cpp,h,css,html,json,xml,yaml,md} (50 each) Large binary files 100 large_*.dat — 1 MB each (random data) Total 10,900 $ du -sh . 143M . $ find . -type f | wc -l 10900 $ find . -type d | wc -l 1506 Tools Tested Tool Version What It Does find (GNU) 4.9.0 The OG. Ships with every Linux distro. fd 10.2.0 Rust-based find alternative. Smarter defaults, colored output. grep (GNU) 3.11 Content search. Also the OG. rg (ripgrep) 15.1.0 Rust-based grep alternative. Respects .gi

2026-05-30 原文 →