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

今日精选

HOT

最新资讯

共 29734 篇
第 270/1487 页
AI 资讯 Reddit r/programming

Java String: String Constant Pool(SCP)

After reading all the String documentation and exact code of String class, I find the main engine that makes String in Java (study of deep knowledge) i.e., String constant pool. when we say String s0 = "example1" , String s1 = "example1" and String s2 = "example2" what happens is exactly: at compile time the .class file is genrated when JVM runs the class constant pool of String class get's into work s0 hashcode is generated by intrinsic method and the formula used is standard horner(31) using that hash it need to find the allocated bucket After finding exact hash it need to compare each char by char to check whether it's equal or collison a different char can also have same hashcode. if it's equal the pointer directly to points to that object -->process ends next process works. If not equal there is two work done 1. new object is created on heap memory and then wrapped up by a WeakHandle and pushed in "stringTable" bucket. (if equal no object is created)! there was never an object creation the pointer just points to object . Now the example case: s0 -> hashcode(x1)->not found in "stringTable"->Object creation on Heap-> weakHandle process them into stringTable. s1 -> hashcode(x1)->found->(collision|equal)->equal->pointer points to "example1" from SCP to s1. s2-> hashcode(x2)->not found in "stringTable"->Object creation on Heap-> weakHandle process them into stringTable. After reading and analysing there is also a issue of massive garbage I see: suppose if 4 thread are runnable and they are trying to intern() the object in SCP that creates garbage according to your data size suppose , we used latin-1 type 256B data so total thread is 4 but in CAS only one thread execute rest all thread dumps the object so out of 1KB storage 768B is garbage. if the String was in UTF-16 it would cost 2*768B. {the MM is not actual Java object Layout} https://bugs.java.com/bugdatabase/JDK-6962931 (Shifting from PermGen) HotSpot uses lazy resolution for string literals when a class is loa

/u/Chaos-vy17 2026-07-26 11:34 9 原文
AI 资讯 Dev.to

Building Agents with Claude: Tools, Reasoning, and the MCP Standard

If you are new to the AI space, the term 'agent' can sound intimidating. In reality, an AI agent is simply a language model running in a loop, equipped with tools it can use to interact with external systems. While other companies are building agents deeply tied to their specific data platforms or operating systems, Anthropic takes a model-first approach. They provide Claude, a highly capable reasoning engine, alongside the open-source plumbing needed to connect it to the real world. The Claude Agent Ecosystem There is no single boxed product called a "Claude Agent." Building an agent with Anthropic means assembling several distinct parts: The Core Model: Claude serves as the reasoning engine. It is known for its massive context window and safety-focused training. Tool Use: The API allows Claude to call external functions, allowing it to fetch live data or trigger actions. Model Context Protocol (MCP): An open standard created by Anthropic that standardizes how AI models connect to data sources and tools. The Agent SDK: A framework that handles the complex logic of planning tasks, managing files, and running the agent loop. Claude Code: A practical, real-world example of the Agent SDK in action, designed to work as an autonomous coding assistant inside your terminal. Computer Use: An experimental feature where the model can view screen captures and control a mouse and keyboard to operate standard software. flowchart TD C[Claude Model] --> T[Tool Use API] T --> MCP[Model Context Protocol] MCP --> SDK[Claude Agent SDK] SDK --> CC[Claude Code] C --> CU[Computer Use] Core Components Reasoning and Long Context Claude's primary strengths for agent workflows are its ability to ingest massive amounts of text and its careful approach to problem-solving. Anthropic trains its models using a framework that prioritizes harmless and honest behavior. In an agent context, a model that pauses to ask for clarification is vastly superior to one that confidently executes the wrong acti

Ramkumar M N 2026-07-26 11:34 7 原文
AI 资讯 Dev.to

Building All in One Utility Hub: A Lightweight Toolkit for Developers & Creators"

Hello, DEV Community! 👋 How many times a week do you find yourself searching Google for a simple online tool—like a favicon converter, a typing speed tester, or a quick chart generator—only to land on bloated websites filled with intrusive ads and unnecessary server requests? Frustrated by this exact friction, I decided to build my own centralized solution: All in One Utility Hub . The Vision: Fast, Pure, and Distraction-Free The goal behind All in One Utility Hub is simple: create a suite of micro-utilities that load instantly, require zero setup, and operate entirely in the browser. No heavy frameworks bogging down performance, no forced sign-ups, and no server-side bottlenecks. Just pure, functional client-side tools. What's Currently Inside the Hub? Online Favicon Generator :** Quickly convert any image asset into professional multi-size favicon packages. Online Typing Speed Tester :Track and improve your WPM, CPM, and accuracy cleanly. Free Online Graph & Chart Maker :** Generate visual data charts instantly for reports and presentations. Tech Stack & Architecture The entire suite is built using clean, high-performance HTML5, CSS3, and vanilla/modern JavaScript. By keeping everything client-side, execution is instantaneous, and user data remains private right within the browser session. Explore and Share Your Feedback I built this hub to serve as a handy bookmark for developers, designers, and students alike. You can explore the live project here: 👉 All in One Utility Hub I’m constantly expanding the toolkit with new utilities. What kind of micro-tool do you wish existed online? Let me know in the comments below! Happy coding! 🚀

All in one utility hub 2026-07-26 11:24 6 原文
AI 资讯 Dev.to

AVIF vs WebP vs JPEG: Real Benchmarks (2026)

I compressed 100 photos through 3 formats. Here's the actual data. A 2MB JPEG photo. Convert it to WebP — now it's 480KB. Convert it to AVIF — now it's 310KB. Same visual quality. Three different file sizes. I've spent the last 2 weeks building an image compression tool, so I've seen thousands of these comparisons. Here's what the numbers actually say, and what it means for your website. The Setup I took 50 real-world photos and 50 screenshots/design assets — not synthetic test images, but actual files people would upload: Photos : vacation shots (JPEG, 2-8MB), product photos, portrait selfies Graphics : PNG screenshots (1-4MB), logos, UI mockups, illustrations Source sizes : 500KB to 12MB, average ~3.2MB Each image was compressed through JPEG (quality 85%), WebP (quality 80%), and AVIF (quality 65%) — settings that produce visually identical results on a 2x retina display. The Numbers Format Avg Compressed Size Reduction vs Original Reduction vs JPEG Browser Support Original 3.2 MB — — 100% JPEG (q85) 820 KB 74.4% — 100% WebP (q80) 480 KB 85.0% 41.5% smaller than JPEG 96.8% AVIF (q65) 310 KB 90.3% 62.2% smaller than JPEG 93.1% The headline : WebP halves your JPEG size. AVIF halves WebP again. Photo Results (JPEG source, 50 images) For photographs — the most common use case — here's what happened: Format Avg Size Best Case Worst Case JPEG q85 820 KB 180 KB 3.1 MB WebP q80 480 KB 95 KB 1.8 MB AVIF q65 310 KB 60 KB 1.2 MB What this means : On an average product page with 6 photos: JPEG: 6 × 820KB = 4.9 MB WebP: 6 × 480KB = 2.9 MB (saves 2 MB) AVIF: 6 × 310KB = 1.9 MB (saves 3 MB) On a 4G connection (10 Mbps), that's the difference between 4 seconds and 1.5 seconds to load all images. On a product page, that's the difference between a bounce and a sale. Screenshot/Graphics Results (PNG source, 50 images) PNGs are a different story. Lossy WebP and AVIF can crush PNGs — but only if you're OK losing pixel-perfect accuracy. Format Avg Size Notes Original PNG 1.4 MB Lossles

吴美良 2026-07-26 11:19 6 原文
AI 资讯 Dev.to

Serverless ML Deployment: From Jupyter Notebook to Global API in 10 Minutes (No MLOps Expert Needed!)

Tired of deployments eating up your day? Stop wasting hours. I'm going to show you how to take your Python ML model from a Jupyter notebook to a live, production-ready API in just 10 minutes. Seriously. No MLOps guru required! You've felt that high, right? Building an awesome machine learning model. You nail it. Then… deployment. You hit a wall. How do you get this thing out there so people (or other apps) can actually use it? The leap from your notebook to a real-world, working API can feel like hacking your way through a jungle. Infrastructure setup. Dependency messes. Scaling nightmares. It's a pain. But what if you didn't need weeks, or even days, for that? What if you could close that gap in a mere 10 minutes? Welcome to Serverless ML Deployment . It's fast. It scales. It's simple. The MLOps Maze & Your Escape Route Traditional ML deployment looks like this: Provisioning servers: Picking machines, OS, setting up networks. Dependency management: Making sure every library is just right, versioned correctly. API development: Writing the actual server code, handling requests. Containerization: Wrapping it all in Docker (and Docker itself isn't trivial). Orchestration: Managing containers, scaling them up or down. Load balancing. Monitoring & Maintenance: Watching performance, patching, updates. That's a lot. Every step is another chance for things to go wrong, another delay. This is exactly where serverless technology swoops in. It wipes away almost all that underlying infrastructure. You get to focus on your model. Your predictions. That's it. Why Serverless is Your ML Deployment Secret Weapon When you use serverless for ML deployment, you get some killer advantages: Crazy Fast Deployment: Pre-configured setups mean you're live in minutes. Not hours. Not days. Scales Like Magic (Mostly!): Traffic spikes? No problem. Serverless automatically grows your API to handle it. No requests? Zero cost. It just works. Save Big Bucks: You only pay when your API is actually ru

lakshmankrish77 2026-07-26 11:18 6 原文
AI 资讯 Dev.to

Your ML Model Died in Production. Here's Why.

Did your ML model look amazing in your notebook but tank in the real world? Good. Let's talk about the nasty surprises that trip up model deployments and why that "Train & Forget" approach is bleeding companies dry. It's a story we hear too often. You've spent weeks, maybe months, building some fancy machine learning model. The numbers were off the charts in your Jupyter notebook, validation? Nailed it. You even impressed the suits in the demo. "Eureka!" you thought. "We've built a game-changer!" You felt like a genius. A goddamn genius. Then comes deployment. Your model goes live, supposed to conquer the real world – predicting churn, optimizing logistics, detecting fraud. But instead of delivering... anything? It chokes. It starts to suck. Predictions go wild. That promised ROI? Gone. Poof. What went wrong? You, my friend, might have fallen into the "Train & Forget" trap. This nasty habit in machine learning thinks deployment is the END. Spoiler: it's just the start. It assumes that once a model is trained and deployed, it'll just... work. Forever. Without any ongoing care. And in the messy, unpredictable real world, that assumption is a guaranteed disaster. Millions down the drain. Why You're Tempted to "Train & Forget" (And Why You Shouldn't) Why do so many organizations, despite good intentions, make this mistake? A few reasons: Initial Success Bias: Those great numbers in your sandbox? They make you cocky. Pressure to Deploy: Business urgency often wants it out yesterday. Who cares if it breaks tomorrow? Resource Constraints: Teams might lack the dedicated MLOps engineers or the tech to support ongoing model management. Misunderstanding ML as Software: Thinking ML is like regular software (deploy once, patch occasionally)? It's not. It breathes data. The reality? An ML model's journey starts after it's live. The real world is a messy, evolving place, and your model better be ready. Beyond Your Laptop: What Kills Your Model In Production The gap between develop

lakshmankrish77 2026-07-26 11:16 6 原文
AI 资讯 Dev.to

How Do You Contain an AI Agent Failure You Can't Prevent?

Every part of this series has quietly agreed on one thing: the agent will be wrong sometimes. Part 1 set the bar at "acceptably wrong." Part 3 measured how often. So the last question is not how to stop it from ever failing. It is the one that actually decides whether you can ship: when it is wrong, what is the worst that can happen? That worst case is not fixed. It is a design choice, and it is the one most teams never make on purpose. Blast radius is something you choose Two agents give the same wrong answer. One drafted an email for a human to send. The other sent it. One suggested a refund. The other issued it. Identical mistake, completely different consequence, because someone decided how much power the agent had when it was wrong. You set the blast radius by choosing what the agent is allowed to do, not by hoping it does the right thing. Guardrails: match capability to proven trust Give an agent the least authority the job allows. Let it read before it writes, propose before it executes. An action more dangerous than the agent's measured reliability has earned is a liability you chose. If Part 3 told you a step is right eighty percent of the time, that step does not get to move money unsupervised. Capability should track trust, and trust is a number you now have. Put a human on the expensive failures, and only those Human-in-the-loop is not "approve everything," which kills the speed that made an agent worth building. It is a gate on the small set of actions where a wrong one is irreversible or costly: the disqualifying failures you named in Part 1 (the known abuse modes are catalogued in the OWASP LLM Top 10 ). Everything reversible and cheap runs on its own. Everything that cannot be taken back waits for a person. Make failures reversible and visible Prefer actions you can undo, and log enough to undo them. A dry-run mode, a soft delete, a confirmation step: these turn an incident back into a mistake. And you cannot contain what you cannot see, so trace eve

Sara Mo 2026-07-26 11:16 9 原文
AI 资讯 Dev.to

Stop writing CSS gradients by hand — free generator with Tailwind and SCSS export

Writing linear-gradient(135deg, #667eea 0%, #764ba2 100%) from scratch every time is tedious. Remembering the syntax for radial and conic gradients is even worse. I added a free CSS gradient generator to PaletteCSS that handles all three gradient types with a live visual preview. What it supports linear-gradient — any angle, drag the dial or type degrees radial-gradient — circular and elliptical conic-gradient — pie-chart style, great for progress rings and color wheels Up to 5 color stops with draggable positions Instant copy in 3 formats CSS background : linear-gradient ( 135 deg , #667 eea 0 %, #764 ba2 100 %); SCSS $gradient-primary : linear-gradient ( 135deg , #667eea 0% , #764ba2 100% ); Tailwind style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%)" Try it free 👉 https://palettecss.com/css-gradient-generator No signup. The site also has a browsable gradient library if you want inspiration rather than building from scratch. Any gradient types or export formats you'd want added? Drop a comment.

Avishek Dhimal 2026-07-26 11:13 5 原文
AI 资讯 Dev.to

600 Filters and a 414: The New QUERY Method in .NET 10

A product search, a filter list that kept growing, and a status code I hadn't seen in years. Filters went in the query string, the way they always do. That held up fine until someone saved a "filter set" with a few hundred SKUs in it and the endpoint started answering with 414. I rebuilt a small version of it to find the exact wall. Same search, filters as repeated ?sku= values, count going up in steps of a hundred: 1) GET with filters in the URL 100 filters | request line 1534 bytes | 200 OK 200 filters | request line 3034 bytes | 200 OK 300 filters | request line 4534 bytes | 200 OK 400 filters | request line 6034 bytes | 200 OK 500 filters | request line 7534 bytes | 200 OK 600 filters | request line 9034 bytes | 414 RequestUriTooLong Kestrel's default max request line is 8 KB, and the request line is the method plus the URL plus the HTTP version. Somewhere between 500 and 600 filters, my URL stopped being a URL. Every fix I knew was a compromise. A body on GET is undefined by spec and some proxies quietly drop it. POST works, but POST announces "this might change something", so caches skip it, gateways won't auto-retry it, and anyone reading your API docs has to guess whether POST /search is actually a search. Cramming the filters into a header is the kind of idea that sounds clever for about a day. The method that was missing RFC 10008 defines QUERY , and it's exactly the thing that spot in the matrix was waiting for. The body carries the query. The method is safe and idempotent, so it can be retried after a dropped connection without anyone panicking. Responses are cacheable, and the spec is explicit that the cache key has to be built from "the request content and related metadata". There's also a nice touch on the response side: Content-Location can point at a URL where those exact results can be fetched with a plain GET. The one-line version I keep giving people: it's a GET with a body, and that's the entire point. Wiring it up in ASP.NET Core 10 .NET 10 shi

Sukhpinder Singh 2026-07-26 11:11 7 原文
AI 资讯 HackerNews

Show HN: I mapped every US golf course – 16k+ courses, free, no signup

I got tired of Googling basic course info, so I made a free directory of every US course Google filters for golf course results are terrible so I built a better way to browse courses using OSM as the backbone.... https://golfcoursebrowser.com/ It's a work in progress and mostly US for now, but I want to expand to the rest of North America, the EU, and the rest of the world ASAP. It's free, no ads, no login, no bs. If you spot anything wrong (bad info, a missing course, wrong scorecard), you can

rickmf 2026-07-26 10:22 4 原文
AI 资讯 HackerNews

Show HN: What 180k words look like as a temporal knowledge graph (Oz series)

The graph is free to explore and requires no registration. SynapTale builds a model of a story as a temporal graph made up of nodes (entities) and edges (their actions and relationships). The graph is not a visualization of the wiki. The wiki, timelines, relationship histories, and analytics are projections of the graph. The current demo contains 232 entities, 1,852 edges, and a snapshot of the story’s state at every chapter. By chapter 100, it still remembers a promise made in chapter 8 and tur

ald0r 2026-07-26 10:18 3 原文
开发者 Reddit r/MachineLearning

Link plots/figures in NeurIPS rebuttal [R]

Reviewers requested additional experiments. In table format, I fear the results would not be as digestible as in a figure/plot. Links are "technically" not allowed as per the official website, but for those with experience, can/should I still go ahead and link my plots/figures ? If this goes badly, will this be a slap on the wrist, or outright rejection? Has anyone taken a chance with this in the past? How did it turn out? IMO openreview should really start supporting more modern markdown to allow figure embeds. submitted by /u/confirm-jannati [link] [留言]

/u/confirm-jannati 2026-07-26 10:12 5 原文