问:
Users can see the homepage before completely redirected to the long url
i have a minor problems, whenever user click on the shorturl the total number of clicks is increased by 2 instead of 1 and the user can see the homepage for a while before being completely redirected.

here is for index.js on account components

```<code>import { useState, Fragment, useEffect, useCallback, useMemo } from 'react';
import React from 'react';
import { Box, Grid, Typography, Button, Divider, Snackbar } from '@mui/material';
import Navbar from './Navbar';
import LinkCard from './LinkCard';
import ShortenUrlModal from './ShortenUrlModal';
import { app, firestore, auth } from '../../firebase';
import { nanoid } from 'nanoid';
import copy from 'copy-to-clipboard';

function Account() {
    const [newLinkToastr, setNewLinkToastr] = useState(false);
    const [openModal, setOpenModal] = useState(false);
    const [links, setLinks] = useState([]);
    const userUid = auth.currentUser.uid
    const linksPathRef = useMemo(() => firestore.collection('users').doc(userUid).collection('links'), [userUid]);

    const handleCreateShortenLink  = async (name, longURL) => {
        const link = {
            name,
            longURL,
            createdAt: app.firestore.FieldValue.serverTimestamp(),
            shortCode: nanoid(6),
            totalClicks: 0
        };

    const resp = await linksPathRef.add(link);

    setLinks((links) => [...links, { ...link, createdAt: new Date(), id: resp.id }])
    setOpenModal(false)
    };

    useEffect(() => {
        const fetchLinks = async () => {
           const snapshot = await linksPathRef.get()

           const tempLinks = [];
           snapshot.forEach((doc) => tempLinks.push({ ...doc.data(), id: doc.id, createdAt: doc.data().createdAt.toDate() }));

           setLinks(tempLinks);
        }
            fetchLinks()
    },[linksPathRef]);

    const handleDeleteLink = useCallback(async (linkDocID) => {
        await linksPathRef.doc(linkDocID).delete()
        setLinks(oldLinks => oldLinks.filter(link => link.id !== linkDocID))
    }, [linksPathRef]);

    const handleCopyLink = useCallback(shortUrl => {
        copy(shortUrl);
        setNewLinkToastr(true)
    }, [])

  return (
    <>
    <Snackbar open={newLinkToastr} onClose={() => setNewLinkToastr(false)} autoHideDuration={1000} message="Link Copied"/>
    {openModal && <ShortenUrlModal createShortenLink={handleCreateShortenLink} handleClose={() => setOpenModal(false)} />}
    <Navbar />
    <Box mt={5}>
    <Grid container justifyContent="center">
        <Grid item xs={8}>
            <Box mb={5} display="flex">
                <Box mr={3}>
                <Typography variant="h4">Links</Typography>
                </Box>
                <Button onClick={() => setOpenModal(true)} disableElevation variant="contained" color="primary">Create New</Button>
            </Box>

            {links.sort((prevLink, nextLink) => nextLink.createdAt - prevLink.createdAt).map((link, idx) => (
                <Fragment key={link.id}>
                <LinkCard {...link} deleteLink={handleDeleteLink} copyLink={handleCopyLink} />
                { idx !== links.length -1 && ( <Box my={4}>
                <Divider />
                </Box>
                )}
                </Fragment>
            ))}
        </Grid>
    </Grid>
    </Box>
    </>
  )
}

export default Account
</code>```

and this is for redirect components

import { useParams } from 'react-router-dom';
import { useEffect, useState, useCallback } from 'react';
import React from 'react';
import { firestore, app } from '../../firebase';
import { CircularProgress, Box, Typography } from '@mui/material';

function LinkRedirect() {
  const { shortCode } = useParams();
  const [loading, setLoading] = useState(true);

  const fetchLinkDoc = useCallback(async () => {
    try {
      const linkDoc = await firestore.collection('links').doc(shortCode).get();
      if (linkDoc.exists) {
        const { longURL, linkID, userUid } = linkDoc.data();
        await firestore
          .collection('users')
          .doc(userUid)
          .collection('links')
          .doc(linkID)
          .update({
            totalClicks: app.firestore.FieldValue.increment(1)
          });
        window.location.href = longURL;
      } else {
        setLoading(false);
      }
    } catch (error) {
      console.error(error);
      setLoading(false);
    }
  }, [shortCode]);

  useEffect(() => {
    fetchLinkDoc();
  }, [fetchLinkDoc]);

  if (loading)
    return (
      <Box mt={10} textAlign="center">
        <CircularProgress />
        <Typography>Redirecting to the link</Typography>
      </Box>
    );
  else
    return (
      <Box mt={10} textAlign="center">
        <Typography>Link is not valid</Typography>
      </Box>
    );
}

export default LinkRedirect;```

i use react-router-dom v6 and firebase/firestore v9

I want the total clicks to increase by only 1 and I want the user to not see the homepage before being redirected.

Body:
i have a minor problems, whenever user click on the shorturl the total number of clicks is increased by 2 instead of 1 and the user can see the homepage for a while before being completely redirected.

here is for index.js on account components

import { useState, Fragment, useEffect, useCallback, useMemo } from 'react';
import React from 'react';
import { Box, Grid, Typography, Button, Divider, Snackbar } from '@mui/material';
import Navbar from './Navbar';
import LinkCard from './LinkCard';
import ShortenUrlModal from './ShortenUrlModal';
import { app, firestore, auth } from '../../firebase';
import { nanoid } from 'nanoid';
import copy from 'copy-to-clipboard';

function Account() {
    const [newLinkToastr, setNewLinkToastr] = useState(false);
    const [openModal, setOpenModal] = useState(false);
    const [links, setLinks] = useState([]);
    const userUid = auth.currentUser.uid
    const linksPathRef = useMemo(() => firestore.collection('users').doc(userUid).collection('links'), [userUid]);

    const handleCreateShortenLink  = async (name, longURL) => {
        const link = {
            name,
            longURL,
            createdAt: app.firestore.FieldValue.serverTimestamp(),
            shortCode: nanoid(6),
            totalClicks: 0
        };

    const resp = await linksPathRef.add(link);

    setLinks((links) => [...links, { ...link, createdAt: new Date(), id: resp.id }])
    setOpenModal(false)
    };

    useEffect(() => {
        const fetchLinks = async () => {
           const snapshot = await linksPathRef.get()

           const tempLinks = [];
           snapshot.forEach((doc) => tempLinks.push({ ...doc.data(), id: doc.id, createdAt: doc.data().createdAt.toDate() }));

           setLinks(tempLinks);
        }
            fetchLinks()
    },[linksPathRef]);

    const handleDeleteLink = useCallback(async (linkDocID) => {
        await linksPathRef.doc(linkDocID).delete()
        setLinks(oldLinks => oldLinks.filter(link => link.id !== linkDocID))
    }, [linksPathRef]);

    const handleCopyLink = useCallback(shortUrl => {
        copy(shortUrl);
        setNewLinkToastr(true)
    }, [])

  return (
    <>
    <Snackbar open={newLinkToastr} onClose={() => setNewLinkToastr(false)} autoHideDuration={1000} message="Link Copied"/>
    {openModal && <ShortenUrlModal createShortenLink={handleCreateShortenLink} handleClose={() => setOpenModal(false)} />}
    <Navbar />
    <Box mt={5}>
    <Grid container justifyContent="center">
        <Grid item xs={8}>
            <Box mb={5} display="flex">
                <Box mr={3}>
                <Typography variant="h4">Links</Typography>
                </Box>
                <Button onClick={() => setOpenModal(true)} disableElevation variant="contained" color="primary">Create New</Button>
            </Box>

            {links.sort((prevLink, nextLink) => nextLink.createdAt - prevLink.createdAt).map((link, idx) => (
                <Fragment key={link.id}>
                <LinkCard {...link} deleteLink={handleDeleteLink} copyLink={handleCopyLink} />
                { idx !== links.length -1 && ( <Box my={4}>
                <Divider />
                </Box>
                )}
                </Fragment>
            ))}
        </Grid>
    </Grid>
    </Box>
    </>
  )
}

export default Account

and this is for redirect components

import { useParams } from 'react-router-dom';
import { useEffect, useState, useCallback } from 'react';
import React from 'react';
import { firestore, app } from '../../firebase';
import { CircularProgress, Box, Typography } from '@mui/material';

function LinkRedirect() {
  const { shortCode } = useParams();
  const [loading, setLoading] = useState(true);

  const fetchLinkDoc = useCallback(async () => {
    try {
      const linkDoc = await firestore.collection('links').doc(shortCode).get();
      if (linkDoc.exists) {
        const { longURL, linkID, userUid } = linkDoc.data();
        await firestore
          .collection('users')
          .doc(userUid)
          .collection('links')
          .doc(linkID)
          .update({
            totalClicks: app.firestore.FieldValue.increment(1)
          });
        window.location.href = longURL;
      } else {
        setLoading(false);
      }
    } catch (error) {
      console.error(error);
      setLoading(false);
    }
  }, [shortCode]);

  useEffect(() => {
    fetchLinkDoc();
  }, [fetchLinkDoc]);

  if (loading)
    return (
      <Box mt={10} textAlign="center">
        <CircularProgress />
        <Typography>Redirecting to the link</Typography>
      </Box>
    );
  else
    return (
      <Box mt={10} textAlign="center">
        <Typography>Link is not valid</Typography>
      </Box>
    );
}

export default LinkRedirect;

i use react-router-dom v6 and firebase/firestore v9

I want the total clicks to increase by only 1 and I want the user to not see the homepage before being redirected.


来源: stackexchange

问:
Change header at the keycloak login panel
I need to style my login screen for a keycloak. I am using themeing and have been already override few texts at keycloak/theme/login/messages/messages_en.properties

But I could not change text at the header. My inspection says that it is this line

```<code><h1 id="kc-page-title"><#nested "header"></h1>
</code>```

It renders as a "Sign in to your account" at my screen and I need to change this text. Could anyone help me?

ContentLicense: CC BY-SA 4.0

Body:
I need to style my login screen for a keycloak. I am using themeing and have been already override few texts at keycloak/theme/login/messages/messages_en.properties

But I could not change text at the header. My inspection says that it is this line

<#nested "header">

It renders as a "Sign in to your account" at my screen and I need to change this text. Could anyone help me?


问:
select top 10 in Access query?
My Access database transactions table and in that there is items, qty sold, etc

I want to do a query that select the top 10 highest items along with how many qty sold of that items till now.
How to do this? Thanks.

i am able to select the top X items but unable to select the total qty sold of that items

Title: select top 10 in Access query?


问:
Flutter - Fail to run Custom Model From Firebase into Flutter App
I call model from firebase through firebase_ml_model_downloader it work fine but when I try to work with my model through this flutter_tflite it giving error

init model in first screen like this

  /// Initially get the lcoal model if found, and asynchronously get the latest one in background.
  initWithLocalModel() async {
    final _model = await FirebaseModelDownloader.instance.getModel(
        'logos', FirebaseModelDownloadType.localModelUpdateInBackground);

    setState(() {
      model = _model;
    });
  }
```
<p>Here's how I am trying to make used of my model</p>
<pre class="lang-dart prettyprint-override"><code>  @override
  void initState() {
    //initS is the first function that is executed by default when this class is called
    super.initState();
    loadModel().then((value) {
      setState(() {});
      Future.delayed(
        const Duration(seconds: 3),
        () {
          log(widget.image.path.toString());
          classifyImage(widget.image);
        },
      );
    });
  }

  loadModel() async {
    //this function loads our model
    log(mode);
    try {
      await Tflite.loadModel(
          model: model.file.toString(),

          numThreads: 2, // defaults to 1
          isAsset:
              true, // defaults to true, set to false to load resources outside assets
          useGpuDelegate:
              false // defaults to false, set to true to use GPU delegate
          );
    } on PlatformException {
      debugPrint("Failed to load Model");
    }
  }
  classifyImage(CroppedFile image) async {
    var recognitions = await Tflite.runModelOnImage(
        path: image.path,
        // imageMean: 0.0, // defaults to 117.0
        imageStd: 20.0, // defaults to 1.0
        numResults: 2, // defaults to 5
        threshold: 0.9, // defaults to 0.1
        asynch: true);
    setState(() {
      _output = recognitions!;
      _loading = true;
    });
    debugPrint("output data is ${_output.toString()}");
  }
</code>```

Error That I am Facing

Exception has occurred.
PlatformException (PlatformException(Failed to run model, Attempt to invoke virtual method 'org.tensorflow.lite.Tensor org.tensorflow.lite.Interpreter.getInputTensor(int)' on a null object reference, java.lang.NullPointerException: Attempt to invoke virtual method 'org.tensorflow.lite.Tensor org.tensorflow.lite.Interpreter.getInputTensor(int)' on a null object reference
    at sq.flutter.flutter_tflite.TflitePlugin.feedInputTensor(TflitePlugin.java:368)
    at sq.flutter.flutter_tflite.TflitePlugin.feedInputTensorImage(TflitePlugin.java:430)
    at sq.flutter.flutter_tflite.TflitePlugin$RunModelOnImage.<init>(TflitePlugin.java:536)
    at sq.flutter.flutter_tflite.TflitePlugin.onMethodCall(TflitePlugin.java:139)
    at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
    at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
    at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
    at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:268)
    at android.app.ActivityThread.main(ActivityThread.java:8101)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:627)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:997)
, null))
```

Body:
I call model from firebase through firebase_ml_model_downloader it work fine but when I try to work with my model through this flutter_tflite it giving error

init model in first screen like this

  /// Initially get the lcoal model if found, and asynchronously get the latest one in background.
  initWithLocalModel() async {
    final _model = await FirebaseModelDownloader.instance.getModel(
        'logos', FirebaseModelDownloadType.localModelUpdateInBackground);

    setState(() {
      model = _model;
    });
  }

Here's how I am trying to make used of my model

  @override
  void initState() {
    //initS is the first function that is executed by default when this class is called
    super.initState();
    loadModel().then((value) {
      setState(() {});
      Future.delayed(
        const Duration(seconds: 3),
        () {
          log(widget.image.path.toString());
          classifyImage(widget.image);
        },
      );
    });
  }

  loadModel() async {
    //this function loads our model
    log(mode);
    try {
      await Tflite.loadModel(
          model: model.file.toString(),

          numThreads: 2, // defaults to 1
          isAsset:
              true, // defaults to true, set to false to load resources outside assets
          useGpuDelegate:
              false // defaults to false, set to true to use GPU delegate
          );
    } on PlatformException {
      debugPrint("Failed to load Model");
    }
  }
  classifyImage(CroppedFile image) async {
    var recognitions = await Tflite.runModelOnImage(
        path: image.path,
        // imageMean: 0.0, // defaults to 117.0
        imageStd: 20.0, // defaults to 1.0
        numResults: 2, // defaults to 5
        threshold: 0.9, // defaults to 0.1
        asynch: true);
    setState(() {
      _output = recognitions!;
      _loading = true;
    });
    debugPrint("output data is ${_output.toString()}");
  }

Error That I am Facing

Exception has occurred.
PlatformException (PlatformException(Failed to run model, Attempt to invoke virtual method 'org.tensorflow.lite.Tensor org.tensorflow.lite.Interpreter.getInputTensor(int)' on a null object reference, java.lang.NullPointerException: Attempt to invoke virtual method 'org.tensorflow.lite.Tensor org.tensorflow.lite.Interpreter.getInputTensor(int)' on a null object reference
    at sq.flutter.flutter_tflite.TflitePlugin.feedInputTensor(TflitePlugin.java:368)
    at sq.flutter.flutter_tflite.TflitePlugin.feedInputTensorImage(TflitePlugin.java:430)
    at sq.flutter.flutter_tflite.TflitePlugin$RunModelOnImage.<init>(TflitePlugin.java:536)
    at sq.flutter.flutter_tflite.TflitePlugin.onMethodCall(TflitePlugin.java:139)
    at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
    at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
    at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
    at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:268)
    at android.app.ActivityThread.main(ActivityThread.java:8101)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:627)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:997)
, null))


问:
How can i get the string description from a device which is on low power mode?
I am working on a C++ application where i retrieve information about devices of a machine, to do this, i get the string descriptors of the devices with the DeviceIoControl function from <ioapiset.h>.

The IOCTL IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION returns with the error "A device attached to the system is not functioning."

My solution worked with almost devices, except by the ones that "current power state" are set to D2. I searched about this power state and it means that the device is in "low power mode" and string descriptors can't be retrieved in devices in this state.

device running at D2/low power mode

There is a way to get string descriptors of a low power mode device in a C++ application?
Also, there is a way to temporaly change the power mode of a device to D0 at program runtime to make the string descriptor retrievable?
Or there is a way that i can change the power state of a device in my computer settings (i'm using windows 10)?
Also, i checked other posts in this community but no one could solve my problem.

I tried to change power config of my machine and disable power-saving mode but nothing worked.


问:
Calculate Standard TAX Rate on all products in shopping bag if company name is filled in WooCommerce
Some of my products are sold without tax. This applies only to private customer(B2C) and not to business to business sales.

Is there a way to set tax of ALL products in the shopping bag to standard tarif WHEN the billing_company field is set?


问:
RSelenium and Rvest to create a table without html_table() from oddsportal.com
Recently, https://www.oddsportal.com/ changed their format. I can no longer use the html_table() to parse the game result table. It seems like the only option here is to use html_text2()and reconstruct the table manually.

```<code>library(RSelenium)
library(rvest)
library(dplyr)
library(stringr)
url_results <- "https://www.oddsportal.com/basketball/australia/nbl/results/"
rD <- rsDriver(port= sample(7600)[1], browser=c("firefox"), chromever = NULL)
  remDr <- rD$client ; remDr$navigate(url_results)
  try(remDr$findElement(using = "xpath", '//*[@id="onetrust-accept-btn-handler"]')$clickElement())
  page <- remDr$getPageSource() ; remDr$close() ; rD$server$stop()

  # R_table <- 0
  # pop <- page[[1]] %>%
  #   read_html() %>%
  #   html_nodes(xpath='//*[@id="tournamentTable"]') %>%
  #   html_table()
  # try(R_table <- pop[[1]])
  # table <- R_table

  R_table <- 0
  pop <- page[[1]] %>%
    read_html() %>%
    html_nodes(xpath=paste0('//*[@id="app"]/div/div[1]/div/main/div[2]/div[7]')) %>%
    html_text2()
  try(R_table <- pop[[1]])
  table <- R_table
</code>```

Would anyone know good ways to reconstruct the table the way the website represents? This is the outcome I used to get before they changed the format by using html_table() :

```<code>V1             V2                                             V3     V4    V5
Today, 10 Jan                                                 1      2     B's
21:30          Perth – New Zealand Breakers 93:90             1.98   1.79  16
19:30          Illawarra Hawks – Tasmania JackJumpers 89:92   3.95   1.24  16
08 Jan 2023                                                   1      2     B's
16:00          Cairns Taipans – South East Melbourne 94:85    1.54   2.43  16
14:00          Adelaide – New Zealand Breakers 83:85          1.91   1.85  16
</code>```

Body:
Recently, https://www.oddsportal.com/ changed their format. I can no longer use the html_table() to parse the game result table. It seems like the only option here is to use html_text2()and reconstruct the table manually.

library(RSelenium)
library(rvest)
library(dplyr)
library(stringr)
url_results <- "https://www.oddsportal.com/basketball/australia/nbl/results/"
rD <- rsDriver(port= sample(7600)[1], browser=c("firefox"), chromever = NULL)
  remDr <- rD$client ; remDr$navigate(url_results)
  try(remDr$findElement(using = "xpath", '//*[@id="onetrust-accept-btn-handler"]')$clickElement())
  page <- remDr$getPageSource() ; remDr$close() ; rD$server$stop()

  # R_table <- 0
  # pop <- page[[1]] %>%
  #   read_html() %>%
  #   html_nodes(xpath='//*[@id="tournamentTable"]') %>%
  #   html_table()
  # try(R_table <- pop[[1]])
  # table <- R_table

  R_table <- 0
  pop <- page[[1]] %>%
    read_html() %>%
    html_nodes(xpath=paste0('//*[@id="app"]/div/div[1]/div/main/div[2]/div[7]')) %>%
    html_text2()
  try(R_table <- pop[[1]])
  table <- R_table

Would anyone know good ways to reconstruct the table the way the website represents? This is the outcome I used to get before they changed the format by using html_table() :

V1             V2                                             V3     V4    V5
Today, 10 Jan                                                 1      2     B's
21:30          Perth – New Zealand Breakers 93:90             1.98   1.79  16
19:30          Illawarra Hawks – Tasmania JackJumpers 89:92   3.95   1.24  16
08 Jan 2023                                                   1      2     B's
16:00          Cairns Taipans – South East Melbourne 94:85    1.54   2.43  16
14:00          Adelaide – New Zealand Breakers 83:85          1.91   1.85  16


问:
Database of my project (donars) is not getting stored on Mongodb,it always shows no connection on the terminal. Help me in finding the error
`//here is my code
const mongoose = require("mongoose");
mongoose.set("strictQuery", false);

mongoose.connect("mongodb://localhost:27017/donars",{

}).then(() => {
console.log(connnection successful);
}).catch((e) => {
console.log(no connection);

});

PS C:\Users\harsh\Downloads\organback\organbackend> npm run dev

organbackend@1.0.0 dev

nodemon src/app.js -e js,hbs

[nodemon] 2.0.20
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): .
[nodemon] watching extensions: js,hbs

[nodemon] starting node src/app.js

server is running at port no 3001
no connection`


问:
how to deny adsbygoogle script to NOT load in site using .htaccess
i have an issue with a bot that hacked my website and injected google ads script.
i have tried to find in the files where the script is located but i had no luck.

i been told to try block the script using .htaccess file, i have read online and tried to make my own code to block the script but no luck again.

this is what i have tried so far :

```<code><Files adsbygoogle.js?client=ca-pub-4262160458050412>
    order deny,allow
    deny from all
</Files>

<Limit GET>
Order allow,deny
Allow from all
deny from https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4262160458050412
deny from https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
</Limit>
</code>```

that is how the script that the bot injected looks like :

```<code><script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4262160458050412" crossorigin="anonymous" data-checked-head="true"></script>
</code>```

can anyone let me know why the script is still loading in my website?

Body:
i have an issue with a bot that hacked my website and injected google ads script.
i have tried to find in the files where the script is located but i had no luck.

i been told to try block the script using .htaccess file, i have read online and tried to make my own code to block the script but no luck again.

this is what i have tried so far :

<Files adsbygoogle.js?client=ca-pub-4262160458050412>
    order deny,allow
    deny from all
</Files>

<Limit GET>
Order allow,deny
Allow from all
deny from https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4262160458050412
deny from https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
</Limit>

that is how the script that the bot injected looks like :

can anyone let me know why the script is still loading in my website?


问:
Error message not appearing on Google Captcha in Laravel application
I am trying to implement a Google Captcha on my Laravel site on the login page. I am using Anam Hossain's Captcha plugin. The captcha appears and allows users to login to the site when it is checked, and prevents users from logging in when it is unchecked, however the error message informing users that they must fill out the captcha doesn't appear.

In my AppServiceProvider I have extended the Validator class to create a rule for 'google-captcha', with a number of error codes in a file 'GoogleRecaptcha.php'. The validator function sits in the LoginController where the rules are added. The captcha itself is displayed in the view, login.blade.php. The validator function is called in AuthenticatesUsers.php.

My code is as follows:

// AppServiceProvider.php

```<code>Validator::extend('google_captcha', function ($attribute, $value, $parameters, $validator){

            $http=Http::asForm()->post(config('google_captcha.gc_verification_url'),[
                'secret' => config('google_captcha.secret_key'),
                'response' =>$value,
            ]);

            if(!$http->object()->success){

                $errorMessage=null;
                collect($http->object()->{"error-codes"})->each(function ($item)use(&$errorMessage){
                    $errorMessage.=config('google_captcha.error_codes')[$item];

                });

                $validator->addReplacer('google_captcha',
                    function($message, $attribute, $rule, $parameters) use ($errorMessage) {
                        return \str_replace(':message', $errorMessage, $message);
                    }
                );
            }
</code>```

// LoginController.php

```<code>
    class LoginController extends Controller
    {
        /*
        |--------------------------------------------------------------------------
        | Login Controller
        |--------------------------------------------------------------------------
        |
        | This controller handles authenticating users for the application and
        | redirecting them to your home screen. The controller uses a trait
        | to conveniently provide its functionality to your applications.
        |
        */

        use AuthenticatesUsers;

        /**
         * Where to redirect users after login.
         *
         * @var string
         */
        protected $redirectTo = RouteServiceProvider::ADMININDEX;

        protected $maxAttempts = 5;

        protected $decayMinutes = 60;

        /**
         * Create a new controller instance.
         *
         * @return void
         */
        public function __construct()
        {
            $this->middleware('guest')->except('logout');
        }

            /**
         * Get a validator for an incoming registration request.
         *
         * @param  array  $data
         * @return \Illuminate\Contracts\Validation\Validator
         */
        public function validator(array $data)
        {
            $messages = [
               'g-recaptcha-response.required' => 'You must complete the captcha',
            ];

            return Validator::make($data, [
                'email' => ['required', 'string', 'email', 'max:255'],
                'password' => ['required', 'string', 'min:8'],
                'g-recaptcha-response' => ['required', 'google_captcha']
            ], $messages);
        }

</code>```

GoogleRecaptcha.php

```<code>    namespace App\Rules;

        use Anam\Captcha\Captcha;
        use Illuminate\Contracts\Validation\Rule;

        class GoogleRecaptcha implements Rule
        {

            /**
             * Determine if the validation rule passes.
             *
             * @param  string  $attribute
             * @param  mixed  $value
             * @return bool
             */
            public function passes($attribute, $value)
            {
                $captcha = new Captcha();
                $response = $captcha->check(request());

                if (! $response->isVerified()) {
                    dd($response->errors());
                }

                return $response->isVerified();
            }

            public function message()
            {
                return 'Please fill out the captcha.';
            }
        }
</code>```

AuthenticatesUsers.php

```<code>
     public function login(Request $request)
        {
            $this->validator($request->all())->validate();

</code>```

login.blade.php

```<code>
    <div class="form-group row">
                                <div class="col-md-6 offset-md-4">
                                    <div class="form-check">
                                        <input class="form-check-input" type="checkbox" name="remember" id="remember" {{ old('remember') ? 'checked' : '' }}>

                                        <label class="form-check-label" for="remember">
                                            {{ __('Remember Me') }}
                                        </label>
                                    </div>
                                </div>
                            </div>

                            @captcha()

                            <div class="form-group row mb-0">
                                <div class="col-md-8 offset-md-4">

</code>```

In GoogleRecaptcha.php do I need to return a value to the view?

Any further info would be appreciated.

Thanks,

Regards,

Robert

Body:
I am trying to implement a Google Captcha on my Laravel site on the login page. I am using Anam Hossain's Captcha plugin. The captcha appears and allows users to login to the site when it is checked, and prevents users from logging in when it is unchecked, however the error message informing users that they must fill out the captcha doesn't appear.

In my AppServiceProvider I have extended the Validator class to create a rule for 'google-captcha', with a number of error codes in a file 'GoogleRecaptcha.php'. The validator function sits in the LoginController where the rules are added. The captcha itself is displayed in the view, login.blade.php. The validator function is called in AuthenticatesUsers.php.

My code is as follows:

// AppServiceProvider.php

Validator::extend('google_captcha', function ($attribute, $value, $parameters, $validator){

            $http=Http::asForm()->post(config('google_captcha.gc_verification_url'),[
                'secret' => config('google_captcha.secret_key'),
                'response' =>$value,
            ]);

            if(!$http->object()->success){

                $errorMessage=null;
                collect($http->object()->{"error-codes"})->each(function ($item)use(&$errorMessage){
                    $errorMessage.=config('google_captcha.error_codes')[$item];

                });

                $validator->addReplacer('google_captcha',
                    function($message, $attribute, $rule, $parameters) use ($errorMessage) {
                        return \str_replace(':message', $errorMessage, $message);
                    }
                );
            }

// LoginController.php

    class LoginController extends Controller
    {
        /*
        |--------------------------------------------------------------------------
        | Login Controller
        |--------------------------------------------------------------------------
        |
        | This controller handles authenticating users for the application and
        | redirecting them to your home screen. The controller uses a trait
        | to conveniently provide its functionality to your applications.
        |
        */

        use AuthenticatesUsers;

        /**
         * Where to redirect users after login.
         *
         * @var string
         */
        protected $redirectTo = RouteServiceProvider::ADMININDEX;

        protected $maxAttempts = 5;

        protected $decayMinutes = 60;

        /**
         * Create a new controller instance.
         *
         * @return void
         */
        public function __construct()
        {
            $this->middleware('guest')->except('logout');
        }

            /**
         * Get a validator for an incoming registration request.
         *
         * @param  array  $data
         * @return \Illuminate\Contracts\Validation\Validator
         */
        public function validator(array $data)
        {
            $messages = [
               'g-recaptcha-response.required' => 'You must complete the captcha',
            ];

            return Validator::make($data, [
                'email' => ['required', 'string', 'email', 'max:255'],
                'password' => ['required', 'string', 'min:8'],
                'g-recaptcha-response' => ['required', 'google_captcha']
            ], $messages);
        }

GoogleRecaptcha.php

    namespace App\Rules;

        use Anam\Captcha\Captcha;
        use Illuminate\Contracts\Validation\Rule;

        class GoogleRecaptcha implements Rule
        {

            /**
             * Determine if the validation rule passes.
             *
             * @param  string  $attribute
             * @param  mixed  $value
             * @return bool
             */
            public function passes($attribute, $value)
            {
                $captcha = new Captcha();
                $response = $captcha->check(request());

                if (! $response->isVerified()) {
                    dd($response->errors());
                }

                return $response->isVerified();
            }

            public function message()
            {
                return 'Please fill out the captcha.';
            }
        }

AuthenticatesUsers.php

     public function login(Request $request)
        {
            $this->validator($request->all())->validate();

login.blade.php

                                        <input class="form-check-input" type="checkbox" name="remember" id="remember" {{ old('remember') ? 'checked' : '' }}>

                                            {{ __('Remember Me') }}

                            @captcha()

In GoogleRecaptcha.php do I need to return a value to the view?

Any further info would be appreciated.

Thanks,

Regards,

Robert


问:
Is it possible to create several UserDetailsService spring security
I found a method that allows me to do what I want but I don't think it's the right method. I have a dto user and a dto admin, when authenticating for email verification with UserDetailService I am unable to verify email for admin because it will verify that in user and return me a reply that the admin does not exist. The only solution I found is with if .
I would like it to browse the userRepository and the adminRepository before returning that the email does not exist. The code below works but it is not the right method. Thank you in advance for your help</p>
```<code>@Service
@RequiredArgsConstructor
public class UserDetailsServiceImpl implements UserDetailsService {

    private final UserRepository userRepository;
    private final AdminRepository adminRepository;

    @Override
    public UserDetails loadUserByUsername(String email) throws UsernameNotFoundException {
        System.out.println(userRepository.findByEmail(email));
        System.out.println(adminRepository.findByEmail(email) + " admin");

        if (!userRepository.findByEmail(email).isEmpty()) {
            return userRepository.findByEmail(email)
                    .orElseThrow(()-> new EntityNotFoundException("Pas d'utilisateur trouvé provenant de cette email"));
        }
        if (!adminRepository.findByEmail(email).isEmpty()) {
            return adminRepository.findByEmail(email)
                    .orElseThrow(()-> new EntityNotFoundException("Pas d'admin trouvé provenant de cette email"));
        }
        return adminRepository.findByEmail(email).orElseThrow(()-> new EntityNotFoundException("aucun user trouvé provenant de cette email"));
    }
}
</code>```

Body:
I found a method that allows me to do what I want but I don't think it's the right method. I have a dto user and a dto admin, when authenticating for email verification with UserDetailService I am unable to verify email for admin because it will verify that in user and return me a reply that the admin does not exist. The only solution I found is with if .
I would like it to browse the userRepository and the adminRepository before returning that the email does not exist. The code below works but it is not the right method. Thank you in advance for your help

@Service
@RequiredArgsConstructor
public class UserDetailsServiceImpl implements UserDetailsService {

    private final UserRepository userRepository;
    private final AdminRepository adminRepository;

    @Override
    public UserDetails loadUserByUsername(String email) throws UsernameNotFoundException {
        System.out.println(userRepository.findByEmail(email));
        System.out.println(adminRepository.findByEmail(email) + " admin");

        if (!userRepository.findByEmail(email).isEmpty()) {
            return userRepository.findByEmail(email)
                    .orElseThrow(()-> new EntityNotFoundException("Pas d'utilisateur trouvé provenant de cette email"));
        }
        if (!adminRepository.findByEmail(email).isEmpty()) {
            return adminRepository.findByEmail(email)
                    .orElseThrow(()-> new EntityNotFoundException("Pas d'admin trouvé provenant de cette email"));
        }
        return adminRepository.findByEmail(email).orElseThrow(()-> new EntityNotFoundException("aucun user trouvé provenant de cette email"));
    }
}


问:
Vue3: How to use Vuelidate v$ object in method
We are currently migrating an externally developed Vue 2 application to Vue 3 to fix issues with deprecated libraries and to be more 'future-proof'. Due to lack of knowledge about the Vue framework and the differences between Vue 2 and 3 (we read the migration guide), we are stuck on the use of the Vuelidate Next library to validate form fields.

We make use of:

Vue 3.2.13

@Vuelidate/core 2.0.0

@vuelidate/validators 2.0.0

The below code describes the situation as created by the original programmers in Vue 2 with minor adjustments. First we import the Vuelidate libraries and the form compoments we want to pass data and validation rules to. Next in setup(), we initiate Vuelidate by calling the useVuelidate hook and binding it to v$. Then in data(), the form fields, based upon a JSON schema, are defined. In validations(), we define a single rule for the 'nameEng' form field. Finally created() calls upon the setValidation method from the methods section.

```<code> <template>
      <div v-if="facility">
        {{  /* When we echo v$ we do get the full object */ }}
        {{ v$ }}

        <form @submit.prevent>
          <component v-for="field in fields" :is="field.type" :key="field.id" :value="facility.fieldValues[field.id]"
            :path="[field.id]" :context="{ resource: 'facilities', institutionId: facility.institutionId }"
            :label="field.label" :fields="field.fields" :editable="editable" v-bind="{ ...field.options }" />
        </form>
      </div>
    </template>

    <script>
    import useVuelidate from '@vuelidate/core';
    import { fetchInstitution } from '@/services/institutionsService';
    import FieldRow from '@/modules/core/components/ui/formElements/FieldRow.vue';
    /* The JSON schema fields aka:
      {
         "general": [
           {
              "type": "FieldRow",
              "id": "nameEng",
              "label": "Facility name (English)",
              "options": {
                 "field": "StringField",
                 "fieldOptions": {
                 "errorMessage": "Please fill in a name for this facility"
              }
           }
        },
      }
    */
    import fields from '../schemas/fields.json';

    export default {
      components: {
        FieldRow,
      },

      props: {
        facility: {
          type: [Object, Array],
        },
        editable: {
          type: Boolean,
          default: false,
        },
      },

      setup() {
        const v$ = useVuelidate();

        return { v$: v$ };
      },

      data() {
        return {
          fields: fields.general,
        };
      },

      validations() {
        return {
          facility: {
            fieldValues: {
              nameEng: {
                required,
              },
            },
          },
        };
      },

      created() {
        this.setValidation();
      },

      methods: {
        setValidation() {
          this.fields = fields.general.map((field) => {
            if (field.options.fieldOptions?.errorMessage) {
              /* Returns empty object: {} */
              console.log(this.v$);

              field.options.fieldOptions.validation = this.v$.facility.fieldValues[field.id];
            }

            return field;
          });
        },
     },
   };
</script>
</code>```

The setValidation method needs to add the validation rules to the data which gets passed on to a form field component as props. However, when trying to access the v$ in the method, it is a completely empty object. We expected to be able to call v$.facility to get the rule set, but this logically results in an undefined. Contrary, when we echo v$ in the HTML template, we do get the full object returned including the facility rule set.

Our questions would be: why can we not use the v$ object in the methods section like this? should this method still be the correct way achieve the desired result in Vue 3?

Thanks in advance!

~ Tom

Body:
We are currently migrating an externally developed Vue 2 application to Vue 3 to fix issues with deprecated libraries and to be more 'future-proof'. Due to lack of knowledge about the Vue framework and the differences between Vue 2 and 3 (we read the migration guide), we are stuck on the use of the Vuelidate Next library to validate form fields.

We make use of:

Vue 3.2.13

@Vuelidate/core 2.0.0

@vuelidate/validators 2.0.0

The below code describes the situation as created by the original programmers in Vue 2 with minor adjustments. First we import the Vuelidate libraries and the form compoments we want to pass data and validation rules to. Next in setup(), we initiate Vuelidate by calling the useVuelidate hook and binding it to v$. Then in data(), the form fields, based upon a JSON schema, are defined. In validations(), we define a single rule for the 'nameEng' form field. Finally created() calls upon the setValidation method from the methods section.

 <template>

        {{  /* When we echo v$ we do get the full object */ }}
        {{ v$ }}

        <form @submit.prevent>
          <component v-for="field in fields" :is="field.type" :key="field.id" :value="facility.fieldValues[field.id]"
            :path="[field.id]" :context="{ resource: 'facilities', institutionId: facility.institutionId }"
            :label="field.label" :fields="field.fields" :editable="editable" v-bind="{ ...field.options }" />
        </form>

    </template>

The setValidation method needs to add the validation rules to the data which gets passed on to a form field component as props. However, when trying to access the v$ in the method, it is a completely empty object. We expected to be able to call v$.facility to get the rule set, but this logically results in an undefined. Contrary, when we echo v$ in the HTML template, we do get the full object returned including the facility rule set.

Our questions would be: why can we not use the v$ object in the methods section like this? should this method still be the correct way achieve the desired result in Vue 3?

Thanks in advance!

~ Tom


问:
Admin dashboard for microservice application
I am working on an admin dashboard for 5 services using Laravel. It is really complicated to do so in admin. We, for example, want to show a list of transactions with user name for each row. Both of the users and transactions tables are in different databases. We had to make another request to fetch the user name form the other service.

I am wondering about when it comes to statistics and writing complex queries to get data from all of theses services in a report. How can I handle such a case?

Can I make multiple connections to the databases with the admin dashboard project?
Is there any available pattern that facilitate the work for me?

Thanks


问:
Cannot find a variant matching build type 'debug' and product flavors '[]' in :app
build.gradle module

`
android {
namespace 'com.bangkit.booking_futsal'
compileSdk 32

```<code>defaultConfig {
    applicationId "com.bangkit.booking_futsal"
    minSdk 21
    targetSdk 32
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
    jvmTarget = '1.8'
}
buildFeatures {
    viewBinding true
}
buildscript {
    repositories {
        maven { url "http://dl.bintray.com/pt-midtrans/maven" }
        maven { url "https://jitpack.io" }
    }
}
productFlavors {
    sandbox {
        buildConfigField "String", "BASE_URL", "\"BASE_URL\""
        buildConfigField "String", "CLIENT_KEY", "\"CLIENT_KEY\""
    }
}
</code>```

}`

i added buildscript and productFlavors in gradle module, but it generates error as shown below.

[error(https://i.stack.imgur.com/dNlHG.png)

Cannot find a variant matching build type 'debug' and product flavors
'[]' in :app

here I use kotlin and android studio dolphin

I expect no errors when syncing the project

Body:
build.gradle module

`
android {
namespace 'com.bangkit.booking_futsal'
compileSdk 32

defaultConfig {
    applicationId "com.bangkit.booking_futsal"
    minSdk 21
    targetSdk 32
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
    jvmTarget = '1.8'
}
buildFeatures {
    viewBinding true
}
buildscript {
    repositories {
        maven { url "http://dl.bintray.com/pt-midtrans/maven" }
        maven { url "https://jitpack.io" }
    }
}
productFlavors {
    sandbox {
        buildConfigField "String", "BASE_URL", "\"BASE_URL\""
        buildConfigField "String", "CLIENT_KEY", "\"CLIENT_KEY\""
    }
}

}`

i added buildscript and productFlavors in gradle module, but it generates error as shown below.

[error(https://i.stack.imgur.com/dNlHG.png)

Cannot find a variant matching build type 'debug' and product flavors
'[]' in :app

here I use kotlin and android studio dolphin

I expect no errors when syncing the project


问:
Django project working on IP address of droplet. But, it does not work on custom domain
I have my domain on GoDaddy and my hosting setup in DigitalOcean. So after I setup my basic django project, I used a droplet to deploy the code to an IP address. When I run this command, my project was running at my [IP_ADDRESS]:8000:

```<code>gunicorn -w 2 -b 0.0.0.0:8000 --chdir /home/USER_NAME/projectdir/test_project test_project.wsgi
</code>```

Then, I put the three digital ocean nameservers in GoDaddy. I also modified the settings.py file by using the ALLOWED_HOSTS variables:

```<code>ALLOWED_HOSTS = ['IP_ADDRESS', 'www.DOMAIN_NAME', 'DOMAIN_NAME']
</code>```

My Nginx configuration looks something like this:

```<code>server {
    listen 8000;
    listen 80;
    server_name IP_ADDRESS DOMAIN_NAME www.DOMAIN_NAME;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/USER_NAME/projectdir;
    }

    location / {
        include proxy_params;
        proxy_pass http://unix:/run/gunicorn.sock;
    }
}
</code>```

But still, I get 'This Site can't be reached'. I also checked that the nameservers have been updated by using https://lookup.icann.org/en. So I don't know where the problem lies. If you need any additional information let me know. Thank you

Body:
I have my domain on GoDaddy and my hosting setup in DigitalOcean. So after I setup my basic django project, I used a droplet to deploy the code to an IP address. When I run this command, my project was running at my [IP_ADDRESS]:8000:

gunicorn -w 2 -b 0.0.0.0:8000 --chdir /home/USER_NAME/projectdir/test_project test_project.wsgi

Then, I put the three digital ocean nameservers in GoDaddy. I also modified the settings.py file by using the ALLOWED_HOSTS variables:

ALLOWED_HOSTS = ['IP_ADDRESS', 'www.DOMAIN_NAME', 'DOMAIN_NAME']

My Nginx configuration looks something like this:

server {
    listen 8000;
    listen 80;
    server_name IP_ADDRESS DOMAIN_NAME www.DOMAIN_NAME;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/USER_NAME/projectdir;
    }

    location / {
        include proxy_params;
        proxy_pass http://unix:/run/gunicorn.sock;
    }
}

But still, I get 'This Site can't be reached'. I also checked that the nameservers have been updated by using https://lookup.icann.org/en. So I don't know where the problem lies. If you need any additional information let me know. Thank you


问:
My code never reaches the protocol stub of my delegate class
I'm new on iOS development, I'm making an IoT app using the TuyaSDK (I've already done the Android version of the App), the problem comes when I pair the device, it uses a delegate to listen wether the device is or isn't successfully paired. I can pair the device but it seems that my code never reaches the protocol of my delegate.
This is my code:

```<code>    import SwiftUI
    import TuyaSmartHomeKit
    import TuyaSmartDeviceKit
    import Toast
    import TuyaSmartActivatorKit

    struct HomeDevices: View{

        @State var homeId: Int64 = 0
        @State var token: String = ""
        @State var devId: String = ""
        @State var device: TuyaSmartDevice?

        let homeManager: TuyaSmartHomeManager = TuyaSmartHomeManager()

        var body: some View {
            VStack{
                Button("Crear casa"){
                    addHome()
                }.font(.title2)
                    .fontWeight(.bold)
                    .frame(width:150, height:20)
                    .foregroundColor(.white)
                    .padding()
                    .background(Color("colorbotones"))
                    .cornerRadius(16)
                    .shadow(color: .gray, radius: 5, x: 0, y: 5)
                    .offset(y:-100)
                Button("Encender"){

                    publishDps(estado : true)
                }.font(.title2)
                    .fontWeight(.bold)
                    .frame(width:150, height:20)
                    .foregroundColor(.white)
                    .padding()
                    .background(Color("colorbotones"))
                    .cornerRadius(16)
                    .shadow(color: .gray, radius: 5, x: 0, y: 5)
                    .offset(y:30)

                Button("Apagar"){

                    publishDps(estado : false)
                }.font(.title2)
                    .fontWeight(.bold)
                    .frame(width:150, height:20)
                    .foregroundColor(.white)
                    .padding()
                    .background(Color("colorbotones"))
                    .cornerRadius(16)
                    .shadow(color: .gray, radius: 5, x: 0, y: 5)
                    .offset(y:90)

            }

        }

        func addHome() {
            homeManager.addHome(withName: "Home",
                                geoName: "Bolivia",
                                rooms: ["Quantum"],
                                latitude: 0,
                                longitude: 0,
                                success: { (homeId) in
                // The value of `homeId` for the home.
                print("add home success")
                print(homeId)
                getToken(homeId: homeId)
            }) { (error) in
                if let e = error {
                    print("add home failure: \(e)")
                }
            }
        }

        func getToken(homeId : Int64){
            TuyaSmartActivator.sharedInstance()?.getTokenWithHomeId(homeId, success: { (token)      in
                print("getToken success: \(String(describing: token))")
                startConfigWiFi(token: token!)
                // TODO: startConfigWiFi
            }, failure: { (error) in
                if let e = error {
                    print(homeId)
                    print("getToken failure: \(e)")
                }
            })
        }
    func startConfigWiFi(token: String) {
        let delegate = tuyaSmartActivatorDelegate.init()
        delegate.StartSync(token: token)
    }

        func publishDps(estado : Bool) {
            device = TuyaSmartDevice(deviceId: "eb153db66617bd33e5dvi1") //I'm manually passing the deviceID

            let dps = ["1" : estado]
            device?.publishDps(dps, success: {
                 print("publishDps success")

                // The DP is sent and the callback of status reporting is implemented with the    `deviceDpsUpdate` method.
            }, failure: { (error) in
                if let e = error {
                    print("publishDps failure: \(e)")
                }
            })
        }

    }

    struct HomeDevices_Previews: PreviewProvider {
        static var previews: some View {
            HomeDevices()
        }
    }
class tuyaSmartActivatorDelegate: NSObject, TuyaSmartActivatorDelegate {
    override init() {
   super.init()
        TuyaSmartActivator.sharedInstance().delegate = self

     }
    func StartSync(token:String){
        TuyaSmartActivator.sharedInstance()?.startConfigWiFi(TYActivatorModeEZ, ssid: "QUANTUM", password: "almacenqnt22*", token: token, timeout: 1000)
        }

    //MARK: - TuyaSmartActivatorDelegate
//My code never reaches this protocol stub//
    func activator(_ activator: TuyaSmartActivator!, didReceiveDevice deviceModel: TuyaSmartDeviceModel!, error: Swift.Error!) {
        print("Anything")
    }

    }

</code>```

I've tried calling the protocol manually like this:
example on how I tried to force the code to enter the protocol of the delegate
what I'm expecting is to get a response from the "func activator()" in order to know if the device was paired or not.
Something like this:

```<code>func activator(_ activator: TuyaSmartActivator!, didReceiveDevice deviceModel: TuyaSmartDeviceModel!, error: Error!) {
    if deviceModel != nil && error == nil {
        // The device is paired.
        //Do something
    }

    if let e = error {
        // Failed to pair the device.
        print("\(e)")
    }
}
</code>```

accordind to the samples provided by Tuya IoT platform, it should work without manually calling the "fun activator()"

Body:
I'm new on iOS development, I'm making an IoT app using the TuyaSDK (I've already done the Android version of the App), the problem comes when I pair the device, it uses a delegate to listen wether the device is or isn't successfully paired. I can pair the device but it seems that my code never reaches the protocol of my delegate.
This is my code:

    import SwiftUI
    import TuyaSmartHomeKit
    import TuyaSmartDeviceKit
    import Toast
    import TuyaSmartActivatorKit

    struct HomeDevices: View{

        @State var homeId: Int64 = 0
        @State var token: String = ""
        @State var devId: String = ""
        @State var device: TuyaSmartDevice?

        let homeManager: TuyaSmartHomeManager = TuyaSmartHomeManager()

        var body: some View {
            VStack{
                Button("Crear casa"){
                    addHome()
                }.font(.title2)
                    .fontWeight(.bold)
                    .frame(width:150, height:20)
                    .foregroundColor(.white)
                    .padding()
                    .background(Color("colorbotones"))
                    .cornerRadius(16)
                    .shadow(color: .gray, radius: 5, x: 0, y: 5)
                    .offset(y:-100)
                Button("Encender"){

                    publishDps(estado : true)
                }.font(.title2)
                    .fontWeight(.bold)
                    .frame(width:150, height:20)
                    .foregroundColor(.white)
                    .padding()
                    .background(Color("colorbotones"))
                    .cornerRadius(16)
                    .shadow(color: .gray, radius: 5, x: 0, y: 5)
                    .offset(y:30)

                Button("Apagar"){

                    publishDps(estado : false)
                }.font(.title2)
                    .fontWeight(.bold)
                    .frame(width:150, height:20)
                    .foregroundColor(.white)
                    .padding()
                    .background(Color("colorbotones"))
                    .cornerRadius(16)
                    .shadow(color: .gray, radius: 5, x: 0, y: 5)
                    .offset(y:90)

            }

        }

        func addHome() {
            homeManager.addHome(withName: "Home",
                                geoName: "Bolivia",
                                rooms: ["Quantum"],
                                latitude: 0,
                                longitude: 0,
                                success: { (homeId) in
                // The value of `homeId` for the home.
                print("add home success")
                print(homeId)
                getToken(homeId: homeId)
            }) { (error) in
                if let e = error {
                    print("add home failure: \(e)")
                }
            }
        }

        func getToken(homeId : Int64){
            TuyaSmartActivator.sharedInstance()?.getTokenWithHomeId(homeId, success: { (token)      in
                print("getToken success: \(String(describing: token))")
                startConfigWiFi(token: token!)
                // TODO: startConfigWiFi
            }, failure: { (error) in
                if let e = error {
                    print(homeId)
                    print("getToken failure: \(e)")
                }
            })
        }
    func startConfigWiFi(token: String) {
        let delegate = tuyaSmartActivatorDelegate.init()
        delegate.StartSync(token: token)
    }

        func publishDps(estado : Bool) {
            device = TuyaSmartDevice(deviceId: "eb153db66617bd33e5dvi1") //I'm manually passing the deviceID

            let dps = ["1" : estado]
            device?.publishDps(dps, success: {
                 print("publishDps success")

                // The DP is sent and the callback of status reporting is implemented with the    `deviceDpsUpdate` method.
            }, failure: { (error) in
                if let e = error {
                    print("publishDps failure: \(e)")
                }
            })
        }

    }

    struct HomeDevices_Previews: PreviewProvider {
        static var previews: some View {
            HomeDevices()
        }
    }
class tuyaSmartActivatorDelegate: NSObject, TuyaSmartActivatorDelegate {
    override init() {
   super.init()
        TuyaSmartActivator.sharedInstance().delegate = self

     }
    func StartSync(token:String){
        TuyaSmartActivator.sharedInstance()?.startConfigWiFi(TYActivatorModeEZ, ssid: "QUANTUM", password: "almacenqnt22*", token: token, timeout: 1000)
        }

    //MARK: - TuyaSmartActivatorDelegate
//My code never reaches this protocol stub//
    func activator(_ activator: TuyaSmartActivator!, didReceiveDevice deviceModel: TuyaSmartDeviceModel!, error: Swift.Error!) {
        print("Anything")
    }

    }

I've tried calling the protocol manually like this:
example on how I tried to force the code to enter the protocol of the delegate
what I'm expecting is to get a response from the "func activator()" in order to know if the device was paired or not.
Something like this:

func activator(_ activator: TuyaSmartActivator!, didReceiveDevice deviceModel: TuyaSmartDeviceModel!, error: Error!) {
    if deviceModel != nil && error == nil {
        // The device is paired.
        //Do something
    }

    if let e = error {
        // Failed to pair the device.
        print("\(e)")
    }
}

accordind to the samples provided by Tuya IoT platform, it should work without manually calling the "fun activator()"


问:
Masking the input to model as a graph
I was wondering if it is possible to mask the input in order to get attention like in GNNs. Specifically, if there was a way to send an attention mask in 2D we could tell a token to attend just to its neighbours and not the other tokens. Is this behaviour possible for example using a pretrained language model from Huggingface?</p>

Title: Masking the input to model as a graph


问:
Inorder to avoid redundancy in CSS code in an Angular App among the various parent child components, what solution is possible?
I am working on an Angular application that has multiple parent and child components. Now from the point of view of code optimization and performance, in parent and child CSS files many classes and other CSS attributes are redundant. I require suggestions through which this code redundancy can be avoided in CSS files across different components and code reusability in CSS files can be established.</p>


问:
how to create registration with email and password using next auth and postgresql without prisma
i can't create registration form with email and password (Two Factor Authentication)

i try using next-auth and prisma for connectiong to postgres database but i can't put email and password or username and another informations to database and after all check with next auth


问:
Narrow generic self with TypeGuard
I have a class which is generic and has some runtime marker for determining the underlying type. I would like to use that marker to guide MyPy in validating the implementation of the class. So I'd like to have a TypeGuard which checks it's generic in A (that is, TypeVar T is bound to A), and therefore it is safe for the method which is annotated as returning a T to return an A in that context.

Minimal example:

```<code>from typing import Generic, Literal, overload, TypeVar
from typing_extensions import TypeGuard

class A: ...
class B: ...
AB_T = TypeVar("AB_T", A, B)

class Gen(Generic[AB_T]):
    # These two overloads ensure that the marker matches the generic type
    @overload
    def __init__(self: "Gen[A]", should_be_A: Literal[True]) -> None:
        ...

    @overload
    def __init__(self: "Gen[B]", should_be_A: Literal[False]) -> None:
        ...

    def __init__(self: "Gen[AB_T]", should_be_A: bool) -> None:
        self._should_be_A = should_be_A

    def res(self) -> AB_T:
        # This should return A() for a Gen[A] and B() for a Gen[B]
        if Gen.gives_A(self): # This calling convention seems to be needed to narrow self
            reveal_type(self) # and it now correctly understands that self is a Gen[A]
            return A() # But this still complains about the scenario where self is a Gen[B]
        elif Gen.gives_B(self):
            reveal_type(self)
            res: AB_T = B() # This also complains about the scenario where AB_T is A.
            return res
        else:
            assert False

    def gives_A(self) -> "TypeGuard[Gen[A]]":
        return self._should_be_A

    def gives_B(self) -> "TypeGuard[Gen[B]]":
        return not self._should_be_A
</code>```

Is there any way to convince MyPy that narrowing self in this way should be understood to also narrow AB_T?

Title: Narrow generic self with TypeGuard

Body:
I have a class which is generic and has some runtime marker for determining the underlying type. I would like to use that marker to guide MyPy in validating the implementation of the class. So I'd like to have a TypeGuard which checks it's generic in A (that is, TypeVar T is bound to A), and therefore it is safe for the method which is annotated as returning a T to return an A in that context.

Minimal example:

from typing import Generic, Literal, overload, TypeVar
from typing_extensions import TypeGuard

class A: ...
class B: ...
AB_T = TypeVar("AB_T", A, B)

class Gen(Generic[AB_T]):
    # These two overloads ensure that the marker matches the generic type
    @overload
    def __init__(self: "Gen[A]", should_be_A: Literal[True]) -> None:
        ...

    @overload
    def __init__(self: "Gen[B]", should_be_A: Literal[False]) -> None:
        ...

    def __init__(self: "Gen[AB_T]", should_be_A: bool) -> None:
        self._should_be_A = should_be_A

    def res(self) -> AB_T:
        # This should return A() for a Gen[A] and B() for a Gen[B]
        if Gen.gives_A(self): # This calling convention seems to be needed to narrow self
            reveal_type(self) # and it now correctly understands that self is a Gen[A]
            return A() # But this still complains about the scenario where self is a Gen[B]
        elif Gen.gives_B(self):
            reveal_type(self)
            res: AB_T = B() # This also complains about the scenario where AB_T is A.
            return res
        else:
            assert False

    def gives_A(self) -> "TypeGuard[Gen[A]]":
        return self._should_be_A

    def gives_B(self) -> "TypeGuard[Gen[B]]":
        return not self._should_be_A

Is there any way to convince MyPy that narrowing self in this way should be understood to also narrow AB_T?


问:
pip3.10 issue - wrong destination
I reacently tried upgrading to python3.11, but because there were some problems so I went back to 3.10. But since I got 3.11 pip3.10 changed the destination directoy. So now it installs the packages for 3.11 (/Library/Frameworks/Python.framework/Versions/3.11/bin/pip3.10). how can I fix this?

I tried reinstalling pip3.10 and uninstalling python3.11 but all stayed the same

Any advice is appreceated <3

Title: pip3.10 issue - wrong destination


问:
fpdf html table text break into cell not work
i'm using fpdf library with html table class that give me the possibility to write table with table tr and td

how is possible to write two value into same cell of html table? i tryed with br and \n but not work.

this is my code

```<code>$html = "
<table border='1'>
<tr>
<td width='240' height='90'>$detail[name] $detail[vase] $detail[quality]</td>
<td width='70' height='90'>$logistic_date</td>
<td width='70' height='90'>$detail[lot]</td>
<td width='60' height='90'>$warehouse</td>
<td width='220' height='90'>$detail[note]</td>
<td width='50' height='90'>$detail[qxb_def]</td>
<td width='50' height='90'>$detail[quantity_def]</td>
</tr>
</table>";

    $pdf->WriteHTML($html);
}

$pdf->Output();
</code>```

i need to show

```<code><td>
$detail[name]
$detail[vase]
$detail[quality]
</td>
</code>```

Body:
i'm using fpdf library with html table class that give me the possibility to write table with table tr and td

how is possible to write two value into same cell of html table? i tryed with br and \n but not work.

this is my code

$html = "

$detail[name] $detail[vase] $detail[quality]
$logistic_date
$detail[lot]
$warehouse
$detail[note]
$detail[qxb_def]
$detail[quantity_def]

";

    $pdf->WriteHTML($html);
}

$pdf->Output();

i need to show

$detail[name]
$detail[vase]
$detail[quality]


问:
ΜongoDB PHP, Error: Call to undefined method MongoDB\Driver\Manager::getEncryptedFieldsMap()
I am trying to create a collection on my MongoDB database using PHP but I am getting the following error

*Uncaught Error: Call to undefined method MongoDB\Driver\Manager::getEncryptedFieldsMap() *

I have downloaded and added the MongoDB PHP Driver, via the php_mongodb.ddl file (have made sure to download the correct driver version for my php version), and have added the MongoDB PHP Library via Composer using the composer require jenssegers/mongodb --ignore-platform-reqs, all with no errors.

My code is the following:

```<code><?php

require 'vendor/autoload.php';

$client = new MongoDB\Client("mongodb://127.0.0.1/");

echo "connected succ <br><br>";

$db = $client->webVacSer;

echo "db sellected successfully <br><br>";

$collection = $db->createCollection("customers");
echo "collection created successfully <br><br>";

?>

</code>```

What is wrong?

Body:
I am trying to create a collection on my MongoDB database using PHP but I am getting the following error

*Uncaught Error: Call to undefined method MongoDB\Driver\Manager::getEncryptedFieldsMap() *

I have downloaded and added the MongoDB PHP Driver, via the php_mongodb.ddl file (have made sure to download the correct driver version for my php version), and have added the MongoDB PHP Library via Composer using the composer require jenssegers/mongodb --ignore-platform-reqs, all with no errors.

My code is the following:

<?php

require 'vendor/autoload.php';

$client = new MongoDB\Client("mongodb://127.0.0.1/");

echo "connected succ

";

$db = $client->webVacSer;

echo "db sellected successfully

";

$collection = $db->createCollection("customers");
echo "collection created successfully

";

?>

What is wrong?


问:
Realm XCFramework nested in another XCFramework error
I'm trying to use a XCFramework built with a private pod, that have another public dependencies inside. In that dependencies, all of them seem to work fine, except RealmSwift. When I try to import the XCFramework I built in my class, the following errors appear:

'RealmSwiftObject' is not a member type of struct 'RealmSwift.Realm'

'RealmSwiftObject' is not a member type of struct 'RealmSwift.Realm'

'RealmSwiftObject' is not a member type of struct 'RealmSwift.Realm'

Type 'Element' does not conform to protocol 'RealmCollectionValue'

'RealmSwiftObject' is not a member type of struct
'RealmSwift.Realm'

'RealmSwiftObject' is not a member type of struct 'RealmSwift.Realm'

'RealmSwiftObject' is not a member type of struct 'RealmSwift.Realm'

'RealmSwiftObject' is not a member type of struct 'RealmSwift.Realm'

I have been searching but I don't know why this error is showing because it doesn't seem like it has anything related to my problem, but I ran out of ideas.

I have tried install Realm both by Cocoapods and XCFramework. Same result


问:
SLF4J multiple bindings Spring boot with weblogic
I updated my spring boot application version to 5.3.24, and I excluded the logback from all dependencies, I checked it with dependency:tree

```<code>[INFO] |  +- org.springframework.boot:spring-boot-starter:jar:2.2.1.RELEASE:compile
[INFO] |  |  \- org.yaml:snakeyaml:jar:1.25:runtime
[INFO] |  +- org.springframework.boot:spring-boot-starter-json:jar:2.2.1.RELEASE:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.10.0:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.10.0:compile
[INFO] |  |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.10.0:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-validation:jar:2.2.1.RELEASE:compile
[INFO] |  |  +- jakarta.validation:jakarta.validation-api:jar:2.0.1:compile
[INFO] |  |  \- org.hibernate.validator:hibernate-validator:jar:6.0.18.Final:compile
[INFO] |  +- org.springframework:spring-web:jar:5.2.1.RELEASE:compile
[INFO] |  \- org.springframework:spring-webmvc:jar:5.2.1.RELEASE:compile
[INFO] |     +- org.springframework:spring-aop:jar:5.2.1.RELEASE:compile
[INFO] |     \- org.springframework:spring-expression:jar:5.2.1.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.2.1.RELEASE:provided
[INFO] |  +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.27:provided
[INFO] |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.27:provided
[INFO] |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.27:provided
[INFO] +- org.springframework.boot:spring-boot-starter-integration:jar:2.2.1.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-aop:jar:2.2.1.RELEASE:compile
[INFO] |  |  \- org.aspectj:aspectjweaver:jar:1.9.4:compile
[INFO] |  \- org.springframework.integration:spring-integration-core:jar:5.2.1.RELEASE:compile
[INFO] |     +- io.projectreactor:reactor-core:jar:3.3.0.RELEASE:compile
[INFO] |     |  \- org.reactivestreams:reactive-streams:jar:1.0.3:compile
[INFO] |     \- org.springframework.retry:spring-retry:jar:1.2.4.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.2.1.RELEASE:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:2.2.1.RELEASE:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.2.1.RELEASE:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.4.0:test
[INFO] |  |  \- net.minidev:json-smart:jar:2.3:test
[INFO] |  |     \- net.minidev:accessors-smart:jar:1.2:test
[INFO] |  |        \- org.ow2.asm:asm:jar:5.0.4:test
[INFO] |  +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.2:compile
[INFO] |  +- org.junit.jupiter:junit-jupiter:jar:5.5.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-api:jar:5.5.2:test
[INFO] |  |  |  +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] |  |  |  \- org.junit.platform:junit-platform-commons:jar:1.5.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-params:jar:5.5.2:test
[INFO] |  |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.5.2:test
[INFO] |  +- org.junit.vintage:junit-vintage-engine:jar:5.5.2:test
[INFO] |  |  +- org.apiguardian:apiguardian-api:jar:1.1.0:test
[INFO] |  |  +- org.junit.platform:junit-platform-engine:jar:1.5.2:test
[INFO] |  |  \- junit:junit:jar:4.12:test
[INFO] |  +- org.mockito:mockito-junit-jupiter:jar:3.1.0:test
[INFO] |  +- org.assertj:assertj-core:jar:3.13.2:test
[INFO] |  +- org.hamcrest:hamcrest:jar:2.1:test
[INFO] |  +- org.mockito:mockito-core:jar:3.1.0:test
[INFO] |  |  +- net.bytebuddy:byte-buddy:jar:1.10.2:compile
[INFO] |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.10.2:test
[INFO] |  |  \- org.objenesis:objenesis:jar:2.6:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.5.0:test
[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] |  +- org.springframework:spring-core:jar:5.2.1.RELEASE:compile
[INFO] |  +- org.springframework:spring-test:jar:5.2.1.RELEASE:test
[INFO] |  \- org.xmlunit:xmlunit-core:jar:2.6.3:test
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:2.2.1.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.2.1.RELEASE:compile
[INFO] |  |  +- com.zaxxer:HikariCP:jar:3.4.1:compile
[INFO] |  |  \- org.springframework:spring-jdbc:jar:5.2.1.RELEASE:compile
[INFO] |  +- jakarta.activation:jakarta.activation-api:jar:1.2.1:compile
[INFO] |  +- jakarta.persistence:jakarta.persistence-api:jar:2.2.3:compile
[INFO] |  +- jakarta.transaction:jakarta.transaction-api:jar:1.3.3:compile
[INFO] |  +- org.hibernate:hibernate-core:jar:5.4.8.Final:compile
[INFO] |  |  +- org.jboss.logging:jboss-logging:jar:3.4.1.Final:compile
[INFO] |  |  +- org.javassist:javassist:jar:3.24.0-GA:compile
[INFO] |  |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  |  +- org.jboss:jandex:jar:2.0.5.Final:compile
[INFO] |  |  +- org.dom4j:dom4j:jar:2.1.1:compile
[INFO] |  |  +- org.hibernate.common:hibernate-commons-annotations:jar:5.1.0.Final:compile
[INFO] |  |  \- org.glassfish.jaxb:jaxb-runtime:jar:2.3.2:compile
[INFO] |  |     +- org.glassfish.jaxb:txw2:jar:2.3.2:compile
[INFO] |  |     +- com.sun.istack:istack-commons-runtime:jar:3.0.8:compile
[INFO] |  |     +- org.jvnet.staxex:stax-ex:jar:1.8.1:compile
[INFO] |  |     \- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.16:compile
[INFO] |  +- org.springframework.data:spring-data-jpa:jar:2.2.1.RELEASE:compile
[INFO] |  |  +- org.springframework.data:spring-data-commons:jar:2.2.1.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-orm:jar:5.2.1.RELEASE:compile
[INFO] |  \- org.springframework:spring-aspects:jar:5.2.1.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-log4j2:jar:2.2.1.RELEASE:compile
[INFO] |  +- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.12.1:compile
[INFO] |  |  +- org.slf4j:slf4j-api:jar:1.7.29:compile
[INFO] |  |  \- org.apache.logging.log4j:log4j-api:jar:2.12.1:compile
[INFO] |  +- org.apache.logging.log4j:log4j-core:jar:2.12.1:compile
[INFO] |  +- org.apache.logging.log4j:log4j-jul:jar:2.12.1:compile
[INFO] |  \- org.slf4j:jul-to-slf4j:jar:1.7.29:compile
[INFO] +- com.lmax:disruptor:jar:3.4.2:compile
[INFO] +- commons-codec:commons-codec:jar:1.13:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.9:compile
[INFO] +- com.oracle.ojdbc:ojdbc8:jar:19.3.0.0:compile
[INFO] |  +- com.oracle.ojdbc:ucp:jar:19.3.0.0:compile
[INFO] |  +- com.oracle.ojdbc:oraclepki:jar:19.3.0.0:compile
[INFO] |  +- com.oracle.ojdbc:osdt_cert:jar:19.3.0.0:compile
[INFO] |  +- com.oracle.ojdbc:osdt_core:jar:19.3.0.0:compile
[INFO] |  +- com.oracle.ojdbc:simplefan:jar:19.3.0.0:compile
[INFO] |  \- com.oracle.ojdbc:ons:jar:19.3.0.0:compile
[INFO] +- org.springframework.boot:spring-boot-devtools:jar:2.2.1.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot:jar:2.2.1.RELEASE:compile
[INFO] |  \- org.springframework.boot:spring-boot-autoconfigure:jar:2.2.1.RELEASE:compile
[INFO] +- org.apache.httpcomponents:httpclient:jar:4.5.10:compile
[INFO] |  \- org.apache.httpcomponents:httpcore:jar:4.4.12:compile
[INFO] +- org.springframework:spring-context-support:jar:5.2.1.RELEASE:compile
[INFO] |  +- org.springframework:spring-beans:jar:5.2.1.RELEASE:compile
[INFO] |  \- org.springframework:spring-context:jar:5.2.1.RELEASE:compile
[INFO] +- io.springfox:springfox-swagger2:jar:2.6.1:compile
[INFO] |  +- io.swagger:swagger-annotations:jar:1.5.10:compile
[INFO] |  +- io.swagger:swagger-models:jar:1.5.10:compile
[INFO] |  |  \- com.fasterxml.jackson.core:jackson-annotations:jar:2.10.0:compile
[INFO] |  +- io.springfox:springfox-spi:jar:2.6.1:compile
[INFO] |  |  \- io.springfox:springfox-core:jar:2.6.1:compile
[INFO] |  +- io.springfox:springfox-schema:jar:2.6.1:compile
[INFO] |  +- io.springfox:springfox-swagger-common:jar:2.6.1:compile
[INFO] |  +- io.springfox:springfox-spring-web:jar:2.6.1:compile
[INFO] |  +- com.google.guava:guava:jar:18.0:compile
[INFO] |  +- com.fasterxml:classmate:jar:1.5.1:compile
[INFO] |  +- org.springframework.plugin:spring-plugin-core:jar:1.2.0.RELEASE:compile
[INFO] |  +- org.springframework.plugin:spring-plugin-metadata:jar:1.2.0.RELEASE:compile
[INFO] |  \- org.mapstruct:mapstruct:jar:1.0.0.Final:compile
[INFO] +- io.springfox:springfox-swagger-ui:jar:2.6.1:compile
[INFO] +- net.sf.ehcache:ehcache:jar:2.9.0:compile
[INFO] +- com.cccis.framework:bamlogger-weblogic:jar:1.0.1:compile
[INFO] |  \- javax.jms:javax.jms-api:jar:2.0.1:compile
[INFO] +- org.springframework:spring-jms:jar:5.2.1.RELEASE:compile
[INFO] |  +- org.springframework:spring-messaging:jar:5.2.1.RELEASE:compile
[INFO] |  \- org.springframework:spring-tx:jar:5.2.1.RELEASE:compile
[INFO] +- com.cccis.common:common-objects:jar:0.0.6:compile
[INFO] |  \- com.fasterxml.jackson.core:jackson-databind:jar:2.10.0:compile
[INFO] |     \- com.fasterxml.jackson.core:jackson-core:jar:2.10.0:compile
[INFO] +- com.google.code.gson:gson:jar:2.8.6:compile
[INFO] +- com.cccis.framework:framework-dataobjects:jar:10.3.189:compile
[INFO] |  +- com.cccis.framework:framework-core:jar:10.3.189:compile
[INFO] |  |  \- net.sf.ehcache:ehcache-core:jar:2.5.1:compile
[INFO] |  +- axis:axis:jar:1.2:compile
[INFO] |  +- com.cccis.servicepower:sp-client:jar:2.12.0:compile
[INFO] |  +- com.cccis.stdvehicle:vinservice-common:jar:0.0.23:compile
[INFO] |  |  \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.9:compile
[INFO] |  |     \- org.codehaus.jackson:jackson-core-asl:jar:1.9.9:compile
[INFO] |  \- com.cccis.framework:simple-storage:jar:0.0.7:compile
[INFO] |     +- com.fasterxml.uuid:java-uuid-generator:jar:3.1.3:compile
[INFO] |     +- org.restlet.jee:org.restlet.ext.httpclient:jar:2.3.1:compile
[INFO] |     |  +- org.apache.httpcomponents:httpmime:jar:4.5.10:compile
[INFO] |     |  +- net.jcip:jcip-annotations:jar:1.0:compile
[INFO] |     |  +- org.apache.james:apache-mime4j-core:jar:0.7.2:compile
[INFO] |     |  \- org.restlet.jee:org.restlet:jar:2.3.1:compile
[INFO] |     +- org.restlet.jse:org.restlet.ext.json:jar:2.3.1:compile
[INFO] |     |  +- org.restlet.jse:org.restlet.lib.org.json:jar:2.0:compile
[INFO] |     |  \- org.restlet.jse:org.restlet:jar:2.3.1:compile
[INFO] |     +- commons-io:commons-io:jar:1.3.2:compile
[INFO] |     \- com.amazonaws:aws-java-sdk-s3:jar:1.10.50:compile
[INFO] |        +- com.amazonaws:aws-java-sdk-kms:jar:1.10.50:compile
[INFO] |        \- com.amazonaws:aws-java-sdk-core:jar:1.10.50:compile
[INFO] |           \- joda-time:joda-time:jar:2.10.5:compile
[INFO] \- com.cccis.frm.journal:journal-logger:jar:5.0.16:compile
[INFO]    \- com.cccis.frm.journal:ejb_journal_client:jar:5.0.16:compile
[INFO]       \- com.cccis.framework:framework-interfaces:jar:10.3.49:compile
[INFO] ------------------------------------------------------------------------
</code>```

But After I rebuild my appliation I got the SLF4J multiple bindings and with logback

[ERROR] SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/gtth/.m2/repository/ch/qos/logback/logback-classic/1.0.13/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/gtth/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.12.1/log4j-slf4j-impl-2.12.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

I did everything, shall the Spring be bugged? :(

What can i do?

Body:
I updated my spring boot application version to 5.3.24, and I excluded the logback from all dependencies, I checked it with dependency:tree

[INFO] |  +- org.springframework.boot:spring-boot-starter:jar:2.2.1.RELEASE:compile
[INFO] |  |  \- org.yaml:snakeyaml:jar:1.25:runtime
[INFO] |  +- org.springframework.boot:spring-boot-starter-json:jar:2.2.1.RELEASE:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.10.0:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.10.0:compile
[INFO] |  |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.10.0:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-validation:jar:2.2.1.RELEASE:compile
[INFO] |  |  +- jakarta.validation:jakarta.validation-api:jar:2.0.1:compile
[INFO] |  |  \- org.hibernate.validator:hibernate-validator:jar:6.0.18.Final:compile
[INFO] |  +- org.springframework:spring-web:jar:5.2.1.RELEASE:compile
[INFO] |  \- org.springframework:spring-webmvc:jar:5.2.1.RELEASE:compile
[INFO] |     +- org.springframework:spring-aop:jar:5.2.1.RELEASE:compile
[INFO] |     \- org.springframework:spring-expression:jar:5.2.1.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.2.1.RELEASE:provided
[INFO] |  +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.27:provided
[INFO] |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.27:provided
[INFO] |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.27:provided
[INFO] +- org.springframework.boot:spring-boot-starter-integration:jar:2.2.1.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-aop:jar:2.2.1.RELEASE:compile
[INFO] |  |  \- org.aspectj:aspectjweaver:jar:1.9.4:compile
[INFO] |  \- org.springframework.integration:spring-integration-core:jar:5.2.1.RELEASE:compile
[INFO] |     +- io.projectreactor:reactor-core:jar:3.3.0.RELEASE:compile
[INFO] |     |  \- org.reactivestreams:reactive-streams:jar:1.0.3:compile
[INFO] |     \- org.springframework.retry:spring-retry:jar:1.2.4.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.2.1.RELEASE:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:2.2.1.RELEASE:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.2.1.RELEASE:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.4.0:test
[INFO] |  |  \- net.minidev:json-smart:jar:2.3:test
[INFO] |  |     \- net.minidev:accessors-smart:jar:1.2:test
[INFO] |  |        \- org.ow2.asm:asm:jar:5.0.4:test
[INFO] |  +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.2:compile
[INFO] |  +- org.junit.jupiter:junit-jupiter:jar:5.5.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-api:jar:5.5.2:test
[INFO] |  |  |  +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] |  |  |  \- org.junit.platform:junit-platform-commons:jar:1.5.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-params:jar:5.5.2:test
[INFO] |  |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.5.2:test
[INFO] |  +- org.junit.vintage:junit-vintage-engine:jar:5.5.2:test
[INFO] |  |  +- org.apiguardian:apiguardian-api:jar:1.1.0:test
[INFO] |  |  +- org.junit.platform:junit-platform-engine:jar:1.5.2:test
[INFO] |  |  \- junit:junit:jar:4.12:test
[INFO] |  +- org.mockito:mockito-junit-jupiter:jar:3.1.0:test
[INFO] |  +- org.assertj:assertj-core:jar:3.13.2:test
[INFO] |  +- org.hamcrest:hamcrest:jar:2.1:test
[INFO] |  +- org.mockito:mockito-core:jar:3.1.0:test
[INFO] |  |  +- net.bytebuddy:byte-buddy:jar:1.10.2:compile
[INFO] |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.10.2:test
[INFO] |  |  \- org.objenesis:objenesis:jar:2.6:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.5.0:test
[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] |  +- org.springframework:spring-core:jar:5.2.1.RELEASE:compile
[INFO] |  +- org.springframework:spring-test:jar:5.2.1.RELEASE:test
[INFO] |  \- org.xmlunit:xmlunit-core:jar:2.6.3:test
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:2.2.1.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.2.1.RELEASE:compile
[INFO] |  |  +- com.zaxxer:HikariCP:jar:3.4.1:compile
[INFO] |  |  \- org.springframework:spring-jdbc:jar:5.2.1.RELEASE:compile
[INFO] |  +- jakarta.activation:jakarta.activation-api:jar:1.2.1:compile
[INFO] |  +- jakarta.persistence:jakarta.persistence-api:jar:2.2.3:compile
[INFO] |  +- jakarta.transaction:jakarta.transaction-api:jar:1.3.3:compile
[INFO] |  +- org.hibernate:hibernate-core:jar:5.4.8.Final:compile
[INFO] |  |  +- org.jboss.logging:jboss-logging:jar:3.4.1.Final:compile
[INFO] |  |  +- org.javassist:javassist:jar:3.24.0-GA:compile
[INFO] |  |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  |  +- org.jboss:jandex:jar:2.0.5.Final:compile
[INFO] |  |  +- org.dom4j:dom4j:jar:2.1.1:compile
[INFO] |  |  +- org.hibernate.common:hibernate-commons-annotations:jar:5.1.0.Final:compile
[INFO] |  |  \- org.glassfish.jaxb:jaxb-runtime:jar:2.3.2:compile
[INFO] |  |     +- org.glassfish.jaxb:txw2:jar:2.3.2:compile
[INFO] |  |     +- com.sun.istack:istack-commons-runtime:jar:3.0.8:compile
[INFO] |  |     +- org.jvnet.staxex:stax-ex:jar:1.8.1:compile
[INFO] |  |     \- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.16:compile
[INFO] |  +- org.springframework.data:spring-data-jpa:jar:2.2.1.RELEASE:compile
[INFO] |  |  +- org.springframework.data:spring-data-commons:jar:2.2.1.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-orm:jar:5.2.1.RELEASE:compile
[INFO] |  \- org.springframework:spring-aspects:jar:5.2.1.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-log4j2:jar:2.2.1.RELEASE:compile
[INFO] |  +- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.12.1:compile
[INFO] |  |  +- org.slf4j:slf4j-api:jar:1.7.29:compile
[INFO] |  |  \- org.apache.logging.log4j:log4j-api:jar:2.12.1:compile
[INFO] |  +- org.apache.logging.log4j:log4j-core:jar:2.12.1:compile
[INFO] |  +- org.apache.logging.log4j:log4j-jul:jar:2.12.1:compile
[INFO] |  \- org.slf4j:jul-to-slf4j:jar:1.7.29:compile
[INFO] +- com.lmax:disruptor:jar:3.4.2:compile
[INFO] +- commons-codec:commons-codec:jar:1.13:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.9:compile
[INFO] +- com.oracle.ojdbc:ojdbc8:jar:19.3.0.0:compile
[INFO] |  +- com.oracle.ojdbc:ucp:jar:19.3.0.0:compile
[INFO] |  +- com.oracle.ojdbc:oraclepki:jar:19.3.0.0:compile
[INFO] |  +- com.oracle.ojdbc:osdt_cert:jar:19.3.0.0:compile
[INFO] |  +- com.oracle.ojdbc:osdt_core:jar:19.3.0.0:compile
[INFO] |  +- com.oracle.ojdbc:simplefan:jar:19.3.0.0:compile
[INFO] |  \- com.oracle.ojdbc:ons:jar:19.3.0.0:compile
[INFO] +- org.springframework.boot:spring-boot-devtools:jar:2.2.1.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot:jar:2.2.1.RELEASE:compile
[INFO] |  \- org.springframework.boot:spring-boot-autoconfigure:jar:2.2.1.RELEASE:compile
[INFO] +- org.apache.httpcomponents:httpclient:jar:4.5.10:compile
[INFO] |  \- org.apache.httpcomponents:httpcore:jar:4.4.12:compile
[INFO] +- org.springframework:spring-context-support:jar:5.2.1.RELEASE:compile
[INFO] |  +- org.springframework:spring-beans:jar:5.2.1.RELEASE:compile
[INFO] |  \- org.springframework:spring-context:jar:5.2.1.RELEASE:compile
[INFO] +- io.springfox:springfox-swagger2:jar:2.6.1:compile
[INFO] |  +- io.swagger:swagger-annotations:jar:1.5.10:compile
[INFO] |  +- io.swagger:swagger-models:jar:1.5.10:compile
[INFO] |  |  \- com.fasterxml.jackson.core:jackson-annotations:jar:2.10.0:compile
[INFO] |  +- io.springfox:springfox-spi:jar:2.6.1:compile
[INFO] |  |  \- io.springfox:springfox-core:jar:2.6.1:compile
[INFO] |  +- io.springfox:springfox-schema:jar:2.6.1:compile
[INFO] |  +- io.springfox:springfox-swagger-common:jar:2.6.1:compile
[INFO] |  +- io.springfox:springfox-spring-web:jar:2.6.1:compile
[INFO] |  +- com.google.guava:guava:jar:18.0:compile
[INFO] |  +- com.fasterxml:classmate:jar:1.5.1:compile
[INFO] |  +- org.springframework.plugin:spring-plugin-core:jar:1.2.0.RELEASE:compile
[INFO] |  +- org.springframework.plugin:spring-plugin-metadata:jar:1.2.0.RELEASE:compile
[INFO] |  \- org.mapstruct:mapstruct:jar:1.0.0.Final:compile
[INFO] +- io.springfox:springfox-swagger-ui:jar:2.6.1:compile
[INFO] +- net.sf.ehcache:ehcache:jar:2.9.0:compile
[INFO] +- com.cccis.framework:bamlogger-weblogic:jar:1.0.1:compile
[INFO] |  \- javax.jms:javax.jms-api:jar:2.0.1:compile
[INFO] +- org.springframework:spring-jms:jar:5.2.1.RELEASE:compile
[INFO] |  +- org.springframework:spring-messaging:jar:5.2.1.RELEASE:compile
[INFO] |  \- org.springframework:spring-tx:jar:5.2.1.RELEASE:compile
[INFO] +- com.cccis.common:common-objects:jar:0.0.6:compile
[INFO] |  \- com.fasterxml.jackson.core:jackson-databind:jar:2.10.0:compile
[INFO] |     \- com.fasterxml.jackson.core:jackson-core:jar:2.10.0:compile
[INFO] +- com.google.code.gson:gson:jar:2.8.6:compile
[INFO] +- com.cccis.framework:framework-dataobjects:jar:10.3.189:compile
[INFO] |  +- com.cccis.framework:framework-core:jar:10.3.189:compile
[INFO] |  |  \- net.sf.ehcache:ehcache-core:jar:2.5.1:compile
[INFO] |  +- axis:axis:jar:1.2:compile
[INFO] |  +- com.cccis.servicepower:sp-client:jar:2.12.0:compile
[INFO] |  +- com.cccis.stdvehicle:vinservice-common:jar:0.0.23:compile
[INFO] |  |  \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.9:compile
[INFO] |  |     \- org.codehaus.jackson:jackson-core-asl:jar:1.9.9:compile
[INFO] |  \- com.cccis.framework:simple-storage:jar:0.0.7:compile
[INFO] |     +- com.fasterxml.uuid:java-uuid-generator:jar:3.1.3:compile
[INFO] |     +- org.restlet.jee:org.restlet.ext.httpclient:jar:2.3.1:compile
[INFO] |     |  +- org.apache.httpcomponents:httpmime:jar:4.5.10:compile
[INFO] |     |  +- net.jcip:jcip-annotations:jar:1.0:compile
[INFO] |     |  +- org.apache.james:apache-mime4j-core:jar:0.7.2:compile
[INFO] |     |  \- org.restlet.jee:org.restlet:jar:2.3.1:compile
[INFO] |     +- org.restlet.jse:org.restlet.ext.json:jar:2.3.1:compile
[INFO] |     |  +- org.restlet.jse:org.restlet.lib.org.json:jar:2.0:compile
[INFO] |     |  \- org.restlet.jse:org.restlet:jar:2.3.1:compile
[INFO] |     +- commons-io:commons-io:jar:1.3.2:compile
[INFO] |     \- com.amazonaws:aws-java-sdk-s3:jar:1.10.50:compile
[INFO] |        +- com.amazonaws:aws-java-sdk-kms:jar:1.10.50:compile
[INFO] |        \- com.amazonaws:aws-java-sdk-core:jar:1.10.50:compile
[INFO] |           \- joda-time:joda-time:jar:2.10.5:compile
[INFO] \- com.cccis.frm.journal:journal-logger:jar:5.0.16:compile
[INFO]    \- com.cccis.frm.journal:ejb_journal_client:jar:5.0.16:compile
[INFO]       \- com.cccis.framework:framework-interfaces:jar:10.3.49:compile
[INFO] ------------------------------------------------------------------------

But After I rebuild my appliation I got the SLF4J multiple bindings and with logback

[ERROR] SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/gtth/.m2/repository/ch/qos/logback/logback-classic/1.0.13/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/gtth/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.12.1/log4j-slf4j-impl-2.12.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

I did everything, shall the Spring be bugged? :(

What can i do?


问:
Build failed in Flutter app due to video_compress package
I have been working an a flutter project that requires to upload video and thumbnail.
I used flutter video_compress package to compress the video and get a thumbnail.
After Adding video_compress package to pubspec.yaml file i found this error.

```<code>
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.otaliastudios:transcoder:0.9.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/otaliastudios/transcoder/0.9.1/transcoder-0.9.1.pom
       - https://repo.maven.apache.org/maven2/com/otaliastudios/transcoder/0.9.1/transcoder-0.9.1.pom
       - https://storage.googleapis.com/download.flutter.io/com/otaliastudios/transcoder/0.9.1/transcoder-0.9.1.pom
     Required by:
         project :app > project :video_compress

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 25s
Exception: Gradle task assembleDebug failed with exit code 1
</code>```

I tried  flutter clean and flutter pub get command but build results same error.

My code in video Controller is.

```<code>
  _compressVideo(String videoPath) async {
    final compressedVideo = await VideoCompress.compressVideo(
      videoPath,
      quality: VideoQuality.MediumQuality,
    );

    return compressedVideo!.file;
  }

  _getThumbnail(String videoPath) async {
    final thumbnail = await VideoCompress.getFileThumbnail(videoPath);
    return thumbnail;
  }

</code>```

Body:
I have been working an a flutter project that requires to upload video and thumbnail.
I used flutter video_compress package to compress the video and get a thumbnail.
After Adding video_compress package to pubspec.yaml file i found this error.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.otaliastudios:transcoder:0.9.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/otaliastudios/transcoder/0.9.1/transcoder-0.9.1.pom
       - https://repo.maven.apache.org/maven2/com/otaliastudios/transcoder/0.9.1/transcoder-0.9.1.pom
       - https://storage.googleapis.com/download.flutter.io/com/otaliastudios/transcoder/0.9.1/transcoder-0.9.1.pom
     Required by:
         project :app > project :video_compress

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 25s
Exception: Gradle task assembleDebug failed with exit code 1

I tried  flutter clean and flutter pub get command but build results same error.

My code in video Controller is.

  _compressVideo(String videoPath) async {
    final compressedVideo = await VideoCompress.compressVideo(
      videoPath,
      quality: VideoQuality.MediumQuality,
    );

    return compressedVideo!.file;
  }

  _getThumbnail(String videoPath) async {
    final thumbnail = await VideoCompress.getFileThumbnail(videoPath);
    return thumbnail;
  }