SShortSingh.

Programming

0
ProgrammingDEV Community ·

Bug in postgres-js driver causes queries to return corrupt results after timeout

A recurring crash in a backend service was traced to a bug in the postgres-js database driver, where a query result cursor was not reset after a connection error. When a query is cancelled mid-execution — typically due to a statement timeout — the row counter retains its previous value, causing the next query on that pooled connection to write results into a sparse array with empty leading slots. This produces arrays whose length exceeds the actual row count, explaining why a LIMIT 500 query appeared to return over 800 rows. The failure mode is particularly dangerous because sparse arrays do not throw errors, silently producing nulls in logs, incorrect API responses, or false 'not found' outcomes on valid records. The bug has been present in the upstream postgres-js repository for approximately a year and is difficult to reproduce locally since it requires a slow query to trigger a mid-scan timeout.

0
ProgrammingDEV Community ·

How a 20-for-1 Stock Split Made Amazon Look Like It Crashed 95%

Raw price data from Amazon's trading history appeared to show a catastrophic 94.9% single-day drop on June 6, 2022, but the move was not a real loss in value. The apparent collapse was caused by Amazon's 20-for-1 stock split executed that day, which divided each share into twenty smaller shares at one-twentieth the price. While the raw closing price fell from $2,447 to $124.79, the adjusted closing price actually showed a modest 2.0% gain over the same period. The discrepancy highlights a common data pitfall: raw price columns record exact trade prices, while adjusted close retroactively rewrites historical prices to account for splits and dividends. Analysts are cautioned that neither column is universally correct, and using the wrong one in calculations such as return models or backtests can produce severely misleading results.

0
ProgrammingDEV Community ·

Background Jobs Must Re-Authorize at Runtime, Not Just at Enqueue Time

Async background jobs commonly inherit user IDs, tenant IDs, or token snapshots from the original request that scheduled them. However, these snapshots do not constitute a permanent permission grant, as roles, memberships, or resource access may change before the job actually executes. A worker that relies solely on enqueue-time credentials risks acting with privileges the user no longer holds. Developers should re-authorize each job against the current subject, tenant, and action immediately before any sensitive read or write operation. The enqueue-time check should only determine what can be scheduled, while final authorization must occur at the actual moment of data access.

0
ProgrammingDEV Community ·

A 40-Line Python Script Can Detect AI Text, But Its Failures Reveal More Than Its Wins

A developer built a compact 40-line Python AI-text detector using two signals: sentence-length burstiness and repeated n-grams, with AI-generated text typically scoring lower due to uniform structure and repetitive phrasing. The tool works as a quick triage filter but breaks down in three notable ways identified during real-world use. Short texts under roughly 40 words produce unreliable scores, while naturally uniform genres like legal writing or API documentation are wrongly flagged as AI-generated. The detector is also trivially easy to game, as minor edits such as splitting sentences or swapping synonyms can reset the score without improving actual prose quality. The author concludes that such a detector serves only as a smoke test, not a reliable judge of writing quality or human authorship.

0
ProgrammingDEV Community ·

Developer Tutorial: Build an Invoice-to-JSON API Using Next.js, DEVUP AI, and Zod

A developer tutorial published on DEV Community walks through building an invoice and receipt data-extraction API using Next.js, DEVUP AI Vision, Zod, and JSON Schema. The pipeline converts uploaded invoice images into structured JSON, then flags each result as either auto-checked or needs-review based on validation and arithmetic checks. The guide emphasizes that a vision model can only propose a structured interpretation, and human approval is required before any extracted data enters an accounting system. It covers setup steps including environment configuration, dependency installation, and secure handling of API keys to ensure the browser never accesses the DEVUP AI credentials. The tutorial explicitly disclaims accuracy guarantees, noting that real-world invoices involving handwriting, perspective distortion, or complex layouts present additional extraction challenges.

0
ProgrammingDEV Community ·

How to Set Up Telegram Order Alerts as a Backup to WooCommerce Emails

WooCommerce store owners often miss order notifications because email alerts can be delayed, spam-filtered, or silently dropped by hosting servers. A practical workaround is adding Telegram as a secondary notification channel, which delivers messages near-instantly without passing through spam pipelines. The setup involves creating a Telegram bot via BotFather, retrieving a chat ID, and connecting both credentials to a WooCommerce Telegram notifications plugin from the WordPress admin panel. Store owners can configure alerts for specific order events such as new orders, failed payments, and refunds. Experts recommend keeping email enabled for customer receipts while using Telegram purely as a real-time backup to avoid single-channel dependency.

0
ProgrammingDEV Community ·

How to Safely Hand Back a WordPress Site After Development Work

When developers work on an inherited WordPress site in a local or staging environment, test content, debug plugins, temporary users, and development settings can accidentally be pushed to the live production site during deployment. To prevent this, developers should categorize every change made into items that belong in production and those that are dev-only leftovers before deploying. Dev-only items such as test posts, debug plugins, temporary admin accounts, and settings like disabled caching or blocked search engine indexing must be cleaned up from the development copy first. Critical checks before going live include taking a fresh production backup, reviewing database changes for new user submissions, and ensuring debug logs are deleted so sensitive file paths are not publicly accessible. After deployment, developers should verify the live site's search engine indexing settings and flush permalink rules to avoid broken URLs.

0
ProgrammingDEV Community ·

Mojo: A High-Performance Programming Language Built for AI Systems

Mojo is a new programming language designed specifically for writing systems-level code optimized for AI workloads. It aims to combine high performance with usability for AI and machine learning development. One of its notable quirks is its unconventional file extension, which uses a fire emoji (.🔥). The language has drawn attention in developer communities for its focus on bridging the gap between AI research and low-level system performance. Developer Ekemini Samuel published an introductory overview of Mojo on DEV Community in August.

0
ProgrammingDEV Community ·

Databricks LTAP Architecture Proposed for Asia Real-Time Financial Markets

A private, invitation-only event called Hong Kong Databricks FSI Community Day 2026 is set to take place aboard a boat on Hong Kong Island waters, bringing together financial data professionals independent of Databricks corporation. The gathering will feature over thirty technical proposals addressing real-world financial architectures, including cross-border liquidity management and real-time streaming across Hong Kong and Singapore. One key session proposes an institutional LTAP (Lake Transactional Analytical Processing) architecture using Databricks Lakebase and Lakehouse to unify transactional applications with large-scale analytics under a single governed storage layer. Lakebase would handle low-latency transactional workflows such as trader watchlists and regulatory approvals, while Lakehouse would serve live market data queries to concurrent dashboards, APIs, and AI agents. Unity Catalog is central to the design, providing unified access control, data lineage, and audit capabilities across all workloads and jurisdictions.

0
ProgrammingDEV Community ·

Microsoft Agent Framework Supports File, Class, and Code-Based Skills in C#

A developer and speaker at Build.AI 2026 has published a detailed walkthrough on implementing Skills within the Microsoft Agent Framework (MAF) using C#. Skills in MAF are focused capability sets defined through concise prompts and supporting scripts, enabling large language models to invoke specific functions. The framework supports multiple skill types, including file-based, class-based, code-defined, and MCP-based skills, with most scripts currently written in Python due to C# scripting limitations. MAF selects skills through a four-step process — advertise, load, execute, and respond — injecting skill descriptions into the system prompt for the LLM to reference. The post also contrasts Skills with Workflows, noting that Skills suit flexible, single-domain tasks while Workflows are better for deterministic, multi-step processes with real-world side effects.

0
ProgrammingDEV Community ·

New Benchmark Tests If AI Models Know When to Admit They Can't Answer

A developer has created a 200-item benchmark called ESCALATE to measure whether AI models can recognize the limits of their own knowledge, not just whether they answer correctly. Each task includes a deliberate "unanswerable" scenario in roughly one in five items, where the only correct response is to escalate rather than guess. The benchmark spans four task types — routing, classification, judgment, and grounded question-answering — and scores models on both accuracy and false-confidence rate. The project compares frontier models hosted on Kaggle against small open-source models ranging from 1B to 8B parameters running locally on a single laptop. The author has pre-registered predictions before results are in, including the hypothesis that some small local models may show lower false-confidence rates than certain frontier models.

0
ProgrammingDEV Community ·

Developer Builds Tetris and Space Shooter on a Two-Button ESP32 Microcontroller

A developer has implemented a Tetris clone and a Roguelite Space Shooter in C on an ESP32-S3 microcontroller that already serves as a network diagnostics tool. The biggest challenge was designing playable games for a device with only two physical buttons, solved in Tetris by introducing an auto-sweep system that moves pieces horizontally on a 200-millisecond timer, reducing required inputs to rotate and drop. Additional actions like pause, hard drop, and soft drop were unlocked through timed button gestures such as double-clicks and long holds. The Space Shooter features 30 enemy waves, three boss fights, and a Roguelite upgrade system, with memory stability maintained by pre-allocating static object pools for bullets and enemies instead of dynamic heap allocation. Both games run on the same FreeRTOS-based hardware alongside packet sniffing and other network tools, serving as a stress test for the ESP32 and the LVGL graphics library.

0
ProgrammingDEV Community ·

Sequential Awaits in Next.js Server Components Can Multiply Your Page Load Time

A common async coding pattern in Next.js Server Components — chaining multiple independent await calls sequentially — can significantly slow down page load times without developers realizing it. When four unrelated data-fetching calls each take ~150ms and run sequentially, the total wait reaches ~600ms, compared to ~150ms if run concurrently. Using Promise.all to fetch independent data simultaneously eliminates this unnecessary delay while returning identical results. When some fetches genuinely depend on earlier results, developers can still optimize by starting independent requests early without immediately awaiting them, letting them run in the background. This technique ensures only true data dependencies impose sequential ordering, keeping load times as low as possible.

0
ProgrammingDEV Community ·

Tutorial: Build an Interactive 3D Tilt Profile Card Using HTML, CSS and JavaScript

A new developer tutorial published on DEV Community walks readers through creating an interactive 3D tilt profile card using only HTML, CSS, and JavaScript, with no external animation libraries required. The card features smooth cursor-based rotation, layered parallax movement, a dynamic glare effect, and a cursor-follow glow. Additional elements include an animated availability indicator, a rotating avatar ring, and a display of profile skills and statistics. The component is designed to be responsive and includes fallback support for touch devices and reduced-motion preferences. According to the tutorial, the finished card is suited for developer portfolios, personal websites, team pages, and modern landing pages.

0
ProgrammingDEV Community ·

Developer Builds Commodore 64-Inspired Retro Android Launcher

A developer has created a custom Android launcher called Tile Launcher, drawing inspiration from the Commodore 64 and 1980s computing aesthetics. The project aims to consolidate frequently used functionality directly within the launcher, reducing the need to switch between apps. The developer designed it to work within the boundaries of what Google permits for Android launchers. A demo video and the project's source code have been made publicly available on GitHub. The launcher is still described as a work in progress.

0
ProgrammingDEV Community ·

Study: 1 in 5 Resold Phones Contained Enough Data to Identify Previous Owner

A 2022 UK forensic study of 100 second-hand mobile devices found that nearly half had no data removal attempted before resale. Among devices still holding data, 20% contained personally identifiable information such as names and account details accessible to the new buyer. A separate 2025 study found recoverable user data on over 12% of USB drives sold as new on the secondhand chip market. Forensic research also shows that even a proper factory reset may leave some data recoverable through low-level analysis, since not all storage partitions are fully wiped. Experts recommend encrypting a device before performing a reset when selling, and buyers are advised to run their own factory reset before signing into any personal accounts.

0
ProgrammingDEV Community ·

AI Agent Checklist for Solo Founders: How to Automate Tasks You Can Trust

Solo founders often struggle not because AI models lack capability, but because they fail to clearly define the task, set boundaries, and build verification steps before automating. A new tool-agnostic checklist guides one-person businesses through scoping, speccing, and safely deploying AI agents across platforms like Zapier, Make, or n8n. Industry data underscores the challenge: a 2025 Stack Overflow survey found only 31% of developers currently use AI agents, with 46% citing accuracy distrust, while McKinsey reports just 23% of organizations are scaling agentic AI. Gartner forecasts that 40% of enterprise apps will include task-specific AI agents by end of 2026, up from under 5% in 2025, signaling rapid but still-early adoption. The checklist emphasizes starting with low-risk, easy-to-verify, draft-only tasks and building trust through clear specs, real test examples, and mandatory human approval gates.

0
ProgrammingHacker News ·

Singapore government dating app uses stable matching algorithm

A Singapore government-supported dating application employs the Gale-Shapley algorithm, a mathematical model for stable matching. The algorithm, a Nobel Prize-winning concept, is designed to create optimal pairings by ensuring no two participants would both prefer to be matched with each other over their assigned partners. The app is part of official efforts to address the nation's low birth rates and promote family formation. This technical approach to matchmaking was discussed on the Hacker News forum, generating significant user engagement.

← NewerPage 785 of 3167Older →