instruction stringlengths 0 30k ⌀ |
|---|
Overlay text on image not renedered correctly when using custom hindi font with GD library functions |
|php|codeigniter|gd| |
null |
I will add another answer as none of present ones feel complete/general for me.
To solve the original question, getting a list of Lora compatible modules programmatically, I have tried using
target_modules = 'all-linear',
which seems available in latest PEFT versions.
However, that would raise an error... |
null |
## Preamble
I've been coding for a while now and have always loved doing it. I always code at every opertunity I get no matter how complex/out of my depth the problem is
The unfortunate thing I always keep finding is both my code and algorithms are inefficient, I always look at other peoples programs on how they'... |
How to learn to make algorithms and code more efficient? |
|c++|algorithm|performance|optimization| |
I am using an api which works but I am having trouble with the location header.
The api document states - If a 201 response is returned it means successful and the location of the newly created data in the http response 'location' header.
So I get the 201 response but no data. I assume the data is in the location h... |
I have been given the task of reading a file, processing the data and returning the results. As it is an async process, I run into the problem where you cannot return from a .then, and an unresolved Promise is unresolved. I am using fetch. I know this issue has been discussed a lot, apologies. Here is code. Thank yo... |
Fetch file, read contents and return contents all in one function |
|javascript|promise|fetch| |
Add this to application tag in main folder AndroidManifest or fork the package you used and add it to package and push it back again to pub.dev :)
```
<application>
<receiver android:name="com.farsitel.bazaar.auth.receiver.AuthReceiver"
android:exported="true">
</receiver>
</application>
``` |
How about trying this one?
```xml
<p class="post-date">
<time datetime="2023-01-01" th:text="${#dates.format(item.getCreatedDate(), 'dd-MM-yyyy HH:mm')}">Oct 5, 2023</time>
</p>
```
Explaination:
I saw that the error said the method format of `org.thymeleaf.expression.Temporals` does not have the prototy... |
**I was facing the same error while using the Nextjs.**
[![enter image description here][1]][1]
This is how I handled this error:
You need to update your nodejs version, You should use Node v20 and 64-bit.
**Step 1:** Uninstall the existing nodejs
**Step 2:** Install the Latest Microsoft Visual C++ Redistr... |
Visual Studio scaffolded Create form does not work in .NET Core 8 MVC |
|asp.net-mvc|foreign-keys|visual-studio-2022|modelstate|asp.net-mvc-scaffolding| |
null |
clang is part of llvm. There is no package for clang alone. Instead, install llvm14.
But you should first deinstall llvm11 if you no longer need it.
pkg delete llvm11 |
I would like to write an Update query. I need to update target_table field in tblnames1 based on tblenames2.
**tblNames1**:
|filename | Description | target table
|----|-----|-----------------------------------------------------------
| /app/data/shared/mbs/test.yaml | select... |
Compare fields in two tables |
|sql|postgresql|postgresql-9.1|postgresql-9.4|postgresql-9.5| |
I use MSMQ queues for a web application made with IIS. Usually I set Everyone permission (write and read) on every queue.
Sometimes, at and moment, Everyone permission is lost.. Why? Nobody removes it manually.
Only some queues lose permission. Can be a problem of the user owner of the queue? Some Windows policy... |
Private queues MSMQ lose Everyone permission |
|permissions|queue|msmq| |
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. ... |
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 |
You cannot.
Closures have anonymous opaque types and only implement the `Fn*` traits (and auto traits) they can. Rust does not have reflection and it's reflection-like mechanisms aren't possible on non-local types. |
I have encountered an issue when rendering a visualization of a 2d matrix using Pygame (I am aware this not the best library for the job ... but anyway). The issue arises when I attempt to render each node in the matrix as a rectangle. Each node is an instance of the Node class and has x1, y1, x2, and y2 values derived... |
For install **cudatoolkit and cudnn** by Anaconda you can use these following command `conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0`
You must aware the **tensorflow version** must be less than **2.11**
For check if the everything installed properly
1) In command prompt check `nvidia-smi` command... |
{"Voters":[{"Id":209103,"DisplayName":"Frank van Puffelen"},{"Id":807126,"DisplayName":"Doug Stevenson"},{"Id":2851937,"DisplayName":"Jay"}],"SiteSpecificCloseReasonIds":[13]} |
I am new to React-Native, i am trying to use Navigation for 2 screens, when i add my LoginScreen & RegisterScreen inside Stack.Navigator, my screens are not visible, it shows blank screen, if i add LoginScreen outside Stack.navigator section, the LoginScreen looks fine but obviously i am not able to navigate to registe... |
Screen inside Stack.Navigator not visible in React-Native |
Rendering a visualisation of matrix using pygame |
|python|matrix|pygame|rendering| |
null |
I am developing a project where we have a java backend spring server connecting with a front end page through endpoints. At the moment in one of our endpoints we are sending an image url to be represented in the frontend. Currently we can see some performance issues on the frontend when loading the images as the sizes ... |
Should I compress images in java backend before sending to frontend? |
|java|image|frontend|compression|backend| |
I'm starting to program in C# and decided to install Visual Studio Code as my text editor and installed the extension called C# Dev Kit. When running the code (without debugging) with the following button:
https://learn-attachment.microsoft.com/api/attachments/c8dad1ae-b55b-4c70-a3bb-f35e4c869c67?platform=QnA
I n... |
Does Visual Studio Code always debug C# code? |
|visual-studio-code| |
null |
I installed these, and the service started:
`sudo yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin` |
null |
I'm trying to secure a page using a jwt token in a session in NextJS, I was looking at similar questions on the forum and I saw that they recommended using useeffect to get access but I still can't recover anything.
The code I started with
`"use client";
import {
useEffect,
useState
} from "react";
... |
|react-native|react-navigation-v5| |
null |
Without `docker-compose.yml` (as most VPS CPanels (open-source PaaS like Dokku, Caprover, Easypanel) don't support `docker-compose.yml`) so I had to find an alternate solution using `--env-file` option in a `Makefile`:
```make
.PHONY: build-staging
build-staging: ## Build the staging docker image.
docker build -... |
I have an app image that I want to install but I get the following error when trying to run it
[![enter image description here][1]][1]
On trying to install the libfuse2 package this is the error I get
[![enter image description here][2]][2]
[1]: https://i.stack.imgur.com/XoauR.png
[2]: https://i.stac... |
How to install libfuse2 on Ubuntu 22.04 |
|ubuntu|package|appimage|lts|libfuse| |
I'm using the following IIS Rewrite Rule to block as many bots as possible.
<rule name="BotBlock" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_USER_AGENT}" pattern="^$|bot|crawl|spider" />
</conditions>
<action type="CustomResponse" statusCode="403... |
IIS Rewrite modules exclude bots but allow GoogleBot |
|asp.net|regex|iis|url-rewriting|url-rewrite-module| |
Why i can not work with Product Hunt api in python. My api key is correct
```
`ph = ProductHunt(api_key='WUY0eh1BU_-BnIOtYcFBSEk2UuwUsFCTOXzbZe0CYFY')
daily_products = ph.get_daily()`
```
```
Traceback (most recent call last):
File "C:\Users\eesca\PyProjects\solkit\test.py", line 4, in <module>
... |
You can first try to solve x^2 = exp(-x^2) numerically. Say the solution is x*.
Then compute the integral of exp(-x^2) between 0 and x*, and substract the integral of x^2 on the same interval (which is x*^3/3).
Concerning the first integral, you might want to have a look at erf function implemented in `math` and ... |
I'm trying to add service principal Databricks managed on azure and put account level permissions with terraform like this:
[![enter image description here][1]][1]
**Error: cannot create mws permission assignment: Endpoint not found for /2.0/accounts/4f93b050-9cee-4668-8136-7937fe98f18e/workspaces/649133103365674... |
There is a part of mathematics called the theory of multiple zeta values (MZVs) introduced around 1992. In this theory, we study the properties of parametric nested infinite series (see, e.g., [here](https://www.usna.edu/Users/math/meh/mult.html) for the definition of one particular variant) whose numeric evaluation is... |
I'm on Laravel 10, and created an API using sanctum.
In my controller, I want to call the local API to display in a view. The API works fine using postman, but when called in my controller the page doesn't load and times out.
Below is my module route in `module/api/routes/api.php`
```
Route::group(['middlewar... |
Timing closure problems in FIFO |
|verilog|xilinx|timing|fifo| |
|sql|datetime|google-bigquery|datediff|time-difference| |
Mismatched data types: The data types of the referencing and referenced columns must be the same.
Dangling foreign keys: A foreign key that links to a nonexistent table or column.
Referencing a nonexistent table or column: The table that the foreign key references must already exist before you can define a foreign ke... |
I am trying to learn Drizzle ORM and integrate it with next/auth.
I am trying to push an updated schema to my DB, (postgres through neon), but am running into the following error:
> Error: foreign key constraint "job-tracker-t3_session_userId_job-tracker-t3_user_id_fk" cannot be implemented
>
> Detail: 'Key co... |
null |
It is good practice to write programs in such a way that an error is raised if you specify the wrong number of arguments.
And you can always open the program itself and take a look :) |
I'm trying to populate a 2D array of objects and get a result like this example:
```
Guid guid = Guid.NewGuid();
var data = new[] {
new object[] { 22, "cust1_fname","cust1_lname",guid },
new object[] { 23, "cust2_fname","cust2_lname",guid },
... |
As of spaCy version 3.7
```py
import spacy
nlp = spacy.load("en_core_web_sm")
ner = nlp.get_pipe("ner")
print(ner.labels)
```
Outputs:
```('CARDINAL', 'DATE', 'EVENT', 'FAC', 'GPE', 'LANGUAGE', 'LAW', 'LOC', 'MONEY', 'NORP', 'ORDINAL', 'ORG', 'PERCENT', 'PERSON', 'PRODUCT', 'QUANTITY', 'TIME', 'WORK_OF_... |
Install `react-native-safe-area-context` using `npm install react-native-safe-area-context`. Wrap your code in `<SafeAreaProvider>` and then `<SafeAreaView>`. This time, `<SafeAreaView>` is imported from `react-native-safe-area-context`. See if this works.
sample code
import React from "react";
import { T... |
Generally speaking, if the program isn't in any way interactive and replies entirely on arguments from the command line, then the best way to know its argument criteria is to ask it. Typically the argument `--help` will produce a list of available options and how to use them, like so: `ls --help`, or `python somescript... |
just go to Android device manager and edit your device, uncheck the device frame checkbox, and it will solve your problem. |
I am attempting to create a flatpak for an old development version of Wine, 6.13, but have been running into problems.
I first downloaded the flathub manifest repository for Wine as it existed for version 6.0.2:
https://github.com/flathub/org.winehq.Wine/tree/a954b18213547d4acaeb7b6e7f5157205fed45b4
Then, I rena... |
I'm trying to create a curl in python to connect to a swagger api and download the data to a csv.
This is the script
# Import necessary modules
import pycurl
import urllib.parse
query = """
SELECT min({cart_pai.pk}) FROM {cart as carrinho JOIN cart AS cart_pai ON {carrinho.parent} = {cart_pai.pk}}
... |
Curl python + token bearer + query sql |
|python| |
null |
Very new to NetSuite scripting. I am writing a very basic workflow action script to take the ID of the created from transaction (which is already referenced on the current transaction form), and then populate that ID into the new transaction ID field. But it keeps populating the words "createdFromID" instead of the act... |
SuiteScript 1 Issue - Unable to populate Created From ID on another field |
|javascript|netsuite|suitescript|suitescript2.0|suitescript1.0| |
null |
So I want to make my taskbar popup whenever I am in my browser full screen. Like I am watching a YT video, I hover in the taskbar region(bottom screen) for few seconds and task bar pop ups. Like I am using autohide task bar, So normally it is hidden, but whenever I hover below, it pop ups. I would like to do it also in... |
Angular with NX
1. create new file _redirects
2. Add below line in _redirect file
/* /index.html 200
3.open project.json
ex: apps\my-app\project.json
4.add path at targets.build.options.assets :
"assets" :[
"apps/my-app/src/_redirects"
]
|
```
java.lang.IllegalArgumentException: Expected list containing Map, List, Boolean, Integer, Long, Double, String and Date
````
This error occurred when I used springsecurty to query the database for a certain user
What errors may be causing the problem? |
Securing routes with sessionStorage in NextJS |
|session|next.js| |
null |
I stumbled on the `x = [m]*n` and running it in the interpreter I can see that the code allocates an n element array initialized with m. But I can't find a description of this type of code online. What is this called?
>>> [0] * 7
[0, 0, 0, 0, 0, 0, 0]
|
null |
I'm trying to secure a page using a jwt token in a session in NextJS, I was looking at similar questions on the forum and I saw that they recommended using useeffect to get access but I still can't recover anything.
The code I started with
`"use client";
import {
useEffect,
useSta... |
I have encountered an issue when rendering a visualization of a 2d matrix using Pygame (I am aware this not the best library for the job ... but anyway). The issue arises when I attempt to render each node in the matrix as a rectangle. Each node is an instance of the Node class and has x1, y1, x2, and y2 values derived... |
Why ProductHunt api dont work with Python? |
|python|django|api|web|pip| |
null |
<!-- language-all: sh -->
> Why is PowerShell failing when redirecting the output?
The reason is that `python` (which underlies `html2text`) - like many other Windows CLIs (console applications) - modifies its output behavior based on whether the output target is a *console (terminal)* or is _redirected_:
* In... |
I am using this code with UISearchBar but you can use this code with UISearchController.
let searchBar = UISearchBar()
searchBar.sizeToFit()
searchBar.placeholder = "Search"
navigationItem.titleView = searchBar
... |