SShortSingh.

Programming

0
ProgrammingDEV Community ·

Key Django QuerySet Tips to Reduce Database Hits and Boost Performance

A developer note originally published in March 2020 outlines practical techniques for optimising Django QuerySet efficiency. Django QuerySets use lazy evaluation, meaning database queries are only executed when the results are explicitly requested. Developers can improve performance by leveraging QuerySet caching with the 'with' template tag, using 'select_related()' and 'prefetch_related()' to minimise redundant database hits, and accessing foreign key values directly rather than fetching entire related objects. The '@cached_property' decorator is recommended for expensive model computations to prevent repeated database lookups. Additionally, using 'queryset.exists()' is advised when only checking for the presence of results, though it should be avoided if the full queryset will be needed later anyway.

0
ProgrammingDEV Community ·

Essential Ubuntu Terminal Commands: A Quick Reference Guide

A developer shared a concise reference guide for commonly used Ubuntu terminal commands, originally written on March 6, 2020. The guide covers key operations including uninstalling packages with full dependency removal using apt-get purge --auto-remove. It also includes commands for listing installed packages, switching users, and searching for files by name. Additional tips cover listing all files including hidden ones and checking the system's configured timezone. The reference serves as a handy cheat sheet for Linux users working in Ubuntu environments.

0
ProgrammingHacker News ·

Flock Safety sought to access rideshare dashcam footage for surveillance network

Surveillance technology company Flock Safety reportedly explored plans to tap into dashcams installed in rideshare vehicles to expand its data collection network. The move would have integrated footage from privately operated ride-hailing cars into Flock's broader surveillance infrastructure. Flock is already known for operating a wide network of license plate readers used by law enforcement agencies across the United States. The proposal raised concerns about the scope of private surveillance and the use of commercial vehicles as data-gathering tools without passengers' explicit knowledge.

0
ProgrammingHacker News ·

OpenAI's Head of Ethics Chloé Bakalar Departs, Raising Questions

Chloé Bakalar, who served as OpenAI's Head of Ethics, has left the company, prompting discussion about the circumstances of her departure. Her exit has drawn attention given the critical nature of her role overseeing ethical standards at one of the world's most prominent AI organizations. The departure raises broader questions about OpenAI's commitment to ethics leadership amid rapid product development. Details surrounding the exact reasons for her leaving have not been fully disclosed publicly.

0
ProgrammingDEV Community ·

Limen library enables multi-tenant auth with org roles and scoped data in Go

A new developer guide demonstrates how to build multi-tenant authentication in Go using the open-source Limen library and its Organization plugin. The setup allows a single user to belong to multiple organizations, each acting as an isolated tenant with its own members, roles, invitations, and project data. Developers can define tenant-scoped roles such as owner, admin, and member, alongside app-specific permissions like project:create. The guide uses Go 1.25+ and PostgreSQL, with optional Node 20+ support for frontend integration. A protected API endpoint is built to enforce permission checks before allowing tenant-scoped actions such as creating a project.

0
ProgrammingDEV Community ·

Solo Maintenance Tech Builds Custom Tool to Manage Seven Sites and Service Trucks

A single maintenance technician responsible for seven business locations — including a dealership, body shop, parts warehouse, and five auto parts stores — built his own digital management system after commercial work order software failed to meet his needs. Work requests previously arrived through informal channels like personal texts and verbal mentions, with no central record for tracking or follow-up. The custom tool allows anyone at any location to submit a problem report without an account, while all requests funnel into one dashboard for the technician. It also tracks scheduled maintenance and manages parts inventory separately for each physical site and each service truck, preventing the technician from arriving at a job without needed supplies. A key design choice was keeping truck inventory visible only on the back end, so public report forms show only the seven physical locations, reducing confusion for staff submitting requests.

0
ProgrammingDEV Community ·

Developer builds FRIDAY, an agentic Android AI assistant with memory and permission controls

A developer is building an Android AI assistant called FRIDAY, designed to go beyond simple chatbot functionality by incorporating memory, tool use, and permission-aware action execution. Unlike basic LLM interfaces, FRIDAY uses a layered architecture where the language model is just one component, surrounded by systems for context retrieval, intent routing, and policy enforcement. The assistant is designed to selectively remember information rather than storing everything, and to route user requests through specific tools rather than granting the AI unrestricted device access. A permission layer evaluates proposed actions before execution, distinguishing between low-risk tasks and sensitive operations that require user approval or are outright blocked. The project also explores when web search is genuinely needed versus when the model's existing knowledge is sufficient, aiming for controlled rather than maximum autonomy.

0
ProgrammingDEV Community ·

How Temporal-powered Ignition flashed 2,300 conference badges in two nights

Engineers at Replay conference built a custom firmware flashing system called Ignition, powered by Temporal, to program 2,300 ESP32-based conference badges in under two days. The team used lazy Susans from Target as rotating carriers for 16-port USB hubs, allowing coworkers to load and flash 32 badges at a time across six laptops. A critical last-minute bug emerged when QA firmware caused devices to reappear under different USB identities after resetting into the bootloader, confusing the tracking system. Engineer Edward Amsden patched the USB re-enumeration logic so Ignition could reliably identify the same physical badge across port changes. The project highlighted how flashing thousands of embedded devices in a live assembly-line setting demands the same reliability and fault-tolerance as a distributed production system.

0
ProgrammingDEV Community ·

Developer discovers CI quality gate had silently failed on every PR for weeks

A software developer writing on DEV Community revealed that their CI pipeline's content quality gate had been failing on every pull request for an extended period, without anyone realizing it was broken. The gate, powered by an LLM-based grading job, was rejecting requests before any scoring occurred due to unsupported JSON Schema constraints — such as minimum and maximum on integers — being sent to the Anthropic API. Because the error message only flagged the first failing constraint, a quick fix would have triggered a second 400 error, then a third, masking the full scope of the problem. The developer ultimately audited all schemas against a documented list of rejected keywords, uncovering sixteen violations in a single schema alone. The incident highlighted that popular Python and TypeScript SDKs silently strip unsupported constraints, a safeguard that disappears when developers call the API directly without dependencies.

0
ProgrammingDEV Community ·

How to Diagnose ClickHouse 'Too Many Parts' Error Before Running OPTIMIZE FINAL

ClickHouse throws a 'Too many parts' error when insert rates outpace background merge operations, causing inserts to slow down or fail entirely. Before running OPTIMIZE FINAL, engineers should first query system.parts to identify which partitions are accumulating excessive active parts. Checking system.merge_tree_settings reveals the actual delay and throw thresholds configured on the cluster, which may differ from table-level overrides. Sampling system.merges twice in succession helps determine whether the merge backlog is shrinking or stalled. Only after diagnosing the root cause — such as frequent small inserts or a poorly chosen partitioning key — and reducing incoming write pressure should a forced merge be considered.

0
ProgrammingHacker News ·

New Orleans Deploys AI System to Triage 911 Calls During Backlogs

New Orleans has implemented an artificial intelligence system to help triage 911 emergency calls when backlogs occur. The system is designed to prioritize incoming calls during periods of high demand. Details about the specific technology provider or deployment timeline are not available from the provided source. The initiative reflects a growing trend of cities exploring AI tools to improve emergency response efficiency.

0
ProgrammingDEV Community ·

Why Credit Notes in Multi-Currency Accounting Must Use the Original Exchange Rate

When a foreign-currency invoice is cancelled or refunded weeks later, most accounting systems apply the current exchange rate to the credit note rather than the original one, creating artificial discrepancies in the ledger. For example, a EUR 10,000 invoice booked at EUR/USD 1.08 records $10,800, but a credit note issued when the rate is 1.11 reverses $11,100, leaving a phantom $300 gap unrelated to any real currency exposure. Repeated across many transactions, this systematic error distorts reported foreign-exchange gains and losses and complicates tax reconciliation. The core distinction that systems often miss is between a pure reversal, which should inherit the original invoice rate, and a genuinely new adjustment, which may warrant a current rate. Proper data modeling requires linking each credit note explicitly to its source transaction so the correct rate can be applied automatically.

0
ProgrammingDEV Community ·

How to Build a Python Benchmark to Compare AI Tools on Real-World Tasks

A technical tutorial published on DEV Community outlines how developers can build a reproducible Python benchmark to evaluate AI tools on their specific use cases. The guide argues that public leaderboards are insufficient for production decisions, as different teams have different priorities such as latency, cost, answer quality, and consistency. The benchmark harness relies solely on Python's standard library, connecting each AI candidate through a small adapter and running identical test cases multiple times. Results are exported as both detailed JSON and a summary CSV, preserving raw outputs for auditability. The tutorial recommends defining clear acceptance criteria before testing to avoid bias toward a preferred tool.

0
ProgrammingDEV Community ·

n8n Guide Breaks Down 10 Vector Databases to Help Teams Avoid Ops Debt in AI Builds

On July 1, 2026, n8n published a practical guide evaluating ten vector database options for AI and retrieval-augmented generation (RAG) deployments. The guide covers Pinecone, Milvus, Weaviate, Qdrant, pgvector, Chroma, Redis, Elasticsearch, SingleStore, and Faiss across managed, serverless, and self-hosted categories. Rather than declaring a universal winner through benchmarks, it offers qualitative assessments across factors such as index design, metadata filtering, ingestion behavior, and operational overhead. The guide stresses that a database easy to start with may become expensive at scale, while highly configurable self-hosted systems can overwhelm smaller teams lacking infrastructure expertise. Its core argument is that vector database selection is an architectural decision shaped by data volume, latency requirements, filtering needs, and a team's maintenance capacity.

0
ProgrammingDEV Community ·

Common PHP Test Smells That Undermine Code Quality and How to Fix Them

A technical analysis highlights recurring test quality issues in PHP projects that can cause production failures even when test suites appear to pass. Problems identified include tests with too many unrelated assertions, hidden data dependencies known as the 'Mystery Guest' smell, and overly strict assertions that fail on harmless code changes. These patterns appear across popular PHP frameworks including PHPUnit, Pest, Laravel, and Symfony. Recommended fixes include splitting tests into single-responsibility units, using factories to create explicit test data, and asserting only the behavior that genuinely matters to the business logic.

0
ProgrammingHacker News ·

Undersea cable rerouted to protect Harry Potter filming site in Wales

A $580 million undersea cable project has been rerouted after public pressure to avoid disturbing a beach in Wales known as the burial site of Dobby the House Elf from the Harry Potter films. The location, Freshwater West beach in Pembrokeshire, became a fan pilgrimage site after being used as a filming location. The cable operator agreed to change the route in response to fan demands to preserve the site. The revised route will instead pass near a Bronze Age burial site in the area.

0
ProgrammingDEV Community ·

How LLMs Learn Facts: It's About Training Data, Not True Understanding

Large language models like ChatGPT do not understand the world the way humans do, but instead predict the next word or token based on patterns learned from vast amounts of text scraped from books, websites, and blogs. Behind the chat interface, a computer program formats conversations into long strings and feeds them to the model, which essentially auto-completes the dialogue. A model answers that the sky is blue not because it perceives color, but because that phrasing appeared far more frequently in its training data than alternatives like 'the sky is red.' After initial training on raw text, models undergo fine-tuning where human raters score outputs for helpfulness and accuracy, shaping the model to produce more useful responses. This means an LLM's apparent factual knowledge is a reflection of what humans have collectively written, revealing as much about human communication patterns as about the technology itself.

0
ProgrammingDEV Community ·

Developer Hosts Personal Website for Free Using Cloudflare Tunnel Behind CGNAT

A developer successfully self-hosted a website from a personal server sitting behind Carrier-Grade NAT (CGNAT) without paying for cloud hosting. The solution involved using Cloudflare Tunnel, which routes incoming internet traffic through an outbound connection the server itself initiates to Cloudflare, bypassing CGNAT restrictions. The setup relied heavily on Docker to manage components including Cloudflare Tunnel, Nginx, and PostgreSQL. A temporary Cloudflare-provided URL confirmed the site was publicly accessible, though the developer noted a custom domain would be needed for a permanent, controllable address. Throughout the project, the developer gained hands-on experience with Linux, Docker, networking, SSH, and Cloudflare — all without spending money on hosting.

0
ProgrammingHacker News ·

Write.md: Free Open-Source Themeable Markdown Editor Launches for macOS

A developer has released Write.md, a free and open-source Markdown editor designed exclusively for macOS. The app supports custom themes, allowing users to personalize their writing environment. It was shared on Hacker News as a community project, garnering initial attention from the developer community. The editor is available via its official website at writemd.app, positioning itself as a lightweight writing tool for macOS users who prefer Markdown formatting.

0
ProgrammingHacker News ·

Nvidia Releases Nemotron 3.5 Lightning 30B AI Model on Hugging Face

Nvidia has published a new AI model called Nemotron 3.5 Lightning on the Hugging Face model hub. The model is identified as a 30-billion-parameter architecture with an active parameter count of 3 billion, designated NVIDIA-Nemotron-3.5-Lightning-30B-A3B-NVFP4. It uses Nvidia's NVFP4 precision format, suggesting an emphasis on efficient inference performance. The release was noted on Hacker News, though it attracted minimal community discussion at the time of posting.

← NewerPage 218 of 1342Older →