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

今日精选

HOT

最新资讯

共 37192 篇
第 1742/1860 页
AI 资讯 Dev.to

Azure API Management - Deploy gRPC API on Azure API management using self hosted gateway

This is a complete guide with steps by step process to deploy the gRPC and how to use Azure API Management to import the gRPC API. It cover step‑by‑step guide to deploying a gRPC API on Azure API Management (APIM), grounded in the Microsoft documentation and a real-world deployment workflow. NOTE: This post is published already in GITHUB here. https://github.com/shailugit/apimGrpc/blob/main/README.md The API Management can expose gRPC services, but with important constraints: APIM supports gRPC by importing a .proto file and forwarding calls to a gRPC backend. gRPC requires HTTP/2 end‑to‑end. gRPC APIs are supported in Self-hosted gateway and not supported in APIM v2 tiers. You can't use the test console to test gRPC The major steps claissfied in two major steps Creating a gRPC server Calling the gPRC application using APIM 1. Creating gRPC Application Typical backend deployment steps include the following Create a .NET gRPC server application Create a .NET gRPC client application Test the setup locally Publish the .NET gRPC server to Azure WebApp and verify the service works directly over HTTPS Step-1 As a first step we will be building a .NET gRPC server application. You can skip this step in case you already have gRPC server application. If you would like to view .NET Core sample used for this sample project, please visit here . Step-2 As a second step we will be building a .NET gRPC client application. You can skip this step in case you already have gRPC client. If you would like to view .NET Core client used for this sample project, please visit the below here . Step-3 Once your client and server code is ready here are the steps to Test your application locally Step-4 Deploy the server to Azure WebApp To understand how-to deploy a .NET 6 gRPC app on App Service, please visit here . Please make sure to enable HTTP version, Enable HTTP 2.0 Proxy and add HTTP20_ONLY_PORT application setting as gRPC only work using http2.0 as shown below 2. Calling gRPC from APIM T

shailugit 2026-05-31 11:25 12 原文
AI 资讯 Dev.to

I Built pretext-pdf: Serverless PDFs Without Chromium

I Built pretext-pdf: Serverless PDFs Without Chromium I got frustrated with PDF generation in Node.js. Every tool had trade-offs, and none of them felt right. The Problem Every time I needed to generate PDFs programmatically, I hit the same walls: Puppeteer — Renders HTML to PDF beautifully, but takes 500ms-2s per page. Way too slow for batch operations. wkhtmltopdf — Old, fragile, breaks in production, dependency hell. pdfmake — Good for simple invoices, falls apart with complex layouts. All of them — Overkill if you're not rendering HTML. And here's the kicker: I didn't need to render HTML. I had structured data (invoices, reports, certificates) that I needed to turn into PDFs programmatically . The Solution I built pretext-pdf — a JSON-based PDF generation library. Instead of: javascript // ❌ Puppeteer: render HTML const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.setContent(html); const pdf = await page.pdf(); // 1000ms+ You do: // ✅ pretext-pdf: define structure const doc = { sections: [ { type: 'heading', text: 'Invoice' }, { type: 'table', rows: [...] } ] }; const pdf = await renderPDF(doc); // 40-100ms No Chromium. No external dependencies. Pure Node.js. Why This Matters If you're building: ✅ Invoice generation systems ✅ Dynamic reports for your SaaS ✅ AI agents that create PDFs (Claude, Cursor, Windsurf) ✅ Certificate systems ✅ Multi-language documents ...pretext-pdf is built for you. Today: v2.0.14 Launch I just shipped a major upgrade. The text layout engine (which handles how words break across lines) is now significantly better: Better CJK + Latin mixed-script handling Smarter punctuation (quotes stay with their text) 7-12% faster Zero breaking changes The Stats 337 tests passing — production-ready 0 critical vulnerabilities — secure MIT licensed — free to use Open source — contribute or fork Technical Foundation The layout engine is based on pretext by Cheng Lou (React core team). I cherry-picked 11 patches for

Himanshu Jain 2026-05-31 11:22 15 原文
AI 资讯 Dev.to

Lottie JSON vs .lottie Format — What's the Difference and Which Should You Use?

Two file formats. Same animations. Very different performance characteristics. If you've used Lottie before, you know the .json file — you export it from After Effects with the Bodymovin plugin, drop it into lottie-web, done. But there's a newer format: .lottie. It's a binary container that replaces the JSON, and if you're starting a new project, it's worth understanding the difference. What is Lottie JSON? The original format. A .json file that describes vector animations: shapes, keyframes, layers, colors, timing. It's plain text, human-readable, and widely supported. Pros: Works everywhere Lottie is supported Human-readable (you can inspect and edit it) Supported by every tool and library Cons: Large files (uncompressed JSON with lots of repeated data) No built-in support for multiple animations in one file No metadata or preview image support What is .lottie? The .lottie format (sometimes called dotLottie) is a ZIP container with a .lottie extension. Inside it contains: The animation data (compressed JSON) A manifest.json describing the file Optional preview images Optional multiple animations in one container It was developed by LottieFiles and adopted as the preferred format for modern Lottie tooling. Pros: ~30-70% smaller than equivalent JSON (thanks to compression) Can contain multiple animations in one file Supports preview thumbnails Cleaner API in the @lottiefiles/dotlottie-web renderer Cons: Binary format — not human-readable Requires the dotLottie player (not the older lottie-web) Slightly less universal support File Size Comparison For a typical 2-second UI animation: Format Typical Size Lottie JSON (.json) 40 – 120 KB dotLottie (.lottie) 15 – 50 KB The size reduction comes from standard ZIP compression applied to the JSON content. It's meaningful on mobile connections. Converting Between Formats The easiest way to convert between .json and .lottie formats is using the free browser-based tools at IconKing . No signup required, no file size limits. Just

Fazal Shah 2026-05-31 11:22 11 原文
AI 资讯 Dev.to

SVG Icon Systems in 2025 — Everything You Need to Know

Every web app needs icons. How you manage them at scale — that's where most teams make mistakes. This is the complete guide to building an SVG icon system that doesn't fall apart as your app grows. Why SVG (Not Icon Fonts or PNG) Icon fonts (FontAwesome, etc.) are the legacy approach. The problems: One broken font file breaks all icons Accessibility is terrible (screen readers read the unicode character) Crispy rendering requires specific font-smoothing hacks No multi-color support PNG icons are dead for UI work. Blurry on Retina, can't be styled with CSS, fixed file per size. SVG wins: Infinitely scalable, pixel-perfect on any screen Styleable with CSS ( currentColor , fill, stroke) Accessible with proper ARIA labels Can animate with CSS or SMIL Single format handles all sizes Where to Get Free SVG Icons IconKing SVG Library — 254+ free SVG icons in flat and outline styles. Covers UI, social media, food, objects, and more. Downloadable as individual SVG, AI, or PNG files. No account required. What sets IconKing apart: many icons have matching animated Lottie versions in the Lottie library — useful when you want an animated hover state that matches your static icon. Other solid free sources: Heroicons (heroicons.com) — MIT, Tailwind-made, 292 icons Phosphor Icons (phosphoricons.com) — MIT, 1,248 icons, 6 weights Lucide (lucide.dev) — ISC, 1,400+ icons, React/Vue packages Tabler Icons (tabler.io/icons) — MIT, 5,000+ icons Method 1: Inline SVG Best for: small number of icons, need CSS styling <!-- Inline the SVG directly --> <button aria-label= "Close" > <svg width= "20" height= "20" viewBox= "0 0 24 24" fill= "none" stroke= "currentColor" stroke-width= "2" > <line x1= "18" y1= "6" x2= "6" y2= "18" /> <line x1= "6" y1= "6" x2= "18" y2= "18" /> </svg> </button> The stroke="currentColor" means the icon inherits its color from the parent element's CSS color property — trivial theming. Method 2: SVG Sprite Best for: many icons, better performance (single HTTP request) Bui

Fazal Shah 2026-05-31 11:20 13 原文
AI 资讯 Dev.to

My Trading Bot Tried to Execute the Same Trade Twice. That Became SafeAgent.

This is a submission for the GitHub Finish-Up-A-Thon Challenge The Bug That Doubled Real Trades On May 21, my live trading bot generated six duplicate execution attempts in one session. SafeAgent blocked all six. Without the guard: one duplicated a $1,350 sell another doubled a TQQQ position total duplicate transaction exposure: $3,653 That session changed how I think about AI agents, retries, and execution guarantees. What I Built SafeAgent is an exactly-once execution guard for AI agents and SaaS applications. It prevents duplicate payments, emails, trades, and webhook processing when retries fire after a timeout or crash. Live endpoint: https://safeagent-production.up.railway.app GitHub: https://github.com/azender1/SafeAgent PyPI: pip install safeagent-exec-guard The Comeback Story How it actually started Six months ago I was building two things at once: PeerPlay — a patented P2P wagering exchange for skill-based video game tournaments (USPTO provisional 63/914,036) — and a live QQQ/TQQQ momentum trading bot running on Alpaca Markets. Both hit the same bug. Contest verification agent times out, retries, settlement fires twice. Bot order fills, confirmation drops, retry fires, doubled position. Same failure mode. Different domain. Different models pushed me toward very different architectures during development. Some were fast but overconfident. The most useful moments came when a model explained why an approach was broken before I implemented it. That's part of why SafeAgent sat unfinished. Not just time — wrong turns that burned momentum. Why local idempotency fails Early versions used a local SQLite guard. It worked until it didn't: workers restart and the in-memory state is gone containers reschedule and replay from the last checkpoint retries land on a different machine entirely Exactly-once semantics require a durable coordination boundary outside the worker itself. That's what the hosted /claim endpoint provides — the claim lives on the server, not in the p

Anthony Zender 2026-05-31 11:11 11 原文
AI 资讯 Dev.to

Free Loading Animations for Web Apps — Lottie, GIF, and SVG Spinners (2025)

Loading states are one of the most overlooked parts of app UX. A bad spinner makes an app feel cheap. A good loading animation makes wait time feel intentional. Here's a curated list of free loading animations you can use right now, organized by format. Lottie Loading Animations (Best Quality) Lottie is the gold standard for loading animations in 2025. Files are small (5-30KB), resolution-independent, and perfectly smooth at any size. IconKing Free Lottie Loaders — 500+ free Lottie animations including dozens of loading spinners, progress indicators, and transition animations. Download as JSON, no account required. Preview any file before downloading at iconking.net/preview . Customize colors to match your brand at iconking.net/editor — swap any color in-browser. Implementation (React): import { useEffect , useRef } from ' react ' ; import lottie from ' lottie-web ' ; function Loader ({ size = 80 }) { const ref = useRef ( null ); useEffect (() => { const anim = lottie . loadAnimation ({ container : ref . current , renderer : ' svg ' , loop : true , autoplay : true , path : ' /animations/loader.json ' }); return () => anim . destroy (); }, []); return < div ref = { ref } style = { { width : size , height : size } } />; } Implementation (Vanilla JS): import lottie from ' lottie-web ' ; lottie . loadAnimation ({ container : document . getElementById ( ' loader ' ), renderer : ' svg ' , loop : true , autoplay : true , path : ' /animations/loader.json ' }); Convert Lottie Loaders to GIF Need the loading animation as a GIF for emails, Notion docs, or environments where you can't run JavaScript? Free Lottie to GIF Converter — upload your JSON, get a GIF. Browser-based, no signup. Other export formats available at iconking.net: Lottie to WebP — animated WebP, smaller than GIF Lottie to APNG — animated PNG with transparency Lottie to MP4 — for video embeds Lottie to WebM — transparent video Lottie to SVG — static frame as SVG CSS SVG Spinners (Zero Dependencies) For simple l

Fazal Shah 2026-05-31 11:08 11 原文
AI 资讯 Dev.to

How to Add Lottie Animations to Your Website (Free JSON Files Included)

Lottie animations are small, crisp, and interactive. This guide covers finding free animations through production-ready implementation. What Is Lottie? Lottie is a JSON-based animation format from Airbnb. After Effects animations are exported via Bodymovin as small JSON files (10-100KB), rendered by a lightweight JS library. Key advantages over GIF: 10-50x smaller file size Resolution independent vector quality on any screen Interactive — play, pause, seek, speed control Full alpha transparency — no halo effects Step 1: Get Free Lottie JSON Files IconKing Free Lottie Library — 500+ free animations: UI icons, loaders, flags, illustrations. No account needed. Preview any file first: iconking.net/preview — drag and drop to instantly see how it plays. Edit colors and speed: iconking.net/editor — swap colors, adjust timing, all in-browser. Step 2: Install lottie-web npm install lottie-web Or CDN: <script src= "https://cdnjs.cloudflare.com/ajax/libs/bodymovin/5.12.2/lottie.min.js" ></script> Step 3: Basic Implementation import lottie from ' lottie-web ' ; const animation = lottie . loadAnimation ({ container : document . getElementById ( ' lottie-container ' ), renderer : ' svg ' , loop : true , autoplay : true , path : ' /animations/my-animation.json ' }); Step 4: React Component import { useEffect , useRef } from ' react ' ; import lottie from ' lottie-web ' ; function LottieAnimation ({ src , loop = true , size = 200 }) { const ref = useRef ( null ); useEffect (() => { const anim = lottie . loadAnimation ({ container : ref . current , renderer : ' svg ' , loop , autoplay : true , path : src }); return () => anim . destroy (); }, [ src ]); return < div ref = { ref } style = { { width : size , height : size } } />; } Step 5: Playback Controls animation . play (); animation . pause (); animation . setSpeed ( 1.5 ); animation . goToAndStop ( 30 , true ); // frame 30 animation . playSegments ([ 0 , 60 ], true ); // frames 0-60 only animation . addEventListener ( ' complete

Fazal Shah 2026-05-31 11:07 11 原文
AI 资讯 Dev.to

Idempotency Keys: The One API Pattern That Prevents Duplicate Payments (and Worse)

You hit "Submit Order" and nothing happens. The spinner just spins. Is it processing? Did the request get lost? You click again. If the API on the other end does not implement idempotency, you just placed two orders. Maybe two charges to your card. This is a solved problem — and the solution is simpler than you think. What Is Idempotency? An operation is idempotent if doing it multiple times produces the same result as doing it once. GET requests are naturally idempotent — fetching a resource does not change it. DELETE is also idempotent in practice. The trouble is POST and PATCH : create an order twice, and you get two orders. An idempotency key is a client-generated unique identifier (usually a UUID) that you send with a mutating request. The server stores this key with the result. If the same key arrives again — whether due to a retry, a network blip, or an impatient user — the server returns the cached result instead of executing the operation again. Implementing Idempotency on the Server Here is a minimal Express implementation backed by Redis: const express = require ( " express " ); const redis = require ( " ioredis " ); const { v4 : uuidv4 } = require ( " uuid " ); const app = express (); const cache = new redis (); app . use ( express . json ()); // TTL for idempotency records: 24 hours const IDEMPOTENCY_TTL = 86400 ; async function idempotencyMiddleware ( req , res , next ) { const key = req . headers [ " idempotency-key " ]; if ( ! key ) return next (); // optional on GET/DELETE const cached = await cache . get ( `idem: ${ key } ` ); if ( cached ) { const { status , body } = JSON . parse ( cached ); return res . status ( status ). json ( body ); } // Intercept the response to cache it const originalJson = res . json . bind ( res ); res . json = async ( body ) => { if ( res . statusCode < 500 ) { await cache . setex ( `idem: ${ key } ` , IDEMPOTENCY_TTL , JSON . stringify ({ status : res . statusCode , body }) ); } return originalJson ( body ); }; next ();

Mean 2026-05-31 11:02 6 原文
AI 资讯 Dev.to

CONFIGURING SEMANTIC MODEL IN POWER BI

INTRODUCTION Configuring a Power BI semantic model involves refining data structures, creating relationships, and setting up calculations. Semantic model is the last stop in the data pipeline before reports and dashboards are built. It is the end product of the raw data that has been extracted, transformed, loaded, modeled, built relationship, and written calculation. The Semantic model consist of Data connections to one or more data sources, Transformations that clean and prepare the data for reporting, Defined calculations and metrics based on business rules to ensure consistent reports and Defined relationships between tables. Key words to note in Semantic Modelling are; 1. Fact table and Dimension table: The Fact table records the quantitative and numerical data. It is where every single details are recorded. The Dimension table act as the descriptive companion to the fact table, containing the attributes or characteristics that provide context to the data. 2. Primary and Foreign Key: Primary Keys are unique identifier assigned to a specific record with a database table ensuring that no two rows are identical or repeated. foreign Keys are columns or group of columns in one table that provides a link between data in two tables by referencing the primary key of another. 3. Star Schema Star Schema is a data modeling technique where a central fact table is surrounded by several dimension tables that provide descriptive content. 4. Cardinality Cardinality defines the kind of relationship between two tables. They are; One to Many (1.*) Many to one (*.1) One to One (1.1) Many to Many ( . ) The cardinality of a relationship is described by the "one" (1) or "many" (*) icons located at the ends of the relationship line. 5. Cross Filter Direction The direction determine how filters propagate. Possible cross filter options are dependent on the relationship cardinality type. One to Many - Single or Both sides One to One - Both sides Many to Many - Single to either table or b

Timothy Atinuke 2026-05-31 11:01 12 原文
AI 资讯 Reddit r/webdev

How To: Re-engineer element to create pagination type layouts - walkthru pages/guides, etc...

This requires both CSS and JS, but is otherwise fairly lightweight and minimal. You can see the effect in action here: https://stephenmthomas.github.io/ico2go/ (Just drag and drop the "ICO2GO" logo in the upper left down into the drop zone to begin the conversion. Its also a single filed - embedded CSS and JS so right click view source, save, whatever...) I recently built an SVG to ICO converter (couldn't find one online that did exactly what I wanted, though doubtless one exists) - and I decided for really no reason at all to tweak the details summary elements to serve the main areas of the document in a "step 1 2 3" fashion. I had styled the elements with CSS already - initially to serve as an "about this app" sections - styling it so it fades in and slides to size. Then decided to just use them as a sort of walkthrough wizard... I'm going to present the steps backwards because the CSS at the bottom is technically optional, although it adds a nice touch and I highly recommend both using that CSS and saving it for later use - its a good way to style those elements outside of this somewhat ridiculous use-case. So, essentially, we are going to be using scaffolding like this - completely hidden sections of the page, as large or small as you want, able to be turned on, off or toggle as you see fit. Each page or section or chapter of the DOM will live inside of a detail summary block like so: <details id="areaHelloWorld"> <summary style="display: none;">HIDDEN AREA - HELLO WORLD/summary> <!-- YOUR CONTENT HERE --> </details> Debatable practice abound here, but because the summary is hidden and inlined, you can still use normal detail-summary sections elsewhere. Anyway, depending on your content... there are now sections of the DOM that are unrendered. There is no conventional way - as far as I know - to open/reveal the content in the details section when the summary is not displayed. To hide or show these areas, you simply add the open attribute to the appropriate detai

/u/woroboros 2026-05-31 10:50 5 原文
AI 资讯 Reddit r/webdev

I'm looking for an Android Studio template that build Apk from Html ?

HI people. I'm looking for a template like that. I made a simple Html note app by Claude and want to make it a propher Android app. I don't know coding. I don't think i want to spend year learning this too. I make it just for personal use and won't publish it on google story or anywhere else. I liked Web2apk Builder but it's not free (i don't have money, honestly). But with Android studio i have to deal with hundreds unknow unknow so i wonder if there is a template outhere (maybe on github) that could help me out ? Thank you for your attention to this matter !!! submitted by /u/Moonnnz [link] [留言]

/u/Moonnnz 2026-05-31 10:33 6 原文
AI 资讯 Reddit r/MachineLearning

[D] Monthly Who's Hiring and Who wants to be Hired?

For Job Postings please use this template Hiring: [Location], Salary:[], [Remote | Relocation], [Full Time | Contract | Part Time] and [Brief overview, what you're looking for] For Those looking for jobs please use this template Want to be Hired: [Location], Salary Expectation:[], [Remote | Relocation], [Full Time | Contract | Part Time] Resume: [Link to resume] and [Brief overview, what you're looking for] ​ Please remember that this community is geared towards those with experience. submitted by /u/AutoModerator [link] [留言]

/u/AutoModerator 2026-05-31 10:30 5 原文
AI 资讯 Reddit r/MachineLearning

Bayesian Opt. GPs vs Linear models and Neural Networks for parameter optimizations [R]

Hi, Relatively new to deep learning. I wanted some opinions on which of these approaches might be best for time series data and spectral analysis. I currently use a GP and it works pretty well, but I’m wondering what the computational tradeoffs and so forth might be. Any ideas? submitted by /u/InevitableCut1243 [link] [留言]

/u/InevitableCut1243 2026-05-31 09:57 5 原文
AI 资讯 Reddit r/artificial

mlx-code — local LLM coding agent for Apple Silicon

Lightweight local coding agent with emphasis on subagenting rather than stuffing everything into one giant context. The idea is to reduce context rot and kv cache size so as to scale to larger coding tasks using focused parallel workers. submitted by /u/Turbulent-Guest154 [link] [留言]

/u/Turbulent-Guest154 2026-05-31 09:35 6 原文
AI 资讯 Reddit r/artificial

Llama Surgery: Continuous Sparsification of Pre-Trained Language Models via Differentiable Ultrametric Topology Injection

Sequel to: Learning to Skip Blocks: Self-Discovered Ultrametric Routing for Hardware-Accelerated Sparse Attention Abstract We present Llama Surgery , a method for injecting learned block-sparse attention topologies into pre-trained dense language models without retraining from scratch, distillation, or post-hoc pruning. Starting from a frozen Llama 3.1 8B, we surgically replace each attention layer with a Dynamic Topology Router that maps token embeddings onto the branches of a Bruhat-Tits p-adic tree via factorized Gumbel-Softmax routing. A Continuous Logit Homotopy guarantees that at initialization the injected topology bias is identically zero, preserving the pre-trained manifold exactly. Over training, temperature annealing polarizes the soft routing assignments into hard binary masks, and a Switch Transformer-style load-balancing loss prevents routing collapse. We identify and resolve two critical failure modes: (1) gradient collapse through discrete masking operations, solved by a Straight-Through Estimator bridge that decouples the hard forward mask from the soft backward gradient; and (2) Attention Sink instability, where hard-masking the initial token causes softmax entropy collapse and syntactic degeneration, solved by permanently anchoring Token 0 in the visibility set. The resulting architecture is validated on Llama 3.1 8B fine-tuned on WikiText-2, achieving stable convergence and producing coherent, mathematically sophisticated text while maintaining dynamic block-sparse routing across all 32 transformer layers. A custom Triton forward kernel with Attention Sink and Local Window support, pipelined for Ampere and Hopper architectures ( num_warps=4 , num_stages=3 ), executes the block-sparse prefill phase at O(N) theoretical complexity. To our knowledge, this is the first demonstration of differentiable ultrametric topology injection into a production-scale pre-trained LLM. https://github.com/sneed-and-feed/adelic-spectral-zeta/blob/main/papers/llama_sur

/u/LooseSwing88 2026-05-31 09:34 5 原文
AI 资讯 Reddit r/artificial

Candide question

My understanding is that AI won’t do anything if we don’t ask him something, so i was wondering what will happen to AI if no one ask him to do anything. submitted by /u/mansithole6 [link] [留言]

/u/mansithole6 2026-05-31 09:32 5 原文