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

AI 资讯

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

15502
篇文章

共 15502 篇 · 第 575/776 页

Dev.to

How to Format SQL Queries in Python: Best Practices, Gotchas, and Real-World Examples

Stop writing SQL strings that look like a ransom note. Here's how to write queries that are readable, safe, and maintainable. The Problem With "Good Enough" SQL Formatting Most Python developers start here: user_id = 5 query = " SELECT * FROM users WHERE id = " + str ( user_id ) cursor . execute ( query ) It works. Until it doesn't — and when it breaks, it breaks badly : SQL injection, cryptic errors from mismatched types, and queries that take 45 minutes to debug at 2am. Let's fix that, permanently. 1. Never Concatenate User Input — Use Parameterized Queries This is rule #1 and it's non-negotiable. ❌ The Wrong Way (SQL Injection Waiting to Happen) username = request . args . get ( " username " ) # Could be: ' OR '1'='1 query = f " SELECT * FROM users WHERE username = ' { username } '" cursor . execute ( query ) If username is ' OR '1'='1 , your entire users table just got exposed. ✅ The Right Way: Parameterized Queries username = request . args . get ( " username " ) # psycopg2 (PostgreSQL) cursor . execute ( " SELECT * FROM users WHERE username = %s " , ( username ,)) # sqlite3 cursor . execute ( " SELECT * FROM users WHERE username = ? " , ( username ,)) # SQLAlchemy Core from sqlalchemy import text result = conn . execute ( text ( " SELECT * FROM users WHERE username = :name " ), { " name " : username }) The database driver handles escaping. You never touch it. This pattern is immune to SQL injection by design. Gotcha: Note the trailing comma in (username,) . Without it, Python treats the string as an iterable and passes each character as a separate parameter. This is one of the most common beginner bugs. # 💥 Bug: passes ('a', 'l', 'i', 'c', 'e') instead of ('alice',) cursor . execute ( " SELECT * FROM users WHERE username = %s " , ( username )) # ✅ Correct: single-element tuple cursor . execute ( " SELECT * FROM users WHERE username = %s " , ( username ,)) 2. Multi-Line Queries: Triple Quotes + Consistent Indentation For anything longer than one clause, use tri

stackOverflowed 2026-06-11 02:30 👁 14 查看原文 →
Dev.to

Developer Tools That Actually Save You Time in 2026

As developers, we often lose hours to repetitive tasks - formatting data, debugging auth tokens, or wrestling with encoding issues. The right set of utility tools can cut that overhead significantly. Here is a curated breakdown of the categories and tools worth keeping in your daily workflow in 2026. JSON and Data Formatting Tools Working with raw, minified API responses is a real productivity killer. A browser-based JSON formatter with real-time validation and proper indentation helps you parse and debug responses in seconds - without sending your data to third-party servers. Similarly, XML is far from dead; SOAP APIs and enterprise integrations still rely on it, so a solid XML formatter with XPath support is worth having around. On the frontend, a CSS minifier that handles dead code removal and selector optimization can meaningfully reduce your page load times. Data Conversion Utilities Modern stacks often have to bridge the gap between formats. A JSON-to-XML converter is critical when integrating with legacy systems, but look for one that handles arrays and special characters correctly. CSV-to-JSON converters help structure flat export data from spreadsheets or databases into something your application can consume. And if your deployment pipeline involves YAML config files, a formatter that catches indentation errors before they break your CI/CD run is essential. Encoding and Security Helpers Base64 encoding comes up constantly - from embedding images in CSS to building HTTP Basic Auth headers. A reliable encoder/decoder handles all these cases without fuss. URL encoding matters too; unencoded special characters in query strings cause subtle API bugs that are surprisingly hard to track down. For authentication debugging, a JWT decoder lets you inspect token payloads without needing to verify the signature - ideal for local development and troubleshooting. Code Generation and Color Utilities Distributed systems need collision-resistant unique IDs - a UUID generato

Moksh Gupta 2026-06-11 02:27 👁 11 查看原文 →
Product Hunt

Riven

Your Apple Watch knows when you've truly hit muscle failure Discussion | Link

Baraa Bilal 2026-06-11 02:22 👁 3 查看原文 →
Dev.to

I Built a Freelance Job Hunting Automation on n8n — Here's Everything I Learned

I'm a 17-year-old IT student from Luxembourg. A few months ago I got tired of spending 2-3 hours a day manually browsing Upwork, Malt, and Freelancer looking for projects. So I built an automation system that does it for me — 24/7, on a Raspberry Pi 3. Here's what it does, how I built it, and every painful lesson I learned along the way. What the system does Scans Upwork, Malt, and Freelancer every 30 minutes Scores each job 0–100 with AI based on my profile Generates proposals in English, French, and German Sends the best jobs to Telegram with inline A/B buttons Tracks which proposal style gets more replies Sends daily stats and weekly market trend reports Reminds me to follow up after 3 days The stack n8n — self-hosted workflow automation (Docker on Raspberry Pi 3) Groq API (Llama 3.1-8b-instant) — AI scoring and proposal generation Supabase — PostgreSQL database for jobs, proposals, clients SerpAPI — searching job boards via Google Apify — scraping Upwork listings Telegram Bot API — alerts and bot commands Cloudflare Tunnel — HTTPS for webhooks Total running cost: ~$5/month. 7 workflows 01 - Job Discovery — runs every 30 minutes, searches 10+ sources, deduplicates via Supabase unique constraint on URL 02 - Proposal Generator — AI scores the job, generates two proposal variants (formal vs hook-first), sends to Telegram with A/B buttons 03 - Follow-up Reminders — checks Supabase every 3 days for unanswered proposals 04 - CRM via Telegram — full client management through bot commands (/jobs, /stats, /clients) 05 - Market Intelligence — daily report: how many jobs found, average score, top platforms 06 - Trend Analysis — weekly report on what skills are trending in automation 07 - Lead Generation — finds companies actively using Zapier or Make who might want to switch to n8n Lessons learned (the hard way) 1. Cyrillic text breaks JSON body nodes silently If you have Cyrillic characters in a JSON body field with newlines, n8n throws a "Bad control character" error. Kee

Ihor Bezruchko 2026-06-11 02:21 👁 5 查看原文 →
Dev.to

How to add a contact form to your static site — no backend, no monthly fee

I got tired of paying for form services or spinning up a backend just to handle contact form submissions. So I built RG Forms — a contact form endpoint backed entirely by a Google Sheet you own. No server, no monthly fee, no third-party storing your data. The idea Most form tools store your submissions on their servers. You pay monthly, you depend on their uptime, and your data lives in their database. RG Forms does the opposite: every submission goes straight into a Google Sheet in your own Google Drive, sent by an Apps Script that you own and control. RG Forms provisions that sheet and script for you in about 90 seconds. After that, your endpoint runs forever at no cost — completely independent of any RG Forms server. Built for static sites If you host on GitHub Pages, Netlify, Vercel, Cloudflare Pages, or just plain HTML on a CDN, you've hit this wall: there's no backend to receive a form POST. The usual workarounds are a paid form service, a serverless function you have to write and maintain, or standing up a whole backend just for a contact form. RG Forms is built exactly for this. Your endpoint is a plain HTTPS URL you POST to straight from client-side JavaScript — no build step, no serverless function, no server of any kind. Drop the fetch call into your page and you're done. It pairs naturally with any static-site generator (Hugo, Jekyll, Astro, Eleventy, Next export) and any no-code builder that lets you add a snippet of JS. Your static site stays static; the form just works. How it's built RG Forms is a fully static web app. There's no RG Forms server, no database, no backend. Every API call during setup goes directly from your browser to Google using your own OAuth token. Setup (one time, in your browser): Your Browser ├─── Google OAuth ──▶ Short-lived token (memory only) ├─── Google Drive API ──▶ Creates Sheet + Drive folder └─── Apps Script API ──▶ Creates & deploys form handler Live endpoint (after provisioning): Your Website / App └─── POST to script

yehuda 2026-06-11 02:14 👁 12 查看原文 →
Dev.to

SAFEDEPLOY AI: DevOps Pipeline Intelligence System

Problem Statement: DevOps Pipeline Agent: Modern software delivery pipelines generate large amounts of operational data. Understanding the relationship between deployments, infrastructure changes, and failures is increasingly complex. Build an AI agent that remembers deployment history, infrastructure modifications, build failures, and incident outcomes. The agent should learn from previous events to predict risks and recommend preventive actions before issues reach production. The project should showcase memory-driven operational intelligence. Solution Approach To address these challenges, we developed SAFEDEPLOY AI, a memory-driven operational intelligence platform that acts as the collective memory of software systems. SAFEDEPLOY AI continuously records: Deployment histories Infrastructure modifications Build outcomes Incident reports Module-level changes Operational metrics Instead of treating these as isolated records, the platform transforms them into searchable organizational knowledge. The AI assistant can answer questions such as: Which deployment introduced a failure? Has this issue occurred before? Which service has the highest deployment risk? What preventive actions worked in previous incidents? Which infrastructure changes caused production instability? This enables teams to move from reactive troubleshooting to proactive decision-making. Architecture and Design SAFEDEPLOY AI follows a cloud-native, layered architecture designed to provide deployment intelligence, operational visibility, and AI-driven decision support. The platform workflow begins with project creation and module registration. As deployments and infrastructure changes occur, SafeDeploy AI continuously records operational events, incident reports, security findings, and compliance records. This information is stored as a centralized knowledge base, enabling the AI engine to perform risk analysis, generate recommendations, and support context-aware issue resolution. Workflow Create Proje

Ankit Kumar 2026-06-11 02:12 👁 10 查看原文 →
Dev.to

Building a Multi-Agent AI Movie Production Team with Google ADK

🚀 What I Built I created a collaborative AI Multi-Agent system using Google's new Agent Development Kit (ADK). The system functions as an automated Hollywood Production Team designed to streamline creative brainstorming. The user submits a simple movie prompt (e.g., "A movie about a time-traveling chef"), and the specialized agents work sequentially to refine the idea into a viable film concept. 🧠 My Agent Architecture My multi-agent team uses a sequential workflow tracking architecture consisting of two specialized agents running on gemini-2.5-flash : movie_writer : Takes the raw user input concept and expands it into a high-stakes, descriptive three-sentence movie plot. movie_critic : Automatically intercepts the writer's completed story context to deliver constructive structural improvements. These agents are orchestrated via a SequentialAgent pipeline configuration that manages data handoffs automatically. 🛠️ Key Learnings & Challenges Framework Evolution: I learned how to structure project modules using ADK 2.0's directory scanning conventions ( __init__.py mapping definitions). Overcoming Roadblocks: I originally ran into layout separation issues on Windows where the backend command runner could not discover the python modules. Resolving this taught me how the google.adk.cli maps working directory environments ( ./app ). Handling API Constraints: Dealing with transient API capacity limits (like standard 503 backend service spikes) taught me how crucial error handling and session resets are when building live AI tools.

Varun Patil 2026-06-11 02:11 👁 5 查看原文 →
Dev.to

Copilot Chat Goes GA in PRs — But Multi-Repo Visibility Is Still Missing

GitHub moved Copilot Chat's richer pull request experience to general availability this week — side-by-side chat with diffs, inline editing, and context-aware answers without leaving the review view. Previously in public preview, it is now live for all Copilot license holders. It is a real improvement for reviewing changes inside a single pull request. But it highlights a gap that per-PR AI tooling structurally cannot close: knowing what is open across the rest of your organisation. The Problem That Lives Outside the PR Most engineering teams don't work in one repository. They ship across services, libraries, and infrastructure — often with related PRs open in multiple repos simultaneously. A reviewer approving a payments service change without knowing that a dependent auth-service PR is still in draft is reviewing without full context. This is not a quality-of-feedback problem. It is a visibility problem. No amount of intelligence surfaced inside a PR tells you what is happening across your repositories. Gartner's 2026 assessment of AI coding agents makes the point clearly: the bottleneck has shifted from generating code to reviewing, securing, and governing it. Better per-PR AI raises the floor on feedback quality. The teams that pull ahead will be the ones who also solve the coordination layer — which PRs are open, which are stale, which are blocked on a dependency in another repo. What Changes With Better In-PR AI GitHub's GA release makes the review experience faster and less disruptive for individual PRs. That matters. But as per-PR intelligence becomes table stakes, the differentiator shifts toward cross-repo awareness: who is waiting for review, what related work is in flight, and where the actual bottlenecks in the delivery pipeline are. Engineering leaders should be watching PR age distribution and review load across all repositories — not just the ones that happen to be open in a browser tab right now. For teams already dealing with multi-repo sprawl, Cod

Nijat 2026-06-11 02:05 👁 12 查看原文 →
Dev.to

Your Agent Returns 200 and Lies. Verify Before You Trust

A success gate verifies an AI agent's claimed success before your system accepts it. SuccessGate runs three read-only checks — schema/contract, claim-vs-evidence against the actual tool-call trace, and an optional post-condition probe — and turns a silent 200 into an explicit REJECTED with reasons. It's stdlib Python, needs no API key, moves nothing, and ships with a self-test you run in one command. Here's the failure that started this for me. An agent in a CRM workflow reported {"status": "sent", ...} for an invoice. Clean run. Green dashboard. 200 OK. The invoice went to a customer id that wasn't on our allow-list — a near-miss hallucination the model was completely sure about. Nothing crashed. No exception, no stack trace. We found it days later, downstream, the expensive way. That's not a rare bug. It's the default failure mode of agents in production, and it has a name now: silent-success drift . Cycles' writeup put it bluntly — "200 OK Is the Most Dangerous Response in Production" : "The most dangerous failures look like success." And the measurements back it up. The Berkeley Function-Calling Leaderboard (BFCL v3) puts frontier-model structurally invalid tool calls at 2–5% even on clean benchmark prompts — higher in noisy production ( via Future AGI ). The arXiv paper Agent Behavioral Contracts reports that across 1,980 sessions , contracted agents caught 5.2–6.8 soft violations per session that uncontracted baselines missed entirely. So the question is not how do I see failures sooner . It's how do I stop accepting a success the agent never actually achieved. TL;DR A 200 and a "status": "done" are claims, not proof. Agents return both while doing the wrong thing — or nothing. Observability is tracking : it tells you a call happened. It can't tell you the result was correct. That's a control problem. verify() runs three checks before you accept success: (1) schema/contract (shape, types, enums/allow-list), (2) claim-vs-evidence (did the agent actually call th

Alexey Spinov 2026-06-11 02:05 👁 5 查看原文 →
The Verge AI

The future of AI regulation is courting the strangest, most anxious bedfellows

Hello and welcome to Regulator, a newsletter for Verge subscribers about tech politics, tech influence, and tech shenanigans in Washington, DC. (If you're not a subscriber, you can get on board here.) We're back after a two-week hiatus, during most of which I was gallivanting in the Netherlands for a family wedding, and a trip […]

Tina Nguyen 2026-06-11 01:38 👁 10 查看原文 →
Reddit r/artificial

What do you think will happen in the future with ai?

I highly recommend watching (or rewatching) the 2014 movie Transcendence. The film beautifully captures the terrifying nature of the "technological singularity" where an Al undergoes exponential, recursive self-improvement, eventually taking over global networks and stripping away human agency until a total global blackout is the only way to stop it. For years, people brushed this off alongside The Terminator as pure Hollywood sci-fi. But look at where we are right now. Just this month, Anthropic-one of the world's leading Al labs-issued a massive warning calling for a globally coordinated, verifiable pause on advanced Al development. Their core fear? Exactly what happens in those movies: recursive self-improvement. They believe we are fast approaching the threshold where an Al can design and build its own successor, meaning humans could completely lose control of the technology. When the people actually building these models are telling us to hit the brakes because society can't keep up, it feels like we're blindly sprinting into a dystopia. What's your take on this? Are we staring down a real-life Skynet situation, or is this just big tech labs using fear-mongering to push for heavy regulations and lock out their competition? submitted by /u/photography_rambog [link] [留言]

/u/photography_rambog 2026-06-11 01:31 👁 5 查看原文 →
The Verge AI

Google won’t just admit it’s feeding YouTube creators to its music AI

If you've uploaded a song to YouTube, Google almost certainly considers your video fair game for training its Lyria music AI, it just won't admit it right now. A group of independent musicians is suing Google, claiming that it illegally used songs they uploaded to YouTube to train its Lyria 3 model. Google has filed […]

Terrence O’Brien 2026-06-11 01:20 👁 10 查看原文 →
Product Hunt

Onpilot

An AI workforce customized to your business Discussion | Link

2026-06-11 01:12 👁 5 查看原文 →
Reddit r/artificial

I ran Fable 5 for half day and the guardrails are the real story

Anthropic dropped Fable 5 and I immediately swapped it into our dev stack. We route everything through a single endpoint on zenmux, so the actual switch was changing one model string and watching the latency graphs. The good parts first because there are a lot of them. I threw a refactoring task at it: split a messy python service into modules, preserve the public api, and write tests that prove nothing broke. Fable 5 planned the whole thing, caught a circular dependency I did not mention, and verified the tests pass. With Opus 4.8 I usually have to nudge it a couple of times when it forgets to update the init file. Fable 5 just did it. Then I dumped our full codebase and asked it to find a race condition we had been hunting for a week. It traced the async flow, named the exact function, and described the interleaving that triggers the bug. That level of context digestion feels new. Opus is good at long context, but Fable 5 felt like it was actually reasoning across the whole window instead of pattern matching near the top. I also sent it a blurry dashboard screenshot from a client call and it rebuilt the html and echarts config including the tooltip formatting. My designer’s first words were "when did you learn front end." I did not. But here is the part nobody in the launch threads is talking about enough. It is slow. On high effort I am seeing 45 to 90 seconds for a single complex turn. Our latency graphs go from a flat green line to a jagged mess the moment Fable 5 traffic hits. And it is expensive. The same prompt that costs X on Opus 4.8 costs roughly 1.4 to 1.7X on Fable 5 because it generates more tokens and runs at a higher effort tier by default. It writes its own reasoning traces out loud and bills you for them. For research tasks the quality is worth it. For "rewrite this email" it is comically overpowered. The bigger issue is the silent fallback. Fable 5 is basically Mythos with guardrails. When your prompt touches cybersecurity, biology, chemistry, or

/u/Interestingyet 2026-06-11 01:09 👁 5 查看原文 →