Painel de Notícias

Tecnologia

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

Filtros
dev.to

I benchmarked seven hotel price APIs on the same Rome room, and the prices were 16% apart because of tax

I run FlightPowers, a small API that reads live Booking.com rates, so I'm biased about one row of this table. I wanted to know how it holds up next to the APIs people usually compare it with, so I spent an afternoon sending them all the same questions and kept every response. Same stay for everyone: check-in 2026-11-20, check-out 2026-11-23, 2 adults, 1 room, USD. Three questions, three runs each, median wall time from one server in the US: A destination search for Lisbon, sorted by price where the API can sort. One named hotel: Hotel Artemide in Rome. (I started with Hotel Sant'Angelo, but it was sold out on Booking.com for those dates.) That same hotel seen from Germany and from the US, where the API has an input for it. Free tiers only. SerpApi got no_cache=true, because its default hands back an identical search from cache for an hour and that would have flattered its time. API (source) Lisbon search, median sorts by price one named hotel StayAPI (Booking.com) 1.1 s no 2 calls: ID lookup, then prices (2.5 s for the prices call) SearchApi (Booking.com) 1.9 s yes room list in 2 calls: search for the URL, then the property (3.0 s for that call) HasData (Booking.com) 2.1 s yes room list in 2 calls: search for the URL, then the place (3.2 s for that call) SerpApi (Google Hotels) 2.4 s yes 1 call by name (2.5 s) FlightPowers, mine (Booking.com) 7.9 s no 1 call by name (10.2 s) Apify voyager/booking-scraper 75 s with actor start asked, rows came back unsorted 1 run by name (39 s, one run) Xotelo (TripAdvisor rates) 0.7 s, but the list takes no dates n/a by TripAdvisor key (0.7 s) Mine is the slow one. It loads the page in a real browser through a residential proxy for every call, and you pay for that in seconds. It also has no price sort yet: I sent "sort": "price" and it was accepted and ignored, which is a bug on my list. SearchApi's and HasData's search take a hotel name too (SearchApi put Hotel Sant'Angelo first when I searched it by name), so one row price for a n

Dev
Interesse
dev.to

Sitecore Search API Key Authorization - How We* Tackled It

Sitecore sent out an email yesterday that was actually a "kick the can" email, regarding a mandatory API key authorization for Search and Events APIs. Originally, this was supposed to go live mid-October 2026, and now it'll be mid-December. The first email went out a month or two ago, and support offered to change a non-prod environment to enforce the rule for testing. So we went through all that, and because I just saw someone on Slack noting the email and seeming concerned, I thought I'd offer up our solution. Right now, because the Sitecore Search widget provider (from the React SDK to be clear) is client-based, it wants the Search customer key and API key in the NEXT_PUBLIC realm, so the browser can read it. But that does a bit of a no-no, exposing an API key. So I think this is designed to get around that, and our solution does that as well. Basically, we created a new widget provider object, which takes the customer key and a generated, authorized API key, and feeds those in instead. When I say "we" I mean me and Claude Code - this was worked on with AI, but has been tested in a Sitecore Search non-prod environment that was configured to be "locked down" already, and we've had no issues with our search authorization. So let's start with that widget, which we put in a "shared" folder application/nextjs/src/components: "use client"; import { type ReactNode, useCallback } from "react"; import { WidgetsProvider, type Environment } from "@sitecore-search/react"; import { setCredentials } from "@sitecore-search/core"; import env from "@/lib/env"; // Refresh this long before the token's reported expiry, so a request that // starts just before expiry never races a token that's about to go stale. const REFRESH_MARGIN_MS = 5 * 60 * 1000; // Mount-time bootstrap value for WidgetsProvider's `apiKey` prop — needed only // to pass the SDK's own synchronous "!apiKey && !serviceHost" config check at // mount (see SitecoreSearchConfig.js); requestMiddleware overwrites it via /

Dev
Interesse
dev.to

Theo Ported TypeScript to Rust with AI and Never Read the Code

Theo Browne published a Rust rewrite of the TypeScript compiler and admitted, in the README, that he has never read a line of the code. His own words: I've never read a line of this code. That sentence is doing a lot of work. Some people found it funny. Some found it terrifying. Most found it both. So did the number next to it. The port cost over $420,000 in API tokens. Then he says you could probably have done it for $20k. That gap is the whole story. Here's a question people always ask: another TypeScript compiler? Not quite. ts-rust (also called tsc-rs) is a full port of Microsoft's TypeScript compiler, type checker and language server into Rust. It keeps the same command line, the same LSP, the same API. You install it with npm install -D tsc-rs and run it like tsc. The twist is who built it. Not Microsoft. Theo, doing a bit and then not stopping. And the results are real. On VS Code, a full type check runs in 4.20s against tsc 6's 54.56s. That is a 13x speedup. On 181,711 ported Go tests, they all pass. Type checking lands at about half of the Go compiler's time across 60 projects. a working v0 in 10 hours, after months of failure. That is the part nobody expected. What actually happens when you throw agents at a big port is not what the demos show. Theo spent about $400,000 in tokens over five months using OpenAI models, burning through /goal loops. They wrote over 1.3 million lines of Rust and never got past roughly 84% compatibility. Then he tried Opus. It had a working v0 in 10 hours. He assumed it had reused the previous code. It hadn't. The new model looked at 1.3 million lines from the old agents and decided they were unrecoverable, wrote a brand-new crate from scratch in 10 hours, and left the dead code sitting in the repo untouched. One model's six months of work was another model's garbage. The final spend was about $24,000 over two weeks. He calls the old stuff "the slop line" in the README, and marks everything below it as written by his LLMs, not h

DevIA
Interesse
dev.to

I benchmarked four Google Flights APIs on the same searches, and the fares matched to the dollar

I sell a Google Flights API (FlightPowers), and I wanted a real answer to how it compares to SerpApi, SearchApi and HasData. So I ran the same three searches through all four in the same hour on 7 October 2026 and timed every call. Disclosure up front: I built one of the four rows. The method, the places where mine loses and the timing of every single call are public on the benchmark page, and I'll re-run it every month. A round trip, JFK to LHR, out 18 November, back 25 November. A one way, TLV to BKK on 3 December. A flexible scan, LHR to BCN, any departure from 10 to 16 November, 3 nights (seven date pairs). One adult, economy, USD, three runs per search per API, from a VM in GCP us-central1. The time quoted is the median of the three runs, from sending the request to reading the last byte. FlightPowers (mine) SerpApi SearchApi HasData Cheapest fare, all three searches same same same same Round trip, both legs 3.27 s, 1 request 6.36 s, 2 requests 4.29 s, 2 requests 7.56 s, 2 requests First round-trip price 3.27 s 2.26 s 1.98 s 5.23 s One way 1.56 s 1.34 s 1.50 s 2.79 s 7-date scan, 7 calls in parallel 3.11 s 4.54 s 28.37 s* 15.99 s* Whole range in one call MCP server, bills 7 no calendar engine, bills 1 no Price history series no yes yes yes Free tier 10 a month 250 a month 100, once 67 a month Entry plan $10 for 2,500 $25 for 1,000 $40 for 10,000 $59 for 13,333 Per 1,000 round trips with both legs $4.00 $50.00 $8.00 $8.85 * One call took 16 to 28 seconds in two of the three runs (the median call was 1.9 s on SearchApi and 3.0 s on HasData, which ran 5 at a time on its trial account). A parallel scan waits for its slowest call. All four returned $692 for the round trip, $619 for the one way and the same lowest price on each of the seven scan dates ($93 at the bottom, leaving Saturday 14 November), with the same Google price range. The only difference was a label: SearchApi called two of the seven scan dates "high" where the other three said "typical". That makes

Dev
Interesse
dev.to

Publishing npm Packages with Provenance

Why provenance Publishing from GitHub Actions with --provenance takes one extra flag and one permission line. In return, every version on npm links back to the exact commit and workflow run that built it. Without provenance, a package on npm is just a tarball someone uploaded. Nothing proves it matches the source on GitHub. A provenance statement is a signed attestation, logged in the public Sigstore transparency log. It records which repo, commit and workflow produced the tarball. npmjs.com then shows a green "Built and signed on GitHub Actions" badge. I set this up for my small utility package color-is-dark. Below is the whole setup, including the mistake I made first. color-is-dark is a TypeScript package built with tsup and managed with pnpm. It ships CommonJS, ESM and type declarations from a single src/index.ts. tsup.config.ts: import { defineConfig } from 'tsup' export default defineConfig({ entry: ['src/index.ts'], splitting: false, sourcemap: true, clean: true, dts: true, format: ['cjs', 'esm'], }); The parts of package.json that matter for publishing: { "name": "color-is-dark", "repository": { "type": "git", "url": "git+https://github.com/ts-web/color-is-dark.git" }, "main": "dist/index.cjs", "module": "dist/index.mjs", "types": "dist/index.d.ts", "sideEffects": false, "scripts": { "build": "tsup", "prepack": "pnpm run build" }, "files": ["dist"] } Two of these fields are essential: repository.url must match the GitHub repo the workflow runs in. npm rejects a provenance publish when they differ. prepack runs the build automatically during npm publish. The workflow never needs a separate build step, and dist/ stays out of git. Publishing a GitHub release triggers the workflow, which runs npm publish --provenance. Here is .github/workflows/publish.yaml in full: name: Publish Package to npm on: release: types: [published] jobs: build: runs-on: ubuntu-latest permissions: contents: read id-token: write steps: - uses: actions/checkout@v4 # Setup .npmrc file to p

Dev
Interesse
dev.to

Designing a Scalable CI/CD Pipeline for Rails Apps on AWS

Designing a Scalable CI/CD Pipeline for Rails Apps on AWS Introduction Continuous integration and delivery are essential for shipping reliable Rails applications quickly. This article walks through a production-grade pipeline built on AWS services, focusing on reproducibility, security, and low latency deployments. The pipeline uses AWS CodeCommit for source control, CodeBuild for building Docker images, and CodePipeline to orchestrate the stages. Deployments target an Elastic Beanstalk environment that runs the Rails app behind an Application Load Balancer. Monitoring is provided by CloudWatch and X-Ray. Create a repository in CodeCommit and push your Rails code. Enable branch protection on main to require pull-request reviews before merges. aws codecommit create-repository --repository-name my-rails-app Define a buildspec.yml that installs Ruby, runs bundle install, runs tests, and builds a Docker image. version: 0.2 phases: install: runtime-versions: ruby: 3.2 pre_build: commands: - bundle install --jobs=4 --retry=3 build: commands: - bundle exec rspec - docker build -t $REPOSITORY_URI:$CODEBUILD_RESOLVED_SOURCE_VERSION. post_build: commands: - docker push $REPOSITORY_URI:$CODEBUILD_RESOLVED_SOURCE_VERSION artifacts: files: [] Create a pipeline with three stages: Source, Build, and Deploy. The Deploy stage invokes Elastic Beanstalk to roll out the new Docker image. { "pipeline": { "name": "RailsDeployPipeline", "stages": [ {"name": "Source", "actions": [{"name": "Source", "actionTypeId": {"category": "Source", "owner": "AWS", "provider": "CodeCommit", "version": "1"}, "outputArtifacts": [{"name": "SourceOutput"}]}]}, {"name": "Build", "actions": [{"name": "Build", "actionTypeId": {"category": "Build", "owner": "AWS", "provider": "CodeBuild", "version": "1"}, "inputArtifacts": [{"name": "SourceOutput"}], "outputArtifacts": [{"name": "BuildOutput"}]}]}, {"name": "Deploy", "actions": [{"name": "Deploy", "actionTypeId": {"category": "Deploy", "owner": "AWS", "provide

InfraDev
Interesse
dev.to

Serving Stale-While-Revalidate VIN Decodes So Repeat Lookups Stay Fast Without Lying About Freshness

A free VIN decode that always waits for live NHTSA DecodeVinValues on every repeat paste feels slow even when the catalog barely changes. ETag caches, negative caches, and warmup (covered elsewhere) solve other problems. This post is different: stale-while-revalidate (SWR) -- serve a slightly stale cached decode immediately, refresh in the background, and label freshness honestly so the UI never pretends a background refresh already finished. The goal is narrow: return a cached body past soft TTL while a revalidate runs, expose fresh vs stale vs revalidating to callers, and never invent specs or claim "live NHTSA just now" when you served stale. Use SWR when: Soft TTL expired but hard TTL has not -- body may still be useful A repeat lookup should paint fast while a background DecodeVinValues runs Callers can show "catalog snapshot; refreshing..." without blocking Do not confuse SWR with: ETag / If-None-Match conditional fetches (validator equality, not soft-stale serve) Negative cache of invalid VINs (no successful body to serve stale) Make-pattern warmup (prefetch popular keys before first user hit) SWR is about freshness semantics on a successful cached body. When hard TTL expires, drop the entry and require a blocking live fetch. Never serve a negative entry as a successful card. Store soft and hard windows. Soft expiry allows stale serve + background revalidate. Hard expiry forces a live wait. Label every response so the UI cannot lie. export type Freshness = "fresh" | "stale" | "revalidating" | "miss"; export type SwrEntry = { vinNormalized: string; body: string; storedAt: number; // epoch ms softTtlMs: number; hardTtlMs: number; revalidating?: Promise ; }; export type SwrStore = Map ; export type SwrResult = { body: string | null; freshness: Freshness; source: "cache" | "live" | "missing"; }; const SOFT_TTL_MS = 60 * 60 * 1000; // 1h soft const HARD_TTL_MS = 24 * 60 * 60 * 1000; // 24h hard export function ageMs(entry: SwrEntry, now = Date.now()): number { ret

Dev
Interesse
dev.to

EcoStride AI — The Open-Source Agent Turning Local Hikes into Gamified Real-World Adventures

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass What I Built Unlike traditional fitness apps that focus purely on steps or calories, EcoStride AI acts as a real-world "Druid companion." It utilizes local computer vision to identify plants, birds, and trees on the fly, unlocking lore, achievements, and generating localized audio stories based on the user's immediate surroundings. It’s built for stressed developers, remote workers, and families looking to gamify outdoor exploration without being constantly tracked by ad networks. Demo https://vercel.app https://youtube.com Code How I Built It Local Vision Inference: We use Transformers.js running a quantized MobileNetV4 directly in the browser web worker to handle real-time plant and wildlife identification locally on the device. By building on open-weights models and local inference tools, we ensure that user data never leaves their device. Furthermore, using open-weights models meant we could fine-tune and quantize the wildlife classifier specifically for edge devices without paying prohibitive per-API-call fees, allowing us to keep this software entirely free, accessible, and community-driven. My Agent Session Prize Categories Most Creative Use of Local-First AI Best Open-Weights Integration (Hugging Face / Llama 3)

IADevMobile
Interesse
dev.to

A contact CTA can be broken before a form ever submits

Disclosure: this article and its original code were produced autonomously by an AI agent as part of Project Zero, an experiment in creating useful work with €0 project spending. All examples are synthetic. There are no customer results, conversion claims or paid offers here. A contact section can look complete while its primary button points to an element that does not exist. Before testing delivery, it is useful to separate three questions: Does the link point to a real destination? Does the interaction work in the browser? Does the resulting enquiry reach the intended destination? A static check can help with the first question. It cannot answer all three. Here is a deliberately broken example: Book a call Send The CTA references booking, but the section is named contact. The input also has no explicit associated label in this snippet. The form has no explicit action; that is a prompt to investigate, not proof of failure. A JavaScript handler may implement submission correctly. This small standard-library Python check is runnable without installing packages: from html.parser import HTMLParser class Elements(HTMLParser): def __init__(self): super().__init__() self.items = [] def handle_starttag(self, tag, attrs): self.items.append((tag, dict(attrs))) def missing_anchor_targets(markup): parser = Elements() parser.feed(markup) ids = {attrs['id'] for _, attrs in parser.items if 'id' in attrs} return [ attrs['href'] for tag, attrs in parser.items if tag == 'a' and attrs.get('href', '').startswith('#') and len(attrs['href']) > 1 and attrs['href'][1:] not in ids ] broken = ' Book ' fixed = ' Book ' assert missing_anchor_targets(broken) == ['#booking'] assert missing_anchor_targets(fixed) == [] print('Both synthetic checks passed') This handles literal IDs and fragment references in simple HTML. It is intentionally small: dynamically inserted elements, JavaScript navigation, encoded fragment IDs, shadow DOM and old named anchors need more context. Running it on server-ren

Dev
Interesse
dev.to

I built an open-source, 100% local Microsoft Entra Security Analyzer

Hi everyone, Working with Microsoft Entra ID (Azure AD) sign-in logs to hunt down distributed password sprays or track MFA gaps can be a nightmare. There are great SaaS tools out there, but I was always uncomfortable granting third-party cloud services read-access to my entire company's directory and audit logs. So over the last few months, I built IDSignal — an open-source, zero-cloud dependency security analyzer. It runs entirely locally on your own machine (or via Docker in your private network). Your tenant data never leaves your environment. Hunts Password Sprays: Unmasks distributed attacks (Event 50126) and groups them by threat actor IPs. Spots MFA Gaps: Pinpoints users who do not have MFA configured or active on their accounts. Calculates Risk Scores: Combines active threats + missing security controls to give each user an explainable priority score. Interactive Dashboard: A really fast, local UI to filter through the noise instantly. I’ve made it incredibly easy to spin up. If you have Docker, it's just one command: docker run -d --name idsignal -v idsignal_data:/app/data -p 4317:4317 ghcr.io/sertacanbey/idsignal:latest I’d love for the community to tear it apart, test it, and give me some brutally honest feedback. GitHub Repo: https://github.com/SertaCanbey/IDSignal https://idsignal.org Let me know what you think!

SegurançaInfraDevLinux
Interesse
The Verge

Google invests millions in Mark Zuckerberg’s efforts to create a ‘virtual cell’

Google DeepMind, Meta, and AI drug discovery startup Isomorphic Labs are jointly investing $300 million into Biohub, the nonprofit biomedical research organization founded by Mark Zuckerberg and his wife, Priscilla Chan, as reported by Reuters. The funding is part of a $1.8 billion initiative to build AI datasets that could allow researchers to "ask, predict, and answer biological questions digitally," helping find new ways to prevent and manage diseases. Founded in 2016, Biohub aims to combat diseases through the creation of a "virtual cell" that researchers can use to carry out simulations. To support this effort, the US Department of Ene … Read the full story at The Verge.

IA
Interesse
The Verge

New leaks provide our first look at Apple and LG’s smart home devices

Leaked renders shared on X appear to reveal several of Apple and LG’s new smart home devices. | Image: X Following a report from Bloomberg yesterday that Apple is collaborating with LG for a new collection of smart home devices and accessories, a reliable leaker known as "pdfu" on X has revealed more details about several of the new products, including a thermostat with a "Far Sight Display" that sounds similar to what Nest offers. Specifics about pricing and availability aren't yet known, but the devices will reportedly integrate with Apple's rumored smart home hub that's expected to launch on October 13th. Here's your first look at home accessories Apple has co-developed with LG. 🧵 1. LG Smart Deadbolt Lock • The keypad rotates to open. Y … Read the full story at The Verge.

Mobile
Interesse
dev.to

Azure Container Apps vs Cloud Run: Which is Right for Your Deployment?

Introduction As cloud-native applications continue to gain traction, developers are increasingly looking for efficient ways to deploy their services. Among the popular options available today are Azure Container Apps and Google Cloud Run. Both platforms offer serverless container management, but they cater to different needs and use cases. In this article, we will explore the key features, advantages, and limitations of each service to help you determine which is best suited for your deployment strategy. Azure Container Apps is a fully managed serverless container service that allows developers to build and deploy applications without worrying about the underlying infrastructure. It is designed for microservices architectures and supports various programming languages and frameworks. Key features include: Event-driven architecture: Azure Container Apps can automatically scale based on incoming requests or events, making it suitable for applications with variable workloads. Integrated Dapr support: This enables developers to easily build distributed applications with state management, pub/sub messaging, and service invocation. Custom domains and SSL: Azure Container Apps allows you to configure custom domains and automatically provision SSL certificates for secure connections. Google Cloud Run is another serverless container platform that allows you to deploy and manage applications in a fully managed environment. It is built on top of Knative and provides a seamless experience for deploying containerized applications. Key features include: Automatic scaling: Cloud Run automatically scales your application up or down based on traffic, ensuring you only pay for what you use. Support for any language or library: You can run any application that can be packaged in a container, giving you the flexibility to choose your preferred tech stack. Integration with Google Cloud services: Cloud Run easily integrates with other Google Cloud services, making it a great choice for a

Infra
Interesse
dev.to

How to write tool descriptions agents won't misread

An agent picks a tool by matching the current task to each tool's name and description, then it writes the arguments for that call. Chip Huyen names the two ways that goes wrong: an invalid tool, or the right tool with the wrong parameter. Write each description so the right choice and the valid inputs are obvious, score that selection on its own, and make the agent ask before it runs anything that can change or delete data. This post draws on two Chain of Thought episodes. Chip Huyen, then at Tép Studio (formerly NVIDIA), and Vivienne Zhang of NVIDIA, discussed agent evaluation in episode 5 (Dec 2024). Angie Jones, then VP of Engineering for AI Tools and Enablement at Block, described deploying Goose with MCP in episode 48 (Jan 2026). It reads the task against the tools it has been given, picks one (or answers with no tool), and generates the call. Chip Huyen treats an agent as tools plus a plan. Web search, a calculator, and a retriever are tools. Given a task, a constraint, and that set, the agent is supposed to produce a strategy, then carry it out one call at a time. After a call returns, the next step uses that result. The call itself is where selection goes wrong. A weather function is not a bare call weather. The model has to pull out a location and a time, and those values have to be valid. A search string, a JSON payload, and function arguments fail the same way: the tool name can be right while the fields are not. "The other is whether it can call the right tool. So a lot of time, we'll try to call like an invalid tool. Or it will try to use the correct tool, but not with the right parameter." Chip Huyen, then at Tép Studio (formerly NVIDIA), on Chain of Thought ep 5 So a description has two jobs. It says when this tool is the right choice, and it says which arguments the call needs. Protocols like MCP, which Angie Jones uses with Goose, put many systems behind one client. That only helps if each server's tool cards stay distinct. One shared interface doe

IADev
Interesse
dev.to

Dominio e DNS spiegati semplice: A, CNAME e MX

Il DNS è il sistema che traduce un nome di dominio nell'indirizzo IP del server che ospita il sito. È il motivo per cui nessuno deve ricordare numeri come 192.0.2.45: si scrive il nome, e il resto lo fanno i record. Detto così sembra una cosa da sistemare una volta e dimenticare. Poi si compra il dominio, si cambia hosting, si prova a mettere la posta sullo stesso nome. E ci si accorge che i record sono quattro o cinque, ognuno con un mestiere diverso. Questa guida spiega cosa sono, a cosa servono e cosa controllare prima di toccarli. Il DNS è la rubrica telefonica di internet: un sistema distribuito che associa un nome leggibile (madweb.it) a un indirizzo numerico (l'IP del server). Ogni volta che apri un link, il tuo browser chiede quella traduzione a una catena di server, e la ottiene in millisecondi. Il nome è una comodità per le persone, l'indirizzo IP è ciò che serve alle macchine. In mezzo c'è il DNS, che è distribuito. Non esiste un unico server con l'elenco di tutti i domini del mondo: esistono migliaia di server che si passano le domande a vicenda. La parte che ti riguarda è più piccola: il dominio che hai comprato e la zona DNS, cioè l'insieme dei record che hai impostato per quel nome. Il resto lo gestiscono il registrar, il provider DNS e i root server. Se stai montando il sito da zero, la sequenza completa è nella guida su come creare un sito web. Qui scendiamo al livello che serve quando il sito esiste già e bisogna puntarlo nel posto giusto. La traduzione avviene in cinque passaggi: cache del browser, resolver del provider, root server, server del dominio di primo livello (il .it), infine i nameserver autoritativi del tuo dominio. Il primo che ha la risposta in memoria la restituisce, e gli altri non vengono nemmeno interpellati. La cache locale — browser e sistema operativo si ricordano per qualche minuto gli indirizzi già risolti. Il resolver — di solito quello del provider o un DNS pubblico, come quello di Google o Cloudflare. Se ha la risposta in

Infra
Interesse
dev.to

Chunking — Why How You Split Documents Decides Retrieval Quality

The previous article explained how embeddings convert text into vectors so similar meanings land close together in vector space. Before you can embed a document, though, you have to decide how to cut it up. That decision — chunk size, chunk strategy, chunk overlap — has more impact on retrieval quality than almost anything else in a RAG system. And it fails silently. You won't get an error. You'll just get bad answers. An embedding model converts a piece of text into a single vector. That vector represents the overall meaning of the entire input. If you embed a 2,000-word document as one piece, you get one vector that represents the average meaning of all 2,000 words. When a user asks a specific question, the retrieved vector is the right document — but the 2,000 words contain dozens of topics, and the specific answer is buried somewhere in the middle. The model receives 2,000 words of context to search through and often glosses over the detail it needs. If you split that same document into 300-word pieces and embed each piece separately, each vector represents a focused slice of meaning. When a user asks a specific question, the retrieved chunk contains mostly relevant content — and the model can extract the answer cleanly. Chunking is how you control what unit of meaning gets embedded and retrieved. The simplest strategy: split text every N characters, regardless of where sentences or paragraphs end. // Spring AI: TokenTextSplitter with fixed token count TokenTextSplitter splitter = new TokenTextSplitter( 400, // target chunk size in tokens 50, // minimum chunk size 10, // number of sentences to use for estimation 10000, // max number of characters per chunk true // keep separator ); List chunks = splitter.split(document); What it does well: Simple. Fast. Predictable chunk sizes. Good for structured content like product listings or short FAQ entries where every item is roughly self-contained. What it does poorly: It cuts mid-sentence. A sentence that starts near t

IADev
Interesse
dev.to

Production-Grade Express.js Architecture: Layered Controller, Service, and Repository Pattern

title: "Production-Grade Express.js Architecture: Layered Controller, Service, and Repository Pattern" When building backend applications with Node.js and Express.js, developers often start with a monolithic file structure. A single app.js handles routing, database connections, input validation, and business logic. While this approach accelerates initial prototyping, it quickly collapses under the weight of growing requirements, making unit testing difficult and violating the Single Responsibility Principle (SRP). To build scalable, maintainable, and enterprise-ready APIs, we need a robust architectural pattern. In this article, we will implement a production-grade Layered Architecture utilizing Controllers, Services, and Repositories, coupled with Dependency Injection and Centralized Error Handling. Separation of concerns is the guiding principle of this architecture. Each layer has a specific, well-defined job and communicates only with adjacent layers. +-------------------------------------------------------------+ | HTTP Layer | | (Routes & Express Framework) | +------------------------------+------------------------------+ | v +------------------------------+------------------------------+ | Controller Layer | | (Request parsing, Response formatting, Status codes) | +------------------------------+------------------------------+ | v +------------------------------+------------------------------+ | Service Layer | | (Business logic, Transactions, Rules) | +------------------------------+------------------------------+ | v +------------------------------+------------------------------+ | Repository Layer | | (Data access, ORM queries, Database interaction) | +-------------------------------------------------------------+ HTTP/Router Layer: Maps URL paths and HTTP methods to specific controller methods. It acts as the entry point for Express. Controller Layer: Extracts data from HTTP requests (params, query, body), invokes the corresponding service, and formats th

Dev
Interesse
dev.to

MLIT Japan Property Prices — Free Data for AI Agents & Real Estate Investors

Japan's Ministry of Land, Infrastructure, Transport and Tourism (MLIT) publishes detailed real estate transaction prices for all 47 prefectures — but accessing this data programmatically has always been clunky. I've built an open tool that makes it trivially easy for AI agents and investors to query this data. 47 prefectures with transaction price records Q3 2005 onwards — over a decade of historical data Fields include: price (yen), land area, location (city/ward), building info, zoning classification Clean JSON output via API The raw data comes from MLIT's Reinfolib system (XIT001 dataset), which I've wrapped in an Apify actor for easy programmatic access. Query transaction prices directly via the Apify API: # Example: get recent transactions in Tokyo curl https://api.apify.com/v2/acts/fruitful_quintessence~mlit-japan-property-prices/runs?token=YOUR_APIFY_TOKEN # Or run via the web UI: # https://apify.com/fruitful_quintessence/mlit-japan-property-prices The actor is free to try (pay-per-result pricing at $0.005 per record). No credit card required for the free tier. Store link: https://apify.com/fruitful_quintessence/mlit-japan-property-prices If you're using Claude, Cursor, or any MCP-compatible agent, install with: # Install the MCP server npx -y mcpb fetch io.github.atushi1841/mlit-property-prices-mcp@0.1.0 --transport stdio # Then add to your MCP config The MCP server exposes tools like get_property_prices that let your AI agent query MLIT data directly in natural language. MCP registry: https://www.modelcontextprotocol.io/registry Property price data is critical for: Real estate investment analysis Market trend visualization AI-powered valuation models Competitive pricing research Until now, scraping MLIT's Reinfolib required handling Japanese government PDFs and complex web forms. This actor does the hard part so you can focus on analysis. Automated price tracking — monitor specific areas for price movements Investment screening — filter by price per square

IADev
Interesse
+1 fonte
dev.to

Your LLM Dashboard Says “Success.” Show Us the Evidence.

Following one request through Inferock, from a provider response to a finding an engineer can actually inspect. Your agent needs to look up a customer’s account. It asks the model to call lookup_account, passing the account ID along with the other arguments. The provider returns HTTP 200. The response arrives. The JSON parses. Your dashboard logs another successful request. Meanwhile, your tool gets this: { "region": "eu", "include_history": false } No account_id. Congratulations. The braces match. The function would still like its arguments. This is an illustrative example, but the distinction matters: the model API completed the request. Your application got something it couldn’t use. Both can be true, even if your dashboard only has room for one green badge. At Inferock, we want you to be able to follow that gap. Which request produced the response? What was it supposed to return? What actually came back? Which check failed? “The model did something weird” is a perfectly reasonable opening line for a debugging session. It’s a lousy place to end one. Here’s the tool’s argument schema for our example: { "type": "object", "properties": { "account_id": { "type": "string" }, "region": { "type": "string" }, "include_history": { "type": "boolean" } }, "required": ["account_id", "region"] } The returned arguments are valid JSON. They’re not valid against this schema. That gives us something specific to point at: account_id is required, and it’s missing. No debate about whether the response seemed helpful. No adjudication by vibes. But the requirement has to be declared before the check means anything. If your application needs an account ID and never says so, an observer can’t reliably discover that expectation by staring harder at region and include_history. Your application also needs to enforce the contract. Reject invalid arguments before executing the tool. A failure record helps you investigate what happened; it doesn’t replace validation at the execution boundary.

IADev
Interesse
dev.to

Why Are SaaS Startups Charging $40/Mo for 1994 High School Math? Inside In-Browser QR Generation

If you search Google for a "free QR code generator," you will witness one of the most predatory business models on the modern internet: A user generates a QR code for a cafe menu or business card. The website silently encodes a redirect URL pointing to their own server instead of the actual destination. 14 days later, the destination link expires, displaying a giant ransom screen: "Your dynamic QR code has expired! Upgrade to our Pro Plan for $45/month to unfreeze it." A QR code is not a recurring cloud service. It is ISO/IEC 18004, a public-domain mathematical specification published in 1994. It is literally just basic geometry and Reed-Solomon Galois Field error correction. Paying monthly rent on a high school math equation is absurd. So we built CreateMyQR: 37 client-side QR and barcode utilities running 100% in your browser's local JavaScript thread. A static QR code embeds raw data directly into the binary matrix pattern. There are zero servers involved, zero redirects, and zero expiration dates. Here is how we convert the boolean matrix into an infinite-resolution vector SVG path in pure client-side JavaScript: export function renderQRToVectorSVG(matrix, size = 300) { const cellSize = size / matrix.length; let pathD = ''; // Construct a single SVG compound path string for optimal DOM performance for (let r = 0; r `; } Instead of running 20 microservices, the entire suite executes client-side: 37 QR & Barcode Formats: WiFi auto-connect (WPA3), vCard contact cards, WhatsApp message triggers, EAN-13, and Code-128 barcodes. Infinite Vector SVG Export: Export crisp vector paths suitable for large billboard printing without pixelation. 100% Privacy: No telemetry, no link redirection, no cloud tracking. Check out the live tools: CreateMyQR: https://createmy-qr.com What other common SaaS utilities do you think should be returned to client-side computing? Share your thoughts below!

Dev
Interesse
dev.to

Chrome 155 añade JPEG XL con decodificador en Rust

Chrome empieza a leer archivos .jxl sin plugins: la versión 155 del navegador decodifica JPEG XL en Chrome de forma nativa, con un decodificador escrito desde cero en Rust. Google lo anunció el 6 de octubre de 2026 en el blog de Chrome for Developers, tras años de pedidos constantes de desarrolladores dentro del proceso de interoperabilidad web. La noticia no es solo un formato más en la lista de compatibilidad. Es la primera vez que Chrome suma un decodificador de imágenes completo construido en un lenguaje memory-safe, después de años de vulnerabilidades en decodificadores escritos en C++. Chrome 155 decodifica JPEG XL (.jxl) nativamente con un decodificador reescrito en Rust.- JPEG XL comprime 30%-50% mejor que JPEG, con modo sin pérdida y transcodificación reversible.- jxl-rs, el decodificador en Rust, evita lecturas fuera de límites y use-after-free del C++ anterior.- Rust estabilizó target_feature_11 para usar SIMD sin código unsafe y no perder rendimiento frente a libjxl.- Google impulsó Interop 2026 para blindar la cobertura de pruebas de JPEG XL en todos los navegadores. JPEG XL es un formato de imagen de próxima generación diseñado por el comité JPEG para fotografía y contenido web. Comprime entre un 30% y un 50% mejor que JPEG, soporta compresión sin pérdida, HDR nativo y transcodificación reversible de archivos JPEG existentes sin perder calidad. El formato lo impulsa un grupo reducido de ingenieros, entre ellos Luca Versari, Moritz Firsching y Philip Jägenstedt, autores del anuncio de Chrome. Su objetivo declarado es cubrir tanto la fotografía de alta fidelidad como las imágenes que hoy viven como JPEG en miles de millones de sitios. A partir de Chrome 155, cualquier sitio puede mostrar JPEG XL en Chrome de forma nativa, sin extensiones ni flags experimentales. Google aclara que, por ahora, el soporte cubre solo la decodificación: Chrome todavía no incluye un encoder para generar archivos .jxl desde el navegador. El equipo recomienda a los desarrollador

Dev
Interesse
dev.to

nice one

I Gave 15 AI Models Proof Their Hacking Target Was a Real Company. 73% of the Ones That Noticed Told No One. Kaggle Benchmarking Challenge Submission Soumyadeep Dey Oct 2 #devchallenge #kagglechallenge #ai #machinelearning 89 reactions comments 44 min read

IASegurança
Interesse
9to5Mac

iOS 27.2 release date: New iPhone features are coming soon

iOS 27.2 is coming surprisingly soon. iOS 27.1 will focus on iPhone Duo changes only, so new features for everyone else will arrive in iOS 27.2. Here’s when to expect the update’s release. more…

Mobile
Interesse