Painel de Notícias

Tecnologia

7045 posts · 26 feeds · tópicos e interesse por Jev

Filtros
dev.to

Atajos de teclado: así se traducen entre Windows y Mac

Programaste un atajo con Ctrl+S y en Mac tu usuario presiona Cmd+S sin que pase nada: ese bug silencioso aparece en casi cualquier editor web que no distingue entre plataformas. Los atajos de teclado no son solo una preferencia de cada sistema operativo, sino un conjunto de nombres, teclas físicas y propiedades de evento que cambian entre Windows, macOS y Linux, y que tu código tiene que manejar explícitamente. Esta guía repasa esas diferencias desde cero: qué tecla hace qué en cada sistema, cómo las ve JavaScript a través de KeyboardEvent, y cómo escribir una función que funcione igual sin importar dónde corra tu aplicación. metaKey se activa con Cmd en Mac y ctrlKey con Control en Windows: son dos propiedades distintas del mismo evento.- Backspace en Windows equivale a Delete en Mac, y Delete en Windows equivale a Forward Delete en Mac.- event.code identifica la tecla física sin importar el idioma del teclado; event.key cambia según el layout.- Fn+Return simula la tecla Enter numérica en los MacBook que no tienen esa tecla física.- Cmd+Q, Cmd+Tab y Ctrl+Alt+Supr nunca llegan a JavaScript porque el sistema operativo los intercepta antes. Los atajos de teclado son combinaciones de una tecla modificadora (Ctrl, Alt o Cmd) y una tecla principal que disparan una acción en una aplicación. En la web no hay una sola combinación universal: Windows, macOS y Linux asignan nombres y funciones distintas a teclas como Control, Alt o Suprimir. La causa de fondo es histórica. Apple diseñó su teclado alrededor de la tecla Comando (⌘) para evitar chocar con los atajos que el sistema reservaba para sí mismo, mientras que Windows heredó la convención de Control de los terminales Unix y DOS. Décadas después, ninguno de los dos layouts es más correcto que el otro: son dos soluciones distintas al mismo problema de reservar teclas para el sistema operativo. Para un desarrollador que nunca tocó código multiplataforma, esto puede sonar a detalle cosmético, pero no lo es. Una aplicación que

Dev
Interesse
dev.to

How to Run Google Antigravity AI on Android with a Native Web GUI (No PC or VNC)

Google Antigravity is a powerful autonomous AI coding assistant. While primarily designed for desktop environments, you can actually run it 100% natively on Android inside Termux, complete with Google's official desktop Web GUI accessible directly in your mobile browser at http://localhost:4400. In this tutorial, we will set up the standalone environment without needing a PC, cloud relays, VNC viewers, or heavy Linux PRoot containers. An Android device (ARM64 / aarch64). Termux installed (from F-Droid or GitHub, not the outdated Play Store version). An active internet connection. Open Termux and run the automated installation script from the open-source repository: curl -fsSL https://raw.githubusercontent.com/dsundaravadhanan/Antigravity-for-Android/main/install.sh | bash Native Android Bionic Engine: Installs Google's official native ARM64 Android binary with zero glibc overhead. Termux PATH Linking: Symlinks the binary to $PREFIX/bin/agy so you never encounter command not found. Browser OAuth Bridge: Bridges xdg-open to termux-open-url so sign-in tabs open seamlessly in Chrome. Latency Fixes: Sets IPv4 DNS precedence and dual-stack localhost mapping to prevent slow startup on mobile carrier data. Background Daemon: Installs termux-wake-lock integration to stop Android battery optimizers from killing background sessions. When the script finishes, launch the Web GUI: agy-gui Your mobile browser will automatically open to http://localhost:4400/onboard. Tap Continue with Google to complete standard Google OAuth sign-in. Once authenticated, your local session is securely saved in ~/.gemini/antigravity-cli/ with restricted permissions (chmod 600). You can convert the Web GUI into a dedicated full-screen app on your phone: In Chrome at http://localhost:4400, tap the three dots menu (⋮) in the top right. Select Install app (or Add to Home screen). Tap Install. The official Google Antigravity icon will now be on your Android launcher, opening in full-screen standalone mode

IADevMobile
Interesse
dev.to

Measuring the ROI of TurboModules before you commit to the rewrite

I was leading the architecture for a clinical AI platform at Synapsis Medical Technologies, where we were integrating real-time health data from wearables into a React Native environment. We were hitting a wall with the Bridge. As we scaled to handle high-frequency biometric streams, our UI thread started dropping frames during heavy data ingest. The immediate internal pressure was to migrate everything to TurboModules and the New Architecture (React Native 0.76+). The promise of synchronous execution and type-safe Codegen is seductive. However, I had a team of 21 engineers and a product roadmap that didn't include a month of "architectural refactoring" with no visible feature output. If you blindly migrate a stable Native Module to a TurboModule, you might spend 40 hours of engineering time to save 2ms of overhead that wasn't your bottleneck. I’ve shipped 18 production apps, and the most expensive mistake I see is optimising for architectural purity rather than measured latency. Before you touch codegen, you need to know if the Bridge is actually your problem. In the legacy architecture, every call between JavaScript and Native is asynchronous, serialised as JSON, and passed over a single queue. When we were streaming data from a wearable heart-rate monitor, each data point was a Bridge message. If the user was also interacting with a complex UI—say, a real-time graph—the Bridge became a bottleneck. The symptom wasn't just "slowness"; it was non-deterministic lag. The JSON serialisation overhead for a large array of health metrics can take 5–10ms. When you do that 60 times a second, your message queue backs up, and your onPress events stay stuck behind data packets. TurboModules solve this by using JSI (JavaScript Interface), allowing JS to hold a reference to C++ host objects. You move from "sending a letter" (Bridge) to "calling a function" (JSI). But if your module only fires once every 10 seconds—like a battery level check—the Bridge overhead is irrelevant. Do

DevMobile
Interesse
dev.to

Shai-Hulud Just Infected an AI Agent Platform's npm Package — What Self-Hosted n8n Builders Must Do Now

On October 8, 2026, the npm package tensorlake — the TypeScript SDK for Tensorlake's AI agent infrastructure — was compromised by a new Shai-Hulud worm variant. Version 0.5.144 shipped a preinstall hook that stole npm tokens, GitHub tokens, AWS keys, SSH keys, .env files, crypto wallets, and browser passwords from every machine that installed it. The version was pulled within minutes, but the malware persists on infected hosts. If you self-host n8n, this is your threat model: you live on npm. Every community node you install, every Docker rebuild that runs npm install, every npx in your CI pipeline runs install scripts. This article walks through exactly how this attack worked — and the concrete checklist that keeps your secrets out of the next one. According to Aikido's analysis, the infection didn't start with a typo-squatted package. It started inside the legitimate tensorlake GitHub repository. On October 7, the threat actor made verified commits under the identity of a maintainer — the malware was introduced in commit 41b38f0 via direct file upload, and the actor then bumped the version to trigger a publish. The repository was compromised for roughly 20 hours before version 0.5.144 went live on npm. Your dependency can be poisoned at the source, not just by a lookalike name. The registry did everything "right" — the package was real, the version was real, the publisher identity was stolen at the repo level. Timeline, per Socket (who flagged the malicious release 11 minutes after it published, at 01:23:10 UTC on October 8): 01:12:07 UTC, Oct 8 — tensorlake@0.5.144 published to npm. 01:23:10 UTC — Socket's scanner flags it; researchers confirm a ChainDrop/Shai-Hulud payload. Shortly after — version 0.5.144 is removed from the registry. Clean versions remain, but damage is already done on any host that ran npm install in between. With ~12,000 weekly downloads and 1k+ GitHub stars, the package's reach is far from trivial — even a minutes-long window can hit CI pipe

SegurançaInfraDev
Interesse
dev.to

MongoDB Indexing Strategies: ESR Rule, Explain Plans, and Performance Tuning

title: "MongoDB Indexing Strategies: ESR Rule, Explain Plans, and Performance Tuning" Indexes are foundational to scalable query performance in MongoDB. Without proper indexing, MongoDB must perform a collection scan (COLLSCAN), inspecting every document in a collection to satisfy a query. As collections grow into millions of documents, unindexed queries introduce severe latency spikes and saturate I/O subsystems. This guide explores production-grade MongoDB indexing strategies. We will examine single-field indexes, compound indexes, the Equality, Sort, Range (ESR) rule, how to dissect execution stats via explain(), and strategies for managing index storage overhead. A single field index operates on a single field of a document. MongoDB creates an ascending index (1) by default, though descending (-1) indexes are also supported. Because MongoDB indexes are structured as B-trees, single-field indexes support fast equality matches, sorting, and range queries on that specific field. // Create an ascending single-field index on the 'email' field db.users.createIndex({ email: 1 }); While single-field indexes accelerate reads, every write operation (insert, update, delete) requires MongoDB to update the corresponding index entries. Maintaining too many single-field indexes on a high-throughput write collection can severely degrade write performance. A compound index involves multiple fields within a single index structure. When designing compound indexes, field ordering is critical because a compound index can serve queries that match a prefix of the index. To maximize the efficiency of compound indexes, adhere to the ESR Rule (Equality, Sort, Range): Equality: Place fields that use equality match conditions first. These fields narrow down the dataset immediately. Sort: Place fields for sorting next. The index can satisfy the sort order before scanning ranges. Range: Place fields that use range conditions (e.g., $gt, $lt, $in, regex) last. Range queries limit the index's

Dev
Interesse
dev.to

MCP Security: Where to Put the Authorization Boundary

An MCP tool call passes through the model, the client, possibly a proxy, and the server before anything happens. Only one of those places sees every call in structured form and is controlled by you rather than by the agent or a third party: the seam between client and servers. That is where an MCP security gateway belongs, and this page shows how to put one there. One seam: client ↔ servers server__tool: namespaced per upstream Default deny: unlisted tools refused Hash-chained: audit per decision The question Every MCP security control is really a decision about where the authorization boundary sits. The MCP security overview covers what goes wrong: broad-scope tools, poisoned tool descriptions, credentials leaking through results. This page answers the follow-up question teams ask once they accept that per-call policy is needed: where should the decision be made? Where the boundary sits What it sees Who controls it Verdict In the prompt or system message Text The model, which can be talked out of it Advisory at best Inside each MCP server Its own calls only Whoever wrote that server, often a third party Inconsistent across servers, no shared context Network or HTTP proxy Hosts and bytes; nothing for stdio servers You Misses local servers and argument meaning Gateway at the client–server seam Every routed tools/call: server, tool, arguments You, independent of agent and server The authorization boundary In-process wrapper (guard.wrap) Calls to tools you own You Use for non-MCP tools alongside the gateway The prompt is the wrong place because the same channel that carries policy also carries injected instructions. The server is the wrong place because you will run servers you did not write, each with its own idea of safety, and none of them knows what the agent did on another server a moment ago. A network proxy is the wrong place because most local MCP servers speak stdio and never open a socket, and a proxy sees a hostname, not that the tool is drop_table. The clie

SegurançaDevIA
Interesse
dev.to

Six of seven models contradicted themselves on the same deprecation question

This is a submission for the Kaggle Benchmarking Challenge Whether a model knows which parts of an API still work. Not "is this deprecated", which is a yes or no question that real API surfaces rarely answer. A feature is usually in one of three states: State Meaning Example Removed End of life has passed. Using it fails. Cloudflare Service Key auth, gone 30 Sep 2026 Deprecated but live Announced, still functional. foundation_dns, works until 23 Nov 2026 Current The documented replacement. Cloudflare API Tokens The middle state is where the interesting failures live, and collapsing it hides two opposite mistakes. A model that calls a removed feature current hands you code that cannot run. A model that calls a live feature removed sends you on a migration you did not need. Score those as one number and a uniformly pessimistic model looks good. Thirteen items, every one quoting a vendor deprecation page with its announcement date and its end-of-life date tracked separately. Each asked two ways: Knowledge: "Can I still authenticate to the Cloudflare API using Service Key authentication?" Premise: "Show me how to authenticate using the X-Auth-User-Service-Key header." The second assumes the feature works. A model can know a thing is gone and write the code anyway when you ask it directly, and the gap between those two framings was the question I set out to measure. It turned out not to be the interesting one. Six models across five vendors, 78 calls each: qwen/qwen3-next-80b-a3b-instruct anthropic/claude-sonnet-5@default google/gemini-3.8-flash anthropic/claude-haiku-4-5@20251001 openai/gpt-5.4-mini-2026-03-17 google/gemini-2.5-flash Plus a seventh run: gemini-2.5-flash a second time, at the other end of the sweep, under identical conditions. That control is the most useful thing in this benchmark, and I nearly did not include it. Three runs of the same model on the same items gave unstable_rate of 0.731, 0.654 and 0.769, with the rate of "that never existed" answers sw

IAInfraDev
Interesse
BleepingComputer

Citrix warns admins to patch new NetScaler RCE flaw immediately

Citrix has warned IT administrators to patch systems immediately against a new critical vulnerability affecting NetScaler ADC networking appliances and NetScaler Gateway secure remote access solutions. [...]

SegurançaInfra
Interesse
dev.to

OpenTelemetry-Native Android: Wiring OTel SDK to Compose Navigation for Distributed Trace Propagation Without the APM Tax

--- title: "OTel Android: Distributed Tracing in Compose Navigation Without the APM Tax" published: true description: "Wire OpenTelemetry's Android SDK to Jetpack Compose Navigation for distributed trace propagation, W3C trace-context in Ktor headers, and a sampling strategy under $50/month at 10M events." tags: android, kotlin, mobile, architecture canonical_url: https://mvpfactory.co/blog/otel-android-compose-navigation --- Today you will wire OpenTelemetry's Android SDK to Jetpack Compose Navigation. By the end, you will have end-to-end distributed trace propagation — from screen transition to backend span — for roughly $20–$50/month on self-hosted Grafana Tempo at 10M events. No Datadog. No New Relic. No vendor lock-in. Here is why that matters: Approach Monthly @ 10M events SDK size Vendor lock-in Datadog Mobile RUM ~$180–$400 6.2 MB High Firebase Performance Free (sampled) 1.1 MB High New Relic Mobile ~$200–$350 5.8 MB High OTel SDK + Grafana Tempo ~$20–$50 0.8 MB None Jetpack Compose project with Navigation component Ktor HTTP client OpenTelemetry Android SDK on your dependencies A Grafana Tempo instance (self-hosted or Grafana Cloud) Let me show you a pattern I use in every project. NavController.addOnDestinationChangedListener fires on every screen transition — it is your single integration point for the entire nav graph. @Composable fun ObserveNavTracing(navController: NavController, tracer: Tracer) { DisposableEffect(navController) { val listener = NavController.OnDestinationChangedListener { _, destination, _ -> val span = tracer.spanBuilder("nav.transition") .setAttribute("screen.route", destination.route ?: "unknown") .setAttribute("screen.id", destination.id.toString()) .startSpan() NavTraceRegistry.set(destination.id, span) } navController.addOnDestinationChangedListener(listener) onDispose { navController.removeOnDestinationChangedListener(listener) } } } Call ObserveNavTracing once at your navigation root. That is it — one span per screen, zero per

MobileInfraDev
Interesse
dev.to

Go regexp too slow? I built coregex, a drop-in replacement. An audit found 16 bugs — here's what broke

Six months ago I published "Go's Regexp is Slow. So I Built My Own". The project grew, got contributors, beat Rust on several patterns. Tested on Go 1.27, go.mod requires 1.27+. Then I commissioned an independent code review — a full differential fuzz against stdlib plus manual audit of the engine internals. 6% of random pattern/input pairs gave wrong answers. Not edge cases. Not theoretical. (?i)привет didn't match "привет" — its own literal. \pL+ on a 50KB file returned no matches while MatchString returned true. A 15-character pattern OOM'd the process at compile time. This is the story of what broke, why 65,000 lines of tests missed it, and what it took to fix. Issue #166 from @vmihailenco — sat open for six weeks because I missed the notification buried in email noise, and only caught it reviewing the repo: coregex.MustCompile(`^x(a|bc)`).MatchString("xbc") // false That's a false on a pattern that obviously matches. When I dug in, it wasn't one bug — it was an entire strategy producing wrong answers: ^x(a|bc) "xbc" → false (prefix ignored) ^HTTP/(1\.0|1\.1|2) "HTTP/2" → false (every HTTP version check) ^/api/(users|posts) "/api/users" → false (every API router) ^(GET|POST) / "GET x" → true (false positive!) The BranchDispatch optimization dispatched by first byte, then verified the match with a simple matcher that couldn't handle real AST shapes. It was a mini-engine — one that said "yes" without being a real engine. Lesson: An optimization that answers "yes" independently must be a full engine. Otherwise it's a bug generator. Safe optimizations only say "no" quickly (prefilters, first-byte reject) and delegate "yes" to the real engine. Rust regex doesn't need branch dispatch — the lazy DFA transition table already is a dispatch table at every state. Solution: deleted the entire strategy. -1077 lines. Anchored alternations now go through BoundedBacktracker with O(1) first-byte reject. 13 ns → 66 ns on short strings — still 1.5× faster than stdlib. The speed ga

Dev
Interesse
dev.to

Suno V6 Mini Review: What the Free Plan Can't Do

If you've never paid for Suno, V6 Mini is the only model you get. I tested it across several genres, then pushed it on originality, control, demos, and solo instruments. Short version: it's a good sandbox, but you won't want to stay there. How it sounds Deep house: generic. Listenable, but forgettable. Pop: fine, though pop is the easiest genre to get away with. Rock/alternative: better than expected. 90s R&B: decent, but not convincingly 90s. Hip hop: the weakest. The melody and beat felt cheesy and too familiar. Overall: average. Nothing broken, nothing groundbreaking. Paid plans add two more models. V6 is the default and clearly stronger than Mini. V6 Wild is more experimental and shines on era-specific music (1980s, early 90s), sounding more authentic and less robotic. 1. Usage rights. This is the big one. On the free plan you don't get rights to use songs outside Suno, so no social media and, as far as I know, no YouTube. Downloads and stems (the separated vocals, drums, bass, etc.) are also restricted. Read Suno's current terms before publishing anything. 2. Originality takes control. Distinctive results need detailed prompts, lyric direction, and the creativity sliders. Mini isn't powerful enough to make good use of them. 3. Demos don't go far. I uploaded a demo and asked for a talk box treatment. Mini produced something, but no real solo, and I couldn't get the sliders under control. 4. Solo instruments are hit and miss. I asked for "solo organ only, instrumental" and explicitly excluded drums, bass, and kick. Mini added drums and everything else anyway. For a beginner, yes. It's a free, low-pressure way to learn how Suno works. My advice: spend a week or two on Mini, then reassess. Once you want something convincing, original, or release-ready, you'll almost certainly upgrade to V6 or V6 Wild. Tried V6 Mini yourself? Tell me how it went in the comments.

IA
Interesse
dev.to

AI review benchmarks score the bot. Nobody scores the reader

This week GitHub published ReviewBench, an open benchmark for AI code reviewers. It is careful work: 219 pull requests from 187 open-source repositories across 19 languages, picked so their size matches what actually gets reviewed on GitHub, based on an analysis of 103.9 million pull requests. The ground truth comes from human reviewers, from bugs that authors fixed in later commits, from static analysis and from several frontier models, and senior engineers who didn't build the dataset re-labelled every finding, agreeing with it 96.6% of the time. You get precision, recall and F1, so you can say "this reviewer finds 40% of the real issues and half of what it says is noise." That is a real improvement on vibes. But read what the benchmark is measuring: the bot. How many true issues it catches, how many false ones it raises. It cannot measure the other half of every review, which is a person reading the finding and deciding whether it is right. That half is where review time goes now. Anthropic's own research puts the gap plainly: developers use AI in roughly 60% of their work, but say they can "fully delegate" only 0–20% of tasks (summary of Anthropic's 2026 Agentic Coding Trends Report). Everything between those two numbers is work an agent did and a human still has to look at. And there is a lot more of it. At the AI Engineer World's Fair, Sourcegraph's CEO described agents producing a "tidal wave of code" that wears down old codebases with duplicated helpers, inconsistent standards and fragile dependencies (recap). GitHub's own guide to reviewing agent pull requests reads like a list of things a person has to go and look at: tests that quietly disappeared, utilities duplicated because the agent didn't find the existing one, a permission check on the path that matters, traced from input to output. None of that is a syntax error a bot can flag. It is reading. Every comment an AI reviewer leaves comes with a cost attached: someone has to open the file, find the plac

IADev
Interesse
dev.to

2026-10-08-introducing-lovieme-instant-free-developer-subdomains

Introducing LovieMe "Built by Developers, for Developers — Stop deploying your experiments to messy hashes or paying $20/year for abandoned domains. Claim your developer identity in 60 seconds." Live Platform: www.lovie.me Namespace: *.lovie.me Official Post: sagarithm.in/link/b013 Founder: Sagar Kewat The "Side-Project Domain Trap" Every active software engineer and indie maker knows the feeling: You have an inspiring concept for a micro-SaaS, a hackathon submission, or an open-source documentation site. You write code, test the UI, and deploy to Vercel, Netlify, or Fly.io in record time. Then comes the identity bottleneck: The Annual Domain Tax: You pay $15 to $50 for a domain you abandon 3 months later. The Clunky Default Hash: Sharing links like project-8f92b.vercel.app looks unpolished on resumes and portfolios. Slow DNS Propagation: Waiting hours for recursive nameservers to update. Email Routing Friction: Receiving an email on a domain requires expensive email suites or complex mail servers. Earlier experiments like Freenom (.tk, .ml) collapsed due to abuse and revocations. That's why I built LovieMe (www.lovie.me). LovieMe is a developer-first cloud infrastructure platform providing instant, forever-free custom subdomains under lovie.me, authoritative Anycast DNS zone management, and stateless serverless email forwarding. The Problem ❌ The LovieMe Solution ✅ $15–$50/yr for domains that get abandoned Forever-Free Base Tier: Up to 3 subdomains ($0, no credit card) Clunky hashes like app-hash.vercel.app Clean Branding: yourproject.lovie.me Slow DNS propagation Sub-2s Anycast Edge Sync: 160+ global edge nodes Complex mail servers Stateless Edge Mail Forwarding: Piped straight to Gmail in memory [Developer / Web Browser] │ ▼ (Next.js 16 Web Console + Turbopack) [Supabase PostgreSQL with Row-Level Security (RLS)] │ ├─► [Gcore Anycast Edge DNS Engine (160+ PoPs)] │ • Sub-2s Global Sync │ • Full Zone Support: A, AAAA, CNAME, TXT, MX │ • Automated Let's Encrypt SSL/T

Infra
Interesse
dev.to

Write-Audit-Publish: Never Promote a Bad Table Again

Most quality checks run after bad data is already live. You load the table, then test it, then prove the data is good The three steps Write — build the new data into a staging location consumers can't see: a temp table, a separate schema, or a zero-copy clone/branch of the target. Audit — run your quality gates against that staged copy: uniqueness at the grain, row-count vs baseline, freshness, reconciliation against a trusted source. Publish — only if every check passes, promote the staged data to production with an atomic swap (a rename or clone-swap), so consumers flip from old-good to new-good with no bad state in between. If a check fails, nothing is published; production keeps serving the last known-good data while you investigate. Consumers never see bad data. The failure mode becomes "today's refresh is delayed," not "the dashboard is wrong." Stale-but-correct beats fresh-but-wrong almost every time. The swap is atomic. No window where half the table is updated and queries see a mix. Rollback is trivial. The previous version is still right there; promoting it back is one operation. The pattern used to be expensive — you'd copy the whole table. Modern warehouses make it nearly zero-copy clones and table/catalog branching: you stage on a clone, audit it, Wire the audit step to the same tests you already write (dbt tests, a data-quality scan) and let Validate on a staged copy and publish only what passes — consumers never see bad data. Promote with an atomic swap so there's no half-updated state, and rollback is one step. Zero-copy clones and branching make WAP cheap enough to be the default. Reframe loads as "propose a version"; a passing audit is what makes it live.

Dev
Interesse
dev.to

I thought rate limiting was a solved problem. Then my AI agents hit production

Keeping requests to a service under some rate always seemed simple to me, and the whole problem a little overblown. Then I started working closely with AI agents. I've been through the euphoria phase: you connect an agent to your company's data, and it starts producing real insights. The trouble starts when those solutions move to something like production scale. We run heavily on Google Cloud, and suddenly a lot of applications slow down because they hit quotas. Resources get burned at a frightening rate, both on GCP services and on the models behind the agents. Tokens stop being merely expensive; they become worth their weight in gold. governor: perfect, on one pod Redis: works, but come on What rateguard does use rateguard::{Decision, Guard}; let guard = Guard::builder() .bind("0.0.0.0:7946") .advertise(pod_ip) // where the other pods reach this one .seeds(["10.0.0.1:7946", "10.0.0.2:7946"]) .limit(10) // 10 calls/s for the whole fleet .spawn()?; // Before every call to the quota-limited API: loop { match guard.check("vertex-ai") { Decision::Allow => break, Decision::Deny { retry_after } => tokio::time::sleep(retry_after).await, } } call_the_api().await?; Eight pods or eighty, the fleet stays at 10 calls a second. How it works, in four lines: Shares follow demand. Each pod gossips how many calls it is trying to make, and takes a proportional slice of the limit. A busy pod gets more; an idle one doesn't sit on a share it doesn't use. Only busy keys are coordinated. Quiet keys run locally on a small fixed share and generate no network traffic at all. Nothing on the call path can fail. If the other pods disappear, each keeps enforcing the last share it knew. What happens during a network split is a setting (HoldDown, Quorum, or Optimistic), with a stated bound for each. It's tested like a distributed system. The protocol runs in a deterministic simulator — partitions, 30% packet loss, GC pauses, rolling restarts — and the README carries an accuracy report that CI ke

InfraDevIA
Interesse
dev.to

256-colour PNGs can keep soft shadows. tRNS shows whether yours did

Before letting 256-colour PNGs into an image pipeline, I wanted to understand one failure. A sticker with a soft drop shadow goes through colour reduction, and on a white page the shadow comes back as a solid black band with a knife-cut edge. My test file is a pink ribbon sticker from Wikimedia Commons (by K B, CC BY 2.0), a third-party image, and the figures only show its top loop. 17.9% of its pixels are semi-transparent. 256 colours were not the problem. An indexed PNG can store soft alpha fine, and the result depends on how many distinct alpha values the encoder writes into one small chunk. The original is colour type 6, four bytes per pixel with alpha stored next to RGB. A 256-colour PNG is colour type 3. Each pixel is an index into PLTE, which holds up to 256 RGB entries of three bytes. Transparency lives in the optional tRNS chunk, one alpha byte per palette entry in the same order, and entries past its end count as opaque. How many distinct values those bytes hold is up to the encoder. I wrote a small reader in Node with no image library: function paletteAlpha(bytes) { const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength); const report = { colourType: null, paletteSize: 0, alphaBytes: 0 }; let alpha = []; for (let at = 8; at a - b); report.belowOpaque = alpha.filter((a) => a a - steps[i])); return report; } It walks the chunks, pads the alpha list to palette size per the spec, and reports entries below 255, distinct alpha values and the widest gap between neighbouring values. Count distinct values, not entries. My 98-level file has 129 entries below 255 but only 98 distinct values, because several colours share one alpha. Output for six versions of the sticker: ribbon.png type=6 tRNS=0B below255=0 steps=0 gap=0 ribbon-2.png type=3 tRNS=256B below255=1 steps=2 gap=255 ribbon-10.png type=3 tRNS=256B below255=9 steps=10 gap=43 ribbon-34.png type=3 tRNS=256B below255=33 steps=34 gap=18 ribbon-98.png type=3 tRNS=256B below255=129 steps=98 ga

Dev
Interesse
dev.to

What It Means to Use a Fly’s Neural Wiring

What It Means to Use a Fly's Neural Wiring You can use a fruit fly's neural connectivity data as the structure of a neural network. When I saw demos of fly-inspired models on social media, my first reaction was: “Flies are pretty impressive.” But what does using their wiring actually involve? This article starts with a tiny model built from measured connections, then looks at a Rubik's Cube implementation and my Sudoku experiment. The aim is to explain what comes from the biological data, what we implement ourselves, and what the model learns. The Python snippets are excerpts for explanation; initialization and other supporting code are omitted. My full implementation is not published. MaleCNS is a public reconstruction of the male fruit fly's central nervous system, including its brain and nerve cord. This kind of connectivity map is called a connectome. It can tell us that neuron A connects to neuron C through 357 synapses, for example. The official download page describes several kinds of data: Category Contents Annotations Cell classifications and types, neurotransmitter predictions, and synapse-count summaries Connectivity Connections between segments, synapse locations, and synaptic partner pairs Skeletons Representations of neuron morphology Volumes Electron microscopy images and segmentation data For the example below, I used connectome-weights-male-cns-v1.0-minconf-0.5.feather from the Connectivity category. It is distributed as the full connection graph at the stated confidence threshold. Segments are identifiers in the reconstructed data; they should not all be assumed to represent fully identified neurons. The example uses four neurons checked against the annotations. Two things matter when we use this data for computation: Connectivity: which unit can send a signal to which other unit. Weights: how strongly each connection affects the computation. Suppose the connection from A to C has 357 synapses. In this example, we divide that count by 582, the larg

IADev
Interesse
dev.to

Turning an SEO audit into tasks your AI coding agent can actually fix (Claude Code, Cursor, Codex)

A typical SEO audit export is a spreadsheet with a few hundred rows: "Missing canonical (18 pages)," "Duplicate title (11 pages)," "Orphan page," "Redirect chain." Pasting that into Claude Code, Cursor, or Codex with "fix these" usually goes badly. The agent edits the wrong template, "fixes" a warning that didn't matter, or changes robots.txt in a way nobody reviews. Coding agents are good at SEO fixes because most technical SEO problems are template problems, and a template is code. The trick is the translation step between the audit and the agent. This post is the process I use. Not every SEO finding is a coding task. Before anything goes to an agent, I sort the list. Delegate to the agent (deterministic, lives in code, easy to verify): Missing, duplicate, or self-contradicting rel="canonical" tags Duplicate or empty and meta descriptions produced by a template Leftover noindex (meta tag or X-Robots-Tag header) on production routes Sitemap problems: wrong host, non-canonical URLs, URLs that 404 or redirect Internal links pointing at redirects or 404s Redirect chains (A→B→C) that should be a single hop Missing or invalid JSON-LD (Organization, SoftwareApplication, BlogPosting, BreadcrumbList) Missing alt attributes on content images, and heading-level order in components Do it with the agent, but decide yourself (code changes that encode a business decision): robots.txt rules, especially for AI crawlers Which URL is canonical when two pages overlap Redirect maps after a URL restructure hreflang sets Keep away from the agent (not code problems): Content quality, search intent, and topic gaps Backlinks and authority Anything that's really a keyword-strategy decision The first bucket usually covers most of what a technical audit flags. The second bucket is where an agent can do real damage if you let it decide on its own. Audits report symptoms per URL. Agents fix causes. "Missing canonical on 18 pages" isn't 18 tasks. It's usually one layout or one generateMetadata-s

IADev
Interesse
dev.to

Three of our six tests say "candidates report", the other three say "our estimate"

The UK train driver battery has a reporting model that is awkward for a practice app. Each test is passed or failed on its own. RSSB recommends a national minimum for each, some train companies set a higher "enhanced" standard of their own, and there is no single enhanced standard. The industry standard that governs the process sets no pass marks, and none are published anywhere. The candidate gets an outcome and never a score, and every result goes on a national database that every train company can check. So we built six of those tests, and every one of them ends on a screen that has to say something about how you did. Our scorers produce numbers. The real test produces a word. The compromise is a band. A sitting is classified as below the national standard, inside its range, or inside the range of an enhanced standard, stored as a single standardBand metric of 0, 1 or 2 so the feedback layer can read it without a new persisted field. Every threshold behind those bands is ours. For three of the six tests, Group Bourdon and the two Trainability for Rules and Procedures tests, they are anchored on something real: candidates post their marks and their outcomes on railway forums, often with the year and the company. Each threshold in the module carries a comment naming the accounts it rests on, so a future edit has to argue with a source rather than with a number. The feedback then says exactly that: The real test gives you no score. You pass or fail it on its own, against either RSSB's recommended national minimum or a company's stricter enhanced standard, and every result goes on a national database that every train company checks. Pass marks are not published, so the band below comes from what candidates report passing with. That sentence shipped on all six tests. Then the audit of the generated feedback asked the obvious question about the other three. The WAFV, the TEA-Occ and the ATAVT are vigilance, attention and perception tests sat on a dedicated test system.

Dev
Interesse
dev.to

Making a photo flow with one fragment shader and a GIF writer

I built OohAlive, a page where you draw an arrow on a photo and the picture flows that way. Then you download the loop as a GIF. Three things went wrong along the way and they were more interesting than the shader, so this post is about those. Each arrow adds a Gaussian pull to every pixel, based on the distance to the arrow segment. Two copies of the photo slide along that flow half a loop apart and cross fade, so the other copy covers the moment one resets. A freeze brush paints a mask, and where the mask is set the flow is zero. The preview and the export call the same draw function. The two copies swap places after half a cycle, so the picture repeats every half cycle. My first GIF had 40 frames, and frame 20 was identical to frame 0. I was encoding the same second twice. Scaling the phase so 0 to 1 is exactly one repeat halved the frame count. I measured a window on the frozen boat across the decoded GIF and found 1,070 changed values out of about 4,600. The raw frames from the shader were identical there, so the encoder was at fault. The palette lookup in gifenc caches by 5-6-5 colour for each call and keeps the match of the first pixel it meets, so the same colour could land on different palette entries in different frames. One lookup table for the whole GIF fixed it, and the same window now shows 0 changed values. With the first fix, the exported file went from 2.1 MB to 887 KiB. A test compared two screenshots with assert.deepEqual. When they differed, Node tried to print both PNG buffers as a diff and the process kept growing until I killed it. Comparing with Buffer.compare and counting draw calls instead of pixels for the pause test fixed it. I've only tested Chromium. Firefox, Safari and real phones are untested. It works best on water, clouds and smoke. If a photo looks wrong, I'd like to see it. Live page: https://arthur031221.github.io/OohAlive/ Source, MIT licensed: https://github.com/Arthur031221/OohAlive

Dev
Interesse
dev.to

BirdLens- App

BirdLens This is a submission for the Hacktoberfest Open-Source AI Challenge I built BirdLens, a simple bird identification app that encourages people to go outside and explore nature. The idea is simple: take a photo of a bird while you are outside, upload it to BirdLens, and the app tries to identify the bird. It then shows some basic information about it. Instead of sitting inside and searching about birds on the internet, the goal is to go outside, find a bird, take a photo, and learn about it. The app is mainly for people who are interested in birds, nature, photography, or just want a small reason to spend some time outdoors. Demo: 1- 2- 3- 4- GitHub: The project contains the frontend and backend code, along with the AI part used for bird identification. I built BirdLens using: React.js for the frontend Python and FastAPI for the backend An open-source AI model for bird identification API/backend logic to process the uploaded image and return the result The main flow is: Take or upload a bird photo → AI identifies the bird → BirdLens shows the bird information. I wanted to keep the project simple so that it can be improved later with more bird species, better information, and more features. For this project, open-source AI made it possible for me to experiment with an AI model without building everything from zero. I could learn how an image classification model works and connect it to my own application. It also means other developers can look at the project, improve it, add new features, or use the idea for their own projects. For me, open source is also a good way to learn by building real projects instead of only following tutorials.

IADevMobile
Interesse
dev.to

Bare-metal boot sequence and startup code

Contents Where the core starts: reset vector and the vector table Clock tree and memory initialization: PLLs, flash latency, and SDRAM Bringing up peripherals and the interrupt system without surprises Bootloader vs application handover: relocation, deinit, and jump patterns Practical checklist for a first bare-metal boot and validation Sources The board hangs at reset, the LED never blinks, or the application runs but SysTick and IRQs never fire after a bootloader jump. Those are the symptoms of three root problems you will see repeatedly on first bring-up: a bad vector table or stack pointer, a mis-configured clock or flash timing, or leftover peripheral/NVIC state across a handover. Each symptom points to a deterministic set of checks; treating them as a checklist turns chaos into reproducible fixes. The vector table is not glue code; it is the CPU’s bootstrap contract. The first 32‑bit word is loaded into the Main Stack Pointer (MSP) and the second word becomes the initial Program Counter (PC) (the reset handler). That happens in hardware before any Reset_Handler code runs. The vector entries must be valid 32‑bit addresses with the low bit set to 1 to indicate Thumb state. Practical checklist for this section Confirm the vector table is located at the address the core expects at reset (commonly 0x00000000 by default) and that the first two words are meaningful. Use your debugger to read the first 8 bytes: x/2x 0x08000000. Verify the stacked MSP value points into RAM and the reset vector points into flash (or the relocated region) and has the Thumb LSB bit set. Bad MSP => immediate HardFault. Minimal example vector table (C) extern uint32_t _estack; void Reset_Handler(void); __attribute__((section(".isr_vector"))) const uint32_t VectorTable[] = { (uint32_t) &_estack, // initial MSP (uint32_t) Reset_Handler, // reset handler (LSB == 1) (uint32_t) NMI_Handler, (uint32_t) HardFault_Handler, // ... }; The Reset_Handler conventionally calls SystemInit() and then perfo

InfraDev
Interesse
dev.to

Two of the six tests we researched turned into pages instead of products

CogniPrep practises aptitude tests. There are 56 assessment providers on the site and 369 games behind them, and the way that number grows is in rounds: pick a handful of batteries candidates actually sit, research each one properly, then build. The round we merged yesterday started with six. It shipped four, and 25 new games with them. The other two produced a research dossier each and no game code at all, which was the correct outcome in both cases and the more interesting half of the round. The CFAT is the Canadian Forces Aptitude Test. It is well known, it is heavily searched, and prep sites still sell practice for it. The Canadian Armed Forces removed it from Regular Force selection on 31 October 2024. It was replaced by the Scored Employment Application Form, a scored questionnaire about your life so far, plus a 30 minute personality inventory called the TSD-PI. Four independent sources agree: the Department of National Defence's own release, the Supplementary Estimates, an Auditor General report, and the live forces.ca joining page, which has quietly deactivated its CFAT help articles. Neither replacement is an ability test. There is nothing to drill. So the build was cancelled and the research turned into three things: An explainer post at /blogs/cfat-replaced-by-seaf that answers the search instead of selling against it. One row in our "which test am I taking" lookup table, routing CFAT searches to that post with the label replaced by the SEAF in October 2024. Not practised here. Past tense corrections everywhere our own copy still described the CFAT as current, including a neighbouring provider's hub page and its research dossier. The thing I would not have predicted is how much of that needed locking down. A page whose whole point is "we do not sell this" is one careless edit away from becoming a page that does, so it has its own test file: it('offers no practice game, because nothing we sell practises the replacements', () => { expect(post.relatedGames ?

Geral
Interesse
dev.to

SHA3-256 vs Keccak-256: the one-byte difference that breaks Ethereum hashes

If you've ever hashed something in Python with hashlib.sha3_256 and got a different result from Solidity's keccak256, nothing is wrong with your code. You're using two different functions that share almost everything. Keccak won NIST's hash competition in 2012. When NIST published the final standard, FIPS 202, in 2015, it changed the padding: SHA-3 appends the bits 01 before the usual 10*1 padding (so the first padding byte is 0x06), while the original Keccak used 0x01. Ethereum had already adopted Keccak, so it kept the original. One byte, completely different outputs: Input Keccak-256 (Ethereum) SHA3-256 (NIST) "" c5d24601...5d85a470 a7ffc6f8...80f8434a "abc" 4e03657a...a12d6c45 3a985da7...11431532 Quick check: if your empty-string hash starts with c5d24601, you have Keccak-256. If it starts with a7ffc6f8, you have SHA3-256. import hashlib hashlib.sha3_256(b"abc").hexdigest() # NIST SHA3-256 from Crypto.Hash import keccak # pip install pycryptodome k = keccak.new(digest_bits=256); k.update(b"abc"); k.hexdigest() # Ethereum import { createHash } from "node:crypto"; createHash("sha3-256").update("abc").digest("hex"); // NIST SHA3-256 import { keccak256, toUtf8Bytes } from "ethers"; keccak256(toUtf8Bytes("abc")); // Ethereum Watch out for library names: Solidity's old sha3() was an alias of keccak256(), and some packages still say "sha3" when they mean Keccak. I put every variant side by side in a free in-browser tool: sha3.si. Type transfer(address,uint256) and the first 8 hex characters of Keccak-256 give you the ERC-20 selector, a9059cbb. From the terminal: npx sha3-check -s "transfer(address,uint256)" -a keccak-256.

SegurançaDev
Interesse
dev.to

Why proxies trigger captchas, and what reduces them

Originally published on proxymint. Why proxies trigger captchas: the risk score behind each challenge, the inputs your proxy tier changes, and what a legitimate client can fix first. A captcha is a policy action on a risk score. reCAPTCHA v3 scores each request from 0.0 to 1.0 with 0.5 as a suggested starting threshold, and each site owner decides what happens below it. The proxy supplies the IP inputs. ASN class, the shared history of the address and how many requests it carries all come from the proxy tier. The client supplies the rest. Pace, cookies, the TLS stack, the browser checks and the locale belong to the client on every tier. Per-request rotation can raise the challenge rate. Each new address starts without the session history the last one built, so multi-page flows often do better on a sticky session. Some captchas mean stop. When a site challenges every automated request on logins, checkout or search, the answer is its API, a data licence or slower permitted access, not another pool. Measure before switching tiers. Put reCAPTCHA v3 or Turnstile on a page on a domain you own, record 100 requests per tier at a fixed pace, then change one client input and repeat. Keep clearance cookies. Cloudflare's cf_clearance cookie lasts 30 minutes by default and Cloudflare recommends 15 to 45; a client that drops it meets the next challenge sooner. Use sticky sessions for multi-page flows. A 5 to 60 minute timer or a sticky session keeps the history that per-request rotation throws away. Ask for the market's language. Set Accept-Language to the market whose pages the job needs, so the site serves the right locale. Use mobile where the mobile origin matters. Carrier IPs are built for platforms that expect phone traffic; residential covers most other targets. Read the full guide on proxymint, with the commands, tables and sources.

Segurança
Interesse