instruction
stringlengths
0
30k
I have an html that has content over multiple pages that has to be printed. I have attached a sample below. ``` <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Dynamically Generated HTML with Header for PDF</title> <s...
|javascript|visual-studio-code|microsoft-edge|
null
What steps should I follow to correctly set up two foreign keys in Laravel 11, as I've been having difficulties with this task? ```php $table->id(); $table->foreignId('news_id') ->constrained(table: 'news') ->cascadeOnDelete() ->cascadeOnUpdate(); $table->foreignId('category_id') -...
Laravel 11 foreign key not showing up in SQL
Ok, so if you have a h1 element with a margin or padding of greater than 0, you want the wrapping element to have the style: overflow:hidden. Sometimes, applying it to the body won't work, as the element containing the h1 or p element may be a div. The wrapping element could be main, div or something else. So don...
I'm literally going crazy. I can't figure out where is the error in the code below whose purpose is to retrieve an image from a database and display it in a frame with id 'img1'. I've tried every way but what I get is just a string that isn't transformed into an image. Some advice? ``` <?php //file foto.php ...
Blob image displaying from database
|javascript|php|mysql|ajax|
The function you are fitting has two properties that the data does not have: * It necessarily has its maximum at the beginning (t=0) since you use the cos function without a phase shift. You should definitely add a phase shift (additive constant within the argument) * Also, it necessarily oscillates around 0 because ...
I am so silly! I just set the x,y and z in `setAngularFactor()` to 0 and it works as intended!
I'm trying to send an object to my api but i always get null values. Here is my angular method: createNormalPost(post: CreateNormalPostInterface) { const formData = 'ceasdasdas' return this.httpClient.post<any>(this.API, formData, {headers: {'Content-Type': 'multipart/form-data'}} ...
Finally, I've found a solution to this problem without utilizing the redirect and refreshListenable properties of GoRouter. The concept involves creating a custom redirection component. Essentially, authStateChanges are globbally listened, and upon any change in AuthenticationState, we navigate to our redirection co...
How can I lock a rigidbody's rotation on all axis? Bullet Physics [SOLVED]
I am getting this error and also "Not starting debugger since process cannot load the jdwp agent " error when i'm connecting my device using cable and i also enable usb debugging. Android studio is showing my account but still i cannot use my device anyone please help me. I have tried by checking and updating my sdk...
Failed to getEnergyData
|android|kotlin|android-studio|
null
I followed the basic *getting started* instructions for Node.js on Heroku here: https://devcenter.heroku.com/categories/nodejs These instructions don't tell you to create a .gitignore node_modules, and therefore imply that folder *node_modules* should be checked into Git. When I included *node_modules* in the Gi...
I'm very new to JS. I'm trying to return a matched value from user input from a global array (aStoreItems) for a theoretical online book store. The array consists of objects passed through a constructor. ``` // Function to find object by ID value function getBookById(id) { console.log("Variable ...
Function is returning undefined but should be returning a matched object from array in JavaScript
|javascript|arrays|function|
null
If I understand you want to exit the loop when any of the child notebook execution fails. Currently your exit loop condition is based on the status of "New" and for multiple child notebook this would not be sufficient. Along with the current exit condition add another OR condition to check if any failure in the exec...
I am trying to convert some R code I've written into an R shiny app so others can use it more readily. The code utilizes a package called `IPDfromKM`. The main function of issue is `getpoints()`, which in R will generate a plot and the user will need to click the max X and max Y coordinates, followed by clicking thr...
If the code to handle when the end of one run is reached before the other is included in the if | else compare logic, then only one loop will be run for each instance of `Merge`. A one time allocation of the second array and one time copy at entry to merge sort and then alternating the direction of merge with each leve...
null
The redis-stack-server does include RediSearch: https://hub.docker.com/r/redis/redis-stack-server However, the image does NOT include the latest RSCoordinator (included in RediSearch), which synchronizes indices among Redis cluster nodes. Is there any images, which upgraded the image with this functionality? Or - an...
I think the best way is to malloc a in main function and pass it to the fn function. #include <stdio.h> #include <string.h> #include <stdlib.h> void fn(char *n) { /* * imagine this variable 'b' is * a part of a structure of * some library */ ...
I tried the following approach which can solve the first problem in the problem detail to some extent, but does not completely resolve it. ```python import torch a1 = torch.randn(15000, 30000).cuda(0) a2 = torch.randn(15000, 30000).cuda(1) b1 = torch.randn(30000, 30000).cuda(0) b2 = b1.cuda(1) # create a e...
1. You're overwriting the value on each match, you should rather store them into a [List][1] and then get the random item from the list, something like: import java.util.Random; import java.util.regex.Pattern; import java.util.regex.Matcher; import org.apache.commons.lang.math.RandomUtils; Str...
null
I'm deleting your post because this seems like a programming-specific question, rather than a conversation starter. With more detail added, this may be better as a Question rather than a Discussions post. Please see [this page](https://stackoverflow.com/help/how-to-ask) for help on asking a question on Stack Overflow...
null
In a basic Remix V2 app, i need help understanding if the following is expected behavior, a bug in V2, or possibly a missing configuration option or setting. I could not find anything related to this issue in the Remix documentation. I created an demo Remix V2 app by running `npx create-remix@latest` I wrote a...
DJI Tello won't follow me
|python-3.x|pycharm|tello-drone|
null
**1st solution** - automatic. The PyCharm plugin "**PyCharm Hel**p" allows you to automatically download web help for offline use: when help is invoked, pages are delivered via a built-in Web server. This solution has drawbacks - for me, it downloaded help only for one version of Python, but not for others. Also, i...
1. Open an Excel workbook. 2. Turn on "Record Macro" (Developer ribbon). 3. Perform manually everything what you need to do. 4. Stop macro recording. 5. Open VBA editor and evaluate the recorded macro. You can correct something, improve. 6. Run the corrected macro to verify it. 7. Copy the code to y...
I am using an ASP.NET Core Web API with Entity Framework Core (pomelo). I have a MariaDB database. I use Swagger UI to explore my API, as per the template. When I try to use it to delete a row, I get the following error: > Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity cha...
**1st solution** - automatic. The PyCharm plugin **"PyCharm Help"** allows you to automatically download web help for offline use: when help is invoked, pages are delivered via a built-in Web server. This solution has drawbacks - for me, it downloaded help only for one version of Python, but not for others. Also, i...
Python ChatGPT bot issue with openai.Completion
|python|openai-api|
null
{"Voters":[{"Id":3744304,"DisplayName":"connexo"},{"Id":3889449,"DisplayName":"Marco Bonelli"},{"Id":26742,"DisplayName":"Sani Huttunen"}],"SiteSpecificCloseReasonIds":[11]}
For django 4+ with drf, it is by-the-book solution but I will put it in here, because it took me like 2 hours to find out. class DSLPaginator(Paginator): """ Override Django's built-in Paginator class to take in a count/total number of items; Elasticsearch provides the total as a part ...
I would like to create a function that takes three arguments (n,m,d) and it should output a matrix with n rows and m columns. The matrix should be populated with values 0 and 1 at random, in order to ensure that you have a density d of ones. This is what I have come up with so far, just can't seem to work out...
Function to create matrix of zeros and ones, with a certain density of ones
|python|python-3.x|matrix|
null
|python|environment-variables|fastapi|pydantic|uvicorn|
null
<!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> const { MyHero, Hero } = require("../models/index.js"); class MyHeroesController { static async addHeroToMyHeroes(req, res, next) { try { const { heroId } = req.params...
**Context: ** Our app recently switched to using Custom Chrome Tabs for authentication. WebViews wouldn't allow login from Google and Facebook due to privacy restrictions. Everything worked well using `onResume` and `onNewIntent` lifecycle methods to detect when the user closes the Custom Chrome Tab and is redir...
I am trying to make a voice changing device with **esp32** board (**PlatformIO + ArduinoIDE**). I have: 1. external microphone on input 2. esp32, to process voice (internal ADC is used for incoming signal - **I2S protocol**) 3. external DAC (PCM5102) to output changed voice (**I2S protocol**) My scheme is w...
I am totally new to bioinformatics, therefore apologies if the terminology is not correct or the question is dumb :) I have been trying the following: - installed miniconda - create an environment called "rnaseq" where I installed kallisto ``` conda install -c bioconda kallisto (0.50.1) ``` - created another en...
problem with running Kallisto on single cell data
|python|miniconda|
null
I'm new to Polars and need some advice from the experts. I have some working code but I've got to believe theres a faster and/or more elegant way to do this. I've got a large dataframe with columns cik(int), form(string) and period(date) of relevance here. Form can have value either '10-Q' or '10-K'. Each cik will have...
Filtering inside groups in polars
|python|python-polars|
As noted in the comments, there were 2 issues. Cuda 9 changed the guarantees about threads in a warp remaining in lockstep, previously answered here: https://stackoverflow.com/questions/67907772/cuda-min-warp-reduction-produces-race-condition The second issue after fixing this was due to imprecision in floating poin...
As a user, how would I know how many arguments and what arguments I need to pass in a command line arguments program, since there is no input function applied to the script with some sort of indication stating, enter your name or age or etc...or how a user know that age comes first or name come first or address ? ...
Here is a possible version of the correct code: import random print('Welcome to the Higher or Lower game!') while True: lowr = int(input('\nWhat would you like for your lower bound to be?: ')) upr = int(input('And your highest?: ')) x = (random.randint(lowr, upr)) if...
error in my code, i can't create a hull by turf because it isn't format input [enter image description here](https://i.stack.imgur.com/4eAWN.png) ``` var pointData = [ [-74.5, 40], [-74.6, 40.1], [-74.4, 39.9], [-74.55, 39.95], [-74.65, 40.05], [-74.35, 40.15] ]; var pointGeoJS...
How can i show the layer like polygon cover all marker in mapbox. Please help me. Thanks
|javascript|mapbox|polygon|
null
send email with react, node using mailgun I try to send a email message by using mailgun. I use node.js (nest.js) and this is my js file. What should I change? I got this Error Unauthorized, forbidden ``` const FormData = require("form-data"); const Mailgun = require("mailgun.js"); const mailgun = new...
Mailgun 401 forbidden
|javascript|reactjs|node.js|unauthorized|
null
When you create a new project with angular 17, you won’t have any modules in your project, we have the [standalone configuration as the default](https://blog.angular.io/introducing-angular-v17-4d7033312e4b) So Angular 17 generate an angular application which is standalone API, there is no module.
null
Finally, I've found a solution to this problem without utilizing the redirect and refreshListenable properties of GoRouter. The concept involves creating a custom redirection component. Essentially, authStateChanges are globbally listened, and upon any change in AuthenticationState, we navigate to our redirection co...
Far from perfect. This one: * wraps each word in a ``<span>`` * calculates by ``offsetHeight`` if a SPAN spans multiple lines * of so it found a hyphened word * it then **removes** each _last_ character from the ``<span>`` to find when the word wrapped to a new line <!-- begin snippet: js hide: false consol...
I'd like to display a rationale, where user can be navigated to the settings on accept, or asked for a city name when declined. I've tried to make there two functions. One, 'displayRationale', and second 'getCityNameFromUser'. When entered to the second function it should display TextField and button. When user will...
Remix V2 useLoaderData issue while running in dev mode
|javascript|reactjs|json|typescript|remix|
Since 2017-03-13 `std::is_callable` is gone from [cppreference.com][1]. The last available description of it is from 2016-11-21 on [WaybackMachine][2]. The main difference between `std::is_callable` and `std::is_invocable`, that replaced it, is that * the former used a single template parameter `template <class FnA...
You may want to call `brew services start mysql` command first to allow the connection.
I'm deleting your post because this seems like a programming-specific question, rather than a conversation starter. With more detail added, this may be better as a Question rather than a Discussions post. Please see [this page](https://stackoverflow.com/help/how-to-ask) for help on asking a question on Stack Overflow...
null
I want to reset my product filter. Filter work by same code ``` filteredData: function () { var vm = this var sf = vm.startFloor; var ef = vm.endFloor; var sa = vm.startSquare; var ea = vm.endSquare; var sp = vm.startPrice; var ep = vm.endPrice; return _.fil...
Some noise when attempting to produce sound wia external DAC for esp323
|esp32|arduino-ide|arduino-esp8266|arduino-esp32|platformio|
**Context: ** Our app recently switched to using Custom Chrome Tabs for authentication. WebViews wouldn't allow login from Google and Facebook due to privacy restrictions. Everything worked well using `onResume` and `onNewIntent` lifecycle methods to detect when the user closes the Custom Chrome Tab and is redir...
How do I get a caller's HTML "Label" surrounding my Custom Element to bubble its "click" events to my shadow root? Is there not something in the shadowRoot that I can listen for Click events for my LightDOM label? I believe this [clicking labels][1] answer comes close but I am inheriting from HTMLElement. In the ...
Currently, there is no option to turn on/off data-labels series wise. It is enabled for all series. I am opening an [issue on GitHub][1] to implement it in the next release. **EDIT**: A new option `enabledOnSeries` is shipped in v3.5.0. You can use it like options = { dataLabels: { enabled: t...
I have a Bulk Data with ID and Name Columns. Now I want to have the report in below format: ID Name ID Name ID Name ID Name 1 x 6 y 11 z 16 f . . . . 5 f 10 l 15 n 20 a I want to populate the table in left to right direction if Page1 filled thus then I want to go to Page2 and follo...
How to make page columns in RDLC Report?
|asp.net|ssrs-2008|rdlc|
null
The libraries related to the helper functions must exist in the same file, since libraries.py will import the libraries to a name space that helper functions file doesn't access it
Android devices <API 25 not connecting to LetsEncrypt SSL servers anymore?