instruction
stringlengths 0
30k
⌀ |
---|
|utf-8|common-lisp|sbcl| |
{"Voters":[{"Id":341994,"DisplayName":"matt"},{"Id":1290731,"DisplayName":"jthill"},{"Id":839601,"DisplayName":"gnat"}],"SiteSpecificCloseReasonIds":[11]} |
This error message is occurring, is indicating that you didn't install the package(coastsat).
You can read the installation instructions on the [GitHub repo][1], or follow these instructions:
## Instructions
1. Cloning the repo
Open a terminal and run the following command to clone the repo.
```
git clone https://github.com/kvos/CoastSat.git
```
If you don't have git installed, you can just download the repo zipfile and extract it from this link [here][2].
2. Creating a new environment called `coastsat`:
Create a new environment named `coastsat` with all the required packages by entering these commands in succession:
```
conda create -n coastsat
conda activate coastsat
conda install -c conda-forge geopandas -y
conda install -c conda-forge earthengine-api scikit-image matplotlib astropy notebook -y
pip install pyqt5 imageio-ffmpeg
````
All the required packages have now been installed and are self-contained in an environment called coastsat. Always make sure that the environment is activated with:
```
conda activate coastsat
```
[1]: https://github.com/kvos/CoastSat?tab=readme-ov-file#installation
[2]: https://github.com/kvos/CoastSat/archive/refs/heads/master.zip |
You can use i.e. [RandomStringUtils.randomAlphabetic()][1] function like:
def msg = "<Check>" + org.apache.commons.lang3.RandomStringUtils.randomAlphabetic(3, 255) + "</Check>"
See [The Groovy Templates Cheat Sheet for JMeter][2] for more details.
Alternatively you can put your payload into a file and use [__FileToString()][3] and [eval()][4] functions combination to get the payload directly in the Sampler body date like:
${__eval(${__FileToString(payload.txt,,)})}
[1]: https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/RandomStringUtils.html#randomAlphabetic-int-int-
[2]: https://www.blazemeter.com/blog/groovy-templates
[3]: https://jmeter.apache.org/usermanual/functions.html#__FileToString
[4]: https://jmeter.apache.org/usermanual/functions.html#__eval |
Discord Image conversion (Base 64) |
|node.js|axios|discord|discord.js|google-gemini| |
null |
|bash|shell|scripting|xterm| |
**Problem :-**
I think it's because unique=True.
So two people can't put a blank email, that's because both values will be equal (''='').
Like, it become
`empty = empty` .
**Answers :-**
I would say,
1)
to remove `unique=True` and use a DB constrain to keep the uniqueness and allow empty values.
If you really want to use `CharField` for this.
Or
2)
Use `EmailField` and removed `unique=True`. Which is more convenient, suitable and **which is build for this**.
___
And make sure to delete old DB migrations and run makemigrations and migrate.
Thanks. |
|python|azure|azure-functions| |
null |
In my case I had to exclude the module
```
implementation ("io.kubernetes:client-java:15.0.1") {
exclude group:"com.google.code.findbugs", module: "jsr305"
}
```
since I didn't see it being used anyway |
Just try this..
`
try:
dlg.child_window(auto_id="XXXX").select(1)
except:
pass
` |
{"Voters":[{"Id":23569224,"DisplayName":"Lakhan"}],"DeleteType":1} |
I can download every Microsoft Edge Add-On (Web extension) as a .crx file by using this URL:
https://edge.microsoft.com/extensionwebstorebase/v1/crx?response=redirect&x=id%3D[EXTENSION_ID]%26installsource%3Dondemand%26uc
[EXTENSION_ID] is the ID like "elhekieabhbkpmcefcoobjddigjcaadp" for [this][1] Add-on.
I use this for using in a [WebView2][2] control.
But before downloading an update, I would like to check, if an update of the Add-on is available.
**How can I get version information of available Edge Add-ons?**
[1]: https://microsoftedge.microsoft.com/addons/detail/adobe-acrobat-werkzeuge-/elhekieabhbkpmcefcoobjddigjcaadp
[2]: https://developer.microsoft.com/en-US/microsoft-edge/webview2/ |
How to get update information of Microsoft Edge Extensions |
|microsoft-edge|webview2| |
> I am aware that documentation defines multiple templates for what an Object in Map can be (like in MultiTypeUserMetadataBinder example), but I really do not know what can be inside. All I know, it is a valid json and my goal is to put it into Elasticsearch as valid json structure under "fields": {...}
If you don't know what the type of each field is, Hibernate Search won't be able to help much. If you really want to stuff that into your index, I'd suggest declaring a [native field](https://docs.jboss.org/hibernate/stable/search/reference/en-US/html_single/#backend-elasticsearch-field-types-extension) and pushing the JSON as-is. But then you won't be able to apply predicates to the metadata fields easily, except using [native JSON](https://docs.jboss.org/hibernate/stable/search/reference/en-US/html_single/#search-dsl-predicate-extensions-elasticsearch-from-json).
Something like this:
```java
@Component
public class JsonPropertyBinder implements PropertyBinder {
@Override
public void bind(PropertyBindingContext context) {
context.dependencies().useRootOnly();
var schemaElement = context.indexSchemaElement();
// CHANGE THIS
IndexFieldReference<JsonElement> userMetadataField = schemaElement.field(
"metadata",
f -> f.extension(ElasticsearchExtension.get())
.asNative().mapping("{\"type\": \"object\", \"dynamic\":\"true\"}");
)
.toReference();
context.bridge(Map.class, new Bridge(userMetadataField));
}
@RequiredArgsConstructor
private static class Bridge implements PropertyBridge<Map> {
private static final Gson GSON = new Gson();
private final IndexFieldReference<JsonElement> fieldReference;
@Override
public void write(DocumentElement target, Map bridgedElement, PropertyBridgeWriteContext context) {
// CHANGE THIS
target.addValue(fieldReference, GSON.toJsonTree(bridgedElement));
}
}
}
```
Alternatively, you can just declare all fields as strings. Then all features provided by Hibernate Search on string types will be available. But of course things like range predicates or sorts will lead to strange results on numeric values (`2` is before `10`, but `"2"` is **after** `"10"`).
Something like this:
```java
@Component
public class JsonPropertyBinder implements PropertyBinder {
@Override
public void bind(PropertyBindingContext context) {
context.dependencies().useRootOnly();
var schemaElement = context.indexSchemaElement();
var userMetadataField = schemaElement.objectField("metadata");
// ADD THIS
userMetadataField.fieldTemplate(
"userMetadataValueTemplate_default",
f -> f.asString().analyzer( "english" )
);
context.bridge(Map.class, new Bridge(userMetadataField.toReference()));
}
@RequiredArgsConstructor
private static class Bridge implements PropertyBridge<Map> {
private final IndexObjectFieldReference fieldReference;
@Override
public void write(DocumentElement target, Map bridgedElement, PropertyBridgeWriteContext context) {
var map = target.addObject(fieldReference);
// CHANGE THIS
((Map<String, Object>) bridgedElement).forEach(entry -> map.addValue( entry.getKey(), String.valueOf(entry.getValue())));
}
}
}
``` |
"How can I ensure that the decoded data I receive on my mobile matches the data shown on the ESP32 console when connecting the ESP32 to my mobile?"
My server side code is ESP32-C++
My Client side code is React Native-Cli
|
{"Voters":[{"Id":150978,"DisplayName":"Robert"},{"Id":6463558,"DisplayName":"Lin Du"},{"Id":839601,"DisplayName":"gnat"}]} |
In a NuxtJs 3 project I tried to add some specific stuff into my app.config.ts a the root directory of my project.
When I tried to call `useAppConfig()` to use my config data, VSCode raise an error `appConfig.as is unknown type`
I'm stuck with that :(
The `app.config.ts` :
```typescript
interface asAppConfig {
layout: {
nav: {
isOpen: boolean
}
}
}
export default defineAppConfig({
ui: {
notifications: {
position: 'top-0 right-0 bottom-auto',
},
},
as: {
layout: {
nav: {
isOpen: false,
},
},
} satisfies asAppConfig,
})
```
Below after calling `useAppConfig()`, I have `appConfig.nav is unknown type`
```typescript
<script lang="ts" setup>
const appConfig = useAppConfig()
const isOpen = computed({
get: () => appConfig.nav.isOpen,
set: (value: boolean) => (appConfig.nav.isOpen = value)
})
``` |
|typescript|nuxt.js|nuxtjs3|nuxt3| |
null |
{"Voters":[{"Id":721855,"DisplayName":"aled"},{"Id":1431720,"DisplayName":"Robert"},{"Id":839601,"DisplayName":"gnat"}],"SiteSpecificCloseReasonIds":[13]} |
im using jupyter notebook for school, just for some basic math.
im trying to run:
```
from turtle import *
for side in range(4):
forward(50)
left(90)
```
it draws it, but when its done the windows that opens up stops responding and jupyter says its kernel died
i have tried running it in Mu editor, it does not crash there.
is this a usual problem or?
i am 100% new to coding so assume i know nothing
thanks :)
i have no idea what to try |
When running turtle the window stops responding and the jupyter kernel dies |
|jupyter-notebook|turtle-graphics| |
null |
I have tried reading through both aubio and librosa papers but I'm not very familiar with the terms,
I'm writing a code that reads through a batch of audio files in .wav and .mp3 to create a metadata.
The code is already retrieving the title, artist, length and other info from the file itself.
Previously I used Mixmeister program to embed the BPM into .mp3 files but I cannot do so with .wav files.
So, I am trying to find a way that calculate the BPM of each audio file whether its .mp3 or .wav.
**update**
I ended up using the average tempo from the two method
https://stackoverflow.com/questions/67443210/how-does-librosa-estimate-tempo
The average of both results, returns a closer estimate to Mixmeister, but it there is a lot of octave-errors (some results needs to be divided by half to equal actual BPM, for example actual BPM 59 the method returns BPM 188) https://stackoverflow.com/questions/61621282/how-can-we-improve-tempo-detection-accuracy-in-librosa
Is there away to detect which songs needs to have its result divided in half?
Can you share with me the current method that you find most accurate in dealing with BPM or beats per minute of an audio file? |
|python|librosa|audio-analysis| |
Is there a method in Java to ensure that when a user inputs a value, the subsequent output appears on the same line, directly adjacent to the input prompt, without moving to a new line? In other words, can we achieve a setup where the input and output are displayed on the same line?
Expectations:
Factorial of 5: 120
Reality:
Factorial of 5
: 120
Here's the code for reference:
```
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int total = 1;
int i;
System.out.print("Factorial of ");
int input = s.nextInt();
for (i = 1; i <= input; i++) {
total *= i;
}
System.out.print(": " + total);
}
}
``` |
For testing my app, I need to send a mail over my companies mailhost.
Unfortunately I have to use a tunnel to connect to that host and so sending mail is rejected because:
```text
tls: failed to verify certificate: x509: certificate is valid for *.example.com, example.com, not host.docker.internal
```
Is there any way around this? Can I disable TLS?
I'm using github.com/jhillyerd/enmime
**Update after 2 comments**
1. I'm working in a VPN and there are no credentials required when sending mails, as the mailhost can only be reached by a small set of known hosts.
2. This is also why I need a tunnel through a jumphost in order to reach the mailhost from my developer machine:
Dockercontainer --> DevMac ---> Jumphost ---> Mailhost
So I do a
`ssh -L9925:mailhost.example.com:25 me@jumphost.example.com`
That's why I have defined the mailhost to be "host.docker.internal:9925".
Maybe there is another idea how I can reach the mailhost by its real name?
|
I'm using drawflow in my angular 16(standalone) app. but i can't implement the package completly
i want to show the work flow of a document with stage, status based to show the user the complete flow of the application and it's functionalities |
Drawflow angular 16 flowchart using drawflow |
|angular|flowchart|angular16| |
null |
I'm porting a Windows C code written for MSVC to be compatible with gcc and clang. I have this snippet of code to declare a variable in a shared segment:
```
#pragma comment(linker, "/SECTION:.shr,RWS")
#pragma data_seg(".shr")
volatile int g_global = 0;
#pragma data_seg()
```
I know that the gcc equivalent in Windows is:
```
volatile int g_global __attribute__((section("shr"), shared)) = 0;
```
What is the working equivalent for the clang compiler in Windows?
|
Is there a method in Java to ensure that when a user inputs a value, the subsequent output appears on the same line, directly adjacent to the input prompt, without moving to a new line? In other words, can we achieve a setup where the input and output are displayed on the same line?
Expectations:
Factorial of 5: 120
Reality:
Factorial of 5
: 120
Here's the code for reference:
```
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int total = 1;
int i;
System.out.print("Factorial of ");
int input = s.nextInt();
for (i = 1; i <= input; i++) {
total *= i;
}
System.out.print(": " + total);
}
}
``` |
In QML side, receiving one QVariantMap container like CALLS from C++ side. This container having some information (floors, class, variant).
First, Read the how many calls received using count function.
Just for reference (It's not original code), For understanding purpose,
for(int i =0; i < CALSS.count(); i++)
CreateButton(floors, class, variant);
Like that, I want to create button component in QML.
Kindly, help to create this dynamic button.
|
Dynamically create button in QML |
|qt|button|qml| |
Like any kind of `Stream` (e.g. `Promise`s), when you see nesting in `Observable`s you might want to take a step back to see if it's really warranted.
Let's examine your solution bit by bit.
Our starting point is:
this.router.paramMap.pipe(takeUntil(this.ngUnsubscribe))
Then you subscribe, but within that subscribe you do observable operations on the given data, this strongly suggests you should be `pipe`ing an operation instead, and then subscribe on the final result.
In this case you want to `map` your `params` to some `Observable`. You also might benefit from the "interrupt early" behavior that [`switchMap`](https://rxjs.dev/api/index/function/switchMap) offers. Otherwise there's also [`mergeMap`](https://rxjs.dev/api/index/function/mergeMap) as a potential option if you don't want to "interrupt early" (it used to be more appropriately named [`flatMap`](https://rxjs.dev/api/index/const/flatMap)).
We'll add a [`filter`](https://rxjs.dev/api/index/function/filter) and [`map`](https://rxjs.dev/api/index/function/map) for good measure, to ensure we have the `team` param, and to pluck it out (since we don't need the rest).
this.router.paramMap.pipe(
takeUntil(this.ngUnsubscribe),
filter(params => params.has("team"))
map(params => params.get("team"))
switchMap(team => {
this.teamToFilterOn = team as string;
// We'll dissect the rest
})
) // [...]
Then comes the part with what you want to do with that team.
You have multiple "tasks" that rely on the same input, and you want them both at the same time, so reaching for [`forkJoin`](https://rxjs.dev/api/index/function/forkJoin) is a good call. But there's also [`combineLatest`](https://rxjs.dev/api/index/function/combineLatest) that does something similar, but combine the results "step by step" instead.
You use the word "latest" for both your tasks, so we'll indeed reach for `combineLatest` instead:
const releaseDef$ = // [...]
const pipelineDef$ = // [...]
return combineLatest([releaseDef$, pipelineDef$]);
Now let's dissect these two operations.
From what I gather, you're only interested in releases that have a `lastRelease`. You also don't want to "switch" when a new one comes in, you want them all, let's encode that:
const releaseDef$ = this.apiService.getReleaseDefinitions(this.teamToFilterOn as string).pipe(
filter(releaseDef => releaseDef.lastRelease),
mergeMap(lastReleaseDef => this.apiService.getRelease(releaseDefinition.lastRelease.id)),
filter(info => !!info)
mergeMap(info => this.apiService.getTestRunsByRelease(info.releaseId).pipe(map(testruns => ({ testruns, info }))),
)
You'll notice I also pipe into the result of `getTestRunsByRelease`. That is because unlike `Promise`s, we don't have an alternative syntax like `async/await` that help with keeping previous state in an easy way. Instead we have to rely on the monoid operation `map` from within our monad operation `flatMap` and drag the previous results along. For `Promise`s, both `map` and `flatMap` are `.then`. For `Observable`s they are respectively `map` and `mergeMap`.
We apply a very similar transformation to your pipelines:
const pipelineDef$ = this.apiService.getPipelineDefinitions(this.teamToFilterOn as string)
.pipe(
mergeMap(pipelineDef => this.apiService.getLatestPipelineRun(pipelineDef.id)),
filter(info => !!info),
mergeMap(info => this.apiService.getTestRunsByPipeline(info.pipelineRunId).pipe(map(testruns => ({ testruns, info }))),
);
Here if you need to operate independently on the results of `releaseDef$` and `pipelineDef$` you can use [`tap`](https://rxjs.dev/api/index/function/tap).
Note that these could easily be extracted into two methods.
As the end operation is the same for both, and their results have the same shape, you can use [`merge`](https://rxjs.dev/api/index/function/merge) instead of `combineLatest` to merge the two observables into one that emits all values of both as they come in (instead of combining and emitting the latest value of each in an array):
return merge(releaseDef$, pipelineDef$);
To wrap this up, let's put it all together:
ngOnInit(): void {
this.router.paramMap.pipe(
takeUntil(this.ngUnsubscribe),
filter(params => params.has("team"))
map(params => params.get("team"))
switchMap(team => {
this.teamToFilterOn = team as string;
const releaseDef$ = this.apiService.getReleaseDefinitions(this.teamToFilterOn as string).pipe(
filter(releaseDef => releaseDef.lastRelease),
mergeMap(lastReleaseDef => this.apiService.getRelease(releaseDefinition.lastRelease.id)),
filter(info => !!info)
mergeMap(info => this.apiService.getTestRunsByRelease(info.releaseId).pipe(map(testruns => ({ testruns, infos })))),
);
const pipelineDef$ = this.apiService.getPipelineDefinitions(this.teamToFilterOn as string)
.pipe(
mergeMap(pipelineDef => this.apiService.getLatestPipelineRun(pipelineDef.id)),
filter(info => !!info),
mergeMap(info => this.apiService.getTestRunsByPipeline(info.pipelineRunId).pipe(map(testruns => ({ testruns, info }))),
)
return merge(releaseDef$, pipelineDef$);
})
).subscribe(({ testruns, infos }) => {
this.isLoading = false;
this.results = [...this.results, { info: info, testruns: testruns, totals: this.calculateEnvironmentTotals(testruns.testRunResults)}];
this.dataSource.data = this.results;
});
}
You'll notice I only used on `takeUntil(this.ngUnsubscribe)` as the "main" observable chain will stop with that, which means operation will stop as well.
If you're unsure or encounter issues, you can still sprinkle them as the very first argument of each `.pipe`. |
Good morning, I suddenly found administrator users on my wordpress site and a plugin called wp-cleansong that I never installed. The site redirects when I browse. How can I solve it? |
Remove Malware wp-cleansong |
|wordpress|malware| |
|wxpython|xterm| |
My application is based on struts2 (v 6.3.0.2) and I am currently using ognl v3.3.4 as one of its dependency. The application is working fine with these version.
When I try to uplift the OGNL to latest version i.e 3.4.2 I am getting the below error:
` java.lang.NoSuchMethodError: ognl.Ognl.createDefaultContext(Ljava/lang/Object;Lognl/MemberAccess;Lognl/ClassResolver;Lognl/TypeConverter;)Ljava/util/Map;
at com.opensymphony.xwork2.ognl.OgnlValueStack.setRoot(OgnlValueStack.java:102)
at com.opensymphony.xwork2.ognl.OgnlValueStack.<init>(OgnlValueStack.java:81)
at com.opensymphony.xwork2.ognl.OgnlValueStackFactory.createValueStack(OgnlValueStackFactory.java:62)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.setContext(DefaultConfiguration.java:244)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:208)
at com.opensymphony.xwork2.config.ConfigurationManager.reload(ConfigurationManager.java:227)
at com.opensymphony.xwork2.config.ConfigurationManager.initialiseConfiguration(ConfigurationManager.java:84)
at com.opensymphony.xwork2.config.ConfigurationManager.wasConfigInitialised(ConfigurationManager.java:72)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:61)
at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:1079)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:537)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:571)
at org.apache.struts2.dispatcher.InitOperations.initDispatcher(InitOperations.java:48)
at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:60)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:262)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:244)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:97)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4311)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4940)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:683)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:658)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:661)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1014)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1866)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:816)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:468)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1584)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:312)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:114)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:345)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:893)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:794)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:866)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:248)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:433)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:925)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
at org.apache.catalina.startup.Catalina.start(Catalina.java:735)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)
`
from what I have found out is that ognl.OgnlValueStack.setRoot calls ognl.Ognl.createDefaultContext.
In 3.3.4 createDefaultContext return type was Map.
In 3.4.2 createDefaultContext return type is OgnlContext.
This incompatibility is the cause of error, but is there any solution to that from my code perspective? or its simply OGNL (3.4.2) is not compatible with struts2 (6.3.0.2). |
Error uplifting OGNL from 3.3.4 to 3.4.2 with struts2(6.3.0.2) |
|struts2|ognl| |
null |
|unix|x11|xterm| |
NPS (Node Package Scripts) solved this problem for me. It lets you put your NPM scripts into a separate JavaScript file, where you can add comments galore and any other JavaScript logic you need to.
https://www.npmjs.com/package/nps
Sample of the `package-scripts.js` from one of my projects:
```javascript
module.exports = {
scripts: {
// makes sure e2e webdrivers are up to date
postinstall: 'nps webdriver-update',
// run the webpack dev server and open it in browser on port 7000
server: 'webpack-dev-server --inline --progress --port 7000 --open',
// start webpack dev server with full reload on each change
default: 'nps server',
// start webpack dev server with hot module replacement
hmr: 'nps server -- --hot',
// generates icon font via a gulp task
iconFont: 'gulp default --gulpfile src/deps/build-scripts/gulp-icon-font.js',
// No longer used
// copyFonts: 'copyfiles -f src/app/glb/font/webfonts/**/* dist/1-0-0/font'
}
}
```
I just did a local install `npm install nps -save-dev` and put this in my `package.json` scripts.
```json
"scripts": {
"start": "nps",
"test": "nps test"
}
``` |
null |
> The code is to get images from my webcam, detect objects, and then
> draw a box around them; however I keep getting thrown the Error.
You need looping for `label` and `conf`. Then draw a box,
Snippet:
while (True):
retu, frame0=video.read()
bbox, label, conf = cv.detect_common_objects(frame0)
output_image= cvlib.object_detection.draw_bbox(frame0, bbox, label, conf)
for l, c in zip(label, conf):
print(f"Detected object: {l} with confidence level of {c}\n")
output_image = draw_bbox(img, bbox, label, conf)
cv2.imshow('Cam', output_image)
if cv2.waitKey(1) & 0xFF==ord('f'):
break
video.release()
cv2.destroyAllWindows() |
{"Voters":[{"Id":446594,"DisplayName":"DarkBee"},{"Id":3181933,"DisplayName":"ProgrammingLlama"},{"Id":839601,"DisplayName":"gnat"}],"SiteSpecificCloseReasonIds":[13]} |
Apart from other solutions also check if you have given type of bloc
> class NewsBloc extends Bloc<NewsEvent, NewsState>
if you haven't given <NewsEvent, NewsState> it will give same error. |
{"Voters":[{"Id":446594,"DisplayName":"DarkBee"},{"Id":1346234,"DisplayName":"Justinas"},{"Id":839601,"DisplayName":"gnat"}],"SiteSpecificCloseReasonIds":[11]} |
{"Voters":[{"Id":3001761,"DisplayName":"jonrsharpe"},{"Id":9214357,"DisplayName":"Zephyr"},{"Id":15405732,"DisplayName":"Koedlt"}],"SiteSpecificCloseReasonIds":[16]} |
I am working on a project to detect whether images uploaded by Android applications may leak personal privacy.If I can monitor the plaintext traffic of software uploading images, or monitor the behavior of software uploading images and obtain these images, I could use models like DRAG to try to identify whether the image leaks privacy. Is there anything wrong with my approach?
I've tried using eBPF programs to capture traffic before SSL encryption. If successful, I would be able to identify and monitor the images uploaded by applications. I have set up a Debian virtual machine on an Android phone and hooked the ssl_write system call, but it seems I cannot obtain the plaintext of the traffic before SSL encryption. Are there any other methods? (I am not a native English speaker, and this is my first time asking. If there are any issues, please let me know. Thank you!) |
How to monitor the traffic of Android applications uploading images? |
|ebpf| |
null |
I have two separate folder frontend and backend. frontend folder have html, CSS, JS code. backend folder have business logic. how to connect both folder.
I want to connect the both folder to run the code. and saw the result. |
How to connect the frontend folder with backend folder in laravel |
|laravel|connect|laravel-11| |
null |
In VScode, I was using `INT_MIN`/`INT_MAX`, But today I got an error, saying "Unidentified Classifier". Instead it suggested me to use `INT8_MIN`.
After using this it worked perfectly.
But, what is the core difference between them ? |
I am pretty new to programming and this is my first attempt at using intlij IDE both ultimate and community. The errors are impending my smooth studies. can someone please tell what is wrong in plain English [[enter image description here](https://i.stack.imgur.com/D5Ci8.png)](https://i.stack.imgur.com/SrDOD.png)
This is my first attempt at programming and i was running a spiring boot application (HelloWorld) in intelij ultimate and community . but haven't been able to scale past these errors . |
Inelij ultimate and spring boot giving me errors |
how can i add a role to a person i mention through `discord.py` via role id?
i tried many commands that came into my search but every command left me with an error which was:
```
File "C:\Users\mxgak\OneDrive\Documents\Own Coded DC Tools\Stone MM Bot V1\main.py", line 350, in client
await member.add_roles(role)
File "C:\Users\mxgak\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\member.py", line 777, in add_roles
await req(guild_id, user_id, role.id, reason=reason)
^^^^^^^
AttributeError: 'NoneType' object has no attribute 'id'
``` |
null |
|macos|terminal|terminfo| |
If you're using a custom ShareViewController.swift for your Share Extension, ensure it's correctly set up to handle the shared content. [This Github Issue](https://github.com/Expensify/react-native-share-menu/issues/112) seems to have been fixed by replacing the initial `ShareViewController.swift` with a new one from the `node-modules/react-native-share-menu/ios/ShareViewController.swift`.
I'm not a swift expert so I'm not sure about that one, but make sure that the `<dict>` tags are properly nested, because the code you shared contains weird indentation. Here is the properly indented dict:
```xml
<dict>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>PHSupportedMediaTypes</key>
<array>
<!--TODO: Add this flag, if you want to support sharing video into your app-->
<string>Video</string>
<!--TODO: Add this flag, if you want to support sharing images into your app-->
<string>Image</string>
</array>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
<integer>100</integer>
<key>NSExtensionActivationSupportsFileWithMaxCount</key>
<integer>100</integer>
</dict>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
</dict>
</dict>
```
I would also suggest that you double-check that the App Group is correctly configured in both your main app and the Share Extension.
Hope this helps :) |
I have exported data from my website and intend to import it into a new template and post type.
My problem is that one of the custom fields of the previous template is stored in PHP serialized form in the database. How can I convert four of its fields into a new custom field that I created with ACF?
I have tested the WP All Import plugin and the Serialize Fields option, but it didn't work.
The following is an example of serialized data from which I intend to extract address, phone number, and latitude and longitude.
`a:11:{s:7:"address";s:41:"باهنر - نبش كوجه شيرازي";s:11:"gpsLatitude";s:9:"35.805457";s:12:"gpsLongitude";s:8:"51.43616";s:18:"streetViewLatitude";s:0:";s:19:"streetViewLongitude";s:0:";s:17:"streetViewHeading";s:1:"0";s:15:"streetViewPitch";s:1:"0";s:14:"streetViewZoom";s:1:"0";s:9:"telephone";s:0:";s:5:"email";s:0:";s:3:"web";s:0:";}` |
|java|spring-boot| |
null |
I need the value of my data to look like this ```18184789564```.
I used this code:
```
REGEXP_REPLACE(+1, b.PHONE_NUMBER, '[^0-9]', '') AS PHONE_NUMBER
```
I get an error
> Numeric value is not recognized
Hopefully I can just add as simple as 1 because I was able to removed the dashes already. |
How to add a 1 to a phone number and remove the dashes? |
Basically, I need to create a clickable row where i can click the row and then the user details can be shown. However, when i click freeze button, which is inside the row within a <td> tag, the detail modal pops up also. I don't want that as I only want the freeze modal to pop up but not the detail modal. Thanks in advance.
Html code:
```
<tr data-toggle="modal" data-id="1" data-target="#detailModal" class="row-click">
<td>
<span class="custom-checkbox">
<input type="checkbox" id="checkbox@(i)" name="options[]" value=@i>
<label for="checkbox@(i)"></label>
</span>
</td>
<td>@Model.UsersList[i].Username</td>
<td>@Model.UsersList[i].Email</td>
<td>@Model.UsersList[i].FirstName</td>
<td>@Model.UsersList[i].LastName</td>
@{
if (!Model.UsersList[i].IsDeleted)
{
<td style="color: #008000; font-weight: bold;">Active</td>
}
else
{
<td style="color: #FF0000; font-weight: bold;">Deleted</td>
}
}
<td class="actions-td">
<div class="dropdown">
<button type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="material-icons" data-toggle="tooltip" title="More"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item delete" href="#" data-target="#deleteUserModal" data-toggle="modal" data-userId="@Model.UsersList[i].UserId" data-username="@Model.UsersList[i].Username">Freeze</a>
<a class="dropdown-item" href="@Url.Action("CreateOrUpdateUser", "User", new { id = Model.UsersList[i].UserId })" >Edit</a>
<a class="dropdown-item" href="@Url.Action("CreateOrUpdateLicense", "FHUserLicenseProfile")">Add License</a>
</div>
</div>
</td>
</tr>
```
Jquery code:
```
<script>
$(document).ready(function () {
$(".delete").click(function () {
var userId = $(this).data('userId');
var userName = $(this).data('username');
$("#userDataDelete").text("Username: " + userName);
$("#userIdDelete").val(userId);
$("#usernameDelete").val(userName);
});
});
$(function () {
$('#detailModal').modal({
keyboard: true,
backdrop: "static",
show: false,
}).on('show', function () {
var getIdFromRow = $(event.target).closest('tr').data('id');
});
});
</script>
```
I try hiding the modal when delete button is clicked but it does not work |
Prevent modal from popping up when freeze button is clicked |
I'm trying to get cookie with name XSRF_TOKEN when execute login function with laravel sanctum (breeze api) through "http://localhost:8000/sanctum/csrf-cookie" and nuxt 3, but I got undefinded value? What's step wrong from me?
...
[TOKEN SET UP ON COOKIE](https://i.stack.imgur.com/heIY6.png)
`
const CSRF_COOKIE = ref("XSRF-TOKEN")
const CSRF_HEADER = ref("X-XSRF-TOKEN")
async function handleLogin() {
await useFetch('http://127.0.0.1:8000/sanctum/csrf-cookie', {
credentials: 'include'
});
const token = useCookie(CSRF_COOKIE.value);
console.log(token.value);
}
`
[LOG UNDEFINDED TOKEN](https://i.stack.imgur.com/i5Ovy.png) |
Convert Serialized Data to WP Custom Fields |
|php|wordpress|advanced-custom-fields| |
null |
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version
I created a server on the host and connect to the database writes an error
I used different versions of the plugin for the server (connecting to the database does not help). Previously, everything worked, I can't figure out what the error is very strange |
A connection is established and does not fill the database because of this mySQL error |
|mysql| |
null |
The available sympy methods are very slow for symbolic matrices.
Entry-wise operations are way faster. I found it in this paper by the name of 'partial inversion': [doi.org/10.1088/1402-4896/ad298a][1].
Here's the code and a graph of time performance for symbolic matrices of dimensions (2,2) and (3,3). (The .inv() method wouldn't finish compiling for me for higher dimensions, whereas the 'partial inversion' does the job reasonably quick.)
from sympy import Matrix, Symbol, simplify
def sp_partial_inversion(m, *cells):
''' Partial inversion algorithm.
ARGUMENTS
m <sympy.Matrix> : symbolic matrix
*cells <tuple> : 2-tuples with matrix indices to perform partial inversion on.
RETURNS
<sympy.Matrix> : matrix m partially-inverted at indices *cells
'''
# Partial inversion algorithm
M = m.copy()
for cell in cells:
i,k = cell
z = M[i,k]
newmat = []
for r in range(m.shape[0]):
newrow = []
for c in range(m.shape[1]):
if i == r:
if k == c: # Pivot cell
newrow.append( 1/z )
else: # Pivot row
newrow.append( -M[r,c]/z )
else:
if k == c: # Pivot col
newrow.append( M[r,c]/z )
else: # Elsewhere
newrow.append( M[r,c] - M[i,c]*M[r,k]/z )
newmat.append(newrow)
M = Matrix(newmat)
#
return M
def SymbolicMatrix(n):
"Generates symbolic matrix for tests"
return Matrix( [ Symbol( f'm_{i}' ) for i in range(n**2) ] ).reshape(n,n)
def FullInversion(m):
"Full matrix inversion is partial inversion at all i==j."
cells = [(i,i) for i in range(m.shape[0])]
return sp_partial_inversion(m, *cells)
# Test 1 --- Z should be matrix of zeros
M = SymbolicMatrix(3)
#Z = simplify( FullInversion(M) - M.inv() )
# Test 2 ---
M = SymbolicMatrix(4)
M_ = simplify( FullInversion(M) )
M_
Check the plots:
[Figure of time performance plot for 1000 sympy symbolic matrices from (2,2) to (3,3)][2].
[Figure of time performance plot for 100 sympy symbolic matrices from (2,2) to (4,4)][3].
It can also be used for numerical matrices, but it's not faster than numpy's default matrix inversion in my tests.
[1]: https://doi.org/10.1088/1402-4896/ad298a
[2]: https://i.stack.imgur.com/U5wPH.png
[3]: https://i.stack.imgur.com/Qdl4y.png |
Trying to append a hidden form field after the file input that was used to upload a file within the simpleUpload call.
So far I have tried:
```
$(document).on('change', '.upfile', function(){
var obj = $(this);
$(this).simpleUpload("/upload.php", {
start: function(file){ console.log("upload started"); },
progress: function(progress){ console.log("upload progress: " + Math.round(progress) + "%"); },
success: function(data){
$(obj).append('<input type="text" name="images[]" value="'+data.message+'">');
console.log("upload successful!");
console.log(data);
},
error: function(error){ console.log("upload error: " + error.name + ": " + error.message); }
});
});
```
```
$(document).on('change', '.upfile', function(){
var obj = this;
$(this).simpleUpload("/upload.php", {
start: function(file){ console.log("upload started"); },
progress: function(progress){ console.log("upload progress: " + Math.round(progress) + "%"); },
success: function(data){
$(obj).append('<input type="text" name="images[]" value="'+data.message+'">');
console.log("upload successful!");
console.log(data);
},
error: function(error){ console.log("upload error: " + error.name + ": " + error.message); }
});
});
```
To no avail. There seems to be no way of setting a context: in simpleUpload or I would have tried that.
What am I doing wrong?
|
How can I append hidden input to this file input after jquery simpleUpload success? |
|javascript|jquery|ajax| |
Let say I've an `std:array<int>` such as:
0 1 1 1 0 1 1 0
I'd like to use std (if possible) to do this in c++-11:
- sum adjacent 1's
- erase the summed value
- transform 0 to 1
So getting this result for the example above:
1 3 1 2 1
Thanks |
i leave you details about this hack:
**Vulnerable plugin:** litespeed-cache (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N)
Affected Version <= 5.7
Patched Version 5.7.0.1
You can fast check at wp-content/plugins/litespeed-cache/readme.txt
**Symptoms:**
Creation of admin users
Redirects generated by js hooked in wp_head via function clean_header() function
infected core files like wp-blog-header.php
**Execution:**
Attackers can inject arbitrary web scripts into pages that will run when an administrator logs in for the first time in wp-admin. The plugin will in fact be created on exactly the same date and time as login as you can see from the access.log Plane.php use a base64 url =base64_decode("aHR0cHM6Ly9kbnMuc3RhcnRzZXJ2aWNlZm91bmRzLmNvbS9zZXJ2aWNlL2YucGhw"); point to hxxps://dns[.]startservicefounds[.]com/service/f.php (blacklisted url)
**Sources :**
https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/litespeed-cache/litespeed-cache-57-reflected-cross-site-scripting-via-nameservers-and-msg
https://www.risorsainformatica.com/rimozione-malware-sito-wordpress/
Malware removal performed on over 1500 websites, of which 30 with this specific attack.
**Notes:**
First detected on February 27, 2024
**Prevention:**
Update to latest version Litespeed cache plugin
HTTP(S) monitoring for /plugins/wp-cleansong/plane.php
Block using htaccess the requests to song and song1
RewriteEngine On
RewriteCond %{QUERY_STRING} song1 [NC,OR]
RewriteCond %{QUERY_STRING} song2 [NC]
RewriteRule ^ - [F]
Also you can block plane.php , wp-cleansong.php and song.php |
How can I using useCookie in Nuxt 3 - Laravel API directory? |
|laravel|api|single-page-application|nuxt3| |
null |
{"Voters":[{"Id":2308683,"DisplayName":"OneCricketeer"},{"Id":5577765,"DisplayName":"Rabbid76"},{"Id":839601,"DisplayName":"gnat"}]} |
Intelij ultimate and spring boot giving me errors |
I have a text that is so long that it spans several pages. Since it is in a table that also spans multiple pages, the TooManyPages error is thrown.
This is the code as a Table and Paragraph. Please help me to make the text span multiple pages.
```
// Erstelle eine Tabelle mit der hierarchischen Struktur
pdf.addPage(pw.MultiPage(
maxPages: 999,
pageFormat: PdfPageFormat.a4,
build: (context) => [
pw.Table(
columnWidths: {
0: pw.FlexColumnWidth(1),
1: pw.FlexColumnWidth(4),
2: pw.FlexColumnWidth(1),
3: pw.FlexColumnWidth(1),
4: pw.FlexColumnWidth(2),
5: pw.FlexColumnWidth(2),
},
children: [
pw.TableRow(
//decoration: pw.BoxDecoration(color: PdfColors.grey300),
children: [
pw.Padding(
padding: const pw.EdgeInsets.all(4),
child: pw.Text('Pos.Nr.', style: headerStyle)),
pw.Padding(
padding: const pw.EdgeInsets.all(4),
child: pw.Text('Leistungsbeschreibung', style: headerStyle)),
pw.Padding(
padding: const pw.EdgeInsets.all(4),
child: pw.Text('Menge', style: headerStyle)),
pw.Padding(
padding: const pw.EdgeInsets.all(4),
child: pw.Text('Einheit', style: headerStyle)),
pw.Padding(
padding: const pw.EdgeInsets.all(4),
child: pw.Text('Einheitspreis', style: headerStyle)),
pw.Padding(
padding: const pw.EdgeInsets.all(4),
child: pw.Text('Gesamtpreis', style: headerStyle)),
],
),
...categoriesAndItems.map((item) {
endTime = DateTime.now();
duration = endTime.difference(startTime);
print("PDF item created. (after ${duration.inMilliseconds}ms)");
if (item['isCategory']) {
return pw.TableRow(
children: [
pw.Padding(
padding: const pw.EdgeInsets.all(4),
child: pw.Text(item['posnr'],
style: textStyles[item['level'] - 1]),
),
pw.Padding(
padding: const pw.EdgeInsets.all(4),
child: pw.Column(
crossAxisAlignment: pw.CrossAxisAlignment.start,
children: [
pw.Text(item['position'],
style: textStyles[item['level'] - 1]),
//here the critical text block
pw.Padding(
padding: const pw.EdgeInsets.all(4),
child: pw.Paragraph(
text: item['description'],
style: textStyles[3])),
]),
),
pw.Padding(
padding: const pw.EdgeInsets.all(4),
child: pw.Text('', style: textStyles[item['level'] - 1])),
pw.Padding(
padding: const pw.EdgeInsets.all(4),
child: pw.Text('', style: textStyles[item['level'] - 1])),
pw.Padding(
padding: const pw.EdgeInsets.all(4),
child: pw.Text('', style: textStyles[item['level'] - 1])),
pw.Padding(
padding: const pw.EdgeInsets.all(4),
child: pw.Text(item['totalPrice'],
style: textStyles[item['level'] - 1])),
],
);
} else {
return pw.TableRow(
children: [
pw.Padding(
padding: const pw.EdgeInsets.all(4),
child: pw.Text(item['posnr'], style: textStyles[2]),
),
pw.Padding(
padding: const pw.EdgeInsets.all(4),
child: pw.Column(
crossAxisAlignment: pw.CrossAxisAlignment.start,
children: [
pw.Text(item['position'], style: textStyles[2]),
pw.Padding(
padding: const pw.EdgeInsets.all(4),
//here another critical text block
child: pw.Paragraph(
text: item['description'],
style: textStyles[3])),
]),
),
pw.Padding(
padding: const pw.EdgeInsets.all(4),
child: pw.Align(
alignment: pw
.Alignment.centerRight, // Setzt den Text rechtsbündig
child: pw.Text(item['quantity'], style: textStyles[2]),
),
),
pw.Padding(
padding: const pw.EdgeInsets.all(4),
child: pw.Text(item['unit'], style: textStyles[2])),
pw.Padding(
padding: const pw.EdgeInsets.all(4),
child: pw.Text(item['unitPrice'], style: textStyles[2])),
pw.Padding(
padding: const pw.EdgeInsets.all(4),
child: pw.Text(item['totalPrice'], style: textStyles[2])),
],
);
}
}),
],
),
],
));
```
If the text is shorter than a page, my code works.
I tried, paragraph, text, Wraps and so on. I even converted everything to containers and rows and the same error is thrown. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.