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.

How to access a Go library (Pdfcpu) in Elixir using Wasmex?

10 May 2026 @ 7:30 pm

I have an Elixir module in which I am trying to call out to Pdfcpu to modify existing PDFs. Pdfcpu is written in Go and has a CLI and an API, and I am trying to use the API. I am using Wasmex to run the WASM code and interface with Elixir. I have created a simple Go module: package main import ( "log" "github.com/pdfcpu/pdfcpu/pkg/api" ) func main() { } func RotateFile(inFile, outFile string, rotation int, selectedPages []string) { if err := api.RotateFile(inFile, outFile, rotation, []string{"1"}, nil); err != nil { log.Fatal(err) } } then ran go mod init proj/pdfcpu go get github.com/pdfcpu/pdfcpu@latest go mod tidy GOOS=wasip1 GOARCH=wasm go build -o mai

Apache Camel HTTP client intermittently delays requests to IIS/.NET SOAP backend causing SocketTimeoutException

10 May 2026 @ 7:11 pm

I have an Apache Camel XML built on SpringBoot DSL based REST microservice that acts as a transformation middleware layer. Flow: REST JSON request --> Apache Camel XML routes Camel transforms JSON into SOAP XML Camel invokes a SOAP backend hosted on Windows IIS (.NET Framework) We are intermittently observing network/execution delays where the request from Camel appears to reach the SOAP backend late, and eventually Camel throws timeout exceptions. Symptoms Requests intermittently take a long time before backend execution starts Some requests succeed normally Some requests timeout after long waits Backend team says they sometimes see the request arriving late from Camel side Apache Camel layer eventually throws SocketTimeoutException Exception

How can I make the onResponseError block in my customized $fetch plugin work properly?

10 May 2026 @ 6:08 pm

I am currently customizing my $fetch in Nuxt and I created a plugin for it as shown in the NUXT documentation. However, I am facing an issue with onResponseError. When I log into the application, my session is managed by the Nuxt Auth Utils module. The tokens are stored in secure and the user information is stored in user. I can retrieve the data correctly, and when the token expires, my onResponseError works properly: it displays the notification, clears the session, and redirects the user to the login page. However, there is one case causing me trouble: when the token is already expired and I manually refresh the page, only the notification is displayed. The session is not cleared and the user is not redirected to the login page. This is my code:

Cannot open google drive folders in a colab notebook, even though It's the correct path

10 May 2026 @ 5:53 pm

I'm currently following a tutorial on how to build an image recognition model. Since I'm on Linux and too scared to fuck up my system if I use anaconda, I'm trying to make it in google colab, and importing the images folder from google drive, because I need to share the notebook with other people and I want them to be able to run the notebook without needing to download the files and manually change their path everytime they run it. So far it looks like this: !pip install tensorflow keras split-folders opencv-python import tensorflow as tf from tensorflow import keras from keras.models import Sequential, load_model from keras.layers import Dense, Conv2D, Flatten, Dropout, MaxPooling2D, Input from keras.src.legacy.preprocessing.image import ImageDataGenerator import matplotlib.pyplot as plt import numpy as np import splitfolders import cv2 from keras import layers, models from kera

Data Studio regression – visualising data using Chart / Filled Map for Morocco

10 May 2026 @ 5:22 pm

For the past few days, there has been a regression in Data Studio regarding the display of data using the Chart / Filled Map feature for Morocco. Summary of the issue: the Moroccan part of the Sahara is no longer included, despite the fact that I am physically located in Morocco and my Google account is that of the company, which is also based in Morocco. Request – solution: When will the original settings in Looker Studio be restored? What workarounds can be put in place to get round this issue if it is temporary? Thank you for your replies and suggestions.

Can't stop page from reloading in SvelteKit after submitting form (with use:enhance and form actions)

10 May 2026 @ 5:02 pm

I'm using form actions in a SvelteKit project. I want to submit a form, but not reload the page afterwards. For whatever reason, the usual solution (with use:enhance and update({ reset: false }) isn't working for me. One point that may be relevant: When I submit the form and haven't changed the value of the form field, the server-side form action runs fine and the page doesn't reload (the desired behavior). Only when I change the value of the form field, then submit the form, does the form action run and then the page reloads (the incorrect behavior). Here's the client-side code: <form method="POST" action="?/updateThings" use:enhance={() => { return async ({ update }) => { await update({ reset: false }); } }} > <input type="text" name="thingsJsonString" bind:value={thingsJsonString}> <button>Submit</button> </form>

How to implement Hilt correctly?

10 May 2026 @ 4:43 pm

I implemented Hilt and got this error: [ksp] [Hilt] Expected @AndroidEntryPoint to have a value. Did you forget to apply the Gradle Plugin? (com.google.dagger.hilt.android) . When try to implement it in the plugins I get the error: Plugin with id 'com.google.dagger.hilt.android' was already requested at line 2 . How did that happen and how can I solve it? build.gradle.kts (Project) // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { alias(libs.plugins.android.application) apply false alias(libs.plugins.kotlin.compose) apply false alias(libs.plugins.kotlin.android) apply false // Room alias(libs.plugins.ksp) apply false // Hilt alias(libs.plugins.hilt) apply false } build.gradle.kts (app) import com.android.aaptcompiler.compileResource plugins { alias(libs.plugins.android.application) alias(libs.plugins.kotlin.compose)

Why when I try to print all generated code from an LLVM Module, the module doesn't print function calls?

10 May 2026 @ 2:49 pm

I have been following along with the LLVM Kaleidoscope ("My First Language Frontend With LLVM Tutorial") tutorial and have run into a strange bug in chapter 3. Those familiar with the tutorial know that on exit, the program prints the generated LLVM IR for the entire program, however when I try to print TheModule's generated code, top-level expressions are omitted from the IR. This includes function calls and binary operations that are not located within the scope of another function. Oddly, when I type a top-level expression into the terminal, the main loop appropriately prints the top-level expression IR code. I haven't modified any of the source code (as to not introduce any user bugs), and compiled with the same flags as shown just above the source code in the tutorial. Here's the program running + the final

Why is the combobox is unresponsive moment I press on it in Avalonia?

10 May 2026 @ 2:32 pm

I am working on getting to know about Avalonia as I am redoing my work from WPF to Avalonia. So, I got stuck at the combobox because for some reason it just freeze like in the image below unresponsive Combobox no menu shows up to select the item, it just greys out the box and I can't select it again. In the previewer, I can see the popup previewer combobox state See the sample code below <ComboBox Grid.Column="0" SelectedIndex="0" MaxDropDownHeight="100" VerticalAlignment="Center"> <ComboBoxItem>Text Item 1</ComboBoxItem> <ComboBoxItem>Text Item 2</ComboBoxItem> <ComboBoxItem>Text Item 3</ComboBoxItem> </ComboB

Turing Completeness for a CPU?

10 May 2026 @ 11:16 am

I've tried to build a CPU in a simulator for circuits that is called logisim-evolution. I defined an instruction set, and I want to demonstrate that you can effectively implement every algorithm with this instruction set on this CPU. I think that a way to do that is to demonstrate the Turing Completeness of this instruction set. I found that a way to demonstrate the Turing Completeness of an instruction set is to demonstrate that you can implement for example an interpreter for BrainFuck language with that instruction set. Is it correct? If I implement every operation of BrainFuck language I demonstrated that the instruction set is Turing Complete and so I arrived to my goal?