instruction
stringlengths
0
30k
The problem is in the way you provide file destination folder in the multer's `destination` method: you're using absolute, instead of a path relative to your project folder, here: cb(null, path.resolve("./public/upload")); which then gets saved like that, and then the frontend tries to load it from the file s...
The d.docx document only a table, across four pages, the last page is a blank page, there is no content. However, if the mouse cursor is located at the top of the blank page, it will become recognized to the state of the form, then right-click the mouse, open source to see the "Delete Cells" option, if you click to de...
I can't delete the last blank page in word with c#
|c#|
null
do you mean you want ListA to always be generated before ListB? are there other constraints on ListB, rather than on its size?
[![Error response from FastAPI i.e. deployed on lambda](https://i.stack.imgur.com/QZ0Jd.png)](https://i.stack.imgur.com/QZ0Jd.png) Is there a way to pass query parameter the the `last-n` endpoint and how do i make it to work in AWS lambda Below is my code for reference: ```python import os import smtplib ...
Query parameter works fine with fastapi application when tested locally but not working when the FastAPI application is deployed on AWS lambda
|python|rest|aws-lambda|fastapi|crud|
null
Using `List.containsAll()` and `Truth.assertThat(list).contains(originalList)` behaves differently. Working as expected ``` assertThat(getItemsByChannelId.containsAll(entitiesChannelAPage2)).isTrue() ``` Not working as expected ``` assertThat(getItemsByChannelId).contains(entitiesChannelAPage2) ``` I am ...
Google Truth.assertThat.contains does not behave similar to List.contains
How can I parse an relative path to an image inside a React Native Image component source?
|react-native|
> How do a build a "Calendar app" in Java? Per your design above, your app will have the following: 1. A UI for adding records (currently command line, but you might want to consider a web UI, Android, Swing or other alternatives) 2. A UI for displaying records 3. A data store for saving records (curre...
The problem is that when you put HTML into innerHTML the system adds closing tags. s You can see this by using your browser devtools inspect facility. Hence you are ending up with more than one table. A simple way of preventing this automatic closure is to make a string of all the HTML and then copy the string ...
HotChocolate gives me "Cannot access a disposed context instance." for my DB Context
|c#|entity-framework|graphql|hotchocolate|
Is there's a way to capture a dynamic div content using html2canvas ? Actually I'm using React-rnd in a div and I can't seem to capture the canvas content using html2canvas. Any help is very much appreciated. Thanks. I've tried some example from html2canvas but all I've got is white screen.
html2canvas capture dynamic div content
|html2canvas|
null
yes, it's a dependency issue. you need the oracle driver dependency in your pom.xml not just Oracle, any datasource you use, you must add its driver dependency in your pom.xml > <dependency> > <groupId>com.oracle.database.jdbc</groupId> > <artifactId>ojdbc11</artifactId> > <scope>runtime<...
i have a problem with my redirection. ``` <?php // Inclure les fichiers d'initialisation require_once("../inc/init.inc.php"); require_once("../inc/haut.inc.php"); ob_start(); // Assurez-vous que l'intervention_id est passé en paramètre dans l'URL if (isset($_GET['id_intervention']...
Use the [deny](https://api.flutter.dev/flutter/services/FilteringTextInputFormatter/FilteringTextInputFormatter.deny.html) method, and the following Regex - `[|]`. FilteringTextInputFormatter.deny(RegExp(r'[|]'))
I have a production. In the queues in front of the respective machine, I would like to prioritize the orders that have the shortest processing time. The information is read from a table. What is the best way to implement this? So far I have tried to prioritize the agent with the smallest number. But it did not work....
Queue Anylogic Prio-based
|queue|anylogic|
null
I am trying to fix an issue on one of my Varnish Cache + Nginx setup on a Wordpress website. I am running the following server stack Nginx( HTTPS - 443 ) -> Varnish ( HTTP - 80 ) -> Nginx (HTTP - 8080 ) I am using a vhost method for Varnish cache so that I can host multiple site on he same varnish server. Curren...
Varnish Cache Strange Issue showing same images /css/txt files on index page or other pages
|wordpress|nginx|varnish|varnish-vcl|varnish-4|
{"Voters":[{"Id":53341,"DisplayName":"MatBailie","BindingReason":{"GoldTagBadge":"sql"}}]}
How do I access "properties" of my `.resw` resource file in code? --- For example, take this example RESW file (from MSDN): [![screenshot of resw editor, with properties like 'Greeting.Text' and 'Farewell'][1]][1] I can access `Farewell` easily: ```cpp auto resourceLoader{ Windows::ApplicationModel::Res...
|android|unit-testing|assertion|instrumented-test|google-truth|
I have a SQL like this ```sql select * from sys_region as sr left join (select count(*) as c,parent_code from sys_region * group by parent_code ) as c on c.parent_code = sr.parent_code ``` Also, there is entity ```java @Getter @Setter @CTE public class SysRegion extends BaseIdEntity { @Column...
null
I am observing a strange behaviour where GCC (but not clang) will skip a pointer-reset-after-free expression in the global destruction phase and with certain values of `-O?`. I can reproduce this with every version I tried (7.2.0, 9.4.0, 12.3.0 and 13.2.0) and I'm trying to understand if this is a bug or not. The ph...
I am learning Spring boot JPA hibernate mapping. I am trying to create 2 tables Employee and Address. It is a unidirectional OneToOne mapping. I am creating foreign key in Employee table. Employee contains address and it is a strong association. Without Employee, Address doesn't exist. My createEmployee controller i...
I want to run the code from this git-repo on a high performance cluster running Red Hat Enterprise Linux 8.6 (Ootpa). To prepare, I connected via ssl, set up a python 3.6 venv 'hgclr_venv', cloned the repo and installed all necessary packages as stated in requirement.txt with more or less ease. Only the last package, t...
command 'gcc' failed with exit status 1 when trying to install torch-sparse 0.6.12
|python-3.x|pytorch|
null
I have a method that fetchs customers ID from database and saves it to local storage when user select a customer. But after selection in example if I change something in my code and refresh my page, it doesnt fetch. How can I solve this? These my code snippets; export class AdminDashboardComponent implements ...
|javascript|angular|angularjs|
null
|javascript|angular|
Why does the first Plot require the '/.' replacement operator, but the second Plot does not? Both use InterpolatingFunctions. In the first block of code, 'sol' is an InterpolatingFunction. In the second block of code, iFun is an InterpolatingFunction. I'm still new to Mathematica. ``` ode1 = {y''[x] + Sin...
I Do Not Know Why One of These Two Plots Requires the /. Replacement Operator
|wolfram-mathematica|wolframalpha|wolfram-language|
null
I'm Using Laravel 10 I'm trying to get Random Record Without Duplication using inRandomOrder But It Giving Duplicate Record Some Time. help me to Solve It My Controller Code $Question = Question::inRandomOrder()->limit(50)->get();
Laravel using inRandomOrder how to prevent duplicate record
|php|laravel|laravel-10|
The d.docx document only a table, across four pages, the last page is a blank page, there is no content. However, if the mouse cursor is located at the top of the blank page, it will become recognized to the state of the form, then right-click the mouse, open source to see the "Delete Cells" option, if you click to de...
{"OriginalQuestionIds":[10514576],"Voters":[{"Id":16217248,"DisplayName":"CPlus"},{"Id":1974224,"DisplayName":"Cristik"},{"Id":578411,"DisplayName":"rene","BindingReason":{"GoldTagBadge":"c#"}}]}
i want to write a code for a telegram bot, where i can connect and see a "dashboard" and "kpi" sheet on a google sheet, however i keep getting this error; "PS C:\Users\ASUS> & C:/Users/ASUS/AppData/Local/Microsoft/WindowsApps/python3.12.exe c:/Users/ASUS/Downloads/philbot.py Traceback (most recent call last)...
Why when I changed something and reload page my service dont fetch in my angular project?
|node.js|angular|
Solution found by @Simon Couch ; however answering my own question as it could help others, awaiting for Simon to do his own: Installing the dev version of odbc indeed fixed the problem: it is required to restart R after installing the packages.
As I'm very new for using .NET MAUI, so I'm a bit confused about passing data from a page to another page.I'm trying to pass the data from the Signup Page to the Setting Page but I can't. This is the code for Signup Page: ``` <Entry x:Name="fullNameEntry" Text="{Binding FullName}" ...
How to pass the registered data from Signup Page to Setting Page, .NET MAUI
|c#|maui|
null
I am trying to define a common query for all repositories extending my base repository: ```java @NoRepositoryBean public interface DocumentRepository<T extends BaseDocument> extends JpaRepository<T, Long> { @Query(value = "FROM BaseDocument bd WHERE (bd.createdAt IS NULL OR :to IS NULL OR bd.createdAt < :to) ...
null
|java|spring-data-jpa|spring-data|
Is there a way to type a nextjs endpoint, so when sending a request I directly know the returned type? **Example Endpoint** ```` const getHandler = async ( req: NextApiRequest, res: NextApiResponse, prisma: PrismaClient ) => { // query data and type it somehow? } ```` **Example Query** `...
How to type nextjs endpoint with TypeScript?
|typescript|next.js|axios|prisma|react-query|
For `Adapter<RecyclerView.ViewHolder> adapter`, using `adapter.notifyDataSetChanged()` may lead to undesired outcome. For instance https://stackoverflow.com/questions/33851370/applying-statelistanimator-in-recylerviews-item-will-cause-flickering-effect-wh I was wondering, can we use `adapter.notifyItemRangeChange...
null
Let's start by not bothering with rows vs. columns, because (and this is the nice thing about the game of life), it doesn't matter. The only thing that matters is what the eight values _around_ a cell are doing, so as long as we stick to one ordering, the code will simply do the right thing. Which means we can get r...
Since .Net 4.5, the preferred way to implement data validation is to implement [`INotifyDataErrorInfo`][1] (example from [Technet][2], example from [MSDN (Silverlight)][3]). Note: `INotifyDataErrorInfo` replaces the obsolete `IDataErrorInfo`. The new framework infrastructure related to the `INotifyDataErrorInfo` ...
{"Voters":[{"Id":1453822,"DisplayName":"DeepSpace"},{"Id":16343464,"DisplayName":"mozway"},{"Id":12046409,"DisplayName":"JohanC"}],"SiteSpecificCloseReasonIds":[11]}
I often create HTML dashboards for SharePoint and intranets with JSON data arrays that exceed 100k rows. If you load your data into JavaScript function you can very efficiently aggregate (sum, count, max, min, avg etc) 100k rows in < 2 secs then pass this array to vega-lite. Here is a sample aggregate function: ...
> What's the correct approach? Neither is more correct than the other. XML Document 1 --- The XML you posted with explicit namespace prefixes used for the `"urn:asw:erT"` namespace<sup>1</sup>... <ns0:Root xmlns:ns0="urn:asw:erT" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"...
The most straightforward option is to set the `MachineId` on the `MachineDashboardViewModel`s when you create them and put them in the `Machines` property. Taking a detour from the parent view model to the data template to the user control to to the child view model makes absolutely no sense when the child viewmodel...
If you still want to take advantage of pnpm and avoid the node-linker=hoisted option, you can take a look at this [great article][1] that explains how to make it works. To summarize it, you need to 1- add a bunch of packages to make the react-native cli works with pnpm: pnpm install @react-native-comm...
For the given code, you should have the following time complexity: ``` T(n) = 1 + N/2 (1 + 2) + 1 + 1 + 1 + 100 (1 + 2) ≈ N/2 ``` This means that your overall complexity is `O(n)`. Because the second `for` loop (the first nested `for` loop) never executes, due to its condition, you don't have `O(n^3)` complexity. I...
I am making a form using next js 14, I made an actions.ts file there I built a generic method that shows a console log. [form component][1] [action.ts][2] In the form component, loginForm.tsx, in the form tag, I use the action property, and from there, I call the generic method that I made in action.ts [de...
So my project got successfully deployed to the vercel. The issue was a mistake that i made where i didn't properly linked the path to my views folder in index.js , however if someOne is having any issues with that make sure to look into the logs on vercel , it will show you what the issue is . also Mine worked fine wi...
I need to have one "General login database", with few columns (ID, Pass, User, IP). Users came to site, enter their data (they can change password\username, and their ip can be changed), all this changes goes to "General Login DB". And I have 2 another servers, with same database "Login Database 1" "Log.DB 2" and ...
I have a shared object where **file** indicates it is a shared object, and it is used and behaves as a shared object. % file libirc.so libirc.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=9d54bda46b31ae048aae323dfd809f9ae6c8c55c, not stripped % But the...
Here's a runnable example: With SrcTable as (SELECT 'product_id' as key, 'iphone_14' as value from dummy union all SELECT 'product_id' as key, 'iphone_14_pro' as value from dummy union all SELECT 'country_code' as key, 'USA' as value from dummy union all SELECT 'country_code' as key, 'CA' as value...
I have a LET & FILTER function used to use a drop down (green cell) and then it populates a report underneath based on data in sheet("Master") You can see it's bringing in all the ("Master") sheet columns B:M in order and I don't need columns C:K ![enter image description here][1] How can I change `fRng,Ma...
## Do not install Mamba in Anaconda/Miniconda It is no longer recommended to install `mamba` in an Anaconda or Miniconda **base**. However, Conda now uses the `libmamba` solver, so just upgrade your **base** `conda` to v23.11.0 or greater and it will run as fast as `mamba`. ```bash ## v23.11+ uses libmamba solver ...
|oop|design-patterns|circular-dependency|
null
Delete the `package-lock.json` file and the `node_modules` directory in your project and then run `npm install` on your terminal. If you still have issues, you may refer the following link. Nextjs Docs: https://nextjs.org/docs/messages/failed-loading-swc
null
I have written my Golang HTML DOM parser with pure Golang and no dependency used in it. This project is still under development. But now it is usable, and I will develop it in the future. Project link: https://github.com/pejman-hkh/gdp/ ```go package main import ( "fmt" "github.com/pejman-hkh/gdp/gdp" ...
I'm currently working implementing AES encryption in the backend using Python, but I'm encountering some issues in ensuring compatibility between frontend and backedn. I need help in integrating the frontend JavaScript code to work with it. My backend Python code: class Crypt(): def pad(self, data)...
|javascript|python|encryption|aes|cryptojs|
I can't change volume of playing music with slider. I tried to change volume with audio_output, but it doesn't work. ``` import sys from PyQt6.QtCore import Qt, QUrl from PyQt6.QtMultimedia import QMediaPlayer, QAudioOutput from PyQt6.QtWidgets import QApplication, QWidget, QPushButton, QSlider, QVBoxLayou...
|javascript|ruby-on-rails|tooltip|amcharts|
Whether a type is considered statically or dynamically sized type depends on whether we know its size at _compile_ time. For example, we know that an `i32` is 4 bytes in size, and we know this at compile time, so this is a statically sized type. We _do_ know the size of a slice when we produce it, but that happens ...
I am new to Kivymd. I have managed to create a testing mobile app with the help of online resources. However, when attempting to convert the main.py file to an APK file using Google Colab notebook, I encountered an error and was unable to generate the mobile app APK file. What is the correct process for converting t...
I have 3 tables: users, roles and user_role (link table) I need to get all the user’s roles in a readable form, that is, using the connection table, pull out everything I need from the roles table for a specific user For this I use: ``` public function roles() { return $this->belongsToMany(RolesMod...
belongsToMany and mongodb Laravel