SShortSingh.

Programming

0
ProgrammingDEV Community ·

Why Screenshots Are the Wrong Input When Using AI to Convert Figma Designs to Code

Design-to-code teams commonly export Figma frames as PNG screenshots and feed them into AI tools like Claude or Cursor, but this approach produces unreliable results. A screenshot strips away the structured layer tree that encodes layout intent, component types, variant properties, and spacing tokens — leaving the AI to infer rather than read. This inference is inherently lossy: the model may reconstruct code that looks visually correct but is semantically wrong, using hardcoded pixel values instead of design tokens or incorrect component variants. Tools like figmascope offer an alternative by exporting a structured context bundle — including typed intermediate representations, design tokens, and component inventories — that AI agents can parse directly. The core issue is not AI model capability but the quality of input provided, since even a capable model can only guess when given pixel data instead of structured design information.

0
ProgrammingDEV Community ·

Why enterprise data infrastructure matters more than AI model choice for agentic AI

Agentic AI systems that plan, query, and execute multi-step tasks on enterprise data are gaining traction, but their reliability depends far more on underlying data quality than on which AI model powers them. Unlike single-step AI features that fail visibly, agents compound errors across multiple steps, meaning a five-step chain with 90% per-step accuracy delivers only around 60% end-to-end reliability. The risk increases further when agents have write access, as a hallucinated action can trigger real-world consequences such as opening tickets or altering records. Experts recommend pointing agents only at well-governed, documented data tables with consistent metric definitions and known data freshness before any pilot begins. These prerequisites are not agent-specific demands but standard data governance practices whose absence becomes far costlier when AI agents can scale incorrect conclusions across an entire organization.

0
ProgrammingDEV Community ·

How to Stop Serverless Cron Jobs From Failing Silently or Running Twice

Migrating scheduled tasks to serverless functions eliminates single-server dependency but introduces new reliability risks, including silent failures and duplicate executions. Because platforms like EventBridge, SQS, and Azure Queue all use at-least-once delivery, the same job can trigger more than once, potentially double-charging customers or sending duplicate emails. Developers must build idempotency into their function code using a stable, event-derived key and an atomic check-and-set database operation to safely skip duplicate runs. Tracking job completion state — not just whether an event was received — helps detect half-finished executions caused by mid-run crashes. Dead-letter queues are also recommended to catch poison messages and prevent silent data loss when a job repeatedly fails.

0
ProgrammingHacker News ·

Lumabri experiment aims to run large AI models across peer-to-peer networks

A developer has launched Lumabri, an experimental project that distributes the workload of running large language models across multiple ordinary computers in a peer-to-peer network. Inspired by earlier work on Colibrì, which explored running large LLMs on a single consumer machine, Lumabri treats a swarm of networked computers as a shared pool of disk, compute, and model resources. The system is particularly suited to Mixture-of-Experts models, where only a fraction of parameters are activated per token, allowing small activations to be sent to peers that already hold the relevant model weights. The developer is experimenting with security and reliability features including SHA-256 verification, signed model state, peer verification, and failover mechanisms. Lumabri is an early-stage personal experiment built without datacenter infrastructure, and the source code is publicly available on GitHub.

0
ProgrammingDEV Community ·

How to Find Ghidra Log Files on Linux and Use Its Built-In Logging API

Ghidra, the open-source reverse engineering tool, uses Apache Log4j to record execution messages, but locating these logs is not straightforward. On Linux, Ghidra follows the XDG Base Directory specification, storing logs and configuration under ~/.config/ghidra/ rather than the commonly expected ~/.ghidra/ folder. The primary log file, application.log, can be found by running a simple find command or by launching Ghidra through Eclipse, which prints the settings directory path directly to the console. Ghidra maintains separate subdirectories for each version and launch mode, making it easy to distinguish logs across different installations. Developers are also advised to replace System.out.println calls with Ghidra's built-in ghidra.util.Msg class, which writes formatted output directly to application.log.

0
ProgrammingDEV Community ·

Single TPU Chip Runs Gemma 4 AI Agent Backend at Under $0.11 per Million Tokens

A developer has published a detailed build log showing that Google's Gemma 4 E2B model can be self-hosted on a single Google Cloud TPU v5e chip using vLLM, achieving 1,496 output tokens per second at roughly $0.107 per million output tokens. The setup costs approximately $0.58 per hour on spot pricing and delivers 8.02 ms per-token latency, making it capable of supporting 8 to 16 concurrent lightweight AI agents. The guide covers three provisioning models — spot, on-demand, and flex-start — noting that flex-start is the only option that automatically stops billing after a set duration. A key finding is that flex-start provisioning for a v5litepod-1 instance is only accepted in the us-west4-a zone, with other zones rejecting the configuration at the API level regardless of available quota. The author also highlights that four of their initial performance predictions were disproved by actual benchmarks, calling those discrepancies the most instructive part of the exercise.

0
ProgrammingDEV Community ·

Most directory listings offer nofollow links unless you pay or meet engagement thresholds

A developer who submitted a product to over 20 online directories found that only 5 of those listings provided dofollow backlinks. Several directories were found to tie followed links to paid upgrades or engagement conditions, such as reaching a minimum of 10 upvotes before a free listing's link becomes dofollow. One directory offered a dofollow link in exchange for displaying their badge on the submitter's site, but the outbound link was already set to nofollow before the condition was met. The developer concluded that followed links are effectively a monetization tool for these platforms rather than a standard feature of free listings. The key takeaway offered is to check a directory's pricing structure before submitting, and to treat free listings only for what they reliably provide, such as brand visibility and name-based search presence.

0
ProgrammingDEV Community ·

Claude Has Two Independent Rate Limits — Here's How They Actually Work

Anthropic's Claude AI enforces two separate rolling usage limits: a 5-hour session limit based on message volume and a 7-day cumulative limit, both of which reset relative to a user's first message rather than on a fixed schedule. These limits are measured in tokens, not messages, meaning heavy tasks like pasting large code files can exhaust a session window far faster than expected. A developer discovered that Claude's browser interface quietly queries an internal usage endpoint that returns exact utilization percentages and reset timestamps for both windows. The token-based model also means Claude Opus consumes quota significantly faster than lighter models like Sonnet or Haiku. Additionally, response quality reportedly begins to degrade before the hard limit is reached, as the model's attention mechanism deprioritizes older context in very long conversations.

0
ProgrammingDEV Community ·

Developer builds privacy-first browser tools for QR, images, and PDFs without uploads

A developer has expanded UsefulAtlas, a browser-local toolbox, with new tools including QR Studio, an Image Toolbox, and a PDF Toolbox supporting merging, splitting, and reordering. The core design principle is that private files remain on the user's device and are never sent to a remote server. Building these tools presented engineering challenges such as PDF coordinate transforms, metadata parsing, and managing memory through Blob lifecycle cleanup. The developer deliberately avoided remote upload APIs and agent layers, prioritizing a well-functioning human-facing tool above all else. UsefulAtlas is currently live and the developer is inviting others working on browser-local utilities to share their own edge-case experiences.

0
ProgrammingHacker News ·

School Districts Build Affordable Homes to Attract and Retain Teachers

Some school districts in the United States are constructing affordable housing as a strategy to recruit and retain teachers. The initiative addresses the challenge of educators being unable to afford homes near the schools where they work, particularly in high-cost areas. By offering below-market housing, districts aim to make teaching positions more attractive amid ongoing staffing shortages. The approach represents a growing recognition that competitive salaries alone may not be sufficient to draw qualified educators to certain regions.

0
ProgrammingDEV Community ·

Fix broken heading hierarchies by making heading levels dynamic, not hardcoded

A BigCommerce accessibility audit revealed skipped and inconsistent heading levels across page templates, confusing screen-reader navigation. The root cause was not incorrect tags but an architectural flaw: each template hardcoded its own heading level with no awareness of the broader page structure. The recommended fix is to create a single reusable heading component that receives its level as an input from whatever controls the page hierarchy, rather than embedding a fixed level in each template. This approach works across stacks — Handlebars, Liquid, React, and Astro — using different mechanisms but the same principle. A contextual heading level stays correct when components are reused or templates are copied, whereas a hardcoded level will eventually break.

0
ProgrammingDEV Community ·

Four Design Principles That Stop LLMs From Misusing Agent Tools

A software engineer writing for DEV Community argues that most bugs in LLM-based agents originate not in the model itself but in poorly designed tool schemas. Because a language model can only infer how a tool works from its parameter names, types, and descriptions, ambiguous schemas cause the model to guess incorrectly and misuse the tool. The author identifies four properties that make tools harder to misuse: a legible schema, a validating boundary, recoverable errors, and idempotency. Practical examples show how replacing vague field types with enums, adding numeric bounds, and writing precise descriptions can eliminate entire categories of invalid inputs. The core recommendation is to treat the schema as the complete specification, since the model has no access to source code or external documentation.

0
ProgrammingDEV Community ·

Debugging LLM Agent Failures Costs Far More Than the Failed Run Itself

Unlike deterministic software, LLM agents produce non-reproducible failures because model outputs are stochastic and external data sources change between runs, making re-running a failed agent effectively a new experiment rather than a replay. This means engineers cannot simply re-run a failed job to reproduce and isolate a bug, as the original failure conditions no longer exist. The true cost of an agent failure lies not in the token spend of the failed run, but in the repeated attempts required to reproduce the failure for inspection. For a bug that occurs just 2% of the time, reproducing it once could require roughly 50 re-runs, costing over $69 in combined token and engineer time before any fix is even attempted. The article argues that agentic systems demand a fundamentally different debugging strategy — one centered on comprehensive logging and trace capture at the time of failure, rather than after-the-fact reproduction.

0
ProgrammingDEV Community ·

How to Safely Roll Back AI Agent Config Changes Without Breaking Live Work

Changing an AI agent's configuration mid-operation is riskier than a standard code deployment, since agents can send messages, spend money, edit code, or control browsers while work is already in flight. Simply restoring an old config file does not reverse side effects already triggered under the previous settings, and can create unresolvable conflicts with recorded intents. A safer approach involves storing every config revision with a unique ID, digest, schema version, and validation result, so each agent action can be traced back to the exact policy that authorized it. Config changes should be promoted in controlled stages — from candidate to canary to active — using deterministic validation checks and isolated probe environments with mock credentials and fake APIs. At the moment of dispatch, agents must re-verify the active revision and policy, marking any intent created under a revoked config as stale and requiring replanning rather than proceeding automatically.

0
ProgrammingDEV Community ·

ICPC Champion Shares Which Competitive Programming Habits Help in Real Engineering

A software engineer who won the ACM-ICPC Asia Topi regional championship in 2021 and qualified for the World Finals has reflected on how competitive programming shaped his professional career. He argues that the discipline's greatest benefit is not algorithmic knowledge but the ability to stay calm and methodical when facing completely unknown problems. Working across XR platforms, AR fire-response systems, and AI voice agents, he found that habits like rigorous edge-case testing and careful constraint analysis translated directly into production work. However, he also acknowledges that two mindsets from competitive programming had to be actively unlearned before he could function effectively on a real engineering team. His conclusion is that contests are valuable not because they teach specific data structures, but because they repeatedly train a reliable problem-solving process under pressure.

0
ProgrammingDEV Community ·

How a Dispatch Table Pattern Can Replace Messy If-Else Chains in Code

A software developer shared how repeated copy-paste logic in a large if-else chain handling third-party API payloads prompted a refactoring exercise. The codebase processed different JSON event types — orders, refunds, and shipments — using nearly identical logic duplicated across each conditional branch. The developer identified that each branch shared the same function signature, making it a classic candidate for a dispatch table or strategy pattern. By mapping event type discriminators to individual handler functions stored in a plain object, the sprawling conditional block could be replaced with a single lookup. The approach improves testability, reduces duplication, and makes adding new event types significantly simpler.

0
ProgrammingDEV Community ·

How Claude Code hooks can enforce strict directory boundaries for unattended agents

Claude Code offers two mechanisms to restrict where an AI agent can write files, but they serve different purposes and are not interchangeable. The permissions.deny setting works as a block-list, but cannot replicate an allow-list because its precedence rules cause a blanket deny to override any exceptions. For finer control — such as limiting an agent to a specific subdirectory within a project — developers need to implement a PreToolUse hook, a command that intercepts file-writing tool calls before they execute. The hook receives the pending operation as JSON on stdin and can respond with an allow, deny, ask, or defer decision, along with a reason passed back to the model. This approach provides binding, code-enforced scope control that remains active even when no human is monitoring the agent.

0
ProgrammingDEV Community ·

How to Detect a Song's BPM and Key: Manual, DAW, and Tool Methods

Finding a song's tempo and musical key is essential for producers, DJs, and remixers working with audio. The quickest manual method involves counting the beat for 15 seconds and multiplying by four, though ambiguity can arise when a track feels half or double its actual tempo. DAW-based grid alignment offers a more precise approach, revealing tempo changes, live timing drift, and misaligned samples across an arrangement. Dedicated analysis tools like KeyFinder can automate the process, detecting BPM, musical key, scale type, and Camelot code from audio files or live system audio. Each method suits different workflows, with manual counting offering speed, DAW alignment offering accuracy, and software tools offering efficiency for batch processing or session prep.

← NewerPage 267 of 1351Older →