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

标签:#r

找到 18567 篇相关文章

开源项目

🔥 PostHog / posthog - 🦔 PostHog is an all-in-one developer platform for building s

GitHub热门项目 | 🦔 PostHog is an all-in-one developer platform for building successful products. We offer product analytics, web analytics, session replay, error tracking, feature flags, experimentation, surveys, data warehouse, a CDP, and an AI product assistant to help debug your code, ship features faster, and keep all your usage and customer data in one stack. | Stars: 35,625 | 58 stars today | 语言: Python

2026-07-16 原文 →
AI 资讯

Claude can now use your 1Password credentials for you

1Password has launched a new browser integration for Claude that allows the Anthropic chatbot to access stored security credentials like usernames and passwords. The 1Password for Claude feature means that users can authorize Claude to complete multi-step tasks like booking travel and managing online accounts on their behalf without having to manually input their login […]

2026-07-16 原文 →
AI 资讯

How AI Can Help You Improve Your Performance as a Developer

Why this matters Let’s be real — most of us don’t struggle because we “can’t code”. We struggle because: we waste time on repetitive tasks we get stuck on small bugs we context-switch too much we overthink simple problems That’s where AI actually helps. Not as a replacement — but as a performance multiplier . 🤖 First, what AI is actually good at AI is not magic. But it’s really good at: generating boilerplate explaining errors suggesting improvements summarizing docs speeding up repetitive work 👉 Basically: saving your mental energy ⚡ 1. Write code faster (without burning out) Instead of writing everything from scratch: // prompt idea " create a custom React hook for localStorage " You get a solid starting point instantly. 👉 You still review it 👉 You still understand it 👉 But you don’t waste time writing boilerplate 🐞 2. Debug faster Instead of Googling for 20 minutes: Error: Cannot read property 'map' of undefined You ask AI: 👉 It explains the issue 👉 suggests fixes 👉 shows edge cases Example mindset shift Before: search → open 5 tabs → read → test → maybe fix Now: ask → get explanation → apply → move on 🧠 3. Learn way faster AI is like having a senior dev on demand. You can ask: “Explain React Server Components simply” “When should I use memo?” “What’s wrong with this pattern?” 👉 Instant explanations 👉 Real examples 👉 No fluff 🔄 4. Automate boring tasks Things you shouldn’t waste time on: writing regex generating types creating repetitive components converting data formats 👉 AI handles these in seconds 📚 5. Write better documentation Most devs hate writing docs. AI helps you: generate README files write comments document APIs 👉 Your project becomes easier to understand 👉 Your team moves faster 🧩 6. Break down complex problems Instead of getting stuck: "build a dashboard with auth, charts, and API integration" Ask AI to break it down: 👉 smaller steps 👉 clear structure 👉 less overwhelm ⚡ 7. Stay focused (this is underrated) Biggest hidden benefit: 👉 less context swi

2026-07-16 原文 →
AI 资讯

The SQL injection bug your code review keeps missing

Every TypeORM project I've worked on grows the same few dangerous lines. I got tired of catching them by hand, so I wrote a linter that does it for me. I was reviewing a pull request a while back and nearly scrolled past this line: await manager . query ( `SELECT * FROM users WHERE id = ${ req . params . id } ` ); Looks fine at a glance. It's a SQL injection hole. The id comes off the request and lands directly in the query string. The thing that bugged me is that I only caught it because I happened to be reading carefully on that line, that day. Review catches this sort of thing a lot of the time. "A lot of the time" is how these end up in production. It's usually not only injection either. The same projects tend to collect a few other habits: synchronize: true in a data source config. It rewrites your schema on startup and can drop a column on the next deploy. A QueryBuilder delete() or update() that hits .execute() with no .where() . Forget that one line and you've changed every row in the table. Three or four writes in one function, none in a transaction, so if the second throws you're left with half-written data. On multi-tenant apps, a query that forgets the tenant filter. That's how one customer sees another customer's data. None of these really need a person to catch them. They're mechanical. A linter can do it on every commit. So I built one. eslint-plugin-typeorm-enterprise npm install --save-dev eslint eslint-plugin-typeorm-enterprise // eslint.config.js const typeormEnterprise = require ( ' eslint-plugin-typeorm-enterprise ' ); module . exports = [ typeormEnterprise . configs . recommended ]; Now those patterns are lint errors. Ten rules today, split into configs ( recommended , strict , performance , multiTenant ): raw SQL, interpolated and concatenated SQL, unsafe QueryBuilder deletes, EntityManager raw queries, writes outside a transaction, tenant scoping, and a nudge to stop counting rows when you only need to know one exists. Two things I was picky

2026-07-16 原文 →
AI 资讯

Arc 11 Catch-Up: Composing Solana Programs with CPIs

Arc 11 covered Days 71–77 of Epoch 3, and it was all about Cross-Program Invocations. In Arc 9, we wrote our first Solana program. In Arc 10, we gave that program a more useful state model with Program Derived Addresses. But our programs were still mostly working alone. They could read and update their own accounts, enforce their own constraints, and respond to instructions sent by a client. They could not directly change state owned by another program or bypass the rules that program enforced. That is an important part of Solana’s security model. The System Program owns the rules for creating accounts and transferring lamports. Token-2022 owns the rules for mints, token accounts, supply, and mint authorities. If our program needs one of those capabilities, it calls the program that owns the operation. That call is a Cross-Program Invocation, or CPI. The Web2 comparison is a service-to-service API call. One service sends a request through another service’s public interface, and the receiving service applies its own rules. A CPI works in a similar way, with one important difference: the outer and inner instructions execute as part of the same Solana transaction. If the inner call fails, the state changes made by the outer instruction are rolled back too. That combination of clear program boundaries and atomic execution is what makes Solana programs composable. Our first CPI called the System Program The arc began with the smallest useful CPI we could build. Our Anchor program accepted a sender, a recipient, and an amount of SOL to transfer. But the program did not edit the sender’s balance directly. Instead, it called the System Program’s transfer instruction. That distinction matters. Accounts on Solana are owned by programs, and the owner program controls how their data may be changed. Our program could not simply reproduce the effect of a System Program transfer by adjusting balances itself. It had to ask the System Program to perform the operation. Every CPI need

2026-07-16 原文 →
AI 资讯

Stuck in the Loop: Why AI Agents Retry, Oscillate, and Never Finish

An agent moving through a multi-step task needs two things it doesn't automatically have: a reliable way to know when the task is actually finished, and a reliable way to recognize when its current approach isn't working. Without both, the agent has no internal alarm bell. It just keeps acting — and if the same action keeps producing the same unhelpful result, nothing tells it to stop, change course, or ask for help. This isn't a minor implementation detail. It's a structural gap in how most agent loops are built: observe, decide, act, observe again. That loop has no natural exit condition unless one is explicitly designed in. Pattern One: The Retry Loop : The retry loop is the simpler of the two failure modes. The agent takes an action, it fails, and the agent tries the exact same action again — sometimes with trivial variation — expecting a different outcome. A few reasons this happens: Misread failures : The agent doesn't correctly interpret why the action failed, so it can't adjust its approach. It just repeats the attempt. No failure memory : Without a persistent record of "I already tried this and it didn't work," the agent has nothing to check against before trying again. Overconfidence in the plan : If the agent's internal reasoning treats the original plan as correct, it may conclude the execution was the problem, not the plan — and simply re-execute. The result is a kind of insanity loop: identical input, identical output, repeated until a turn limit, budget cap, or timeout finally intervenes from the outside. Pattern Two: Oscillation : Oscillation is subtler and, in some ways, more dangerous, because it can look like activity rather than failure. The agent doesn't repeat the same action — it alternates between two (or more) states, undoing its own progress each cycle. A classic example : An agent editing a file makes a change, then in a later step "fixes" that change back to something close to the original, believing it's correcting an error. The next cyc

2026-07-16 原文 →
AI 资讯

BIP-110 Explained for Developers: How Bitcoin Soft Forks Actually Work

Published to Dev.to — Bitcoin Development Series, Part 1 of 4_ Bitcoin is heading toward an August 2026 deadline for BIP-110, a proposed temporary softfork that would restrict Ordinals-style arbitrary data from being embedded in transactions for one year. As of today, miner signaling sits at effectively zero. The proposal is almost certainly going to fail but the mechanics of why and how are worth understanding if you work anywhere near the Bitcoin protocol. This post walks through how soft fork activation works, what BIP-110 specifically proposes, and how to inspect miner signaling yourself with code. What Is a Soft Fork? A soft fork is a backward-compatible change to Bitcoin's consensus rules. Nodes running old software still accept blocks from nodes running the new rules — but not vice versa. This is what makes soft forks safer than hard forks in a permissionless network: you do not force everyone to upgrade on day one. Hard forks, by contrast, change rules in a way that causes old nodes to reject new blocks entirely. They require near-universal coordination, which is why Bitcoin has avoided them. How Soft Fork Activation Works: BIP 9 The dominant activation mechanism used since 2016 is defined in BIP 9 . The process works like this: A proposal is assigned a version bit (bit 0–28) in the block header's nVersion field. Miners signal readiness by setting that bit in blocks they produce. Activation requires 95% of blocks in a 2,016-block retarget window to signal support. There is a starttime and a timeout . If the threshold is not met before timeout , the proposal fails and is discarded. # Simplified BIP 9 state machine logic THRESHOLD = 0.95 # 95% of blocks in a retarget window WINDOW = 2016 # one retarget period def check_activation ( signaling_blocks : int , total_blocks : int ) -> str : ratio = signaling_blocks / total_blocks if ratio >= THRESHOLD : return " LOCKED_IN " # activates after one more window return " STARTED " # still counting print ( check_activati

2026-07-16 原文 →
AI 资讯

Why Most Azure DevOps Pipelines Become Slow Over Time

* When a project first starts, CI/CD pipelines are usually simple. * Build the application. Run a few tests. Deploy somewhere. Done. Then six months pass. Another test gets added. Then another deployment step. A security scan. Performance tests. Notifications. More environments. Before long, a pipeline that once took five minutes now takes forty-five. I've seen this happen more than once, and it's rarely because Azure DevOps is the problem. It's usually because nobody ever stops to ask one simple question: Does this step still belong here? Everything Ends Up in the Same Pipeline One of the most common mistakes I see is trying to make a single pipeline do everything. Every Pull Request ends up running: Every unit test Every API test Hundreds of UI tests Security scans Deployment steps Report generation The result? Developers wait longer for feedback, releases become slower, and people eventually start ignoring failed pipelines because they happen too often. Fast Feedback Wins Not every test needs to run on every commit. A better approach is to think about the purpose of each pipeline. For a Pull Request, I want answers quickly. That usually means: Build the application Run unit tests Run a small smoke test suite Stop if something important fails Everything else can happen later. Long-running regression tests, cross-browser testing and other expensive checks are often better suited to scheduled or nightly pipelines. Pipelines Should Evolve A pipeline isn't something you build once and forget about. Every few months it's worth reviewing it. Ask yourself: Which step takes the longest? Which tests fail most often? Are there any tasks nobody remembers adding? Are we getting useful feedback, or just more output? Removing unnecessary work is just as valuable as adding new automation. Final Thoughts Azure DevOps is an incredibly powerful platform, but even the best tools become frustrating if they're overloaded with unnecessary work. The goal isn't to build the biggest pipel

2026-07-16 原文 →
开发者

C++ Optimized Compilation Ways

The very common way we know to compile a C++ program is by running the following command: g++ filename.cpp -o filename Talking in terms of stages of optimized compilation, this method is the basic one — we can say stage 0, also written as: g++ -O0 filename.cpp -o filename There are a few more, from zero to three. Let's talk about these ways of compilation. 1] -O0 : No Optimization (Default) Fast compile time. Every variable gets a real stack slot; nothing gets reordered or removed. 2] -O1 : Basic Optimization Some dead code elimination. Simple register allocation. 3] -O2 : 'Standard' Optimization Register allocation. Dead code elimination. Inlining small functions. Loop unrolling and vectorization. Constant folding/propagation. Does not enable optimizations that trade accuracy/safety for speed. 4] -O3 : More Aggressive than -O2 Sometimes faster, sometimes not. Can hurt cache performance. Other than this, there is also a space-optimization option. 5] -Os : Optimization for Size Instead of Speed The command to use these optimizations is as follows: g++ -O2 filename.cpp -o filename Remember, in -O2 the "O" is a capital letter, not a zero — the same applies to the other optimization levels. If you don't know what's going on, or you just wish to compile C++ files the way developers do, use the following standard command: g++ -O2 filename.cpp -o filename

2026-07-16 原文 →
AI 资讯

From Zero to a Working EKS Pipeline: Terraform, Ansible, and GitLab CI/CD (and Everything That Broke Along the Way)

From Zero to a Working EKS Pipeline: Terraform, Ansible, and GitLab CI/CD (and Everything That Broke Along the Way) I recently built an end-to-end deployment pipeline on AWS EKS using Terraform for infrastructure, Ansible for configuration, and GitLab CI/CD to tie it all together. On paper, that sentence sounds clean. In practice, it took several rounds of "why is this failing" before it actually worked. This post is not a "here's how EKS works" tutorial. There are plenty of those. This is the version with the failures left in, the quota limits, the IAM permission walls, the pods that wouldn't schedule, and the resources that refused to die. If you're building something similar, I'm hoping this saves you a few hours of confused Googling. Repo: gitlab.com/nenyeonyema/terraform-eks-ansible-cicd What I Was Building The goal was a full IaC-driven pipeline: Terraform to provision the EKS cluster and supporting AWS infrastructure (VPC, node groups, IAM roles) Ansible to handle configuration tasks on top of the provisioned infrastructure GitLab CI/CD to automate the whole thing — plan, apply, configure, deploy — on every push Simple enough in theory. Four separate blockers said otherwise. Blocker #1: Free Tier ASG Restrictions The first wall I hit was with the Auto Scaling Group for my EKS node group. AWS Free Tier limits how much compute you can provision, and my initial node group sizing quietly ran into those limits — the kind of failure that doesn't always throw an obvious, single-line error. Fix: I resized the node group to stay within Free Tier boundaries and got explicit about instance types and desired/min/max capacity in Terraform, instead of leaving Auto Scaling to make assumptions I couldn't afford. Lesson: If you're building on Free Tier, hardcode your capacity expectations early. Don't let the defaults surprise you later. Blocker #2: EKS Private Endpoint Access By default, EKS clusters can be configured with private-only API server endpoint access. That's grea

2026-07-16 原文 →
AI 资讯

The Complete Guide to Python Dictionary Behavior in Technical Interviews

Dictionary ordering, key hashing, view objects, and the iteration traps that catch experienced developers. Dictionaries are the most used Python data structure in production code and one of the most tested in technical interviews. Most developers use them comfortably but have gaps in their understanding of how they actually work. Insertion Order Is Guaranteed in Python 3.7 data = {} data [ " c " ] = 3 data [ " a " ] = 1 data [ " b " ] = 2 print ( list ( data . keys ())) print ( list ( data . values ())) Output: ['c', 'a', 'b'] ['3', '1', '2'] Since Python 3.7, dictionaries maintain insertion order as a language guarantee. Before that, order was an implementation detail. This is worth knowing because interview questions sometimes try to catch candidates who believe dictionaries are unordered. Mutating a Dictionary While Iterating data = { " a " : 1 , " b " : 2 , " c " : 3 } for key in data : if data [ key ] == 2 : del data [ key ] Output: RuntimeError: dictionary changed size during iteration You cannot add or remove keys from a dictionary while iterating over it. The safe pattern is to iterate over a copy of the keys: for key in list ( data . keys ()): if data [ key ] == 2 : del data [ key ] Or collect keys to delete first: to_delete = [ k for k , v in data . items () if v == 2 ] for key in to_delete : del data [ key ] Dictionary Views data = { " a " : 1 , " b " : 2 , " c " : 3 } keys = data . keys () values = data . values () items = data . items () print ( keys ) data [ " d " ] = 4 print ( keys ) Output: dict_keys(['a', 'b', 'c']) dict_keys(['a', 'b', 'c', 'd']) Dictionary views are live views of the dictionary. They update automatically when the dictionary changes. This surprises developers who expect .keys() to return a static snapshot. The get() Method Versus Direct Access data = { " a " : 1 , " b " : 2 } print ( data [ " a " ]) print ( data . get ( " a " )) print ( data . get ( " z " )) print ( data . get ( " z " , 0 )) try : print ( data [ " z " ]) except Key

2026-07-16 原文 →
AI 资讯

From a Suno Track to a Hosted Music Video: Designing the Async Workflow

A music generator such as Suno can give a creator a finished track. It does not automatically give them a finished music video. The usual next step is a toolchain: Export the song as an MP3. Use an image model such as Nano Banana to establish the artist, character, location, or visual style. Turn those references into individual video shots with a model such as Veo , Seedance , or another video generator. Route performance close-ups through a lip-sync-capable step when the singer needs to match the vocals. Prepare lyrics or an SRT file, then align captions with the song. Retry failed shots, choose the usable takes, match aspect ratios, place the original track, and compose the final timeline. Upload the exported MP4 somewhere the application can reliably deliver it. Modern multimodal models reduce parts of this work, but an application still has to own the workflow around them. A full song is longer than one generated shot. Character consistency can drift. One failed scene should not require restarting everything. Subtitle timing, task state, retries, cost evidence, and final delivery still need product code. I wanted to see what this integration would look like if the application only had to submit the source material and track one job. For the concrete implementation below, I used the BeatAPI Music Video API . At the simplest level, the application provides: one MP3, WAV, AAC, or M4A file; one to seven reference images; optional creative direction; optional lip-sync and subtitle controls; output format and quality settings. The API returns a task ID immediately and delivers a hosted MP4 when the workflow succeeds. The default path does not require the developer to review or edit a storyboard. Before: song -> reference images -> generated shots -> lip sync -> subtitle timing -> retries -> editing -> hosting Behind one workflow API: audio + reference images + controls -> one async task -> hosted MP4 By the end of the tutorial, you will have a backend flow that: uplo

2026-07-16 原文 →
AI 资讯

How to Fix Email Not Working on Render (SMTP Blocked) 🚀

If you've deployed your application on Render and noticed that emails are not being sent, you're definitely not the only one. I recently faced this issue while deploying my project: https://rizzzler.onrender.com After spending hours debugging my code, checking environment variables, testing SMTP credentials, and reading logs, I finally discovered the real cause: The hosting environment was restricting outbound SMTP connections, preventing my application from connecting to the mail server. To solve this, I moved the email-sending functionality to Google Cloud , where the SMTP connection worked correctly. This article explains how I diagnosed the issue, common mistakes to avoid, and the solution that worked for me. Symptoms You might experience one or more of the following: Password reset emails are never received. OTP emails aren't delivered. Email verification doesn't work. Nodemailer throws timeout errors. SMTP connection fails. Everything works on localhost but fails after deployment. Typical errors include: ETIMEDOUT ECONNREFUSED Connection timeout Greeting never received Step 1: Verify Your SMTP Credentials Before assuming the issue is with Render, verify your SMTP configuration. Check that the following are correct: SMTP Host SMTP Port Username Password Even one incorrect character can prevent emails from sending. Step 2: Check Environment Variables Ensure all required environment variables are configured in Render. Example: SMTP_HOST=smtp.example.com SMTP_PORT=587 SMTP_USER=your-email@example.com SMTP_PASS=your-password Also remember to: Restart your Render service after updating variables. Never hardcode credentials in your source code. Step 3: Test Locally If your application sends emails successfully on your local machine but fails only after deployment, your application code is probably not the problem. This is an important clue. Step 4: Read the Logs Open your Render logs and look for SMTP-related errors. Common messages include: ETIMEDOUT ECONNREFUSED Co

2026-07-16 原文 →