Programming

Questions about C#, Python, Java, algorithms, and code architecture.

ProgrammingFix OOM Qwen3-0.6B Training on A100 32k Seq Length

Diagnose why OOM hits training Qwen3-0.6B (16 heads) on A100 48GB at 32k sequence with FlashAttention 2. Correct attention matrix estimates, quick fixes like windowed attention, ZeRO-3 offload, and scaling strategies for long sequences.

1 answer• 1 view
ProgrammingPython Console Output Without print(): logging & sys.stdout

Output text to the console in Python without print(): compare sys.stdout.write/writelines, os.write, logging, and file/tee with short examples and use cases.

1 answer• 1 view
ProgrammingFix Zoho Books API Vendor Credit Error Without Bill ID

Resolve Zoho Books API error 37034 'Select associated bill number or bill type' when creating vendor credits without bill_id. Use bill_type 'OTHER' or bill_number, add account_id. Sample payload and steps to create standalone credits.

1 answer• 1 view
ProgrammingExtract Book Titles, Images & Prices with lxml XPath

Extract book titles, image URLs and prices from books.toscrape.com using lxml XPath in Python. Includes sample code, urljoin for images, and error handling.

1 answer• 1 view
ProgrammingWhy Git disallows --detach with --orphan (detached HEAD)

Why Git forbids --detach with --orphan, how to detach HEAD by using git checkout on an orphan commit SHA, and scripting patterns to handle orphan branches.

1 answer• 1 view
ProgrammingEntity Framework Core: Fix 'Second Operation Started' Error

Learn why Entity Framework Core throws 'A second operation was started...' and how to fix it: scope DbContext, await queries, or use IDbContextFactory.

1 answer• 1 view
ProgrammingPrompt LLM for Exhaustive Lists: Engineering & Local Models

Master prompt engineering to make LLMs generate complete 500+ item lists in one prompt. Use reverse ordering, explicit instructions, delimiters, and local LLMs like Qwen3-Next for exhaustive outputs without truncation.

1 answer• 1 view
ProgrammingC++ vs Rust: Future Prospects & Which to Learn Now

Compare C++ vs Rust future prospects, performance, memory safety, ecosystem, jobs. C++ remains dominant with vast ecosystem; Rust grows in safety-critical areas. Learn C++ for broad jobs, Rust for modern systems and long-term edge.

1 answer• 1 view
ProgrammingNumPy Polyfit: Fix Cubic Polynomial Coefficients Python

Why does sampling fail for cubic polynomial coefficients in NumPy? Fix Vandermonde matrix issues with np.polyfit, np.vander for accurate roots. Robust Python code for polynomial fitting and np.roots.

1 answer• 1 view
ProgrammingTennis Score Encoding for Machine Learning Models

Learn how to convert tennis score strings like '6-4 6-2' into numerical features for Random Forest models. Step-by-step guide with code examples.

1 answer• 1 view
ProgrammingCode Reviews Before GitHub: Git Patches via Email

Discover how developers conducted code reviews before GitHub using Git patches emailed to mailing lists. Learn the git format-patch, git send-email workflow that powered Linux kernel development with offline testing and inline feedback.

1 answer• 1 view
Programming.NET Minimal API Validation Fails Across Assemblies

Why .NET Minimal API validation breaks with generic endpoints in different assemblies. Source generator limits, resolver scanning issues, and workarounds like custom filters and FluentValidation for modular CQRS setups.

1 answer• 1 view
ProgrammingGDT & IDT Selectors for Protected-Mode Kernel (Bootloader)

GDT and IDT entries for protected-mode kernels: how to read the code-segment selector, reuse or replace the bootloader GDT, and key best practices. Tips.

1 answer• 1 view
ProgrammingRust vs JS/TS Binaries: Backend API Performance

Compare Rust performance vs JS/TS binaries (Bun, Deno) for backend API servers: throughput, latency, CPU/memory, concurrency stability. Benchmarks show Rust edges in predictability; JS/TS viable for fast development.

1 answer• 1 view
ProgrammingGet the QML engine from a registered C++ QML type object

Obtain the QQmlEngine that created a registered C++ QML type using qmlEngine(this) or QQmlEngine::contextForObject(this). Includes concise code example and tips.

1 answer• 1 view
ProgrammingInject Base64 Avatar into Carbone Template Properly

Learn how to inject base64-encoded avatar images into Carbone templates using dummy placeholders and full data URIs. Fix Java code issues and use with third-party Carbone providers for dynamic PDFs and DOCX.

1 answer• 1 view
ProgrammingTroubleshoot Dask: Client Connects but No Workers Available

Dask client connects but reports no workers - troubleshoot scheduler, worker registration, network/TLS, version mismatches, autoscaling, and check worker logs.

1 answer• 1 view
ProgrammingFix Vulkan macOS Crash with Silk.NET & MoltenVK

Resolve vkEnumeratePhysicalDevices crash in Silk.NET Vulkan on macOS with MoltenVK. Learn proper setup, extensions, and device enumeration for .NET 8.

1 answer• 1 view
Programmingggplot2 Legend Label Intervals: Prevent Text Overlapping in Contour Plots

Learn how to adjust label intervals in ggplot2's geom_contour_filled legend using guide_colorsteps parameters to prevent text overlapping and improve visualization readability.

1 answer• 1 view
ProgrammingCount USB Ports on Windows Using Go: Stable Enumeration

Count physical USB ports on Windows using Go. Stable enumeration via SetupAPI & IOCTL ignores connected devices. Code examples for USB root hub query.

1 answer• 6 views