StackOverflow.com

VN:F [1.9.22_1171]
Rating: 8.5/10 (13 votes cast)

Random snippets of all sorts of code, mixed with a selection of help and advice.

1.17 Files list loses folder reveals and level selection

27 May 2026 @ 10:05 pm

Running my project with 1.17 results in the Files list having lost reveal controls and reveal levels. I've modified the general template, but Files has worked fine for the last few versions. I'm not finding anything in the changelog about this (could be reading too fast). Is the 1.17 output the new default, or is the a config setting I should update? TIA for any clues. Here's 1.16 vs 1.17... Files list generated by 1.16 Files list generated by 1.17

How to optimize $O(N)$ insertion time in a custom Java Singly Linked List used as a Priority Queue?

27 May 2026 @ 10:04 pm

I am implementing a custom generic Singly Linked List in Java to manage elements ordered by a specific priority (a custom priority task queue). While the implementation works fine for small datasets, the performance drops drastically when handling larger sets because every insertion requires a linear scan to find the correct position. I tried adding a tail pointer, but it only optimizes insertions at the very end, not intermediate priority elements. Sample: public class PriorityQueueList<T extends Comparable<T>> { private Node<T> head; private static class Node<T> { T data; Node<T> next; Node(T data) { this.data = data; } } // Linear insertion sorting elements on the fly public void insertWithPriority(T data) { Node<T> newNode = new Node<>(data); if (head == null || data.compareTo(head.data) < 0) {

What proof data structures should represent meta-level proof objects in a Hilbert prover? I am trying to prove the deduction theorem

27 May 2026 @ 9:46 pm

My goal is to prove the dectuction theorem by induction in a specific axiomatic system (from Introduction to Mathematical Logic, 4th ed by Mendelson, ch1, sec4), using a hand rolled Hilbert prover I wrote in Python. I am having significant difficulty determining what datastuctures to use to represent this type of proof in my system. Hence, my goal in asking is to have outside feedback on how I can approach this. Currently, without any of the induction code, my Hilbert system produces this sort of repeatable logic: Line Reasoning Logic Label 1 Axiom (B → (C → B)) Axiom (A1) 2 Axiom ((B → (C → D)) → ((B → C) Axiom (A2) → (B → D))) 3 Axiom ((¬(C) → ¬(B)) → ((¬(C) → Axiom (A3) B) → C)) 4 Subs(Axiom (A2), {C: (B → ⊢ ((B → ((B

Why does my Java while loop keep repeating even after entering the correct value?

27 May 2026 @ 9:25 pm

I'm learning Java and practicing loops and user input with Scanner. I created a simple program that asks the user to enter a password. The loop should stop when the correct password is entered, but sometimes it keeps repeating unexpectedly. Here is my code: import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); String password = "java123"; String userInput = ""; while (!userInput.equals(password)) { System.out.println("Enter password:"); userInput = input.nextLine(); System.out.println("Incorrect password"); } System.out.println("Access granted"); } } The output looks like this when I enter the correct password: Enter password: java123 Incorrect password Access granted Observed behavior:

SwiftUI navigation bar button color changes depending on whether the root view is a ScrollView or VStack

27 May 2026 @ 9:24 pm

I have a SwiftUI view inside a NavigationStack with a custom navigation bar background color. I want the navigation bar buttons to have a consistent color throughout the app. The issue is that the navigation bar button color changes depending on the first/root view in the body. When the root view is a ScrollView, the navigation bar buttons appear white: var body: some View { ScrollView {} .toolbarBackground(Color(red: 0.02, green: 0.27, blue: 0.13), for: .navigationBar) .toolbarBackground(.visible, for: .navigationBar) .toolbarColorScheme(.dark, for: .navigationBar) } With ScrollView However, if I replace the ScrollView with a VStack, while keeping the same modifiers, the navigation bar buttons appear black: var body: some View

Why won't Ollama models pull on my Raspberry Pi 5? [closed]

27 May 2026 @ 9:24 pm

I have a Raspberry Pi 5 model B, and trying to pull any Ollama models results in this error Error: pull model manifest: Get "https://registry.ollama.ai/v2/library/llama3.2/manifests/3b": dial tcp 104.21.75.227:443: i/o timeout

How can I have a DIV under another DIV?

27 May 2026 @ 9:19 pm

I have a module, which presents all my products on the home page (prestashop). Each product category is in a DIV. My problem is that the DIVs appear next to each other, instead of one under/after the other. I would like the ROPES category to show under the RIBBONS category etc. Please see what I mean in the following image: screenshot. The DIV code is this: {foreach from=$blocks item=block} <div id="hppContainer{$block->id|escape:'int':'utf-8'}" class="{if $block->carousell==1}hppContainerBlockMainDiv hppCarouselBlock{/if}"> <h1 class="h1 products-section-title text-uppercase ">{if $block->head_url==1}<a href="{$block->url}">{/if}{$block->name|escape:'html':'utf-8'}{if $block->head_url==1}</a>{/if}{if $block->carousell_controls==1

Fixing date and time column format in R

27 May 2026 @ 9:14 pm

I have a date column in a dataframe that looks like this. Currently, the date column shows yyyy-mm-dd. But this is because the csv file automatically changed dd-mm-yyyy to this format. I want to convert this date to the proper dd-mm-yyyy hh-mm format. So for example, the first line should be 10-11-2024 11:01. I am not sure how to set this up using lubridate in R. I also do not want to manually change all my csv files. df <- data.frame(date = c( "2010-11-24 11:01", "2010-11-24 13:01", "2010-11-24 15:01", "2010-11-24 17:01", "2010-11-24 19:01", "2010-11-24 21:01", "2010-11-24 23:01", "2011-11-24 1:01", "2011-11-24 3:01", "2011-11-24 5:01", "2011-11-24 7:01", "2011-11-24 9:01", "2011-11-24 11:01"))

Show 3d decals in bgfx API

27 May 2026 @ 8:38 pm

I'm working on a 3D maze game using the BGFX API! I'm trying to display decal textures, but it's not working! First, I'm rendering them using a static projection view matrix. I can see red, but it's not in the right places! The view matrix clipping for the decals isn't even working! The depth texture consists of float values ranging from 0.0f to 1.0f. ChatGPT isn’t qualified to help with this kind of thing! Here is the C++ code on the CPU side: if (matdbg == NULL) { HANDLE f = CreateFileA(sftmp, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); if (f != INVALID_HANDLE_VALUE) { matdbg = new float[16]; //float* fv = glm::value_ptr(vvd); //float fv[16]; ReadFile(f, matdbg, 16 * sizeof(float), NULL, NULL); CloseHandle(f); } } if (matdbg != NULL) {

"Open with Code" in the context menu shows as garbled characters on my device

27 May 2026 @ 5:51 pm

I have tried uninstalling VS Code and deleting the data in %UserProFile%\.vscode, %UserProFile%\.vscode-shared, and %AppData%\Code, and then reinstalling VS Code. However, the characters in the context menu are still incorrect. Screenshot of abnormal situation: Screenshot of abnormal situation Screenshot of normal situation: Screenshot of normal situation