StackOverflow.com

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

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

How can I make pdfcrowd script to save on Windows Downloads Folder instead of the site folder

5 November 2025 @ 10:11 am

I am trying to creating a page with pdfcrowd, it works well. But the issue i am having is that it saves the created PDF file inside the site folder. Meanwhile, i want it to be saving on the Windows Downloads Folder. I have tried to find where to change the download folder on the code but could not. Please can someone help to make this code to start saving the created pdf into the Windows Download Folder instead of the site folder. <?php require "pdfcrowd.php"; try { // Create an API client instance. $client = new \Pdfcrowd\HtmlToPdfClient("demo", "demo"); // Specify the mapping of HTML content width to the PDF page width. // To fine-tune the layout, you can specify an exact viewport width, such as '960px'. $client->setContentViewportWidth(&

Google Play integrity stuck at "Integrity started"

5 November 2025 @ 10:09 am

I am using firebase app check in my flutter app, and I have done all required settings and statisfied requirements. This worked for another app, where it got active quick, but for this app I have been waiting for 9 days and it is still stuck at integrity started. I need help with this, I have sent 6 tickets to google support and there has been no response from them for 9 days. enter image description here

Android driver app position sending to server

5 November 2025 @ 10:07 am

I developed a simple Android app (A driver app for taxi booking). App sends its location (lat/lng) every 5 seconds to server using TCP/IP. and server stores the driver location in SQL SEVER database. if there any message for driver, server returns it. Server is PHP. This way, when number of drivers reaches about 300, server can not responses some time. Is there a problem in the mechanism I designed and is it not suitable for this task? What is the best and Optimal way for driver app to send its position to server and store it? do I have to use UDP Instead of TCP?

Creating a stack in portainer with docker compose in R

5 November 2025 @ 10:04 am

I would need how to create the yaml to deploy the stack making sure it has alll these libraries and that it uses these ports Libraries: 1.1- openxlsx 1.2- xml2 1.3- rdflib 1.4- jsonld 1.5- jsonlite 1.6- tools 1.7- logger 2- shiny-server 2.1- shiny 2.2- bs4Dash 2.3- shinyWidgets 2.4- fresh 2.5- highlighter 2.6- dplyr 2.7- echarts4r 2.8- shinyalert 2.9- shinybusy Ports: for rstudio "8787:8787" and for the siny server "3838:3838" This is what i've been doing but i don't know if it is correct ersion: '3.8' services: rstudio: image: rocker/rstudio:latest container_name: rstudio_ejecucion_r restart: unless-stopped environment: - PASSWORD= ports: - "8787:8787" volumes: - ./proyecto:/home/rstudio/proyecto command: > bash -c " R -e 'install.packages(

How to force the initialisation of static fields of internal records/classes even they are not been referenced?

5 November 2025 @ 10:04 am

I'll begin with explaining of my case to avoid the potential X/Y problem. The Task is recursive entity which has parent and children properties: public class TaskCustomFolder { public required string ID { get; init; } public required string label { get; set; } public TaskCustomFolder? parent { get; set; } public List<TaskCustomFolder> children { get; set; } = []; public required uint orderAmongSiblings { get; set; } } SampleTasksCustomFoldersRepository is the class which contains some samples of TaskCustomFolder: public abstract class SampleTasksCustomFoldersRepository { public abstract class OrderCounter { private static readonly Dictionary<uint, uint> countersByLevels = []; public stat

A wrapper route to simulate a FastAPI request

5 November 2025 @ 10:04 am

My goal is to have a special route which receives name and payload for any other route and then (after doing some unpacking and decoding) call the target route which I prefer to go through http middleware that does validation as if it was requested from client. So far I managed to implemented a wrapper route which can be called in turn to calls any other route. The only obstacle here is that when target route is called by await app(scope, receive, send) it does not go through middleware. How can I circumvent this? >>> fastapi.__version__ '0.116.1' The function responsible for calling target route: async def internal_dispatch(request, method, target_route, params): if method == "GET": query_bytes = urlencode(params).encode() body_bytes = b"" else: query_bytes = b"" body_bytes = json.dumps(params).encode() preserved_headers = [] safe_to_f

Office Scripts manual filter on pivot tables failing in browser excel version

5 November 2025 @ 10:04 am

I've used the below Office Script code successfully in the past to apply a manual filter against a filter hierarchy in a pivot table using office scripts. The below works in the app version, but it is failing in the browser version of excel stating 'internal error' on the manual filter line. My current workaround is to use the labelfilter option against rowhierarchies however I would like to know how to get manual filter to work on the browser please. // Add filter to pivot table newPivotTable.addFilterHierarchy(newPivotTable.getHierarchy("Resolution action")) const ResolutionField = newPivotTable.getHierarchy("Resolution action").getFields()[0]; // Get all available items in the field const allItems = ResolutionField.getIte

How to implement A.rowwise() + B.row(i) without the loop, to trigger Eigen optimizations

5 November 2025 @ 10:02 am

Given that Eigen allows parallelising the computations via either MKL, OpenMP, or AVX, it is often considered a best practice to avoid iterations when possible, as these cannot be fully optimized at the library level. I was wondering if it would be possible to further use .rowwise() in some way rather than iterating over the rows in the following snippet of code computing the decision function for a trained SVM with the RBF Kernel

Gravitee OSS Gateway returns 404 when accessing proxied Swagger UI

5 November 2025 @ 10:02 am

I’ve deployed Gravitee OSS as an API Gateway on a VM, with a local DNS entry so it’s available at: http://apim.local:8082 I also have an API running externally at: https://my-app.k8s.acme.fr/spring/api/* and its Swagger documentation is available directly at: https://my-app.k8s.acme.fr/spring/swagger-ui/index.html On Gravitee, I created and started a new API called MYAPI with the following configuration: Context path: /myapi Backend (target): https://my-app.k8s.acme.fr ✅ Expected behavior: When I open http://apim.local:8082/myapi/spring/swagger-ui/index.html I should see the Swagger UI from the backend service. ❌ Actual behavior: I get a 404 Not Found error in the browser.

How can I keep all-zero columns in `tbl_hierarchical` nested in `tbl_strata()`?

5 November 2025 @ 9:58 am

For reporting purposes, I need to display some observations that are supposed to be in dataset but not there actually, solely within hierarchical table, this is working: library(cards) library(gtsummary) adsl <- cards::ADSL adsl$SEX <- factor(adsl$SEX, levels = c(unique(na.omit(adsl$SEX)), "other")) levels(adsl$SEX) tbl_hierarchical( data = adsl, denominator = adsl, id = USUBJID, by = SEX, variables = c(SITEGR1, SITEID), overall_row = TRUE ) Then it gives you this: enter image description here Furthermore, I want them to be nested in a strata: tbl_strata( data = adsl, strata = SEX, .tbl_fun = ~ .x |> tbl_hierarchical( denominator = adsl, id = USUBJID, by = TRT01A, variables = c(SITEGR1, SITEID), overall_row = TRUE ) )