instruction stringlengths 0 30k ⌀ |
|---|
**tl;dr:** Remove the `safecall`
The definition of `IEnumerable`:
```
IEnumerable = interface(IInterface)
function GetEnumerator: IEnumerator;
end;
```
Yours:
function GetEnumerator: IEnumerator; safecall;
Or, side-by-side:
function GetEnumerator: IEnumerator; // defi... |
You need to declare `content_scripts` in manifest.json, then [re-inject `content_scripts`](/q/10994324) after reloading/installing the extension in Chrome, but a much simpler solution is to use programmatic injection via `chrome.scripting.executeScript` instead of content_scripts+messaging, see [these examples](/a/6722... |
Does flutter wasm support native module import? |
I have to execute a shell script `log-agent.sh` inside my docker container.
**Dockerfile**
FROM openjdk:11-jre
LABEL org.opencontainers.image.authors="gurucharan.sharma@paytm.com"
# Install AWS CLI
RUN apt-get update && \
apt-get install -y awscli && \
apt-get clean
... |
Run multiple shell scripts in Dockerfile |
|docker|shell|dockerfile| |
|python|machine-learning|deep-learning|sequential|optuna| |
### About `I would like it to return tab/sheet name "Park Letter" instead.`
When I saw your showing script, `var sheetName = SpreadsheetApp.getActiveSpreadsheet().getName();` is used as the filename of PDF file at `MailApp.sendEmail (emailAddress, subject ,body, {attachments:[{fileName:sheetName+".pdf", content:conten... |
A `dplyr` solution:
```
library(dplyr)
df |>
filter(Disease == 1 & lead(Disease) == 2, .by = ID) |>
pull(ID)
```
Result:
```
[1] 2 4
```
**Edit:**
The original question was extended such that cases with disease sequence (1, 3, 2) shall also be included:
```
df |>
filter(Disease == 1 &
... |
you can make something like this
@Catch(TypeORMError)
export class EntityNotFoundExceptionFilter implements ExceptionFilter {
catch(exception: TypeORMError, host: ArgumentsHost) {
const ctx = host.switchToHttp();
const response = ctx.getResponse<Response>();
const request =... |
Running "flutter pub get" in carousel_slider...
Resolving dependencies...
Error on line 34, column 3 of pubspec.yaml: A package may not list itself as a dependency.
╷
34 │ carousel_slider: ^4.2.1
│ ^^^^^^^^^^^^^^^
╵
pub get failed
I tried changing the file name still the same error. |
Not able to add carousel_slider package in flutter application |
|flutter|carousel-slider| |
null |
maybe you must use property value:
foreach (var key in appSettings.AllKeys)
{
Console.WriteLine("Key: {0} Value: {1}", key, appSettings[key].Value);
}
and later, to obtain value you must use:
string result = appSettings[key].Value;
Try and good luck
|
You should do like this:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
import mysite.wsgi
application = mysite.wsgi.application
<!-- end snippet -->
|
I am using Apache 2.4.58 with Windows server 2019 essentials.
I have only 1 server and 1 public IP address with 2 network cards: 192.168.3.100 and 192.168.3.200.
I created 2 proxy directives in httpd-ssl.conf
<VirtualHost _default_:443>
<Proxy "http://192.168.3.100:20300/">
Require expr "(%{H... |
In my react-native application I use `react-query` to fetch the data from backend written in `Spring Boot`.
```typescript
export function useFetchAllNotes(kindeId: string) {
return useInfiniteQuery<ApiResponseListNote, AxiosError, Response>({
initialPageParam: 0,
queryKey: ['userNote... |
React Query useInfiniteQuery fetching first page after last page |
|reactjs|pagination|react-query|tanstackreact-query| |
Refresh your database with `Artisan`:
Artisan::call('migrate:fresh --seed');
*This command removes your tables, creates the tables again (runs the migrations) and then seeds the tables with clean data.* |
the input is:
[input of sample data](https://i.stack.imgur.com/akaB9.png)
need output as:
[enter image description here](https://i.stack.imgur.com/tyeiB.png)
is this possible in just XL format or a python script is required.
if yes can you help with python script?
thanks.
my script:
my logic is read each ... |
I'm trying to implement basic socket program in C which parses HTTP GET requests for now, in `parse_http_req` function I've declared `char* line;` and after `strncpy` call `line` contains 1st line of HTTP request data. My doubt is I didn't allocate any memory for `line` before I called `strncpy`, how is this code worki... |
how is strncpy able to copy from source to empty destination? |
|c|sockets|memory-management|strncpy| |
null |
I am trying to develop a plugin to export markdown file to PDF.
Here is a sample markdown content:
# What is Obsidian ?
Obsidian is a **markdown** editor.
I am using `marked` library to convert `markdown => html string` after which using `html` function of `JSPDF` library to convert to PDF and save
The cod... |
html to PDF not rendering properly while using jsPDF |
|jspdf|obsidian| |
I have class files which are compiled in `C:\Users\Chandrasekaran\eclipse-workspace\DemoTestForHealenium\target\classes`
testng and jcommander Jar files and `testng.xml` is present in `C:\Users\Chandrasekaran\eclipse-workspace\DemoTestForHealenium`
```
java -cp "C:\Users\Chandrasekaran\eclipse-workspace\DemoTe... |
If you're writing code where the _only_ difference is a number, or the "number of some fixed thing", then that's a loop, not separate `if` statements, but if you _do_ use if statements, resolve them either with `if` statements that are ordered "largest to smallest match", so there's no fall-through, _or_ with if-else s... |
When you create a custom router in Express using `express.Router()`, parameters won't be passed to it. This means that you can access parameter values only in your main entry file and not in the custom router.
To make parameters accessible in the custom router, you need to instruct Express to pass these parameters u... |
s = 'greenland.gdb**\t**opology_check**\t**_buildings'
python is consider this \t has the escape sequence .
\t - Indicates the whitespace in python.
for the above case we won't specify any separater .space considered as default separater.
input- print (s.split())
output- ['greenland.gdb', 'opology_check', '_bu... |
I am trying to build a personal project in astro, for this, i created a header component that looks like this:
import { AlignJustify } from 'lucide-react';
import Sidebar from './Sidebar';
import { useState } from "react";
const Header = () => {
const [open, setOpen] = useState(false... |
I am using the pins R package and the `board_gdrive()` function to create a hosted board on my Google Drive. My goal is to have a hosted shiny app that pulls pin data from the Google Drive board. However, it appears that Google Drive requires authentication verification each time. Is there a way to not require, or have... |
Write R pin to Google Drive without authentification |
|r|google-drive-api|pins| |
I have an Android Studio project with a Kotlin only module in it that I'd like to use to implement database related code (in other words create the database, entities and DAO's) using Jetpack Room.
By reading the [Declaring dependencies](https://developer.android.com/jetpack/androidx/releases/room#declaring_dependen... |
Cannot resolve room dependencies in Kotlin only module |
|build.gradle|android-room| |
null |
I have to work with the learning history of a Keras model. This is a basic task, but I've measured the performance of the Python built-in min() function, the numpy.min() function, and the numpy ndarray.min() function for list and ndarray. The performance of the built-in Python min() function is nothing compared to that... |
reformat numbers stored in array |
|input|numeric|reformat| |
null |
If you come across errors such as "SyntaxError: Unexpected token 'export'" or "'SyntaxError: Cannot use import statement outside a module'", along with similar issues, it's necessary to include the module causing the problem in the transpilePackages configuration.
**next.config.mjs or next.config.js**
const... |
The below script has been working fine for multiple things but the letter returns as a PDF letter named "Site Utilities" this is the whole spreadsheet name.
I would like it to return tab/sheet name "Park Letter" instead. Even better would be a chosen name or a cell within the sheet.
```
function Email3() {
var ... |
What would be the best way to solve the problem of wanting to 'auto group' all artboards?
Opposed to dragging a selection box of each artboard, then hitting CMD+G, each page has 8 artboards and I have probably 80-150 pages to get through.
To those proficient in javascript, does this code resemble something workab... |
astro onclick event not calling the function |
|reactjs|onclick|astro| |
null |
I am trying to add my number in whatsapp manager but it dont show any option for code or call. It just land me to list view and shows number status as pending. My business is already verified. have anybody experienced similar issue?
I have added number and it should send SMS code or call on given number but it redi... |
Whatsapp Manager number verification pending |
|whatsapp|whatsapp-cloud-api| |
null |
There's a following table, called `fields`:
[![enter image description here][1]][1]
And there's a dedicated table to store its values, called `values`
[![enter image description here][2]][2]
I want to run a query to produce the following output:
Finished | Faculity | Characteristic | Photo
--... |
I have a problem with writing a dots and boxes game with alpha-beta pruning. The whole program works, but the algorithm makes some stupid moves sometimes and I think it generates wrong evaluation of the state. Could you please look at it and maybe tell me what have I done wrong? I'm completely stuck at it.
(I know th... |
Dots and Boxes with apha-beta pruning |
|python|algorithm|artificial-intelligence|game-development|alpha-beta-pruning| |
null |
{"OriginalQuestionIds":[54957941],"Voters":[{"Id":5577765,"DisplayName":"Rabbid76","BindingReason":{"GoldTagBadge":"pygame"}}]} |
I would like to create custom history back and forwards buttons using a React hook.
For reference, in case it helps, I'm trying to replicate the behaviour that can be seen in Spotify's web app. Their custom forwards and back buttons integrate seamlessly with the browser history buttons.
I think I have it mostly w... |
{"OriginalQuestionIds":[19271169],"Voters":[{"Id":2943403,"DisplayName":"mickmackusa","BindingReason":{"GoldTagBadge":"php"}}]} |
A super minimalist solution is to simply assign your variable to another variable that expects to be of type `never` so that your code doesn't compile if a new `job.type` type is added:
```
if (job.type === 'add') {
add(job)
} else if (job.type === 'send') {
send(job)
} else {
const check: neve... |
hi everyone i'm having problems saving photos from summernote. My project uses springboot jsp. When adding photos to summernote and pressing save, springboot displays the error "Maximum upload size exceeded". Local image size is 8MB.I tried to configure image size but it didn't work. When you add an image using the fil... |
Maximum upload size exceeded when saving photos in summernote |
|spring-boot|file-upload|max|summernote| |
null |
1. Return a pointer to the `Node` of interest instead of updating the out parameter `head_dest`. The stack will implicitly hold `cur_list_dest`.
1. The original implementation changes the original list. To create a new list you need to return a pointer to *copy* of the smallest node or NULL. To emphasize that I m... |
My program uses orthpgraphic projection with an internal resolution of 480x270 and a viewport resolution of 1920x1080 (without shaders). When I draw a rectangle directly to the framebuffer I am able to move it around in incriments of 0.25 pixels (because there are 4 pixels in the framebuffer for every 1 pixel of inter... |
OpenGL Framebuffer/FBO RTT subpixel movement discrepancy |
|opengl| |
I am making a program that solves a sudoku game, but I received an error from my compiler.
```
error: invalid use of undefined type ‘struct Square’
30 | if(box->squares[x]->possible[number-1] == 0){
^~
```
the function is:
```
int updateBoxes(Square *** sudoku, i... |
```Because when I use the stored procedure in Crystal Report, it does not work because to create the columns it requires me to put the start and end dates, which is a variable that cannot be fixed.```
Does this mean you think the values you assign during selecting the procedure is fixed and cant be changed after desig... |
I'm trying to run some integration tests for Kafka consumer with,
> org.springframework.kafka.test.context.EmbeddedKafka
Currently letting spring-boot-starter-parent to do the dependency version management responsibility. Here is the **pom.xml** file.
<parent>
<groupId>org.springframework.boot</groupId... |
Embedded Kafka Failed to Start After Spring Starter Parent Version 3.1.10 |
Apache Reverse Proxy: only one proxy directive is working. Second one is ignored |
|apache|proxy|reverse-proxy|proxypass| |
I'm working on a WordPress/Dokan plugin. I am looking for a way to add a new field by two selectable options, New and Used product. Also, The visitors can filter the products in the shop page or search results page by New and Used products. I would really appreciate it if someone can help me?
I tried the following ... |
How to Add New Fields in Dokan Product Form to Specify New and Used product, and Can Filter the Products by Used and New One |
{"Voters":[{"Id":9098759,"DisplayName":"Akash Singh"}],"DeleteType":1} |
Yes if you are creating the program on the browser using html and js, you can use the following code to achieve it. By changing the template inside `amountInput.oninput` you can change the maximum amount.
HTML
<label>Montant Rechargement</label>
<br />
<input
autocomplete="cc-number"
i... |
I have a DataGridView containing data about different customers, and my objective is to print each row on a separate page. However, I'm facing a problem where the data from two consecutive rows prints on the same page, overlapping each other. For example, if I have four rows in my DataGridView, the content of rows 1 an... |
null |
> I am using following code to get the IP of the client ... and this is outputting IPv4 for some clients, and IPv6 for some
The code is doing the same thing for all clients: outputting the IP address they connected from. If someone connects using IPv6, that's the only address you can get.
Imagine you have a syste... |
I’ll just mimic the string in a *pre* tag and do the string parsing...
<!DOCTYPE html><head></head>
<body onload="Process();">
<script>
function Process(){
let S=Cont.innerHTML;
S=S.replace(/\n+/g,'').replace(/ +/g,'').replace(/{/g,' {\n ').replace(/;/g,'... |
It seems that Luxon can be also used with CDN. [Ref](https://cdnjs.com/libraries/luxon) When `https://cdnjs.cloudflare.com/ajax/libs/luxon/3.4.4/luxon.min.js` is used, how about the following sample script?
### Pattern 1:
In this pattern, the script of Luxon is used by copying to the script editor.
1. Please acc... |
Why don't you just validate first and then try the update?
public function update(UpdateUserRequest $request, string $id)
{
// you can just use:
// $request->validated();
// and it throws error or anything you change in failedValidation() method
// or
$va... |
{"OriginalQuestionIds":[10994324],"Voters":[{"Id":3959875,"DisplayName":"wOxxOm","BindingReason":{"GoldTagBadge":"google-chrome-extension"}}]} |
You could try implementing a custom drag preview by adopting the [`UIDragInteractionDelegate`](https://developer.apple.com/documentation/uikit/uidraginteractiondelegate) in a [`UIViewRepresentable`](https://developer.apple.com/documentation/swiftui/uiviewrepresentable) that wraps your SwiftUI view: by using [`UIDragPre... |
Since a comma can not be in a url, you can narrow the characters in the url to not be a comma with `[^,]`:
\b(?<=,)http[^,]*(?=,)\b
Also you do not need the ? for optional character as * already means zero or more characters. |
i am trying designing a neural network to classify signals by a pytorch model. after training the model i save the model and load it for inference phase.
i am trying designing a neural network to classify signals by a pytorch model. after training the model i save the model by the fllowing code:
```
torch.save(m... |
a problem for save and load a pytorch model |
|python|deep-learning|pytorch|neural-network| |
null |
You can use `envsubst` to substitute environment variables :
```
psql -h XXX -p 5432 -U XXX -d XXX -f <(envsubst < ./script.sql)
``` |
It isn't reliable to use `implode()` then unconditionally append a trailing delimiter for cases where an array might be empty.
If you are seeking a functional-style approach, then `array_reduce()` can most directly iterate your values as a delimited string.
Code: ([Demo][1])
$array = ['name1', 'name2', 'n... |
null |
You can use getQueryInterface function and createaDabase function to create database before model initialization .:
import { Sequelize } from "sequelize";
let sequelizeOptions: any = {
dialect: "mysql",
host: process.env.DB_HOST || "localhost",
port: process.env.DB_PORT || 12345,
username: pro... |
Instead of extending DefaultBatchConfiguration, you can define custom beans for specific components you want to customize. For example, you can define a custom TaskExecutor bean without extending DefaultBatchConfiguration. This allows you to retain other autoconfigured beans provided by Spring Boot.
@Configurati... |