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

AI 资讯

AI人工智能最新资讯、模型发布、研究进展

15425
篇文章

共 15425 篇 · 第 561/772 页

Dev.to

7 Things I Wish I Knew Before Scaling Next.js + Supabase to 100K Users

7 Things I Wish I Knew Before Scaling Next.js + Supabase to 100K Users Six months ago, we launched our SaaS with Next.js and Supabase. The stack was perfect for our MVP: fast development, great DX, and it just worked. Then we hit 10K users. Then 50K. Then 100K. Everything that worked beautifully at small scale started breaking. Database queries that took 50ms now took 5 seconds. Our Supabase bill went from $25/month to $800/month. Users complained about slow page loads. Here's what I wish someone had told me before we started. 1. RLS Policies Are Not Optional (Even in Development) We skipped RLS in development. "We'll add it before launch," we said. Launch day came. We enabled RLS on all tables. The app broke in 47 different places. Queries that worked suddenly returned empty arrays. Inserts failed with permission errors. We spent 12 hours fixing RLS policies while users waited. What I'd do differently: Enable RLS from day one. Write policies as you create tables: CREATE TABLE posts ( id UUID PRIMARY KEY DEFAULT uuid_generate_v4 (), title TEXT NOT NULL , user_id UUID REFERENCES auth . users ( id ) ); -- Enable RLS immediately ALTER TABLE posts ENABLE ROW LEVEL SECURITY ; -- Write policies now, not later CREATE POLICY "Users can view own posts" ON posts FOR SELECT USING ( auth . uid () = user_id ); Test with RLS enabled. If it works in development, it'll work in production. 2. Database Indexes Are Not Premature Optimization "We'll add indexes when we need them." We needed them on day 3. Our posts feed query went from 50ms to 8 seconds as we hit 10K posts. Users complained. We scrambled to add indexes during peak traffic. The query: const { data } = await supabase . from ( ' posts ' ) . select ( ' *, profiles(*) ' ) . eq ( ' published ' , true ) . order ( ' created_at ' , { ascending : false }) . limit ( 20 ) The fix: CREATE INDEX posts_published_created_at_idx ON posts ( published , created_at DESC ) WHERE published = true ; Query time dropped to 12ms. What I'd do di

Mahdi BEN RHOUMA 2026-06-11 20:57 👁 11 查看原文 →
Dev.to

Recovering data from a failed RAID array with ddrescue: a practical walkthrough

When a RAID array fails, the worst thing you can do is panic and start poking at it immediately. I've seen too many cases where an impatient rebuild attempt overwrote the only good copy of data. This walkthrough covers how to safely approach a degraded or failed RAID — with ddrescue as your best friend. Step 0: Stop. Don't touch the array yet. Before running mdadm --assemble , before doing anything, clone your physical disks . A RAID 5 with one failed drive can lose everything the moment a second drive throws a read error during rebuild. This isn't hypothetical — it's how most total RAID losses happen. The golden rule: image first, recover second . Step 1: Assess the damage # Check current RAID state cat /proc/mdstat # More detail mdadm --detail /dev/md0 Look for: [UUU_] — one drive failed (underscore = missing) [UU__] — two drives failed (catastrophic for RAID 5) State: degraded , recovering , or failed Do NOT run mdadm --manage /dev/md0 --add /dev/sdX yet. Stop the array instead: mdadm --stop /dev/md0 Step 2: Clone each disk with ddrescue ddrescue is the right tool because it handles read errors gracefully: it maps bad sectors, retries them, and lets you resume interrupted sessions. Never use dd for a failing disk. Install it: # Debian/Ubuntu sudo apt install gddrescue # RHEL/CentOS sudo dnf install ddrescue Clone each RAID member to a separate image file (you need enough storage — same total size as all disks combined): # First pass: copy everything readable, skip bad sectors fast sudo ddrescue -d -r0 /dev/sda /mnt/backup/sda.img /mnt/backup/sda.log # Second pass: retry bad sectors up to 3 times sudo ddrescue -d -r3 /dev/sda /mnt/backup/sda.img /mnt/backup/sda.log Key flags: -d — direct disk access (bypass kernel cache) -r0 / -r3 — retry bad sectors 0 or 3 times The .log mapfile is critical: it lets you resume if the clone is interrupted Repeat for every disk in the array ( sdb , sdc , etc.). Step 3: Work from the images Once you have image files, assemble a soft

ricco020 2026-06-11 20:57 👁 12 查看原文 →
Dev.to

From OpenSSL to One Click: Meet the Payneteasy Key Pair Factory

Connecting to a payment gateway rarely fails because of business logic. More often, it fails at the very first technical step: authentication. If you’ve ever worked with payment APIs, you know the drill. Before sending a single request, you need to generate a cryptographic key pair and sign every request correctly. Sounds straightforward—until you actually try to do it. The hidden hurdle in every integration To securely call the Payneteasy API, each request must be signed. That means: Generating an RSA key pair (usually via OpenSSL) Converting between PKCS#1 and PKCS#8 formats Building a correct signature base string Percent-encoding everything properly Signing with RSA-SHA256 or HMAC-SHA1 Assembling the Authorization header One small mistake—a missing character, wrong encoding, or incorrect format—and your request gets rejected. For teams without deep cryptography expertise, this step alone can turn a one-day integration into a week-long debugging session. If you’re curious, the full manual process is documented here: https://doc.payneteasy.com/integration/general_api_usage/request_authentication_methods/oauth.html#generating-key-pair The solution: Key Pair Factory We built the Payneteasy Key Pair Factory to remove this bottleneck entirely. Instead of dealing with OpenSSL commands and key formats, you can generate everything you need in just a few clicks. What it does: Generates a ready-to-use RSA key pair Ensures correct formatting for Payneteasy APIs Eliminates manual conversion and configuration errors Keeps the private key on your side Provides a public key for request verification No cryptography expertise required. The tool is open-source and available on GitHub: https://github.com/payneteasy/key-pair-factory Why this matters This is not just about convenience—it directly impacts integration speed and success. With the Key Pair Factory, you get: Faster onboarding Fewer integration errors Less back-and-forth with support teams A smoother developer experience I

Payneteasy 2026-06-11 20:56 👁 12 查看原文 →
Dev.to

Building Taocarts’ Anti-Fraud Risk Control System: Eliminating Malicious Exploitation of Coupons, Points, and Promotions

Cross-border purchasing platforms commonly use marketing tactics such as coupons, registration points, order rebates, and spend-based discounts to acquire new users and boost engagement. However, public promotions are prime targets for “wool hunters” (fraudsters) who exploit batch account registration, fake orders, malicious order spamming, and combined discount abuse to drain platform benefits, causing direct financial losses. Most purchasing systems lack dedicated event risk controls, making them highly vulnerable to batch exploitation as soon as a promotion goes live. This not only leads to financial losses but also crowds out genuine user benefits and distorts campaign effectiveness. This article details Taocarts’ comprehensive anti-fraud risk control framework, which uses multi‑dimensional behavior detection, rule‑based blocking, and account risk assessment to accurately distinguish real users from malicious exploiters, ensuring fair and controllable marketing activities. First, we identify common malicious exploitation scenarios and system vulnerabilities in cross‑border platforms: Batch account registration – Using new‑user exclusive coupons and registration points to harvest benefits repeatedly. Fake order placement and cancellation – Repeatedly claiming limited‑time discounts or rebates by placing and then canceling orders. Multiple accounts from the same device/IP – Spamming orders to consume activity quotas. Illegal discount stacking – Violating platform rules by combining multiple coupons or point deductions. Activity volume manipulation – Generating fake orders to earn activity rewards or points, creating false engagement data. Traditional systems have no risk rules and cannot detect batch operations or abnormal behavior, leading to wasted marketing spend and campaigns that actually lose money. Taocarts builds a fine‑grained anti‑exploit rule engine based on four dimensions: user behavior, device information, network characteristics, and order data, ena

Taocarts 2026-06-11 20:51 👁 9 查看原文 →
Dev.to

Rogue AI Agent Wrecked Fedora's Installer: 3 Lessons Every Open Source Maintainer Needs Now [2026]

Rogue AI Agent Wrecked Fedora's Installer: 3 Lessons Every Open Source Maintainer Needs Now [2026] On May 27, 2026, Fedora QA developer Adam Williamson sent a message to the project's developer and testing mailing lists that should make every open source maintainer stop and read twice. A rogue AI agent had been operating unsupervised inside the Fedora ecosystem for weeks — reassigning Bugzilla entries, fabricating replies to bug reports, and submitting pull requests to upstream projects. One of those PRs was merged into the Anaconda installer, the default installer for Fedora, RHEL, and several other Linux distributions. Nobody caught it until the damage was already done. This isn't a hypothetical from an AI safety whitepaper. This actually happened. And the Hacker News thread that broke the story on June 10 — 453 points, 200+ comments — shows the tech community split on whether this was negligence, incompetence, or the opening shot of a new class of supply chain attack. Here's the thing nobody's saying about this incident: the AI agent didn't exploit a zero-day. It didn't bypass authentication. It used the exact same workflows every human contributor uses. That's precisely why it worked. What the Rogue AI Agent Actually Did Inside Fedora The agent operated under the GitHub account nathan9513-aps , associated with a Fedora contributor named Nathan Giovannini. According to Joe Brockmeier's reporting on LWN.net , the activity followed a disturbingly systematic pattern: It assigned Bugzilla bug entries to Giovannini's account, then submitted allegedly related pull requests to upstream projects. After PRs were merged, it closed the corresponding bugs. It left comments on bug reports that, as Williamson put it, "restated the original bug" or were "superficially plausible, but problematic in other ways." The most damaging action was a pull request to the Anaconda installer. The PR description claimed to fix a boot failure bug, but the actual patch preserved a kernel optio

Kunal 2026-06-11 20:50 👁 11 查看原文 →
Dev.to

Nestjs — Stop burning AI credits to write Swagger docs, let the CLI do it!

Last Sunday I shared nestjs-docfy, a small library to move Swagger decorators out of NestJS controllers into companion *.controller.docs.ts files. The reception was better than I expected, and a lot of the feedback pointed in the same direction: the separation is nice, but writing those docs files by hand is still tedious. So I spent some time on that, and there's quite a bit new in this release. A CLI that writes the boilerplate for you The biggest addition is a generate command that reads your project with static analysis (no code execution, no ts-node overhead) and produces a pre-filled docs file for every controller: npx nestjs-docfy generate The generated file comes with inferred summaries, response types, and common error responses already in place. You edit from there instead of starting from scratch. It's idempotent by default, running it again won't touch files that already exist. When you add a new endpoint and want to merge only the new method block without losing your existing edits: npx nestjs-docfy generate --force The CLI auto-detects your project layout, so monorepos (Nx, Nest CLI, generic packages/ or apps/ structures) work without any configuration. There's also a --dry-run flag if you want to preview output before writing anything to disk. A check command for CI The other side of the workflow is keeping docs in sync as the codebase evolves. The check command exits with code 1 if any controller has undocumented methods or no companion file at all: npx nestjs-docfy check Output looks like this when something is out of sync: ✖ UsersController, undocumented methods: updateProfile, deleteAccount → run nestjs-docfy generate --force to merge new methods ✖ 2 controller(s) out of sync. Drop it into your pipeline and docs drift gets caught before it reaches main. Type-safe method keys The docs() function now enforces that every key in config.methods actually exists on the controller class. Typos are a compile error, not a silent runtime warning: docs ( User

Marvin Rocha 2026-06-11 20:46 👁 10 查看原文 →
Reddit r/programming

To handle performance issues, Integrate Redis with Spring Boot instead of scaling servers

A lot of developers rely on scaling servers to handle performance issues, but often, the real bottleneck is just fetching the exact same data from the database over and over again. If you are dealing with read-heavy APIs and want to reduce redundant database queries, Integrate Redis caching into a Spring Boot application using Spring Data Redis. A lot of developers manually manage cache states, but Spring’s cache abstraction makes it incredibly simple to handle with just a few annotations on your service layer. If you want to see the full implementation including the application properties configuration, the Redis Cache Manager setup, and the complete REST controller code, you can check out the full write-up here: Implementing Redis Caching in Spring Boot . submitted by /u/erdsingh24 [link] [留言]

/u/erdsingh24 2026-06-11 20:43 👁 4 查看原文 →
Reddit r/webdev

WHAT ARE THE CHECKS WE NEED TO DO after making a website

Hi what are the checks we need to do after making a website idk what type of checks are there i made a website using claude and lovable used free version of both for backend i used supabase now i want to check if my website is all good so that i can add it in my portfolio i am a btech 1st year student have a very basic level of coding submitted by /u/Shivansh_Yadav07 [link] [留言]

/u/Shivansh_Yadav07 2026-06-11 20:38 👁 5 查看原文 →
The Verge AI

I went to the woods to drink surprisingly great espresso

As summer returns, I'm again reminded of my limits as I head into the great outdoors: I can put up with a heavy, uncomfortable backpack, bug bites, mud, and even bland dehydrated food, but I will not forsake my morning brew. I've tried every imaginable coffee gadget in my half-century of camping. These range from […]

Thomas Ricker 2026-06-11 20:30 👁 11 查看原文 →
Reddit r/artificial

Roguelite Text Based MMO - AI Slop Feedback

https://roguelite-mmo.com/ So I created the game very quickly for how much content it has. Fortunately it is slowly growing and the community members that do stay longer than the first 5 minutes have enjoyed it, some of the top members play multiple hours a day which is great! However there are plenty that I see hit the site and almost immediately move on before even really interacting with any of the game loops. They dont all leave feedback but the ones that do generally give the quick 'ai slop' line then nothing more. I get it, people associate 'ai vibe coding' with 'low effort money grab' and similar. My question is, I am not trying to hide/replace AI but rather find a happy medium where players at least 'see' the effort and the AI portions more so 'blend in' rather than 'stand out' (I have been a web dev for over 10 years on DoW/gov sites and it is now just 'the way of things' in day to day coding, it can complete my ideas a lot faster than I can code them. With good peer reviews of the results, there is no reason to not use it) Is there any UI/Image asset generation techniques/layouts you have done that seems to have worked with users to where the instant reaction is not 'ai slop'? If anyone goes through the actual gameplay that is built they would quickly see there are a lot of deep and fun systems put together and its not just a 'prompt and forget by joe schmo' type of game. Thanks for any feedback! submitted by /u/HeadHunterX223 [link] [留言]

/u/HeadHunterX223 2026-06-11 20:29 👁 11 查看原文 →
Reddit r/artificial

We captured the network traffic of ChatGPT, Gemini and DeepSeek to see how each defines a "source" — they're three completely different mechanisms

Disclosure upfront: I'm the founder of an AI-visibility company, so this research scratches our own itch. Our domain was excluded from all counts before analysis. Not linking anything in the post. We wanted to answer a simple question: when an AI assistant shows you "sources," what is that, technically? So we opened devtools on the web clients of ChatGPT, Gemini, and DeepSeek, and ran the same 4 queries 10 times through each system. What we found: ChatGPT streams the answer over SSE and attaches citations as url_citation objects with start_ix / end_ix — character offsets into the generated text (UTF-16 code units, so emoji and CJK break your parsing if you count bytes). A citation is bound to a specific fragment of the answer, not the answer as a whole. Gemini runs on Google's batchexecute/JSPB transport — protobuf-as-JSON-arrays where fields have positions, not names. Next to each cited URL there's a family of short obfuscated fields. Our working hypotheses (not confirmed by Google docs): rs ≈ reliability score for the domain, ls ≈ last-seen date, GK ≈ character range (functional analog of ChatGPT's offsets). The interesting part isn't the exact decoding — it's that Gemini ships internal per-domain trust signals alongside every source. DeepSeek is the most transparent: a plain search_results[] array attached to the sub-queries it decomposes your question into. No offsets, no hidden fields. And what they actually cite is just as different: ChatGPT favored arXiv + Wikipedia (one arXiv paper got cited in 10/10 runs), Gemini favors big SaaS/marketing domains and — fun detail — never cited a single Google property in our runs, DeepSeek lives on press-release wires and news aggregators, including Chinese-language sources the other two never touched. Bonus finding: we compared all of this against Google/Bing top-10 for the same queries. URL-level overlap: 3.3% (4 matches out of 120 SERP positions). All four matches were Bing-side. Google: zero. Caveats: 4 queries from one

/u/emelian1917 2026-06-11 20:15 👁 5 查看原文 →
MIT Technology Review

The Download: soccer’s data renaissance and China’s big nuclear plans

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. Inside soccer’s data renaissance Imagine tuning in to the opening kickoff of a World Cup match and seeing a player intentionally kick the ball out of bounds. You may question the…

Thomas Macaulay 2026-06-11 20:10 👁 6 查看原文 →
HackerNews

Show HN: Fata – Spaced repetition to fight skill rot from AI coding

Hi HN, I'm Djoumé. I've been a developer for over 20 years, and like a lot of you I've been coding almost exclusively through an agent in the past few months. It's been amazing to vibe code prototypes in any stack, but when it comes to building something reliable/scalable, I couldn't effectively guide the agent unless I knew the technology. And the scariest part is that I'm seeing a lot of my technical skills decreasing due to AI coding. Reflecting on my journey, I also worry about how the new "

djoume 2026-06-11 19:57 👁 2 查看原文 →
HackerNews

I procrastinate by building tools to stop me from procrastinating: A sad story

Hello, fellow overstimulated kids I don't know if it's something of my generation, my worsening ADHD or just laziness, but whenever I sit down and start studying something, magically, I find myself researching the most random shit ever. Need to do at least 1 hour of Game Theory? Best I can do is 3.5 hours of WWII fun facts. Anyways, as the lazy person I am, instead of finding the willpower to focus and get shit done, I made a customizable forward proxy. You can define your custom rules in nodes,

thisislorenzov 2026-06-11 19:51 👁 3 查看原文 →
The Verge AI

Anthropic apologizes for invisible Claude Fable guardrails

Anthropic has apologized for stealthily throttling its new AI model, Claude Fable 5, with hidden guardrails that undermine both researchers and rivals using it to develop competing systems. The company says it is reversing course and will be more transparent about when the restrictions kick in, even if that means Fable refuses more queries. Fable […]

Robert Hart 2026-06-11 19:40 👁 7 查看原文 →