问:
Second BrowserWindow doesn't load html file in electron.js using Vue CLI
I'm making a desktop app using Vue CLI and vue-cli-plugin-electron-builder.

I need to use multiple renderer processes to do calculations, and I tried to initiate multiple BrowserWindows in the background.js file.

The background.js file is like this:

```<code>async function createWindow() {

  // Create the main browser window.
  win = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {

      // Use pluginOptions.nodeIntegration, leave this alone
      // See nklayman.github.io/vue-cli-plugin-electron-builder/guide/security.html#node-integration for more info
      nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION,
      contextIsolation: !process.env.ELECTRON_NODE_INTEGRATION,
      preload: path.join(__dirname, 'preload.js')
    }
  })

  if (process.env.WEBPACK_DEV_SERVER_URL) {
    // Load the url of the dev server if in development mode
    await win.loadURL(process.env.WEBPACK_DEV_SERVER_URL)
    if (!process.env.IS_TEST) win.webContents.openDevTools()
  } else {
    createProtocol('app')
    // Load the index.html when not in development
    win.loadURL('app://./index.html')
  }

  // The worker process is a renderer BrowserWindow.
  const worker_process = new BrowserWindow({
    show: true,
    width: 1440,
    height: 900,
    webPreferences: {
      nodeIntegration: true,
      webSecurity: false,
     }
  })

  worker_process.loadFile(path.join(__dirname, 'work.html')) // THIS line doesn't work.

  ...

  app.on('ready', async () => {

    createWindow()

  })

</code>```

When I ran npm run electron:serve, the "main browser window" and the "worker process" both opened up, but the "worker process" didn't load the html file. The terminal showed:
Failed to load URL: file:///D:/dev2/dist_electron/work.html with error: ERR_FILE_NOT_FOUND''

I've already had ./src/worker.html file. I seemed that vue CLI or electron didn't copy this html file into the 'distribution folder'.

I tried to change

```<code>worker_process.loadFile(path.join(__dirname, 'work.html'))
</code>```

to

```<code>worker_process.loadURL('app://./work.html')
</code>```

and this popped up
OS warning.

I also tried adding the following into vue.config.js. This adding only gave me more errors in compiling.

```<code>module.exports = defineConfig({

  pages:{
    worker: './src/preload.js',
    workers1: './src/preload2.js',
  },
...
})
</code>```

Any suggestion is appreciated! I can also provide more information.

Body:
I'm making a desktop app using Vue CLI and vue-cli-plugin-electron-builder.

I need to use multiple renderer processes to do calculations, and I tried to initiate multiple BrowserWindows in the background.js file.

The background.js file is like this:

async function createWindow() {

  // Create the main browser window.
  win = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {

      // Use pluginOptions.nodeIntegration, leave this alone
      // See nklayman.github.io/vue-cli-plugin-electron-builder/guide/security.html#node-integration for more info
      nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION,
      contextIsolation: !process.env.ELECTRON_NODE_INTEGRATION,
      preload: path.join(__dirname, 'preload.js')
    }
  })

  if (process.env.WEBPACK_DEV_SERVER_URL) {
    // Load the url of the dev server if in development mode
    await win.loadURL(process.env.WEBPACK_DEV_SERVER_URL)
    if (!process.env.IS_TEST) win.webContents.openDevTools()
  } else {
    createProtocol('app')
    // Load the index.html when not in development
    win.loadURL('app://./index.html')
  }

  // The worker process is a renderer BrowserWindow.
  const worker_process = new BrowserWindow({
    show: true,
    width: 1440,
    height: 900,
    webPreferences: {
      nodeIntegration: true,
      webSecurity: false,
     }
  })

  worker_process.loadFile(path.join(__dirname, 'work.html')) // THIS line doesn't work.

  ...

  app.on('ready', async () => {

    createWindow()

  })

When I ran npm run electron:serve, the "main browser window" and the "worker process" both opened up, but the "worker process" didn't load the html file. The terminal showed:
Failed to load URL: file:///D:/dev2/dist_electron/work.html with error: ERR_FILE_NOT_FOUND''

I've already had ./src/worker.html file. I seemed that vue CLI or electron didn't copy this html file into the 'distribution folder'.

I tried to change

worker_process.loadFile(path.join(__dirname, 'work.html'))

to

worker_process.loadURL('app://./work.html')

and this popped up
OS warning.

I also tried adding the following into vue.config.js. This adding only gave me more errors in compiling.

module.exports = defineConfig({

  pages:{
    worker: './src/preload.js',
    workers1: './src/preload2.js',
  },
...
})

Any suggestion is appreciated! I can also provide more information.


来源: stackexchange

问:
Micronaut-data-hibernate<3.8.1> : class java.lang.String cannot be cast to class java.util.Collection
With Micronaut version upgrade to 3.7.5/3.8.0 custom @Query in Repository with sql-IN clause not working when list is having single element. Below is the stack trace logs, this is still working in older version on micronaut:3.5.4 and micronaut-data-processor:3.4.3.

Stacktrace:

```<code>java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.Collection (java.lang.String and java.util.Collection are in module java.base of loader 'bootstrap')

at io.micronaut.data.hibernate.operations.AbstractHibernateOperations$2.bindOne(AbstractHibernateOperations.java:403)
at io.micronaut.data.runtime.operations.internal.query.DefaultBindableParametersStoredQuery.bindParameter(DefaultBindableParametersStoredQuery.java:172)
at io.micronaut.data.runtime.operations.internal.query.DefaultBindableParametersStoredQuery.bindParameters(DefaultBindableParametersStoredQuery.java:84)
at io.micronaut.data.runtime.operations.internal.query.DefaultBindableParametersPreparedQuery.bindParameters(DefaultBindableParametersPreparedQuery.java:82)
at io.micronaut.data.runtime.operations.internal.query.BindableParametersPreparedQuery.bindParameters(BindableParametersPreparedQuery.java:51)
at io.micronaut.data.hibernate.operations.AbstractHibernateOperations.bindParameters(AbstractHibernateOperations.java:379)
at io.micronaut.data.hibernate.operations.AbstractHibernateOperations.bindPreparedQuery(AbstractHibernateOperations.java:431)
at io.micronaut.data.hibernate.operations.AbstractHibernateOperations.collectResults(AbstractHibernateOperations.java:364)
at io.micronaut.data.hibernate.operations.AbstractHibernateOperations.collectFindAll(AbstractHibernateOperations.java:306)
at io.micronaut.data.hibernate.operations.HibernateJpaOperations.lambda$findAll$7(HibernateJpaOperations.java:315)
at io.micronaut.transaction.support.AbstractSynchronousStateTransactionManager.execute(AbstractSynchronousStateTransactionManager.java:145)
at io.micronaut.transaction.support.AbstractSynchronousStateTransactionManager.executeRead(AbstractSynchronousStateTransactionManager.java:160)
at io.micronaut.transaction.support.AbstractSynchronousTransactionManager.executeRead(AbstractSynchronousTransactionManager.java:150)
at io.micronaut.data.hibernate.operations.HibernateJpaOperations.findAll(HibernateJpaOperations.java:313)
at io.micronaut.data.runtime.intercept.DefaultFindAllInterceptor.intercept(DefaultFindAllInterceptor.java:51)
at io.micronaut.data.runtime.intercept.DefaultFindAllInterceptor.intercept(DefaultFindAllInterceptor.java:35)
</code>```

Repository method

```<code>@Query(value = "Select * from table a where a.status in (:statuses)", nativeQuery = true)
List<Entity> findByStatus(List<String> statuses);
</code>```

ContentLicense: CC BY-SA 4.0

Body:
With Micronaut version upgrade to 3.7.5/3.8.0 custom @Query in Repository with sql-IN clause not working when list is having single element. Below is the stack trace logs, this is still working in older version on micronaut:3.5.4 and micronaut-data-processor:3.4.3.

Stacktrace:

java.lang.ClassCastException: class java.lang.String cannot be cast to class java.util.Collection (java.lang.String and java.util.Collection are in module java.base of loader 'bootstrap')

at io.micronaut.data.hibernate.operations.AbstractHibernateOperations$2.bindOne(AbstractHibernateOperations.java:403)
at io.micronaut.data.runtime.operations.internal.query.DefaultBindableParametersStoredQuery.bindParameter(DefaultBindableParametersStoredQuery.java:172)
at io.micronaut.data.runtime.operations.internal.query.DefaultBindableParametersStoredQuery.bindParameters(DefaultBindableParametersStoredQuery.java:84)
at io.micronaut.data.runtime.operations.internal.query.DefaultBindableParametersPreparedQuery.bindParameters(DefaultBindableParametersPreparedQuery.java:82)
at io.micronaut.data.runtime.operations.internal.query.BindableParametersPreparedQuery.bindParameters(BindableParametersPreparedQuery.java:51)
at io.micronaut.data.hibernate.operations.AbstractHibernateOperations.bindParameters(AbstractHibernateOperations.java:379)
at io.micronaut.data.hibernate.operations.AbstractHibernateOperations.bindPreparedQuery(AbstractHibernateOperations.java:431)
at io.micronaut.data.hibernate.operations.AbstractHibernateOperations.collectResults(AbstractHibernateOperations.java:364)
at io.micronaut.data.hibernate.operations.AbstractHibernateOperations.collectFindAll(AbstractHibernateOperations.java:306)
at io.micronaut.data.hibernate.operations.HibernateJpaOperations.lambda$findAll$7(HibernateJpaOperations.java:315)
at io.micronaut.transaction.support.AbstractSynchronousStateTransactionManager.execute(AbstractSynchronousStateTransactionManager.java:145)
at io.micronaut.transaction.support.AbstractSynchronousStateTransactionManager.executeRead(AbstractSynchronousStateTransactionManager.java:160)
at io.micronaut.transaction.support.AbstractSynchronousTransactionManager.executeRead(AbstractSynchronousTransactionManager.java:150)
at io.micronaut.data.hibernate.operations.HibernateJpaOperations.findAll(HibernateJpaOperations.java:313)
at io.micronaut.data.runtime.intercept.DefaultFindAllInterceptor.intercept(DefaultFindAllInterceptor.java:51)
at io.micronaut.data.runtime.intercept.DefaultFindAllInterceptor.intercept(DefaultFindAllInterceptor.java:35)

Repository method

@Query(value = "Select * from table a where a.status in (:statuses)", nativeQuery = true)
List<Entity> findByStatus(List<String> statuses);


问:
Multiplication in LC3
How would one multiply in LC3 taking into account that numbers in registers could be negative? Additionally, how would one multiply a value in a register by an integer?
For example lets say R2 = R1 * R0
If both numbers inside registers were positive the LC3 code would look something like this:

```<code>.ORIG x3000
LD R2, ZERO
LD R0, M0
LD R1, M1
ST R1, SaveR1
LOOP BRz DONE
ADD R2, R2, R0
ADD R1, R1, #-1
BR LOOP
DONE ST R2, RESULT
LD R1, SaveR1
HALT
SaveR1 .BLKW 1
M0 .FILL x1011
M1 .FILL x0005
.END
</code>```

How would I implement multiplication if either R1 or R0 was negative? How can I check to see if both are negative? Additionally, how can I implement multiplication by a number, such as 4? R1 = R0 * 4.

Title: Multiplication in LC3

Body:
How would one multiply in LC3 taking into account that numbers in registers could be negative? Additionally, how would one multiply a value in a register by an integer?
For example lets say R2 = R1 * R0
If both numbers inside registers were positive the LC3 code would look something like this:

.ORIG x3000
LD R2, ZERO
LD R0, M0
LD R1, M1
ST R1, SaveR1
LOOP BRz DONE
ADD R2, R2, R0
ADD R1, R1, #-1
BR LOOP
DONE ST R2, RESULT
LD R1, SaveR1
HALT
SaveR1 .BLKW 1
M0 .FILL x1011
M1 .FILL x0005
.END

How would I implement multiplication if either R1 or R0 was negative? How can I check to see if both are negative? Additionally, how can I implement multiplication by a number, such as 4? R1 = R0 * 4.


问:
I cloned ubuntu server, but it doesn't work. What changes I should make?
I have ubuntu server which have virtulmin installed and I want to clone the server multiple times instead of creating everything again by hand.

I cloned server with the same disc image, but it doesn't work straight away. What sort of changes I need to make to make this work? I have a different IP address. Right now I can't access virtualmin.


问:
get the main form from another process
I have 2 processed 1 receiver and one dispacther

```<code>public partial class Form1 : Form, IDispacther
{
    private Action<string> m_action;

    public Form1()
    {
        InitializeComponent();
    }

    public void OnData(Action<string> action)
    {
        m_action = action;
    }

    protected override void OnLoad(EventArgs e)
    {
        Thread.Sleep(1000);
        m_action?.Invoke("Hello from dispacther");
        base.OnLoad(e);
    }
}
</code>```

simple , the dispacther just sends back data after a second

the interface is only getting the action

```<code>public interface IDispacther
{
    void OnData(Action<string> action);
}
</code>```

The receiver main form looks like so:

```<code>    public ReceiverForm()
    {
        InitializeComponent();
    }

    protected override void OnLoad(EventArgs e)
    {
        startProcess();
        base.OnLoad(e);

    }

    private void startProcess()
    {
        string processName = "DispatcherEventTester.exe";
        var process  = new Process();
        process.StartInfo.FileName = processName;
        process.Start();
        process.WaitForInputIdle();
        var container = Control.FromHandle(process.MainWindowHandle);
        IDispacther dispacter = .... //What should be here?

    }
</code>```

I dont know how to get Form1 from the dispacther.exe that implements IDispatcher  from the mainwindowhandler - I know there is a way but i forgot

Title: get the main form from another process

Body:
I have 2 processed 1 receiver and one dispacther

public partial class Form1 : Form, IDispacther
{
    private Action<string> m_action;

    public Form1()
    {
        InitializeComponent();
    }

    public void OnData(Action<string> action)
    {
        m_action = action;
    }

    protected override void OnLoad(EventArgs e)
    {
        Thread.Sleep(1000);
        m_action?.Invoke("Hello from dispacther");
        base.OnLoad(e);
    }
}

simple , the dispacther just sends back data after a second

the interface is only getting the action

public interface IDispacther
{
    void OnData(Action<string> action);
}

The receiver main form looks like so:

    public ReceiverForm()
    {
        InitializeComponent();
    }

    protected override void OnLoad(EventArgs e)
    {
        startProcess();
        base.OnLoad(e);

    }

    private void startProcess()
    {
        string processName = "DispatcherEventTester.exe";
        var process  = new Process();
        process.StartInfo.FileName = processName;
        process.Start();
        process.WaitForInputIdle();
        var container = Control.FromHandle(process.MainWindowHandle);
        IDispacther dispacter = .... //What should be here?

    }

I dont know how to get Form1 from the dispacther.exe that implements IDispatcher  from the mainwindowhandler - I know there is a way but i forgot


问:
I want a read more/hide button when there's multiple lines
I'm creating a comment section (something similar to youtube), and i want be able to show readmore/hide button when the {{content}} has multiple lines.
This is what I've done so far, my read more/hide button works since I added a computed lineclamp, to make the content show two lines only when there's mutltiple lines, I only want to show the button in case there's multiples lines.
But if you have any other suggestions to make it work, I'm open for it.

`

```<code><template>
    <div>
        <div class="d-flex flex-row align-items-center">
            <h4 class="card-title">{{ author }}</h4>
            <h6 class="card-subtitle text-muted ml-3">
                {{ timeAgo(createdAt) }} ago
            </h6>
        </div>
        <p class="multiline" :style="{ '-webkit-line-clamp': computedLineclamp }"><b class="timestamp" v-if="timestamp !== null">@{{
        timeToHHMMSS(timestamp)
}}</b> {{ content }}
        </p>
        <div>
            <base-button v-show="!readmore" @click="changeLineclamp()" link class="text-white p-0" size="sm">Read
                more</base-button>
            <base-button v-show="readmore" @click="hideContent()" link class="text-white p-0"
                size="sm">Hide</base-button>
        </div>
    </div>
</template>

<script>
// Internal modules
import { timeSince, toHHMMSS } from "@/plugins/timeControls.js";

export default {
    name: "comment-item",
    data() {
        return {
            lineclamp: 2,
            readmore: false,
            showButton: true,
        }
    },
    props: {
        id: {
            type: String,
            required: true,
        },
        author: {
            type: String,
            required: true,
        },
        createdAt: {
            type: Number,
            required: true,
        },
        timestamp: {
            type: Number,
            required: true,
        },
        content: {
            type: String,
            required: true,
        }
    },
    methods: {
        changeLineclamp() {
            this.lineclamp = 'initial';
            this.readmore = true;
            this.showButton = false;
        },
        hideContent() {
            this.lineclamp = 2;
            this.readmore = false
        },
        timeAgo(date) {
            return timeSince(date);
        },
        timeToHHMMSS(time) {
            return toHHMMSS(time);
        },
    },
    computed: {
        computedLineclamp() {
            return this.lineclamp;
        },
    },
};
</script>

<style lang="scss" scoped>
@import "@/assets/sass/dashboard/custom/_variables.scss";

ul {
    list-style-type: none;
    padding: 0;
}

.button {
    visibility: none;
}

.timestamp {
    color: $primary;
}

.multiline {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;

    &.__lineclamp {
        -webkit-line-clamp: 2;
    }

    &.__none {
        -webkit-line-clamp: initial;
    }
}
</style>

</code>```

`

enter image description hereenter image description here

As I said it does work here, but the readmore/hide button shows up in all the comment section, I tried to use the height function to make it work, but i doesn't

`

```<code> <div v-if="content.height() > 2">
            <base-button v-show="!readmore" @click="changeLineclamp()" link class="text-white p-0" size="sm">Read
                more</base-button>
            <base-button v-show="readmore" @click="hideContent()" link class="text-white p-0"
                size="sm">Hide</base-button>
        </div>

</code>```

`

Body:
I'm creating a comment section (something similar to youtube), and i want be able to show readmore/hide button when the {{content}} has multiple lines.
This is what I've done so far, my read more/hide button works since I added a computed lineclamp, to make the content show two lines only when there's mutltiple lines, I only want to show the button in case there's multiples lines.
But if you have any other suggestions to make it work, I'm open for it.

`

<template>

{{ author }}

                {{ timeAgo(createdAt) }} ago

@{{
        timeToHHMMSS(timestamp)
}} {{ content }}

            <base-button v-show="!readmore" @click="changeLineclamp()" link class="text-white p-0" size="sm">Read
                more</base-button>
            <base-button v-show="readmore" @click="hideContent()" link class="text-white p-0"
                size="sm">Hide</base-button>

</template>

`

enter image description hereenter image description here

As I said it does work here, but the readmore/hide button shows up in all the comment section, I tried to use the height function to make it work, but i doesn't

`

 2">
            <base-button v-show="!readmore" @click="changeLineclamp()" link class="text-white p-0" size="sm">Read
                more</base-button>
            <base-button v-show="readmore" @click="hideContent()" link class="text-white p-0"
                size="sm">Hide</base-button>

`


问:
legacy-install-failure while downloading dlib from pip using 'pip install dlib'
This is the error I have been facing while installing dlib. I have tried installing cmake first as I thought that was the issue. I installed cmake and it worked without any errors but I am not able to install dlib. Please check the code which I pasted below which was the error I have been facing

```<code> -- Configuring incomplete, errors occurred!
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\lenovo\AppData\Local\Temp\pip-install-zfdideoa\dlib_36bb0c7331c64241ba41d26308a57467\setup.py", line 222, in <module>
          setup(
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
          return run_commands(dist)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
          dist.run_commands()
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
          super().run_command(command)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\wheel\bdist_wheel.py", line 325, in run
          self.run_command("build")
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
          super().run_command(command)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
          self.run_command(cmd_name)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
          super().run_command(command)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\lenovo\AppData\Local\Temp\pip-install-zfdideoa\dlib_36bb0c7331c64241ba41d26308a57467\setup.py", line 134, in run
          self.build_extension(ext)
        File "C:\Users\lenovo\AppData\Local\Temp\pip-install-zfdideoa\dlib_36bb0c7331c64241ba41d26308a57467\setup.py", line 171, in build_extension
          subprocess.check_call(cmake_setup, cwd=build_folder)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\subprocess.py", line 373, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-zfdideoa\\dlib_36bb0c7331c64241ba41d26308a57467\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-zfdideoa\\dlib_36bb0c7331c64241ba41d26308a57467\\build\\lib.win-amd64-cpython-39', '-DPYTHON_EXECUTABLE=c:\\users\\lenovo\\appdata\\local\\programs\\python\\python39\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-zfdideoa\\dlib_36bb0c7331c64241ba41d26308a57467\\build\\lib.win-amd64-cpython-39', '-A', 'x64']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for dlib
  Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib
  Running setup.py install for dlib ... error
  error: subprocess-exited-with-error

  × Running setup.py install for dlib did not run successfully.
  │ exit code: 1
  ╰─> [72 lines of output]
      running install
      c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      running build_ext
      C:\Users\lenovo\AppData\Local\Temp\pip-install-zfdideoa\dlib_36bb0c7331c64241ba41d26308a57467\setup.py:129: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
        if LooseVersion(cmake_version) < '3.1.0':
      Building extension for Python 3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)]
      Invoking CMake setup: 'cmake C:\Users\lenovo\AppData\Local\Temp\pip-install-zfdideoa\dlib_36bb0c7331c64241ba41d26308a57467\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\lenovo\AppData\Local\Temp\pip-install-zfdideoa\dlib_36bb0c7331c64241ba41d26308a57467\build\lib.win-amd64-cpython-39 -DPYTHON_EXECUTABLE=c:\users\lenovo\appdata\local\programs\python\python39\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\lenovo\AppData\Local\Temp\pip-install-zfdideoa\dlib_36bb0c7331c64241ba41d26308a57467\build\lib.win-amd64-cpython-39 -A x64'
      -- Building for: NMake Makefiles
      CMake Error at CMakeLists.txt:5 (message):

        !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

        You must use Visual Studio to build a python extension on windows.  If you
        are getting this error it means you have not installed Visual C++.  Note
        that there are many flavors of Visual Studio, like Visual Studio for C#
        development.  You need to install Visual Studio for C++.

        !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

      -- Configuring incomplete, errors occurred!
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\lenovo\AppData\Local\Temp\pip-install-zfdideoa\dlib_36bb0c7331c64241ba41d26308a57467\setup.py", line 222, in <module>
          setup(
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
          return run_commands(dist)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
          dist.run_commands()
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
          super().run_command(command)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\command\install.py", line 68, in run
          return orig.install.run(self)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\command\install.py", line 698, in run
          self.run_command('build')
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
          super().run_command(command)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
          self.run_command(cmd_name)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
          super().run_command(command)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\lenovo\AppData\Local\Temp\pip-install-zfdideoa\dlib_36bb0c7331c64241ba41d26308a57467\setup.py", line 134, in run
          self.build_extension(ext)
        File "C:\Users\lenovo\AppData\Local\Temp\pip-install-zfdideoa\dlib_36bb0c7331c64241ba41d26308a57467\setup.py", line 171, in build_extension
          subprocess.check_call(cmake_setup, cwd=build_folder)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\subprocess.py", line 373, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-zfdideoa\\dlib_36bb0c7331c64241ba41d26308a57467\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-zfdideoa\\dlib_36bb0c7331c64241ba41d26308a57467\\build\\lib.win-amd64-cpython-39', '-DPYTHON_EXECUTABLE=c:\\users\\lenovo\\appdata\\local\\programs\\python\\python39\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-zfdideoa\\dlib_36bb0c7331c64241ba41d26308a57467\\build\\lib.win-amd64-cpython-39', '-A', 'x64']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> dlib

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
</code>```

I tried
pip install cmake (This worked)

pip install dlib
(But this is not working)

Body:
This is the error I have been facing while installing dlib. I have tried installing cmake first as I thought that was the issue. I installed cmake and it worked without any errors but I am not able to install dlib. Please check the code which I pasted below which was the error I have been facing

 -- Configuring incomplete, errors occurred!
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\lenovo\AppData\Local\Temp\pip-install-zfdideoa\dlib_36bb0c7331c64241ba41d26308a57467\setup.py", line 222, in <module>
          setup(
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
          return run_commands(dist)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
          dist.run_commands()
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
          super().run_command(command)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\wheel\bdist_wheel.py", line 325, in run
          self.run_command("build")
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
          super().run_command(command)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
          self.run_command(cmd_name)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
          super().run_command(command)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\lenovo\AppData\Local\Temp\pip-install-zfdideoa\dlib_36bb0c7331c64241ba41d26308a57467\setup.py", line 134, in run
          self.build_extension(ext)
        File "C:\Users\lenovo\AppData\Local\Temp\pip-install-zfdideoa\dlib_36bb0c7331c64241ba41d26308a57467\setup.py", line 171, in build_extension
          subprocess.check_call(cmake_setup, cwd=build_folder)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\subprocess.py", line 373, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-zfdideoa\\dlib_36bb0c7331c64241ba41d26308a57467\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-zfdideoa\\dlib_36bb0c7331c64241ba41d26308a57467\\build\\lib.win-amd64-cpython-39', '-DPYTHON_EXECUTABLE=c:\\users\\lenovo\\appdata\\local\\programs\\python\\python39\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-zfdideoa\\dlib_36bb0c7331c64241ba41d26308a57467\\build\\lib.win-amd64-cpython-39', '-A', 'x64']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for dlib
  Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib
  Running setup.py install for dlib ... error
  error: subprocess-exited-with-error

  × Running setup.py install for dlib did not run successfully.
  │ exit code: 1
  ╰─> [72 lines of output]
      running install
      c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      running build_ext
      C:\Users\lenovo\AppData\Local\Temp\pip-install-zfdideoa\dlib_36bb0c7331c64241ba41d26308a57467\setup.py:129: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
        if LooseVersion(cmake_version) < '3.1.0':
      Building extension for Python 3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)]
      Invoking CMake setup: 'cmake C:\Users\lenovo\AppData\Local\Temp\pip-install-zfdideoa\dlib_36bb0c7331c64241ba41d26308a57467\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\lenovo\AppData\Local\Temp\pip-install-zfdideoa\dlib_36bb0c7331c64241ba41d26308a57467\build\lib.win-amd64-cpython-39 -DPYTHON_EXECUTABLE=c:\users\lenovo\appdata\local\programs\python\python39\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\lenovo\AppData\Local\Temp\pip-install-zfdideoa\dlib_36bb0c7331c64241ba41d26308a57467\build\lib.win-amd64-cpython-39 -A x64'
      -- Building for: NMake Makefiles
      CMake Error at CMakeLists.txt:5 (message):

        !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

        You must use Visual Studio to build a python extension on windows.  If you
        are getting this error it means you have not installed Visual C++.  Note
        that there are many flavors of Visual Studio, like Visual Studio for C#
        development.  You need to install Visual Studio for C++.

        !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

      -- Configuring incomplete, errors occurred!
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\lenovo\AppData\Local\Temp\pip-install-zfdideoa\dlib_36bb0c7331c64241ba41d26308a57467\setup.py", line 222, in <module>
          setup(
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
          return run_commands(dist)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
          dist.run_commands()
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
          super().run_command(command)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\command\install.py", line 68, in run
          return orig.install.run(self)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\command\install.py", line 698, in run
          self.run_command('build')
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
          super().run_command(command)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
          self.run_command(cmd_name)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\dist.py", line 1208, in run_command
          super().run_command(command)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\lenovo\AppData\Local\Temp\pip-install-zfdideoa\dlib_36bb0c7331c64241ba41d26308a57467\setup.py", line 134, in run
          self.build_extension(ext)
        File "C:\Users\lenovo\AppData\Local\Temp\pip-install-zfdideoa\dlib_36bb0c7331c64241ba41d26308a57467\setup.py", line 171, in build_extension
          subprocess.check_call(cmake_setup, cwd=build_folder)
        File "c:\users\lenovo\appdata\local\programs\python\python39\lib\subprocess.py", line 373, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-zfdideoa\\dlib_36bb0c7331c64241ba41d26308a57467\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-zfdideoa\\dlib_36bb0c7331c64241ba41d26308a57467\\build\\lib.win-amd64-cpython-39', '-DPYTHON_EXECUTABLE=c:\\users\\lenovo\\appdata\\local\\programs\\python\\python39\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-zfdideoa\\dlib_36bb0c7331c64241ba41d26308a57467\\build\\lib.win-amd64-cpython-39', '-A', 'x64']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> dlib

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

I tried
pip install cmake (This worked)

pip install dlib
(But this is not working)


问:
Java - Sap Hybris Upgrade 2205
I'm trying to upgrade my Hybris project to 2205 and while initializing the "ant updatesystem", i am getting following error

```<code>ERROR [hybrisHTTP9] [Initialization] Property 'http://javax.xml.XMLConstants/property/accessExternalSchema' is not recognized.
 java.lang.IllegalArgumentException: Property 'http://javax.xml.XMLConstants/property/accessExternalSchema' is not recognized.
        at de.hybris.bootstrap.xml.XMLSchemaValidator.validate(XMLSchemaValidator.java:94) ~[ybootstrap.jar:?]
        at de.hybris.bootstrap.typesystem.YTypeSystemSource.validateXml(YTypeSystemSource.java:175) ~[ybootstrap.jar:?]
        at de.hybris.bootstrap.typesystem.YTypeSystemSource.readTypeSystem(YTypeSystemSource.java:101) ~[ybootstrap.jar:?]
        at de.hybris.bootstrap.typesystem.YTypeSystemSource.getTypeSystem(YTypeSystemSource.java:47) ~[ybootstrap.jar:?]
</code>```

Using SapMAchine17. Initialization triggered from HAC.

I have tried to add these properties "-Djavax.xml.accessExternalSchema=all", "-Djavax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema=com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory" to tomcat.generaloptions located in local.properties but it didn't work.

Any idea would be appreciated..Thank you for your help..

Title: Java - Sap Hybris Upgrade 2205

Body:
I'm trying to upgrade my Hybris project to 2205 and while initializing the "ant updatesystem", i am getting following error

ERROR [hybrisHTTP9] [Initialization] Property 'http://javax.xml.XMLConstants/property/accessExternalSchema' is not recognized.
 java.lang.IllegalArgumentException: Property 'http://javax.xml.XMLConstants/property/accessExternalSchema' is not recognized.
        at de.hybris.bootstrap.xml.XMLSchemaValidator.validate(XMLSchemaValidator.java:94) ~[ybootstrap.jar:?]
        at de.hybris.bootstrap.typesystem.YTypeSystemSource.validateXml(YTypeSystemSource.java:175) ~[ybootstrap.jar:?]
        at de.hybris.bootstrap.typesystem.YTypeSystemSource.readTypeSystem(YTypeSystemSource.java:101) ~[ybootstrap.jar:?]
        at de.hybris.bootstrap.typesystem.YTypeSystemSource.getTypeSystem(YTypeSystemSource.java:47) ~[ybootstrap.jar:?]

Using SapMAchine17. Initialization triggered from HAC.

I have tried to add these properties "-Djavax.xml.accessExternalSchema=all", "-Djavax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema=com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory" to tomcat.generaloptions located in local.properties but it didn't work.

Any idea would be appreciated..Thank you for your help..


问:
Why doesn't my if statement get executed?
```<code>            System.out.println("Inside loop");
            System.out.println(customer.getCustId());
            System.out.println(customer.getPhone());
            System.out.println(transaction.getCustId());
            if(transaction.getCustId() == customer.getCustId()) {
                System.out.println("Found one transaction");
                System.out.println(transaction);
                filteredTransaction.add(transaction);
            }
        }
</code>```

This is my code. The values for the fields on if statement are same but still the if statement doesn't get executed.

Here is the output I am getting.

```<code>Inside loop
446bdfd3-3d09-43e7-83df-1883f967d296
9818122018
446bdfd3-3d09-43e7-83df-1883f967d296
Inside loop
446bdfd3-3d09-43e7-83df-1883f967d296
9818122018
446bdfd3-3d09-43e7-83df-1883f967d296
Inside loop
446bdfd3-3d09-43e7-83df-1883f967d296
9818122018
446bdfd3-3d09-43e7-83df-1883f967d296
Inside loop
446bdfd3-3d09-43e7-83df-1883f967d296
9818122018
446bdfd3-3d09-43e7-83df-1883f967d296
Inside loop
446bdfd3-3d09-43e7-83df-1883f967d296
9818122018
446bdfd3-3d09-43e7-83df-1883f967d296
Inside loop
446bdfd3-3d09-43e7-83df-1883f967d296
9818122018
446bdfd3-3d09-43e7-83df-1883f967d296
</code>```

Body:
            System.out.println("Inside loop");
            System.out.println(customer.getCustId());
            System.out.println(customer.getPhone());
            System.out.println(transaction.getCustId());
            if(transaction.getCustId() == customer.getCustId()) {
                System.out.println("Found one transaction");
                System.out.println(transaction);
                filteredTransaction.add(transaction);
            }
        }

This is my code. The values for the fields on if statement are same but still the if statement doesn't get executed.

Here is the output I am getting.

Inside loop
446bdfd3-3d09-43e7-83df-1883f967d296
9818122018
446bdfd3-3d09-43e7-83df-1883f967d296
Inside loop
446bdfd3-3d09-43e7-83df-1883f967d296
9818122018
446bdfd3-3d09-43e7-83df-1883f967d296
Inside loop
446bdfd3-3d09-43e7-83df-1883f967d296
9818122018
446bdfd3-3d09-43e7-83df-1883f967d296
Inside loop
446bdfd3-3d09-43e7-83df-1883f967d296
9818122018
446bdfd3-3d09-43e7-83df-1883f967d296
Inside loop
446bdfd3-3d09-43e7-83df-1883f967d296
9818122018
446bdfd3-3d09-43e7-83df-1883f967d296
Inside loop
446bdfd3-3d09-43e7-83df-1883f967d296
9818122018
446bdfd3-3d09-43e7-83df-1883f967d296


问:
SQLFeatureNotSupportedException after EclipseLink upgrade
I have a following entity declared in my code:

```<code>@NoArgsConstructor
@Cacheable(false)
@Data
@Entity
@SqlResultSetMappings(
        @SqlResultSetMapping(name = "KpiProfitabilitySaleResultSetMapping",
        classes = {
                @ConstructorResult(
                        targetClass= KpiProfitabilitySale.class,
                        columns= {
                                @ColumnResult(name = "client_id", type = Long.class),
                                @ColumnResult(name = "period_date", type = Date.class),
                                @ColumnResult(name = "billing_value", type = Double.class)
                        }
                )
        }
        )
)
@NamedStoredProcedureQueries({
        @NamedStoredProcedureQuery(name = "KPI.ProfitabilitySale",
                procedureName = "cmf_kpi_employee_profitability_sale",
                parameters = {
                        @StoredProcedureParameter(mode = ParameterMode.IN, name = "date_start", type = Date.class),
                        @StoredProcedureParameter(mode = ParameterMode.IN, name = "date_end", type = Date.class)
                },
                resultSetMappings = {"KpiProfitabilitySaleResultSetMapping"}
        )
})
@AllArgsConstructor
public class KpiProfitabilitySale implements Serializable {

    @Id
    private Long clientId;

    private String clientName;

    @Temporal(TemporalType.DATE)
    private Date periodDate;

    private Double billingValue;
}
</code>```

and method in stateless bean which executes a stored procedure

```<code>StoredProcedureQuery query = getEM().createNamedStoredProcedureQuery("KPI.ProfitabilitySale")
                .setParameter("date_start", period.getBeginDate(), TemporalType.DATE)
                .setParameter("date_end", period.getEndDate(), TemporalType.DATE)
                .getResultList();
</code>```

This one stoped working after upgrade from EclipseLink 2.6 to 2.7 . Code throws following exception:

```<code>Caused by: java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc.PgCallableStatement.setDate(String,Date) not supported yet.
        at org.postgresql.Driver.notImplemented(Driver.java:731)
        at org.postgresql.jdbc.PgCallableStatement.setDate(PgCallableStatement.java:738)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.postgresql.ds.PGPooledConnection$StatementHandler.invoke(PGPooledConnection.java:441)
</code>```

Any ideas how to solve this ?

Body:
I have a following entity declared in my code:

@NoArgsConstructor
@Cacheable(false)
@Data
@Entity
@SqlResultSetMappings(
        @SqlResultSetMapping(name = "KpiProfitabilitySaleResultSetMapping",
        classes = {
                @ConstructorResult(
                        targetClass= KpiProfitabilitySale.class,
                        columns= {
                                @ColumnResult(name = "client_id", type = Long.class),
                                @ColumnResult(name = "period_date", type = Date.class),
                                @ColumnResult(name = "billing_value", type = Double.class)
                        }
                )
        }
        )
)
@NamedStoredProcedureQueries({
        @NamedStoredProcedureQuery(name = "KPI.ProfitabilitySale",
                procedureName = "cmf_kpi_employee_profitability_sale",
                parameters = {
                        @StoredProcedureParameter(mode = ParameterMode.IN, name = "date_start", type = Date.class),
                        @StoredProcedureParameter(mode = ParameterMode.IN, name = "date_end", type = Date.class)
                },
                resultSetMappings = {"KpiProfitabilitySaleResultSetMapping"}
        )
})
@AllArgsConstructor
public class KpiProfitabilitySale implements Serializable {

    @Id
    private Long clientId;

    private String clientName;

    @Temporal(TemporalType.DATE)
    private Date periodDate;

    private Double billingValue;
}

and method in stateless bean which executes a stored procedure

StoredProcedureQuery query = getEM().createNamedStoredProcedureQuery("KPI.ProfitabilitySale")
                .setParameter("date_start", period.getBeginDate(), TemporalType.DATE)
                .setParameter("date_end", period.getEndDate(), TemporalType.DATE)
                .getResultList();

This one stoped working after upgrade from EclipseLink 2.6 to 2.7 . Code throws following exception:

Caused by: java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc.PgCallableStatement.setDate(String,Date) not supported yet.
        at org.postgresql.Driver.notImplemented(Driver.java:731)
        at org.postgresql.jdbc.PgCallableStatement.setDate(PgCallableStatement.java:738)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.postgresql.ds.PGPooledConnection$StatementHandler.invoke(PGPooledConnection.java:441)

Any ideas how to solve this ?


问:
cant get token from laravel passport with authorization_code flow
im using laravel passport and i want to get a token like this
https://laravel.com/docs/9.x/passport#requesting-tokens-converting-authorization-codes-to-access-tokens

this is the code in my controller

```<code>$response = Http::asForm()->post('http://passport-app.test/sso/oauth/token', [
           'grant_type' => 'authorization_code',
           'client_id' =>env( 'CLIENT_ID'),
          'client_secret' =>env( 'CLIENT_SECRET'),
          'redirect_uri' =>env( 'REDIRECT_URI'),
          'code' => $request->code,
        ]);

        return $response->json();
</code>```

but im getting an error

```<code>
  "error": "invalid_request",
    "error_description": "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.",
    "hint": "Cannot decrypt the authorization code",
    "message": "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed."

``
</code>```

Body:
im using laravel passport and i want to get a token like this
https://laravel.com/docs/9.x/passport#requesting-tokens-converting-authorization-codes-to-access-tokens

this is the code in my controller

$response = Http::asForm()->post('http://passport-app.test/sso/oauth/token', [
           'grant_type' => 'authorization_code',
           'client_id' =>env( 'CLIENT_ID'),
          'client_secret' =>env( 'CLIENT_SECRET'),
          'redirect_uri' =>env( 'REDIRECT_URI'),
          'code' => $request->code,
        ]);

        return $response->json();

but im getting an error

  "error": "invalid_request",
    "error_description": "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.",
    "hint": "Cannot decrypt the authorization code",
    "message": "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed."

``


问:
The getter 'Share' isn't defined for the class '_SettingsState'
I have the "share_plus" package, which works fine on emulator. I imported the package as usual, I also tried the functionality to share the actual app without any problem. But when i try to run with the Xcode in real device it gives me this error:

```<code>import 'package:share_plus/share_plus.dart';
   ^
 lib/Settings.dart:138:19: Error: The getter 'Share' isn't defined for the class   '_SettingsState'.
  - '_SettingsState' is from 'package:flutter_projects/Settings.dart'   ('lib/Settings.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Share'.
Share.share('https://apps.apple.com/.....');
</code>```

What could be the problem?
This is my code:

```<code>SettingsSection(
      title: 'Extra',
      tiles: [
        SettingsTile(
            title: ('Condividi').tr(), leading: Icon(Icons.share),
            onPressed: (context) async {
              //share_plus requires iPad users to provide the sharePositionOrigin parameter.
              final box = context.findRenderObject() as RenderBox?;
              await Share.share('https://apps.apple....,
              sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
              );

            }),
      ],
    ),
</code>```

Body:
I have the "share_plus" package, which works fine on emulator. I imported the package as usual, I also tried the functionality to share the actual app without any problem. But when i try to run with the Xcode in real device it gives me this error:

import 'package:share_plus/share_plus.dart';
   ^
 lib/Settings.dart:138:19: Error: The getter 'Share' isn't defined for the class   '_SettingsState'.
  - '_SettingsState' is from 'package:flutter_projects/Settings.dart'   ('lib/Settings.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Share'.
Share.share('https://apps.apple.com/.....');

What could be the problem?
This is my code:

SettingsSection(
      title: 'Extra',
      tiles: [
        SettingsTile(
            title: ('Condividi').tr(), leading: Icon(Icons.share),
            onPressed: (context) async {
              //share_plus requires iPad users to provide the sharePositionOrigin parameter.
              final box = context.findRenderObject() as RenderBox?;
              await Share.share('https://apps.apple....,
              sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
              );

            }),
      ],
    ),


问:
Plotly non-interactive image with sliders
I have managed to make a plotly graph based on this code sample from Plotly documentation:

```<code>import plotly.graph_objects as go
import numpy as np

# Create figure
fig = go.Figure()

# Add traces, one for each slider step
for step in np.arange(0, 5, 0.1):
    fig.add_trace(
        go.Scatter(
            visible=False,
            line=dict(color="#00CED1", width=6),
            name=" = " + str(step),
            x=np.arange(0, 10, 0.01),
            y=np.sin(step * np.arange(0, 10, 0.01))))

# Make 10th trace visible
fig.data[10].visible = True

# Create and add slider
steps = []
for i in range(len(fig.data)):
    step = dict(
        method="update",
        args=[{"visible": [False] * len(fig.data)},
              {"title": "Slider switched to step: " + str(i)}],  # layout attribute
    )
    step["args"][0]["visible"][i] = True  # Toggle i'th trace to "visible"
    steps.append(step)

sliders = [dict(
    active=10,
    currentvalue={"prefix": "Frequency: "},
    pad={"t": 50},
    steps=steps
)]

fig.update_layout(
    sliders=sliders
)

fig.show()
</code>```

Problem is that, as I am instead visualizing relatively big go.Images, the preparation of the plots is extremely slow and not suitable for the final interactive Streamlit app that I am trying to create.

To make it faster, I thought to have non-interactive plots which (I guess so at least) should be much faster. There is, however, no interactive=False option for the plotly traces, or at least I cannot find them. There is option to export figure to a static image, but that would make no sense, as the figure would have to be prepared anyway before it would be exported to png and visualized as a static image.

So, is there any way to modify this Plotly example in a way that keeps the sliders but directly creates non-interactive plot from a Numpy array?

Or do I have to switch do a different library completely? Thanks.

Body:
I have managed to make a plotly graph based on this code sample from Plotly documentation:

import plotly.graph_objects as go
import numpy as np

# Create figure
fig = go.Figure()

# Add traces, one for each slider step
for step in np.arange(0, 5, 0.1):
    fig.add_trace(
        go.Scatter(
            visible=False,
            line=dict(color="#00CED1", width=6),
            name=" = " + str(step),
            x=np.arange(0, 10, 0.01),
            y=np.sin(step * np.arange(0, 10, 0.01))))

# Make 10th trace visible
fig.data[10].visible = True

# Create and add slider
steps = []
for i in range(len(fig.data)):
    step = dict(
        method="update",
        args=[{"visible": [False] * len(fig.data)},
              {"title": "Slider switched to step: " + str(i)}],  # layout attribute
    )
    step["args"][0]["visible"][i] = True  # Toggle i'th trace to "visible"
    steps.append(step)

sliders = [dict(
    active=10,
    currentvalue={"prefix": "Frequency: "},
    pad={"t": 50},
    steps=steps
)]

fig.update_layout(
    sliders=sliders
)

fig.show()

Problem is that, as I am instead visualizing relatively big go.Images, the preparation of the plots is extremely slow and not suitable for the final interactive Streamlit app that I am trying to create.

To make it faster, I thought to have non-interactive plots which (I guess so at least) should be much faster. There is, however, no interactive=False option for the plotly traces, or at least I cannot find them. There is option to export figure to a static image, but that would make no sense, as the figure would have to be prepared anyway before it would be exported to png and visualized as a static image.

So, is there any way to modify this Plotly example in a way that keeps the sliders but directly creates non-interactive plot from a Numpy array?

Or do I have to switch do a different library completely? Thanks.


问:
localVarFormParams.getHeaders is not function when using openai.createImageEdit()
this is my function

```<code>const generatedDalleImage = async () => {

    await openai.createImageEdit(
      selectedImage,
      selectedMaskImage,
      "human face",
      1,
      "1024x1024"
    ).then((response) => {
      console.log(response);
      setGeneratedImage(response.data.data[0].url)
    }).catch(err => {
      console.log(err);
    });

  }
</code>```

i am getting this error
localVarFormParams.getHeaders is not function when using openai.createImageEdit()

i am really stuck in this one so any help is appreciated

Body:
this is my function

const generatedDalleImage = async () => {

    await openai.createImageEdit(
      selectedImage,
      selectedMaskImage,
      "human face",
      1,
      "1024x1024"
    ).then((response) => {
      console.log(response);
      setGeneratedImage(response.data.data[0].url)
    }).catch(err => {
      console.log(err);
    });

  }

i am getting this error
localVarFormParams.getHeaders is not function when using openai.createImageEdit()

i am really stuck in this one so any help is appreciated


问:
Assigning variables to python from an sql database
```<code>mycursor.execute("SELECT lcm FROM testdatabase")
data = mycursor.fetchone()
print(data)
</code>```

This was the code I used and this returns something like : (Decimal('1.8500'),)

But I want it to show only 1.85 as a number, how can I do this?

Body:
mycursor.execute("SELECT lcm FROM testdatabase")
data = mycursor.fetchone()
print(data)

This was the code I used and this returns something like : (Decimal('1.8500'),)

But I want it to show only 1.85 as a number, how can I do this?


问:
Next.js Fast Refresh doesn't work properly with jotai
So I'm using Next.js with jotai a few months now. The problem is that with every change (and when the fast-refresh occurs due to the change), the atoms are reset and I have to refresh the page manually.

Do you know if there is any configuration that I need to make in order for it to not reset the atoms when the fast refresh occurs?

Here is a codesandbox link, but there is no fast refresh there (I am using the same code)

https://codesandbox.io/s/nextjs-with-jotai-forked-eori6o?file=/pages/_app.js

Thank you!


问:
"no module named numpy.core" error after installing numpy in a layer in AWS Lambda
When I deployed my serverless FastAPI with AWS Lambda and API Gateway I got the following error:
No module named numpy.core. Unable to import module 'path/to/handler': Unable to import required dependencies: numpy

And I also got this:
The python version is: Python3.7 from "var/lang/bin/python3.7" , the numpy version is: "1.21.6"

I have installed the numpy module in a layer and included the path to the directory where the module is installed in the serverless.yml file and I still experience the "no module named numpy.core" error.

My serverless.yml file looks like this:

```<code>layers:
  something:
    compatibleRuntimes:
            - python3.8
            - python3.7
        - python3.6
    path: 'path/to/layer'
</code>```

I also tried without the compatibleRuntimes block, and I still got the same error.

I think that since the numpy module is installed and the correct version is being used, it is likely that the issue is not related to the numpy module itself.

And, actually, in my code, what I import is the pandas module, but when I install pandas, it also installs numpy.

```<code>import pandas as pd

# functions
</code>```

Any advice or tip? I have been stuck in this for a long time. Thank you in advance!

Body:
When I deployed my serverless FastAPI with AWS Lambda and API Gateway I got the following error:
No module named numpy.core. Unable to import module 'path/to/handler': Unable to import required dependencies: numpy

And I also got this:
The python version is: Python3.7 from "var/lang/bin/python3.7" , the numpy version is: "1.21.6"

I have installed the numpy module in a layer and included the path to the directory where the module is installed in the serverless.yml file and I still experience the "no module named numpy.core" error.

My serverless.yml file looks like this:

layers:
  something:
    compatibleRuntimes:
            - python3.8
            - python3.7
        - python3.6
    path: 'path/to/layer'

I also tried without the compatibleRuntimes block, and I still got the same error.

I think that since the numpy module is installed and the correct version is being used, it is likely that the issue is not related to the numpy module itself.

And, actually, in my code, what I import is the pandas module, but when I install pandas, it also installs numpy.

import pandas as pd

# functions

Any advice or tip? I have been stuck in this for a long time. Thank you in advance!


问:
Assigning a specific function to a more abstract function in typescript
I have two Function types:

```<code>type AbstractFunc = (value: string) => boolean
type ConcreteFunc = (value1: 'hello') => boolean
</code>```

Since I can assign a variable of the literal type 'hello' to a variable of type string, I thought I can do the same with my two functions for example:

```<code>let z1: 'hello' = 'hello' as const
// No Error
let z2: string  = z1;

type AbstractFunc = (value: string) => boolean
type ConcreteFunc = (value1: 'hello') => boolean

let u: ConcreteFunc = null as any;

// Error:
//       Type 'ConcreteFunc' is not assignable to type 'AbstractFunc'.
//       Types of parameters 'value1' and 'value' are incompatible.
//       Type 'string' is not assignable to type '"hello"'.
let z: AbstractFunc = u;
</code>```

But I get the specified error message.

In my opinion this behaviour does not make sense. A Function that accepts a literal string as input type should be assignable to a more abstract function that accepts a regular string as input.

Are my assumptions wrong or is this a mistake made by typescript?

Body:
I have two Function types:

type AbstractFunc = (value: string) => boolean
type ConcreteFunc = (value1: 'hello') => boolean

Since I can assign a variable of the literal type 'hello' to a variable of type string, I thought I can do the same with my two functions for example:

let z1: 'hello' = 'hello' as const
// No Error
let z2: string  = z1;

type AbstractFunc = (value: string) => boolean
type ConcreteFunc = (value1: 'hello') => boolean

let u: ConcreteFunc = null as any;

// Error:
//       Type 'ConcreteFunc' is not assignable to type 'AbstractFunc'.
//       Types of parameters 'value1' and 'value' are incompatible.
//       Type 'string' is not assignable to type '"hello"'.
let z: AbstractFunc = u;

But I get the specified error message.

In my opinion this behaviour does not make sense. A Function that accepts a literal string as input type should be assignable to a more abstract function that accepts a regular string as input.

Are my assumptions wrong or is this a mistake made by typescript?


问:
How to FIX OutOfMemoryError for seemingly very light resource 64 byte
I have got a android.view.InflateException, and further down the stacktrace, I've got this outOfMemory exception at the line where a 4 kb XML drawable is loaded with srcCombat into an AppCompatImageView.

```<code>   <androidx.appcompat.widget.AppCompatImageView
        android:id="@+id/img_arrow"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:srcCompat="@drawable/ic_menu_profile_arrow" />
</code>```

StackTrace::

```<code>Caused by java.lang.OutOfMemoryError: Failed to allocate a 64 byte allocation with 3187176 free bytes and 3112KB until OOM, target footprint 402653184, growth limit 402653184; giving up on allocation because <1% of heap free after GC.
   at android.graphics.drawable.VectorDrawable.inflateChildElements(VectorDrawable.java:853)
   at android.graphics.drawable.VectorDrawable.inflate(VectorDrawable.java:752)
</code>```

Whats the meaning of this, I mean, if there is  3187176 free bytes why can't a 64 byte be allocated?

Whats the meaning of OOM, target footprint, and growth limit.

Body:
I have got a android.view.InflateException, and further down the stacktrace, I've got this outOfMemory exception at the line where a 4 kb XML drawable is loaded with srcCombat into an AppCompatImageView.

   <androidx.appcompat.widget.AppCompatImageView
        android:id="@+id/img_arrow"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:srcCompat="@drawable/ic_menu_profile_arrow" />

StackTrace::

Caused by java.lang.OutOfMemoryError: Failed to allocate a 64 byte allocation with 3187176 free bytes and 3112KB until OOM, target footprint 402653184, growth limit 402653184; giving up on allocation because <1% of heap free after GC.
   at android.graphics.drawable.VectorDrawable.inflateChildElements(VectorDrawable.java:853)
   at android.graphics.drawable.VectorDrawable.inflate(VectorDrawable.java:752)

Whats the meaning of this, I mean, if there is  3187176 free bytes why can't a 64 byte be allocated?

Whats the meaning of OOM, target footprint, and growth limit.


问:
how to send notification in App that a date is approaching with scheduler in Laravel
I'm trying to send notification to user(i have only one user ,it's a dashboard)
in the App if the start_date is approaching ,so i tried to use task scheduler but i don't know how to use notification with task scheduler , should I create a table that save the notification in the database ?
So this is what i did:

```<code>
class CongeNotification extends Notification
{
    use Queueable;
    public $conge;
    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct(Conge $conge)
    {
        $this->conge = $conge;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['database'];
    }

    public function toArray($notifiable)
    {
        return [
            'conge_id' => $this->conge->id
        ];
    }

</code>```

and this is my command:

```<code>class NotifyUsers extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'users:notify';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'conge notification added';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
    //$conge =Conge::all();
    $now = Carbon::now();
    $conge =Conge::where('start_date','<',$now->addDays(7))->get() ->each(function ($conge) {
        DB::table('notification')->insert($conge->id);
    });

    }

</code>```
```<code>`please any help`
</code>```

i tried to create in handle a notification that notify the user a 7 day before the start_date

Body:
I'm trying to send notification to user(i have only one user ,it's a dashboard)
in the App if the start_date is approaching ,so i tried to use task scheduler but i don't know how to use notification with task scheduler , should I create a table that save the notification in the database ?
So this is what i did:

class CongeNotification extends Notification
{
    use Queueable;
    public $conge;
    /**
     * Create a new notification instance.
     *
     * @return void
     */
    public function __construct(Conge $conge)
    {
        $this->conge = $conge;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return ['database'];
    }

    public function toArray($notifiable)
    {
        return [
            'conge_id' => $this->conge->id
        ];
    }

and this is my command:

class NotifyUsers extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'users:notify';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'conge notification added';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
    //$conge =Conge::all();
    $now = Carbon::now();
    $conge =Conge::where('start_date','<',$now->addDays(7))->get() ->each(function ($conge) {
        DB::table('notification')->insert($conge->id);
    });

    }

`please any help`

i tried to create in handle a notification that notify the user a 7 day before the start_date


问:
Property 'MarkerImage' does not exist on type 'typeof maps'
I am running React JS, Typescript with @react-google-maps/api. All good but adding Typescript to the ReactJS I get typescript error:

Property 'MarkerImage' does not exist on type 'typeof maps'.

I have installed @types/google.maps hoping this will resolve the issue, but it did not.

Function where the error occurs looks like this:

```<code>  drawMarker = () => {
      return <Marker
      position={{
        lat: this.state.lat,
        lng: this.state.lng
      }}
      icon={
        new window.google.maps.MarkerImage(
          markerPosition,
          null, /* size is determined at runtime */
          null, /* origin is 0,0 */
          null, /* anchor is bottom center of the scaled image */
          new window.google.maps.Size(48, 48)
        )
      }
    >
    </Marker>
  }
</code>```

It is in the icon section:
new window.google.maps.MarkerImage(

Did anyone had any such issue before and know how to resolve it? Thank you for your time and kind help.

Body:
I am running React JS, Typescript with @react-google-maps/api. All good but adding Typescript to the ReactJS I get typescript error:

Property 'MarkerImage' does not exist on type 'typeof maps'.

I have installed @types/google.maps hoping this will resolve the issue, but it did not.

Function where the error occurs looks like this:

  drawMarker = () => {
      return <Marker
      position={{
        lat: this.state.lat,
        lng: this.state.lng
      }}
      icon={
        new window.google.maps.MarkerImage(
          markerPosition,
          null, /* size is determined at runtime */
          null, /* origin is 0,0 */
          null, /* anchor is bottom center of the scaled image */
          new window.google.maps.Size(48, 48)
        )
      }
    >
    </Marker>
  }

It is in the icon section:
new window.google.maps.MarkerImage(

Did anyone had any such issue before and know how to resolve it? Thank you for your time and kind help.


问:
Toast Notification launches app in background instead of foreground
I need help with Toast Notifications. I've written a script that creates and sends a Toast notification with custom buttons and protocols. The issue is that it launches apps in background. How would I go about launching them in foreground or focus?

REGISTRY KEYS FOR CUSTOM PROTOCOLS

```<code>$1 = @(
        [pscustomobject]@{name = 'Time'; Link = 'C:\Users\XXX\Desktop\Personal\Scripts\Time_sleep.BAT'},
        [pscustomobject]@{name = 'Zenek'; Link = 'C:\Users\XXX\Desktop\Personal\Scripts\email.bat'},
        [pscustomobject]@{name = 'NetEx'; Link = 'C:\Users\XXX\Desktop\Personal\Scripts\ne.bat'},
        [pscustomobject]@{name = 'Busy'; Link = 'C:\Users\XXX\Desktop\Personal\Scripts\busy.bat'},
        [pscustomobject]@{name = 'Shorts'; Link = 'C:\Users\XXX\Desktop\Personal\Scripts\Shortcuts.bat'}
    )
     $1 | % {
$RegPath = "HKCU:\Software\Classes\$($_.name)\"
New-Item -Path "$RegPath" -Force |Out-Null
New-ItemProperty -Path "$RegPath" -Name "(Default)" -Value "URL:$($_.name) Protocol" -PropertyType "String"|Out-Null
New-ItemProperty -Path "$RegPath" -Name "URL Protocol" -Value "" -PropertyType "String"|Out-Null
New-Item -Path "$RegPath\shell\open\command" -Force|Out-Null
New-ItemProperty -Path "$RegPath\shell\open\command" -Name "(Default)" -Value $_.Link -PropertyType "String"|Out-Null
    }

</code>```

EXAMPLE BAT FILE CONTENT
'SHORTCUTS.BAT'

```<code>@echo off
color b
echo List of shortcuts
echo BUSY      CTRL + ALT + C
echo MAIL      CTRL + ALT + L
echo NETEXT    CTRL + ALT + N
echo HIBERNATE CTRL + ALT + H
echo TIME      CTRL + ALT + T
echo ASSOC     CTRL + ALT + P
echo DRIVES    CTRL + ALT + D
pause
</code>```

SCRIPT

```<code>function Show-Toast{
[cmdletbinding()]
param(
[Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position = 0)]
[string]$Title,
[Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position = 1)]
[string]$message
)

[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime]|Out-Null
[Windows.UI.Notifications.ToastNotification, Windows.UI.Notifications, ContentType = WindowsRuntime]|Out-Null
[Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime]|out-null

$guid = '{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\WindowsPowerShell\v1.0\powershell.exe'
$ToastTitle = ""
$Signature = ""
$CustomHello = "Hello {0}.{1}" -f ($env:USERNAME[0].ToString()).ToUpper(), (($env:USERNAME.ToString()).Substring(1)).ToUpper()
$BannerImage = 'C:\Users\XXX\Desktop\Personal\Scripts\Toast\lake.jpg'

$template = @"
<toast scenario="reminder">>
    <visual>
        <binding template = "ToastGeneric">
         <text>$CustomHello</text>
            <text>$ToastTitle</text>
            <text placement="attribution">$Signature</text>

        <group>
                <subgroup>
                    <text hint-style="title" hint-wrap="true" >$Title</text>
                </subgroup>
            </group>
            <group>
                <subgroup>
                    <text hint-style="base" hint-wrap="true" >$message</text>
                </subgroup>
            </group>
            <group>
                <subgroup>
                    <text hint-style="captionSubtle" hint-wrap="true" >$Title</text>
                </subgroup>
            </group>
            <group>
                <subgroup>
                    <text hint-style="body" hint-wrap="true" >$message</text>
                </subgroup>
            </group>
            <image placement="hero" src="$BannerImage"/>

        </binding>
    </visual>
        <actions>
            <action arguments="Zenek:" content="Zenek" activationType="protocol" />
            <action arguments="NetEx:" content="NetEx" activationType="protocol"/>
            <action arguments="Busy:" content="Busy" activationType="protocol"/>
            <action arguments="Time:" content="Time" activationType="protocol"/>
            <action arguments="shorts:" content="Shorts" activationType="protocol"/>

            </actions>
</toast>
"@

$xml = [Windows.Data.Xml.Dom.XmlDocument]::new()
$xml.LoadXml($template)
$toast =  [Windows.UI.Notifications.ToastNotification]::new($xml)
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier($guid).Show($toast)
}
 [pscustomobject]@{
 Title = "Test"
 message = "Another"
 }| Show-Toast
</code>```

How Shortcuts.bat is launched:

versus how I want it to be launched (as an active/selected/focused window):

Body:
I need help with Toast Notifications. I've written a script that creates and sends a Toast notification with custom buttons and protocols. The issue is that it launches apps in background. How would I go about launching them in foreground or focus?

REGISTRY KEYS FOR CUSTOM PROTOCOLS

$1 = @(
        [pscustomobject]@{name = 'Time'; Link = 'C:\Users\XXX\Desktop\Personal\Scripts\Time_sleep.BAT'},
        [pscustomobject]@{name = 'Zenek'; Link = 'C:\Users\XXX\Desktop\Personal\Scripts\email.bat'},
        [pscustomobject]@{name = 'NetEx'; Link = 'C:\Users\XXX\Desktop\Personal\Scripts\ne.bat'},
        [pscustomobject]@{name = 'Busy'; Link = 'C:\Users\XXX\Desktop\Personal\Scripts\busy.bat'},
        [pscustomobject]@{name = 'Shorts'; Link = 'C:\Users\XXX\Desktop\Personal\Scripts\Shortcuts.bat'}
    )
     $1 | % {
$RegPath = "HKCU:\Software\Classes\$($_.name)\"
New-Item -Path "$RegPath" -Force |Out-Null
New-ItemProperty -Path "$RegPath" -Name "(Default)" -Value "URL:$($_.name) Protocol" -PropertyType "String"|Out-Null
New-ItemProperty -Path "$RegPath" -Name "URL Protocol" -Value "" -PropertyType "String"|Out-Null
New-Item -Path "$RegPath\shell\open\command" -Force|Out-Null
New-ItemProperty -Path "$RegPath\shell\open\command" -Name "(Default)" -Value $_.Link -PropertyType "String"|Out-Null
    }

EXAMPLE BAT FILE CONTENT
'SHORTCUTS.BAT'

@echo off
color b
echo List of shortcuts
echo BUSY      CTRL + ALT + C
echo MAIL      CTRL + ALT + L
echo NETEXT    CTRL + ALT + N
echo HIBERNATE CTRL + ALT + H
echo TIME      CTRL + ALT + T
echo ASSOC     CTRL + ALT + P
echo DRIVES    CTRL + ALT + D
pause

SCRIPT

function Show-Toast{
[cmdletbinding()]
param(
[Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position = 0)]
[string]$Title,
[Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position = 1)]
[string]$message
)

[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime]|Out-Null
[Windows.UI.Notifications.ToastNotification, Windows.UI.Notifications, ContentType = WindowsRuntime]|Out-Null
[Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime]|out-null

$guid = '{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\WindowsPowerShell\v1.0\powershell.exe'
$ToastTitle = ""
$Signature = ""
$CustomHello = "Hello {0}.{1}" -f ($env:USERNAME[0].ToString()).ToUpper(), (($env:USERNAME.ToString()).Substring(1)).ToUpper()
$BannerImage = 'C:\Users\XXX\Desktop\Personal\Scripts\Toast\lake.jpg'

$template = @"
<toast scenario="reminder">>
    <visual>
        <binding template = "ToastGeneric">
         <text>$CustomHello</text>
            <text>$ToastTitle</text>
            <text placement="attribution">$Signature</text>

        <group>
                <subgroup>
                    <text hint-style="title" hint-wrap="true" >$Title</text>
                </subgroup>
            </group>
            <group>
                <subgroup>
                    <text hint-style="base" hint-wrap="true" >$message</text>
                </subgroup>
            </group>
            <group>
                <subgroup>
                    <text hint-style="captionSubtle" hint-wrap="true" >$Title</text>
                </subgroup>
            </group>
            <group>
                <subgroup>
                    <text hint-style="body" hint-wrap="true" >$message</text>
                </subgroup>
            </group>
            <image placement="hero" src="$BannerImage"/>

        </binding>
    </visual>
        <actions>
            <action arguments="Zenek:" content="Zenek" activationType="protocol" />
            <action arguments="NetEx:" content="NetEx" activationType="protocol"/>
            <action arguments="Busy:" content="Busy" activationType="protocol"/>
            <action arguments="Time:" content="Time" activationType="protocol"/>
            <action arguments="shorts:" content="Shorts" activationType="protocol"/>

            </actions>
</toast>
"@

$xml = [Windows.Data.Xml.Dom.XmlDocument]::new()
$xml.LoadXml($template)
$toast =  [Windows.UI.Notifications.ToastNotification]::new($xml)
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier($guid).Show($toast)
}
 [pscustomobject]@{
 Title = "Test"
 message = "Another"
 }| Show-Toast

How Shortcuts.bat is launched:

versus how I want it to be launched (as an active/selected/focused window):


问:
how to set up node-http-mitm-proxy (certificate) with Android phone
My goal is to route and record the traffic from an Android phone (Chrome or my own app) over a proxy. I would like to use this one: https://github.com/joeferner/node-http-mitm-proxy

After configuring my phone's wifi settings (IP and port of desktop machine), and trying to load a page in the mobile chrome, I am now facing a "Your connection is not private" dialog. On the desktop my proxy displays following:

```<code>HTTPS_CLIENT_ERROR on : [Error: 8190125312:error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL alert number 46
] {
  library: 'SSL routines',
  function: 'ssl3_read_bytes',
  reason: 'sslv3 alert certificate unknown',
  code: 'ERR_SSL_SSLV3_ALERT_CERTIFICATE_UNKNOWN'
}
HTTPS_CLIENT_ERROR on : [Error: 8190125312:error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL alert number 46
] {
  library: 'SSL routines',
  function: 'ssl3_read_bytes',
  reason: 'sslv3 alert certificate unknown',
  code: 'ERR_SSL_SSLV3_ALERT_CERTIFICATE_UNKNOWN'
}
HTTPS_CLIENT_ERROR on : [Error: 8190125312:error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL alert number 46
] {
  library: 'SSL routines',
  function: 'ssl3_read_bytes',
  reason: 'sslv3 alert certificate unknown',
  code: 'ERR_SSL_SSLV3_ALERT_CERTIFICATE_UNKNOWN'
}
HTTPS_CLIENT_ERROR on : [Error: 8190125312:error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL alert number 46
] {
  library: 'SSL routines',
  function: 'ssl3_read_bytes',
  reason: 'sslv3 alert certificate unknown',
  code: 'ERR_SSL_SSLV3_ALERT_CERTIFICATE_UNKNOWN'
}
HTTPS_CLIENT_ERROR on : [Error: 8190125312:error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL alert number 46
] {
  library: 'SSL routines',
  function: 'ssl3_read_bytes',
  reason: 'sslv3 alert certificate unknown',
  code: 'ERR_SSL_SSLV3_ALERT_CERTIFICATE_UNKNOWN'
}
</code>```

I guess this is somehow related to certificates, but can someone point me into the right direction of how to solve this issue?

This is how it's done for Charles Proxy: https://stackoverflow.com/a/39227880/457059 I am just clueless about which certificate to install on the Android side in case of using node-http-mitm-proxy

Body:
My goal is to route and record the traffic from an Android phone (Chrome or my own app) over a proxy. I would like to use this one: https://github.com/joeferner/node-http-mitm-proxy

After configuring my phone's wifi settings (IP and port of desktop machine), and trying to load a page in the mobile chrome, I am now facing a "Your connection is not private" dialog. On the desktop my proxy displays following:

HTTPS_CLIENT_ERROR on : [Error: 8190125312:error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL alert number 46
] {
  library: 'SSL routines',
  function: 'ssl3_read_bytes',
  reason: 'sslv3 alert certificate unknown',
  code: 'ERR_SSL_SSLV3_ALERT_CERTIFICATE_UNKNOWN'
}
HTTPS_CLIENT_ERROR on : [Error: 8190125312:error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL alert number 46
] {
  library: 'SSL routines',
  function: 'ssl3_read_bytes',
  reason: 'sslv3 alert certificate unknown',
  code: 'ERR_SSL_SSLV3_ALERT_CERTIFICATE_UNKNOWN'
}
HTTPS_CLIENT_ERROR on : [Error: 8190125312:error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL alert number 46
] {
  library: 'SSL routines',
  function: 'ssl3_read_bytes',
  reason: 'sslv3 alert certificate unknown',
  code: 'ERR_SSL_SSLV3_ALERT_CERTIFICATE_UNKNOWN'
}
HTTPS_CLIENT_ERROR on : [Error: 8190125312:error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL alert number 46
] {
  library: 'SSL routines',
  function: 'ssl3_read_bytes',
  reason: 'sslv3 alert certificate unknown',
  code: 'ERR_SSL_SSLV3_ALERT_CERTIFICATE_UNKNOWN'
}
HTTPS_CLIENT_ERROR on : [Error: 8190125312:error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL alert number 46
] {
  library: 'SSL routines',
  function: 'ssl3_read_bytes',
  reason: 'sslv3 alert certificate unknown',
  code: 'ERR_SSL_SSLV3_ALERT_CERTIFICATE_UNKNOWN'
}

I guess this is somehow related to certificates, but can someone point me into the right direction of how to solve this issue?

This is how it's done for Charles Proxy: https://stackoverflow.com/a/39227880/457059 I am just clueless about which certificate to install on the Android side in case of using node-http-mitm-proxy


问:
React Dynamic meta tags
I am using Reactjs and codeigniter APIs but the problem is in react side. Here is the reactjs meta tags code which rendered when a new page load and get API response. The content of meta tags is updating but in the meta preview apps it is not shwoing the data.

```<code>          <Helmet>
            <title>{data.page_title}</title>
            <meta name="title" content={site_settings.site_name} />
            <meta name="description" content={meta_desc.meta_description} />
            <meta name="keywords" content={meta_desc.meta_keywords} />
            <meta property="og:title" content={meta_desc.og_title} />
            <meta
              property="og:descripiton"
              content={meta_desc.og_description}
            />
            <meta property="og:url" content={window.location.href} />
            <meta
              property="og:image"
              content={`${site_settings.site_domain}api/uploads/images/${site_settings.site_logo}`}
            />
            <meta property="og:type" content="website" />
          </Helmet>
</code>```

Html head

Meta preview apps response

I have used React Helmet, React Document Meta etc npm libraries. but it is not working. Is there a solution that would work without SSR? Or an easy solution with SSR?

Title: React Dynamic meta tags

Body:
I am using Reactjs and codeigniter APIs but the problem is in react side. Here is the reactjs meta tags code which rendered when a new page load and get API response. The content of meta tags is updating but in the meta preview apps it is not shwoing the data.

          <Helmet>
            <title>{data.page_title}</title>
            <meta name="title" content={site_settings.site_name} />
            <meta name="description" content={meta_desc.meta_description} />
            <meta name="keywords" content={meta_desc.meta_keywords} />
            <meta property="og:title" content={meta_desc.og_title} />
            <meta
              property="og:descripiton"
              content={meta_desc.og_description}
            />
            <meta property="og:url" content={window.location.href} />
            <meta
              property="og:image"
              content={`${site_settings.site_domain}api/uploads/images/${site_settings.site_logo}`}
            />
            <meta property="og:type" content="website" />
          </Helmet>

Html head

Meta preview apps response

I have used React Helmet, React Document Meta etc npm libraries. but it is not working. Is there a solution that would work without SSR? Or an easy solution with SSR?


问:
Can I clipPath on a div in Vercel/OG Image generator in React?
Basically I am trying to display a div which splits a text section from a image via a clipPath which is a inverted triangle. (The parent Element is a flex row) I tested it in normal React and everything seemed to work, now as I copied the working code to the og.tsx, it somehow just displays a square as you can see in the image:

The result should look like this:

Instead it looks like this:

The code i used for clipping the div is the following:

```<code>...
<div
  style={{
  backgroundColor: 'white',
  width: '132px',
  height: '100%',
  clipPath: 'polygon(100% 0, 0% 100%, 0 0)',
  }}
 />
</code>```

Body:
Basically I am trying to display a div which splits a text section from a image via a clipPath which is a inverted triangle. (The parent Element is a flex row) I tested it in normal React and everything seemed to work, now as I copied the working code to the og.tsx, it somehow just displays a square as you can see in the image:

The result should look like this:

Instead it looks like this:

The code i used for clipping the div is the following:

...


问:
Ratelimit Specific path using Spring gateway
I was trying to migrate my project to the Latest spring gateway, previously I was using zuul rate limiter which has the flexibility to the specific exact path to rate limit ex "/api/xxx/yyy" but using the latest spring gateway, especially if I have service discovery, I have to apply rate-limiting on the whole service, is there a way to work around this?</p>


问:
How to get Swapiness Value from Node Exporter Grafana?
what is the metrice used for fetching the swapiness value by using node exporter?

I need to display the swapiness value to grafana dashboard


问:
How to establish a persistent connection to a WebSocket server in Laravel to receive and send messages?
I have created a Laravel backend, which is an API. React frontend interacts with it. The frontend also communicates with the websocket server, receiving messages from it and reacting appropriately from it.
I was given the task of sending messages to a remote web socket from my backend.

I created the defined events to dispatch and listeners for those events. As far as I understand, in listeners I have to send messages to the websocket server. I was trying to use the textalk/websocket library, i.e. creating a websocket connection every time I sent a message to the websocket. It's wrong, but at least it worked. But now I need to keep a permanent connection with this web socket in order to receive messages from it and respond to them. And also I need to still keep sending messages on certain backend events.In general, I need to keep open the connection of my backend with a remote web socket server in order to constantly receive messages from it and in turn send messages to it at certain events within the Laravel application.


问:
Is it possible to add background color in each cell in FullCalendar V5 timeGridWeek?
I have this Time Grid Week from FullCalendar

Time Grid Week from FullCalendar

Is it possible to change the background color for a specific day and specific time? For example in Monday from 7:00AM to 10:00AM, I want to change the background color in red.

I tried to inspect the element, I can't find any element that represents a single cell, but I can only see a full row.enter image description here


问:
Is it possible to restrict searches to tracked files only?
When using Edit > "Search in Files" I'd like to exclude "untracked" files (identified by the U). Is there a way to achieve this?