问:
JAXBException error while external SOAP web service
The service is made to consume an external soap web service. Despite having set the configs as shown below:

public class Test extends WebServiceGatewaySupport {

```<code>  public JAXBElement<Result> callWebService(String url, JAXBElement<Request> request){

    return (JAXBElement<Result>) getWebServiceTemplate().marshalSendAndReceive(url, request);

  }
}

@Bean
public Jaxb2Marshaller marshaller() {

    Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    marshaller.setContextPath(path);
    return marshaller;
}

@Bean
public Test test(Jaxb2Marshaller jaxb2Marshaller) {
    Test client = new Test();
    client.setDefaultUri(uri);
    client.setMarshaller(jaxb2Marshaller);
    client.setUnmarshaller(jaxb2Marshaller);
    return client;
}
</code>```

There has been a persistent error reading:

```<code>Caused by: jakarta.xml.bind.JAXBException: class javax.xml.bind.JAXBElement nor any of its super class is known to this context.
    at org.glassfish.jaxb.runtime.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:543)
    at org.glassfish.jaxb.runtime.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:444)
    at org.glassfish.jaxb.runtime.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:265)
    at org.glassfish.jaxb.runtime.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:197)
    at org.springframework.oxm.jaxb.Jaxb2Marshaller.marshal(Jaxb2Marshaller.java:712)
    ... 65 more
</code>```

Mind that the @XmlSeeAlso is present on the objectfactory classes.

The general expectation was that the service is able to reach the third party soap service but it seems to encounter the runtime error when calling the web service with the callWebService( uri, jaxbElement) method.

Body:
The service is made to consume an external soap web service. Despite having set the configs as shown below:

public class Test extends WebServiceGatewaySupport {

  public JAXBElement<Result> callWebService(String url, JAXBElement<Request> request){

    return (JAXBElement<Result>) getWebServiceTemplate().marshalSendAndReceive(url, request);

  }
}

@Bean
public Jaxb2Marshaller marshaller() {

    Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    marshaller.setContextPath(path);
    return marshaller;
}

@Bean
public Test test(Jaxb2Marshaller jaxb2Marshaller) {
    Test client = new Test();
    client.setDefaultUri(uri);
    client.setMarshaller(jaxb2Marshaller);
    client.setUnmarshaller(jaxb2Marshaller);
    return client;
}

There has been a persistent error reading:

Caused by: jakarta.xml.bind.JAXBException: class javax.xml.bind.JAXBElement nor any of its super class is known to this context.
    at org.glassfish.jaxb.runtime.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:543)
    at org.glassfish.jaxb.runtime.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:444)
    at org.glassfish.jaxb.runtime.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:265)
    at org.glassfish.jaxb.runtime.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:197)
    at org.springframework.oxm.jaxb.Jaxb2Marshaller.marshal(Jaxb2Marshaller.java:712)
    ... 65 more

Mind that the @XmlSeeAlso is present on the objectfactory classes.

The general expectation was that the service is able to reach the third party soap service but it seems to encounter the runtime error when calling the web service with the callWebService( uri, jaxbElement) method.


来源: stackexchange

问:
Why redis max expired keys is the maximum written keys of per second divided by 4
Why redis max expired keys is the maximum written keys of per second divided by 4.

The redis cycle deletion strategy is based on probability.I think even if the keys sampled each time are different, the maximum number of expired keys must be 1/4 of the total memory.

Why not give expired time sorting? Which is better than probability.I feel that based on probability is an unreliable solution.

I didn't find a reasonable explanation from books and official documents.
Official doucument: How Redis expires keys

ContentLicense: CC BY-SA 4.0


问:
Is there any way to programmatically detect if setting "Random hardware addresses" is enabled?
I am trying to detect if the setting called "Random hardware addresses" is enabled on a Windows machine.

I would like to filter out network cards that have this option enabled and only leave network cards that have this option disabled. I am trying to code this for c++, but i can also accept c#.
I can also work with just a global feedback that this is enabled in general on a Windows machine.

So far i have searched through the register at the best of my abilities and though iptypes.h.
Did not find any interface that would provide this information.

EDIT:
I need a MAC list that does not contain cards with this option enabled.
Currently i am using GetAdaptersInfo() and RegQueryValueEx() to query all cards and get other information of network interfaces.


问:
how to fix Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) when use decodeURIComponent
hi guys i am use typescript for angular project, and my application running well, but when i check use our veracode for scanning application i got this problem,

```<code>window.location.href = decodeURIComponent(decodeURIComponent(this.queryParams['login_url']));
</code>```

the flaws vulnerabilities is : Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)

i got information this code improper neutralization. how to fix this issue ? i have try search on google but i still got error

Body:
hi guys i am use typescript for angular project, and my application running well, but when i check use our veracode for scanning application i got this problem,

window.location.href = decodeURIComponent(decodeURIComponent(this.queryParams['login_url']));

the flaws vulnerabilities is : Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)

i got information this code improper neutralization. how to fix this issue ? i have try search on google but i still got error


问:
Show Warning message When User is from different country/region android studio
I want to get user from canada or USA (can use vpn) in my android application. If any user under the network of other countrybased location, The application will show him/her a warning message and close the application. If connected to vpn in canada or usa, it will give the access of using application.

I have no idea about it. Please help me out.

I am using android studio for coding a mobile application.

Thanks in advance.


问:
How to force a Google Protobuf generated java code to implement a user-defined interface
I am working on a service serialization enhancement to introduce Google Protobuf. One additional design flexibility, I am attempting to accomplish is to enhance the ease of extensibility of the serialization mechanisms. The idea I got is to define an interface that contains a subset of the *Builder.java Protobuf generated java code, then append the generated *Builder.java class to implement that newly defined interface. My questions are:

How I can append that interface syntax to the generated class?

Does Protobuf have a native way to support such a scenario?

If Google Protobuf doesn't support that approach natively, is there a different, better approach to do it? (other than encapsulating the *Builder.java class in a wrapper object?)

In light of Protobuf's best practices, does anyone thinks doing a code-gen that generates and appends the needed code to the *Builder.java at the coding build stage is feasible?

I have looked in blog posts and it seems the way that people are implementing it is using gradle to append the interface implementation syntax implements user_defined_interfaceinto the protobuf generated Java code *Builder.java class


问:
reducing lag and packet loss in online multiplayer games
good day dears,
i have developed a turn based multiplayer game, using Nakama server and deployed it on AWS ec2 instance and using unity as editor,
since i did not use their managed cloud i had to implement every server configurations myself, and by that i'm facing a lot of lag, desync and packet loss even if the internet connection is not very bad, the socket gets disconnected in most devices which results in more packet loss,

here is my netcode:
my game is turn based, i don't send any data inside update method, a player does a bunch of movement(in all cases a player has either 2 moves or 4 moves which might be completed around a second or two) each move is send as a packet this packet has 5 payloads which usually contains a small number of bytes (example: a string such as "2.736" or "move")
for serialization i use tiny json

my server Type:
since i'm not using nakama enterprise i can't create a cluster, i only have one instance of type t2.xlarge ( 4 cpus, 16 gib memory) deployed on ireland and i'm in iraq

server configurations:
max_request_size_bytes: 8000
max_message_size_bytes: 8000
outgoing_queue_size: 32
read_buffer_size_bytes: 8192
write_buffer_size_bytes: 8192

please someone guide me into fixing this issue that i think it all occures because of bad server setup,
any help is much appreciated.


问:
External API calls in lib folder in Nextjs app return undefined during npm run build
I have built an app using Nextjs and I am having the following problem when I try to deploy the app on Vercel. Npm run build always throws this error:

```<code>Error occurred prerendering page "/portfolio/0". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: jsonRes.items is not iterable (cannot read property undefined)
    at /vercel/path0/.next/server/pages/portfolio/[id].js:84:150
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async getPhotos (/vercel/path0/.next/server/pages/portfolio/[id].js:84:5)
    at async getStaticProps (/vercel/path0/.next/server/pages/portfolio/[id].js:114:18)
    at async renderToHTML (/vercel/path0/node_modules/next/dist/server/render.js:384:20)
    at async /vercel/path0/node_modules/next/dist/export/worker.js:248:32
    at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/trace/trace.js:79:20)
</code>```

I am trying to retrieve a gallery of photos from Google Drive that relate to the projects I need to display. I have followed the Next.js documentation to a T and my app works just fine locally and I have no errors when I run npm run build locally. The following is my code where the API call that returns undefined is located:

```<code>export async function getPhotos() {
  const imgIds = [];

  const URL_START = "https://www.googleapis.com/drive/example/url";
  const URL_END = "example";

  await fetch(URL_START + process.env.NEXT_PUBLIC_DIR_ID + URL_END + process.env.NEXT_PUBLIC_G_KEY)
    .then(res => res.json())
    .then(jsonRes => imgIds.push(...jsonRes.items));

  return imgIds;
}
</code>```

And the following is the getStaticProps function where the above function is called:

```<code>import { getPhotos } from '../../lib/photos';

export const getStaticProps = async (context) => {
  const id = context.params.id;
  const project = Projects.projects[id];

  var photos = await getPhotos(); // function from lib/
  var projectPhotos = [];

  for (var i = 0; i < photos.length; i++) {
    if (photos[i].title.includes(project.title)) {
      projectPhotos.push(photos[i]);
    }
  }

  project.images = projectPhotos;

  return {
    props: {
      project
    }
  }
}
</code>```

To see the documentation I referred to, go here: https://nextjs.org/docs/basic-features/data-fetching/get-static-props
Thank you in advance.

Body:
I have built an app using Nextjs and I am having the following problem when I try to deploy the app on Vercel. Npm run build always throws this error:

Error occurred prerendering page "/portfolio/0". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: jsonRes.items is not iterable (cannot read property undefined)
    at /vercel/path0/.next/server/pages/portfolio/[id].js:84:150
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async getPhotos (/vercel/path0/.next/server/pages/portfolio/[id].js:84:5)
    at async getStaticProps (/vercel/path0/.next/server/pages/portfolio/[id].js:114:18)
    at async renderToHTML (/vercel/path0/node_modules/next/dist/server/render.js:384:20)
    at async /vercel/path0/node_modules/next/dist/export/worker.js:248:32
    at async Span.traceAsyncFn (/vercel/path0/node_modules/next/dist/trace/trace.js:79:20)

I am trying to retrieve a gallery of photos from Google Drive that relate to the projects I need to display. I have followed the Next.js documentation to a T and my app works just fine locally and I have no errors when I run npm run build locally. The following is my code where the API call that returns undefined is located:

export async function getPhotos() {
  const imgIds = [];

  const URL_START = "https://www.googleapis.com/drive/example/url";
  const URL_END = "example";

  await fetch(URL_START + process.env.NEXT_PUBLIC_DIR_ID + URL_END + process.env.NEXT_PUBLIC_G_KEY)
    .then(res => res.json())
    .then(jsonRes => imgIds.push(...jsonRes.items));

  return imgIds;
}

And the following is the getStaticProps function where the above function is called:

import { getPhotos } from '../../lib/photos';

export const getStaticProps = async (context) => {
  const id = context.params.id;
  const project = Projects.projects[id];

  var photos = await getPhotos(); // function from lib/
  var projectPhotos = [];

  for (var i = 0; i < photos.length; i++) {
    if (photos[i].title.includes(project.title)) {
      projectPhotos.push(photos[i]);
    }
  }

  project.images = projectPhotos;

  return {
    props: {
      project
    }
  }
}

To see the documentation I referred to, go here: https://nextjs.org/docs/basic-features/data-fetching/get-static-props
Thank you in advance.


问:
Dependent dropdown with the following json - using Flutter
I am a beginner in flutter, I have the current json response:

```<code>{
   "pizza":[
      {
         "type":"auto",
         "name":"bmw",
         "currency":"usd"
      },
      {
         "type":"furniture",
         "name":"closet",
         "currency":"eur"
      },
      {
         "type":"electronics",
         "name":"PC",
         "currency":"GBP"
      },
      {
         "type":"auto",
         "name":"audi",
         "currency":"GBP"
      }
   ]
}
</code>```

data is fetched in entity

My Entity:

```<code>class PizzaEntity extends Equatable  {
  final String type;
  final String name;
  final String currency;

  const PizzaEntity({
    required this.type,
    required this.name,
    required this.currency,
  });

  @override
  List<Object?> get props => [
        type,
        name,
        currency,
      ];
}
</code>```

Piece from ui:

```<code>BlocBuilder<MyBlocBloc, MyBlocState>(
            builder: (context, state) {
          if (state is MyBlocLoading) {
            return const Center(
              child: CircularProgressIndicator(),
            );
          } else if (state is MyBlocLoaded) {
            PizzaEntity pizza = state.pizza;
            if (pizza.isEmpty) {
              return Text("null");
            }

            return  // My dependable dropdown
          } else if (state is MyBlocError) {
            return Text("error");
          } else {
            return const Center(
              child: Icon(Icons.error),
            );
          }
        }
        )
</code>```

I need to add here 3 related dropdown lists inside BlocBuilder:

type, (auto)

linked to the type (bmw, audi)

linked to the type and name (selected bmw:usd, audi: GBP)

Body:
I am a beginner in flutter, I have the current json response:

{
   "pizza":[
      {
         "type":"auto",
         "name":"bmw",
         "currency":"usd"
      },
      {
         "type":"furniture",
         "name":"closet",
         "currency":"eur"
      },
      {
         "type":"electronics",
         "name":"PC",
         "currency":"GBP"
      },
      {
         "type":"auto",
         "name":"audi",
         "currency":"GBP"
      }
   ]
}

data is fetched in entity

My Entity:

class PizzaEntity extends Equatable  {
  final String type;
  final String name;
  final String currency;

  const PizzaEntity({
    required this.type,
    required this.name,
    required this.currency,
  });

  @override
  List<Object?> get props => [
        type,
        name,
        currency,
      ];
}

Piece from ui:

BlocBuilder<MyBlocBloc, MyBlocState>(
            builder: (context, state) {
          if (state is MyBlocLoading) {
            return const Center(
              child: CircularProgressIndicator(),
            );
          } else if (state is MyBlocLoaded) {
            PizzaEntity pizza = state.pizza;
            if (pizza.isEmpty) {
              return Text("null");
            }

            return  // My dependable dropdown
          } else if (state is MyBlocError) {
            return Text("error");
          } else {
            return const Center(
              child: Icon(Icons.error),
            );
          }
        }
        )

I need to add here 3 related dropdown lists inside BlocBuilder:

type, (auto)

linked to the type (bmw, audi)

linked to the type and name (selected bmw:usd, audi: GBP)


问:
From Parts DiagnosticError in Flutter while using ListView.Builder
I have my widget as

```<code>Flexible(
   child: Column(
     children: [
       Expanded(
        child: SizedBox(
           width: double.infinity,
           height: double.infinity,
           child: ListView.builder(
              scrollDirection: Axis.vertical,
              itemCount: content.length,
              itemBuilder: (context, index) {
              return LocalChatItem(index: index);
            },
           ),
         ),
        ),
      ],
  ),
)
</code>```

and I am getting below error -
throw FlutterError.fromParts(<DiagnosticsNode>[
ErrorSummary('Incorrect use of ParentDataWidget.'),
...parentDataWidget._debugDescribeIncorrectParentDataType(
parentData: renderObject.parentData,
parentDataCreator: _ancestorRenderObjectElement!.widget as RenderObjectWidget,
ownershipChain: ErrorDescription(debugGetCreatorChain(10)),
),
])

Please help we solving this error i am having headache now after looking for 1 month till now

Body:
I have my widget as

Flexible(
   child: Column(
     children: [
       Expanded(
        child: SizedBox(
           width: double.infinity,
           height: double.infinity,
           child: ListView.builder(
              scrollDirection: Axis.vertical,
              itemCount: content.length,
              itemBuilder: (context, index) {
              return LocalChatItem(index: index);
            },
           ),
         ),
        ),
      ],
  ),
)

and I am getting below error -
throw FlutterError.fromParts(<DiagnosticsNode>[
ErrorSummary('Incorrect use of ParentDataWidget.'),
...parentDataWidget._debugDescribeIncorrectParentDataType(
parentData: renderObject.parentData,
parentDataCreator: _ancestorRenderObjectElement!.widget as RenderObjectWidget,
ownershipChain: ErrorDescription(debugGetCreatorChain(10)),
),
])

Please help we solving this error i am having headache now after looking for 1 month till now


问:
How to identify and kill the child processes which were created during an API call whose parent processes have been killed ? (python code required)
I have created an API in python using tornado. For a given URL, it returns me with a summary of data on that URL. There are several processes which are still there (and not running, but consuming space). For example, in the image provided, I can see 'chrome_crashpad' which is not running but still consuming space. So, I am looking for a python code where we make sure that for API hit, the processes which were created are deleted at the end , so that it doesn't affect the server (over longer period of time). In other words, the junk processes whose parents have been killed should also be identified and deleted.

I tried and was unable to identify if these processes are junk processes or not. Also , was unable to identify if the process which is there and TIME shown is 00:00:00 is parent process or not. Need more clarity on this. But, the motive of this is to delete all the junk and zombie processes so that for a longer duration of time, the server remains stable.processes shown at my server


问:
How .doc file print in google chrome using js?
i have a url for doc file
how pirnt this on any browser

```<code>function printdoc(id) {
    $.ajax({
        type: "POST",
        url: "/Document/GetDocIdByDocumentUrl",
        data: { id: id },
        success: function (url) {
            debugger
            let Filename = url.substr(url.lastIndexOf("/") + 1)
            if (IsDoc) {

                let new_window = window.open(`https://docs.google.com/viewerng/viewer?url=${url}`, '', 'height=500, width=500');
                let doc = document.createElement("iframe");
                doc.style.height = "100%";
                doc.style.width = "100%";
                doc.src = "https://docs.google.com/gview?url=" + url + "&embedded=true";
                new_window.document.write(doc.outerHTML);
                setTimeout(() => {
                    new_window.print();
                    new_window.close();
                }, 2000);
            }

        },
        error: function (err) {
            console.log(err);
        }
    });
}
</code>```

i have try this code , but file quality not good and not full size
any solution

Body:
i have a url for doc file
how pirnt this on any browser

function printdoc(id) {
    $.ajax({
        type: "POST",
        url: "/Document/GetDocIdByDocumentUrl",
        data: { id: id },
        success: function (url) {
            debugger
            let Filename = url.substr(url.lastIndexOf("/") + 1)
            if (IsDoc) {

                let new_window = window.open(`https://docs.google.com/viewerng/viewer?url=${url}`, '', 'height=500, width=500');
                let doc = document.createElement("iframe");
                doc.style.height = "100%";
                doc.style.width = "100%";
                doc.src = "https://docs.google.com/gview?url=" + url + "&embedded=true";
                new_window.document.write(doc.outerHTML);
                setTimeout(() => {
                    new_window.print();
                    new_window.close();
                }, 2000);
            }

        },
        error: function (err) {
            console.log(err);
        }
    });
}

i have try this code , but file quality not good and not full size
any solution


问:
How to get MORPH-II dataset
Recently I needed facial images and corresponding height and weight information as supporting data for a study, and I found that MORPH-II dataset had the data I needed.
Does anyone know where to apply for this dataset, and is my application channel wrong?

I have not received any response to the application form I submitted to the official website (https://uncw.edu/oic/tech/morph.html) for academic use and have tried to contact the author and the official contact email address.
It doesn't look like I can get the data this way, and I tried the links mentioned in the other questions and they don't seem to work anymore.

Title: How to get MORPH-II dataset


问:
Blob download not working with JavaScript inside a WebView
I have a React application which needs to support both WebViews and Browsers. I have a functionality where-in we have an API which returns base64String and we need to convert it to PDF and provide a link to user to download the PDF. Below is a sample code snippet.

Code Snippet:

const convertBase64StringToPDF = (data: string) => {
  const byteCharacters = atob(data);
  const byteNumbers = new Array(byteCharacters.length);
  for (let i = 0; i < byteCharacters.length; i++) {
    byteNumbers[i] = byteCharacters.charCodeAt(i);
  }
  const byteArray = new Uint8Array(byteNumbers);
  return new Blob([byteArray], { type: 'application/pdf' });
};

getbase64StringData(baseUrl2)
  .then((response) => {
    const blob = convertBase64StringToPDF(response.foobar);
    const link = document.createElement('a');
    link.href = window.URL.createObjectURL(blob);
    link.download = 'MyDoc' + new Date() + '.pdf';
    link.click();
  })
```

The problem I'm facing is when a user clicks on the link we create, the download isn't getting triggered only in WebViews. I searched for solutions but most of them suggest making changes in WebView code. Problem is I don't have control over the App code which has the WebView embedded in it. Is there a way I can solve this in React/JavaScript application? I don't care where the download happens, I just need it to get triggered and get stored in users device.

Body:
I have a React application which needs to support both WebViews and Browsers. I have a functionality where-in we have an API which returns base64String and we need to convert it to PDF and provide a link to user to download the PDF. Below is a sample code snippet.

Code Snippet:

const convertBase64StringToPDF = (data: string) => {
  const byteCharacters = atob(data);
  const byteNumbers = new Array(byteCharacters.length);
  for (let i = 0; i < byteCharacters.length; i++) {
    byteNumbers[i] = byteCharacters.charCodeAt(i);
  }
  const byteArray = new Uint8Array(byteNumbers);
  return new Blob([byteArray], { type: 'application/pdf' });
};

getbase64StringData(baseUrl2)
  .then((response) => {
    const blob = convertBase64StringToPDF(response.foobar);
    const link = document.createElement('a');
    link.href = window.URL.createObjectURL(blob);
    link.download = 'MyDoc' + new Date() + '.pdf';
    link.click();
  })

The problem I'm facing is when a user clicks on the link we create, the download isn't getting triggered only in WebViews. I searched for solutions but most of them suggest making changes in WebView code. Problem is I don't have control over the App code which has the WebView embedded in it. Is there a way I can solve this in React/JavaScript application? I don't care where the download happens, I just need it to get triggered and get stored in users device.


问:
Edit iframe DOM from window
When i try to manipulate iframe i always get the cors issue permission denied to access property document on cross-origin, same goes when i try to attach event listener.

So is it possible to manipulate DOM elements inside iframe that is coming from different origin?

I'm happy to somehow also take a copy of iframe and just have it in my code as long as it allows me to edit it later, but unsure how?

```<code>import { useEffect } from 'react';

const post = () => {
  const iframe = document.querySelector('iframe');
  const message = { type: 'modifyDOM', text: 'Hello World!' };
  // window.postMessage(message);

  if (iframe?.contentWindow) {
    iframe.contentWindow.postMessage(message, 'http://example.com');
  }
};

export const IFrame = () => {
  useEffect(() => {
    const iframe = document.querySelector('iframe');

    const receiveMessage = (e: MessageEvent) => {
      if (e.data.type === 'modifyDOM') {
        console.log(e.data);
        // window.document.body.innerHTML = '<h1>Hello World!</h1>';
        if (iframe?.contentWindow) {
          iframe.contentWindow.document.body.innerHTML = '<h1>Hello World!</h1>';
        }
      }
    };

    window.addEventListener('message', receiveMessage);

    return () => {
      window.removeEventListener('message', receiveMessage);
    };
  }, []);

  return (
    <div>
      <button onClick={post}>Post</button>
      <iframe src="http://example.com" />
    </div>
  );
};
</code>```

Title: Edit iframe DOM from window

Body:
When i try to manipulate iframe i always get the cors issue permission denied to access property document on cross-origin, same goes when i try to attach event listener.

So is it possible to manipulate DOM elements inside iframe that is coming from different origin?

I'm happy to somehow also take a copy of iframe and just have it in my code as long as it allows me to edit it later, but unsure how?

import { useEffect } from 'react';

const post = () => {
  const iframe = document.querySelector('iframe');
  const message = { type: 'modifyDOM', text: 'Hello World!' };
  // window.postMessage(message);

  if (iframe?.contentWindow) {
    iframe.contentWindow.postMessage(message, 'http://example.com');
  }
};

export const IFrame = () => {
  useEffect(() => {
    const iframe = document.querySelector('iframe');

    const receiveMessage = (e: MessageEvent) => {
      if (e.data.type === 'modifyDOM') {
        console.log(e.data);
        // window.document.body.innerHTML = '
Hello World!
';
        if (iframe?.contentWindow) {
          iframe.contentWindow.document.body.innerHTML = '
Hello World!
';
        }
      }
    };

    window.addEventListener('message', receiveMessage);

    return () => {
      window.removeEventListener('message', receiveMessage);
    };
  }, []);

  return (

      <button onClick={post}>Post</button>

  );
};


问:
How can I open cmd in PostgreSQL?
I know, that it possible to write python code in postgresql with PL/Python Functions.
Is it possible to call cmd command from postgresql? I need to use pg_repack, not from terminal as usual, but from procedures from postgresql.</p>

Title: How can I open cmd in PostgreSQL?


问:
How to not let outlook or gmail not to change the rgb color in dark mode?
I don't want outlook or gmail to change my background-color of rgb(255, 80, 0) to rgb(208, 33, 0).My background is a dark one,therefore email clients are changing it into a slightly lighter or darker shade of the original color.I have tried using gradient but it doesn't work with every client. Can anyone help?

CSS for overwriting outlook inline css.

IMAGES FOR REFERENCE:

1.DARK MODE IMAGE
2.LIGHT MODE IMAGE


问:
Custom Authorization with Windows Authentication
I have a Web API which is developed on.Net where enabled Windows Authentication. I have added some custom authorization code also where it checks for the systemid/userid from the database.

Here I am trying to check if the user details are there in the DB it is working fine. If the details are not there in the DB then the authentication pop up is keeps on poping up even if entered the correct Windows credentials. How to handle that pop up if the user is not there in the DB instead of popping up the window continuously.

Added custom authorization class and added the attribute over the controller.


问:
In other environments, the package of python3 venv is not recognized
I'm developing python3 venv in my local environment.

And, I compressed the project by compressing the whole (including the venv folder) and executed it on another environment (closed server, can`t use pip).

Of course, I ran venv in an activated state, and I also confirmed that there were packages I wanted to use in the site-package in venv.


问:
Unhandled Exception: Instance of '_RecorderRunningException' flutter_sound_lite
I am using flutter sound lite library what I wanna do is to record the sound and then play the recorded sound so i wrote the following code

importing the library

```<code>import 'package:flutter_sound_lite/public/flutter_sound_recorder.dart';
</code>```

Class to record the sound start_recorder.dart

```<code>class SoundRecorder{
  FlutterSoundRecorder? _audioRecorder;
  bool _isRecorderInitialised= false;
  bool isRecording=false;

  //init method
  Future init() async{
    _audioRecorder= FlutterSoundRecorder();
    final status= await Permission.microphone.request();
    if(status!= PermissionStatus.granted){
      throw RecordingPermissionException('Microphone permission not granted');
    }
    await _audioRecorder!.openAudioSession();
    _isRecorderInitialised=true;
  }

  //dispose method

  void dispose(){
    if(!_isRecorderInitialised) return;
    _audioRecorder!.closeAudioSession();
    _audioRecorder=null;
    _isRecorderInitialised=false;
  }

  //record method to record sound
  Future _record() async{
    if(!_isRecorderInitialised) return;
    try{
      await _audioRecorder!.startRecorder(toFile:pathToSaveAudio );
    }
    catch (e)
    {
      throw e;
    }

  }

  //stop method to stop recording sound

  Future _stop() async {
    if(!_isRecorderInitialised) return;
    await _audioRecorder!. startRecorder();

  }
  Future toggleRecording() async{
    if(_audioRecorder!.isStopped){
      isRecording=true;
      await _record();
    }
    else{
      isRecording=false;
      await _stop();
    }
  }

}
</code>```

Main.dart

now in main state elevatedButton is a child of a container

```<code>Container(
            child:  ElevatedButton.icon(
              style: ElevatedButton.styleFrom(
                  minimumSize: Size(175, 50),
                  primary: primary,
                  onPrimary: onPrimary
              ),
              icon: Icon(icon),
              label: Text(
                text,
                style: TextStyle(fontSize: 16,fontWeight: FontWeight.bold),
              ),
              onPressed: () async{
                final isRecording= await recorder.toggleRecording();
                setState(() {

                });
              },

            ),

          )
</code>```

when i start recorder it turn button red and icon to stop icon but when i click back it doesnt get into actual position and in log it gives an error
Unhandled Exception: Instance of '_RecorderRunningException'

logs

```<code>V/AutofillManager(26337): requestHideFillUi(null): anchor = null
I/flutter (26337): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (26337): │ #0   FlutterSoundRecorder.startRecorder (package:flutter_sound_lite/public/flutter_sound_recorder.dart:635:13)
I/flutter (26337): │ #1   SoundRecorder._record (package:speech_app/api/start_recorder.dart:27:29)
I/flutter (26337): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter (26337): │  FS:---> startRecorder
I/flutter (26337): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (26337): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (26337): │ #0   FlutterSoundRecorder._startRecorder (package:flutter_sound_lite/public/flutter_sound_recorder.dart:659:13)
I/flutter (26337): │ #1   FlutterSoundRecorder.startRecorder.<anonymous closure> (package:flutter_sound_lite/public/flutter_sound_recorder.dart:637:13)
I/flutter (26337): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter (26337): │  FS:---> _startRecorder.
I/flutter (26337): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
D/AudioRecordExtImpl(26337): AudioRecordExtImpl init
D/AudioRecordExtImpl(26337): audiorecordTest
D/AudioRecord(26337): set(): inputSource 0, sampleRate 16000, format 0x1, channelMask 0x10, frameCount 1280, notificationFrames 0, sessionId 0, transferType 0, flags 0, identity AttributionSourceState{pid: -1, uid: 10375, packageName: com.speech.app.speech_app, attributionTag: (null), token: , renouncedPermissions: [], next: []}uid -1, pid -1
D/AudioRecord(26337): set(): mSessionId 0
D/AudioRecord(26337): start(2854): sync event 0 trigger session 0
I/System.out(26337): ---> writeAudioDataToFile
W/System.err(26337): java.io.FileNotFoundException: audio_example.wav: open failed: EROFS (Read-only file system)
W/System.err(26337):    at libcore.io.IoBridge.open(IoBridge.java:574)
W/System.err(26337):    at java.io.FileOutputStream.<init>(FileOutputStream.java:236)
W/System.err(26337):    at java.io.FileOutputStream.<init>(FileOutputStream.java:125)
W/System.err(26337):    at com.dooboolab.TauEngine.FlautoRecorderEngine.writeAudioDataToFile(FlautoRecorderEngine.java:70)
W/System.err(26337):    at com.dooboolab.TauEngine.FlautoRecorderEngine._startRecorder(FlautoRecorderEngine.java:247)
W/System.err(26337):    at com.dooboolab.TauEngine.FlautoRecorder.startRecorder(FlautoRecorder.java:300)
W/System.err(26337):    at com.dooboolab.fluttersound.FlutterSoundRecorder.startRecorder(FlutterSoundRecorder.java:261)
W/System.err(26337):    at com.dooboolab.fluttersound.FlutterSoundRecorderManager.onMethodCall(FlutterSoundRecorderManager.java:106)
W/System.err(26337):    at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
W/System.err(26337):    at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
W/System.err(26337):    at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
W/System.err(26337):    at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
W/System.err(26337):    at android.os.Handler.handleCallback(Handler.java:938)
W/System.err(26337):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(26337):    at android.os.Looper.loopOnce(Looper.java:233)
W/System.err(26337):    at android.os.Looper.loop(Looper.java:344)
W/System.err(26337):    at android.app.ActivityThread.main(ActivityThread.java:8212)
W/System.err(26337):    at java.lang.reflect.Method.invoke(Native Method)
W/System.err(26337):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
W/System.err(26337):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1034)
W/System.err(26337): Caused by: android.system.ErrnoException: open failed: EROFS (Read-only file system)
W/System.err(26337):    at libcore.io.Linux.open(Native Method)
W/System.err(26337):    at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
W/System.err(26337):    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
W/System.err(26337):    at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
W/System.err(26337):    at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:8094)
W/System.err(26337):    at libcore.io.IoBridge.open(IoBridge.java:560)
W/System.err(26337):    ... 19 more
I/flutter (26337): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (26337): │ #0   FlutterSoundRecorder.startRecorderCompleted (package:flutter_sound_lite/public/flutter_sound_recorder.dart:249:13)
I/flutter (26337): │ #1   MethodChannelFlutterSoundRecorder.channelMethodCallHandler (package:flutter_sound_platform_interface/method_channel_flutter_sound_recorder.dart:74:22)
I/flutter (26337): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter (26337): │  ---> startRecorderCompleted: true
I/flutter (26337): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (26337): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (26337): │ #0   FlutterSoundRecorder.startRecorderCompleted (package:flutter_sound_lite/public/flutter_sound_recorder.dart:258:13)
I/flutter (26337): │ #1   MethodChannelFlutterSoundRecorder.channelMethodCallHandler (package:flutter_sound_platform_interface/method_channel_flutter_sound_recorder.dart:74:22)
I/flutter (26337): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter (26337): │  <--- startRecorderCompleted: true
I/flutter (26337): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (26337): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (26337): │ #0   FlutterSoundRecorder._startRecorder (package:flutter_sound_lite/public/flutter_sound_recorder.dart:750:13)
I/flutter (26337): │ #1   <asynchronous suspension>
I/flutter (26337): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter (26337): │  FS:<--- _startRecorder.
I/flutter (26337): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (26337): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (26337): │ #0   FlutterSoundRecorder.startRecorder (package:flutter_sound_lite/public/flutter_sound_recorder.dart:647:13)
I/flutter (26337): │ #1   <asynchronous suspension>
I/flutter (26337): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter (26337): │  FS:<--- startRecorder
I/flutter (26337): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
</code>```

Body:
I am using flutter sound lite library what I wanna do is to record the sound and then play the recorded sound so i wrote the following code

importing the library

import 'package:flutter_sound_lite/public/flutter_sound_recorder.dart';

Class to record the sound start_recorder.dart

class SoundRecorder{
  FlutterSoundRecorder? _audioRecorder;
  bool _isRecorderInitialised= false;
  bool isRecording=false;

  //init method
  Future init() async{
    _audioRecorder= FlutterSoundRecorder();
    final status= await Permission.microphone.request();
    if(status!= PermissionStatus.granted){
      throw RecordingPermissionException('Microphone permission not granted');
    }
    await _audioRecorder!.openAudioSession();
    _isRecorderInitialised=true;
  }

  //dispose method

  void dispose(){
    if(!_isRecorderInitialised) return;
    _audioRecorder!.closeAudioSession();
    _audioRecorder=null;
    _isRecorderInitialised=false;
  }

  //record method to record sound
  Future _record() async{
    if(!_isRecorderInitialised) return;
    try{
      await _audioRecorder!.startRecorder(toFile:pathToSaveAudio );
    }
    catch (e)
    {
      throw e;
    }

  }

  //stop method to stop recording sound

  Future _stop() async {
    if(!_isRecorderInitialised) return;
    await _audioRecorder!. startRecorder();

  }
  Future toggleRecording() async{
    if(_audioRecorder!.isStopped){
      isRecording=true;
      await _record();
    }
    else{
      isRecording=false;
      await _stop();
    }
  }

}

Main.dart

now in main state elevatedButton is a child of a container

Container(
            child:  ElevatedButton.icon(
              style: ElevatedButton.styleFrom(
                  minimumSize: Size(175, 50),
                  primary: primary,
                  onPrimary: onPrimary
              ),
              icon: Icon(icon),
              label: Text(
                text,
                style: TextStyle(fontSize: 16,fontWeight: FontWeight.bold),
              ),
              onPressed: () async{
                final isRecording= await recorder.toggleRecording();
                setState(() {

                });
              },

            ),

          )

when i start recorder it turn button red and icon to stop icon but when i click back it doesnt get into actual position and in log it gives an error
Unhandled Exception: Instance of '_RecorderRunningException'

logs

V/AutofillManager(26337): requestHideFillUi(null): anchor = null
I/flutter (26337): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (26337): │ #0   FlutterSoundRecorder.startRecorder (package:flutter_sound_lite/public/flutter_sound_recorder.dart:635:13)
I/flutter (26337): │ #1   SoundRecorder._record (package:speech_app/api/start_recorder.dart:27:29)
I/flutter (26337): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter (26337): │  FS:---> startRecorder
I/flutter (26337): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (26337): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (26337): │ #0   FlutterSoundRecorder._startRecorder (package:flutter_sound_lite/public/flutter_sound_recorder.dart:659:13)
I/flutter (26337): │ #1   FlutterSoundRecorder.startRecorder.<anonymous closure> (package:flutter_sound_lite/public/flutter_sound_recorder.dart:637:13)
I/flutter (26337): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter (26337): │  FS:---> _startRecorder.
I/flutter (26337): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
D/AudioRecordExtImpl(26337): AudioRecordExtImpl init
D/AudioRecordExtImpl(26337): audiorecordTest
D/AudioRecord(26337): set(): inputSource 0, sampleRate 16000, format 0x1, channelMask 0x10, frameCount 1280, notificationFrames 0, sessionId 0, transferType 0, flags 0, identity AttributionSourceState{pid: -1, uid: 10375, packageName: com.speech.app.speech_app, attributionTag: (null), token: , renouncedPermissions: [], next: []}uid -1, pid -1
D/AudioRecord(26337): set(): mSessionId 0
D/AudioRecord(26337): start(2854): sync event 0 trigger session 0
I/System.out(26337): ---> writeAudioDataToFile
W/System.err(26337): java.io.FileNotFoundException: audio_example.wav: open failed: EROFS (Read-only file system)
W/System.err(26337):    at libcore.io.IoBridge.open(IoBridge.java:574)
W/System.err(26337):    at java.io.FileOutputStream.<init>(FileOutputStream.java:236)
W/System.err(26337):    at java.io.FileOutputStream.<init>(FileOutputStream.java:125)
W/System.err(26337):    at com.dooboolab.TauEngine.FlautoRecorderEngine.writeAudioDataToFile(FlautoRecorderEngine.java:70)
W/System.err(26337):    at com.dooboolab.TauEngine.FlautoRecorderEngine._startRecorder(FlautoRecorderEngine.java:247)
W/System.err(26337):    at com.dooboolab.TauEngine.FlautoRecorder.startRecorder(FlautoRecorder.java:300)
W/System.err(26337):    at com.dooboolab.fluttersound.FlutterSoundRecorder.startRecorder(FlutterSoundRecorder.java:261)
W/System.err(26337):    at com.dooboolab.fluttersound.FlutterSoundRecorderManager.onMethodCall(FlutterSoundRecorderManager.java:106)
W/System.err(26337):    at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
W/System.err(26337):    at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
W/System.err(26337):    at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
W/System.err(26337):    at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
W/System.err(26337):    at android.os.Handler.handleCallback(Handler.java:938)
W/System.err(26337):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err(26337):    at android.os.Looper.loopOnce(Looper.java:233)
W/System.err(26337):    at android.os.Looper.loop(Looper.java:344)
W/System.err(26337):    at android.app.ActivityThread.main(ActivityThread.java:8212)
W/System.err(26337):    at java.lang.reflect.Method.invoke(Native Method)
W/System.err(26337):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
W/System.err(26337):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1034)
W/System.err(26337): Caused by: android.system.ErrnoException: open failed: EROFS (Read-only file system)
W/System.err(26337):    at libcore.io.Linux.open(Native Method)
W/System.err(26337):    at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
W/System.err(26337):    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
W/System.err(26337):    at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
W/System.err(26337):    at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:8094)
W/System.err(26337):    at libcore.io.IoBridge.open(IoBridge.java:560)
W/System.err(26337):    ... 19 more
I/flutter (26337): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (26337): │ #0   FlutterSoundRecorder.startRecorderCompleted (package:flutter_sound_lite/public/flutter_sound_recorder.dart:249:13)
I/flutter (26337): │ #1   MethodChannelFlutterSoundRecorder.channelMethodCallHandler (package:flutter_sound_platform_interface/method_channel_flutter_sound_recorder.dart:74:22)
I/flutter (26337): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter (26337): │  ---> startRecorderCompleted: true
I/flutter (26337): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (26337): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (26337): │ #0   FlutterSoundRecorder.startRecorderCompleted (package:flutter_sound_lite/public/flutter_sound_recorder.dart:258:13)
I/flutter (26337): │ #1   MethodChannelFlutterSoundRecorder.channelMethodCallHandler (package:flutter_sound_platform_interface/method_channel_flutter_sound_recorder.dart:74:22)
I/flutter (26337): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter (26337): │  <--- startRecorderCompleted: true
I/flutter (26337): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (26337): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (26337): │ #0   FlutterSoundRecorder._startRecorder (package:flutter_sound_lite/public/flutter_sound_recorder.dart:750:13)
I/flutter (26337): │ #1   <asynchronous suspension>
I/flutter (26337): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter (26337): │  FS:<--- _startRecorder.
I/flutter (26337): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (26337): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (26337): │ #0   FlutterSoundRecorder.startRecorder (package:flutter_sound_lite/public/flutter_sound_recorder.dart:647:13)
I/flutter (26337): │ #1   <asynchronous suspension>
I/flutter (26337): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter (26337): │  FS:<--- startRecorder
I/flutter (26337): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────


问:
how to disable particular element from scrolling in same div?
1.I want fixed my row headers while horizontal scrolling.
2.I am using mat grid list to create my tables

.noScroll{ top: 0; position: sticky; }
position: static


问:
How to verify a parser in TLA+?
I'd like to verify a LL(1)-style parser using formal verification and TLA+.

But I don't have any idea how to model the specification of the parser.

Are there any examples about this,or can you give me some hint?

Title: How to verify a parser in TLA+?


问:
Sorting League Standings table
Am doing a league management system where the system generates fixtures and assign each match to an official who later enters results. Now when i have set everything possible for the log table but when i pass the results, am getting the some few errors : Too few arguments to function App\Models\Gamescores::updateStandings(), 0 passed in E:\Video\laraVids\laraProjects\HAM\app\Models\Gamescores.php on line 28 and exactly 1 expected

here is my code for the sorting of the league

```<code>    class Gamescores extends Model
{
    use HasFactory;
    protected $table = 'gamescores';
    protected $fillable = [
        'games_id',
        'away_score',
        'home_score',
    ];

    public function game()
    {
        return $this->belongsTo(Game::class, 'games_id');
    }

    public static function boot()
    {
        parent::boot();

        static::created(function ($gamescore) {
            $gamescore->updateStandings();
        });
    }

    public function updateStandings($league_id)
    {
        // Get all gamescores for the specified league
        $gameScores = Gamescores::whereHas('game', function ($query) use ($league_id) {
        $query->where('league_id', $league_id);
        })->get();

        // Loop through each gamescore and update the log table for each team
        foreach ($gameScores as $gameScore) {
            $game = Games::find($gameScore->games_id);
            $league_id = $game->league_id;
            $home_team_id = $game->home_team;
            $away_team_id = $game->away_team;

            $home_team_log = Logtable::where('team_id', $home_team_id)->first();
                if ($home_team_log !== null) {
                    $home_team_log->played += 1;
                    if ($gameScore->home_score > $gameScore->away_score) {
                        $home_team_log->won += 1;
                        $home_team_log->points += 3;
                    } else if ($gameScore->home_score == $gameScore->away_score) {
                        $home_team_log->drawn += 1;
                        $home_team_log->points += 1;
                    } else {
                        $home_team_log->lost += 1;
                    }
                    $home_team_log->goals_for += $gameScore->home_score;
                    $home_team_log->goals_against += $gameScore->away_score;
                    $home_team_log->goal_difference = $home_team_log->goals_for - $home_team_log->goals_against;
                    $home_team_log->save();
                }

                $away_team_log = Logtable::where('team_id', $away_team_id)->first();
                if ($away_team_log !== null) {
                    $away_team_log->played += 1;
                    if ($gameScore->away_score > $gameScore->home_score) {
                        $away_team_log->won += 1;
                        $away_team_log->points += 3;
                    } else if ($gameScore->home_score == $gameScore->away_score) {
                        $away_team_log->drawn += 1;
                        $away_team_log->points += 1;
                    } else {
                        $away_team_log->lost += 1;
                    }
                    $away_team_log->goals_for += $gameScore->away_score;
                    $away_team_log->goals_against += $gameScore->home_score;
                    $away_team_log->goal_difference = $away_team_log->goals_for - $away_team_log->goals_against;
                    $away_team_log->save();
                }
            }
        }
}
</code>```

thats my model where am passing the method to genererate the results

```<code>    public function fixtureToView($league)
{
    // Fetch all rows from the games table, including the related official model
    $games = Games::where('league_id', $league)->get();

    // Extract the values for the role column as an array
    $pluckedFixtures = $games->pluck('Fixture')->toArray();

    // Count the number of occurrences of each value in the array
    $counts = array_count_values($pluckedFixtures);

    // Initialize an empty array to store the duplicate keys and values
    $fixtures = collect([]);

    // Iterate over the counts array
    foreach ($counts as $key => $count) {
        // If the count is greater than 1, add the key and value to the duplicates array
        $fixtures->push($games->where('Fixture', $key));
    }

    // In your controller

    $gamescores = Gamescores::all();
    foreach ($gamescores as $gamescore) {
        $game = Games::find($gamescore->games_id);
        $league_id = $game->league_id;
        $gamescore->updateStandings($league_id);
        if($gamescore->games_id){
            $game = Games::find($gamescore->games_id);
            $league_id = $game->league_id;
            $gamescore->updateStandings($league_id);
        }

    }

    $standings = Logtable::all();
    $standings = $standings->sortByDesc('points');

// return view('standings', compact('standings'));

    return view(
        'admin.league.fixtures.index',
        compact('fixtures', 'standings')
    );
</code>```

thats my controller where am passing the method to retrieve it in the view, what i want is the log table to get the Id of the league where the games/matches belong to

the error am getting this error

Title: Sorting League Standings table

Body:
Am doing a league management system where the system generates fixtures and assign each match to an official who later enters results. Now when i have set everything possible for the log table but when i pass the results, am getting the some few errors : Too few arguments to function App\Models\Gamescores::updateStandings(), 0 passed in E:\Video\laraVids\laraProjects\HAM\app\Models\Gamescores.php on line 28 and exactly 1 expected

here is my code for the sorting of the league

    class Gamescores extends Model
{
    use HasFactory;
    protected $table = 'gamescores';
    protected $fillable = [
        'games_id',
        'away_score',
        'home_score',
    ];

    public function game()
    {
        return $this->belongsTo(Game::class, 'games_id');
    }

    public static function boot()
    {
        parent::boot();

        static::created(function ($gamescore) {
            $gamescore->updateStandings();
        });
    }

    public function updateStandings($league_id)
    {
        // Get all gamescores for the specified league
        $gameScores = Gamescores::whereHas('game', function ($query) use ($league_id) {
        $query->where('league_id', $league_id);
        })->get();

        // Loop through each gamescore and update the log table for each team
        foreach ($gameScores as $gameScore) {
            $game = Games::find($gameScore->games_id);
            $league_id = $game->league_id;
            $home_team_id = $game->home_team;
            $away_team_id = $game->away_team;

            $home_team_log = Logtable::where('team_id', $home_team_id)->first();
                if ($home_team_log !== null) {
                    $home_team_log->played += 1;
                    if ($gameScore->home_score > $gameScore->away_score) {
                        $home_team_log->won += 1;
                        $home_team_log->points += 3;
                    } else if ($gameScore->home_score == $gameScore->away_score) {
                        $home_team_log->drawn += 1;
                        $home_team_log->points += 1;
                    } else {
                        $home_team_log->lost += 1;
                    }
                    $home_team_log->goals_for += $gameScore->home_score;
                    $home_team_log->goals_against += $gameScore->away_score;
                    $home_team_log->goal_difference = $home_team_log->goals_for - $home_team_log->goals_against;
                    $home_team_log->save();
                }

                $away_team_log = Logtable::where('team_id', $away_team_id)->first();
                if ($away_team_log !== null) {
                    $away_team_log->played += 1;
                    if ($gameScore->away_score > $gameScore->home_score) {
                        $away_team_log->won += 1;
                        $away_team_log->points += 3;
                    } else if ($gameScore->home_score == $gameScore->away_score) {
                        $away_team_log->drawn += 1;
                        $away_team_log->points += 1;
                    } else {
                        $away_team_log->lost += 1;
                    }
                    $away_team_log->goals_for += $gameScore->away_score;
                    $away_team_log->goals_against += $gameScore->home_score;
                    $away_team_log->goal_difference = $away_team_log->goals_for - $away_team_log->goals_against;
                    $away_team_log->save();
                }
            }
        }
}

thats my model where am passing the method to genererate the results

    public function fixtureToView($league)
{
    // Fetch all rows from the games table, including the related official model
    $games = Games::where('league_id', $league)->get();

    // Extract the values for the role column as an array
    $pluckedFixtures = $games->pluck('Fixture')->toArray();

    // Count the number of occurrences of each value in the array
    $counts = array_count_values($pluckedFixtures);

    // Initialize an empty array to store the duplicate keys and values
    $fixtures = collect([]);

    // Iterate over the counts array
    foreach ($counts as $key => $count) {
        // If the count is greater than 1, add the key and value to the duplicates array
        $fixtures->push($games->where('Fixture', $key));
    }

    // In your controller

    $gamescores = Gamescores::all();
    foreach ($gamescores as $gamescore) {
        $game = Games::find($gamescore->games_id);
        $league_id = $game->league_id;
        $gamescore->updateStandings($league_id);
        if($gamescore->games_id){
            $game = Games::find($gamescore->games_id);
            $league_id = $game->league_id;
            $gamescore->updateStandings($league_id);
        }

    }

    $standings = Logtable::all();
    $standings = $standings->sortByDesc('points');

// return view('standings', compact('standings'));

    return view(
        'admin.league.fixtures.index',
        compact('fixtures', 'standings')
    );

thats my controller where am passing the method to retrieve it in the view, what i want is the log table to get the Id of the league where the games/matches belong to

the error am getting this error


问:
How to pivot a list of data which has table meta data?
I have designed 2 tables to store data.

If I want to just show a list of tables with 2 columns and the column value, how should I write my LINQ query in C#?

I can't even pivot it using SQL. This my query

```<code>SELECT FieldValue, recordid
  FROM [TableMetadatas] t inner join TableMetadataTemplates t2
  on t.[TableMetadataTemplateId] = t2.id
  where (FieldName = 'application_name' or fieldname = 'application_category')
  and TableName = 'application'
  group by t.FieldValue,  t.recordid
  order by recordid
</code>```

Problem is each row is each field value instead of each record.

```<code>Application 1
application_type value 1
Application 2
application_type value 2
</code>```

The expected result should be below:

```<code>Application 1 | application_type value 1
Application 2 | application_type value 2
</code>```

Body:
I have designed 2 tables to store data.

If I want to just show a list of tables with 2 columns and the column value, how should I write my LINQ query in C#?

I can't even pivot it using SQL. This my query

SELECT FieldValue, recordid
  FROM [TableMetadatas] t inner join TableMetadataTemplates t2
  on t.[TableMetadataTemplateId] = t2.id
  where (FieldName = 'application_name' or fieldname = 'application_category')
  and TableName = 'application'
  group by t.FieldValue,  t.recordid
  order by recordid

Problem is each row is each field value instead of each record.

Application 1
application_type value 1
Application 2
application_type value 2

The expected result should be below:

Application 1 | application_type value 1
Application 2 | application_type value 2


问:
Passenger 6 requests secret_key_base for production, even though is already defined
Currently trying to deploy rails 7 app, using Passenger 6, Rbenv and Rails 7.

Passenger is requesting

Missing secret_key_base for 'production' environment, set this string with bin/rails credentials:edit (ArgumentError)

And is already defined on config/credentials.yml.enc, config/credentials/production.yml.enc, on rbenv vars, on .bashrc, already tried removing them and testing one by one still nothing.

Hope someone can help me with this, thank you very much in advance, have several days trying to fix this to no avail :(


问:
How to play sound in Swift spritekid for Emulator with IOS version earlier than 14?
I am working with sound in my IOS game using Swift - spritekit.
I used to have this code for running my sound
First: Declare an action to run the sound like this

let soundHome:SKAction = SKAction.playSoundFileNamed("clickSound.m4a",waitForCompletion:false)

Then to run the sound I just simply call the action like this:

```<code>run(soundHome)
</code>```

It works fine when I use XCode 12 and use IOS Simulator with IOS version 13, but as I use Xcode 14, the same code, same project, it now crashes for the same IOS Simulator with IOS version earlier than version 14.
I have tried several different way to run the file, such as use AVAudioPlayer but it still does not work. Does anyone face the same problem like me or does anyone know how to fix this? Please let me know. Thank you very much.

Body:
I am working with sound in my IOS game using Swift - spritekit.
I used to have this code for running my sound
First: Declare an action to run the sound like this

let soundHome:SKAction = SKAction.playSoundFileNamed("clickSound.m4a",waitForCompletion:false)

Then to run the sound I just simply call the action like this:

run(soundHome)

It works fine when I use XCode 12 and use IOS Simulator with IOS version 13, but as I use Xcode 14, the same code, same project, it now crashes for the same IOS Simulator with IOS version earlier than version 14.
I have tried several different way to run the file, such as use AVAudioPlayer but it still does not work. Does anyone face the same problem like me or does anyone know how to fix this? Please let me know. Thank you very much.


问:
Docker mount with non-persistent changes
Is it possible to bind mount a directory to a docker container where changes do not persist. It should be like:

All existing files in the directory are visible as in a regular bind mount, but

Changes (on files) made from the container are only visible to the container and not actually written to mounted directory.

It is like tmpfs like layer on top of normal bind mount.

It can be used for a lot of things like sand-boxing, or dry-running tests. This can also be used for running a container without filesystem of its own, like mounting root filesystem of the host system and for example install something with apt and try without affecting the host.


问:
riscv's custom instructions are not compiled gnu as, ld into the correct machine language
I want to run a custom instruction on the following RISC-V 32IM: custom_es32, which is an R-style instruction such as add, sub, etc. Only func7 is "1110001" different from add,sub, etc. I have used riscv-gnu-unknown-as to startup, S and disassemble them with riscv-gnu-unknown-as, opcode becomes 11010111 instead of 0110011 and func7 becomes 0000001 instead of 1110001. Why is this?
Here is the code I added and the compile-time commands.[RISCV singlecys code][1]
[The site I referred to][2]</p>
```<code>///home/ubuntu4/riscv-gnu-toolchain/binutils/gdb/opcodes/riscv-opc.c
{"custom_es32",     32, INSN_CLASS_I,     "d,s,t", MATCH_CUSTOM, MASK_CUSTOM, match_opcode, 0}

~/riscv-opc.h
#define MATCH_CUSTOM_ES32 0x200006b
#define MASK_CUSTOM_ES32  0xfe00707f

DECLARE_INSN(custom, MATCH_CUSTOM_ES32, MASK_CUSTOM_ES32)
</code>```
```<code>riscv64-unknown-elf-as -march=rv32im -mabi=ilp32 -o main.o main.S
riscv64-unknown-elf-as -march=rv32im -mabi=ilp32 -o startup.o startup.S
riscv64-unknown-elf-ld -static -melf32lriscv -T stdld.script startup.o main.o -o init
riscv64-unknown-elf-objdump -d init
~~
 220:   03ff0eeb                custom_es32     t4,t5,t6
 224:   00130313                addi    t1,t1,1
~~```

  [1]: https://github.com/ridecore/ridecore/tree/master/src/test/singlecyc/verilog
  [2]: https://hsandid.github.io/posts/risc-v-custom-instruction/
</code>```

Body:
I want to run a custom instruction on the following RISC-V 32IM: custom_es32, which is an R-style instruction such as add, sub, etc. Only func7 is "1110001" different from add,sub, etc. I have used riscv-gnu-unknown-as to startup, S and disassemble them with riscv-gnu-unknown-as, opcode becomes 11010111 instead of 0110011 and func7 becomes 0000001 instead of 1110001. Why is this?
Here is the code I added and the compile-time commands.[RISCV singlecys code][1]
[The site I referred to][2]

///home/ubuntu4/riscv-gnu-toolchain/binutils/gdb/opcodes/riscv-opc.c
{"custom_es32",     32, INSN_CLASS_I,     "d,s,t", MATCH_CUSTOM, MASK_CUSTOM, match_opcode, 0}

~/riscv-opc.h
#define MATCH_CUSTOM_ES32 0x200006b
#define MASK_CUSTOM_ES32  0xfe00707f

DECLARE_INSN(custom, MATCH_CUSTOM_ES32, MASK_CUSTOM_ES32)

riscv64-unknown-elf-as -march=rv32im -mabi=ilp32 -o main.o main.S
riscv64-unknown-elf-as -march=rv32im -mabi=ilp32 -o startup.o startup.S
riscv64-unknown-elf-ld -static -melf32lriscv -T stdld.script startup.o main.o -o init
riscv64-unknown-elf-objdump -d init
~~
 220:   03ff0eeb                custom_es32     t4,t5,t6
 224:   00130313                addi    t1,t1,1
~~```

  [1]: https://github.com/ridecore/ridecore/tree/master/src/test/singlecyc/verilog
  [2]: https://hsandid.github.io/posts/risc-v-custom-instruction/


问:
handle lifetime of returned references to returned owner
I want to have a function which owns its parameter, and returns ownership along with references to that parameter - but I can't figure out how to annotate the lifetime for rust to allow it:

```<code>fn line_refs(s: String) -> (String, Vec<&str>) {
  (s, s.lines().collect())
}
</code>```

Rust requires I add lifetime to the refs, but I'm not sure how I indicate that their lifetime is associated with s.

Body:
I want to have a function which owns its parameter, and returns ownership along with references to that parameter - but I can't figure out how to annotate the lifetime for rust to allow it:

fn line_refs(s: String) -> (String, Vec<&str>) {
  (s, s.lines().collect())
}

Rust requires I add lifetime to the refs, but I'm not sure how I indicate that their lifetime is associated with s.


问:
AWS Glue Stuck on loading Redshift Spectrum table
Connecting to Redshift spectrum table takes too long to load. Any best practices or alternative to get the data I need?
It has 60 million records with item array</p>
```<code>#Amazon Redshift connect
redshift_table = glueContext.create_dynamic_frame.from_catalog(
    database="s3_staging_json",
    additional_options={
        "aws_iam_role": "arn:aws:iam::000000000000:role/service-role/AWSGlueDev"
    },
    redshift_tmp_dir="s3://io.rad-ar.dev.etl/source/",
    table_name="bulk_table",
    transformation_ctx="redshift_table",
)
</code>```

Body:
Connecting to Redshift spectrum table takes too long to load. Any best practices or alternative to get the data I need?
It has 60 million records with item array

#Amazon Redshift connect
redshift_table = glueContext.create_dynamic_frame.from_catalog(
    database="s3_staging_json",
    additional_options={
        "aws_iam_role": "arn:aws:iam::000000000000:role/service-role/AWSGlueDev"
    },
    redshift_tmp_dir="s3://io.rad-ar.dev.etl/source/",
    table_name="bulk_table",
    transformation_ctx="redshift_table",
)


问:
The loss does not decrease on CUDA but works well on CPU
Running following code if device = 'cpu' then loss decreases as expected. However, if device = 'cuda' the loss wont decrease, and model training fails. How should I correct this?

    device = 'cpu'
    device = 'cuda'

    import sys
    from typing import Optional

    import torch
    from torch import Tensor
    from torch_geometric.nn import Node2Vec

    class Node2VecV2(Node2Vec):
        def __init__(
                self,
                edge_index: Tensor,
                embedding_dim: int,
                walk_length: int,
                context_size: int,
                walks_per_node: int = 1,
                p: float = 1.0,
                q: float = 1.0,
                num_negative_samples: int = 1,
                num_nodes: Optional[int] = None,
                sparse: bool = False,
                batch_size: int = 128,
                shuffle: bool = True,
                num_workers: int = 0,
                device: str = 'cuda'
        ):
            super().__init__(edge_index, embedding_dim, walk_length, context_size, walks_per_node,
                             p, q, num_negative_samples, num_nodes, sparse)
            self.device = device
            self.batch_size = batch_size
            self.shuffle = shuffle
            self.num_workers = 0 if sys.platform.startswith('win') else num_workers
            self.loader = self.loader(batch_size=128, shuffle=True,
                              num_workers=num_workers)

        # def make_loader(
        #         self,
        #         batch_size: int = 128,
        #         shuffle: bool = True,
        #         num_workers: int = 0,
        #         device: str = 'cpu'
        # ):
        #     self.device = device
        #     self.batch_size = batch_size
        #     self.shuffle = shuffle
        #     self.num_workers = 0 if sys.platform.startswith('win') else num_workers
        #     self.loader = super().loader(batch_size=128, shuffle=True,
        #                       num_workers=num_workers)

        def __repr__(self) -> str:
            return (f'{self.__class__.__name__}({self.embedding.weight.size(0)}, '
                    f'{self.embedding.weight.size(1)})')

        def train_(self):
            self.train()
            total_loss = 0
            for pos_rw, neg_rw in self.loader:
                self.optimizer.zero_grad()
                loss = self.loss(pos_rw.to(device), neg_rw.to(device))
                loss.backward()
                self.optimizer.step()
                total_loss += loss.item()
            #print(total_loss / len(self.loader))
            return total_loss / len(self.loader)

    def train_dw_model(dw_model, dataset):
        data = dataset[0]
        data = data.to(device)
        best_val = 0
        for epoch in range(1, 101):
            loss = dw_model.train_()
            with torch.no_grad():
                dw_model.eval()
                z = dw_model()
                val_acc = dw_model.test(
                    z[data.train_mask], data.y[data.train_mask],
                    z[data.val_mask], data.y[data.val_mask],
                    max_iter=150)
            if val_acc> best_val:
                best_val = val_acc
                torch.save(dw_model.state_dict(), 'dw.pt')
            print(f'{dataset}_{dw_model} Epoch: {epoch:02d}, Loss: {loss:.4f},'
                  f' Val: {val_acc*100:.2f} best Val: {best_val*100:.2f} ')

    if __name__ == '__main__':
        import os.path as osp
        from torch_geometric.datasets import Planetoid
        import torch_geometric.transforms as T

        path = osp.join(osp.dirname(osp.realpath(__file__)), '..', 'data', 'Planetoid')
        dataset = Planetoid(path, 'Cora', transform=T.NormalizeFeatures())
        data = dataset[0].to(device)

        dw_model = Node2VecV2(data.edge_index, embedding_dim=128, walk_length=20,
                         context_size=10, walks_per_node=10,
                         num_negative_samples=1, p=1, q=1, sparse=True,batch_size=128, shuffle=True, num_workers=4, device=device).to(device)
        #dw_model.make_loader(batch_size=128, shuffle=True, num_workers=4, device=args.device)

        dw_model.optimizer = torch.optim.SparseAdam(list(dw_model.parameters()), lr=0.01)
        for i in range(10):
            print(f'Epoch {i} loss: ',dw_model.train_())

```
<p>cpu output:</p>
```Epoch 0 loss:  8.111482880332254
Epoch 1 loss:  6.081473242152821
Epoch 2 loss:  4.976185473528775
Epoch 3 loss:  4.138110041618347
Epoch 4 loss:  3.4765207875858652
Epoch 5 loss:  2.960351337086071
Epoch 6 loss:  2.5505979494615034
Epoch 7 loss:  2.2174546501853247
Epoch 8 loss:  1.955638435753909
Epoch 9 loss:  1.7383252869952808

Process finished with exit code 0
```
<p>cuda output:</p>
```Epoch 0 loss:  1.3862942511385137
Epoch 1 loss:  1.3862942511385137
Epoch 2 loss:  1.3862942511385137
Epoch 3 loss:  1.3862942511385137
Epoch 4 loss:  1.3862942511385137
Epoch 5 loss:  1.3862942511385137
Epoch 6 loss:  1.3862942511385137
Epoch 7 loss:  1.3862942511385137
Epoch 8 loss:  1.3862942511385137
Epoch 9 loss:  1.3862942511385137

Process finished with exit code 0
```

Body:
Running following code if device = 'cpu' then loss decreases as expected. However, if device = 'cuda' the loss wont decrease, and model training fails. How should I correct this?

    device = 'cpu'
    device = 'cuda'

    import sys
    from typing import Optional

    import torch
    from torch import Tensor
    from torch_geometric.nn import Node2Vec

    class Node2VecV2(Node2Vec):
        def __init__(
                self,
                edge_index: Tensor,
                embedding_dim: int,
                walk_length: int,
                context_size: int,
                walks_per_node: int = 1,
                p: float = 1.0,
                q: float = 1.0,
                num_negative_samples: int = 1,
                num_nodes: Optional[int] = None,
                sparse: bool = False,
                batch_size: int = 128,
                shuffle: bool = True,
                num_workers: int = 0,
                device: str = 'cuda'
        ):
            super().__init__(edge_index, embedding_dim, walk_length, context_size, walks_per_node,
                             p, q, num_negative_samples, num_nodes, sparse)
            self.device = device
            self.batch_size = batch_size
            self.shuffle = shuffle
            self.num_workers = 0 if sys.platform.startswith('win') else num_workers
            self.loader = self.loader(batch_size=128, shuffle=True,
                              num_workers=num_workers)

        # def make_loader(
        #         self,
        #         batch_size: int = 128,
        #         shuffle: bool = True,
        #         num_workers: int = 0,
        #         device: str = 'cpu'
        # ):
        #     self.device = device
        #     self.batch_size = batch_size
        #     self.shuffle = shuffle
        #     self.num_workers = 0 if sys.platform.startswith('win') else num_workers
        #     self.loader = super().loader(batch_size=128, shuffle=True,
        #                       num_workers=num_workers)

        def __repr__(self) -> str:
            return (f'{self.__class__.__name__}({self.embedding.weight.size(0)}, '
                    f'{self.embedding.weight.size(1)})')

        def train_(self):
            self.train()
            total_loss = 0
            for pos_rw, neg_rw in self.loader:
                self.optimizer.zero_grad()
                loss = self.loss(pos_rw.to(device), neg_rw.to(device))
                loss.backward()
                self.optimizer.step()
                total_loss += loss.item()
            #print(total_loss / len(self.loader))
            return total_loss / len(self.loader)

    def train_dw_model(dw_model, dataset):
        data = dataset[0]
        data = data.to(device)
        best_val = 0
        for epoch in range(1, 101):
            loss = dw_model.train_()
            with torch.no_grad():
                dw_model.eval()
                z = dw_model()
                val_acc = dw_model.test(
                    z[data.train_mask], data.y[data.train_mask],
                    z[data.val_mask], data.y[data.val_mask],
                    max_iter=150)
            if val_acc> best_val:
                best_val = val_acc
                torch.save(dw_model.state_dict(), 'dw.pt')
            print(f'{dataset}_{dw_model} Epoch: {epoch:02d}, Loss: {loss:.4f},'
                  f' Val: {val_acc*100:.2f} best Val: {best_val*100:.2f} ')

    if __name__ == '__main__':
        import os.path as osp
        from torch_geometric.datasets import Planetoid
        import torch_geometric.transforms as T

        path = osp.join(osp.dirname(osp.realpath(__file__)), '..', 'data', 'Planetoid')
        dataset = Planetoid(path, 'Cora', transform=T.NormalizeFeatures())
        data = dataset[0].to(device)

        dw_model = Node2VecV2(data.edge_index, embedding_dim=128, walk_length=20,
                         context_size=10, walks_per_node=10,
                         num_negative_samples=1, p=1, q=1, sparse=True,batch_size=128, shuffle=True, num_workers=4, device=device).to(device)
        #dw_model.make_loader(batch_size=128, shuffle=True, num_workers=4, device=args.device)

        dw_model.optimizer = torch.optim.SparseAdam(list(dw_model.parameters()), lr=0.01)
        for i in range(10):
            print(f'Epoch {i} loss: ',dw_model.train_())

cpu output:

Epoch 0 loss:  8.111482880332254
Epoch 1 loss:  6.081473242152821
Epoch 2 loss:  4.976185473528775
Epoch 3 loss:  4.138110041618347
Epoch 4 loss:  3.4765207875858652
Epoch 5 loss:  2.960351337086071
Epoch 6 loss:  2.5505979494615034
Epoch 7 loss:  2.2174546501853247
Epoch 8 loss:  1.955638435753909
Epoch 9 loss:  1.7383252869952808

Process finished with exit code 0

cuda output:

Epoch 0 loss:  1.3862942511385137
Epoch 1 loss:  1.3862942511385137
Epoch 2 loss:  1.3862942511385137
Epoch 3 loss:  1.3862942511385137
Epoch 4 loss:  1.3862942511385137
Epoch 5 loss:  1.3862942511385137
Epoch 6 loss:  1.3862942511385137
Epoch 7 loss:  1.3862942511385137
Epoch 8 loss:  1.3862942511385137
Epoch 9 loss:  1.3862942511385137

Process finished with exit code 0


问:
React JS \ Webpack - modular system
How can you make a modular system in React JS?
There is a project with the main application (Frontend, Backend) on GitHub, and modules (for example, react components) on a separate branch or repository. How can I dynamically connect modules to a ready-made, assembled assembly?</p>
```<code>The request from the Backend comes in this form (
for example)
</code>```
```<code>[
    {
        "id": 15,
        "name": "app1",
        "enabled": true,
        "front_bundle_path": ".../modules/app1.js"
      },
      {
        "id": 17,
        "name": "app2",
        "enabled": true,
        "front_bundle_path": ".../modules/app2.js"
      }
]
</code>```

Title: React JS \ Webpack - modular system

Body:
How can you make a modular system in React JS?
There is a project with the main application (Frontend, Backend) on GitHub, and modules (for example, react components) on a separate branch or repository. How can I dynamically connect modules to a ready-made, assembled assembly?

The request from the Backend comes in this form (
for example)

[
    {
        "id": 15,
        "name": "app1",
        "enabled": true,
        "front_bundle_path": ".../modules/app1.js"
      },
      {
        "id": 17,
        "name": "app2",
        "enabled": true,
        "front_bundle_path": ".../modules/app2.js"
      }
]


问:
java.lang.ClassNotFoundException: javax.xml.bind.JAXBException android
I am trying to run my project , then showing java.lang.ClassNotFoundException: javax.xml.bind.JAXBException error

```<code>    java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
    at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3137)
    at java.base/java.lang.Class.getConstructor0(Class.java:3342)
    at java.base/java.lang.Class.newInstance(Class.java:556)
    at org.jetbrains.kotlin.cli.jvm.plugins.ServiceLoaderLite.loadImplementations(ServiceLoaderLite.kt:50)
    at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension$loadProcessors$efficientProcessorLoader$1.doLoadProcessors(Kapt3Extension.kt:83)
    at org.jetbrains.kotlin.kapt3.base.ProcessorLoader.loadProcessors(ProcessorLoader.kt:42)
    at org.jetbrains.kotlin.kapt3.base.ProcessorLoader.loadProcessors$default(ProcessorLoader.kt:25)
    at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.loadProcessors(Kapt3Extension.kt:88)
    at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.analysisCompleted(Kapt3Extension.kt:171)
    at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.analysisCompleted(Kapt3Extension.kt:98)
    at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM$analyzeFilesWithJavaIntegration$2.invoke(TopDownAnalyzerFacadeForJVM.kt:96)
    at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:106)
    at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:82)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:384)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:70)
    at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:107)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:375)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:123)
    at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:159)
    at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:57)
    at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:96)
    at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:52)
    at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:93)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$1$2.invoke(CompileServiceImpl.kt:442)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$1$2.invoke(CompileServiceImpl.kt:102)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:1013)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:102)
    at org.jetbrains.kotlin.daemon.common.DummyProfiler.withMeasure(PerfUtils.kt:137)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl.checkedCompile(CompileServiceImpl.kt:1055)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl.doCompile(CompileServiceImpl.kt:1012)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:441)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
    at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
    at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    ... 49 more
</code>```

I tried many stackoverflow answer but not resolve issue and getting same error.

Tried :-

adding these into gradle file as a classpath

```<code>    classpath 'javax.xml.bind:jaxb-api:2.3.1'
    classpath 'com.sun.xml.bind:jaxb-impl:2.3.0'

    classpath 'com.sun.xml.bind:jaxb-core:2.3.0'
    classpath 'org.glassfish.jaxb:jaxb-runtime:2.3.0'
    classpath 'javax.activation:activation:1.1.1'
</code>```

Is there any solution to resolve this issue.

Body:
I am trying to run my project , then showing java.lang.ClassNotFoundException: javax.xml.bind.JAXBException error

    java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
    at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3137)
    at java.base/java.lang.Class.getConstructor0(Class.java:3342)
    at java.base/java.lang.Class.newInstance(Class.java:556)
    at org.jetbrains.kotlin.cli.jvm.plugins.ServiceLoaderLite.loadImplementations(ServiceLoaderLite.kt:50)
    at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension$loadProcessors$efficientProcessorLoader$1.doLoadProcessors(Kapt3Extension.kt:83)
    at org.jetbrains.kotlin.kapt3.base.ProcessorLoader.loadProcessors(ProcessorLoader.kt:42)
    at org.jetbrains.kotlin.kapt3.base.ProcessorLoader.loadProcessors$default(ProcessorLoader.kt:25)
    at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.loadProcessors(Kapt3Extension.kt:88)
    at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.analysisCompleted(Kapt3Extension.kt:171)
    at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.analysisCompleted(Kapt3Extension.kt:98)
    at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM$analyzeFilesWithJavaIntegration$2.invoke(TopDownAnalyzerFacadeForJVM.kt:96)
    at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:106)
    at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:82)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:384)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:70)
    at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:107)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:375)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:123)
    at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:159)
    at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:57)
    at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:96)
    at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:52)
    at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:93)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$1$2.invoke(CompileServiceImpl.kt:442)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$1$2.invoke(CompileServiceImpl.kt:102)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:1013)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:102)
    at org.jetbrains.kotlin.daemon.common.DummyProfiler.withMeasure(PerfUtils.kt:137)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl.checkedCompile(CompileServiceImpl.kt:1055)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl.doCompile(CompileServiceImpl.kt:1012)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:441)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
    at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
    at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    ... 49 more

I tried many stackoverflow answer but not resolve issue and getting same error.

Tried :-

adding these into gradle file as a classpath

    classpath 'javax.xml.bind:jaxb-api:2.3.1'
    classpath 'com.sun.xml.bind:jaxb-impl:2.3.0'

    classpath 'com.sun.xml.bind:jaxb-core:2.3.0'
    classpath 'org.glassfish.jaxb:jaxb-runtime:2.3.0'
    classpath 'javax.activation:activation:1.1.1'

Is there any solution to resolve this issue.


问:
How to access FetchError class in NodeJS
NodeJS 18 has an experimental support for fetch https://nodejs.org/dist/latest-v18.x/docs/api/globals.html

fetch function throws FetchError instances which I need to analize in try-catch with instanceof check... Unfortunately, FetchError class is not exposed in the global space of NodeJS!

I understand the API is "experimental" but, seriously, is there a way to access that class? Ideal answer will compile in TypeScript as well

P.S. one workaround is error.name == "FetchError" but I'm still curious about the class. Why it's not exposed?


问:
Running spark application with two different java versions
Is there any way I can run the Spark3 application with two different java versions for example java8 and java11?

I have tried the following command but it is picking the default java version i.e java8.

```<code>spark-shell \
--conf spark.yarn.appMasterEnv.JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.17.0.8-2.el7_9.x86_64/ \
--conf spark.executorEnv.JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.17.0.8-2.el7_9.x86_64/
</code>```

Body:
Is there any way I can run the Spark3 application with two different java versions for example java8 and java11?

I have tried the following command but it is picking the default java version i.e java8.

spark-shell \
--conf spark.yarn.appMasterEnv.JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.17.0.8-2.el7_9.x86_64/ \
--conf spark.executorEnv.JAVA_HOME=/usr/lib/jvm/java-11-openjdk-11.0.17.0.8-2.el7_9.x86_64/


问:
Microsoft.Identity.Web with Graph and Graphbeta in Parallell
I am working on a asp.net core MVC project and want to use Graph and GrahBeta packages
using Microsoft.Identity.Web.MicrosoftGraph adn Microsoft.Identity.Web.MicrosoftGraphBeta.

I define an external alias for the beta version of the package as described here:
https://github.com/microsoftgraph/msgraph-beta-sdk-dotnet#using-the-beta-client-along-with-the-v10-library

This works as excpected, but in Startup.cs, when registering Graph like

services.AddAuthentication[...].AddMicrosoftGraph(Configuration.GetSection("GraphAPI"))

I get the following error:

The call is ambiguous between the following methods or properties: 'Microsoft.Identity.Web.MicrosoftGraphExtensions.AddMicrosoftGraph(Microsoft.Identity.Web.MicrosoftIdentityAppCallsWebApiAuthenticationBuilder, string, string)' and 'Microsoft.Identity.Web.MicrosoftGraphExtensions.AddMicrosoftGraph(Microsoft.Identity.Web.MicrosoftIdentityAppCallsWebApiAuthenticationBuilder, string, string)'

As this seems to come from the exact same package, I have no idea about how to handle this. Thank you for your help.


问:
How should you write unit test for an native andorid app that strongly communicate with android bitmap and view related task?
Suppose there's an app that works with photos. The bitmap related task, editing them, rendering and view related tasks are main concerns of the app.

Now what I want is to write unit testing for the whole app and getting into it for the first time. As there are so many terms like London approach(Mock) or detroit approach (Not to mock) or use Instrumental testing instead of Unit testing which one should you choose.