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.

Why on Linux when I install from a USB, it trys and deletes itself?

6 May 2026 @ 5:13 pm

Recently, I tried booting Linux using a persistent USB, via Ventoy, it worked, but I wanted to install it. Ubuntu, the distro of Linux I got worked fine, but the actual installation on the USB failed, I could try Ubuntu, but it would try wiping Windows, even though I clearly told it not to. This caused a major problem, but Windows was not corrupted, what should I do, so it does not try and wipe the USB I was using and Windows itself.

csh script calling some .sql scripts but not others

6 May 2026 @ 5:10 pm

I have a csh script set up to run multiple .sql scripts within SQLPLUS. It is running some scripts, but not others. The scripts all work as expected when run individually in SQLPLUS, so I know the problem isn't with the scripts themselves. This is my csh script: /#!/bin/csh -f set pw = [password] sqlplus -s /nolog << EOF connect [username]/${pw} @ /path/to/script/script1.sql input1 input2 @ /path/to/script/script2.sql input1 input2 @ /path/to/script/script3.sql input1 input2 @ /path/to/script/script4.sql input1 input2 @ /path/to/script/script5.sql input1 input2 @ /path/to/script/script6.sql input1 input2 EOF When I run the csh script, it creates output files for scripts 1, 3, 5 and 6. Scripts 2 and 4 appear to not run at all. They do not create any output, nor do they appear in the stdout log. Any ideas why this would happen, and how to fix it? I am running this on a Solaris 11.4

How to extend manifest.scm in Guix project?

6 May 2026 @ 5:07 pm

I have a manifest.scm file in my project. $ cat manifest.scm (specifications->manifest (list "gcc-toolchain")) I want to create another manifest, manifest-alt.scm, where I need everything from manifest.scm AND another package. Is it possible to import and extend the first file, so that I can do guix shell -m manifest-alt.scm? I tried this, but it didn't work. $ cat manifest-alt.scm (append (load "manifest.scm") (list "make"))

C thread deadlock debug regarding a thread synchronization assignment

6 May 2026 @ 5:00 pm

I have an assignment regarding managing multiple threads in synchronizing them base on some specific conditions. I did most of this assignment, but I can't figure out the last part of it. It sound something like this: Create 40 threads and synchronize them based on the following conditions: The main thread can't end before all other threads end At a given moment, at most 6 threads can be running thread 10 can end only when 6 others threads are running (including itself) For synchronization I use POSIX semaphores. I nailed most of these conditions, but I have problems in starting up all my other threads after the last condition has been met. int p2_t_count = 0; sem_t sem_t2; sem_t sem_t210; sem_t sem_kidnap; void* thread_barrier(void* arg){ struct thread_arg *thread_info = (struct thread_arg*)arg; // kidnap 5 threads an keep them running until t

In Slack: how can I make the "apply" button available again when pasting Markdown-formatted text?

6 May 2026 @ 4:59 pm

I often compose Slack messages in a separate text editor (for various reasons not relevant here). Since they're meant to eventually be pasted into Slack, I use slack-style markdown to stress things or mark code snippets or whatever. And when I paste them, a little pop-up asks if I want to apply the markdown formatting: "Apply" or "Don't Ask Again". The problem is, on one of my machines I must have inadvertently clicked "Don't Ask Again", because the popup is gone here. On my other machine I still see it. I feel like I have fully scoured the preferences dialog and can't find any option to turn the popup back on. How do I reset this? (I'd also accept permanently turning on "apply formatting when pasting", which would be even more convenient, actually.) Both machines are running Slack as a desktop application, in Linux (Mint).

how @PersistenceContext deals with threads specially with entityManager and Session

6 May 2026 @ 4:51 pm

I am facing an issue and trying to figure out what is happening. From what I understand, using @PersistenceContext injects an EntityManager into my class. It should be thread-aware, tying the EntityManager to a thread using a ThreadLocal. However, looking at my code: package org.example.service; import org.example.entity.Account; import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; import org.hibernate.Session; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @Service public class AccountParallelService { @PersistenceContext private EntityManager entityManager; @Transactional public void updateAccountAsync(Long accountId, String newName) { Session session = entityManager.unwrap(Session.class); org.hibernate.internal.SessionImpl realSession =

How do I sync SelkoDialog user signals into Mixpanel for segmentation and filtering?

6 May 2026 @ 4:43 pm

I use Mixpanel for analytics and this works great, I can see what users are doing and what is happening in the product. To understand the real reasons why users do various things, especially why they churn, I use SelkoDialog AI User Interview Agent. This gives me deeper insights about my users and creates AI Signals for each user. Now I would like to sync these signals into Mixpanel so that I can use them there, for example to: segment users based on the AI Signals use the signals as filters in reports/funnels study specific user groups based on these signals What is the recommended way to sync external user-level data like this into Mixpanel? Is there some 3rd party Mixpanel-SelkoDialog integration? If I do this manually myself, should the AI Signals be sent as: user profile properties event properties cohorts or something else

Sanity Typegen doesn't resolve dynamic language mapping in GROQ

6 May 2026 @ 4:42 pm

I am using sanity typegen with Next.js and I have localized fields in my Sanity schema. In my GROQ queries, I use a $lang variable to pick the correct translation. While the query works perfectly at runtime and returns a string, the generated TypeScript types still treat the field as the full localized object (e.g., { pl: string, en: string }). Schema : defineField({ name: 'title', type: 'object', fields: [ { name: 'pl', type: 'string' }, { name: 'en', type: 'string' } ] }) Query: const HERO_QUERY = defineQuery(` *[_type == "home"][0] { "heading": heading[$lang] } `); Generated type (types.ts) export type HERO_QUERY_RESULT = { heading: { pl?: string; en?: string; } | null; }; Expected Type: The heading should be inferred as string | null because of the [$lang] mapping i

How to start developing HTTP server as a beginner for learning projects? and is it even a good idea?

6 May 2026 @ 4:22 pm

I am Currently a first year Software Engineering trainee based in Germany. for the most part i did Front End and UI/UX development as a hobby before starting my job but now i want to get into back end development. i heard from a lot of SWE influencers and developers that developing your own HTTP server is a good project for learning. I don't want to blindly follow youtube tutorials or vaguely written guides. any help is appreciated. at work i now mainly use c# and in school i learn Java

INSERT … WITH … SELECT fails with different errors (invalid column, invalid date) depending on execution context

6 May 2026 @ 4:22 pm

I am running a complex INSERT ... WITH ... SELECT statement on SAP HANA. The statement works partially in some contexts, but fails with different errors depending on where it is executed (SQL editor vs. automated worker/JDBC). Environment: SAP HANA Execution via JDBC (hdbcli/SAP DBTech JDBC) Also tested in DBeaver The target table exists and the column names are correct. Simplified structure of the SQL: INSERT IO ADHOC_AREA.Table_to_Insert WITH t01 AS ( SELECT ... ), t02 AS ( SELECT ... ) SELECT YEAR(MIN(b.VON)) AS BASISJAHR, g.KV AS WOP_KV, ... FROM DW_AL.Table01 a JOIN DW_AL.Table02 b ON ... LEFT JOIN Table03 g ON ... WHERE ... GROUP BY g.KV, ... Depending on execution context, I get different errors: In JDBC/worker: invalid column name: G.KV