StackOverflow.com

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

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

Migrating to graalvm issues. (log4j2)

15 June 2025 @ 10:31 am

I am actually working on migrating my java, springboot application to graalvm native image. Does graalvm support log4j2? or is there any substitute with minimal change.It is a quite big microservice so i want to find something which requires less changes to make it work. I was researching regarding it, but mostly found that it is not supported. But i have limited time for this migration, about 3 weeks. so i need the most optimal and feasible solution. in

why i cant use bean annotation over public securityFilterChain

15 June 2025 @ 10:31 am

Am learning spring boot security,please some one to explain me so that i can understand.Why while am using bean annotation over public securityFilterChain the public modifier seems like disabled and said "public @Bean method" it prompt me to remove public keyword.What problem i may face in feature if i remove public keyword as prompted. Am using vs code editor I tried to remove public keyword but am not sure problem will cause in the future

Is It Possible to open the PhpStorm Keymap window using a keyboard shortcut?

15 June 2025 @ 10:24 am

I want to open the Keymap window directly in PhpStorm using a keyboard shortcut, without going through Settings > Keymap or without using the quick action menu. I know this is possible because the Promoter X plugin does exactly that: it opens the Keymap as a window when needed, bypassing the normal settings navigation. Is there a built-in way to assign a shortcut for this?

Numpyro producing the exact same value for parameters for every sample

15 June 2025 @ 10:17 am

I have written the following numpyro model which models a gaussian process and then performs binomial regression. The issue i am having is that I get the same values for the parameters for every single sample (almost as if something is wrong with the random key thats been passed). Any idea why this may be ? print(mcmc.get_samples()) {'b0': Array([1.9732423, 1.9732423, 1.9732423, 1.9732423, 1.9732423, 1.9732423, 1.9732423, 1.9732423, 1.9732423, 1.9732423], dtype=float32), 'f': Array([[-1.8119389, -1.4418964, 0.5465225, ..., -1.9745315, 1.8767447, -1.0638568], [-1.8119389, -1.4418964, 0.5465225, ..., -1.9745315, 1.8767447, -1.0638568], [-1.8119389, -1.4418964, 0.5465225, ..., -1.9745315, 1.8767447, -1.0638568], ..., [2.0822305e-03, 9.9998713e-01, 4.5200054e-02, 2.7854379e-14, 5.2529750e-03, 1.0000000e+00, 6.3772571e-10, 9.9999976e-01, 7.6609455e-02, 9.9984181e-01, 7.4886680e-01,

Deploy Express server to Vercel with ESM dependency?

15 June 2025 @ 10:16 am

I have an Express server which uses a ESM dependency react-pdf. I also need the file to be .tsx as I'm using TypeScript JSX for rendering. I have this working locally but I run into issues when trying to deploy to Vercel: import React from "react"; import express, { Request, Response } from "express"; import ReactPDF, { Document, Page, Text, View, StyleSheet, } from "@react-pdf/renderer"; const styles = StyleSheet.create({ page: { flexDirection: "row", backgroundColor: "#E4E4E4", }, section: { margin: 10, padding: 10, flexGrow: 1, }, }); const MyDocument = () => ( <Document> <Page size="A4" style={styles.page}> <View style={styles.section}> <Text>Section #1</Text> </View> <View style={styles.section}

The option "attr" does not exist. Defined options are:

15 June 2025 @ 10:15 am

i have this error log.... The option "attr" does not exist. Defined options are: "accessibility_checker", "clickable_row", "confirm_message", "extra_route_params", "route", "route_param_field", "route_param_name", "use_inline_display". Symfony\Component\OptionsResolver\Exception\ UndefinedOptionsException in vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/OptionsResolver.php (line 645) OptionsResolver->resolve() in src/Core/Grid/Action/Row/AbstractRowAction.php (line 164) AbstractRowAction->resolveOptions() in src/Core/Grid/Action/Row/AbstractRowAction.php (line 113) AbstractRowAction->setOptions() in modules/newsletterwizardpro/src/Grid/Definition/Factory/CampaignGridDefinitionFactory.php (line 128) CampaignGridDefinitionFactory->getColumns() in src/Core/Grid/Definition/Factory/AbstractGridDefinitionFactory.php (line 89) A

Web app with app router: how to make telegram fullscreen on a phone?

15 June 2025 @ 8:59 am

On my bot side, I am sending an InlineKeyboardButton with an app router link with couple of parameters webapp_url = f'{base_url}/?param1={rid}&parama2={uid}' I want to be able to open it full screen in the iOS/Android telegram app. However, whatever I have tried does not seem to work. The only thing that have worked is when I provide a static web app link to the botfather, only this link opens full screen. However, I was not able to make it work with the dynamic link. Is it possible at all? Here's my code on the bot side: webapp_url = f'{base_url}/?param1={rid}&parama2={uid}' button = InlineKeyboardButton( text="ClickMe", web_app=WebAppInfo(url=webapp_url) ) kb = InlineKeyboardMarkup([[button]]) try: await context.bot.send_message( chat_id=user.tg_id, text=f"Test Button", reply_markup=kb ) And this is also something that I have tried on th

How are messages distributed in Kafka when no key is provided? Is order preserved across partitions?

15 June 2025 @ 7:58 am

I want to understand: How will Kafka distribute these messages across the 3 partitions? Will the order of messages be preserved? From my understanding, Kafka might use a round-robin strategy when no key is provided, but I'm not sure how that affects message ordering. Could someone please clarify how partitioning and ordering behave in this scenario?

How to retrieve the visible content of an element including `select` elements?

15 June 2025 @ 5:43 am

I want to retrieve the visible text content of an div element which contains several <select> elements: However, in Chrome, div.innerText will include text content in all <option> tags, including unselected ones (and to my surprise, even hidden ones are included as well); in FireFox, div.innerText simply ignores the content of the <select> element. let div=document.querySelector("div") console.log("div.innerText:\n"+div.innerText) select { appearance: none; border: none }

Why is knitr failing to see a function defined in a child document?

14 June 2025 @ 3:04 pm

I am working with Rmarkdown parent and child files, and using a YAML header to make it so that when I click "Knit" in RStudio on a child document, it compiles the parent (as seen here: https://stackoverflow.com/a/79655552/1129889). Consider the following two files, in the same folder: parent.Rmd --- title: "Test" output: pdf_document --- ```{r include=FALSE} knitr::opts_chunk$set(echo = FALSE) library(ggplot2) ``` ```{r child = "child.Rmd"} ``` child.Rmd --- knit: (\(input,...) rmarkdown::render('parent.Rmd',...)) editor_options: chunk_output_type: console --- ```{r} # Create simple plot data.frame( x = seq(.01,.99,length.out=100), y = seq(.01,.99,length.out=100) ) |> ggplot(aes(x=x,y=y)) + geom_point() -> gg1 ``` ```{r eval=FALSE} source(textConne