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

标签:#p

找到 12701 篇相关文章

AI 资讯

The Hidden Cost of a Log Line : Sync/Async Flush and everything in Between

log.info("user logged in") looks free. It isn't. Behind that one line is a chain of decisions — buffer or not, flush or not, block or drop, same thread or another — and each one trades latency , throughput , and durability against the others. This post walks the whole chain, from the method call down to the bytes hitting the disk platter. If you've ever wondered why your p99 latency has a mysterious spike, why logs vanish after a crash, or what "async logging" actually buys you, this is for you. First, the map: facade vs. implementation Java logging is a two-layer cake, and mixing up the layers is the #1 source of confusion. The facade is the API your code calls. The implementation is what actually writes the bytes. your code │ log.info(...) ▼ ┌───────────────────────────────┐ │ Facade: SLF4J (or Log4j2 API)│ ← the interface you compile against └──────────────┬────────────────┘ │ bound at runtime ┌───────────┼────────────┬──────────────┐ ▼ ▼ ▼ ▼ Logback Log4j2 Core java.util.logging ... (the engine that buffers, formats, and flushes) SLF4J — the de-facto standard facade. Your app should log against this. Logback — the reference SLF4J implementation. Solid, widely deployed. Log4j2 — the performance-focused implementation, famous for its lock-free async loggers. java.util.logging (JUL) — built into the JDK, rarely chosen on purpose. Why the split? So you can swap engines without touching a single log. call. Everything interesting in this post — the buffering, the flushing, the async magic — happens in the implementation layer. The anatomy of a single log call Before we talk flushing, let's see what one log.info(...) actually does. There are five stages: 1. Level check → is INFO enabled for this logger? (cheap, often the fastest bail-out) 2. Build LogEvent → capture message, timestamp, thread, MDC context, maybe a stack trace 3. Filter → run any configured filters 4. Layout / encode → turn the event into bytes ("2026-07-28 12:00:01 INFO ...") 5. Append → write those by

2026-07-29 原文 →
AI 资讯

The file conversion tools I actually reach for (instead of installing FFmpeg again)

Every few months I hit the same wall. A client sends over a .mov file that needs to end up as an .mp4 for a web page, or someone drops a .heic photo in Slack and asks why it "won't open" on their Windows machine. My first instinct used to be brew install ffmpeg and then spend twenty minutes remembering the flags. These days I don't bother unless the job actually needs scripting or batch automation. Here's what's actually in my rotation, and when I reach for each one. When it's a one-off file and I just need it done If I'm not going to touch this format again for another six months, I'm not installing anything. Browser-based converters have gotten good enough that for a single file, they're just faster. CloudConvert is usually my first stop for anything document or spreadsheet related — it handles a wide range of formats and the interface doesn't get in the way. AhaConvert is what I use when it's image or audio work specifically; it's fully browser-based, no account needed, and it deletes uploaded files automatically after 24 hours, which matters if the file has anything client-confidential in it. Neither one requires me to think about dependencies or version conflicts, which honestly is 90% of why I use them. For quick audio grabs — pulling an MP3 out of a video file someone sent, or converting an old .wma voice memo — I've had good results with Online-Convert too. It's not pretty, but it's reliable and doesn't nag you to create an account. When I need to batch-process a folder This is where the browser tools stop being useful and FFmpeg earns its keep. If I'm converting 200 images or normalizing audio levels across a podcast archive, nothing beats a script I can rerun. for f in * .wav ; do ffmpeg -i " $f " -acodec libmp3lame " ${ f %.wav } .mp3" done I know this loop by heart at this point. If you're doing this regularly, it's worth the setup pain once and never thinking about it again. When it's part of a pipeline If file conversion is happening inside an app — sa

2026-07-29 原文 →
AI 资讯

The 8 Most Expensive Unit Conversion Mistakes in Engineering History — and the Software Bugs That Caused Them

TL;DR Eight engineering disasters. Zero arithmetic errors. Every single one was caused by two numbers — both correct, both carefully computed — meaning different things on opposite sides of a software interface. One cost $65 billion. Another killed 28 soldiers because 0.1 can't be represented in binary. The fix is never the math. The fix is the label. There is a particular kind of silence in a control room when someone realizes the number on the screen is in the wrong unit. It lasts about two seconds. Then it's replaced by the kind of noise nobody wants to hear. On September 23, 1999, that silence happened at the Jet Propulsion Laboratory in Pasadena, California. The Mars Climate Orbiter had just disappeared behind the planet. Telemetry showed the spacecraft at 57 kilometers above the surface. It was supposed to be at 140. The silence was four seconds long. Then someone said "oh no" — the official NASA transcript uses a stronger word — and $327 million of aluminum, titanium, and human effort disintegrated into the Martian atmosphere. What follows are eight stories about the same bug, wearing different uniforms. Some are famous. Some you've never heard of. Two of them are pure software failures that every developer who's ever written for (let i = 0; i < 10; i += 0.1) has come within a rounding error of replicating. 1. The Patriot Missile — When 0.1 Is Not 0.1 (1991) Let's start with the one that belongs in every CS curriculum. Because this isn't a "unit conversion" error in the traditional sense — nobody confused meters and feet. The error was in the way a computer counted time. And it killed 28 American soldiers in a warehouse in Dhahran, Saudi Arabia. The MIM-104 Patriot missile system tracks incoming targets using a phased-array radar. The radar scans the sky, and the fire-control computer predicts where the target will be when the interceptor arrives. That prediction depends on knowing exactly when the radar echo returned. Time is measured by the system's interna

2026-07-29 原文 →
AI 资讯

Excited to launch my latest full-stack project: NeighborHelp! 🤝✨

Have you ever been in a situation where you needed immediate help from someone nearby? Maybe you needed a blood donor, a local electrician, emergency transportation, pet care, or just someone in your neighborhood who could help quickly. Finding the right person at the right time isn't always easy. That's exactly why I built NeighborHelp — a modern community platform that helps people connect with nearby neighbors and provide or receive help in real time. 🌐 Live Demo: https://neighborhelp99.vercel.app 💡 What Makes NeighborHelp Special? 📍 Smart Location-Based Help NeighborHelp uses real-time location to show nearby help requests with distance filters like: Within 5 km Within 10 km Within 25 km Anywhere This makes finding nearby help simple and fast. 💬 Real-Time Chat Users can instantly communicate using a built-in chat system powered by Socket.io. Features include: Online status Live typing indicators Instant messaging Everything updates in real time without refreshing the page. 🔔 Instant Notifications Urgent requests shouldn't wait. NeighborHelp instantly sends: Web Push Notifications Automated Email Alerts so people can respond as quickly as possible. 🏆 Community Reputation System Helping others deserves recognition. The platform includes: 10-level badge system Reputation points Community success stories to encourage active participation and build trust. 🤖 NeighborBot AI Assistant An integrated AI assistant helps users by: Answering common questions Guiding new users Suggesting helpful actions Making the platform easier to use 🛡️ Secure Authentication Security was one of my top priorities while building this project. Features include: JWT Authentication Express Rate Limiting OTP-based Password Recovery Protected APIs 🛠️ Tech Stack Frontend Next.js 16 React Tailwind CSS Vanilla CSS Backend Node.js Express.js Socket.io Web Push API Database & Deployment Supabase PostgreSQL Vercel 💻 What I Learned Building NeighborHelp from scratch helped me gain hands-on experience wi

2026-07-29 原文 →
AI 资讯

Two ceilings: taking a Go DNS server from 500 to 9,500 QPS

I run HydraDNS, an open-source DNS security gateway in Go. Last month I sat down to find out what one box could actually handle before I put it on anyone else's network. The plan had a rule I'd written for myself: every number we discover becomes either a sales claim or a fix ticket. No number, no claim. I expected to find one bottleneck. I found two, stacked on top of each other, and a third thing I wasn't looking for: a data structure in our own documentation that had never existed in the code. Everything below was measured on a 22-core dev machine with load generated inside the container, using dnspyre, so docker-proxy and host networking stay out of the numbers. It's not appliance hardware and I'm not making appliance claims. The shapes are what matter. The first ceiling: ~500 QPS, and it didn't care what I threw at it The first redline run capped at roughly 500 queries per second. Fine, servers have limits. What made it interesting was that the cap didn't move. Blocked queries: ~500. Cached queries that never touch upstream: ~500. Two code paths that do completely different work, hitting the same wall, with the CPU sitting under 30% of 22 cores. That signature is worth memorizing. When two very different paths hit the same ceiling and the CPU is bored, the bottleneck isn't in either path. It's in something they share, or something upstream of both. Ours was in the blocklist check. IsBlocked ran a SQL COUNT against a 92k-row blocklist_entries table on every query . Not just candidate blocks, every query, because the check sits in front of the cache, so even cache hits paid for it. And all of those reads were serialized through a single SQLite connection, MaxOpenConns=1 , which was also absorbing the async write traffic from query logging. The engine's self-measured latency under load: p50 of 50ms, p99 of 5000ms. Five full seconds at the tail, for DNS, which is supposed to be the fast part of the internet. The part where I found out our docs were lying Here's the

2026-07-29 原文 →
开发者

Fast & Lightweight Online CRC Calculator

Hi everyone, I built a simple, fast, and lightweight online CRC calculator tool for embedded systems and developers. URL: https://crc-calc.com Features: Supports standard CRC polynomials (CRC-8, CRC-16, CRC-32, etc.) Custom polynomial & bit reflection settings No signup required I'd love to hear your feedback or suggestions!

2026-07-29 原文 →
AI 资讯

How I Built My Own AI Platforms as a 2nd-Year Engineering Student 🚀

markdown Hello Dev Community! 👋 I’m Anshul Raturi , a Full-Stack Software Developer and 2nd-year Computer Engineering student at Pithuwala Polytechnic in Dehradun, Uttarakhand, India. Today, I want to share my journey of building and launching two AI platforms from scratch: RaturiHub AI and MAX AI Assistant . 💡 The Problem As a developer, I use AI tools daily for coding, brainstorming, and research. However, I found that most mainstream AI wrappers are either cluttered with unnecessary features or lock their best performance behind expensive enterprise paywalls. I wanted a sleek, blazing-fast, and distraction-free AI workspace for my daily coordination and private Q&A. When I couldn’t find the perfect tool, I decided to engineer it myself. 🛠️ Building RaturiHub AI & MAX AI Over the past few months, I poured my skills in JavaScript, Python, C++, and Web Development into creating two distinct AI applications: RaturiHub AI (RaturiGPT) : An intelligent, highly responsive AI platform focused on smart chat and seamless admin coordination. MAX AI Assistant : Designed for a premium, secure, and highly optimized conversational experience. I focused heavily on the UI/UX, ensuring that the interface feels glass-like, modern, and completely intuitive. Performance optimization was key—I wanted the response latency to be as minimal as possible. ### 🚀 We Are Live on ProductHunt! Building these platforms solo was a massive learning curve, from handling API integrations to perfecting the frontend design. Today, I am thrilled to announce that RaturiHub AI is officially live on ProductHunt! 🎉 I would love for the developer community here to check it out. Your feedback on the UI, speed, and overall experience means the world to me. 🔗 Check out RaturiHub AI : [Link to your ProductHunt page or App] 🔗 My Official Portfolio : https://anshulraturi2009.github.io/portfolio/ ### 🤝 Let's Connect! I am always looking to connect with fellow developers, tech enthusiasts, and mentors. Let’s talk ab

2026-07-29 原文 →
AI 资讯

MCP Usage Metering: Track Agent Tool Calls Without Billing Surprises

An AI agent can turn one user request into a small storm of model calls, MCP tool calls, retries, partial failures, and background work. If you only meter the final response, you are guessing. If you meter every low-level event without context, you create noise customers will not trust. That is the billing trap many AI product builders are walking into: the product feels simple, but the usage behind it is multi-step, non-deterministic, and easy to dispute. MCP makes this more urgent. The Model Context Protocol gives agents a standard way to call tools, but a standard tool call is not the same thing as a fair usage meter. A production meter needs to answer harder questions: Which customer, workspace, user, and agent run caused the call? Was it read-only or write-capable? Was the call retried, duplicated, cached, rejected, or actually executed? Did it hit a paid upstream API? Should it count toward quota, invoice, abuse limits, or only observability? Can you explain the charge without exposing private prompt or customer data? This guide shows a practical MCP usage metering architecture for solo developers, micro product teams, and AI platform builders who need cost control without surprising users. Why MCP Usage Metering Is Different From Token Tracking Token tracking is mostly linear. You send a prompt, receive a response, and record input tokens, output tokens, model, latency, and cost. Agent tool usage is messier. A single request like "research these accounts and update the CRM" might trigger: A retrieval call to fetch customer rules A search tool call for each account A browser or enrichment call for missing fields A CRM read A CRM write proposal A human approval pause A final write call A summary response Some calls are internal. Some are customer-visible. Some are expensive. Some are dangerous. Some are free but should be rate limited. Some fail after doing real work. Some are retried by the agent, the SDK, the queue, or the network layer. If you charge blindly

2026-07-29 原文 →
AI 资讯

Agent Reach installs the tools, then gets out of the way

Agent Reach is easiest to understand as a setup layer: it gives a command-capable coding agent a local toolbox, then stops being the center of the workflow. What is Agent Reach CLI for? Agent Reach CLI is a local, open-source coordinator for AI coding agents that can run shell commands; it is not a hosted scraping API, managed crawler, or cloud browser service. The practical job is narrower and more useful: choose platform utilities, install them, verify they work, and route the agent toward the right upstream tool. The current setup story should be pinned to Agent Reach v1.5.0, with package metadata listing Python >=3.10 and an MIT license . The v1.5.0 release was published on June 11, 2026, and describes 162 total tests plus 32 end-to-end real-machine tests across 13 channels . That matters because the project is handling brittle platform tooling, not exposing one stable universal API. "Selects, installs, health-checks and routes" is the core model described by the Agent Reach project, which means the agent still calls tools such as OpenCLI, yt-dlp, GitHub CLI, Jina Reader, feedparser, and platform CLIs directly (source: Agent Reach GitHub repository ). Out of the box, the zero-config surface is deliberately limited: public web reading via Jina Reader, YouTube, GitHub, RSS, Exa Search, V2EX, and basic Bilibili are listed in the install guide . The seed video frames the tool as a way to give agents access to social and web platforms, but builders should read that through the repo’s stricter model: Agent Reach installs and checks local capabilities; it does not remove login, cookie, or platform constraints . Prerequisites before pipx Agent Reach prerequisites are mostly local-environment prerequisites: use Python >=3.10, a shell-capable workstation, and accounts where you can manage CLIs, browser sessions, environment variables, and cookies deliberately . Treat the setup as installing a local capability layer for an AI coding agent, not as signing up for a hosted sc

2026-07-29 原文 →
AI 资讯

How to safely run AI-generated code — a practical sandboxing checklist

Cross-post. Original: stellarbytecapital.com/blog/how-to-run-ai-generated-code-safely If you're building an AI agent, sooner or later it will write code and you'll have to run that code. The moment you do, you're executing something no human reviewed against your infrastructure. This is a practical checklist for doing that safely — the controls we use in production, in the order they matter. The short version: treat every piece of AI-generated code as hostile, and design so that even a full compromise of the runtime buys the attacker nothing. First, the threat model Before controls, be honest about what can go wrong when you run untrusted code: It reads or exfiltrates data belonging to other users on the same host. It reaches out to the network to leak data or pull a payload. It leaves state behind — temp files, mutated env, background threads — that corrupts the next run. It exhausts CPU, memory, or disk and takes down the shared service. It escapes the sandbox entirely via a kernel or runtime bug. "The model probably won't do that" is not a control. Design for the case where it does. The core pattern: one disposable sandbox per execution The single highest-leverage decision: run every execution in its own fresh sandbox, and destroy it after the run. Never reuse. Reuse is where most bugs and attacks live — leaked file descriptors, leftover temp files, mutated globals, a background thread from the last run. If nothing is ever reused, that entire class of problems disappears. To keep it fast, keep a warm pool of ready sandboxes and backfill each one as it's consumed. The checklist Isolation boundary — use a real boundary, not a language-level "safe eval." A container is the baseline; a microVM ( gVisor , Firecracker ) is stronger against kernel escapes. Network egress: default-deny — no outbound network by default. An escaped agent that can't reach the internet has nowhere to send data. Filesystem: read-only + ephemeral — mount inputs read-only; give a scratch space

2026-07-29 原文 →
AI 资讯

Building a Modern Rate Limiter and DDoS Protection Library for Python

Rate limiting is one of those features every production API eventually needs. Whether you're building a public REST API, a WebSocket service, or an authentication endpoint, you'll eventually face problems like: Credential stuffing Brute-force attacks API abuse Bots scraping your endpoints Unexpected traffic spikes Most applications solve this with a simple request counter. But after building several APIs with Django, FastAPI, and Flask, I realized that production traffic requires much more than "X requests per minute." That observation led me to build drogue , an open-source Python library for rate limiting and traffic protection. The Problem Traditional rate limiting is straightforward: Allow 100 requests per minute. This works well for many cases, but real-world applications quickly expose its limitations. For example: A distributed attack can remain below the per-IP limit. A bot can rotate through proxies. WebSocket connections often require different handling than HTTP requests. Different endpoints need different protection strategies. I wanted a system that could go beyond simple request counting. Design Goals From the beginning, I focused on a few principles. 1. Clean framework integration I didn't want endpoint functions filled with framework-specific plumbing. Instead, the library should feel like a natural extension of the framework. from fastapi import FastAPI from drogue.adapters.fastapi import DrogueLimiter app = FastAPI () limiter = DrogueLimiter ( app , default_limits = [ " 100/minute " ]) @app.get ( " /users " ) @limiter.limit ( " 10/minute " ) async def users (): return { " status " : " ok " } No additional request objects. No complicated middleware configuration. Minimal boilerplate. Multiple Rate Limiting Algorithms Different applications require different algorithms. Instead of supporting only one approach, drogue includes multiple options: Token Bucket Sliding Window Fixed Window Each has different trade-offs between accuracy, burst handling, and

2026-07-29 原文 →
AI 资讯

ViciDial "Campaign Has No Dialable Leads" — List & Hopper Troubleshooting

ViciDial "Campaign Has No Dialable Leads" — List & Hopper Troubleshooting Master the root causes of no dialable leads errors and regain full campaign productivity through systematic list validation, hopper configuration, and database troubleshooting. Prerequisites Before troubleshooting, ensure you have: SSH access to your ViciDial server with sudo privileges Access to the ViciDial web admin panel at /vicidial/admin.php MySQL/MariaDB command-line access to the asterisk database Understanding of basic ViciDial campaign structure (lists, dialers, agents) Root or asterisk-user permissions to check Asterisk processes Recent backups of your ViciDial database and configuration files A test campaign with known lead counts for validation The "Campaign Has No Dialable Leads" error typically appears when: The dialer attempts to initiate calls but the hopper queue is empty All records in the lead list have been exhausted or marked as non-dialable List settings conflict with campaign configuration The database connection between ViciDial and the dialer is broken Lead filtering rules remove all records from the dialable pool Understanding ViciDial List Architecture The Lead Lifecycle in ViciDial Every lead in ViciDial passes through status states that determine dialability. A lead is considered "dialable" if it matches specific criteria based on campaign and list configuration. Lead Status States: NEW — Fresh lead, never contacted QUEUE — Scheduled for dialing CALL — Currently being dialed LEFT MESSAGE — Voicemail was left CALLED — Contacted but not completed XFER — Transferred to another department XFER SEND — Pending transfer INCALL — Active call in progress CBHOLD — Callback hold status CBSCHED — Callback scheduled DNCC — Do Not Call Compiled DNCL — Do Not Call List The status field in the vicidial_list table controls whether a lead can be dialed again. Most campaigns set a maximum dial count limit to prevent redialing exhausted leads infinitely. Hopper Mechanism The ViciDial

2026-07-29 原文 →