Programming

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

ProgrammingHow to Get a Tkinter Menu's HMENU on Windows (Fast)

Why Tkinter doesn't expose a native HMENU on Windows, how to retrieve it with MN_GETHMENU + SendMessage when posted, and use SetMenuInfo to set a background.

1 answer• 3 views
ProgrammingC++ coroutine: lifetime of temporary bound to reference

C++ coroutines materialize temporaries into the coroutine frame and store references there, so references to them remain valid across suspension. Key rules.

1 answer• 3 views
ProgrammingFix QOpenGLWidget Flicker in PySide6 Layouts

Embed QOpenGLWidget in PySide6 layouts without flickering on resize or idle. Step-by-step fixes, working code example, platform tips for Linux/Windows, and Qt bug workarounds using attributes and QSurfaceFormat.

1 answer• 3 views
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• 3 views
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• 3 views
ProgrammingIs JavaScript Learning Progress Normal After 20-25 Hours?

Assess if your JavaScript learning progress and OOP approach is typical after 20-25 hours with Python background. Code review, fixes, roadmap, and tips for beginners tackling JavaScript OOP challenges.

1 answer• 3 views
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• 3 views
ProgrammingH.264 CAVLC: run_before > zerosLeft Table 9-10 Fix

Fix H.264 CAVLC decoding errors where run_before exceeds zerosLeft in Table 9-10. Learn validation rules, prevent negative zerosLeft, and implement compliant residual block decoding for H.264/AVC decoders.

1 answer• 3 views
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• 3 views
ProgrammingSuppress MSan Errors in Bazel: Protobuf & GTest Fix

Learn how to suppress MemorySanitizer (MSan) errors from third-party libraries like Google Protobuf and GTest in Bazel builds. Custom toolchains, ignore-lists, and no-instrument patches for hermetic CI builds.

1 answer• 2 views
ProgrammingMicrosoft Access VBA UIAutomation InvokePattern Issue

Fix UIAutomation InvokePattern.Invoke not firing Microsoft Access VBA windowless buttons on secondary monitors. Includes DPI scaling, diagnostics and COM.

1 answer• 2 views
ProgrammingFix VBA Error 1004: ActiveWindow.FreezePanes (Minimized)

ActiveWindow.FreezePanes throws Runtime Error 1004 when a workbook is minimized. Learn causes and fixes: unminimize/activate or use Workbooks(...).Windows(1).

1 answer• 2 views
ProgrammingDisable font-lock-warning-face Globally in Emacs (All Modes)

Prevent Emacs from applying font-lock-warning-face in any mode. Set font-lock-ignore or add a hook to strip keywords so the warning face isn't applied.

1 answer• 2 views
ProgrammingDraw Accurate US Flag in FMX TPaintBox (50 Stars)

Learn to draw precise US flag with 13 stripes, blue canton, and 50 stars in Delphi FMX TPaintBox. Fix star positioning math, use correct proportions, and render five-pointed stars on canvas for authentic results.

1 answer• 2 views
ProgrammingImplement Undo Redo in C++ Gap Buffer Text Editor

Step-by-step guide to implement undo and redo functionality in a C++ text editor using gap buffer data structure. Beginner tips, code examples, best practices, and performance optimization for efficient editing.

1 answer• 2 views
ProgrammingC Integer Literal Promotion: Windows vs Linux Diff

Why does C integer literal promotion for 2654435769 differ between Windows (LLP64) and Linux (LP64)? Explains signed vs unsigned rules, truncation in uint32_t mul, and fix with 'u' suffix for cross-platform code.

1 answer• 2 views
ProgrammingPractical Self-Contained Boolean Lambda Use Cases in Python

Discover practical use cases for self-contained boolean lambda functions in Python using equality operators. Examples for filtering with python filter lambda, sorting via python sorted lambda, predicates, and more without external dependencies.

1 answer• 2 views
ProgrammingWinForms Modernization: .NET Migration & MVP Guide

Step-by-step path for modernizing legacy WinForms apps on .NET Framework 3.5 with God Object code-behind. Upgrade to 4.8, implement MVP pattern, refactor, and migrate to modern .NET with risks and roadmap.

1 answer• 2 views
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• 2 views
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• 2 views