问:
Unity Android App is not compatible with debugger device after publishing it on Play Store
I created an augmented reallity app using Unity and ARCore Foundation library, I used my Samsung A23 smartphone in order to test and debug it; after everything was working as expected, I published it on play store and after deployment was approved, I found out it is not compatible with my phone. Am I missing something?

https://play.google.com/store/apps/details?id=com.Anarvista.anARVistAPP&hl=es

Google Play Store requires the app to set Target API Level to 31 which matches with my cellphone, minimun API Level is set to 28 (Android 9.0 Pie)

This is manifest file:

```<code><?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.CAMERA" />
  <uses-feature android:name="com.google.ar.core.depth" />
  <uses-feature android:glEsVersion="0x00030000" />
  <application android:icon="@drawable/app_icon" android:label="@string/app_name">
    <activity android:name="jp.fantom1x.plugin.android.fantomPlugin.FullPluginOnUnityPlayerActivity"
              android:label="@string/app_name"
              android:exported="true"
              android:screenOrientation="sensorPortrait"
              android:launchMode="singleTask"
              android:theme="@android:style/Theme.DeviceDefault.Light.NoActionBar.Fullscreen"
              android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
  </application>
</manifest>
</code>```

Unity Build Settings

I am expecting this app being available and compatible with my Samsung A23 cellphone since I used it for debugging this app before publishing it.

Body:
I created an augmented reallity app using Unity and ARCore Foundation library, I used my Samsung A23 smartphone in order to test and debug it; after everything was working as expected, I published it on play store and after deployment was approved, I found out it is not compatible with my phone. Am I missing something?

https://play.google.com/store/apps/details?id=com.Anarvista.anARVistAPP&hl=es

Google Play Store requires the app to set Target API Level to 31 which matches with my cellphone, minimun API Level is set to 28 (Android 9.0 Pie)

This is manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.CAMERA" />
  <uses-feature android:name="com.google.ar.core.depth" />
  <uses-feature android:glEsVersion="0x00030000" />
  <application android:icon="@drawable/app_icon" android:label="@string/app_name">
    <activity android:name="jp.fantom1x.plugin.android.fantomPlugin.FullPluginOnUnityPlayerActivity"
              android:label="@string/app_name"
              android:exported="true"
              android:screenOrientation="sensorPortrait"
              android:launchMode="singleTask"
              android:theme="@android:style/Theme.DeviceDefault.Light.NoActionBar.Fullscreen"
              android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
  </application>
</manifest>

Unity Build Settings

I am expecting this app being available and compatible with my Samsung A23 cellphone since I used it for debugging this app before publishing it.


来源: stackexchange

问:
How to play sound only once on notification and once on refresh if unread jQuery
I have a $.ajax call running every 5 seconds to check if there's been a new 'lead' inserted into the database and playing a sound if the 'is_read' column is equal to 0.

However, the way I have it set up now, every 5 seconds the sound plays since the notification has not yet been read.

I found this post: Jquery Play sound only once that explains how I've got to store the notification count and check if the new count is higher, however I also want to play the sound on page load if there are any unread ones.

Here's my jQuery:

```<code>$('document').ready(function() {
    var audioElement = document.createElement('audio');
    audioElement.setAttribute('src', '<?php echo URLROOT . '/assets/audio/notification.wav' ?>');

    setInterval(function() {
        var rowCount = 0;
        $.ajax({
            method: 'POST',
            url: '<?php echo URLROOT . '/pos/getLead' ?>',
            data: {getLead: true},
            success: function(response) {
                if (response > 0) {
                    var count = response;
                    console.log(response)
                    audioElement.play();
                }
            }
        })
    }, 5000)
});
</code>```

The 'response' is the row count that 'is_read' equals 0.

ContentLicense: CC BY-SA 4.0

Body:
I have a $.ajax call running every 5 seconds to check if there's been a new 'lead' inserted into the database and playing a sound if the 'is_read' column is equal to 0.

However, the way I have it set up now, every 5 seconds the sound plays since the notification has not yet been read.

I found this post: Jquery Play sound only once that explains how I've got to store the notification count and check if the new count is higher, however I also want to play the sound on page load if there are any unread ones.

Here's my jQuery:

$('document').ready(function() {
    var audioElement = document.createElement('audio');
    audioElement.setAttribute('src', '<?php echo URLROOT . '/assets/audio/notification.wav' ?>');

    setInterval(function() {
        var rowCount = 0;
        $.ajax({
            method: 'POST',
            url: '<?php echo URLROOT . '/pos/getLead' ?>',
            data: {getLead: true},
            success: function(response) {
                if (response > 0) {
                    var count = response;
                    console.log(response)
                    audioElement.play();
                }
            }
        })
    }, 5000)
});

The 'response' is the row count that 'is_read' equals 0.


问:
Video url not working and is throwing an error in html code, but work's fine when entered in browser address bar
I am just trying to figure out what could be going wrong in my code. It seems that certain vimeo urls work, but not all. So I have this code here and I am passing in a url.

```<code>import { useEffect, useRef, useState } from "react";
VideoPlayer.propTypes = {
  src: PropTypes.string,
  playing: PropTypes.bool,
  controls: PropTypes.bool,
  volume: PropTypes.number, //between 0 and 1
  loop: PropTypes.bool,
  muted: PropTypes.bool,
  backgroundImage: PropTypes.string,
  playsinline: PropTypes.bool,
  playIcon: PropTypes.func,
  autoplay: PropTypes.bool,
  containerClassName: PropTypes.string,
  containerStyles: PropTypes.object,
  styles: PropTypes.object,
  width: PropTypes.oneOfType(PropTypes.number, PropTypes.string),
  height: PropTypes.oneOfType(PropTypes.number, PropTypes.string),
};

VideoPlayer.defaultProps = {
  src: "",
  loop: false,
  muted: false,
  controls: true,
  volume: 0.05,
  width: 1600,
  height: 900,
  containerClassName: "",
  containerStyles: {
    width: "100%",
    position: "relative",
    paddingTop: `${(900 / 1600) * 100}%`,
  },
  styles: {
    width: "100%",
    height: "100%",
    position: "absolute",
    left: 0,
    top: 0,
  },
};
const BASEBUTTON = (props) => <button {...props} />;
function VideoPlayer(props) {
  const [playing, setIsPlaying] = useState(false);
  //get video tag ref
  let videoRef = useRef(null);
  ///on mount we can change all attributes
  const PLAYICON = props.playIcon ? props.playIcon : BASEBUTTON;
  useEffect(() => {
    const video = videoRef.current;
    videoDefault();
    if (props.autoplay) {
      video.autoplay = true;
      video.volume = 0;
      video.oncanplay = () => {
        setIsPlaying(true);
        video.play();
      };
    }
    fixVideoControls();
  }, []);

  const pauseStart = () => {
    const video = videoRef.current;
    if (playing) {
      video.onpause = () => {
        setIsPlaying(false);
        video.pause();
      };
    }
    if (!playing) {
      video.onplay = () => {
        setIsPlaying(true);
        video.play();
      };
    }
  };
  const videoDefault = () => {
    const video = videoRef.current;
    video.volume = props.volume;
  };
  const togglePlay = () => {
    const video = videoRef.current;
    if (!playing) {
      setIsPlaying(true);
      video.play();
    } else {
      setIsPlaying(false);
      video.pause();
    }
  };
  ///hide download cta from video
  const fixVideoControls = () => {
    const video = videoRef.current;
    video.setAttribute("controlsList", "nodownload");
    video.setAttribute("disablePictureInPicture", true);
  };
  const setratio =
    typeof props.width !== "string" && typeof props.height !== "string";
  const containerBase = {
    ...props.containerStyles,
    paddingTop: setratio
      ? `${(props.height / props.width) * 100}%`
      : prop.height,
  };
  return (
    <div className={props.containerClassName} style={containerBase}>
      <video
        style={props.styles}
        ref={videoRef}
        src={props.src}
        controls={props.controls}
        loop={props.loop}
        playsinline
        poster={props.backgroundImage}
        onClick={pauseStart}
      />
      <div>
        <PLAYICON
          className={playing ? "video__play_icon hidden" : `video__play_icon`}
          onClick={togglePlay}
        />
      </div>
    </div>
  );
}

export default VideoPlayer;

</code>```

However, when I play it, is just gives me an error. I know its not my code because I have tried different vimeo sources. Some have worked, others have not.

Here is the image to the console error everytime I try to play the video:

I am getting error:

Uncaught (in promise) DOMException: The element has no supported sources.

Anyone know what the issue is? I have been looking all over stackoverflow, which others have the same issue, but none of the suggestions work. Any help is appreciated. Thanks!

I tried to add controls flag to the video tag like some people have said, and I was expecting it to work. But it didn't.

I also tried adding type="video/mp4"

Body:
I am just trying to figure out what could be going wrong in my code. It seems that certain vimeo urls work, but not all. So I have this code here and I am passing in a url.

import { useEffect, useRef, useState } from "react";
VideoPlayer.propTypes = {
  src: PropTypes.string,
  playing: PropTypes.bool,
  controls: PropTypes.bool,
  volume: PropTypes.number, //between 0 and 1
  loop: PropTypes.bool,
  muted: PropTypes.bool,
  backgroundImage: PropTypes.string,
  playsinline: PropTypes.bool,
  playIcon: PropTypes.func,
  autoplay: PropTypes.bool,
  containerClassName: PropTypes.string,
  containerStyles: PropTypes.object,
  styles: PropTypes.object,
  width: PropTypes.oneOfType(PropTypes.number, PropTypes.string),
  height: PropTypes.oneOfType(PropTypes.number, PropTypes.string),
};

VideoPlayer.defaultProps = {
  src: "",
  loop: false,
  muted: false,
  controls: true,
  volume: 0.05,
  width: 1600,
  height: 900,
  containerClassName: "",
  containerStyles: {
    width: "100%",
    position: "relative",
    paddingTop: `${(900 / 1600) * 100}%`,
  },
  styles: {
    width: "100%",
    height: "100%",
    position: "absolute",
    left: 0,
    top: 0,
  },
};
const BASEBUTTON = (props) => <button {...props} />;
function VideoPlayer(props) {
  const [playing, setIsPlaying] = useState(false);
  //get video tag ref
  let videoRef = useRef(null);
  ///on mount we can change all attributes
  const PLAYICON = props.playIcon ? props.playIcon : BASEBUTTON;
  useEffect(() => {
    const video = videoRef.current;
    videoDefault();
    if (props.autoplay) {
      video.autoplay = true;
      video.volume = 0;
      video.oncanplay = () => {
        setIsPlaying(true);
        video.play();
      };
    }
    fixVideoControls();
  }, []);

  const pauseStart = () => {
    const video = videoRef.current;
    if (playing) {
      video.onpause = () => {
        setIsPlaying(false);
        video.pause();
      };
    }
    if (!playing) {
      video.onplay = () => {
        setIsPlaying(true);
        video.play();
      };
    }
  };
  const videoDefault = () => {
    const video = videoRef.current;
    video.volume = props.volume;
  };
  const togglePlay = () => {
    const video = videoRef.current;
    if (!playing) {
      setIsPlaying(true);
      video.play();
    } else {
      setIsPlaying(false);
      video.pause();
    }
  };
  ///hide download cta from video
  const fixVideoControls = () => {
    const video = videoRef.current;
    video.setAttribute("controlsList", "nodownload");
    video.setAttribute("disablePictureInPicture", true);
  };
  const setratio =
    typeof props.width !== "string" && typeof props.height !== "string";
  const containerBase = {
    ...props.containerStyles,
    paddingTop: setratio
      ? `${(props.height / props.width) * 100}%`
      : prop.height,
  };
  return (

      <video
        style={props.styles}
        ref={videoRef}
        src={props.src}
        controls={props.controls}
        loop={props.loop}
        playsinline
        poster={props.backgroundImage}
        onClick={pauseStart}
      />

        <PLAYICON
          className={playing ? "video__play_icon hidden" : `video__play_icon`}
          onClick={togglePlay}
        />

  );
}

export default VideoPlayer;

However, when I play it, is just gives me an error. I know its not my code because I have tried different vimeo sources. Some have worked, others have not.

Here is the image to the console error everytime I try to play the video:

I am getting error:

Uncaught (in promise) DOMException: The element has no supported sources.

Anyone know what the issue is? I have been looking all over stackoverflow, which others have the same issue, but none of the suggestions work. Any help is appreciated. Thanks!

I tried to add controls flag to the video tag like some people have said, and I was expecting it to work. But it didn't.

I also tried adding type="video/mp4"


问:
Conflict between webview and pusher beam in app Flutter
When I use webviewController.runJavascript(dataJs) of webview the app immediately cannot receive notifications from pusher beam but the app can still receive notifications in background

Please see the image below, Is there any way to fix this?

enter image description here

enter image description here

enter image description here


问:
AttributeError | How should I call a class method?
My class code in edit (For presentation, not a problem for my question.)

```<code>class TxtFile:
    """Responsible for the file.

Creates objects that store the text of a '.txt' file
    """

    file_count = 0

    @staticmethod
    def question():
        """Call question()
        """

        print("""If you need:
open '.txt' file for read, use .open_file
write a '.txt' file, use .write_file
append text to '.txt' file, use .append_file""")

    @classmethod
    def kids(cls):
        """Counts the number of open files.

Variable keeper - file_count
        """
        print('I have', cls.file_count, 'file')

    def __init__(self):
        self.__file_name = None
        self.__file_path = None

        TxtFile.file_count += 1

    @property
    def name(self):
        if self.__file_name is None:
            print('You didn\'t enter a file name.\n')
        else:
            return self.__file_name

    @property
    def path(self):
        if self.__file_path is None:
            print('Path not specified.')
            fpath.display_catalog(DATA_PATH)
        else:
            return self.__file_path

    @name.setter
    def name(self, name):
        if self.__file_name is not None:
            print('The file already has the specified name.\n')
        else:
            if self.__file_path is not None:
                fpath.search_file(self.__file_path, name)
            else:
                print('You did not specify the path to the',
                      'directory with the file.\n')

    @path.setter
    def path(self, path):
        if self.__file_path is not None:
            print('The file already has the specified path.')
        else:
            self.__file_path = path

    def open_file(self, method='read'):
        """Responsible for opening a file.

Takes 3 arguments: read, write, append
Equal: rt, wt, at
        """

        if method == 'read':
            pass
        if method == 'write':
            pass
        if method == 'append':
            pass
</code>```

The code I want to do:

```<code>def display_info(cls):
    method_list = [method for method in dir(cls)
                   if callable(getattr(cls, method))
                   and method.startswith('__') is False]

    for method in method_list:
        method_doc = cls.method.__doc__
        print(method + ':')

        if method_doc is None:
            print('This method does not have docstring.')
        else:
            print('This is the docstring',
                  method_doc)

display_info(TxtFile)
</code>```

Error thrown: AttributeError: type object 'TxtFile' has no attribute 'method'

I tried in this way:

```<code>method_doc = cls.__dict__[method].__doc__
</code>```

Output:

```<code>This is the docstring classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:

  class C:
      @classmethod
      def f(cls, arg1, arg2, ...):
          ...

It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()).  The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.

Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.
open_file:
This is the docstring Responsible for opening a file.

Takes 3 arguments: read, write, append
 Equal: rt, wt, at

question:
This is the docstring staticmethod(function) -> method

Convert a function to be a static method.

A static method does not receive an implicit first argument.
To declare a static method, use this idiom:

     class C:
         @staticmethod
         def f(arg1, arg2, ...):
             ...

It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()). Both the class and the instance are ignored, and
neither is passed implicitly as the first argument to the method.

Static methods in Python are similar to those found in Java or C++.
For a more advanced concept, see the classmethod builtin.
</code>```

I want to have a function that will output dcstring of class methods.

I have been learning Python for less than a month, so my knowledge is limited. In the code, I use what I know. I would like to know the solution and get an answer how it works.

Body:
My class code in edit (For presentation, not a problem for my question.)

class TxtFile:
    """Responsible for the file.

Creates objects that store the text of a '.txt' file
    """

    file_count = 0

    @staticmethod
    def question():
        """Call question()
        """

        print("""If you need:
open '.txt' file for read, use .open_file
write a '.txt' file, use .write_file
append text to '.txt' file, use .append_file""")

    @classmethod
    def kids(cls):
        """Counts the number of open files.

Variable keeper - file_count
        """
        print('I have', cls.file_count, 'file')

    def __init__(self):
        self.__file_name = None
        self.__file_path = None

        TxtFile.file_count += 1

    @property
    def name(self):
        if self.__file_name is None:
            print('You didn\'t enter a file name.\n')
        else:
            return self.__file_name

    @property
    def path(self):
        if self.__file_path is None:
            print('Path not specified.')
            fpath.display_catalog(DATA_PATH)
        else:
            return self.__file_path

    @name.setter
    def name(self, name):
        if self.__file_name is not None:
            print('The file already has the specified name.\n')
        else:
            if self.__file_path is not None:
                fpath.search_file(self.__file_path, name)
            else:
                print('You did not specify the path to the',
                      'directory with the file.\n')

    @path.setter
    def path(self, path):
        if self.__file_path is not None:
            print('The file already has the specified path.')
        else:
            self.__file_path = path

    def open_file(self, method='read'):
        """Responsible for opening a file.

Takes 3 arguments: read, write, append
Equal: rt, wt, at
        """

        if method == 'read':
            pass
        if method == 'write':
            pass
        if method == 'append':
            pass

The code I want to do:

def display_info(cls):
    method_list = [method for method in dir(cls)
                   if callable(getattr(cls, method))
                   and method.startswith('__') is False]

    for method in method_list:
        method_doc = cls.method.__doc__
        print(method + ':')

        if method_doc is None:
            print('This method does not have docstring.')
        else:
            print('This is the docstring',
                  method_doc)

display_info(TxtFile)

Error thrown: AttributeError: type object 'TxtFile' has no attribute 'method'

I tried in this way:

method_doc = cls.__dict__[method].__doc__

Output:

This is the docstring classmethod(function) -> method

Convert a function to be a class method.

A class method receives the class as implicit first argument,
just like an instance method receives the instance.
To declare a class method, use this idiom:

  class C:
      @classmethod
      def f(cls, arg1, arg2, ...):
          ...

It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()).  The instance is ignored except for its class.
If a class method is called for a derived class, the derived class
object is passed as the implied first argument.

Class methods are different than C++ or Java static methods.
If you want those, see the staticmethod builtin.
open_file:
This is the docstring Responsible for opening a file.

Takes 3 arguments: read, write, append
 Equal: rt, wt, at

question:
This is the docstring staticmethod(function) -> method

Convert a function to be a static method.

A static method does not receive an implicit first argument.
To declare a static method, use this idiom:

     class C:
         @staticmethod
         def f(arg1, arg2, ...):
             ...

It can be called either on the class (e.g. C.f()) or on an instance
(e.g. C().f()). Both the class and the instance are ignored, and
neither is passed implicitly as the first argument to the method.

Static methods in Python are similar to those found in Java or C++.
For a more advanced concept, see the classmethod builtin.

I want to have a function that will output dcstring of class methods.

I have been learning Python for less than a month, so my knowledge is limited. In the code, I use what I know. I would like to know the solution and get an answer how it works.


问:
Excel workbook with data linked to another workbook is fetching data even though the sourced workbook is renamed/replaced or deleted
I have created a workbook say A which has product specification along with their product code in normal range format. The second workbook say B is having a table with calculated columns containing index match formulas to fetch data from the workbook A. As soon as I fill Product no. in product code column in WB B the calculated columns automatically fills data in the row by Index-Matching it from WB A's data. The setup overall is working fine.
The issue is that while I wanted to get a VBA customized notification to user if the two workbook's link is broken. So what I did is I deleted the WB A temporarily. But now when I open WB B although it is showing the "We can't update some links...." dialogue box. But when I enter Product No. in the cell it still able to fetch data somehow. I'm puzzled how WB B is still able to get the data. I Tried multiple times with different values but it is still able to fetch the data somehow.

Instead of deleting the WB A I tried renaming or replacing but WB B it still behaves the same. It seems like the WB B has fetched all the data from A and stored somewhere.
The downside is that I will not be able to be sure that the fetched data is latest or not.


问:
Is there a way to stop specific port on localhost such as port 8080 or all the listening ports
I am trying to develop a web app with dart and whenever I try to invoke webdev serve command I am getting Socket Exception I don't know what to do please help, I tried to stop the port that's been used, but I am lost each time, no yelling be respectful.</p>
```<code>[INFO] Building new asset graph completed, took 1.2s
[INFO] Checking for unexpected pre-existing outputs. completed, took 0ms
[INFO] Starting resource servers...Unhandled exception:
SocketException: Failed to create server socket (OS Error: An attempt was made to access a socket in a way forbidden by its access permissions.
, errno = 10013), address = 127.0.0.1, port = 8080
#0      _NativeSocket.bind (dart:io-patch/socket_patch.dart:996:7)
<asynchronous suspension>
#1      HttpMultiServer._loopback (package:http_multi_server/http_multi_server.dart:209:20)
<asynchronous suspension>
#2      WebDevServer.start (package:webdev/src/serve/webdev_server.dart:178:16)
<asynchronous suspension>
#3      ServerManager.start (package:webdev/src/serve/server_manager.dart:23:19)
<asynchronous suspension>
#4      _startServerManager (package:webdev/src/serve/dev_workflow.dart:107:7)
<asynchronous suspension>
#5      DevWorkflow.start (package:webdev/src/serve/dev_workflow.dart:200:25)
<asynchronous suspension>
#6      ServeCommand.run (package:webdev/src/command/serve_command.dart:107:9)
<asynchronous suspension>
#7      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#8      _CommandRunner.runCommand (package:webdev/src/webdev_command_runner.dart:38:12)
<asynchronous suspension>
#9      run (package:webdev/src/webdev_command_runner.dart:19:46)
<asynchronous suspension>
#10     main (file:///C:/Users/ayyub/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/webdev-2.7.12/bin/webdev.dart:17:16)
<asynchronous suspension>
[INFO] Starting resource servers...Unhandled exception:
SocketException: Failed to create server socket (OS Error: An attempt was made to access a socket in a way forbidden by its access permissions.
, errno = 10013), address = 127.0.0.1, port = 8080
#0      _NativeSocket.bind (dart:io-patch/socket_patch.dart:996:7)
<asynchronous suspension>
#1      HttpMultiServer._loopback (package:http_multi_server/http_multi_server.dart:209:20)
<asynchronous suspension>
#2      WebDevServer.start (package:webdev/src/serve/webdev_server.dart:178:16)
<asynchronous suspension>
#3      ServerManager.start (package:webdev/src/serve/server_manager.dart:23:19)
<asynchronous suspension>
#4      _startServerManager (package:webdev/src/serve/dev_workflow.dart:107:7)
<asynchronous suspension>
#5      DevWorkflow.start (package:webdev/src/serve/dev_workflow.dart:200:25)
<asynchronous suspension>
#6      ServeCommand.run (package:webdev/src/command/serve_command.dart:107:9)
<asynchronous suspension>
#7      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#8      _CommandRunner.runCommand (package:webdev/src/webdev_command_runner.dart:38:12)
<asynchronous suspension>
#9      run (package:webdev/src/webdev_command_runner.dart:19:46)
<asynchronous suspension>
#10     main (file:///C:/Users/ayyub/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/webdev-2.7.12/bin/webdev.dart:17:16)
<asynchronous suspension>
</code>```

Body:
I am trying to develop a web app with dart and whenever I try to invoke webdev serve command I am getting Socket Exception I don't know what to do please help, I tried to stop the port that's been used, but I am lost each time, no yelling be respectful.

[INFO] Building new asset graph completed, took 1.2s
[INFO] Checking for unexpected pre-existing outputs. completed, took 0ms
[INFO] Starting resource servers...Unhandled exception:
SocketException: Failed to create server socket (OS Error: An attempt was made to access a socket in a way forbidden by its access permissions.
, errno = 10013), address = 127.0.0.1, port = 8080
#0      _NativeSocket.bind (dart:io-patch/socket_patch.dart:996:7)
<asynchronous suspension>
#1      HttpMultiServer._loopback (package:http_multi_server/http_multi_server.dart:209:20)
<asynchronous suspension>
#2      WebDevServer.start (package:webdev/src/serve/webdev_server.dart:178:16)
<asynchronous suspension>
#3      ServerManager.start (package:webdev/src/serve/server_manager.dart:23:19)
<asynchronous suspension>
#4      _startServerManager (package:webdev/src/serve/dev_workflow.dart:107:7)
<asynchronous suspension>
#5      DevWorkflow.start (package:webdev/src/serve/dev_workflow.dart:200:25)
<asynchronous suspension>
#6      ServeCommand.run (package:webdev/src/command/serve_command.dart:107:9)
<asynchronous suspension>
#7      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#8      _CommandRunner.runCommand (package:webdev/src/webdev_command_runner.dart:38:12)
<asynchronous suspension>
#9      run (package:webdev/src/webdev_command_runner.dart:19:46)
<asynchronous suspension>
#10     main (file:///C:/Users/ayyub/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/webdev-2.7.12/bin/webdev.dart:17:16)
<asynchronous suspension>
[INFO] Starting resource servers...Unhandled exception:
SocketException: Failed to create server socket (OS Error: An attempt was made to access a socket in a way forbidden by its access permissions.
, errno = 10013), address = 127.0.0.1, port = 8080
#0      _NativeSocket.bind (dart:io-patch/socket_patch.dart:996:7)
<asynchronous suspension>
#1      HttpMultiServer._loopback (package:http_multi_server/http_multi_server.dart:209:20)
<asynchronous suspension>
#2      WebDevServer.start (package:webdev/src/serve/webdev_server.dart:178:16)
<asynchronous suspension>
#3      ServerManager.start (package:webdev/src/serve/server_manager.dart:23:19)
<asynchronous suspension>
#4      _startServerManager (package:webdev/src/serve/dev_workflow.dart:107:7)
<asynchronous suspension>
#5      DevWorkflow.start (package:webdev/src/serve/dev_workflow.dart:200:25)
<asynchronous suspension>
#6      ServeCommand.run (package:webdev/src/command/serve_command.dart:107:9)
<asynchronous suspension>
#7      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#8      _CommandRunner.runCommand (package:webdev/src/webdev_command_runner.dart:38:12)
<asynchronous suspension>
#9      run (package:webdev/src/webdev_command_runner.dart:19:46)
<asynchronous suspension>
#10     main (file:///C:/Users/ayyub/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/webdev-2.7.12/bin/webdev.dart:17:16)
<asynchronous suspension>


问:
How to create swipeActions for a multi-level list in swift?
How do I create swipeActions for a multi-level (recursive) list in swift?

With a simple list I can do this, and everything works just fine:

```<code>struct ContentView: View {
    @State private var data = ["One", "Two", "Three"]

    var body: some View {
        List(data, id: \.self) { item in
            Text(item)
                .swipeActions(edge: .trailing, allowsFullSwipe: true) {
                     Button("Delete", role: .destructive) {
                         data.removeAll { $0 == item }
                     }
                 }
        }
    }
}

</code>```

But when I try the same with a multi-level list, I cannot swipe any of its rows (nothing happens when I try to swipe):

```<code>struct MyData: Hashable {
    let value: String
    var children: [MyData]? = nil
}

struct ContentView: View {
    @State private var data: [MyData] = [
        .init(
            value: "One",
            children: [
                .init(value: "Two"),
                .init(
                    value: "Three",
                    children: [
                        .init(value: "Four"),
                        .init(value: "Five")
                    ]
                )
            ]
        )
    ]

    var body: some View {
        List(data, id: \.self, children: \.children) { item in
            Text(item.value)
                .swipeActions(edge: .trailing, allowsFullSwipe: true) {
                    Button("Delete", role: .destructive) {
                        data.removeAll { $0 == item }
                    }
                }
        }
    }
}

</code>```

How to make this work?

I also tried using .onDelete, but it requires using ForEach to construct the list which does not work with the multi-level list (or I did not figure out a way to make it work).

Body:
How do I create swipeActions for a multi-level (recursive) list in swift?

With a simple list I can do this, and everything works just fine:

struct ContentView: View {
    @State private var data = ["One", "Two", "Three"]

    var body: some View {
        List(data, id: \.self) { item in
            Text(item)
                .swipeActions(edge: .trailing, allowsFullSwipe: true) {
                     Button("Delete", role: .destructive) {
                         data.removeAll { $0 == item }
                     }
                 }
        }
    }
}

But when I try the same with a multi-level list, I cannot swipe any of its rows (nothing happens when I try to swipe):

struct MyData: Hashable {
    let value: String
    var children: [MyData]? = nil
}

struct ContentView: View {
    @State private var data: [MyData] = [
        .init(
            value: "One",
            children: [
                .init(value: "Two"),
                .init(
                    value: "Three",
                    children: [
                        .init(value: "Four"),
                        .init(value: "Five")
                    ]
                )
            ]
        )
    ]

    var body: some View {
        List(data, id: \.self, children: \.children) { item in
            Text(item.value)
                .swipeActions(edge: .trailing, allowsFullSwipe: true) {
                    Button("Delete", role: .destructive) {
                        data.removeAll { $0 == item }
                    }
                }
        }
    }
}

How to make this work?

I also tried using .onDelete, but it requires using ForEach to construct the list which does not work with the multi-level list (or I did not figure out a way to make it work).


问:
Jquery validation - Ajax call if condition add rule
I wrote the logic to check for a valid ID using the code below. It works fine with default logic using https://jqueryvalidation.org/files/demo/

Now, there is an additional rule to check and show a validation message based on the AJAX call response if the content is true.

I added the below rule to display an error message if the content is true. flow is going there, but the validation message is not showing. Please let me know whether any syntax is missing?

{
 "id": "4974635f-514e-4d26-8170-ae77c984e8ab",
 "content": "true",
 "status": "SUCCESS",
 "redirect": null
}

$.validator.addMethod('IDNumber', function (value) {
    return  /^[STFGstfg]\d{7}[a-zA-Z]$/.test(value);
}, 'Please enter a valid ID number');

$("#signup--form").validate({
    rules:{
        "id-no": {
              required: true,
              IDNumber: true
        }
    },
    messages:{
        "id-no":{
            required: 'Please enter a valid ID number'
        }
    },
    submitHandler: function submitHandler() {
      var checkID = $('#id-no').val();
      var getDomainName = window.location.origin;
      $.ajax({
          url: getDomainName + '/.rest/stripe/v1?id=' +checkID,
          type:'GET',
          dataType: 'json',
          success: function(response) {
            if(response.content == 'false'){
               popupSubmit();
            } else{
                $('#id-no').rules('add', {
                    messages: {
                        required: 'ID no. is blacklisted. Please try with another valid ID'
                    }
                });
            }
          }
       });
       return false;
    }
});```
<pre class="snippet-code-html lang-html prettyprint-override"><code><form id="signup--form">
    <div class="row">
        <div class="col-lg-12">
            <div class="input-field--wrapper">
                <div class="title">
                    ID of the subscriber
                </div>
                <input class="form-control" value="" placeholder="D1234567U" id="id-no" name="id-no" autocomplete="off" required/>
            </div>
        </div>
    </div>

    <div class="button-wrapper">
        <button type="submit" value="Submit" class="button button-primary">Confirm</button>
    </div>
</form></code>```

Body:
I wrote the logic to check for a valid ID using the code below. It works fine with default logic using https://jqueryvalidation.org/files/demo/

Now, there is an additional rule to check and show a validation message based on the AJAX call response if the content is true.

I added the below rule to display an error message if the content is true. flow is going there, but the validation message is not showing. Please let me know whether any syntax is missing?

{
 "id": "4974635f-514e-4d26-8170-ae77c984e8ab",
 "content": "true",
 "status": "SUCCESS",
 "redirect": null
}

$.validator.addMethod('IDNumber', function (value) {
    return  /^[STFGstfg]\d{7}[a-zA-Z]$/.test(value);
}, 'Please enter a valid ID number');

$("#signup--form").validate({
    rules:{
        "id-no": {
              required: true,
              IDNumber: true
        }
    },
    messages:{
        "id-no":{
            required: 'Please enter a valid ID number'
        }
    },
    submitHandler: function submitHandler() {
      var checkID = $('#id-no').val();
      var getDomainName = window.location.origin;
      $.ajax({
          url: getDomainName + '/.rest/stripe/v1?id=' +checkID,
          type:'GET',
          dataType: 'json',
          success: function(response) {
            if(response.content == 'false'){
               popupSubmit();
            } else{
                $('#id-no').rules('add', {
                    messages: {
                        required: 'ID no. is blacklisted. Please try with another valid ID'
                    }
                });
            }
          }
       });
       return false;
    }
});

<form id="signup--form">

                    ID of the subscriber

                <input class="form-control" value="" placeholder="D1234567U" id="id-no" name="id-no" autocomplete="off" required/>

        <button type="submit" value="Submit" class="button button-primary">Confirm</button>

</form>


问:
Android Chrome's url prefetch breaks page height (and thus sticky footer)
I was trying to create a page with sticky footer, when I found it.
If you type your url several times in searchbar so that chrome would prefetch it when you've typed it but didn't hit go (enter), then the page is loaded with bigger height for some reason. (Only on Android, but it happend on all my devices).

At first I thought that maybe my styles were wrong, but the I've checked it against typical examples such as:

https://getbootstrap.com/docs/5.0/examples/sticky-footer/

https://getbootstrap.com/docs/4.0/examples/sticky-footer/

And both versions from here
https://developer.mozilla.org/en-US/docs/Web/CSS/Layout_cookbook/Sticky_footers

To reproduce it just open new tab, write full url and wait some time before hitting go so it will prefetch. May not work for the first time, then just close opened tad, open new one and once again type the full url, wait and after hitting go you will not see a footer in the end of the page untill (for some reason!!) tapping in any place of it.

While figuring out I also found out that https://viewportsizer.com/ gives for my Pixel 6 height of 1112px it loaded with prefetch (as described above) and waited for some time to display numbers, while actual Pixel 6 height (without prefetch) is 790px and it could be seen on that same site.

(Screenshots are with prefetch load and after touching the screen)

So my questions is..

Is it a bug? Is it a known issue? And most of all are there any workarounds? Can my site detect being loaded with wrong\prefetched height and somehow reload the page afterwards?


问:
How to check real time changes in sqlite with Flask and sqlachemy
I need to dynamically create/update tables in the database based on rows entries on a different table

idea:

when a row gets added to the User table, add User.ID as a new entry in the TrackData table

when a row gets added to the Trackers table, add Trackers.ID as a new column in the TrackData table

data can either be added to Trackers and User tables either via API or manually
so far I have tried to use
`

@listens_for(Trackers, "after_commit")
```
<p>and</p>
```event.listen(Session, 'after_commit', my_after_commit)
```

documentation here

but nothing really happens

Body:
I need to dynamically create/update tables in the database based on rows entries on a different table

idea:

when a row gets added to the User table, add User.ID as a new entry in the TrackData table

when a row gets added to the Trackers table, add Trackers.ID as a new column in the TrackData table

data can either be added to Trackers and User tables either via API or manually
so far I have tried to use
`

@listens_for(Trackers, "after_commit")

and

event.listen(Session, 'after_commit', my_after_commit)

documentation here

but nothing really happens


问:
runtime network not ready: NetworkReady=false Kubernetes after installing flannel
I have existing control plane node, here is details about it:

```<code>System Info:
  Machine ID:                 b17c3aeb591145c3a2179bf59a6fd463
  System UUID:                b17c3aeb-5911-45c3-a217-9bf59a6fd463
  Boot ID:                    0aa4608e-cdd2-4501-b9c8-4bba6cc350a1
  Kernel Version:             5.11.12-1.el7.elrepo.x86_64
  OS Image:                   CentOS Linux 7 (Core)
  Operating System:           linux
  Architecture:               amd64
  Container Runtime Version:  docker://20.10.12
  Kubelet Version:            v1.20.14
  Kube-Proxy Version:         v1.20.14
PodCIDR:                      10.244.0.0/24
PodCIDRs:                     10.244.0.0/24
Non-terminated Pods:          (25 in total)
</code>```

While, my worked node that I tri to deploy looks like this:

```<code>System Info:
  Machine ID:                 944275a550a54347ca51e69f639945ee
  System UUID:                7438EA43-DDB0-4417-A056-1552B3DD3A04
  Boot ID:                    9af4132a-f7c5-4c9c-bc5a-d38a6577ae5f
  Kernel Version:             3.10.0-1160.45.1.el7.x86_64
  OS Image:                   CentOS Linux 7 (Core)
  Operating System:           linux
  Architecture:               amd64
  Container Runtime Version:  docker://20.10.12
  Kubelet Version:            v1.20.14
  Kube-Proxy Version:         v1.20.14
PodCIDR:                      10.244.4.0/24
PodCIDRs:                     10.244.4.0/24
Non-terminated Pods:          (3 in total)
</code>```

Having this problem:

```<code>runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized

</code>```

And here is my list of commands that I used to install and join this worker node

```<code>   8. yum install kubelet-1.20.14 kubeadm-1.20.14 kubectl-1.20.14
   9. sudo setenforce 0
      sudo sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config
   10 sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
      sudo swapoff -a
   11 sudo modprobe overlay
      sudo modprobe br_netfilter
   12 sudo tee /etc/sysctl.d/kubernetes.conf<<EOF
      net.bridge.bridge-nf-call-ip6tables = 1
      net.bridge.bridge-nf-call-iptables = 1
      net.ipv4.ip_forward = 1
      EOF
   13 sudo sysctl --system
   14 sudo yum install -y yum-utils device-mapper-persistent-data lvm2
   15 sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
   16 sudo yum install docker-ce-20.10.12 docker-ce-cli-20.10.12 containerd.io
   17 sudo mkdir -p /etc/systemd/system/docker.service.d
   18 sudo mkdir /etc/docker
   19 #Creating daemon json config file
   18  sudo systemctl daemon-reload
   19  sudo systemctl restart docker
   20  sudo systemctl enable docker
   21  sudo systemctl disable --now firewalld
   22  lsmod | grep br_netfilter
   23  sudo systemctl enable kubelet
   25  kubeadm join...
</code>```

Also, worth to mentioned that I tried to use both Flannel and Calico

```<code>kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/2140ac876ef134e0ed5af15c65e414cf26827915/Documentation/kube-flannel.yml

#OR

kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/2140ac876ef134e0ed5af15c65e414cf26827915/Documentation/kube-flannel.yml
</code>```

But error still persist

All code that I mentioned above I used to set up my new worker node

Body:
I have existing control plane node, here is details about it:

System Info:
  Machine ID:                 b17c3aeb591145c3a2179bf59a6fd463
  System UUID:                b17c3aeb-5911-45c3-a217-9bf59a6fd463
  Boot ID:                    0aa4608e-cdd2-4501-b9c8-4bba6cc350a1
  Kernel Version:             5.11.12-1.el7.elrepo.x86_64
  OS Image:                   CentOS Linux 7 (Core)
  Operating System:           linux
  Architecture:               amd64
  Container Runtime Version:  docker://20.10.12
  Kubelet Version:            v1.20.14
  Kube-Proxy Version:         v1.20.14
PodCIDR:                      10.244.0.0/24
PodCIDRs:                     10.244.0.0/24
Non-terminated Pods:          (25 in total)

While, my worked node that I tri to deploy looks like this:

System Info:
  Machine ID:                 944275a550a54347ca51e69f639945ee
  System UUID:                7438EA43-DDB0-4417-A056-1552B3DD3A04
  Boot ID:                    9af4132a-f7c5-4c9c-bc5a-d38a6577ae5f
  Kernel Version:             3.10.0-1160.45.1.el7.x86_64
  OS Image:                   CentOS Linux 7 (Core)
  Operating System:           linux
  Architecture:               amd64
  Container Runtime Version:  docker://20.10.12
  Kubelet Version:            v1.20.14
  Kube-Proxy Version:         v1.20.14
PodCIDR:                      10.244.4.0/24
PodCIDRs:                     10.244.4.0/24
Non-terminated Pods:          (3 in total)

Having this problem:

runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized

And here is my list of commands that I used to install and join this worker node

   8. yum install kubelet-1.20.14 kubeadm-1.20.14 kubectl-1.20.14
   9. sudo setenforce 0
      sudo sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config
   10 sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
      sudo swapoff -a
   11 sudo modprobe overlay
      sudo modprobe br_netfilter
   12 sudo tee /etc/sysctl.d/kubernetes.conf<<EOF
      net.bridge.bridge-nf-call-ip6tables = 1
      net.bridge.bridge-nf-call-iptables = 1
      net.ipv4.ip_forward = 1
      EOF
   13 sudo sysctl --system
   14 sudo yum install -y yum-utils device-mapper-persistent-data lvm2
   15 sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
   16 sudo yum install docker-ce-20.10.12 docker-ce-cli-20.10.12 containerd.io
   17 sudo mkdir -p /etc/systemd/system/docker.service.d
   18 sudo mkdir /etc/docker
   19 #Creating daemon json config file
   18  sudo systemctl daemon-reload
   19  sudo systemctl restart docker
   20  sudo systemctl enable docker
   21  sudo systemctl disable --now firewalld
   22  lsmod | grep br_netfilter
   23  sudo systemctl enable kubelet
   25  kubeadm join...

Also, worth to mentioned that I tried to use both Flannel and Calico

kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/2140ac876ef134e0ed5af15c65e414cf26827915/Documentation/kube-flannel.yml

#OR

kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/2140ac876ef134e0ed5af15c65e414cf26827915/Documentation/kube-flannel.yml

But error still persist

All code that I mentioned above I used to set up my new worker node


问:
Is Handler single-threaded?
Android has the traditional Handler and the Java-provided Executor for multitasking.

On what threading models are Handlers based off? Is it backed by single threading, much like an instance of Executors.newSingleThreadExecutor()? Is it multithreaded like thread pools?

From my understanding of a Kotlin Camera2 example, I suspect it works much like a single-threaded executor.

Title: Is Handler single-threaded?


问:
pipewire/Rust: How to list all Audio/Source nodes and those properties by using pipewire-rs
I want to list all "Audio/Source" pipewire nodes and those properties in my Rust program with pipewire Rust library.

By using event handler, this can be done. But event handler requires a running main loop, which is weird.

Is there any idiomatic way to get list of nodes in Rust program?

Thank you in advance.


问:
Calling sqlite.connect() in Python using in-memory variable instead of file path
Using Python 3.10.8 is it possible to call sqlite.connect() using a variable containing the raw db file instead of a file path on disk? I.E. read the db file from an external source into memory and then call connect() with the variable in memory?

For example:

...
import sqlite3
...

db = s3.get('my-bucket', 'myapp.db')
sqlite.connect(db)
```


问:
is there a way to let github codespaces to connect my other SQL server?
is there a way to allow specified IP, which codespaces can connect?

i've tried to ping everything inside a codespace, and all got nothing, such as bing.com, github.com etc..


问:
Why Android Studio with Retrofit or Volley sends all requests as GET?
I am programming android applications with retrofit and volley to consume APIs, the endpoints handle different methods but when I program them all are sent with the GET method.

I am debugging with Android Studio and I also generate the APKs, I test them on different devices but the result is the same.


问:
Merge Editor Issues while building new SCM extension in vs code
Hi I am building new vs code extension for our source control project we need merge editor for merging functionality.
I am using "vscode.commands.executeCommand('_open.mergeEditor', options);" for opening merge editor.
i came out through when scenario while doing Accept Merge operation
If user try to click Accept merge button if still there are conflicts unhandled. i am trying to close the merge editor before merge at that time it will trigger pop up box like there are still conflicts.
image
I am using this code to close editor
let didCloseTab = await vscode.window.tabGroups.close(mergeEditorTabs, true);
if its true it will continue merge

But if user select close with conflicts its closing merge editor so its setting "didCloseTab" value true and accepting merge.

I want to identify the option which user is clicking because i need to restrict merge option in this case.
How can i do that??
is there any event i can use to capture that.
Or how can i capture conflicts from merge editor


问:
ApolloGraphQL keeps displaying errors in console
I have the following mutation:

```<code>const [CreateDoc, {error, loading }] = useMutation(CREATE_DOC, {
    onError(err) {
              setErrorMsg([...msg_error]);
            }
}
CreateDoc({ variables: { input } });
</code>```

Although I have an onError defined in the mutation, I keep seeing the error 400 (bad request) in the console. How can I capture that error in a way that doesn't show in the browser's console?

Thanks

Body:
I have the following mutation:

const [CreateDoc, {error, loading }] = useMutation(CREATE_DOC, {
    onError(err) {
              setErrorMsg([...msg_error]);
            }
}
CreateDoc({ variables: { input } });

Although I have an onError defined in the mutation, I keep seeing the error 400 (bad request) in the console. How can I capture that error in a way that doesn't show in the browser's console?

Thanks


问:
How can show all test that ran regardless if passed or failed using dotnet test?
I have a solution and in the solution is s directory where all tests reside.

I can run all tests using

```<code> dotnet test  "c:\testing.dll"
</code>```

It only shows in the console the name of the failed tests
and the end result shows how many passed.
Is there a way in the command i can show all test in the command window that ran regardless f failed or passed ?

Body:
I have a solution and in the solution is s directory where all tests reside.

I can run all tests using

 dotnet test  "c:\testing.dll"

It only shows in the console the name of the failed tests
and the end result shows how many passed.
Is there a way in the command i can show all test in the command window that ran regardless f failed or passed ?


问:
The effect of hierarchical unloading reasoning based on deep learning model becomes worse
I calculated the different network layers separately on my host and edge devices, but the inference effect was very poor.

I will infer a deep learning model, and put different network layers on the edge device and my host for inference, but the effect is very poor. What is the reason? I'm using the same torch+python version between devices.


问:
Error while installing onnxmltools version 1.11.1
Getting the following error while installing onnxmltools

```<code>  import onnxmltools
  File "/usr/local/lib/python3.7/site-packages/onnxmltools/__init__.py", line 16, in <module>
    from .convert import convert_coreml
  File "/usr/local/lib/python3.7/site-packages/onnxmltools/convert/__init__.py", line 3, in <module>
    from .main import convert_coreml
  File "/usr/local/lib/python3.7/site-packages/onnxmltools/convert/main.py", line 5, in <module>
    import onnx
  File "/usr/local/lib/python3.7/site-packages/onnx/__init__.py", line 7, in <module>
    from onnx.external_data_helper import (
  File "/usr/local/lib/python3.7/site-packages/onnx/external_data_helper.py", line 9, in <module>
    from .onnx_pb import AttributeProto, GraphProto, ModelProto, TensorProto
  File "/usr/local/lib/python3.7/site-packages/onnx/onnx_pb.py", line 4, in <module>
    from .onnx_ml_pb2 import *  # noqa
  File "/usr/local/lib/python3.7/site-packages/onnx/onnx_ml_pb2.py", line 5, in <module>
    from google.protobuf.internal import builder as _builder
ImportError: cannot import name 'builder' from 'google.protobuf.internal' (/usr/local/lib/python3.7/site-packages/google/protobuf/internal/__init__.py)
</code>```

Got this error while running an experiment after building a docker container and running experiment through it. The build had onnxmltools v1.11.1 installed.

Body:
Getting the following error while installing onnxmltools

  import onnxmltools
  File "/usr/local/lib/python3.7/site-packages/onnxmltools/__init__.py", line 16, in <module>
    from .convert import convert_coreml
  File "/usr/local/lib/python3.7/site-packages/onnxmltools/convert/__init__.py", line 3, in <module>
    from .main import convert_coreml
  File "/usr/local/lib/python3.7/site-packages/onnxmltools/convert/main.py", line 5, in <module>
    import onnx
  File "/usr/local/lib/python3.7/site-packages/onnx/__init__.py", line 7, in <module>
    from onnx.external_data_helper import (
  File "/usr/local/lib/python3.7/site-packages/onnx/external_data_helper.py", line 9, in <module>
    from .onnx_pb import AttributeProto, GraphProto, ModelProto, TensorProto
  File "/usr/local/lib/python3.7/site-packages/onnx/onnx_pb.py", line 4, in <module>
    from .onnx_ml_pb2 import *  # noqa
  File "/usr/local/lib/python3.7/site-packages/onnx/onnx_ml_pb2.py", line 5, in <module>
    from google.protobuf.internal import builder as _builder
ImportError: cannot import name 'builder' from 'google.protobuf.internal' (/usr/local/lib/python3.7/site-packages/google/protobuf/internal/__init__.py)

Got this error while running an experiment after building a docker container and running experiment through it. The build had onnxmltools v1.11.1 installed.


问:
Event Schema Question - Adding to existing third party schema
I have an issue I am hoping somebody can help me with. I have an events website. All of my events on the website are served automatically through a third party api with event schema already coded into each event. The problem is that there are some event fields that they leave blank and there are also some fields that I feel could be changed for the better. I do have an option to add my own html and other code to each page but I do not have the option to work on the existing code that is there.

I am not a coder by any means but I understand it enough to know how to implement it with instructions. This website was mainly built using bootstrap from what I understand. Is there anyway to override the exising schema OR somehow add to it. I can provide any screenshots or info that you may need. Thank you so much for your time

I tried adding my own and it was creating duplicate fields


问:
LARAVEL : How to autofill form using ajax
I'm making a form for leave allocation, the form data consists of 2 table relations to table_karyawan and settingalokasi. when I select the kategori_cuti, tanggal_masuk form will appear where this form will be filled when the user selects nama_karyawan.

so the nama_karyawan and tanggal_masuk data come from the same table. I've tried to fetch the data using jquery ajax, but haven't been able to until now:
this is my controller for getTglmasuk:

```<code> public function getTglmasuk(Request $request)
{
    try {
        $getTglmasuk = Karyawan::select('tgl_masuk')
        ->where('id', $request->id_karyawan)->first();

        if(!$getTglmasuk) {
            throw new \Exception('Data not found');
        }
        return response()->json($getTglmasuk);
    } catch (\Exception $e){
        return response()->json([
            'message' =>$e->getMessage()
        ], 500);
    }
}
</code>```

and this is the route:

```<code>Route::post('/gettglmasuk', [AlokasicutiController::class, 'getTglmasuk'])->name('get.Tglmasuk');
</code>```

this is the form in blade.php:

```<code> <form class="input" action="{{route('alokasi.store')}}" method="POST" enctype="multipart/form-data">
                @csrf
                @method('POST')
                <div class="panel-body">
                    <div class="col-md-6">
                        <div class="form-group col-sm">
                            <label for="id_karyawan" class="col-form-label">Karyawan</label>
                            <select name="id_karyawan" id="id_karyawan" class="form-control">
                                <option value="">Pilih Karyawan</option>
                                @foreach ($karyawan as $data)
                                    <option value="{{ $data->id }}">{{ $data->nama }}</option>
                                @endforeach
                            </select>
                        </div>

                        <div class="form-group col-sm" id="jeniscuti">
                            <label for="id_jeniscuti" class="col-form-label">Kategori Cuti</label>
                            <select name="id_jeniscuti" id="id_jeniscuti" class="form-control">
                                <option value="">Pilih Kategori Cuti</option>
                                    @foreach ($jeniscuti as $jenis)
                                        <option value="{{ $jenis->id }}">{{ $jenis->jenis_cuti }}</option>
                                    @endforeach
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="durasi" class="col-form-label">Durasi (Hari)</label>
                                <input type="text" class="form-control" name="durasi" placeholder="durasi" id="durasi">
                        </div>
                        <div class="form-group">
                            <label for="mode_alokasi" class="col-form-label">Mode Alokasi</label>
                                <input type="text" class="form-control" name="mode_alokasi" placeholder="mode alokasi" id="mode_alokasi">
                        </div>
                    </div>

                    <div class="col-md-6" id="validitas">
                        <div class=""  id="tanggalmulai">
                            <div class="form-group">
                                <label for="tgl_masuk" class="form-label">Tanggal Masuk</label>
                                <div class="input-group">
                                    <input type="text" class="form-control" placeholder="mm/dd/yyyy" id="tgl_masuk" name="tgl_masuk" autocomplete="off" readonly>
                                    <span class="input-group-addon bg-custom b-0"><i class="mdi mdi-calendar text-white"></i></span>
                                </div>
                            </div>
                        </div>
                        <div class="" id="tanggalselesai">
                            <div class="form-group">
                                <label for="tgl_selesai" class="form-label">Tanggal Sekarang</label>
                                <div class="input-group">
                                    <input type="text" class="form-control" placeholder="mm/dd/yyyy" id="tgl_sekarang" name="tgl_sekarang" autocomplete="off" readonly>
                                    <span class="input-group-addon bg-custom b-0"><i class="mdi mdi-calendar text-white"></i></span>
                                </div>
                            </div>
                        </div>
                        <div class=""  id="start">
                            <div class="form-group">
                                <label for="tgl_mulai" class="form-label">Aktif Dari</label>
                                <div class="input-group">
                                    <input type="text" class="form-control" placeholder="mm/dd/yyyy" id="datepicker-autoclosea1" name="tgl_mulai" autocomplete="off">
                                    <span class="input-group-addon bg-custom b-0"><i class="mdi mdi-calendar text-white"></i></span>
                                </div>
                            </div>
                        </div>
                        <div class="" id="end">
                            <div class="form-group">
                                <label for="tgl_selesai" class="form-label">Sampai</label>
                                <div class="input-group">
                                    <input type="text" class="form-control" placeholder="mm/dd/yyyy" id="datepicker-autoclosea2" name="tgl_selesai" autocomplete="off">
                                    <span class="input-group-addon bg-custom b-0"><i class="mdi mdi-calendar text-white"></i></span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="modal-footer">
                    <button type="button" class="btn btn-light" data-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-info" name="submit" value="save">Save Changes</button>
                </div>
            </form>
</code>```

and this is the javascript:

```<code><script>
$("id_karyawan").on('change',function(e){
    var id_karyawan = $(this).val();
    $.ajax({
        type:"POST",
        url: '{{route('get.Tglmasuk')}}',
        data: {'id_karyawan':id_karyawan},
        dataType: 'json',
        success:function(data){
            var json = data,
            obj = JSON.parse(json);
            $('#tgl_masuk').val(obj.tgl_masuk);
        }
        // error: function(response) {
        //     alert(response.responseJSON.message);
        // }
    });
});
</code>```

Body:
I'm making a form for leave allocation, the form data consists of 2 table relations to table_karyawan and settingalokasi. when I select the kategori_cuti, tanggal_masuk form will appear where this form will be filled when the user selects nama_karyawan.

so the nama_karyawan and tanggal_masuk data come from the same table. I've tried to fetch the data using jquery ajax, but haven't been able to until now:
this is my controller for getTglmasuk:

 public function getTglmasuk(Request $request)
{
    try {
        $getTglmasuk = Karyawan::select('tgl_masuk')
        ->where('id', $request->id_karyawan)->first();

        if(!$getTglmasuk) {
            throw new \Exception('Data not found');
        }
        return response()->json($getTglmasuk);
    } catch (\Exception $e){
        return response()->json([
            'message' =>$e->getMessage()
        ], 500);
    }
}

and this is the route:

Route::post('/gettglmasuk', [AlokasicutiController::class, 'getTglmasuk'])->name('get.Tglmasuk');

this is the form in blade.php:

 <form class="input" action="{{route('alokasi.store')}}" method="POST" enctype="multipart/form-data">
                @csrf
                @method('POST')

                            Karyawan
                            <select name="id_karyawan" id="id_karyawan" class="form-control">
                                <option value="">Pilih Karyawan</option>
                                @foreach ($karyawan as $data)
                                    <option value="{{ $data->id }}">{{ $data->nama }}</option>
                                @endforeach
                            </select>

                            Kategori Cuti
                            <select name="id_jeniscuti" id="id_jeniscuti" class="form-control">
                                <option value="">Pilih Kategori Cuti</option>
                                    @foreach ($jeniscuti as $jenis)
                                        <option value="{{ $jenis->id }}">{{ $jenis->jenis_cuti }}</option>
                                    @endforeach
                            </select>

                            Durasi (Hari)
                                <input type="text" class="form-control" name="durasi" placeholder="durasi" id="durasi">

                            Mode Alokasi
                                <input type="text" class="form-control" name="mode_alokasi" placeholder="mode alokasi" id="mode_alokasi">

                                Tanggal Masuk

                                    <input type="text" class="form-control" placeholder="mm/dd/yyyy" id="tgl_masuk" name="tgl_masuk" autocomplete="off" readonly>

                                Tanggal Sekarang

                                    <input type="text" class="form-control" placeholder="mm/dd/yyyy" id="tgl_sekarang" name="tgl_sekarang" autocomplete="off" readonly>

                                Aktif Dari

                                    <input type="text" class="form-control" placeholder="mm/dd/yyyy" id="datepicker-autoclosea1" name="tgl_mulai" autocomplete="off">

                                Sampai

                                    <input type="text" class="form-control" placeholder="mm/dd/yyyy" id="datepicker-autoclosea2" name="tgl_selesai" autocomplete="off">

                    <button type="button" class="btn btn-light" data-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-info" name="submit" value="save">Save Changes</button>

            </form>

and this is the javascript:


问:
Inventory management python
I want to subtract current stock when releasing
I'm new to python I hope someone helps me with this problem

```<code>def Release_Materials():
print("==================")
print("Release Materials")
print("==================")
for item in inventory:
    item_index = int(input("what is the index of the item you would like to change? (type 0 to cancel): ")) - 1
    if item_index == "0":
        return
    if item_index < 0:
        return
    if check_valid_index(item_index) == False:
        print("")
        print("Error: The Index Does not exist! ")
        return
    else:
        break
    quantity = int(input("what is the quantity of item you would like to change? (type 0 to cancel): "))
    if quantity == "0":
        return
    if quantity < 0:
        return
    print(f"{inventory[item_index].get_name()} - OLD QUANTITY: {inventory[item_index].get_stock()}")
    inventory[item_index].update_stock(quantity)
    print(f"{inventory[item_index].get_name()} - NEW QUANTITY: {inventory[item_index].get_stock()}")
    print("Quantity Successfully Updated! ")
else:
    print("No items added yet! ")

MenuDisplay()
</code>```

enter image description here
Here is my full code
https://pastebin.pl/view/d4441a68

Title: Inventory management python

Body:
I want to subtract current stock when releasing
I'm new to python I hope someone helps me with this problem

def Release_Materials():
print("==================")
print("Release Materials")
print("==================")
for item in inventory:
    item_index = int(input("what is the index of the item you would like to change? (type 0 to cancel): ")) - 1
    if item_index == "0":
        return
    if item_index < 0:
        return
    if check_valid_index(item_index) == False:
        print("")
        print("Error: The Index Does not exist! ")
        return
    else:
        break
    quantity = int(input("what is the quantity of item you would like to change? (type 0 to cancel): "))
    if quantity == "0":
        return
    if quantity < 0:
        return
    print(f"{inventory[item_index].get_name()} - OLD QUANTITY: {inventory[item_index].get_stock()}")
    inventory[item_index].update_stock(quantity)
    print(f"{inventory[item_index].get_name()} - NEW QUANTITY: {inventory[item_index].get_stock()}")
    print("Quantity Successfully Updated! ")
else:
    print("No items added yet! ")

MenuDisplay()

enter image description here
Here is my full code
https://pastebin.pl/view/d4441a68


问:
Managing end point request/response objects and exception handling in spring controller?
I have written a controller to manage online shopping baskets(shopping carts). I would like to get feedback on where I can make improvements and exceptions that must be handled at the controller?

The controller allows adding items to a basket, removing items to a basket, viewing a basket.

Should I create a Response object for every api endpoint I have, is that good practise? For eg: GetBasketResponse, AddItemToBasketResponse, DeleteItemResponse

I have used some DTO objects to get values from client and pass values back to client? Is this the right approach to take

What kind of exceptions must I handle and how should I represent it to the end user? Should I have an object that stores the response along with any error message?

Appreciate any other feedback you might want to give to improve the below controller?

```<code>@RestController
@RequestMapping("/baskets")
public class BasketController {

 @Autowired
 private BasketService basketService;

 @GetMapping(value = "/{basketId}")
 public ResponseEntity<BasketDto> getBasket(@PathVariable("basketId") UUID basketId) {
     Basket basket = basketService.getBasket(basketId);
     BasketDto dto = toBasketDto(basket);
     ResponseEntity response = ResponseEntity.status(HttpStatus.OK).body(dto);
     return response;
 }

 @PostMapping(value = "/{basketId}/item")
 public ResponseEntity<BasketDto> addItemToBasket(@PathVariable("basketId") UUID basketId, @RequestBody ItemDto itemDto) {
     Item item = toItem(itemDto);
     basketService.addItemToBasket(basketId, item);
     Basket basket = basketService.getBasket(basketId);
     BasketDto dto = toBasketDto(basket);
     return ResponseEntity.status(HttpStatus.OK).body(dto);
 }

 @DeleteMapping(value = "/{basketId}/items/{itemId}")
 public ResponseEntity<Void> deleteItemFromBasket(@PathVariable("basketId") UUID basketId, @PathVariable("itemId") String itemId){
     if(basketService.removeItemFromBasket(basketId,itemId)) {
         return ResponseEntity.ok().build();
     }else{
         return ResponseEntity.badRequest().build();
     }
 }

 private Item toItem(ItemDto itemDto) {
     Item item = new Item(itemDto.getItemId(), itemDto.getUnitPrice(), itemDto.getQty());
     return item;
 }

 private BasketDto toBasketDto(Basket basket) {
     BasketDto dto = new BasketDto(basket.getBasketId(), basket.getItems());
     return dto;
 }
</code>```

Body:
I have written a controller to manage online shopping baskets(shopping carts). I would like to get feedback on where I can make improvements and exceptions that must be handled at the controller?

The controller allows adding items to a basket, removing items to a basket, viewing a basket.

Should I create a Response object for every api endpoint I have, is that good practise? For eg: GetBasketResponse, AddItemToBasketResponse, DeleteItemResponse

I have used some DTO objects to get values from client and pass values back to client? Is this the right approach to take

What kind of exceptions must I handle and how should I represent it to the end user? Should I have an object that stores the response along with any error message?

Appreciate any other feedback you might want to give to improve the below controller?

@RestController
@RequestMapping("/baskets")
public class BasketController {

 @Autowired
 private BasketService basketService;

 @GetMapping(value = "/{basketId}")
 public ResponseEntity<BasketDto> getBasket(@PathVariable("basketId") UUID basketId) {
     Basket basket = basketService.getBasket(basketId);
     BasketDto dto = toBasketDto(basket);
     ResponseEntity response = ResponseEntity.status(HttpStatus.OK).body(dto);
     return response;
 }

 @PostMapping(value = "/{basketId}/item")
 public ResponseEntity<BasketDto> addItemToBasket(@PathVariable("basketId") UUID basketId, @RequestBody ItemDto itemDto) {
     Item item = toItem(itemDto);
     basketService.addItemToBasket(basketId, item);
     Basket basket = basketService.getBasket(basketId);
     BasketDto dto = toBasketDto(basket);
     return ResponseEntity.status(HttpStatus.OK).body(dto);
 }

 @DeleteMapping(value = "/{basketId}/items/{itemId}")
 public ResponseEntity<Void> deleteItemFromBasket(@PathVariable("basketId") UUID basketId, @PathVariable("itemId") String itemId){
     if(basketService.removeItemFromBasket(basketId,itemId)) {
         return ResponseEntity.ok().build();
     }else{
         return ResponseEntity.badRequest().build();
     }
 }

 private Item toItem(ItemDto itemDto) {
     Item item = new Item(itemDto.getItemId(), itemDto.getUnitPrice(), itemDto.getQty());
     return item;
 }

 private BasketDto toBasketDto(Basket basket) {
     BasketDto dto = new BasketDto(basket.getBasketId(), basket.getItems());
     return dto;
 }


问:
Handing overloaded functions in Hardhat Ethers
I recently upgraded one of my ethereum governance contracts to support governance bravo compatibility.

```<code>contract GovernorBravoContract is
  Governor,
  GovernorSettings,
  //Added Compatibility instead of simple counting
  GovernorCompatibilityBravo,
  GovernorVotes,
  GovernorVotesQuorumFraction,
  GovernorTimelockControl
{
}
</code>```

I mostly did this because built some of my interface from the Uniswap frontend and they're using governor bravo.

I noticed when I upgraded my scripts starting to fail claiming there is no propose method:

```<code>const proposeTx = await governor.propose(
  [token.address],
  [0],
  [encodedFunctionCall],
  proposalDescription
)
</code>```

Governor Bravo Compatibility creates overloads for some of the methods Propose now had two method signatures:

```<code>"propose(address[],uint256[],bytes[],string)"
"propose(address[],uint256[],string[],bytes[],string)
</code>```

Which means that my calling code needs to address the proper method using the signature as the name:

```<code>const proposeTx = await governor["propose(address[],uint256[],bytes[],string)"](
  [token.address],
  [0],
  [encodedFunctionCall],
  proposalDescription
)
</code>```

This is trash and is going to reek havoc on my front end, I would prefer if ethers ignored one of the methods completely or if there was a hack in which I can call my methods normally, without having to update my calling code.

I was wondering if anyone had a good resolution for this problem

The only way I can think is to: override the binding of the methods to count the parameters, and then re-route the functions.

Body:
I recently upgraded one of my ethereum governance contracts to support governance bravo compatibility.

contract GovernorBravoContract is
  Governor,
  GovernorSettings,
  //Added Compatibility instead of simple counting
  GovernorCompatibilityBravo,
  GovernorVotes,
  GovernorVotesQuorumFraction,
  GovernorTimelockControl
{
}

I mostly did this because built some of my interface from the Uniswap frontend and they're using governor bravo.

I noticed when I upgraded my scripts starting to fail claiming there is no propose method:

const proposeTx = await governor.propose(
  [token.address],
  [0],
  [encodedFunctionCall],
  proposalDescription
)

Governor Bravo Compatibility creates overloads for some of the methods Propose now had two method signatures:

"propose(address[],uint256[],bytes[],string)"
"propose(address[],uint256[],string[],bytes[],string)

Which means that my calling code needs to address the proper method using the signature as the name:

const proposeTx = await governor["propose(address[],uint256[],bytes[],string)"](
  [token.address],
  [0],
  [encodedFunctionCall],
  proposalDescription
)

This is trash and is going to reek havoc on my front end, I would prefer if ethers ignored one of the methods completely or if there was a hack in which I can call my methods normally, without having to update my calling code.

I was wondering if anyone had a good resolution for this problem

The only way I can think is to: override the binding of the methods to count the parameters, and then re-route the functions.


问:
Querying Constraints
I'm looking for advice on some adjustment to this insert query.

The 2 tables are:

```<code>CREATE TABLE StorageUnit
(
    StorageID INT IDENTITY(1,1) NOT NULL,
    StorageName VARCHAR(45) NOT NULL,
    NoofRows INT NOT NULL
);

CREATE TABLE ItemRecord
(
    ItemID INT IDENTITY(1,1) NOT NULL,
    ItemName VARCHAR(45) NOT NULL,
    ItemDesc VARCHAR(200),
    StorageID INT NOT NULL,
    RowNo INT,
    LocationDesc VARCHAR(200),
    IMGLink nVarchar(MAX),
    PRIMARY KEY (ItemID)
    FOREIGN KEY (StorageID) REFERENCES [dbo].[StorageUnit](StorageID)
);
</code>```

The current insert query inserts values into the table ensuring no duplicate records.

```<code>INSERT INTO [dbo].[ItemRecord]
    SELECT ItemName, ItemDesc, StorageID, RowNo, LocationDesc, IMGLink
    FROM (VALUES ('Screw', 'Philipshead', 4, 2, 'Somewhere','')
         ) V(ItemName, ItemDesc, StorageID, RowNo, LocationDesc, IMGLink)
    WHERE NOT EXISTS (SELECT 1 FROM [dbo].[ItemRecord] deil
                      WHERE deil.ItemDesc = V.ItemDesc
                        AND deil.ItemName = V.ItemName
                        AND deil.StorageID = V.StorageID
                        AND deil.RowNo = V.RowNo
                        AND deil.LocationDesc = V.LocationDesc);
</code>```

How would I go about ensuring that the value of StorageID is present in the StorageUnit table and ensuring that the Rowno entered is less or equal to the NoofRows for its respective StorageID?

Title: Querying Constraints

Body:
I'm looking for advice on some adjustment to this insert query.

The 2 tables are:

CREATE TABLE StorageUnit
(
    StorageID INT IDENTITY(1,1) NOT NULL,
    StorageName VARCHAR(45) NOT NULL,
    NoofRows INT NOT NULL
);

CREATE TABLE ItemRecord
(
    ItemID INT IDENTITY(1,1) NOT NULL,
    ItemName VARCHAR(45) NOT NULL,
    ItemDesc VARCHAR(200),
    StorageID INT NOT NULL,
    RowNo INT,
    LocationDesc VARCHAR(200),
    IMGLink nVarchar(MAX),
    PRIMARY KEY (ItemID)
    FOREIGN KEY (StorageID) REFERENCES [dbo].[StorageUnit](StorageID)
);

The current insert query inserts values into the table ensuring no duplicate records.

INSERT INTO [dbo].[ItemRecord]
    SELECT ItemName, ItemDesc, StorageID, RowNo, LocationDesc, IMGLink
    FROM (VALUES ('Screw', 'Philipshead', 4, 2, 'Somewhere','')
         ) V(ItemName, ItemDesc, StorageID, RowNo, LocationDesc, IMGLink)
    WHERE NOT EXISTS (SELECT 1 FROM [dbo].[ItemRecord] deil
                      WHERE deil.ItemDesc = V.ItemDesc
                        AND deil.ItemName = V.ItemName
                        AND deil.StorageID = V.StorageID
                        AND deil.RowNo = V.RowNo
                        AND deil.LocationDesc = V.LocationDesc);

How would I go about ensuring that the value of StorageID is present in the StorageUnit table and ensuring that the Rowno entered is less or equal to the NoofRows for its respective StorageID?


问:
Flutter - Android sdk 31 Upgrade - Waiting for observatory port to be available
I'm upgrading android sdk targetSdkVersion to 31 from 30 in android/app/build.gradle file for a flutter application.

Added exported false tag to main/Androidmanifest.xml file as well.

```<code><activity
    android:name=".MainActivity"
    android:exported="false" />
</code>```

When the application is running, it get stuck and the error is

```<code>       Error type 3
       Error: Activity class {com.test.qa/com.test.MainActivity} does not exist.
</code>```

[        ] Waiting for observatory port to be available...

Note that app works fine for sdk version 30.

Body:
I'm upgrading android sdk targetSdkVersion to 31 from 30 in android/app/build.gradle file for a flutter application.

Added exported false tag to main/Androidmanifest.xml file as well.

<activity
    android:name=".MainActivity"
    android:exported="false" />

When the application is running, it get stuck and the error is

       Error type 3
       Error: Activity class {com.test.qa/com.test.MainActivity} does not exist.

[        ] Waiting for observatory port to be available...

Note that app works fine for sdk version 30.


问:
Does any know how UE calculate the rayleigh scattering coefficient？
In the file "SkyAtmosphereComponent.cpp", I've found the rayleigh scattering coefficient:

const FLinearColor RayleightScatteringRaw = FLinearColor(0.005802f, 0.013558f, 0.033100f);

But UE don't tell what the formula it bases on, only the numbers...

So I tried to figure out the formula. There is a link about the math which inside SkyAtmosphere:
https://www.alanzucconi.com/2017/10/10/atmospheric-scattering-3/#:~:text=Rayleigh%20Scattering%20Coefficient&text=indicates%20the%20fraction%20of%20the,as%20the%20Rayleigh%20scattering%20coefficient.

and I've written a python code to solve it:

```<code>import math
def beta(wavelength):
    w = wavelength / 1000000000
    PI = 3.1415926
    n = 1.00029
    N = 2.504e25
    val = (8 * (PI ** 3) * ((n * n - 1) ** 2))/ (3 * N * (w**4))
    print ('{:.11f}'.format(val))

    return val

r = beta(680)
g = beta(550)
b = beta(440)

</code>```

The result of above code is the same with the article:

```<code>0.00000519673
0.00001214270
0.00002964526
</code>```

Then, when I compare these number to the UE's，I found there is a scale between them：

```<code>print(r/0.005802, g/0.013558, b/0.033100)
# output
# 1116.4710036505135 1116.555873783846 1116.5361088177956
</code>```

so the question is, what is the UE's formula? Where does the 1116 comes from?

Body:
In the file "SkyAtmosphereComponent.cpp", I've found the rayleigh scattering coefficient:

const FLinearColor RayleightScatteringRaw = FLinearColor(0.005802f, 0.013558f, 0.033100f);

But UE don't tell what the formula it bases on, only the numbers...

So I tried to figure out the formula. There is a link about the math which inside SkyAtmosphere:
https://www.alanzucconi.com/2017/10/10/atmospheric-scattering-3/#:~:text=Rayleigh%20Scattering%20Coefficient&text=indicates%20the%20fraction%20of%20the,as%20the%20Rayleigh%20scattering%20coefficient.

and I've written a python code to solve it:

import math
def beta(wavelength):
    w = wavelength / 1000000000
    PI = 3.1415926
    n = 1.00029
    N = 2.504e25
    val = (8 * (PI ** 3) * ((n * n - 1) ** 2))/ (3 * N * (w**4))
    print ('{:.11f}'.format(val))

    return val

r = beta(680)
g = beta(550)
b = beta(440)

The result of above code is the same with the article:

0.00000519673
0.00001214270
0.00002964526

Then, when I compare these number to the UE's，I found there is a scale between them：

print(r/0.005802, g/0.013558, b/0.033100)
# output
# 1116.4710036505135 1116.555873783846 1116.5361088177956

so the question is, what is the UE's formula? Where does the 1116 comes from?


问:
how to get either price or offer price using project stage in mongodb
I have a product collection , in this product collection i have price field and offer-price field followed by offer_start_date and offer_end_date i need to get one offer-price in project stage of aggregation if it fall between start date and end date otherwise need price</p>


问:
Provide instance instantiated in parent fragment to @Inject in children fragments in Dagger/Hilt
I am instantiating a service in a fragment that uses its childFragmentManager to add child fragments within it's view. I'd like for these child fragments to @Inject the same instance of that service that was created by the parent.

I have a parent fragment like so:

```<code>@AndroidEntrypoint
class ParentFragment : Hilt_ParentFragment {
  var service: SomeService = SomeService(/* ... */)

  // ...

  childFragmentManager.commit {
    add(R.id.container, ChildFragment())
  }
}

</code>```

And I have a child fragment like so:

```<code>@AndroidEntrypoint
class ChildFragment : Hilt_ChildFragment {
  @Inject lateinit var service: SomeService
}
</code>```

How can I set this up so that the ChildFragment injects SomeService from the instance instantiated by the ParentFragment?

Body:
I am instantiating a service in a fragment that uses its childFragmentManager to add child fragments within it's view. I'd like for these child fragments to @Inject the same instance of that service that was created by the parent.

I have a parent fragment like so:

@AndroidEntrypoint
class ParentFragment : Hilt_ParentFragment {
  var service: SomeService = SomeService(/* ... */)

  // ...

  childFragmentManager.commit {
    add(R.id.container, ChildFragment())
  }
}

And I have a child fragment like so:

@AndroidEntrypoint
class ChildFragment : Hilt_ChildFragment {
  @Inject lateinit var service: SomeService
}

How can I set this up so that the ChildFragment injects SomeService from the instance instantiated by the ParentFragment?


问:
Merging a Files
My goal to achieve merge long files 500 mb to 1gb File. i have merged all files but the issue is Write a file but memory usage is very low then app crashed. Can you guide me how to cattle this problem.if i merged 46 files then some time show didReceiveLowWarning and some time app is crashed because virtual memory very low Kindly Help and my Code is

```<code>  fileprivate func recursiveFunctionforMergeMultipleFiles(firstFile:URL,secondURl:URL,outputUrl:URL) -> URL
    {
        let filedocument1 = PDFDocument(url: firstFile)
        let pdfdocument2 = PDFDocument(url: secondURl)
        filedocument1?.addPages(from: pdfdocument2!)
        filedocument1?.write(to: outputUrl)
        return outputUrl
    }
</code>```
```<code>extension PDFDocument {

    func addPages(from document: PDFDocument) {
            let pageCountAddition = document.pageCount

            for pageIndex in 0..<pageCountAddition {
                guard let addPage = document.page(at: pageIndex) else {
                    break
                }
                self.insert(addPage, at: pageIndex) // unfortunately this is very very confusing. The index is the page *after* the insertion. Every normal programmer would assume insert at self.pageCount-1

            }
        }

    }
</code>```

i have tried multiple resource to merge but this one is best

Title: Merging a Files

Body:
My goal to achieve merge long files 500 mb to 1gb File. i have merged all files but the issue is Write a file but memory usage is very low then app crashed. Can you guide me how to cattle this problem.if i merged 46 files then some time show didReceiveLowWarning and some time app is crashed because virtual memory very low Kindly Help and my Code is

  fileprivate func recursiveFunctionforMergeMultipleFiles(firstFile:URL,secondURl:URL,outputUrl:URL) -> URL
    {
        let filedocument1 = PDFDocument(url: firstFile)
        let pdfdocument2 = PDFDocument(url: secondURl)
        filedocument1?.addPages(from: pdfdocument2!)
        filedocument1?.write(to: outputUrl)
        return outputUrl
    }

extension PDFDocument {

    func addPages(from document: PDFDocument) {
            let pageCountAddition = document.pageCount

            for pageIndex in 0..<pageCountAddition {
                guard let addPage = document.page(at: pageIndex) else {
                    break
                }
                self.insert(addPage, at: pageIndex) // unfortunately this is very very confusing. The index is the page *after* the insertion. Every normal programmer would assume insert at self.pageCount-1

            }
        }

    }

i have tried multiple resource to merge but this one is best


问:
How to extract xpath with a colon character?
<item> <g:id>NS60</g:id> <g:title>Disc Lock</g:title>' </item>
How do I get the id and title value on this example since it got a colon? I'm doing this on Google Sheet using the 'importxml' function.

I've tried '//title/@g:id' to no avail.


问:
unable to install javabridge with pip on macOS Monterey (m1)
when trying to install with "python3 -m pip install javabridge"
i get a very long error message that ends with this

```<code>   25 warnings and 2 errors generated.
    error: command '/usr/bin/clang' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8h/hkmcg37d1_b6f6jq7qlhzzk00000gn/T/pip-install-uw2m_ckh/javabridge_c69e21afe5d44091bab36d7f0fddc92d/setup.py'"'"'; __file__='"'"'/private/var/folders/8h/hkmcg37d1_b6f6jq7qlhzzk00000gn/T/pip-install-uw2m_ckh/javabridge_c69e21afe5d44091bab36d7f0fddc92d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/8h/hkmcg37d1_b6f6jq7qlhzzk00000gn/T/pip-record-1kv_6_sp/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/zeke/Library/Python/3.9/include/python3.9/javabridge Check the logs for full command output.
</code>```

I have tried deleting later versions of java and re-downloading the java jdks and i made sure i have both the jre8 and jdk8 installed

Body:
when trying to install with "python3 -m pip install javabridge"
i get a very long error message that ends with this

   25 warnings and 2 errors generated.
    error: command '/usr/bin/clang' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8h/hkmcg37d1_b6f6jq7qlhzzk00000gn/T/pip-install-uw2m_ckh/javabridge_c69e21afe5d44091bab36d7f0fddc92d/setup.py'"'"'; __file__='"'"'/private/var/folders/8h/hkmcg37d1_b6f6jq7qlhzzk00000gn/T/pip-install-uw2m_ckh/javabridge_c69e21afe5d44091bab36d7f0fddc92d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/8h/hkmcg37d1_b6f6jq7qlhzzk00000gn/T/pip-record-1kv_6_sp/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/zeke/Library/Python/3.9/include/python3.9/javabridge Check the logs for full command output.

I have tried deleting later versions of java and re-downloading the java jdks and i made sure i have both the jre8 and jdk8 installed


问:
How to know is the react application is already running in browser on a different tab
I am learning react functional components just trying a scenario where i  need to know is the application already loaded in bowser some other tab for example say below is the component

```<code>import { useEffect, useState } from "react";

function RefreshPage(){
    const [isLoad,SetIsLoad]=useState(false)

    return(
        <div>Hii</div>
    )

}

export default RefreshPage;
</code>```

which is running if i open the application again on different tab of browser then i need to know that application is already running in other tab please provide pointers to achieve this

Body:
I am learning react functional components just trying a scenario where i  need to know is the application already loaded in bowser some other tab for example say below is the component

import { useEffect, useState } from "react";

function RefreshPage(){
    const [isLoad,SetIsLoad]=useState(false)

    return(

Hii

    )

}

export default RefreshPage;

which is running if i open the application again on different tab of browser then i need to know that application is already running in other tab please provide pointers to achieve this


问:
Using INDIRECT to dynamically select a cell in a sheet in a different workbook
I am trying to reference a cell ($C$3) in a sheet in a different workbook dynamically. For example, lets say I have a column of the sheet names in Workbook1 (C4:C35) in Workbook2. Using a cell in Workbook2, how could I get find a cell in Workbook1 while going down each record of sheet names in Workbook1 (C4:C35) in Workbook2. It might make more sense if I type out what I think the answer should be using indirect (could use something else, but this just came to mind first).

Typical format:

```<code>='[Workbook1.xlsx]Sheet1'!$C$3
</code>```

What I think the answer should be, but it doesn't work:

```<code>= INDIRECT ( “ ‘ “ & A5 & C4 & “ ‘ ! “ & $C$3 )
</code>```

Cell Values:

```<code>A5 = [Workbook1.xlsx]
C4 = Start of column of sheets in Workbook2 (C4) (out of C4:C35)
$C$3 = The cell I want to retrieve
</code>```

I'm using a cell for the other workbook because indirect doesn't like the brackets. I am also using extra spaces so it's easier to read the indirect.

Body:
I am trying to reference a cell ($C$3) in a sheet in a different workbook dynamically. For example, lets say I have a column of the sheet names in Workbook1 (C4:C35) in Workbook2. Using a cell in Workbook2, how could I get find a cell in Workbook1 while going down each record of sheet names in Workbook1 (C4:C35) in Workbook2. It might make more sense if I type out what I think the answer should be using indirect (could use something else, but this just came to mind first).

Typical format:

='[Workbook1.xlsx]Sheet1'!$C$3

What I think the answer should be, but it doesn't work:

= INDIRECT ( “ ‘ “ & A5 & C4 & “ ‘ ! “ & $C$3 )

Cell Values:

A5 = [Workbook1.xlsx]
C4 = Start of column of sheets in Workbook2 (C4) (out of C4:C35)
$C$3 = The cell I want to retrieve

I'm using a cell for the other workbook because indirect doesn't like the brackets. I am also using extra spaces so it's easier to read the indirect.


问:
Is possible to create Next.js Static pages during Build time?
I want to create a google forms clone, in this project there will be a page to create forms, to prevent storing big texts in database, for example the statements of questions, I want to know if there is possible that in this page I can fill the forms info and generate a static html with that info, during production.

I tried to research about it but couldn't find anything.


问:
X-Frame option to same origin issue
enter image description hereWe are getting x-frame option to same origin issue while using tableau extension. We are using tomcat server. Please refer the image.

Thanks,
Raja.

We deployed our code in tomcat server. Tableau extension is not working after publishing the report to the server.

Title: X-Frame option to same origin issue


问:
Why do browsers and Node.js parse URLs with custom schemes differently with "new URL(...)"?
Different browsers and JS runtimes behave differently when parsing URLs with custom schemes (that is, non-special schemes like "http"). For instance, parsing "test://example" with new URL('test://example') produces:

Runtime
url.hostname
url.pathname

Node.js 19
'example'
''

Chrome 108
''
'//example'

Firefox 108
''
'//example'

Safari 16
'example'
''

Why is there this difference and are both parsings valid or are some of the runtimes not spec compliant?


问:
How to allow external AD guest user to use the analyze in excel feature?
I have published Power BI reports into a Power BI app.

I have given the app access to a Azure security group.

I am being asked to allow couple of external AD users to access the app and also to use the analyze in excel feature.

Is the following a solution:

Add external AD users into our AD

Create a new security group with the above external AD users as members

Enable Allow Azure Active Directory guest users to access Power BI in tenant settings

Will that allow external AD users to use the power bi app and analyze in excel feature?