SShortSingh.

Programming

0
ProgrammingDEV Community ·

How Startups Can Survive AWS Regional Outages Without Doubling Cloud Costs

Full multi-region infrastructure redundancy is the standard recommendation for surviving AWS outages, but it can double cloud bills and is impractical for most startups and mid-sized businesses. A hybrid approach combining intra-region Multi-AZ automation with a lightweight cross-region backup strategy offers a more affordable alternative. The method relies on managed services like AWS Fargate, Lambda, and RDS Multi-AZ for automated local failover, while storing only data — via daily RDS snapshots and S3 Cross-Region Replication — in a secondary region rather than running live infrastructure there. Infrastructure-as-code tools like Terraform or CloudFormation are used to define the backup environment, with compute resources spun up only when a real disaster occurs, avoiding the cost of idle servers. This trade-off accepts a short recovery delay during a worst-case regional failure in exchange for significantly lower ongoing costs, with cold backup storage estimated at around $5 per month for a 100 GB database.

0
ProgrammingDEV Community ·

How to Build an AI Agent Harness From Scratch in Your Code Repository

A developer tutorial on DEV Community walks through building an AI agent harness — a structured set of files, rules, and conventions stored directly in a code repository. The harness gives an AI agent everything it needs to operate autonomously, including how to start, what constraints to follow, how to verify task completion, and how to hand off work to the next session. The guide uses a simple command-line ledger project as a sandbox, constructing key files such as CLAUDE.md for agent instructions and ARCHITECTURE.md for system design details. A startup script is also added to handle dependency installation and verification in a single step, forming the foundation of the agent's operating loop. The core principle is that keeping task criteria inside the repository — rather than in ephemeral chat messages — ensures consistent decision-making across agents and developers alike.

0
ProgrammingDEV Community ·

How a Provider Policy Linter Can Catch Silent AI Gateway Failures in CI

Multi-provider AI gateways can fail quietly when model aliases, routing rules, or pricing data change without triggering obvious errors in the SDK or dashboard. A provider policy linter is a lightweight CI gate designed to catch these issues before a release ships, by validating assumptions around models, endpoints, pricing, and billing groups. The approach involves five core checks: confirming pricing source freshness with dated references, verifying model route existence, enforcing explicit endpoint compatibility declarations, clarifying billing-group context in examples, and requiring named fallback policies. Reference pricing data for this guide was sourced from AIWave's public endpoints on September 14, 2026, reflecting a 64-model snapshot dated September 10, 2026. The linter is intended to complement, not replace, live monitoring, and its policy configuration file should be version-controlled alongside SDK code.

0
ProgrammingDEV Community ·

Adding One String Key to a PHP Array Can Silently Consume 25 MB Extra Memory

A developer refactoring legacy PHP code discovered a significant memory cost tied to how PHP internally handles arrays. A packed array of one million integers uses about 16.8 MB in PHP 8.4, but adding even a single string key forces PHP to convert it into a full hash table, jumping memory usage to nearly 42 MB. This conversion adds roughly 25 MB of overhead and is irreversible — unsetting the key does not reclaim the memory. The same penalty applies when filling an array with sequential integer keys in reverse order, as PHP treats out-of-order insertion as a hash table rather than a packed list. The findings highlight how PHP's internal array optimizations can silently break under common coding patterns, with real consequences for memory-heavy workloads like processing large database result sets.

0
ProgrammingDEV Community ·

HTMP Library Brings React-Like Reactivity to a Single HTML File at 2.9 kB

A lightweight library called HTMP enables reactive UI behavior — including counters, todo lists, and live form updates — directly inside a single HTML file with no build tools or package managers required. The zero-dependency engine weighs just 2.9 kB gzipped and works in any browser, including via a local file:// URL. HTMP is built on three core concepts: an HTML template parsed by the browser's native DOMParser, a reactive state object powered by JavaScript's Proxy, and plain event-handler functions. It offers a lifecycle API with mount, unmount, remount, and destroy methods, making it suitable for single-page apps and embeddable widgets. The library is aimed primarily at PHP, WordPress, and legacy-stack developers who need client-side interactivity without adopting a full JavaScript framework.

0
ProgrammingDEV Community ·

Step-by-Step Lab Guide: Build an Active Directory Domain with Hyper-V

A hands-on IT lab project walks users through setting up a Windows Server Active Directory Domain Services environment using Hyper-V virtualization on a Windows 10 or 11 machine. The project covers creating and configuring a domain controller, promoting it, and adding a domain member server using two Windows Server 2022 Evaluation Edition virtual machines. Users need the Professional or Enterprise edition of Windows 10/11 and at least 16 GB of RAM on the host machine to run the setup. The lab is designed to simulate a real-world scenario, such as a company establishing centralized authentication for a new branch office. The entire exercise is estimated to take approximately 45 minutes to complete.

0
ProgrammingHacker News ·

Guide Outlines Best Practices for Writing Effective Software Design Documents

A new guide published on Refactoring English offers practical advice for software developers on writing effective design documents. The article focuses on structuring design docs in a way that clearly communicates technical decisions and project scope. It aims to help engineers improve collaboration and reduce ambiguity during the software development process. The resource was shared on Hacker News, where it attracted initial reader interest.

0
ProgrammingDEV Community ·

GitHub Copilot Billing Gap Sparks Proposal for Project-Level AI Cost Tracking

Enterprises using GitHub Copilot face a significant challenge in accurately attributing AI usage costs across multiple projects, customers, and internal units, since current billing only aggregates data at the user level. This makes project-based cost accounting, customer chargebacks, and departmental budgeting difficult or impractical. A proposal raised in GitHub Community Discussion #206110 suggests allowing Copilot clients to attach a configurable billing reference — defined via a small file at the workspace or project root — to AI usage based on the active project context. The identifier would be organization-defined, enabling alignment with existing internal accounting structures such as cost centers or project codes. If adopted, the feature would expose this reference as an additional dimension in AI usage reporting and APIs, giving technical and financial leaders clearer visibility into the true ROI of AI investments per project.

0
ProgrammingDEV Community ·

How a Caffeine Tracker Uses Decay Math to Show What's Still in Your System

A developer built a manual caffeine tracker that estimates residual caffeine in the body using an exponential decay formula based on a default five-hour half-life. Unlike a simple daily total, the tool sums the decayed residuals of every logged drink, meaning a late-night coffee from the previous day can still show up in the current estimate. Records are kept for 48 hours rather than reset at midnight, preventing the misleading scenario where a low daily total masks significant leftover caffeine. The tracker includes a Chart.js projection of residual levels over the next 24 hours, sampled at 30-minute intervals, with a configurable 50 mg sleep threshold line and a separate 400 mg daily reference. The project's key design principle is keeping dose, time, half-life, and display thresholds as distinct variables rather than collapsing them into a single opaque figure.

0
ProgrammingDEV Community ·

Developer releases open-source CeX UK price tool after bug inflated £30 case value to £136

A developer building an eBay pricing tool discovered a bug that incorrectly attributed a £136 CeX cash offer — meant for a Raspberry Pi 500+ — to a £30 Argon ONE Pi case. The error stemmed from CeX's Algolia-powered search returning fuzzy, mismatched results rather than exact product matches. To address this, the developer built and published a standalone Python library called cex-uk-prices on GitHub under an MIT licence, which scores search results for relevance and discards weak matches below a 0.6 threshold. The tool queries CeX's Algolia index directly, since the main website returns 403 errors to server-side requests, and retrieves sell prices, cash and voucher trade-in values, and stock availability. The developer cautions that the library relies on an unofficial endpoint that may break if CeX updates its front end.

0
ProgrammingHacker News ·

Otis: Open-Source AI Agent Runs Local Models With Automatic Hardware Detection

A developer has released Otis, an open-source AI agent designed to run large language models locally with a focus on user privacy. On first setup, Otis automatically detects the host machine's hardware and recommends, downloads, and runs a suitable local model via llama.cpp. The tool offers a unified interface for both local and hosted open-weight models, keeping the experience minimal and consistent. It also supports popular local model platforms including Ollama, LM Studio, and Nvidia PAIR. The project is currently seeking community feedback and is openly available for anyone to try.

0
ProgrammingDEV Community ·

How to Build a Thread-Safe HTTP Server in Python Using Threading

A new developer tutorial on DEV Community walks through the concept of thread safety and its importance in concurrent programming. Thread safety ensures multiple threads can run simultaneously without corrupting shared data, similar to how a bank must coordinate ATM transactions to prevent errors. The guide uses Python's built-in http.server module to first build a basic single-threaded HTTP server, then extends it with the ThreadingMixIn class from the socketserver module to handle multiple client requests at once. The tutorial is aimed at beginners and explains core concepts like threads, processes, and shared resource management before introducing code. The goal is to help developers understand how to build efficient, concurrent servers suitable for real-world use cases.

0
ProgrammingDEV Community ·

Amazon S3 at 18: Why AWS's First Storage Service Still Powers the Cloud

Amazon S3 (Simple Storage Service), launched in 2006 as one of AWS's earliest offerings, remains a foundational component of modern cloud infrastructure. The object storage service stores data as objects inside buckets, supports individual files up to 5 TB, and guarantees 99.999999999% durability by replicating data across at least three availability zones. Unlike traditional file systems such as EBS or EFS, S3 offers unlimited capacity with no provisioning required and natively integrates with over 200 AWS services. It supports multiple storage classes — from S3 Standard for frequently accessed data to Glacier Deep Archive for long-term retention — allowing teams to balance cost against access needs. S3 is widely used as the backbone of data lakes, static website hosting, backup storage, and machine learning pipelines on AWS.

0
ProgrammingDEV Community ·

Amazon S3 Security, Performance and Infrastructure-as-Code Best Practices Explained

A technical guide covering Amazon S3 security, cost optimisation, and infrastructure-as-code using Terraform has been published as the second part of a two-part series. Since April 2023, all new S3 buckets have Block Public Access enabled by default, and since January 2023, all new objects are encrypted by default using SSE-S3 with AES-256. The guide recommends using SSE-KMS with a dedicated customer-managed key per sensitive bucket to enable auditing via AWS CloudTrail and enforce separation of responsibilities. For cost management, lifecycle policies can automatically transition objects across storage classes, while S3 Intelligent-Tiering handles unpredictable access patterns with no retrieval fees. The article also covers data protection features such as versioning, Object Lock in Compliance mode, and MFA Delete to guard against accidental or malicious deletion.

0
ProgrammingDEV Community ·

Anthropic's Model Context Protocol Aims to Standardize AI Tool Integration

Anthropic released the Model Context Protocol (MCP), an open standard, in late 2024 to address the fragmentation in how AI tools are built and shared across different language models. Currently, developers must write separate integration code for each AI platform — such as OpenAI, Anthropic, or Ollama — because each expects a different format. MCP acts as a universal interface, allowing a tool built once as an MCP server to work with any compatible client without modification. The protocol defines how clients discover available tools, how servers expose them in a standard format, and how tool calls and results are exchanged via JSON-RPC. Hundreds of pre-built MCP servers already exist for common use cases, including file system access, GitHub, PostgreSQL, and web search.

0
ProgrammingDEV Community ·

AWS Lambda: How Amazon's Serverless Compute Service Works and When to Use It

AWS Lambda, launched by Amazon in 2014, is a serverless compute service that runs code in response to events without requiring users to manage any underlying infrastructure. It has become the most widely used AWS compute service after EC2, handling scaling, availability, monitoring, and patching automatically. Each function execution follows a lifecycle that includes either a cold start — involving code download, micro-VM creation, and runtime bootstrap — or a faster warm start that reuses an existing environment. Lambda supports multiple programming languages and offers configurable memory from 128 MB to 10 GB, with execution timeouts of up to 15 minutes. Pricing is based on the number of invocations and memory-duration usage, with a free tier covering one million invocations and 400,000 GB-seconds per month.

0
ProgrammingHacker News ·

Texas Judge Rules TikTok Deceived Users About Child Safety Feature

A Texas judge has ruled that TikTok misled users regarding one of its child safety features, according to a Reuters report dated September 11, 2026. The ruling centers on claims that TikTok made false or deceptive representations about how the feature functioned to protect younger users. The case is part of broader ongoing legal scrutiny TikTok faces in the United States over its handling of minors on the platform. The decision could have significant implications for TikTok's operations and its obligations to users and regulators going forward.

0
ProgrammingDEV Community ·

Sliding Window Technique Explained: A Key DSA Pattern for Coding Interviews

The sliding window is a high-frequency algorithmic pattern used to solve subarray and substring problems efficiently, distinct from the two-pointer technique. It works by maintaining a moving window over an array or string, updating results incrementally rather than recalculating from scratch each time. Fixed sliding windows maintain a constant size, while variable windows expand and shrink dynamically based on validity conditions. Common interview problems solved with this pattern include longest substring without repeating characters, maximum sum subarray of size k, and minimum window substring. Key mistakes to avoid include recalculating window sums in a loop, forgetting to shrink the window, and using a list instead of a set or dictionary for duplicate checks.

← NewerPage 1263 of 3231Older →