问:
Unhandled exception 0xE0434352 does not get wrapped into a .NET Exception
Here's my scenario:

.NET 6.0.11

Native application, running as a Windows service, calls a .NET 6 assembly via a .NET generated .comhost.dll using COM

The .NET assembly blocks on System.Net.Sockets.Socket.Receive call

When shutting down the OS, the Receive call gets an unhandled exception:

Unhandled exception at 0x77438642 (KERNELBASE.dll) in myapp.exe.3180.dmp: 0xE0434352 (parameters: 0x80004005, 0x00000000, 0x00000000, 0x00000000, 0x71370000).

The try/catch block cannot handle the exception, i.e. it seems the exception isn't wrapped into a .NET Exception and the catch block below isn't hit:

try
{
    return s.Receive(buffer); // <- the unhandled exception seen in a crash dump
}
catch (Exception ex)
{
    Trace($"Receive error - ex: {ex}");
    throw;
}
```
<p>This unhandled exception does not result in a HRESULT being returned to the native code and the process crashes. A registered <code>AppDomain.CurrentDomain.UnhandledException</code> does not get triggered.</p>
<p>When the OS runs normally, the internal Receive exceptions are properly wrapped into an Exception, the catch block is hit and a HRESULT is returned to the native code.</p>
<p>I'm colleting the crash dump with WER. This crash gets also logged as Informational in the Application Windows Logs:</p>
```Fault bucket 1695090666501866404, type 1
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: myapp.exe
P2: 1.0.0.0
P3: 63984a64
P4: KERNELBASE.dll
P5: 10.0.20348.1249
P6: ac7a852c
P7: e0434352
P8: 00138642
P9:
P10:
```
<p>The native stack for the exception is:</p>
```    KERNELBASE.dll!_RaiseException@16() Unknown
    coreclr.dll!RaiseTheExceptionInternalOnly(Object * throwable, int rethrow=0x00000000, int) Line 2807    C++
    coreclr.dll!IL_Throw(Object * obj=0x021463a0) Line 4119 C++
    System.Net.Sockets.dll!6fb66362()   Unknown
    [Frames below may be incorrect and/or missing, native debugger attempting to walk managed call stack]
    073689cd()  Unknown
    07368801()  Unknown
    0736843d()  Unknown
    073682c8()  Unknown
    coreclr.dll!@COMToCLRDispatchHelper@32()    Unknown
    coreclr.dll!InvokeStub(ComCallMethodDesc * pCMD, unsigned long pManagedTarget=0x021463a0, Object * orThis=0x0213efac, ComMethodFrame * pFrame=0x0191eea8, Thread * pThread=0x00b96d40, unsigned __int64 * pRetValOut=0x0191ee88) Line 197   C++
    [Inline Frame] coreclr.dll!COMToCLRInvokeTarget(unsigned long) Line 342 C++
    [Inline Frame] coreclr.dll!COMToCLRWorkerBody(Thread *) Line 457    C++
    coreclr.dll!COMToCLRWorker(Thread * pThread=0x00b96d40, ComMethodFrame * pFrame=0x0191eea8) Line 560    C++
    01d0d359()  Unknown
    .. the rest of the stack in myapp.exe ...
```
<p>And the managed stack is:</p>
```    KERNELBASE.dll!_RaiseException@16() Unknown
    [Managed to Native Transition]
    System.Net.Sockets.dll!System.Net.Sockets.Socket.Receive(System.Span<byte> buffer) Line 1495    C#
    .. the rest of the stack in myapp.exe ..
```

Do you have any suggestions on how to proceed with debugging this?

Thank you.

Body:
Here's my scenario:

.NET 6.0.11

Native application, running as a Windows service, calls a .NET 6 assembly via a .NET generated .comhost.dll using COM

The .NET assembly blocks on System.Net.Sockets.Socket.Receive call

When shutting down the OS, the Receive call gets an unhandled exception:

Unhandled exception at 0x77438642 (KERNELBASE.dll) in myapp.exe.3180.dmp: 0xE0434352 (parameters: 0x80004005, 0x00000000, 0x00000000, 0x00000000, 0x71370000).

The try/catch block cannot handle the exception, i.e. it seems the exception isn't wrapped into a .NET Exception and the catch block below isn't hit:

try
{
    return s.Receive(buffer); // <- the unhandled exception seen in a crash dump
}
catch (Exception ex)
{
    Trace($"Receive error - ex: {ex}");
    throw;
}

This unhandled exception does not result in a HRESULT being returned to the native code and the process crashes. A registered AppDomain.CurrentDomain.UnhandledException does not get triggered.

When the OS runs normally, the internal Receive exceptions are properly wrapped into an Exception, the catch block is hit and a HRESULT is returned to the native code.

I'm colleting the crash dump with WER. This crash gets also logged as Informational in the Application Windows Logs:

Fault bucket 1695090666501866404, type 1
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: myapp.exe
P2: 1.0.0.0
P3: 63984a64
P4: KERNELBASE.dll
P5: 10.0.20348.1249
P6: ac7a852c
P7: e0434352
P8: 00138642
P9:
P10:

The native stack for the exception is:

    KERNELBASE.dll!_RaiseException@16() Unknown
    coreclr.dll!RaiseTheExceptionInternalOnly(Object * throwable, int rethrow=0x00000000, int) Line 2807    C++
    coreclr.dll!IL_Throw(Object * obj=0x021463a0) Line 4119 C++
    System.Net.Sockets.dll!6fb66362()   Unknown
    [Frames below may be incorrect and/or missing, native debugger attempting to walk managed call stack]
    073689cd()  Unknown
    07368801()  Unknown
    0736843d()  Unknown
    073682c8()  Unknown
    coreclr.dll!@COMToCLRDispatchHelper@32()    Unknown
    coreclr.dll!InvokeStub(ComCallMethodDesc * pCMD, unsigned long pManagedTarget=0x021463a0, Object * orThis=0x0213efac, ComMethodFrame * pFrame=0x0191eea8, Thread * pThread=0x00b96d40, unsigned __int64 * pRetValOut=0x0191ee88) Line 197   C++
    [Inline Frame] coreclr.dll!COMToCLRInvokeTarget(unsigned long) Line 342 C++
    [Inline Frame] coreclr.dll!COMToCLRWorkerBody(Thread *) Line 457    C++
    coreclr.dll!COMToCLRWorker(Thread * pThread=0x00b96d40, ComMethodFrame * pFrame=0x0191eea8) Line 560    C++
    01d0d359()  Unknown
    .. the rest of the stack in myapp.exe ...

And the managed stack is:

    KERNELBASE.dll!_RaiseException@16() Unknown
    [Managed to Native Transition]
    System.Net.Sockets.dll!System.Net.Sockets.Socket.Receive(System.Span<byte> buffer) Line 1495    C#
    .. the rest of the stack in myapp.exe ..

Do you have any suggestions on how to proceed with debugging this?

Thank you.


来源: stackexchange

问:
How to prevent animate.css to restart itself after hover in react
I've a problem in animate.css with React.JS, when I apply hover effect it restarts the animation after hover. how can I prevent that ?

useEffect(() => {
    setTimeout(() => {
      document.getElementById("extra-title").style.display = "block"
    }, 3000)
  }, [])
```
<p>and the scss code is:</p>
<pre class="lang-css prettyprint-override"><code>#extra-title {
    cursor: default;
    display: none;
    color: #091831;
    font-size: clamp(0.1rem, 10vw + 0.5rem, 1rem);

    &:hover {
        animation: shakeX 1s 0s forwards;
    }
}
</code>```

I tried to apply the animation when hovering and ok it is working, but after hovering it repeats the animation

ContentLicense: CC BY-SA 4.0

Body:
I've a problem in animate.css with React.JS, when I apply hover effect it restarts the animation after hover. how can I prevent that ?

useEffect(() => {
    setTimeout(() => {
      document.getElementById("extra-title").style.display = "block"
    }, 3000)
  }, [])

and the scss code is:

#extra-title {
    cursor: default;
    display: none;
    color: #091831;
    font-size: clamp(0.1rem, 10vw + 0.5rem, 1rem);

    &:hover {
        animation: shakeX 1s 0s forwards;
    }
}

I tried to apply the animation when hovering and ok it is working, but after hovering it repeats the animation


问:
Trying to access the fields and files property when using Form Data to send data to the back end
i am working on a small application for learning purposes i am trying to access a bunch of data sent to the backend using formdata in react. i am trying to access the data on the backend using req.fields and i keep getting undefined

React code

```<code>import { useState } from 'react';
import axios from "axios";
import TextField from '@mui/material/TextField';
import { DatePicker } from "antd";
import moment from "moment";

const CreateHotels = () => {
    const user = localStorage.getItem("auth");
    let userObj = JSON.parse(user);
    const token = userObj.token;

    const [values, setValues] = useState({
        title: "",
        bed: "",
        from: "",
        to: "",
        image: "",
        price: ""
    })
    const { image, title, bed, from, to, price } = values;

    const handleSubmit = async (e) => {
        e.preventDefault();
        let hotelData = new FormData();
        hotelData.append("title", title)
        hotelData.append("bed", bed)
        hotelData.append("from", from)
        hotelData.append("to", to)
        image && hotelData.append("image", image)
        hotelData.append("price", price)
        try {
            let response = await axios.post(`http://localhost:7000/api/createhotels`, hotelData , {
                headers: {
                    Authorization: `Bearer ${token}`
                }
            })
            console.log(response)
        } catch (err) {
            console.log(err)
        }
    }

    const handleImageChange = (e) => {
        setValues((prevValues) => ({ ...prevValues, image: e.target.files[0] }))
    }

    const handleChange = (e) => {
        const { target: { value, name } } = e
        setValues(prevValues => ({ ...prevValues, [name]: value }))
    }

    return (
        <div>
            <form onSubmit={handleSubmit}>
            <input onChange={handleImageChange} type="file" />
            <TextField name="title" onChange={handleChange} type="text" className='fields' id="outlined-basic" label="Title" variant="outlined" />
            <TextField name="bed" onChange={handleChange} type="text" className='fields' id="outlined-basic" label="Bed" variant="outlined" />
            <DatePicker
             name="from"
             className="datepickers"
             onChange={(date, dateString) => setValues(prevValues => ({...prevValues, from: dateString}))}
             disabledDate={(current) => current.valueOf() < moment().subtract(1, "days")}
             />
            <DatePicker
             name='to'
             className="datepickers"
             onChange={(date, dateString) => setValues(prevValues => ({...prevValues, to: dateString}))}
             disabledDate={(current) => current.valueOf() < moment().subtract(1, "days")}
             />
            <TextField  name='price' onChange={handleChange} className='fields' id="outlined-basic" label="Price" variant="outlined" />
            <button>POST HOTEL</button>
            </form>
        </div>
    )
}
export default CreateHotels;
</code>```

express controller

```<code>const Hotel = require("../models/hotel");
const fs = require('fs');

const createhotels = async (req, res) => {
    try {
         let fields = req.fields;
         let files = req.files;
         console.log(fields)
    } catch (err) {
        console.log(err)
    }
}

module.exports = {
    createhotels
}
</code>```

express routes

```<code>const express = require("express");
const router = express.Router();

const { createhotels } = require("../controllers/hotel");

router.post("/createhotels", createhotels);

module.exports = router;
</code>```

I have tried using req.fields to access the data but i keep getting undefined. Please i will appreciate if anyone can help me

Body:
i am working on a small application for learning purposes i am trying to access a bunch of data sent to the backend using formdata in react. i am trying to access the data on the backend using req.fields and i keep getting undefined

React code

import { useState } from 'react';
import axios from "axios";
import TextField from '@mui/material/TextField';
import { DatePicker } from "antd";
import moment from "moment";

const CreateHotels = () => {
    const user = localStorage.getItem("auth");
    let userObj = JSON.parse(user);
    const token = userObj.token;

    const [values, setValues] = useState({
        title: "",
        bed: "",
        from: "",
        to: "",
        image: "",
        price: ""
    })
    const { image, title, bed, from, to, price } = values;

    const handleSubmit = async (e) => {
        e.preventDefault();
        let hotelData = new FormData();
        hotelData.append("title", title)
        hotelData.append("bed", bed)
        hotelData.append("from", from)
        hotelData.append("to", to)
        image && hotelData.append("image", image)
        hotelData.append("price", price)
        try {
            let response = await axios.post(`http://localhost:7000/api/createhotels`, hotelData , {
                headers: {
                    Authorization: `Bearer ${token}`
                }
            })
            console.log(response)
        } catch (err) {
            console.log(err)
        }
    }

    const handleImageChange = (e) => {
        setValues((prevValues) => ({ ...prevValues, image: e.target.files[0] }))
    }

    const handleChange = (e) => {
        const { target: { value, name } } = e
        setValues(prevValues => ({ ...prevValues, [name]: value }))
    }

    return (

            <form onSubmit={handleSubmit}>
            <input onChange={handleImageChange} type="file" />
            <TextField name="title" onChange={handleChange} type="text" className='fields' id="outlined-basic" label="Title" variant="outlined" />
            <TextField name="bed" onChange={handleChange} type="text" className='fields' id="outlined-basic" label="Bed" variant="outlined" />
            <DatePicker
             name="from"
             className="datepickers"
             onChange={(date, dateString) => setValues(prevValues => ({...prevValues, from: dateString}))}
             disabledDate={(current) => current.valueOf() < moment().subtract(1, "days")}
             />
            <DatePicker
             name='to'
             className="datepickers"
             onChange={(date, dateString) => setValues(prevValues => ({...prevValues, to: dateString}))}
             disabledDate={(current) => current.valueOf() < moment().subtract(1, "days")}
             />
            <TextField  name='price' onChange={handleChange} className='fields' id="outlined-basic" label="Price" variant="outlined" />
            <button>POST HOTEL</button>
            </form>

    )
}
export default CreateHotels;

express controller

const Hotel = require("../models/hotel");
const fs = require('fs');

const createhotels = async (req, res) => {
    try {
         let fields = req.fields;
         let files = req.files;
         console.log(fields)
    } catch (err) {
        console.log(err)
    }
}

module.exports = {
    createhotels
}

express routes

const express = require("express");
const router = express.Router();

const { createhotels } = require("../controllers/hotel");

router.post("/createhotels", createhotels);

module.exports = router;

I have tried using req.fields to access the data but i keep getting undefined. Please i will appreciate if anyone can help me


问:
ComboBox not close the popup after select value from list
I noticed a strange behavior when selecting a value from a ComboBox from the initialize method annotated with @FXML. The behavior is that on initial selection from the control's popup sheet, it is not hidden.

Here is an example project

```<code>public class Main  extends Application {

    @Override
    public void start(Stage stage) throws Exception {
        Button test = new Button("Test");
        test.setOnAction(event -> {
            TestDialog dialog = new TestDialog(stage);
            dialog.show();
        });

        HBox hBox = new HBox(test);
        stage.setScene(new Scene(hBox, 300, 50));
        stage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
</code>```

```<code>public class TestDialog extends Dialog<ButtonType> {

    @FXML
    private ComboBox<Integer> baudRateComboBox;

    public TestDialog(Window owner) {
        try {
            FXMLLoader loader = new FXMLLoader();
            loader.setLocation(getClass().getResource("/com/sample/dialogpane.fxml"));
            loader.setController(this);

            initOwner(owner);
            initModality(Modality.APPLICATION_MODAL);

            setDialogPane(loader.load());
        }
        catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    @FXML
    private void initialize() {
        baudRateComboBox.getItems().setAll(4800, 9600, 19200, 38400, 57600, 115200);

        baudRateComboBox.getSelectionModel().select((Integer) 115200);
    }
}
</code>```

```<code><DialogPane xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml">

    <content>
        <HBox spacing="5" alignment="BASELINE_LEFT">
            <Label text="Baudrate:"/>
            <ComboBox fx:id="baudRateComboBox"/>
        </HBox>
    </content>

    <buttonTypes>
        <ButtonType text="Затвори" buttonData="CANCEL_CLOSE"/>
    </buttonTypes>

</DialogPane>
</code>```

If I select the value asynchronously, the problem disappears.

```<code>@FXML
private void initialize() {
    baudRateComboBox.getItems().setAll(4800, 9600, 19200, 38400, 57600, 115200);

    Platform.runLater(() -> baudRateComboBox.getSelectionModel().select((Integer) 115200));
}
</code>```

I am using jdk 18.0.1.1 on Ubuntu and javafx 19

Body:
I noticed a strange behavior when selecting a value from a ComboBox from the initialize method annotated with @FXML. The behavior is that on initial selection from the control's popup sheet, it is not hidden.

Here is an example project

public class Main  extends Application {

    @Override
    public void start(Stage stage) throws Exception {
        Button test = new Button("Test");
        test.setOnAction(event -> {
            TestDialog dialog = new TestDialog(stage);
            dialog.show();
        });

        HBox hBox = new HBox(test);
        stage.setScene(new Scene(hBox, 300, 50));
        stage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}

public class TestDialog extends Dialog<ButtonType> {

    @FXML
    private ComboBox<Integer> baudRateComboBox;

    public TestDialog(Window owner) {
        try {
            FXMLLoader loader = new FXMLLoader();
            loader.setLocation(getClass().getResource("/com/sample/dialogpane.fxml"));
            loader.setController(this);

            initOwner(owner);
            initModality(Modality.APPLICATION_MODAL);

            setDialogPane(loader.load());
        }
        catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    @FXML
    private void initialize() {
        baudRateComboBox.getItems().setAll(4800, 9600, 19200, 38400, 57600, 115200);

        baudRateComboBox.getSelectionModel().select((Integer) 115200);
    }
}

<DialogPane xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml">

    <content>
        <HBox spacing="5" alignment="BASELINE_LEFT">

            <ComboBox fx:id="baudRateComboBox"/>
        </HBox>
    </content>

    <buttonTypes>
        <ButtonType text="Затвори" buttonData="CANCEL_CLOSE"/>
    </buttonTypes>

</DialogPane>

If I select the value asynchronously, the problem disappears.

@FXML
private void initialize() {
    baudRateComboBox.getItems().setAll(4800, 9600, 19200, 38400, 57600, 115200);

    Platform.runLater(() -> baudRateComboBox.getSelectionModel().select((Integer) 115200));
}

I am using jdk 18.0.1.1 on Ubuntu and javafx 19


问:
Next.js fails on netlify because of Object.build in index.js
I am trying to add Intercom widget (JS code) to my website which is in Typescript mostly

I am getting an error in index.js, eventhough I don't have index.js file, and not pointing out to it or importing from it in any file

Here are the logs from Netlify

at /opt/build/repo/node_modules/next/dist/export/index.js:500:19 2:50:38 AM:     at runMicrotasks (<anonymous>) 2:50:38 AM:     at processTicksAndRejections (node:internal/process/task_queues:96:5) 2:50:38 AM:     at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/trace/trace.js:75:20) 2:50:38 AM:     at async /opt/build/repo/node_modules/next/dist/build/index.js:1021:17 2:50:38 AM:     at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/trace/trace.js:75:20) 2:50:38 AM:     at async /opt/build/repo/node_modules/next/dist/build/index.js:895:13 2:50:38 AM:     at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/trace/trace.js:75:20) 2:50:38 AM:     at async Object.build [as default] (/opt/build/repo/node_modules/next/dist/build/index.js:82:25) 2:50:38 AM: child process exited with code 1 2:50:39 AM: **error** Command failed with exit code 1. (https://ntl.fyi/exit-code-1) 2:50:39 AM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 2:50:39 AM: **error** Command failed with exit code 1. (https://ntl.fyi/exit-code-1) 2:50:39 AM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 2:50:39 AM:  2:50:39 AM: ──────────────────────────────────────────────────────────────── 2:50:39 AM:   "build.command" failed                                         2:50:39 AM: ──────────────────────────────────────────────────────────────── 2:50:39 AM:  2:50:39 AM:   Error message 2:50:39 AM:   Command failed with exit code 1: yarn build (https://ntl.fyi/exit-code-1) 2:50:39 AM:  2:50:39 AM:   Error location 2:50:39 AM:   In Build command from Netlify app: 2:50:39 AM:   yarn build

It was working fine until i added the intercom code (Intercom.JS), which is below and it works fine on my other JS website

```<code>// Set your APP_ID https://widget.intercom.io/widget/*
export const APP_ID = "****"

// Loads Intercom with the snippet
// This must be run before boot, it initializes window.Intercom
// prettier-ignore
export const load = () => {
  (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/' + APP_ID;var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s, x);};if(document.readyState==='complete'){l();}else if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
}

// Initializes Intercom
export const boot = (options = {}) => {
  window &&
    window.Intercom &&
    window.Intercom("boot", { app_id: APP_ID, ...options })
}

export const update = () => {
  window && window.Intercom && window.Intercom("update")
}
</code>```

I also edited _app.tsx to add the bootintercom and loadintercom functions as below after importing them from Intercom.JS

```<code>function MyApp({ Component, pageProps }: AppProps)

{
  BootIntercom()
  LoadIntercom()

  return (
    <>
</code>```

Body:
I am trying to add Intercom widget (JS code) to my website which is in Typescript mostly

I am getting an error in index.js, eventhough I don't have index.js file, and not pointing out to it or importing from it in any file

Here are the logs from Netlify

at /opt/build/repo/node_modules/next/dist/export/index.js:500:19 2:50:38 AM:     at runMicrotasks (<anonymous>) 2:50:38 AM:     at processTicksAndRejections (node:internal/process/task_queues:96:5) 2:50:38 AM:     at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/trace/trace.js:75:20) 2:50:38 AM:     at async /opt/build/repo/node_modules/next/dist/build/index.js:1021:17 2:50:38 AM:     at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/trace/trace.js:75:20) 2:50:38 AM:     at async /opt/build/repo/node_modules/next/dist/build/index.js:895:13 2:50:38 AM:     at async Span.traceAsyncFn (/opt/build/repo/node_modules/next/dist/trace/trace.js:75:20) 2:50:38 AM:     at async Object.build [as default] (/opt/build/repo/node_modules/next/dist/build/index.js:82:25) 2:50:38 AM: child process exited with code 1 2:50:39 AM: **error** Command failed with exit code 1. (https://ntl.fyi/exit-code-1) 2:50:39 AM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 2:50:39 AM: **error** Command failed with exit code 1. (https://ntl.fyi/exit-code-1) 2:50:39 AM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. 2:50:39 AM:  2:50:39 AM: ──────────────────────────────────────────────────────────────── 2:50:39 AM:   "build.command" failed                                         2:50:39 AM: ──────────────────────────────────────────────────────────────── 2:50:39 AM:  2:50:39 AM:   Error message 2:50:39 AM:   Command failed with exit code 1: yarn build (https://ntl.fyi/exit-code-1) 2:50:39 AM:  2:50:39 AM:   Error location 2:50:39 AM:   In Build command from Netlify app: 2:50:39 AM:   yarn build

It was working fine until i added the intercom code (Intercom.JS), which is below and it works fine on my other JS website

// Set your APP_ID https://widget.intercom.io/widget/*
export const APP_ID = "****"

// Loads Intercom with the snippet
// This must be run before boot, it initializes window.Intercom
// prettier-ignore
export const load = () => {
  (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/' + APP_ID;var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s, x);};if(document.readyState==='complete'){l();}else if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
}

// Initializes Intercom
export const boot = (options = {}) => {
  window &&
    window.Intercom &&
    window.Intercom("boot", { app_id: APP_ID, ...options })
}

export const update = () => {
  window && window.Intercom && window.Intercom("update")
}

I also edited _app.tsx to add the bootintercom and loadintercom functions as below after importing them from Intercom.JS

function MyApp({ Component, pageProps }: AppProps)

{
  BootIntercom()
  LoadIntercom()

  return (
    <>


问:
Changing camera_info orientation in ignition Gazebo (used with ROS2)
recently I am working on a project with ROS2 Galactic. I am trying to use a Simulated ignition Gazebo Robot with it. The goal is to make the SLAM algorithm rtabmap working.

At the moment I am facing the problem, that the camera_info topic visualizes the image at the top (as shown in the picture). I found that Gazebo uses a different coordinate system (https://answers.gazebosim.org/question/26690/how-to-get-the-camera-matrix-of-a-camera-sensor-in-ignition-gazebo/), but I am not able to change the orientation. When I try to change the pose, only the camera angle (picture) changes but the camera_info stays at the top. In addition, the point cloud is displayed correct, so it makes no sense to me, to use a tf2_transformation in ROS2. I added the rgbd_camera sensor code. The pose relative has only an effect at the camera picture. Sadly, I think that's the problem why I am not able to get a map from rtabmap. Culd someone please help me?
Visualization in Foxglove, used SDF file: sensors_demo.sdf from the ignition examples

```<code><model name="rgbd_camera">
      <pose>5 0 0.5 0 0.0 0</pose>
      <link name="link">
        <pose>0.05 0.05 0.05 0 0 0</pose>
        <inertial>
          <mass>0.1</mass>
          <inertia>
            <ixx>0.000166667</ixx>
            <iyy>0.000166667</iyy>
            <izz>0.000166667</izz>
          </inertia>
        </inertial>
        <collision name="collision">
          <geometry>
            <box>
              <size>0.1 0.1 0.1</size>
            </box>
          </geometry>
        </collision>
        <visual name="visual">
          <geometry>
            <box>
              <size>0.1 0.1 0.1</size>
            </box>
          </geometry>
        </visual>
        <sensor name="rgbd_camera" type="rgbd_camera">
          <pose relative_to="rgbd_camera::link">0 0 0 0 0 3.14</pose>
          <camera>
            <horizontal_fov>1.047</horizontal_fov>
            <image>
              <width>320</width>
              <height>240</height>
            </image>
            <clip>
              <near>0.1</near>
              <far>100</far>
            </clip>
          </camera>

          <always_on>1</always_on>
          <update_rate>30</update_rate>
          <visualize>true</visualize>
          <topic>rgbd_camera</topic>
          <enable_metrics>true</enable_metrics>
        </sensor>
      </link>
</model>
</code>```

Body:
recently I am working on a project with ROS2 Galactic. I am trying to use a Simulated ignition Gazebo Robot with it. The goal is to make the SLAM algorithm rtabmap working.

At the moment I am facing the problem, that the camera_info topic visualizes the image at the top (as shown in the picture). I found that Gazebo uses a different coordinate system (https://answers.gazebosim.org/question/26690/how-to-get-the-camera-matrix-of-a-camera-sensor-in-ignition-gazebo/), but I am not able to change the orientation. When I try to change the pose, only the camera angle (picture) changes but the camera_info stays at the top. In addition, the point cloud is displayed correct, so it makes no sense to me, to use a tf2_transformation in ROS2. I added the rgbd_camera sensor code. The pose relative has only an effect at the camera picture. Sadly, I think that's the problem why I am not able to get a map from rtabmap. Culd someone please help me?
Visualization in Foxglove, used SDF file: sensors_demo.sdf from the ignition examples

<model name="rgbd_camera">
      <pose>5 0 0.5 0 0.0 0</pose>
      <link name="link">
        <pose>0.05 0.05 0.05 0 0 0</pose>
        <inertial>
          <mass>0.1</mass>
          <inertia>
            <ixx>0.000166667</ixx>
            <iyy>0.000166667</iyy>
            <izz>0.000166667</izz>
          </inertia>
        </inertial>
        <collision name="collision">
          <geometry>
            <box>
              <size>0.1 0.1 0.1</size>
            </box>
          </geometry>
        </collision>
        <visual name="visual">
          <geometry>
            <box>
              <size>0.1 0.1 0.1</size>
            </box>
          </geometry>
        </visual>
        <sensor name="rgbd_camera" type="rgbd_camera">
          <pose relative_to="rgbd_camera::link">0 0 0 0 0 3.14</pose>
          <camera>
            <horizontal_fov>1.047</horizontal_fov>
            <image>
              <width>320</width>
              <height>240</height>
            </image>
            <clip>
              <near>0.1</near>
              <far>100</far>
            </clip>
          </camera>

          <always_on>1</always_on>
          <update_rate>30</update_rate>
          <visualize>true</visualize>
          <topic>rgbd_camera</topic>
          <enable_metrics>true</enable_metrics>
        </sensor>
      </link>
</model>


问:
AttributeError: 'XGBCdsDtContainer' object has no attribute 'logger' error when running pycaret setup()
I am new to pycaret and am trying out the timeseries analysis to create a forecasting model in relation to historical transaction data. I want to try out pycaret to see what type of model would best fit this datasample. When running the setup, I get the error: AttributeError: 'XGBCdsDtContainer' object has no attribute 'logger'. I can't find anything online, does someone how to fix this error?
enter image description here

As mentioned I tried to run the setup function from pycaret. This didn't workout, resulting in the error shown in the image


问:
How to update two tables at the same time in SQL?
I have two SQL Server tables, SERVIS_GON_TABLO and STOK_TABLO.

After I updated SERVIS_GON_TABLO a product, at the same time I want to update in stock table (STOK_TABLO) two different products.

I mean, I sent a product (from a barcode reader) to repair (SERVIS_GON_TABLO), and service location qty+1 and storage qty-1 .

But we sent a product wrongly and I changed to product to COMPUTER. In STOK_TABLO (stock table) barcode reader will be qty+1 to storage and service location qty will be qty-1. And COMPUTER will be qty-1 to storage and service location qty will be qty+1.

I use a gridview and with select command I sent them to the textboxes. Then with a stored procedure, I try to UPDATE tables. Could you help me with that stored procedure?

```<code>ALTER PROCEDURE UPDATE_TABLE
    (@STOCKID NVARCHAR(100),
     @MODELID NVARCHAR(100),
     @QTY INT,
     @FROM NVARCHAR(60),
     @TO NVARCHAR(60),
     @TEDARIKID NVARCHAR(150),
     @TED_TEL NVARCHAR(50))
AS
BEGIN
    DECLARE
         @StockQTY INT,
         @YeniUrunID NVARCHAR(100),
         @Location NVARCHAR(100)

    --This part which I sent to service and update a table(SERVIS_GON_TABLO)
    UPDATE SERVIS_GON_TABLO
    SET URUNID = @URUNID,
        MODELID = @MODELID,
        TEDARIKID = @TEDARIKID,
        TEDARIK_TELEFON = @TED_TEL
    WHERE SERVISID = @ID

    -- Below in other table I try to UPDATE at STOCK_TABLE which I sent to service new STOCK
    UPDATE STOK_TABLO
    SET ADET -= @ADET
    WHERE URUNID = @URUNID AND LOKASYONID = @NEREDEN

    UPDATE STOK_TABLO
    SET ADET += @ADET
    WHERE URUNID = @URUNID AND LOKASYONID = @NEREYE

    --LAST part which I pull back from the service
    UPDATE STOK_TABLO
    SET ADET -= @ADET
    WHERE URUNID = @YeniUrunID AND LOKASYONID = @NEREDEN

    UPDATE STOK_TABLO
    SET ADET += @ADET
    WHERE URUNID = @YeniUrunID AND LOKASYONID = @NEREYE

    SELECT * FROM SERVIS_GON_TABLO
END
</code>```

Body:
I have two SQL Server tables, SERVIS_GON_TABLO and STOK_TABLO.

After I updated SERVIS_GON_TABLO a product, at the same time I want to update in stock table (STOK_TABLO) two different products.

I mean, I sent a product (from a barcode reader) to repair (SERVIS_GON_TABLO), and service location qty+1 and storage qty-1 .

But we sent a product wrongly and I changed to product to COMPUTER. In STOK_TABLO (stock table) barcode reader will be qty+1 to storage and service location qty will be qty-1. And COMPUTER will be qty-1 to storage and service location qty will be qty+1.

I use a gridview and with select command I sent them to the textboxes. Then with a stored procedure, I try to UPDATE tables. Could you help me with that stored procedure?

ALTER PROCEDURE UPDATE_TABLE
    (@STOCKID NVARCHAR(100),
     @MODELID NVARCHAR(100),
     @QTY INT,
     @FROM NVARCHAR(60),
     @TO NVARCHAR(60),
     @TEDARIKID NVARCHAR(150),
     @TED_TEL NVARCHAR(50))
AS
BEGIN
    DECLARE
         @StockQTY INT,
         @YeniUrunID NVARCHAR(100),
         @Location NVARCHAR(100)

    --This part which I sent to service and update a table(SERVIS_GON_TABLO)
    UPDATE SERVIS_GON_TABLO
    SET URUNID = @URUNID,
        MODELID = @MODELID,
        TEDARIKID = @TEDARIKID,
        TEDARIK_TELEFON = @TED_TEL
    WHERE SERVISID = @ID

    -- Below in other table I try to UPDATE at STOCK_TABLE which I sent to service new STOCK
    UPDATE STOK_TABLO
    SET ADET -= @ADET
    WHERE URUNID = @URUNID AND LOKASYONID = @NEREDEN

    UPDATE STOK_TABLO
    SET ADET += @ADET
    WHERE URUNID = @URUNID AND LOKASYONID = @NEREYE

    --LAST part which I pull back from the service
    UPDATE STOK_TABLO
    SET ADET -= @ADET
    WHERE URUNID = @YeniUrunID AND LOKASYONID = @NEREDEN

    UPDATE STOK_TABLO
    SET ADET += @ADET
    WHERE URUNID = @YeniUrunID AND LOKASYONID = @NEREYE

    SELECT * FROM SERVIS_GON_TABLO
END


问:
Test failure because of adding of new line characters
I have a scenario where I need to test that nothing was changed. So I reference in context@select and expect@select to the same element.

<x:scenario label="Scenario for testing template with match 'tuplet'">
      <x:scenario label="@num.visible preserved">
        <x:param href="input/input_4.xml" name="global-context-item"/>
        <x:context mode="enable.tuplet.nums" select="$global-context-item/id('dir_22245')"/>
        <x:expect label="supplied with content will be preserved." select="$global-context-item/id('dir_22245')"/>
      </x:scenario>
    </x:scenario>```

The test fails because new lines are added:

[![oXygen Diff][2]][2]

I use oXygen XML Editor 25.0 and Xspec framework v2.2.6

[2]: https://i.stack.imgur.com/J7cE8.png
</code>```


问:
how to view only week in monthly formatted tablecalender in flutter
enter image description here,

i need this table calender view like its weekly formatted , and while clicking the left or right button it should change month not week

while i tried to change the calendar format to week the right and left button works as to switch between weeks but i need it to swith between months and while sliding through the weeks it should chnange to week is there any way to do that?

code //

```<code>TableCalendar(

  daysOfWeekStyle: const DaysOfWeekStyle(
      decoration: BoxDecoration(color: Colors.white)),
  daysOfWeekHeight: 20,

  calendarFormat: CalendarFormat.month,
  weekendDays: const [DateTime.sunday],
  calendarStyle: CalendarStyle(

      // canMarkersOverflow: true,
      todayDecoration: BoxDecoration(
          borderRadius: BorderRadius.circular(20),
          gradient: const LinearGradient(
              colors: [Color(0xFF20264B), Color(0xFF213BCE)],
              begin: Alignment.centerLeft,
              end: Alignment.centerRight)),
      rowDecoration: const BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.only(
              bottomLeft: Radius.circular(20),
              bottomRight: Radius.circular(20))),
      weekendTextStyle: const TextStyle(color: Colors.red)),
  headerStyle: HeaderStyle(
    headerMargin: EdgeInsets.only(bottom: 10),
      titleTextStyle: const TextStyle(color: Colors.white, fontSize: 20),
      decoration: BoxDecoration(
        shape: BoxShape.rectangle,
          borderRadius: BorderRadius.circular(50),
          gradient: const LinearGradient(

              colors: [Color(0xFF20264B), Color(0xFF213BCE)],
              begin: Alignment.centerLeft,
              end: Alignment.centerRight)),
      formatButtonVisible: false,
      titleCentered: true,
      leftChevronIcon: Container(
        height: 30,
        width: 30,
        decoration: BoxDecoration(
            color: const Color(0xFF0B0E20),
            borderRadius: BorderRadius.circular(50)),
        child: const Icon(
          Icons.keyboard_arrow_left,
          color: Colors.white,
        ),
      ),
      rightChevronIcon: Container(
        height: 30,
        width: 30,
        decoration: BoxDecoration(
            color: const Color(0xFF0B0E20),
            borderRadius: BorderRadius.circular(50)),
        child: const Icon(
          Icons.keyboard_arrow_right,
          color: Colors.white,
        ),
      )),
  firstDay: DateTime.utc(2010, 10, 16),
  lastDay: DateTime.utc(2030, 3, 14),
  focusedDay: DateTime.now(),

),

</code>```

Body:
enter image description here,

i need this table calender view like its weekly formatted , and while clicking the left or right button it should change month not week

while i tried to change the calendar format to week the right and left button works as to switch between weeks but i need it to swith between months and while sliding through the weeks it should chnange to week is there any way to do that?

code //

TableCalendar(

  daysOfWeekStyle: const DaysOfWeekStyle(
      decoration: BoxDecoration(color: Colors.white)),
  daysOfWeekHeight: 20,

  calendarFormat: CalendarFormat.month,
  weekendDays: const [DateTime.sunday],
  calendarStyle: CalendarStyle(

      // canMarkersOverflow: true,
      todayDecoration: BoxDecoration(
          borderRadius: BorderRadius.circular(20),
          gradient: const LinearGradient(
              colors: [Color(0xFF20264B), Color(0xFF213BCE)],
              begin: Alignment.centerLeft,
              end: Alignment.centerRight)),
      rowDecoration: const BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.only(
              bottomLeft: Radius.circular(20),
              bottomRight: Radius.circular(20))),
      weekendTextStyle: const TextStyle(color: Colors.red)),
  headerStyle: HeaderStyle(
    headerMargin: EdgeInsets.only(bottom: 10),
      titleTextStyle: const TextStyle(color: Colors.white, fontSize: 20),
      decoration: BoxDecoration(
        shape: BoxShape.rectangle,
          borderRadius: BorderRadius.circular(50),
          gradient: const LinearGradient(

              colors: [Color(0xFF20264B), Color(0xFF213BCE)],
              begin: Alignment.centerLeft,
              end: Alignment.centerRight)),
      formatButtonVisible: false,
      titleCentered: true,
      leftChevronIcon: Container(
        height: 30,
        width: 30,
        decoration: BoxDecoration(
            color: const Color(0xFF0B0E20),
            borderRadius: BorderRadius.circular(50)),
        child: const Icon(
          Icons.keyboard_arrow_left,
          color: Colors.white,
        ),
      ),
      rightChevronIcon: Container(
        height: 30,
        width: 30,
        decoration: BoxDecoration(
            color: const Color(0xFF0B0E20),
            borderRadius: BorderRadius.circular(50)),
        child: const Icon(
          Icons.keyboard_arrow_right,
          color: Colors.white,
        ),
      )),
  firstDay: DateTime.utc(2010, 10, 16),
  lastDay: DateTime.utc(2030, 3, 14),
  focusedDay: DateTime.now(),

),


问:
Vaadin Spring-Boot project not having connection to internet in Docker
My Vaadin spring-Boot project runs alrighty when run in IDE, but when I'm running it in docker, after navigating to adequate port, Vaadin message appears:

```<code>You are offline
Project Base for Vaadin requires an internet connection to work. You do not seem to have access to the server right now. Check your internet connection and try reloading the page to use the application.
</code>```

vaadin v.23

Is this docker or vaadin related problem?

Edit:
Dev-console in my browser:

Body:
My Vaadin spring-Boot project runs alrighty when run in IDE, but when I'm running it in docker, after navigating to adequate port, Vaadin message appears:

You are offline
Project Base for Vaadin requires an internet connection to work. You do not seem to have access to the server right now. Check your internet connection and try reloading the page to use the application.

vaadin v.23

Is this docker or vaadin related problem?

Edit:
Dev-console in my browser:


问:
Most Accessed Files
This is an apache log and is there any linux command to check like top 10 most access files (.html) inside the log file?

Tried the grep or cat commands but not sure how it is chained

Title: Most Accessed Files


问:
Getting a NullInjectorError / R3InjectorError in the console when trying to click on the link to Register
I'm getting the above mentioned errors in the console, when i click on Register. I'm using Angular and I have a CustomValidationService that's beeing called from my RegisterComponent and apparently somewhere inbetween I must be doing a circular dependency. Any  ideas what must be changed would be much appreciated.

Here is the error from the console:
console_errors

I'll paste my code here:

custom-validation.service.ts

```<code>import { Injectable } from '@angular/core';
import { FormGroup } from '@angular/forms';

@Injectable()
export class CustomValidationService {

  passwordMatchValidator(password: string, repass: string) {
    return (formGroup: FormGroup) => {
      let passwordControl = formGroup.controls[password];
      let repassControl = formGroup.controls[repass];

      if (!passwordControl || !repassControl) {
        return null;
      }

      if (
        repassControl.errors &&
        !repassControl.errors['passwordMismatch']
      ) {
        return null;
      }

      if (passwordControl.value !== repassControl.value) {
        repassControl.setErrors({ passwordMismatch: true });
      } else {
        repassControl.setErrors(null);
      }
    };
  }
}
</code>```

register.component.ts:

```<code>import { Component, OnInit } from '@angular/core';
import { FormGroup, ReactiveFormsModule, FormControl, Validators, FormBuilder } from '@angular/forms';
import { CustomValidationService } from '../../services/custom-validation.service';
import { ErrorhandlingService } from '../../services/errorhandling.service';
import { FirebaseService } from '../../services/firebase.service';

@Component({
  selector: 'app-register',
  templateUrl: './register.component.html',
  styleUrls: ['./register.component.css']
})
export class RegisterComponent implements OnInit {
  registerForm!: FormGroup;
  hasAuthError: boolean = false;
  getErrorMsg: any;

  constructor(
    private fBuilder: FormBuilder,
    private customValidationService: CustomValidationService,
    private getErrorMessages: ErrorhandlingService,
    private fb: FirebaseService
  ) { }

  ngOnInit(): void {
    this.registerForm = this.fBuilder.group({
      "firstName": ["", [Validators.required]],
      "lastName": ["", ],
      "email": ["", [Validators.required, Validators.email]],
      "username": ["", [Validators.required, Validators.minLength(6)]],
      "password": ["", [Validators.required, Validators.minLength(8)]],
      "repass": ["", [Validators.required, Validators.minLength(8)]]
    },
      {
        validator: this.customValidationService.passwordMatchValidator("password", "repass")
      }
    );

    this.getErrorMsg = this.getErrorMessages.getErrorMsg;
  }

  onSubmit(): void {
    if (this.registerForm.valid) {
      let { email, password } = this.registerForm.value;
      this.fb.register(email, password)
      .catch( () => {
        this.hasAuthError = true;
      });
    }
  }
}

</code>```

Body:
I'm getting the above mentioned errors in the console, when i click on Register. I'm using Angular and I have a CustomValidationService that's beeing called from my RegisterComponent and apparently somewhere inbetween I must be doing a circular dependency. Any  ideas what must be changed would be much appreciated.

Here is the error from the console:
console_errors

I'll paste my code here:

custom-validation.service.ts

import { Injectable } from '@angular/core';
import { FormGroup } from '@angular/forms';

@Injectable()
export class CustomValidationService {

  passwordMatchValidator(password: string, repass: string) {
    return (formGroup: FormGroup) => {
      let passwordControl = formGroup.controls[password];
      let repassControl = formGroup.controls[repass];

      if (!passwordControl || !repassControl) {
        return null;
      }

      if (
        repassControl.errors &&
        !repassControl.errors['passwordMismatch']
      ) {
        return null;
      }

      if (passwordControl.value !== repassControl.value) {
        repassControl.setErrors({ passwordMismatch: true });
      } else {
        repassControl.setErrors(null);
      }
    };
  }
}

register.component.ts:

import { Component, OnInit } from '@angular/core';
import { FormGroup, ReactiveFormsModule, FormControl, Validators, FormBuilder } from '@angular/forms';
import { CustomValidationService } from '../../services/custom-validation.service';
import { ErrorhandlingService } from '../../services/errorhandling.service';
import { FirebaseService } from '../../services/firebase.service';

@Component({
  selector: 'app-register',
  templateUrl: './register.component.html',
  styleUrls: ['./register.component.css']
})
export class RegisterComponent implements OnInit {
  registerForm!: FormGroup;
  hasAuthError: boolean = false;
  getErrorMsg: any;

  constructor(
    private fBuilder: FormBuilder,
    private customValidationService: CustomValidationService,
    private getErrorMessages: ErrorhandlingService,
    private fb: FirebaseService
  ) { }

  ngOnInit(): void {
    this.registerForm = this.fBuilder.group({
      "firstName": ["", [Validators.required]],
      "lastName": ["", ],
      "email": ["", [Validators.required, Validators.email]],
      "username": ["", [Validators.required, Validators.minLength(6)]],
      "password": ["", [Validators.required, Validators.minLength(8)]],
      "repass": ["", [Validators.required, Validators.minLength(8)]]
    },
      {
        validator: this.customValidationService.passwordMatchValidator("password", "repass")
      }
    );

    this.getErrorMsg = this.getErrorMessages.getErrorMsg;
  }

  onSubmit(): void {
    if (this.registerForm.valid) {
      let { email, password } = this.registerForm.value;
      this.fb.register(email, password)
      .catch( () => {
        this.hasAuthError = true;
      });
    }
  }
}


问:
React Native - TypeError: Cannot read property 'apply' of undefined when focus on textinput
After updating the React Native version to 0.70.6, I get this error when I focus any textinput.


问:
Dump Redshift schema to mock a Redshift DB with a Postgres DB in a local env
I would like to use a Postgres DB as a Redshift mock for my local tests.

I need to dump the redshift schema and load it into my containerized postgres DB.

What I have tried so far :

PG_PASSWORD=password pg_dump -Cs -h host.com -U user -p 5439 --exclude-table='*temp*' db > dump.sql
```
<p>The reason I add <code>--exclude-table='*temp*'</code> is this issue I got when I run my command :</p>
<pre class="lang-bash prettyprint-override"><code>pg_dump: [archiver (db)] query failed: ERROR:  relation "s.xyz_temp__" does not exist
pg_dump: [archiver (db)] query was: LOCK TABLE s.xyz_temp__ IN ACCESS SHARE MODE
</code>```

I don't want temp tables in my dump anyway.

But it doesn't work. Even with this option - --exclude-table='*temp*' - I still get this error.

How can I get a schema that I can load into my postgres DB ?

Body:
I would like to use a Postgres DB as a Redshift mock for my local tests.

I need to dump the redshift schema and load it into my containerized postgres DB.

What I have tried so far :

PG_PASSWORD=password pg_dump -Cs -h host.com -U user -p 5439 --exclude-table='*temp*' db > dump.sql

The reason I add --exclude-table='*temp*' is this issue I got when I run my command :

pg_dump: [archiver (db)] query failed: ERROR:  relation "s.xyz_temp__" does not exist
pg_dump: [archiver (db)] query was: LOCK TABLE s.xyz_temp__ IN ACCESS SHARE MODE

I don't want temp tables in my dump anyway.

But it doesn't work. Even with this option - --exclude-table='*temp*' - I still get this error.

How can I get a schema that I can load into my postgres DB ?


问:
TinyMCE loaded listener
I'm using TinyMCE with Vue3. When I refresh the page it takes about a second to load and show the TinyMCE editor. During this time the page looks ugly.
So what I want to do is show the page content when the TinyMCE is fully loaded. Is there any way to add an event listener to it?

Here is the code snippet of the editor:

```<code><editor api-key="no-api-key" :init="{
      height: 500,
      menubar: true,
      plugins: [
        'advlist autolink lists link image charmap print preview anchor',
        'searchreplace visualblocks code fullscreen',
        'insertdatetime media table paste code help wordcount'
      ],
      toolbar:
        'undo redo | formatselect | bold italic backcolor | \ alignleft aligncenter alignright alignjustify | \ bullist numlist outdent indent | removeformat | help'
    }" v-model="text" />
</code>```

Title: TinyMCE loaded listener

Body:
I'm using TinyMCE with Vue3. When I refresh the page it takes about a second to load and show the TinyMCE editor. During this time the page looks ugly.
So what I want to do is show the page content when the TinyMCE is fully loaded. Is there any way to add an event listener to it?

Here is the code snippet of the editor:

<editor api-key="no-api-key" :init="{
      height: 500,
      menubar: true,
      plugins: [
        'advlist autolink lists link image charmap print preview anchor',
        'searchreplace visualblocks code fullscreen',
        'insertdatetime media table paste code help wordcount'
      ],
      toolbar:
        'undo redo | formatselect | bold italic backcolor | \ alignleft aligncenter alignright alignjustify | \ bullist numlist outdent indent | removeformat | help'
    }" v-model="text" />


问:
Custom document preview component in formio
I am currently trying to create a custom component in formio which would allow me to preview DOCX, PDF and EXCEL files. I do not really understand how the custom component works in formio.
How would you do that?</p>


问:
Accesing room database in AppWidget
Im trying to get data from room database and show it on the listView on my widget. I followed this tutorial :
https://medium.com/@SiddyDevelops/populating-android-app-widgets-with-room-database-713e12bdcc63
In my provider class i create 3 intents and pass them to my service class with RemoteViewFactoryClass.
There are 2 issues with my app

If i send all three intents they behave like they were 3 the same intents but for diffrent ListViews (they have the same varaibles in getExtra). When i send only 1 of them they have correct variables.

My RemoteViewFactory doesnt seem to update count value and only update the number of the rows that was specyfied during onCreate method even though when i try to retrive count value it gives correct value. Because of this RemoteViewsFactory update only the amout of rows that is equal to the initial count value. Im using live data so i need to update this value in order to get correct results

here is my code

Service class

```<code>package com.example.reminderapp.UI.widget

import android.appwidget.AppWidgetManager
import android.content.Context
import android.content.Intent
import android.util.Log
import android.view.View
import android.widget.RemoteViews
import android.widget.RemoteViewsService
import androidx.lifecycle.LiveData
import com.example.reminderapp.Importance
import com.example.reminderapp.R
import com.example.reminderapp.ReminderObject
import com.example.reminderapp.ServiceClass
import kotlinx.coroutines.*
import java.time.LocalDateTime

class WidgetService() : RemoteViewsService() {
    override fun onGetViewFactory(p0: Intent?): RemoteViewsFactory {
        return RemoteViewFactory(applicationContext,p0!!)
    }

    private class RemoteViewFactory(val context: Context,val intent : Intent) : RemoteViewsService.RemoteViewsFactory{

        private var impList = ArrayList<ReminderObject>()
        private lateinit var liveImp : LiveData<List<ReminderObject>>
        private lateinit var impType : String
        //private val scope = CoroutineScope(SupervisorJob())
        private  val service = ServiceClass(context)

        /*

        val nothingToShowList = listOf<ReminderObject>(
            ReminderObject(
                R.string.noReminders.toString(),
                false,
                LocalDateTime.now(),
                Importance.min,
                LocalDateTime.now(),
                "")
        )

         */

        override fun onCreate() {

            /*
            val appWidgetId = intent.getIntExtra(
                AppWidgetManager.EXTRA_APPWIDGET_ID,
                AppWidgetManager.INVALID_APPWIDGET_ID
            )
            Log.d("AAAAAAAppWidgetId", appWidgetId.toString())

             */
            //now it always show 2 rows; when not initialized show always only 1 row
            impList.add(ReminderObject(
                R.string.noReminders.toString(),
                false,
                LocalDateTime.now(),
                Importance.min,
                LocalDateTime.now(),
                ""))
            impList.add(ReminderObject(
                R.string.noReminders.toString(),
                false,
                LocalDateTime.now(),
                Importance.min,
                LocalDateTime.now(),
                ""))
            impType = intent.getStringExtra("imp").toString()

            liveImp = service.showByimportance(Importance.valueOf(impType))
            liveImp.observeForever{
                newData(it as ArrayList<ReminderObject>)
            }

                Log.i("AAAAwidget","widgetServiceccc $impType")

        }

        override fun onDataSetChanged() {

            liveImp = service.showByimportance(Importance.valueOf(impType))

            if(impList.isEmpty())
                impList.add(ReminderObject(
                    R.string.noReminders.toString(),
                    false,
                    LocalDateTime.now(),
                    Importance.min,
                    LocalDateTime.now(),
                    ""))

            Log.i("AAAAwidget","data changed")

           for(item  in 0 until count)
                getViewAt(item)

        }

        override fun onDestroy() {

        }

        override fun getCount(): Int {
            return impList.size
        }

        override fun getViewAt(p0: Int): RemoteViews {

            Log.i("AAAAwidget","widgetServicevvv $p0 size: $count type $impType")

            val remoteView = RemoteViews(
                context.packageName,
                R.layout.widget_row_layout
            )

            val reminderObj = impList[p0]
            val reminderText = reminderObj.reminderText
            val reminderImp = reminderObj.importance//Importance.valueOf(impType)
            val containsDeadline = reminderObj.containsDeadline

            when (reminderImp) {
                Importance.max -> remoteView.setImageViewResource(R.id.imageViewListViewRow,R.drawable.ic_max_importance)
                Importance.mid -> remoteView.setImageViewResource(R.id.imageViewListViewRow,R.drawable.ic_mid_importance)
                Importance.min -> remoteView.setImageViewResource(R.id.imageViewListViewRow,R.drawable.ic_min_importance)
            }

            remoteView.setViewVisibility(R.id.imageViewListViewRow,View.VISIBLE)

            remoteView.setTextViewText(R.id.textViewReminder,reminderText)

            if (containsDeadline) {
                 val deadline = reminderObj.deadline
                 remoteView.setTextViewText(R.id.textViewDeadline,"Due to: ${deadline.dayOfMonth}.0${deadline.monthValue}.${deadline.year}")
                 remoteView.setViewVisibility(R.id.textViewDeadline,View.VISIBLE)
            } else {
                 remoteView.setViewVisibility(R.id.textViewDeadline,View.GONE)
            }

            return remoteView
        }

        override fun getLoadingView(): RemoteViews {
            val remoteView = RemoteViews(
                context.packageName,
                R.layout.widget_row_layout
            )
            remoteView.setTextViewText(R.id.textViewReminder, "Loading")
            return remoteView
        }

        override fun getViewTypeCount(): Int {
          return 1
        }

        override fun getItemId(p0: Int): Long {
            return p0.toLong()
        }

        override fun hasStableIds(): Boolean {
            return true
        }

        private fun newData(list : ArrayList<ReminderObject>)
        {
            impList.clear()
            impList.addAll(list)
            Log.i("AAAAwidgetSize","${impList.size}")
            onDataSetChanged()

        }

    }
}
</code>```

provider class

```<code>package com.example.reminderapp.UI.widget

import android.appwidget.AppWidgetManager
import android.appwidget.AppWidgetProvider
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.util.Log
import android.widget.RemoteViews
import com.example.reminderapp.Importance
import com.example.reminderapp.R
import com.example.reminderapp.ReminderObject
import com.example.reminderapp.ServiceClass
import kotlinx.coroutines.*

class WidgetProvider : AppWidgetProvider() {

    private val scope = CoroutineScope(SupervisorJob())

    override fun onUpdate(context: Context, appWidgetManager: AppWidgetManager, appWidgetIds: IntArray) {
        for(widget : Int in appWidgetIds) {
            //val service = ServiceClass(context)
            val views = RemoteViews(context.packageName, R.layout.widget_layout)
            //val pendingResult = goAsync()

            Log.i("AAAAwidget","widget")

            /*
            scope.launch(Dispatchers.IO) {

                val impListMax = async { service.getByImportanceStatic(Importance.max) }
                val impListMid = async { service.getByImportanceStatic(Importance.mid) }
                val impListMin = async { service.getByImportanceStatic(Importance.min) }

                val intentMax = Intent(context,WidgetService::class.java)
                intentMax.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widget)
                intentMax.setData(Uri.parse(intentMax.toUri(Intent.URI_INTENT_SCHEME)))
                intentMax.putExtra("impList",impListMax.await() as ArrayList<ReminderObject>)
                views.setRemoteAdapter(R.id.listViewImpMax, intentMax)

                val intentMid = Intent(context,WidgetService::class.java)
                intentMid.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widget)
                intentMid.setData(Uri.parse(intentMid.toUri(Intent.URI_INTENT_SCHEME)))
                intentMid.putExtra("impList",impListMid.await() as ArrayList<ReminderObject>)
                views.setRemoteAdapter(R.id.listViewImpMid, intentMid)

                val intentMin = Intent(context,WidgetService::class.java)
                intentMin.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widget)
                intentMin.setData(Uri.parse(intentMin.toUri(Intent.URI_INTENT_SCHEME)))
                intentMin.putExtra("impList",impListMin.await() as ArrayList<ReminderObject>)
                views.setRemoteAdapter(R.id.listViewImpMin, intentMin)

                appWidgetManager.updateAppWidget(widget, views)

                Log.i("AAAAwidget","widgetEndProvider")

                pendingResult.finish()
            }

             */

            val intentMax = Intent(context,WidgetService::class.java)
            intentMax.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widget)
            intentMax.setData(Uri.parse(intentMax.toUri(Intent.URI_INTENT_SCHEME)))
            intentMax.putExtra("imp","max")
            views.setRemoteAdapter(R.id.listViewImpMax, intentMax)

            val intentMid = Intent(context,WidgetService::class.java)
            intentMid.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widget)
            intentMid.setData(Uri.parse(intentMid.toUri(Intent.URI_INTENT_SCHEME)))
            intentMid.putExtra("imp","mid")
            //views.setRemoteAdapter(R.id.listViewImpMid, intentMid)

            val intentMin = Intent(context,WidgetService::class.java)
            intentMin.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widget)
            intentMin.setData(Uri.parse(intentMin.toUri(Intent.URI_INTENT_SCHEME)))
            intentMin.putExtra("imp","min")
            //views.setRemoteAdapter(R.id.listViewImpMin, intentMin)

            appWidgetManager.updateAppWidget(widget, views)

        }
    }
}
</code>```

Title: Accesing room database in AppWidget

Body:
Im trying to get data from room database and show it on the listView on my widget. I followed this tutorial :
https://medium.com/@SiddyDevelops/populating-android-app-widgets-with-room-database-713e12bdcc63
In my provider class i create 3 intents and pass them to my service class with RemoteViewFactoryClass.
There are 2 issues with my app

If i send all three intents they behave like they were 3 the same intents but for diffrent ListViews (they have the same varaibles in getExtra). When i send only 1 of them they have correct variables.

My RemoteViewFactory doesnt seem to update count value and only update the number of the rows that was specyfied during onCreate method even though when i try to retrive count value it gives correct value. Because of this RemoteViewsFactory update only the amout of rows that is equal to the initial count value. Im using live data so i need to update this value in order to get correct results

here is my code

Service class

package com.example.reminderapp.UI.widget

import android.appwidget.AppWidgetManager
import android.content.Context
import android.content.Intent
import android.util.Log
import android.view.View
import android.widget.RemoteViews
import android.widget.RemoteViewsService
import androidx.lifecycle.LiveData
import com.example.reminderapp.Importance
import com.example.reminderapp.R
import com.example.reminderapp.ReminderObject
import com.example.reminderapp.ServiceClass
import kotlinx.coroutines.*
import java.time.LocalDateTime

class WidgetService() : RemoteViewsService() {
    override fun onGetViewFactory(p0: Intent?): RemoteViewsFactory {
        return RemoteViewFactory(applicationContext,p0!!)
    }

    private class RemoteViewFactory(val context: Context,val intent : Intent) : RemoteViewsService.RemoteViewsFactory{

        private var impList = ArrayList<ReminderObject>()
        private lateinit var liveImp : LiveData<List<ReminderObject>>
        private lateinit var impType : String
        //private val scope = CoroutineScope(SupervisorJob())
        private  val service = ServiceClass(context)

        /*

        val nothingToShowList = listOf<ReminderObject>(
            ReminderObject(
                R.string.noReminders.toString(),
                false,
                LocalDateTime.now(),
                Importance.min,
                LocalDateTime.now(),
                "")
        )

         */

        override fun onCreate() {

            /*
            val appWidgetId = intent.getIntExtra(
                AppWidgetManager.EXTRA_APPWIDGET_ID,
                AppWidgetManager.INVALID_APPWIDGET_ID
            )
            Log.d("AAAAAAAppWidgetId", appWidgetId.toString())

             */
            //now it always show 2 rows; when not initialized show always only 1 row
            impList.add(ReminderObject(
                R.string.noReminders.toString(),
                false,
                LocalDateTime.now(),
                Importance.min,
                LocalDateTime.now(),
                ""))
            impList.add(ReminderObject(
                R.string.noReminders.toString(),
                false,
                LocalDateTime.now(),
                Importance.min,
                LocalDateTime.now(),
                ""))
            impType = intent.getStringExtra("imp").toString()

            liveImp = service.showByimportance(Importance.valueOf(impType))
            liveImp.observeForever{
                newData(it as ArrayList<ReminderObject>)
            }

                Log.i("AAAAwidget","widgetServiceccc $impType")

        }

        override fun onDataSetChanged() {

            liveImp = service.showByimportance(Importance.valueOf(impType))

            if(impList.isEmpty())
                impList.add(ReminderObject(
                    R.string.noReminders.toString(),
                    false,
                    LocalDateTime.now(),
                    Importance.min,
                    LocalDateTime.now(),
                    ""))

            Log.i("AAAAwidget","data changed")

           for(item  in 0 until count)
                getViewAt(item)

        }

        override fun onDestroy() {

        }

        override fun getCount(): Int {
            return impList.size
        }

        override fun getViewAt(p0: Int): RemoteViews {

            Log.i("AAAAwidget","widgetServicevvv $p0 size: $count type $impType")

            val remoteView = RemoteViews(
                context.packageName,
                R.layout.widget_row_layout
            )

            val reminderObj = impList[p0]
            val reminderText = reminderObj.reminderText
            val reminderImp = reminderObj.importance//Importance.valueOf(impType)
            val containsDeadline = reminderObj.containsDeadline

            when (reminderImp) {
                Importance.max -> remoteView.setImageViewResource(R.id.imageViewListViewRow,R.drawable.ic_max_importance)
                Importance.mid -> remoteView.setImageViewResource(R.id.imageViewListViewRow,R.drawable.ic_mid_importance)
                Importance.min -> remoteView.setImageViewResource(R.id.imageViewListViewRow,R.drawable.ic_min_importance)
            }

            remoteView.setViewVisibility(R.id.imageViewListViewRow,View.VISIBLE)

            remoteView.setTextViewText(R.id.textViewReminder,reminderText)

            if (containsDeadline) {
                 val deadline = reminderObj.deadline
                 remoteView.setTextViewText(R.id.textViewDeadline,"Due to: ${deadline.dayOfMonth}.0${deadline.monthValue}.${deadline.year}")
                 remoteView.setViewVisibility(R.id.textViewDeadline,View.VISIBLE)
            } else {
                 remoteView.setViewVisibility(R.id.textViewDeadline,View.GONE)
            }

            return remoteView
        }

        override fun getLoadingView(): RemoteViews {
            val remoteView = RemoteViews(
                context.packageName,
                R.layout.widget_row_layout
            )
            remoteView.setTextViewText(R.id.textViewReminder, "Loading")
            return remoteView
        }

        override fun getViewTypeCount(): Int {
          return 1
        }

        override fun getItemId(p0: Int): Long {
            return p0.toLong()
        }

        override fun hasStableIds(): Boolean {
            return true
        }

        private fun newData(list : ArrayList<ReminderObject>)
        {
            impList.clear()
            impList.addAll(list)
            Log.i("AAAAwidgetSize","${impList.size}")
            onDataSetChanged()

        }

    }
}

provider class

package com.example.reminderapp.UI.widget

import android.appwidget.AppWidgetManager
import android.appwidget.AppWidgetProvider
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.util.Log
import android.widget.RemoteViews
import com.example.reminderapp.Importance
import com.example.reminderapp.R
import com.example.reminderapp.ReminderObject
import com.example.reminderapp.ServiceClass
import kotlinx.coroutines.*

class WidgetProvider : AppWidgetProvider() {

    private val scope = CoroutineScope(SupervisorJob())

    override fun onUpdate(context: Context, appWidgetManager: AppWidgetManager, appWidgetIds: IntArray) {
        for(widget : Int in appWidgetIds) {
            //val service = ServiceClass(context)
            val views = RemoteViews(context.packageName, R.layout.widget_layout)
            //val pendingResult = goAsync()

            Log.i("AAAAwidget","widget")

            /*
            scope.launch(Dispatchers.IO) {

                val impListMax = async { service.getByImportanceStatic(Importance.max) }
                val impListMid = async { service.getByImportanceStatic(Importance.mid) }
                val impListMin = async { service.getByImportanceStatic(Importance.min) }

                val intentMax = Intent(context,WidgetService::class.java)
                intentMax.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widget)
                intentMax.setData(Uri.parse(intentMax.toUri(Intent.URI_INTENT_SCHEME)))
                intentMax.putExtra("impList",impListMax.await() as ArrayList<ReminderObject>)
                views.setRemoteAdapter(R.id.listViewImpMax, intentMax)

                val intentMid = Intent(context,WidgetService::class.java)
                intentMid.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widget)
                intentMid.setData(Uri.parse(intentMid.toUri(Intent.URI_INTENT_SCHEME)))
                intentMid.putExtra("impList",impListMid.await() as ArrayList<ReminderObject>)
                views.setRemoteAdapter(R.id.listViewImpMid, intentMid)

                val intentMin = Intent(context,WidgetService::class.java)
                intentMin.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widget)
                intentMin.setData(Uri.parse(intentMin.toUri(Intent.URI_INTENT_SCHEME)))
                intentMin.putExtra("impList",impListMin.await() as ArrayList<ReminderObject>)
                views.setRemoteAdapter(R.id.listViewImpMin, intentMin)

                appWidgetManager.updateAppWidget(widget, views)

                Log.i("AAAAwidget","widgetEndProvider")

                pendingResult.finish()
            }

             */

            val intentMax = Intent(context,WidgetService::class.java)
            intentMax.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widget)
            intentMax.setData(Uri.parse(intentMax.toUri(Intent.URI_INTENT_SCHEME)))
            intentMax.putExtra("imp","max")
            views.setRemoteAdapter(R.id.listViewImpMax, intentMax)

            val intentMid = Intent(context,WidgetService::class.java)
            intentMid.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widget)
            intentMid.setData(Uri.parse(intentMid.toUri(Intent.URI_INTENT_SCHEME)))
            intentMid.putExtra("imp","mid")
            //views.setRemoteAdapter(R.id.listViewImpMid, intentMid)

            val intentMin = Intent(context,WidgetService::class.java)
            intentMin.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widget)
            intentMin.setData(Uri.parse(intentMin.toUri(Intent.URI_INTENT_SCHEME)))
            intentMin.putExtra("imp","min")
            //views.setRemoteAdapter(R.id.listViewImpMin, intentMin)

            appWidgetManager.updateAppWidget(widget, views)

        }
    }
}


问:
CSS How to make content inside div responsive
I have two elements inside a parent element:

```<code><section>
   <div class="container">
      ...some content here
   </div>
   <div class="myStuff">
      ...some content here - should follow the "container"-div
   </div>
</section>
</code>```

the container-element has the following css:

```<code>.container {
  width: 100%;
  margin: 0 auto;
 }

@media (min-width: 640px) {
 .container {
    max-width: 640px;
 }
}

@media (min-width: 768px) {
 .container {
    max-width: 768px;
 }
}

@media (min-width: 1024px) {
 .container {
   max-width: 1024px;
 }
}
@media (min-width: 1280px) {
 .container {
   max-width: 1280px;
 }
}
@media (min-width: 1536px) {
  .container {
   max-width: 1536px;
  }
}
</code>```

now, I want the content from the div with the class myStuff to be responsive as well but due to design reasons, I cannot add the container-class.

I tried to do this:

```<code>.myStuff {
   margin-left: 10%;
}
</code>```

but that didnt work, the content is not aligned to the container div.

How can I achieve this?

Body:
I have two elements inside a parent element:

      ...some content here

      ...some content here - should follow the "container"-div

the container-element has the following css:

.container {
  width: 100%;
  margin: 0 auto;
 }

@media (min-width: 640px) {
 .container {
    max-width: 640px;
 }
}

@media (min-width: 768px) {
 .container {
    max-width: 768px;
 }
}

@media (min-width: 1024px) {
 .container {
   max-width: 1024px;
 }
}
@media (min-width: 1280px) {
 .container {
   max-width: 1280px;
 }
}
@media (min-width: 1536px) {
  .container {
   max-width: 1536px;
  }
}

now, I want the content from the div with the class myStuff to be responsive as well but due to design reasons, I cannot add the container-class.

I tried to do this:

.myStuff {
   margin-left: 10%;
}

but that didnt work, the content is not aligned to the container div.

How can I achieve this?


问:
PHP with podman shows internal ip address as remote address
I run a simple nginx, php server with docker on a remote server. I call a url which display my remote address:

```<code>echo $_SERVER['REMOTE_ADDR'];
</code>```

And I see my real public ip address. But if I run the exactly same project with podman instead docker, the url shows an internal ip address:

```<code>10.89.0.3
</code>```

How can I do with podman, to show the real remote address?

My docker-compose.yml:

```<code>version: '3'

services:
  nginx:
    container_name: min-web-nginx
    build:
      context: .
      dockerfile: docker/nginx/Dockerfile
    volumes:
      - ./app:/app
    depends_on:
      - php
    ports:
      - 8080:80
    networks:
      - halozat
  php:
    container_name: min-web-php
    build:
      context: .
      dockerfile: docker/php/Dockerfile
    volumes:
      - ./app:/app
    networks:
      - halozat
networks:
  halozat:
</code>```

Body:
I run a simple nginx, php server with docker on a remote server. I call a url which display my remote address:

echo $_SERVER['REMOTE_ADDR'];

And I see my real public ip address. But if I run the exactly same project with podman instead docker, the url shows an internal ip address:

10.89.0.3

How can I do with podman, to show the real remote address?

My docker-compose.yml:

version: '3'

services:
  nginx:
    container_name: min-web-nginx
    build:
      context: .
      dockerfile: docker/nginx/Dockerfile
    volumes:
      - ./app:/app
    depends_on:
      - php
    ports:
      - 8080:80
    networks:
      - halozat
  php:
    container_name: min-web-php
    build:
      context: .
      dockerfile: docker/php/Dockerfile
    volumes:
      - ./app:/app
    networks:
      - halozat
networks:
  halozat:


问:
How can I control iOS device (connected via USB) from Windows (c#) using libimobiledevice?
I can connect to device and take the screenshot. Additionally I would like to simulate touch, swipe, etc... I am not using Xamarin, just c# and libimobiledevice.

I didn't find the way how to simulate it.


问:
DbSet only .Remove or .RemoveRange not working
I am trying to write a unit test for removing items from my dbset using the code below

```<code>var entitySet = Context.Set<TEntity>();
            var entitiesToRemove = await entitySet.Where(request.KeyExpression)
                                                  .ToListAsync(cancellationToken);

            entitySet.RemoveRange(entitiesToRemove);

            await Context.SaveChangesAsync(cancellationToken);
</code>```

For some reason if I would change .RemoveRange to .Add I can add items. .AddRange,.Remove or .RemoveRange however don't work
Any ideas why?

Body:
I am trying to write a unit test for removing items from my dbset using the code below

var entitySet = Context.Set<TEntity>();
            var entitiesToRemove = await entitySet.Where(request.KeyExpression)
                                                  .ToListAsync(cancellationToken);

            entitySet.RemoveRange(entitiesToRemove);

            await Context.SaveChangesAsync(cancellationToken);

For some reason if I would change .RemoveRange to .Add I can add items. .AddRange,.Remove or .RemoveRange however don't work
Any ideas why?


问:
Problem with Joystick HID descriptor readout
I bought a used Joystick (Speedlink Phantom Hawk), which I can't return. I contacted the Support from Speedlink, but they cant help me with this. It is a known Problem for them, but they dont have a Solution.

The Z-Rotation Axis (twist axis) has a weird offset and doesn't read out the full Motion, it is centred at readout 180, and only uses about 20-30% of the IRL range. I tried everything conventional, and everything driver related, nothing helped (Windows driver, Speedlink Joystick Driver, and alternative drivers).

From Hours of trying to fix this Problem, I got to figure out what exactly is not working correctly, however I couldn't find a way to solve it.

Using "Free Device Monitoring Studio" I am able to read out the HID descriptor and the Values send by the Joystick.

The Problem is, that the Joystick has 2 Z-Axis readouts, the first one is the actual Z-Rotation Axis with its full range, the second Z-Axis is the thrust Slider, and the Rz-Axis is again the Z-Rotation, but only part of the Range with the weird offset.

The actual Z-Axis gives values between 35-230 over the full twist range.

So it's not a faulty sensor.

The Joystick driver is build on top of the Windows driver, and only gives the ability to centre the Axis.

The Question now is, is there a way to get it working again?

Either by editing the HID descriptor, or by making it that Windows reads the actual Z-Axis instead of the false Rz-Axis?

One readout of sent packages looks like this:

Report ID:-1

X[0..255]/[0..255]: 128

Y[0..255]/[0..255]: 125

Z[0..255]/[0..255]: 146 <--- actual twist Axis

Z[0..255]/[0..255]: 127 <---- Thrust Slider

Rz[0..255]/[0..255]: 174 <----fake/false twist Axis.

Hat Switch[0x0..0x7]/[0x0..0x13b]: 0xf

BUTTON1 pressed: 0

BUTTON2 pressed: 0

BUTTON3 pressed: 0

BUTTON4 pressed: 0

BUTTON5 pressed: 0

BUTTON6 pressed: 0

BUTTON7 pressed: 0

BUTTON8 pressed: 0

BUTTON9 pressed: 0

BUTTON10 pressed: 0

BUTTON11 pressed: 0

BUTTON12 pressed: 0

Unknown: 0

Unknown: 0

Unknown: 0

Unknown: 0

Unknown: 0

Unknown: 0

Unknown: 1

Unknown: 0

The HID Descriptor reads out this:

05 01 09 04 A1 01 09 00 A1 02 09 30 15 00 25 FF

35 00 45 FF 65 00 55 00 75 08 95 01 81 02 09 31

81 02 09 32 81 02 09 32 81 02 09 35 81 02 09 39

25 07 46 3B 01 65 14 75 04 81 42 05 09 19 01 29

0C 25 01 45 01 65 00 75 01 95 0C 81 02 95 08 81

03 C1 00 06 00 FF 09 00 A1 02 09 02 25 FF 45 FF

75 08 95 07 91 02 C1 00 C1 00

Which when Parsed gives this:

0x05, 0x01, // Usage Page (Generic Desktop Ctrls)

0x09, 0x04, // Usage (Joystick)

0xA1, 0x01, // Collection (Application)

0x09, 0x00, // Usage (Undefined)

0xA1, 0x02, // Collection (Logical)

0x09, 0x30, // Usage (X)

0x15, 0x00, // Logical Minimum (0)

0x25, 0xFF, // Logical Maximum (-1)

0x35, 0x00, // Physical Minimum (0)

0x45, 0xFF, // Physical Maximum (-1)

0x65, 0x00, // Unit (None)

0x55, 0x00, // Unit Exponent (0)

0x75, 0x08, // Report Size (8)

0x95, 0x01, // Report Count (1)

0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)

0x09, 0x31, // Usage (Y)

0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)

0x09, 0x32, // Usage (Z)

0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)

0x09, 0x32, // Usage (Z)

0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)

0x09, 0x35, // Usage (Rz)

0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)

0x09, 0x39, // Usage (Hat switch)

0x25, 0x07, // Logical Maximum (7)

0x46, 0x3B, 0x01, // Physical Maximum (315)

0x65, 0x14, // Unit (System: English Rotation, Length: Centimeter)

0x75, 0x04, // Report Size (4)

0x81, 0x42, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,Null State)

0x05, 0x09, // Usage Page (Button)

0x19, 0x01, // Usage Minimum (0x01)

0x29, 0x0C, // Usage Maximum (0x0C)

0x25, 0x01, // Logical Maximum (1)

0x45, 0x01, // Physical Maximum (1)

0x65, 0x00, // Unit (None)

0x75, 0x01, // Report Size (1)

0x95, 0x0C, // Report Count (12)

0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)

0x95, 0x08, // Report Count (8)

0x81, 0x03, // Input (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)

0xC1, 0x00, // End Collection

0x06, 0x00, 0xFF, // Usage Page (Vendor Defined 0xFF00)

0x09, 0x00, // Usage (0x00)

0xA1, 0x02, // Collection (Logical)

0x09, 0x02, // Usage (0x02)

0x25, 0xFF, // Logical Maximum (-1)

0x45, 0xFF, // Physical Maximum (-1)

0x75, 0x08, // Report Size (8)

0x95, 0x07, // Report Count (7)

0x91, 0x02, // Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)

0xC1, 0x00, // End Collection

0xC1, 0x00, // End Collection

// 106 bytes


问:
Redirect to default culture
I am using Request Localization in a NET Core 7 and Razor Pages application:

```<code>builder.Services.AddRazorPages();

builder.Services.Configure<RequestLocalizationOptions>(options => {
  options.DefaultRequestCulture = new RequestCulture("pt");
  options.SupportedCultures = new List<CultureInfo> { new CultureInfo("en"), new CultureInfo("pt") };
  options.SupportedUICultures = new List<CultureInfo> { new CultureInfo("en"), new CultureInfo("pt") };
  options.RequestCultureProviders.Insert(0, new RouteDataRequestCultureProvider {
    RouteDataStringKey = "culture",
    UIRouteDataStringKey = "culture",
    Options = options
  });
});

WebApplication application = builder.Build();

application.UseRouting();

application.MapRazorPages();

application.UseRequestLocalization();

// ...
</code>```

A few of my razor pages are:

```<code>Index: @page "/{culture?}"

About: @page "/{culture?}/about"
</code>```

I am using culture as optional because if I hit "/" I will get a 404 error.

How can I use {culture} as not optional and if null redirect to default culture?

Title: Redirect to default culture

Body:
I am using Request Localization in a NET Core 7 and Razor Pages application:

builder.Services.AddRazorPages();

builder.Services.Configure<RequestLocalizationOptions>(options => {
  options.DefaultRequestCulture = new RequestCulture("pt");
  options.SupportedCultures = new List<CultureInfo> { new CultureInfo("en"), new CultureInfo("pt") };
  options.SupportedUICultures = new List<CultureInfo> { new CultureInfo("en"), new CultureInfo("pt") };
  options.RequestCultureProviders.Insert(0, new RouteDataRequestCultureProvider {
    RouteDataStringKey = "culture",
    UIRouteDataStringKey = "culture",
    Options = options
  });
});

WebApplication application = builder.Build();

application.UseRouting();

application.MapRazorPages();

application.UseRequestLocalization();

// ...

A few of my razor pages are:

Index: @page "/{culture?}"

About: @page "/{culture?}/about"

I am using culture as optional because if I hit "/" I will get a 404 error.

How can I use {culture} as not optional and if null redirect to default culture?


问:
Search specific word in Kofax PDF using vba
I'm using VBA to read the PDF content in Kofax. I need to find an specific word through VBA like using ctrl+f in the PDF. There is a method called FindText but there is no example of how to use this method.

I would like to find the word, highlight it and return the annotation number within the PDF page.


问:
Limiting SPARQL result for each group
I have to write a query on wikidat. The question is :

```<code>Consider only films directed by Woody Allen or Quentin Tarantino. Then consider the date of publication of these films (take the first one if there are more than one date of publication). Return the year with more films release for the two director (the result set must be two elements and for each element there must be present the director IRI, the label of the IRI, the year and the number of films).
</code>```

I wrote a query and run it. The result contains 3 line for Woody Allen and 1 for Quentin Tarantino. It's because in 3 different years no of W.Allen's films released are 2 (which is the max no.). It's True, but I want to report just one of them (no matter which one).

I confused how I should do it with limit.

I'm not sure if my query is efficient or not. However, Using UNION is forbidden.

```<code>select distinct ?director1 ?date1 ?filmNo1  where
    {
################################
{
select distinct ?director1 ?date1 (count(?date1) as ?filmNo1) where
    {
      SELECT DISTINCT ?director1 ?f1Label (MIN(?pYear1) as ?date1)
      WHERE
     {
         # bind something
        VALUES ?director1 {wd:Q25089 wd:Q3772} .
        ?f1 wdt:P31 wd:Q11424 ;
           wdt:P57 ?director1 ;
           wdt:P577 ?pdate1 .
        BIND(YEAR(?pdate1) AS ?pYear1).
        SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # Helps get the label in your language, if not, then en language
      }
      GROUP BY ?director1 ?f1Label
    }
    group by ?director1 ?date1
    order by desc(?filmNo1)
    #limit 5
}
########################
{
  select ?director  (MAX(?filmNo) as ?maxNo)
  {
    select distinct ?director ?date (count(?date) as ?filmNo) where
    {
      SELECT DISTINCT ?director ?fLabel (MIN(?pYear) as ?date)
      WHERE
     {
         # bind something
        VALUES ?director {wd:Q25089 wd:Q3772} .
        ?f wdt:P31 wd:Q11424 ;
           wdt:P57 ?director ;
           wdt:P577 ?pdate .
        BIND(YEAR(?pdate) AS ?pYear).
        SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # Helps get the label in your language, if not, then en language
      }
      GROUP BY ?director ?fLabel
    }
    group by ?director ?date
    #order by DESC(?filmNo)
  }
  group by ?director
}
#####################

filter(?director1=?director && ?filmNo1=?maxNo)
}
group by ?director1 ?date1 ?filmNo1
order by ?director1

</code>```

the result is

Title: Limiting SPARQL result for each group

Body:
I have to write a query on wikidat. The question is :

Consider only films directed by Woody Allen or Quentin Tarantino. Then consider the date of publication of these films (take the first one if there are more than one date of publication). Return the year with more films release for the two director (the result set must be two elements and for each element there must be present the director IRI, the label of the IRI, the year and the number of films).

I wrote a query and run it. The result contains 3 line for Woody Allen and 1 for Quentin Tarantino. It's because in 3 different years no of W.Allen's films released are 2 (which is the max no.). It's True, but I want to report just one of them (no matter which one).

I confused how I should do it with limit.

I'm not sure if my query is efficient or not. However, Using UNION is forbidden.

select distinct ?director1 ?date1 ?filmNo1  where
    {
################################
{
select distinct ?director1 ?date1 (count(?date1) as ?filmNo1) where
    {
      SELECT DISTINCT ?director1 ?f1Label (MIN(?pYear1) as ?date1)
      WHERE
     {
         # bind something
        VALUES ?director1 {wd:Q25089 wd:Q3772} .
        ?f1 wdt:P31 wd:Q11424 ;
           wdt:P57 ?director1 ;
           wdt:P577 ?pdate1 .
        BIND(YEAR(?pdate1) AS ?pYear1).
        SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # Helps get the label in your language, if not, then en language
      }
      GROUP BY ?director1 ?f1Label
    }
    group by ?director1 ?date1
    order by desc(?filmNo1)
    #limit 5
}
########################
{
  select ?director  (MAX(?filmNo) as ?maxNo)
  {
    select distinct ?director ?date (count(?date) as ?filmNo) where
    {
      SELECT DISTINCT ?director ?fLabel (MIN(?pYear) as ?date)
      WHERE
     {
         # bind something
        VALUES ?director {wd:Q25089 wd:Q3772} .
        ?f wdt:P31 wd:Q11424 ;
           wdt:P57 ?director ;
           wdt:P577 ?pdate .
        BIND(YEAR(?pdate) AS ?pYear).
        SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # Helps get the label in your language, if not, then en language
      }
      GROUP BY ?director ?fLabel
    }
    group by ?director ?date
    #order by DESC(?filmNo)
  }
  group by ?director
}
#####################

filter(?director1=?director && ?filmNo1=?maxNo)
}
group by ?director1 ?date1 ?filmNo1
order by ?director1

the result is


问:
Environmental Variable Path - Add the variable to the top of the list
Is there way to insert an environmental variable path top top of the list via cmdline/groupolicy/powershell.

It added but the requirement is to have it first in path the order.


问:
Using okd4 installer in openstack with only one floating ip
I have some limitations in my network, so I can only use one floating IP in the installation process. I know this is possible, but I do not know how to accomplish it.
This is the install-config.yaml generated and tuned that I use:

```<code>apiVersion: v1
baseDomain: xxx
compute:
- architecture: amd64
  hyperthreading: Enabled
  name: worker
  platform:
    openstack:
      type: xxx
  replicas: 3
controlPlane:
  architecture: amd64
  hyperthreading: Enabled
  name: master
  platform:
    openstack:
      type: xxx
  replicas: 3
metadata:
  creationTimestamp: null
  name: xxx
networking:
  clusterNetwork:
  - cidr: 10.128.0.0/14
    hostPrefix: 23
  machineNetwork:
  - cidr: 10.0.0.0/16
  networkType: OpenShiftSDN
  serviceNetwork:
  - 172.30.0.0/16
platform:
  openstack:
    apiFloatingIP: xxx
    apiVIP: 10.0.0.5
    cloud: openstack
    defaultMachinePlatform:
      type: xxx
    externalDNS: null
    externalNetwork: xxx
    ingressVIP: xxx
publish: External
pullSecret: '{"auths":{"fake":{"auth":"aWQ6cGFzcwo="}}}'
sshKey: |
  ssh-rsa xxx
</code>```

I tried removing apiFloatingIP, however, I got the following error:

```<code>ERROR
ERROR Error: Error creating openstack_networking_floatingip_v2: Expected HTTP response code [201 202] when accessing [POST xxx], but got 409 instead
ERROR {"NeutronError": {"type": "OverQuota", "message": "Quota exceeded for resources: ['floatingip'].", "detail": ""}}
ERROR
ERROR   with openstack_networking_floatingip_v2.bootstrap_fip[0],
ERROR   on main.tf line 113, in resource "openstack_networking_floatingip_v2" "bootstrap_fip":
ERROR  113: resource "openstack_networking_floatingip_v2" "bootstrap_fip" {
ERROR
ERROR failed to fetch Cluster: failed to generate asset "Cluster": failure applying terraform for "bootstrap" stage: failed to create cluster: failed to apply Terraform: exit status 1
ERROR
ERROR Error: Error creating openstack_networking_floatingip_v2: Expected HTTP response code [201 202] when accessing [POST xxx], but got 409 instead
ERROR {"NeutronError": {"type": "OverQuota", "message": "Quota exceeded for resources: ['floatingip'].", "detail": ""}}
ERROR
ERROR   with openstack_networking_floatingip_v2.bootstrap_fip[0],
ERROR   on main.tf line 113, in resource "openstack_networking_floatingip_v2" "bootstrap_fip":
ERROR  113: resource "openstack_networking_floatingip_v2" "bootstrap_fip" {
ERROR
ERROR
</code>```

Note that I only have one public IP available, so I would like to know if there is an easy way to use the installer, and exactly what I have to modify or add in openstack.

Body:
I have some limitations in my network, so I can only use one floating IP in the installation process. I know this is possible, but I do not know how to accomplish it.
This is the install-config.yaml generated and tuned that I use:

apiVersion: v1
baseDomain: xxx
compute:
- architecture: amd64
  hyperthreading: Enabled
  name: worker
  platform:
    openstack:
      type: xxx
  replicas: 3
controlPlane:
  architecture: amd64
  hyperthreading: Enabled
  name: master
  platform:
    openstack:
      type: xxx
  replicas: 3
metadata:
  creationTimestamp: null
  name: xxx
networking:
  clusterNetwork:
  - cidr: 10.128.0.0/14
    hostPrefix: 23
  machineNetwork:
  - cidr: 10.0.0.0/16
  networkType: OpenShiftSDN
  serviceNetwork:
  - 172.30.0.0/16
platform:
  openstack:
    apiFloatingIP: xxx
    apiVIP: 10.0.0.5
    cloud: openstack
    defaultMachinePlatform:
      type: xxx
    externalDNS: null
    externalNetwork: xxx
    ingressVIP: xxx
publish: External
pullSecret: '{"auths":{"fake":{"auth":"aWQ6cGFzcwo="}}}'
sshKey: |
  ssh-rsa xxx

I tried removing apiFloatingIP, however, I got the following error:

ERROR
ERROR Error: Error creating openstack_networking_floatingip_v2: Expected HTTP response code [201 202] when accessing [POST xxx], but got 409 instead
ERROR {"NeutronError": {"type": "OverQuota", "message": "Quota exceeded for resources: ['floatingip'].", "detail": ""}}
ERROR
ERROR   with openstack_networking_floatingip_v2.bootstrap_fip[0],
ERROR   on main.tf line 113, in resource "openstack_networking_floatingip_v2" "bootstrap_fip":
ERROR  113: resource "openstack_networking_floatingip_v2" "bootstrap_fip" {
ERROR
ERROR failed to fetch Cluster: failed to generate asset "Cluster": failure applying terraform for "bootstrap" stage: failed to create cluster: failed to apply Terraform: exit status 1
ERROR
ERROR Error: Error creating openstack_networking_floatingip_v2: Expected HTTP response code [201 202] when accessing [POST xxx], but got 409 instead
ERROR {"NeutronError": {"type": "OverQuota", "message": "Quota exceeded for resources: ['floatingip'].", "detail": ""}}
ERROR
ERROR   with openstack_networking_floatingip_v2.bootstrap_fip[0],
ERROR   on main.tf line 113, in resource "openstack_networking_floatingip_v2" "bootstrap_fip":
ERROR  113: resource "openstack_networking_floatingip_v2" "bootstrap_fip" {
ERROR
ERROR

Note that I only have one public IP available, so I would like to know if there is an easy way to use the installer, and exactly what I have to modify or add in openstack.


问:
Quarkus autogenerated JAX-RS resource throws PersistentObjectException
I've created simple entity with two fields that extends PanacheEntity and then also an interface that extends PanacheEntityResource. Quarkus autogenerates all the endpoints for this entity. GET, DELETE work correctly but when trying to make POST request the application throws following: org.hibernate.PersistentObjectException: detached entity passed to persist: org.acme.Student. Since the entire project is as simple as possible I can't figure out what's wrong with it.

Student.java

```<code>package org.acme;

import javax.persistence.Entity;

import io.quarkus.hibernate.orm.panache.PanacheEntity;

@Entity
public class Student extends PanacheEntity{
    public Long id;
    public String name;
}
</code>```

StudentResource.java

```<code>package org.acme;

import io.quarkus.hibernate.orm.rest.data.panache.PanacheEntityResource;

public interface StudentResource extends PanacheEntityResource<Student, Long>{
}
</code>```

POST request body

```<code>{
  "name": "Vitaliy",
  "id": 5
}
</code>```

Body:
I've created simple entity with two fields that extends PanacheEntity and then also an interface that extends PanacheEntityResource. Quarkus autogenerates all the endpoints for this entity. GET, DELETE work correctly but when trying to make POST request the application throws following: org.hibernate.PersistentObjectException: detached entity passed to persist: org.acme.Student. Since the entire project is as simple as possible I can't figure out what's wrong with it.

Student.java

package org.acme;

import javax.persistence.Entity;

import io.quarkus.hibernate.orm.panache.PanacheEntity;

@Entity
public class Student extends PanacheEntity{
    public Long id;
    public String name;
}

StudentResource.java

package org.acme;

import io.quarkus.hibernate.orm.rest.data.panache.PanacheEntityResource;

public interface StudentResource extends PanacheEntityResource<Student, Long>{
}

POST request body

{
  "name": "Vitaliy",
  "id": 5
}