问:
How to connect wifi with NetworkSpecifier?
Permission(AndroidManifest.xml)

```<code><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
</code>```

WifiConnector.kt

```<code>    val builder = WifiNetworkSpecifier.Builder()
    builder.setSsid("test1234")
    builder.setWpa2Passphrase("12345678")

    val wifiNetworkSpecifier = builder.build()

    val networkRequestBuilder1 = NetworkRequest.Builder()
    networkRequestBuilder1.addTransportType(NetworkCapabilities.TRANSPORT_WIFI)
    networkRequestBuilder1.setNetworkSpecifier(wifiNetworkSpecifier)

    val nr = networkRequestBuilder1.build()
    val cm = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager

    val networkCallback = object : ConnectivityManager.NetworkCallback() {
        override fun onAvailable(network: Network) {
            super.onAvailable(network)
            cm.bindProcessToNetwork(network)
        }
    }

    cm.requestNetwork(nr, networkCallback);
</code>```

Test device android version

Android API 29

Hello
I used WifiNetworkSpecifier to connect to a specific Wifi.

https://developer.android.com/guide/topics/connectivity/wifi-bootstrap

I made it by referring to the document

The message appears.

"Something came up. The application has cancelled the request to choose a device"

I think the app is printing the message because it doesn't have the necessary permissions to connect to WiFi.
If you know why it's not working, please let me know

Body:
Permission(AndroidManifest.xml)

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

WifiConnector.kt

    val builder = WifiNetworkSpecifier.Builder()
    builder.setSsid("test1234")
    builder.setWpa2Passphrase("12345678")

    val wifiNetworkSpecifier = builder.build()

    val networkRequestBuilder1 = NetworkRequest.Builder()
    networkRequestBuilder1.addTransportType(NetworkCapabilities.TRANSPORT_WIFI)
    networkRequestBuilder1.setNetworkSpecifier(wifiNetworkSpecifier)

    val nr = networkRequestBuilder1.build()
    val cm = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager

    val networkCallback = object : ConnectivityManager.NetworkCallback() {
        override fun onAvailable(network: Network) {
            super.onAvailable(network)
            cm.bindProcessToNetwork(network)
        }
    }

    cm.requestNetwork(nr, networkCallback);

Test device android version

Android API 29

Hello
I used WifiNetworkSpecifier to connect to a specific Wifi.

https://developer.android.com/guide/topics/connectivity/wifi-bootstrap

I made it by referring to the document

The message appears.

"Something came up. The application has cancelled the request to choose a device"

I think the app is printing the message because it doesn't have the necessary permissions to connect to WiFi.
If you know why it's not working, please let me know


来源: stackexchange

问:
I'm writing el-tree using vuejs,it doesn't select what i checked
I'm writing el-tree using vuejs,it doesn't select what i checked.
anyone knows why?

enter image description here

```<code><el-tree
  class="tree-border"
  :data="menuOptions"
  show-checkbox
  ref="menu"
  node-key="id"
  :check-strictly="form.menuCheckStrictly"
  empty-text="Loading, please wait"
  :props="defaultProps"
></el-tree>
</code>```
```<code>created() {
  this.handleUpdate();
  const userId = this.$route.params && this.$route.params.userId;
  if (userId) {
    getAuthUserMenu(userId).then((response) => {
      this.form = response.user;
      this.$nextTick(() => {
      let checkedKeys = response.checkedKeys
      checkedKeys.forEach((value) => {
        this.$nextTick(()=>{
          this.$refs.menu.setChecked(value, true ,false);
        })
      })
      });
    });
  }
},
</code>```

I try to select from the tree component.
I expect that seleted what i choose.

ContentLicense: CC BY-SA 4.0

Body:
I'm writing el-tree using vuejs,it doesn't select what i checked.
anyone knows why?

enter image description here

<el-tree
  class="tree-border"
  :data="menuOptions"
  show-checkbox
  ref="menu"
  node-key="id"
  :check-strictly="form.menuCheckStrictly"
  empty-text="Loading, please wait"
  :props="defaultProps"
></el-tree>

created() {
  this.handleUpdate();
  const userId = this.$route.params && this.$route.params.userId;
  if (userId) {
    getAuthUserMenu(userId).then((response) => {
      this.form = response.user;
      this.$nextTick(() => {
      let checkedKeys = response.checkedKeys
      checkedKeys.forEach((value) => {
        this.$nextTick(()=>{
          this.$refs.menu.setChecked(value, true ,false);
        })
      })
      });
    });
  }
},

I try to select from the tree component.
I expect that seleted what i choose.


问:
tailwinds css some class not generate css ,,,,but some class work and some class not working
```<code><div className='w-[100%] h-[250px] absolute bg-[#603760] top-0 left-0'></div>
</code>```

here is my code there element didn't get height and background

```<code>
`
/** @type {import('tailwindcss').Config} */
module.exports = {

  content: [
    "./app/**/*.{js,ts,jsx,tsx}",
    "./pages/**/*.{js,ts,jsx,tsx}",
    "./components/**/*.{js,ts,jsx,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [
    require('tailwindcss'),
    require('autoprefixer'),
  ],
</code>```

this is my tailwind.config.js file

Body:
here is my code there element didn't get height and background

`
/** @type {import('tailwindcss').Config} */
module.exports = {

  content: [
    "./app/**/*.{js,ts,jsx,tsx}",
    "./pages/**/*.{js,ts,jsx,tsx}",
    "./components/**/*.{js,ts,jsx,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [
    require('tailwindcss'),
    require('autoprefixer'),
  ],

this is my tailwind.config.js file


问:
my channel dose not find in awesome_notifications flutter
Hi I want create app with GetX and awesome_notifications, But after i click on button this error is show:
how can fix this? please help.

W/Android: Awesome Notifications: Channel model
'basic_channel' was not found (ChannelManager:88) E/Android: Awesome
Notifications: Channel 'basic_channel' does not exist
(NotificationBuilder:58)

this is my controller for the app:

```<code>class HomeScreenController extends GetxController {
  RxString verb = "".obs;
  RxBool check = false.obs;

  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();

    checkOffOn();
    random();

  }

  static void initializeNotificationService() {
    AwesomeNotifications().initialize("assets/images/notification.png", [
      NotificationChannel(
        channelKey: 'basic_channel',
        channelName: 'Basic Notifications',
        defaultColor: Colors.teal,
        importance: NotificationImportance.Max,
        channelShowBadge: true,
        channelDescription: 'show positive energy every day',
        enableVibration: true,
        enableLights: true,
        //playSound: true,
        //soundSource: ""
      ),
    ]);
  }
 void random() {
    final random = Random();
    verb.value = EnergyList[random.nextInt(EnergyList.length)].sentences;
  }

  void checkOffOn() {
    AwesomeNotifications().isNotificationAllowed().then((isAllowed) {
      if (!isAllowed) {
        check.value = false;
      } else {
        check.value = true;
      }
    });
  }
 void notification() {
    AwesomeNotifications().isNotificationAllowed().then((isAllowed) {
      if (!isAllowed) {
        Get.defaultDialog(
          title: "اعلان ها",
          middleText: 'به برنامه اجازه نمایش اعلان را می دهید؟',
          backgroundColor: Colors.greenAccent,
          textConfirm: 'اجازه می دم',
          cancelTextColor: Colors.black,
          confirmTextColor: Colors.black,
          textCancel: 'بی خیالش',
          buttonColor: Colors.yellowAccent,
          titleStyle: const TextStyle(
              fontSize: 40,
              fontWeight: FontWeight.bold,
              color: Colors.black,
              height: 2),
          middleTextStyle: const TextStyle(
            fontSize: 25,
            color: Colors.black,
          ),
          onConfirm: () {
            check.value = true;
            AwesomeNotifications().requestPermissionToSendNotifications();
            Get.back();
          },
        );
      } else {
        Get.defaultDialog(
          title: "اعلان ها",
          middleText: 'آیا می خواهید اعلان ها متوقف شود؟',
          backgroundColor: Colors.greenAccent,
          textConfirm: 'آره بشه',
          cancelTextColor: Colors.black,
          confirmTextColor: Colors.black,
          textCancel: 'نه بذار باشه',
          buttonColor: Colors.yellowAccent,
          titleStyle: const TextStyle(
              fontSize: 40,
              fontWeight: FontWeight.bold,
              color: Colors.black,
              height: 2),
          middleTextStyle: const TextStyle(
            fontSize: 25,
            color: Colors.black,
          ),
          onConfirm: () {
            check.value = false;
            AwesomeNotifications()
                .cancelNotificationsByChannelKey('basic_channel');
            Get.back();
          },
        );
      }
    });
  }

  Future<void> createNotification() async {
    await AwesomeNotifications().createNotification(
      content: NotificationContent(
        id: DateTime.now().microsecond,
        channelKey: 'basic_channel',
        title: "پیام روز",
        body: "تست",
        backgroundColor: Colors.tealAccent,
        color: Colors.black,
        displayOnForeground: true,
        wakeUpScreen: true,
      ),
    );
  }
}
</code>```

and this is my home screen button code:

```<code>ElevatedButton(
                    onPressed: () {
                      controller.createNotification();
                    },
                    child: const Text('تست'),
                  ),
</code>```

Body:
Hi I want create app with GetX and awesome_notifications, But after i click on button this error is show:
how can fix this? please help.

W/Android: Awesome Notifications: Channel model
'basic_channel' was not found (ChannelManager:88) E/Android: Awesome
Notifications: Channel 'basic_channel' does not exist
(NotificationBuilder:58)

this is my controller for the app:

class HomeScreenController extends GetxController {
  RxString verb = "".obs;
  RxBool check = false.obs;

  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();

    checkOffOn();
    random();

  }

  static void initializeNotificationService() {
    AwesomeNotifications().initialize("assets/images/notification.png", [
      NotificationChannel(
        channelKey: 'basic_channel',
        channelName: 'Basic Notifications',
        defaultColor: Colors.teal,
        importance: NotificationImportance.Max,
        channelShowBadge: true,
        channelDescription: 'show positive energy every day',
        enableVibration: true,
        enableLights: true,
        //playSound: true,
        //soundSource: ""
      ),
    ]);
  }
 void random() {
    final random = Random();
    verb.value = EnergyList[random.nextInt(EnergyList.length)].sentences;
  }

  void checkOffOn() {
    AwesomeNotifications().isNotificationAllowed().then((isAllowed) {
      if (!isAllowed) {
        check.value = false;
      } else {
        check.value = true;
      }
    });
  }
 void notification() {
    AwesomeNotifications().isNotificationAllowed().then((isAllowed) {
      if (!isAllowed) {
        Get.defaultDialog(
          title: "اعلان ها",
          middleText: 'به برنامه اجازه نمایش اعلان را می دهید؟',
          backgroundColor: Colors.greenAccent,
          textConfirm: 'اجازه می دم',
          cancelTextColor: Colors.black,
          confirmTextColor: Colors.black,
          textCancel: 'بی خیالش',
          buttonColor: Colors.yellowAccent,
          titleStyle: const TextStyle(
              fontSize: 40,
              fontWeight: FontWeight.bold,
              color: Colors.black,
              height: 2),
          middleTextStyle: const TextStyle(
            fontSize: 25,
            color: Colors.black,
          ),
          onConfirm: () {
            check.value = true;
            AwesomeNotifications().requestPermissionToSendNotifications();
            Get.back();
          },
        );
      } else {
        Get.defaultDialog(
          title: "اعلان ها",
          middleText: 'آیا می خواهید اعلان ها متوقف شود؟',
          backgroundColor: Colors.greenAccent,
          textConfirm: 'آره بشه',
          cancelTextColor: Colors.black,
          confirmTextColor: Colors.black,
          textCancel: 'نه بذار باشه',
          buttonColor: Colors.yellowAccent,
          titleStyle: const TextStyle(
              fontSize: 40,
              fontWeight: FontWeight.bold,
              color: Colors.black,
              height: 2),
          middleTextStyle: const TextStyle(
            fontSize: 25,
            color: Colors.black,
          ),
          onConfirm: () {
            check.value = false;
            AwesomeNotifications()
                .cancelNotificationsByChannelKey('basic_channel');
            Get.back();
          },
        );
      }
    });
  }

  Future<void> createNotification() async {
    await AwesomeNotifications().createNotification(
      content: NotificationContent(
        id: DateTime.now().microsecond,
        channelKey: 'basic_channel',
        title: "پیام روز",
        body: "تست",
        backgroundColor: Colors.tealAccent,
        color: Colors.black,
        displayOnForeground: true,
        wakeUpScreen: true,
      ),
    );
  }
}

and this is my home screen button code:

ElevatedButton(
                    onPressed: () {
                      controller.createNotification();
                    },
                    child: const Text('تست'),
                  ),


问:
Http 500 error in soap API java due to jaxb jar file
One of my soapAPI was giving HTTP 500 error. when we searched in log we got the below issue.

```<code>Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'validator'. Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)
</code>```

To remove this issue we put below jar in our pom.xml

```<code><dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>2.2.11</version>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-core</artifactId>
        <version>2.2.11</version>
    </dependency>
</code>```

and this issue gone. But unfortunately code is creating problem in other places. The functionality which were working earlier now giving http 500 error. When we remove the above jar the original issues comes but new issue vanished.

Are we doing some mistake by including above jar files? is there any guess to get it done? I know issue seems somewhat strange but it is coming like this only. We are using java 8 , jsp and struts.

We did not do any code changes.

Body:
One of my soapAPI was giving HTTP 500 error. when we searched in log we got the below issue.

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'validator'. Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)

To remove this issue we put below jar in our pom.xml

<dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>2.2.11</version>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-core</artifactId>
        <version>2.2.11</version>
    </dependency>

and this issue gone. But unfortunately code is creating problem in other places. The functionality which were working earlier now giving http 500 error. When we remove the above jar the original issues comes but new issue vanished.

Are we doing some mistake by including above jar files? is there any guess to get it done? I know issue seems somewhat strange but it is coming like this only. We are using java 8 , jsp and struts.

We did not do any code changes.


问:
Facing invalid path error when I tried to get a new remote branch created by a mac user to my local windows
Tried multiple ways but getting following error.

```<code>error: invalid path 'build\ios/Runner.build/Release-iphoneos/Runner.build/dgph'
</code>```

Please let me know if you need additional information. Thanks.

Body:
Tried multiple ways but getting following error.

error: invalid path 'build\ios/Runner.build/Release-iphoneos/Runner.build/dgph'

Please let me know if you need additional information. Thanks.


问:
How to unify and manage overloaded functions?
This code works by taking a function as a parameter and using try-catch to log the result of the function.

When I change the functionDecorator here, I want the changes to be applied automatically to functionDecorator<T> or functionDecorator<T1, T2> without copying the entire code as it is now

These functions that do almost the same thing Is there a way to manage each other's behavior in one place, including even try-catch statements?

```<code>        public void funtionDecorator(Func<bool> Func, string successText = "success", string failText = "fail", string errorText = "error")
        {
            try
            {
                if (Func())
                {
                    txtStatusBar.Text = successText;
                }
                else
                {
                    txtStatusBar.Text = failText;
                }
            }
            catch(Exception ex)
            {
                txtStatusBar.Text = errorText + Func.Method.Name + ex.ToString();
            }
        }

        // ex : funtionDecorator<DataTable>(useDataFuntion, dt);
        public void funtionDecorator<T>(Func<T, bool> Func, T type, string successText = "success", string failText = "fail", string errorText = "error")
        {
            try
            {
                if (Func(type))
                {
                    txtStatusBar.Text = successText;
                }
                else
                {
                    txtStatusBar.Text = failText;
                }
            }
            catch (Exception ex)
            {
                txtStatusBar.Text = errorText + Func.Method.Name + ex.ToString();
            }
        }

        // ex : funtionDecorator<DataTable, Double>(useDataFuntion, dt, value);
        public void funtionDecorator<T1, T2>(Func<T1, T2, bool> Func, T1 type1, T2 type2, string successText = "success", string failText = "fail", string errorText = "error")
        {
            try
            {
                if (Func(type1, type2))
                {
                    txtStatusBar.Text = successText;
                }
                else
                {
                    txtStatusBar.Text = failText;
                }
            }
            catch (Exception ex)
            {
                txtStatusBar.Text = errorText + Func.Method.Name + ex.ToString();
            }
        }
</code>```

I tried to handle it dynamically using dynamic, but the function type was not converted to dynamic, so I couldn't find a way.

Body:
This code works by taking a function as a parameter and using try-catch to log the result of the function.

When I change the functionDecorator here, I want the changes to be applied automatically to functionDecorator<T> or functionDecorator<T1, T2> without copying the entire code as it is now

These functions that do almost the same thing Is there a way to manage each other's behavior in one place, including even try-catch statements?

        public void funtionDecorator(Func<bool> Func, string successText = "success", string failText = "fail", string errorText = "error")
        {
            try
            {
                if (Func())
                {
                    txtStatusBar.Text = successText;
                }
                else
                {
                    txtStatusBar.Text = failText;
                }
            }
            catch(Exception ex)
            {
                txtStatusBar.Text = errorText + Func.Method.Name + ex.ToString();
            }
        }

        // ex : funtionDecorator<DataTable>(useDataFuntion, dt);
        public void funtionDecorator<T>(Func<T, bool> Func, T type, string successText = "success", string failText = "fail", string errorText = "error")
        {
            try
            {
                if (Func(type))
                {
                    txtStatusBar.Text = successText;
                }
                else
                {
                    txtStatusBar.Text = failText;
                }
            }
            catch (Exception ex)
            {
                txtStatusBar.Text = errorText + Func.Method.Name + ex.ToString();
            }
        }

        // ex : funtionDecorator<DataTable, Double>(useDataFuntion, dt, value);
        public void funtionDecorator<T1, T2>(Func<T1, T2, bool> Func, T1 type1, T2 type2, string successText = "success", string failText = "fail", string errorText = "error")
        {
            try
            {
                if (Func(type1, type2))
                {
                    txtStatusBar.Text = successText;
                }
                else
                {
                    txtStatusBar.Text = failText;
                }
            }
            catch (Exception ex)
            {
                txtStatusBar.Text = errorText + Func.Method.Name + ex.ToString();
            }
        }

I tried to handle it dynamically using dynamic, but the function type was not converted to dynamic, so I couldn't find a way.


问:
Flutter: Image instance from CameraImage with format ImageFormatGroup.jpeg
I'm using flutter camera library and
want to create Image instance from CameraImage which format is ImageFormatGroup.jpeg.</p>


问:
Flask Socket application deployment using nginx and gunicorn in Ubuntu 22.04 is not working. Getting 404 error from nginx
When I run the below code from a local Ubuntu machine, the socket connection is successfully established; however, when I deploy it to an Ubuntu server, it does not work.

This is the error message I received from Nginx.

```<code>- [28/Dec/2022:07:29:10 +0000] "GET /media HTTP/1.1" 404 153 "-" "Boost.Beast/266" "3.235.111.201"
</code>```

Linux is running and I check the IP it is 200 and the application also is running.

The code is in the file aap.py

```<code>import json
import logging
from flask import Flask, request, jsonify
from flask_sockets import Sockets
from gevent import pywsgi
from geventwebsocket.handler import WebSocketHandler
import os
import logging
from logging.handlers import RotatingFileHandler
from flask_cors import CORS

app = Flask(__name__)
CORS(app)
sockets = Sockets(app)

@app.route("/hello", methods=['GET', 'POST'])
def hello():
    print("testing")
    return jsonify({"message": "Success"})

@sockets.route('/test')
def test(ws):
    print(f"*****Test****{ws}")

@sockets.route('/media')
def echo(ws):
    print(f"Media WS: {ws}")
    while True:
        message = ws.receive()
        packet = json.loads(message)
        print(packet)

if __name__ == '__main__':
    formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
    file_handler = RotatingFileHandler('log_data.log', maxBytes=10000, backupCount=2)
    file_handler.setFormatter(formatter)
    logging.basicConfig(handlers=[file_handler], level=logging.DEBUG)
    logger = logging.getLogger('log_data.log')
    app.logger.setLevel(logging.DEBUG)
    server = pywsgi.WSGIServer(('127.0.0.1', 5000), app, handler_class=WebSocketHandler)
    #server = pywsgi.WSGIServer(('', 5000), app, handler_class=WebSocketHandler)
    server.serve_forever()

</code>```

from the localhost, I run the command python3 app.py
Here is the screenshot of the terminal and socket connection test result.

My nginx config is in file  /etc/nginx/sites-available/test-socket and the content is:

```<code>server {
    listen 80;
    server_name _;
    access_log /var/log/nginx/access.log;

    location / {
        include proxy_params;
        proxy_http_version 1.1;
        proxy_buffering off;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_pass http://127.0.0.1:5000;
      }
    }
</code>```

I am running one service file /etc/systemd/system/demo.service

```<code>[Unit]
Description=Gunicorn instance to serve testApp
After=network.target

[Service]
User=root
Group=www-data
WorkingDirectory=/root/test-socket
Environment="PATH=/root/test-socket/myenv/bin"
ExecStart=/root/test-socket/myenv/bin/gunicorn --worker-class eventlet -w1 --workers 3 --bind 127.0.0.1:5000 app:app

[Install]
WantedBy=multi-user.target
</code>```

Body:
When I run the below code from a local Ubuntu machine, the socket connection is successfully established; however, when I deploy it to an Ubuntu server, it does not work.

This is the error message I received from Nginx.

- [28/Dec/2022:07:29:10 +0000] "GET /media HTTP/1.1" 404 153 "-" "Boost.Beast/266" "3.235.111.201"

Linux is running and I check the IP it is 200 and the application also is running.

The code is in the file aap.py

import json
import logging
from flask import Flask, request, jsonify
from flask_sockets import Sockets
from gevent import pywsgi
from geventwebsocket.handler import WebSocketHandler
import os
import logging
from logging.handlers import RotatingFileHandler
from flask_cors import CORS

app = Flask(__name__)
CORS(app)
sockets = Sockets(app)

@app.route("/hello", methods=['GET', 'POST'])
def hello():
    print("testing")
    return jsonify({"message": "Success"})

@sockets.route('/test')
def test(ws):
    print(f"*****Test****{ws}")

@sockets.route('/media')
def echo(ws):
    print(f"Media WS: {ws}")
    while True:
        message = ws.receive()
        packet = json.loads(message)
        print(packet)

if __name__ == '__main__':
    formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
    file_handler = RotatingFileHandler('log_data.log', maxBytes=10000, backupCount=2)
    file_handler.setFormatter(formatter)
    logging.basicConfig(handlers=[file_handler], level=logging.DEBUG)
    logger = logging.getLogger('log_data.log')
    app.logger.setLevel(logging.DEBUG)
    server = pywsgi.WSGIServer(('127.0.0.1', 5000), app, handler_class=WebSocketHandler)
    #server = pywsgi.WSGIServer(('', 5000), app, handler_class=WebSocketHandler)
    server.serve_forever()

from the localhost, I run the command python3 app.py
Here is the screenshot of the terminal and socket connection test result.

My nginx config is in file  /etc/nginx/sites-available/test-socket and the content is:

server {
    listen 80;
    server_name _;
    access_log /var/log/nginx/access.log;

    location / {
        include proxy_params;
        proxy_http_version 1.1;
        proxy_buffering off;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_pass http://127.0.0.1:5000;
      }
    }

I am running one service file /etc/systemd/system/demo.service

[Unit]
Description=Gunicorn instance to serve testApp
After=network.target

[Service]
User=root
Group=www-data
WorkingDirectory=/root/test-socket
Environment="PATH=/root/test-socket/myenv/bin"
ExecStart=/root/test-socket/myenv/bin/gunicorn --worker-class eventlet -w1 --workers 3 --bind 127.0.0.1:5000 app:app

[Install]
WantedBy=multi-user.target


问:
The JSX import source cannot be set without also enabling React's "automatic" JSX transform
I'm trying to use Material UI icons inside my Qwik website.

I used the answers of If possible, how to use MUI with Qwik framework? and here's my Icons.jsx file:

```<code>/** @jsxImportSource react */

import { qwikify$ } from '@builder.io/qwik-react'
import AcUnitIcon from '@mui/icons-material/AcUnit'
import MenuIcon from '@mui/icons-material/Menu'
import AddIcon from '@mui/icons-material/Add'
import RemoveIcon from '@mui/icons-material/Remove'
import DriveFileRenameOutlineOutlinedIcon from '@mui/icons-material/DriveFileRenameOutlineOutlined'

export const MuiAcUnitIcon = qwikify$(() => <AcUnitIcon />)
export const MuiMenuIcon = qwikify$(() => <MenuIcon />)
export const MuiDriveFileRenameOutlineOutlinedIcon = qwikify$(() => <DriveFileRenameOutlineOutlinedIcon className='text-white' />)
export const MuiAddIcon = qwikify$(({ sx, className }) => <AddIcon sx={sx} className={className} />)
export const MuiRemoveIcon = qwikify$(({ sx, className }) => <RemoveIcon sx={sx} className={className} />);
</code>```

Everything works great in the development. But when I want to build the app for the production environment using npm run build or npm run preview, I get this error:

The JSX import source cannot be set without also enabling React's "automatic" JSX transform

And every component that has used the MUI icon would render as a blank space on my website.

I also tried How to fix vite warning: The JSX import source cannot be set?, but it made no difference.

Here's the issue that we wrote for the Qwik team. And here's a reproducable repository.

What should we do to fix this?

Body:
I'm trying to use Material UI icons inside my Qwik website.

I used the answers of If possible, how to use MUI with Qwik framework? and here's my Icons.jsx file:

/** @jsxImportSource react */

import { qwikify$ } from '@builder.io/qwik-react'
import AcUnitIcon from '@mui/icons-material/AcUnit'
import MenuIcon from '@mui/icons-material/Menu'
import AddIcon from '@mui/icons-material/Add'
import RemoveIcon from '@mui/icons-material/Remove'
import DriveFileRenameOutlineOutlinedIcon from '@mui/icons-material/DriveFileRenameOutlineOutlined'

export const MuiAcUnitIcon = qwikify$(() => <AcUnitIcon />)
export const MuiMenuIcon = qwikify$(() => <MenuIcon />)
export const MuiDriveFileRenameOutlineOutlinedIcon = qwikify$(() => <DriveFileRenameOutlineOutlinedIcon className='text-white' />)
export const MuiAddIcon = qwikify$(({ sx, className }) => <AddIcon sx={sx} className={className} />)
export const MuiRemoveIcon = qwikify$(({ sx, className }) => <RemoveIcon sx={sx} className={className} />);

Everything works great in the development. But when I want to build the app for the production environment using npm run build or npm run preview, I get this error:

The JSX import source cannot be set without also enabling React's "automatic" JSX transform

And every component that has used the MUI icon would render as a blank space on my website.

I also tried How to fix vite warning: The JSX import source cannot be set?, but it made no difference.

Here's the issue that we wrote for the Qwik team. And here's a reproducable repository.

What should we do to fix this?


问:
How do I find how many numbers are greater than 0?
I want to find how many numbers are greater than 0.

```<code>let tempObj = [
{"id":1,"servPrice":0,"bedPrice":0},
{"id":2,"servPrice":3,"bedPrice":5},
{"id":3,"servPrice":9,"bedPrice":0}
]
</code>```

If I write array as method parameter and which prop I want to learn, I guess it will work.
For example : servPrice = 2, bedPrice = 1

Body:
I want to find how many numbers are greater than 0.

let tempObj = [
{"id":1,"servPrice":0,"bedPrice":0},
{"id":2,"servPrice":3,"bedPrice":5},
{"id":3,"servPrice":9,"bedPrice":0}
]

If I write array as method parameter and which prop I want to learn, I guess it will work.
For example : servPrice = 2, bedPrice = 1


问:
I want to add the ID in the API
API

In my Indexin.vue.

<template>

   <base-button
    type="primary"
    size="sm"
    @click="deleteIndexing(data.indexing_id)"
    class="ml-4"
    >Delete</base-button
   >

</template>

method: deleteIndexing: function() {
this.api.putData('indexing/'+store.state.journalId,
this.indexingList.indexing_id).then((res)=> { console.log(res.data) },(error)=>
{ console.log(error) }) },
```
<p>Here in my <code>api.js</code>.</p>
<pre class="lang-js prettyprint-override"><code>putData (action, data) { let url = `${BASE_URL}` url += action + '.json' return
instance.put(url, data) },
</code>```

And the Error which I'm facing.

```<code>Error: http://ipAddress/api/journals/v1/indexing/1.json' from origin 'http://localhost:8080' has been blocked by CORS policy: Method PUT is not allowed by Access-Control-Allow-Methods in preflight response.
</code>```

I'm passing'indexing/'+store.state.journalIdas an argument againstputDatafunction's action parameter. That is showing in the IP address. But I have to pass indexing_id as a second argument in the api. I passed this.indexingList.indexing_id as a second argument against putData. But in the error it's showing 1.json in the end. 1 is journal ID, not the indexing ID. It's not taking the second argument. indexing_id has been written in the server side, just I have to pass in the API. But it's not taking, and I'm getting the error.

Title: I want to add the ID in the API

Body:
API

In my Indexin.vue.

<template>

   <base-button
    type="primary"
    size="sm"
    @click="deleteIndexing(data.indexing_id)"
    class="ml-4"
    >Delete</base-button
   >

</template>

method: deleteIndexing: function() {
this.api.putData('indexing/'+store.state.journalId,
this.indexingList.indexing_id).then((res)=> { console.log(res.data) },(error)=>
{ console.log(error) }) },

Here in my api.js.

putData (action, data) { let url = `${BASE_URL}` url += action + '.json' return
instance.put(url, data) },

And the Error which I'm facing.

Error: http://ipAddress/api/journals/v1/indexing/1.json' from origin 'http://localhost:8080' has been blocked by CORS policy: Method PUT is not allowed by Access-Control-Allow-Methods in preflight response.

I'm passing'indexing/'+store.state.journalIdas an argument againstputDatafunction's action parameter. That is showing in the IP address. But I have to pass indexing_id as a second argument in the api. I passed this.indexingList.indexing_id as a second argument against putData. But in the error it's showing 1.json in the end. 1 is journal ID, not the indexing ID. It's not taking the second argument. indexing_id has been written in the server side, just I have to pass in the API. But it's not taking, and I'm getting the error.


问:
RDS failover instance size
Is there a way to check the specs (i.e aws rds describe-db-instances) of a multi-az RDS failover instance?

I understand that the instance is inaccessible, but yet is it possible? I see the documentation for describe-db-clusters, but the instance is not listed there

Title: RDS failover instance size


问:
AttributeError: 'function' object has no attribute 'isna'
After applying isna to my original dataset, and saving it to a new variable.

That new variable is not acting like a dataframe and the output shows this error (AttributeError: 'function' object has no attribute 'isna') when I look for its shape.

When I read the new dataframe, it gives the description of the new dataframe in the output.

```<code>df1Books = df1.dropna
print(df1Books)
</code>```

It is giving description of the new variable df1Books

And

```<code>df1Books.head()

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-20-8f073fd0d9cc> in <module>
----> 1 df1Books.head()-tt

AttributeError: 'function' object has no attribute 'head'
</code>```

Body:
After applying isna to my original dataset, and saving it to a new variable.

That new variable is not acting like a dataframe and the output shows this error (AttributeError: 'function' object has no attribute 'isna') when I look for its shape.

When I read the new dataframe, it gives the description of the new dataframe in the output.

df1Books = df1.dropna
print(df1Books)

It is giving description of the new variable df1Books

And

df1Books.head()

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-20-8f073fd0d9cc> in <module>
----> 1 df1Books.head()-tt

AttributeError: 'function' object has no attribute 'head'


问:
Add background Image to body with selenium python
I want to add

```<code><style>
body {
  background-image: url('example_img.jpg');
  background-repeat: no-repeat;
}
</style>
</code>```

to page source with selenium python.

what should I do? I didn't find any solution.

Body:
I want to add

to page source with selenium python.

what should I do? I didn't find any solution.


问:
Kong gateway header allow list / whitelist
I want my Kong gateway to only allow certain headers in the request to be sent to the upstream server. Effectively a header whitelist. Is there a way to do this? I can't find any plugins for this.</p>


问:
Greater than and less than, not fully functional - Javascript, Wordpress, gravity forms
How do I convert number field data to the same format?

I have a form that contains a calculation for the resistance of a type of product. For example, if you choose the product that has 350W, it calculates the resistance. 52900 / 350 = Resistance. When this value is calculated, it ends up in a field called resistance #input_1_22. We use this field to calculate two new values. A min value and a max value.

Min Resistance (-5%) = Resistance * 0.95 #input_1_23
Max resistance (+10%) = Resistance * 1.1 #input_1_24

When these fields are calculated, it is the user's turn to fill in the value of their own installation, so that it lies between min and max resistance #input_1_25
If the value is approved true, the box turns green, span#result1 is filled with a value and span#result2 becomes empty.
If the value is not approved false, the box turns red, span#result2 is filled with a value and span#result1 becomes empty.

To calculate if the value is passed, I have the following code:

```<code>    <script>
    // When the field is changed do function
    document.getElementById("input_1_25").addEventListener("input", myFunction);

    function myFunction() {
         var x = document.getElementById("input_1_23").value; // Collect my value from input
         var y = document.getElementById("input_1_24").value; // Collect max value from input
         $value = document.getElementById("input_1_25").value;

         if (($value >= x) && ($value <= y)) {
          document.getElementById("result1").innerHTML = "✓";
    document.getElementById("result2").innerHTML = "";
    input = document.getElementById('input_1_25');
    input.style.borderColor = 'green';
         } else {
          document.getElementById("result2").innerHTML = "X";
    document.getElementById("result1").innerHTML = "";
    input = document.getElementById('input_1_25');
    input.style.borderColor = 'red';
         }
     }
    </script>
</code>```

It works on most values, but not all. If I choose, for example, 550W, it calculates:

value: 96.18

min value: 91.37

max value: 105.8

Input: 96 = false, why?

Then I should get true if I fill in a value of 96.
But whatever I enter in user input #input_1_25, it becomes false.

I assume it has to do with the values I get out being from different data? Maybe comparing a string with a number? So that "2" < "12" = false?

If so, how do I get the values to be the same type?

Body:
How do I convert number field data to the same format?

I have a form that contains a calculation for the resistance of a type of product. For example, if you choose the product that has 350W, it calculates the resistance. 52900 / 350 = Resistance. When this value is calculated, it ends up in a field called resistance #input_1_22. We use this field to calculate two new values. A min value and a max value.

Min Resistance (-5%) = Resistance * 0.95 #input_1_23
Max resistance (+10%) = Resistance * 1.1 #input_1_24

When these fields are calculated, it is the user's turn to fill in the value of their own installation, so that it lies between min and max resistance #input_1_25
If the value is approved true, the box turns green, span#result1 is filled with a value and span#result2 becomes empty.
If the value is not approved false, the box turns red, span#result2 is filled with a value and span#result1 becomes empty.

To calculate if the value is passed, I have the following code:

It works on most values, but not all. If I choose, for example, 550W, it calculates:

value: 96.18

min value: 91.37

max value: 105.8

Input: 96 = false, why?

Then I should get true if I fill in a value of 96.
But whatever I enter in user input #input_1_25, it becomes false.

I assume it has to do with the values I get out being from different data? Maybe comparing a string with a number? So that "2" < "12" = false?

If so, how do I get the values to be the same type?


问:
Visual Studio paste the copied lıne on the bottom line
We want paste the copied line on the bottom line looks like the video.

Here my VS Code about.

```<code>Version: 1.74.2
Commit: e8a3071ea4344d9d48ef8a4df2c097372b0c5161
Date: 2022-12-20T10:27:19.253Z
Electron: 19.1.8
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Linux x64 5.10.0-20-amd64
Sandboxed: No
</code>```

I using GNU/Linux. I think there is an obvious shortcuts difference between GNU/Linux and Windows VS Code versions.

Body:
We want paste the copied line on the bottom line looks like the video.

Here my VS Code about.

Version: 1.74.2
Commit: e8a3071ea4344d9d48ef8a4df2c097372b0c5161
Date: 2022-12-20T10:27:19.253Z
Electron: 19.1.8
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Linux x64 5.10.0-20-amd64
Sandboxed: No

I using GNU/Linux. I think there is an obvious shortcuts difference between GNU/Linux and Windows VS Code versions.


问:
TypeError: object PublicChatConsumer can't be used in 'await' expression
I am using python ,django and creating a chat web with django channels
i'm getting this error :

File
"C:\Users\guest1.virtualenvs\chatkaro-rdA4zw_Z\lib\site-packages\channels\routing.py",
line 116, in call
return await application( TypeError: object PublicChatConsumer can't be used in 'await' expression WebSocket DISCONNECT
/public_chat/2/ [127.0.0.1:51079]

```<code>

from channels.generic.websocket import AsyncJsonWebsocketConsumer
import json
from django.contrib.auth import get_user_model

User = get_user_model()

class PublicChatConsumer(AsyncJsonWebsocketConsumer):

    async def connect(self):
        """
        Called when the websocket is handshaking as part of initial connection.
        """
        print("PublicChatConsumer: connect: " + str(self.scope["user"]))

        await self.accept()

    async def disconnect(self, code):
        """
        Called when the WebSocket closes for any reason.
        """

        print("PublicChatConsumer: disconnect")
        pass

    async def receive_json(self, content):

        command = content.get("command", None)
        print("PublicChatConsumer: receive_json: " + str(command))

</code>```

Body:
I am using python ,django and creating a chat web with django channels
i'm getting this error :

File
"C:\Users\guest1.virtualenvs\chatkaro-rdA4zw_Z\lib\site-packages\channels\routing.py",
line 116, in call
return await application( TypeError: object PublicChatConsumer can't be used in 'await' expression WebSocket DISCONNECT
/public_chat/2/ [127.0.0.1:51079]

from channels.generic.websocket import AsyncJsonWebsocketConsumer
import json
from django.contrib.auth import get_user_model

User = get_user_model()

class PublicChatConsumer(AsyncJsonWebsocketConsumer):

    async def connect(self):
        """
        Called when the websocket is handshaking as part of initial connection.
        """
        print("PublicChatConsumer: connect: " + str(self.scope["user"]))

        await self.accept()

    async def disconnect(self, code):
        """
        Called when the WebSocket closes for any reason.
        """

        print("PublicChatConsumer: disconnect")
        pass

    async def receive_json(self, content):

        command = content.get("command", None)
        print("PublicChatConsumer: receive_json: " + str(command))


问:
When messages are updated they change their order Firestore v9
I have a chat screen, and I want to add ticks when the message is received or sent. I managed to do that by passing received and sent fields in the firestore collection. So far so good, but when the user sent a new the ticks from the old one must vanish. But when I update the firstore document the messages change order and then get back to their normal order. Any idea if is possible to have the last message with ticks without all this stuff happening?

Here I get all the messages:

```<code>const uid=route.params.uid
const chatid = uid > userExists.uid ? userExists.uid+ "-" +uid : uid+ "-" +userExists.uid

const docRef=doc(db,"chats",chatid)
const docSnap = await getDoc(docRef);
const colRef = collection(docRef, "messages")

if (docSnap.exists()) {
  const colRef = query(collection(docRef, "messages"),orderBy('createdAt', 'desc'))
const uns=onSnapshot(colRef,docSnap=>{
  setMessages(docSnap.docs.map(doc=>({
    _id:doc.data()._id,createdAt:doc.data().createdAt.toDate(),sentBy:doc.data().sentBy,
    sentTo:doc.data().sentTo,text:doc.data().text,user:doc.data().user,received:doc.data().received
  })))

})
return uns
</code>```

Here is what happen when a new message is sent:

```<code>const onSend =  useCallback ((msgArray) => {
const msg = msgArray[0]
const uid=route.params.uid
const name=route.params.name
const usermsg = {
  ...msg,
  sentBy: userExists.uid,
  sentTo: uid,
  createdAt: new Date(),
  sent:false,
  received:true
}
setMessages(previousMessages => GiftedChat.append(previousMessages, usermsg))
const chatid = uid > userExists.uid ? userExists.uid+ "-" +uid : uid+ "-" +userExists.uid
const getMessage= async()=>{
  const docRef=doc(db,"chats",chatid)
  const colRef = collection(docRef, "messages")
  const q=query(collection(docRef, "messages"),where('sentBy', '==',userExists.uid),orderBy('createdAt', 'desc'),limit(1))

      await getDocs(q).then(function(querySnapshot){//update previous message received statuts
      querySnapshot.forEach(function(doc){
       updateDoc(doc.ref,{received:false,sent:false})

      })
    })

   addDoc(colRef,{...usermsg})
}
getMessage()
</code>```

Body:
I have a chat screen, and I want to add ticks when the message is received or sent. I managed to do that by passing received and sent fields in the firestore collection. So far so good, but when the user sent a new the ticks from the old one must vanish. But when I update the firstore document the messages change order and then get back to their normal order. Any idea if is possible to have the last message with ticks without all this stuff happening?

Here I get all the messages:

const uid=route.params.uid
const chatid = uid > userExists.uid ? userExists.uid+ "-" +uid : uid+ "-" +userExists.uid

const docRef=doc(db,"chats",chatid)
const docSnap = await getDoc(docRef);
const colRef = collection(docRef, "messages")

if (docSnap.exists()) {
  const colRef = query(collection(docRef, "messages"),orderBy('createdAt', 'desc'))
const uns=onSnapshot(colRef,docSnap=>{
  setMessages(docSnap.docs.map(doc=>({
    _id:doc.data()._id,createdAt:doc.data().createdAt.toDate(),sentBy:doc.data().sentBy,
    sentTo:doc.data().sentTo,text:doc.data().text,user:doc.data().user,received:doc.data().received
  })))

})
return uns

Here is what happen when a new message is sent:

const onSend =  useCallback ((msgArray) => {
const msg = msgArray[0]
const uid=route.params.uid
const name=route.params.name
const usermsg = {
  ...msg,
  sentBy: userExists.uid,
  sentTo: uid,
  createdAt: new Date(),
  sent:false,
  received:true
}
setMessages(previousMessages => GiftedChat.append(previousMessages, usermsg))
const chatid = uid > userExists.uid ? userExists.uid+ "-" +uid : uid+ "-" +userExists.uid
const getMessage= async()=>{
  const docRef=doc(db,"chats",chatid)
  const colRef = collection(docRef, "messages")
  const q=query(collection(docRef, "messages"),where('sentBy', '==',userExists.uid),orderBy('createdAt', 'desc'),limit(1))

      await getDocs(q).then(function(querySnapshot){//update previous message received statuts
      querySnapshot.forEach(function(doc){
       updateDoc(doc.ref,{received:false,sent:false})

      })
    })

   addDoc(colRef,{...usermsg})
}
getMessage()


问:
How to use google vision API within a Flutter app
I want to create an app (build by Flutter), which uses OCR features of google cloud vision (https://cloud.google.com/vision/). In the app, taking a picture by camera, and use gooogle  cloud vision to extract text from it.

I found several resources, but I am  not sure which one is the right one.

1)https://pub.dev/documentation/googleapis/latest/vision.v1/vision.v1-library.html

2)https://cloud.google.com/vision/docs/reference/rest#service-endpoint

3)https://pub.dev/packages/google_ml_vision

My question is

which one above that I can use with my Flutter app?

the first and the third are the same thing?

Is there  any example of using the first and second approach.

Thanks very much.


问:
Update an entity in database
I have these two entities:

```<code>public class TblUser
{
    public long Userid { get; set; }
    public string Username { get; set; }
    public string Password { get; set; }
    public string PasswordSalt { get; set; }
    public string FullName { get; set; }
    public virtual ICollection<TblNotify> TblNotifies { get; set; }
}

public partial class TblNotify
{
    public Guid NotifyId { get; set; }
    public string Message { get; set; }
    public virtual TblUser ApprovalUser { get; set; }
}
</code>```

The table tblNotify has a foreign key Userid.

DbContext was initially built as singleton service.

I call an update method:

```<code>uow.GetRepository<tblNotify>().Update(item);
</code>```

It almost always updates successfully, but rarely, I got this error:

The instance of entity type 'Tbluser' cannot be tracked because another instance with the same key value for {'Userid'} is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.

It's weird because I only update the tblNotify table. How could I investigate this error further?

Any help will be appreciated.

Title: Update an entity in database

Body:
I have these two entities:

public class TblUser
{
    public long Userid { get; set; }
    public string Username { get; set; }
    public string Password { get; set; }
    public string PasswordSalt { get; set; }
    public string FullName { get; set; }
    public virtual ICollection<TblNotify> TblNotifies { get; set; }
}

public partial class TblNotify
{
    public Guid NotifyId { get; set; }
    public string Message { get; set; }
    public virtual TblUser ApprovalUser { get; set; }
}

The table tblNotify has a foreign key Userid.

DbContext was initially built as singleton service.

I call an update method:

uow.GetRepository<tblNotify>().Update(item);

It almost always updates successfully, but rarely, I got this error:

The instance of entity type 'Tbluser' cannot be tracked because another instance with the same key value for {'Userid'} is already being tracked. When attaching existing entities, ensure that only one entity instance with a given key value is attached. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.

It's weird because I only update the tblNotify table. How could I investigate this error further?

Any help will be appreciated.


问:
Android CameraApi2 BLASTBufferQueue
I am working on a android app with the cameraApi2. It is working fine which means I see a preview of the camera and I can take pictures.
The only problem I have is the logs getting flooded with the following error message:

```<code>E/BLASTBufferQueue: [VRI[MainActivity]#0](f:0,a:2) Faking releaseBufferCallback from transactionCompleteCallback
</code>```

I already googled for the error message but did not find any explanation.
Can somebody explain what this one actually means so i can fix this?

Thank you

Title: Android CameraApi2 BLASTBufferQueue

Body:
I am working on a android app with the cameraApi2. It is working fine which means I see a preview of the camera and I can take pictures.
The only problem I have is the logs getting flooded with the following error message:

E/BLASTBufferQueue: [VRI[MainActivity]#0](f:0,a:2) Faking releaseBufferCallback from transactionCompleteCallback

I already googled for the error message but did not find any explanation.
Can somebody explain what this one actually means so i can fix this?

Thank you


问:
Ora2PG REPLACE_AS_BOOLEAN property and exclude one column by replacing
I'm using ora2pg to import an oracle db schema into a postgresql db schema. I configured all in the correct way and I'm able to dump the oracle dn into the postgresql db.

In the schema that I'm converting I have some columns number(1,0) that I need to convert as boolean in the pg schema.

At first I used this configuration
REPLACE_AS_BOOLEAN NUMBER:1
so every column with this type will be conmverted as boolean in the pg db.

The problem is that I have a column in the oracle schema defined as number(1,0). This column has to remain numeric and maintain the same type on the pg schema, so it hasn't to be converted as boolean.

This means that i changed the property in this manner
REPLACE_AS_BOOLEAN TABLE1:COLUMN1 TABLE2:COLUMN2 TABLE3:COLUMN3

I have a lot of columns that they have to be converted as boolean and the definition of this property became very long.

Is there a method to define the REPLACE_AS_BOOLEAN property to replace all the column with type number(1,0), but with some exception for one or some of them?

I had to wrote the property with the list of all the tables name and columns name


问:
Predict future values for a whole row
I am working on a time-series model where I have a date-time column and other five columns. My question is, can I predict future values for all the columns in a row based only on previous row values and the current date-time? I mean without having input columns and one output column?</p>

Title: Predict future values for a whole row


问:
TypeError: cannot unpack non-iterable function object
I'm fine tuning bert model for ner task and in the evaluation step after tarining I get this error

```<code>from seqeval.metrics import accuracy_score

def flat_accuracy(preds, labels):
    flat_preds = np.argmax(preds, axis=2)
    flat_labels = labels
    return accuracy_score(flat_preds, flat_labels)
</code>```
```<code>from seqeval.metrics import f1_score
from seqeval.metrics import accuracy_score
def flat_accuracy(preds, labels):
    flat_preds = np.argmax(preds, axis=2).flatten()
    flat_labels = labels.flatten()
    return np.sum(flat_preds == flat_labels)/len(flat_labels)
</code>```
```<code>def valid(model, testing_loader, dev):
    model.eval()
    eval_loss = 0; eval_accuracy = 0
    n_correct = 0; n_wrong = 0; total = 0
    predictions , true_labels = [], []
    nb_eval_steps, nb_eval_examples = 0, 0
    with torch.no_grad():
        for _, data in enumerate(testing_loader, 0):

            for k, v in data.items():
                data[k] = v.to(device, dtype = torch.long)

            ids = data['ids']
            mask = data['mask']
            targets = data['target_tags']

            output = model(**data)
            loss, logits = output[:2]
            logits = logits.detach().cpu().numpy()
            label_ids = targets.to('cpu').numpy()
            predictions.extend([list(p) for p in np.argmax(logits, axis=2)])
            true_labels.append(label_ids)
            accuracy = flat_accuracy(logits, label_ids)
            eval_loss += loss.mean().item()
            eval_accuracy += accuracy
            nb_eval_examples += ids.size(0)
            nb_eval_steps += 1
        eval_loss = eval_loss/nb_eval_steps
        print("Validation loss: {}".format(eval_loss))
        print("Validation Accuracy: {}".format(eval_accuracy/nb_eval_steps))

    return flat_accuracy
</code>```
```<code>#tags_vals = list(set(df_data[""].values))
predictions, true_labels = valid(model, valid_data_loader, device)
</code>```

the error I get is TypeError: cannot unpack non-iterable function object
does anyone know how to correct this?

Body:
I'm fine tuning bert model for ner task and in the evaluation step after tarining I get this error

from seqeval.metrics import accuracy_score

def flat_accuracy(preds, labels):
    flat_preds = np.argmax(preds, axis=2)
    flat_labels = labels
    return accuracy_score(flat_preds, flat_labels)

from seqeval.metrics import f1_score
from seqeval.metrics import accuracy_score
def flat_accuracy(preds, labels):
    flat_preds = np.argmax(preds, axis=2).flatten()
    flat_labels = labels.flatten()
    return np.sum(flat_preds == flat_labels)/len(flat_labels)

def valid(model, testing_loader, dev):
    model.eval()
    eval_loss = 0; eval_accuracy = 0
    n_correct = 0; n_wrong = 0; total = 0
    predictions , true_labels = [], []
    nb_eval_steps, nb_eval_examples = 0, 0
    with torch.no_grad():
        for _, data in enumerate(testing_loader, 0):

            for k, v in data.items():
                data[k] = v.to(device, dtype = torch.long)

            ids = data['ids']
            mask = data['mask']
            targets = data['target_tags']

            output = model(**data)
            loss, logits = output[:2]
            logits = logits.detach().cpu().numpy()
            label_ids = targets.to('cpu').numpy()
            predictions.extend([list(p) for p in np.argmax(logits, axis=2)])
            true_labels.append(label_ids)
            accuracy = flat_accuracy(logits, label_ids)
            eval_loss += loss.mean().item()
            eval_accuracy += accuracy
            nb_eval_examples += ids.size(0)
            nb_eval_steps += 1
        eval_loss = eval_loss/nb_eval_steps
        print("Validation loss: {}".format(eval_loss))
        print("Validation Accuracy: {}".format(eval_accuracy/nb_eval_steps))

    return flat_accuracy

#tags_vals = list(set(df_data[""].values))
predictions, true_labels = valid(model, valid_data_loader, device)

the error I get is TypeError: cannot unpack non-iterable function object
does anyone know how to correct this?


问:
Exoplayer Downloading and playing downloaded video steps or example
I am trying to implement a concept of downloading and playing the downloaded content using exoplayer.
I have referred the exoplayer doc and link https://exoplayer.dev/downloading-media.html.
Tried running the Demo app in the github link which also doesn't download.

Now the concept is not getting cleared. I am looking for some opensource sample(working) where this concept is actually functional.

Thank You.

I have referred the exoplayer doc and link https://exoplayer.dev/downloading-media.html.
Tried running the Demo app in the github link which also doesn't download.


问:
"flutter run" is not working on my phone after upgrading to android 13
When I run flutter apk on vs code it showing some error "Error waiting for a debug connection: The log reader stopped unexpectedly
Error launching application on I2012."

When I am running my app in vs code it will show some error after updating my phone to Android 13.


问:
Unable to reset password using django test client
I'm using pytest-django to test for password reset. When a request is sent to the reset url, the response contains a form with new_password1 and new_password2 which means, the reset url works successfully. When I send the new password and try using it to login, it doesn't work and the old password remains active:

```<code>@pytest.mark.django_db
def test_reset_password(client, valid_user_data, django_user_model):
    client_signup(client, valid_user_data)
    activate_user(client, valid_user_data['username'])
    client.post(reverse('signout'))
    response = client.post(
        reverse('reset-password'), {'email': valid_user_data['email']}
    )
    assert len(mail.outbox) == 1
    token = response.context[0]['token']
    uid = response.context[0]['uid']
    new_password = uuid.uuid4().hex
    client.post(
        reverse('password_reset_confirm', kwargs={'token': token, 'uidb64': uid}),
        {'new_password1': new_password, 'new_password2': new_password},
    )
    new_password_response = client.post(
        reverse('signin'),
        {
            'username': valid_user_data['username'],
            'password': new_password,
        },
    )
    old_password_response = client.post(
        reverse('signin'),
        {
            'username': valid_user_data['username'],
            'password': valid_user_data['password1'],
        },
    )
    print(f'(new): {new_password_response.status_code}')
    print(f'(old): {old_password_response.status_code}')
</code>```

which results in 200 and 302 for new and old passwords respectively while the opposite is expected:

```<code>(new): 200
(old): 302
</code>```

The functionality works fine in a browser though, using selenium or by resetting the password manually using the same urls. Something is wrong with the below:

```<code>client.post(
    reverse('password_reset_confirm', kwargs={'token': token, 'uidb64': uid}),
    {'new_password1': new_password, 'new_password2': new_password},
)
</code>```

Body:
I'm using pytest-django to test for password reset. When a request is sent to the reset url, the response contains a form with new_password1 and new_password2 which means, the reset url works successfully. When I send the new password and try using it to login, it doesn't work and the old password remains active:

@pytest.mark.django_db
def test_reset_password(client, valid_user_data, django_user_model):
    client_signup(client, valid_user_data)
    activate_user(client, valid_user_data['username'])
    client.post(reverse('signout'))
    response = client.post(
        reverse('reset-password'), {'email': valid_user_data['email']}
    )
    assert len(mail.outbox) == 1
    token = response.context[0]['token']
    uid = response.context[0]['uid']
    new_password = uuid.uuid4().hex
    client.post(
        reverse('password_reset_confirm', kwargs={'token': token, 'uidb64': uid}),
        {'new_password1': new_password, 'new_password2': new_password},
    )
    new_password_response = client.post(
        reverse('signin'),
        {
            'username': valid_user_data['username'],
            'password': new_password,
        },
    )
    old_password_response = client.post(
        reverse('signin'),
        {
            'username': valid_user_data['username'],
            'password': valid_user_data['password1'],
        },
    )
    print(f'(new): {new_password_response.status_code}')
    print(f'(old): {old_password_response.status_code}')

which results in 200 and 302 for new and old passwords respectively while the opposite is expected:

(new): 200
(old): 302

The functionality works fine in a browser though, using selenium or by resetting the password manually using the same urls. Something is wrong with the below:

client.post(
    reverse('password_reset_confirm', kwargs={'token': token, 'uidb64': uid}),
    {'new_password1': new_password, 'new_password2': new_password},
)


问:
Adding new table to mysql replication
Hi I have an existing mysql master-master replication between 3 servers and all the servers are connected to each other. I'm replicating some tables in a specific database. there is about 80 tables in this database and only 10 of them is replicating. I'm using replicate-do-table option in my mysql config file to tell mysql which tables should be replicated.

In this stage I found that I need another table to be replicated which was not replicated before. When I add new table to mysql config file, Newly added data are coming to all the server but old existing data are not coming. what should I do to bring older data to all the servers.

this is my mysql config file

```<code>    default_table_encryption=ON
    table_encryption_privilege_check=ON
    replica_parallel_workers=4
    enforce_gtid_consistency=ON
    gtid_mode=ON
    keyring_file_data=.....
    early-plugin-load=keyring_file.so
    skip_replica_start=OFF
    auto_increment_increment=50
    auto_increment_offset=1
    server_id=3
    replicate_same_server_id=0
    replicate-do-db=db
    replicate-do-table=db.table1
    replicate-do-table=db.table2
    replicate-do-table=db.table3
    replicate-do-table=db.table4
    replicate-do-table=db.table5
    replicate-do-table=db.table6
    replicate-do-table=db.table7
    replicate-do-table=db.table8
    replicate-do-table=db.table9
    replicate-do-table=db.table10
    replicate-do-table=db.table11
    replicate-do-table=db.table12
    slave-skip-errors=1032

</code>```

Title: Adding new table to mysql replication

Body:
Hi I have an existing mysql master-master replication between 3 servers and all the servers are connected to each other. I'm replicating some tables in a specific database. there is about 80 tables in this database and only 10 of them is replicating. I'm using replicate-do-table option in my mysql config file to tell mysql which tables should be replicated.

In this stage I found that I need another table to be replicated which was not replicated before. When I add new table to mysql config file, Newly added data are coming to all the server but old existing data are not coming. what should I do to bring older data to all the servers.

this is my mysql config file

    default_table_encryption=ON
    table_encryption_privilege_check=ON
    replica_parallel_workers=4
    enforce_gtid_consistency=ON
    gtid_mode=ON
    keyring_file_data=.....
    early-plugin-load=keyring_file.so
    skip_replica_start=OFF
    auto_increment_increment=50
    auto_increment_offset=1
    server_id=3
    replicate_same_server_id=0
    replicate-do-db=db
    replicate-do-table=db.table1
    replicate-do-table=db.table2
    replicate-do-table=db.table3
    replicate-do-table=db.table4
    replicate-do-table=db.table5
    replicate-do-table=db.table6
    replicate-do-table=db.table7
    replicate-do-table=db.table8
    replicate-do-table=db.table9
    replicate-do-table=db.table10
    replicate-do-table=db.table11
    replicate-do-table=db.table12
    slave-skip-errors=1032


问:
Extract the features of last layer from the pytorch-fasterrcnn-resnet50-fpn
I have a image where i have to use the pytorch-fasterrcnn-resnet50-fpn to extract the features of the image. Below is the code that I am trying

```<code>import torchvision
model = torchvision.models.detection.fasterrcnn_resnet50_fpn(pretrained = True)
### strip the last layer
feature_extractor = torch.nn.Sequential(*list(model_ft.children())[:-1])
inputs = feature_extractor(images=image, return_tensors="pt")
with torch.no_grad():
  outputs = model(**inputs)
last_hidden_states = outputs.last_hidden_state
</code>```

Here the type of image is PIL.JpegImagePlugin.JpegImageFile

The above code is not working for getting the features. Can anyone tell me how to solve this?

Body:
I have a image where i have to use the pytorch-fasterrcnn-resnet50-fpn to extract the features of the image. Below is the code that I am trying

import torchvision
model = torchvision.models.detection.fasterrcnn_resnet50_fpn(pretrained = True)
### strip the last layer
feature_extractor = torch.nn.Sequential(*list(model_ft.children())[:-1])
inputs = feature_extractor(images=image, return_tensors="pt")
with torch.no_grad():
  outputs = model(**inputs)
last_hidden_states = outputs.last_hidden_state

Here the type of image is PIL.JpegImagePlugin.JpegImageFile

The above code is not working for getting the features. Can anyone tell me how to solve this?


问:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource - Passport Google Oauth2
I am trying to implement a third party log-in feature in my web app using the  passport-google-oauth20, however I am getting the following error when trying to GET the resource using a function in my client side as shown below:

```<code>async function handleGoogleLogin() {
    const url = 'http://localhost:5000/auth/google';
    try {
        let response = await fetch(url, {
            method: 'GET',
            headers: {
                'Content-type': 'application/json',
                'Accept': 'application/json',
                'Access-Control-Allow-Origin': 'http://localhost:5000'
            },
            mode: 'cors',
            cache: 'no-cache',
            credentials: 'include',

        })
        console.log(response)
    } catch (error) {
        console.log(error);
    }

}
</code>```

These below are my passport.js code and my server.js respectively:

```<code>passport.use(new GoogleStrategy({
    clientID: "261273528668-u49b84sr0r8qjerk414jpk1u0odsveoh.apps.googleusercontent.com",
    clientSecret: "*******************************",
    callbackURL: "http://localhost:5000/auth/google/callback",
    passReqToCallback: true
}, (request, accessToken, refreshToken, profile, done) => {
    console.log(profile)
    return done(null, profile)
}))
</code>```

server.js

// Google oauth

```<code>app.get('/auth/google', passport.authenticate('google', { scope: ['profile'] }));

app.get('/auth/google/callback', passport.authenticate('google', { failureRedirect: '/notFound' }), (req, res) => {
    res.send({ loggedIn: true, customer: req.user });
});
</code>```

////////////// My CORS middleware below : ////////////////////////////

```<code>app.use(cors({
    origin: 'http://localhost:3000',
    credentials: true
}));
</code>```

The error that I get is as follows:

XHROPTIONShttps://accounts.google.com/o/oauth2/v2/auth?response_type=code&redirect_uri=http://localhost:5000/auth/google/callback&scope=profile&client_id=261273528668-u49b84sr0r8qjerk414jpk1u0odsveoh.apps.googleusercontent.com
CORS Missing Allow Origin

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://accounts.google.com/o/oauth2/v2/auth?response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A5000%2Fauth%2Fgoogle%2Fcallback&scope=profile&client_id=261273528668-u49b84sr0r8qjerk414jpk1u0odsveoh.apps.googleusercontent.com. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 405.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://accounts.google.com/o/oauth2/v2/auth?response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A5000%2Fauth%2Fgoogle%2Fcallback&scope=profile&client_id=261273528668-u49b84sr0r8qjerk414jpk1u0odsveoh.apps.googleusercontent.com. (Reason: CORS request did not succeed). Status code: (null).

TypeError: NetworkError when attempting to fetch resource.

I tried to tweak the 'Access-Control-Allow-Origin' header in my get request many times both using the wildcard * as well as my backend as origin however I get the same result either way.

Any suggestion would be appreciated.

Body:
I am trying to implement a third party log-in feature in my web app using the  passport-google-oauth20, however I am getting the following error when trying to GET the resource using a function in my client side as shown below:

async function handleGoogleLogin() {
    const url = 'http://localhost:5000/auth/google';
    try {
        let response = await fetch(url, {
            method: 'GET',
            headers: {
                'Content-type': 'application/json',
                'Accept': 'application/json',
                'Access-Control-Allow-Origin': 'http://localhost:5000'
            },
            mode: 'cors',
            cache: 'no-cache',
            credentials: 'include',

        })
        console.log(response)
    } catch (error) {
        console.log(error);
    }

}

These below are my passport.js code and my server.js respectively:

passport.use(new GoogleStrategy({
    clientID: "261273528668-u49b84sr0r8qjerk414jpk1u0odsveoh.apps.googleusercontent.com",
    clientSecret: "*******************************",
    callbackURL: "http://localhost:5000/auth/google/callback",
    passReqToCallback: true
}, (request, accessToken, refreshToken, profile, done) => {
    console.log(profile)
    return done(null, profile)
}))

server.js

// Google oauth

app.get('/auth/google', passport.authenticate('google', { scope: ['profile'] }));

app.get('/auth/google/callback', passport.authenticate('google', { failureRedirect: '/notFound' }), (req, res) => {
    res.send({ loggedIn: true, customer: req.user });
});

////////////// My CORS middleware below : ////////////////////////////

app.use(cors({
    origin: 'http://localhost:3000',
    credentials: true
}));

The error that I get is as follows:

XHROPTIONShttps://accounts.google.com/o/oauth2/v2/auth?response_type=code&redirect_uri=http://localhost:5000/auth/google/callback&scope=profile&client_id=261273528668-u49b84sr0r8qjerk414jpk1u0odsveoh.apps.googleusercontent.com
CORS Missing Allow Origin

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://accounts.google.com/o/oauth2/v2/auth?response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A5000%2Fauth%2Fgoogle%2Fcallback&scope=profile&client_id=261273528668-u49b84sr0r8qjerk414jpk1u0odsveoh.apps.googleusercontent.com. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 405.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://accounts.google.com/o/oauth2/v2/auth?response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A5000%2Fauth%2Fgoogle%2Fcallback&scope=profile&client_id=261273528668-u49b84sr0r8qjerk414jpk1u0odsveoh.apps.googleusercontent.com. (Reason: CORS request did not succeed). Status code: (null).

TypeError: NetworkError when attempting to fetch resource.

I tried to tweak the 'Access-Control-Allow-Origin' header in my get request many times both using the wildcard * as well as my backend as origin however I get the same result either way.

Any suggestion would be appreciated.


问:
How does compiled Dart code communicate with the Flutter engine?
With my naive and limited knowledge I would think that compiled dart code and the compiled flutter engine are linked together in the build process. If I'm correct, what patterns and mechanisms are used to achieve this perfect bond? If not, just how do they (dart code and the flutter engine) fit together?</p>


问:
How to raise Raspberry's buzzer sound in javascript running with apache without using node.js
i'm using Raspberry Pi 3+ and there are 3 different languages running in one web page. The languages i'm using are PHP, Python, and Javascript and running from apache web server. I want to raise a buzzer sound periodically and call python script from Javascript.

This is my Python script :

```<code>#!/usr/bin/python

import RPi.GPIO as GPIO
import time
from time import sleep

GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(23, GPIO.OUT)
GPIO.output(23, GPIO.HIGH)
time.sleep(1)
GPIO.output(23, GPIO.LOW)
GPIO.cleanup()
time.sleep(1)
</code>```

...
this is my javascript fragment that calls the Python script :

```<code>function goPython(){
   $.ajax({
    type: "GET",
    url: "bunyi.py",
    data: { param: " "},
    dataType: "text"
    }).done(function() {
        alert("OK");
         });
}
</code>```
```<code>                if (minutes < 5) {

                        if ((seconds < 60) && (seconds > 0)){

                                timer2.innerHTML = hours + ':' + minutes + ':' + seconds;

                                if ((seconds < 60) && (seconds > 55)){
                                     goPython();
                                }
</code>```

The python script is running well when i execute directly from command line : python bunyi.py
i have already tried to change python script file mode to 755 and chown to www-data, unfortunately i didn't get my expected result.

Sorry my English is not good enough.

Thank you so much in advance.

Body:
i'm using Raspberry Pi 3+ and there are 3 different languages running in one web page. The languages i'm using are PHP, Python, and Javascript and running from apache web server. I want to raise a buzzer sound periodically and call python script from Javascript.

This is my Python script :

#!/usr/bin/python

import RPi.GPIO as GPIO
import time
from time import sleep

GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(23, GPIO.OUT)
GPIO.output(23, GPIO.HIGH)
time.sleep(1)
GPIO.output(23, GPIO.LOW)
GPIO.cleanup()
time.sleep(1)

...
this is my javascript fragment that calls the Python script :

function goPython(){
   $.ajax({
    type: "GET",
    url: "bunyi.py",
    data: { param: " "},
    dataType: "text"
    }).done(function() {
        alert("OK");
         });
}

                if (minutes < 5) {

                        if ((seconds < 60) && (seconds > 0)){

                                timer2.innerHTML = hours + ':' + minutes + ':' + seconds;

                                if ((seconds < 60) && (seconds > 55)){
                                     goPython();
                                }

The python script is running well when i execute directly from command line : python bunyi.py
i have already tried to change python script file mode to 755 and chown to www-data, unfortunately i didn't get my expected result.

Sorry my English is not good enough.

Thank you so much in advance.


问:
Firebase: Unable to read/write to database after enforcing app check
I am following all the steps accordingly as shown in the app check documentation page.

Initially I registered my web application in the official Google reCAPTCHA v3 website and acquired my private and public key. After that, I registered my private key in the app check section.

After that I added both app check library and firebase to my web-app:

login.js:

```<code>import { initializeAppCheck, ReCaptchaV3Provider} from "https://www.gstatic.com/firebasejs/9.14.0/firebase-app-check.js"
import { initializeApp } from 'https://www.gstatic.com/firebasejs/9.14.0/firebase-app.js';
import { getAuth, onAuthStateChanged, signInAnonymously } from "https://www.gstatic.com/firebasejs/9.14.0/firebase-auth.js";

const firebaseConfig = {
  apiKey: "key here",
  authDomain: "project.firebaseapp.com",
  projectId: "project_id",
  storageBucket: "project.appspot.com",
  messagingSenderId: "sender_id",
  databaseURL: "https://project.firebaseio.com",
  appId: "app_id"
};
const app = initializeApp(firebaseConfig);
const auth = getAuth();

signInAnonymously(auth).then(() => {
    onAuthStateChanged(auth, (user) => {
        if (user) {
            const appCheck = initializeAppCheck(app, {
                provider: new ReCaptchaV3Provider('reCAPTCHA v3 public key'),
                isTokenAutoRefreshEnabled: true
            });
            window.open("/index.html", "_self");
        }
    });
})
.catch((error) => {
    const errorCode = error.code;
    const errorMessage = error.message;
    alert(errorCode+": "+errorMessage);
});
</code>```

index.js:

```<code>const firebaseConfig = {
  apiKey: "key here",
  authDomain: "project.firebaseapp.com",
  projectId: "project_id",
  storageBucket: "project.appspot.com",
  messagingSenderId: "sender_id",
  databaseURL: "https://project.firebaseio.com",
  appId: "app_id"
};
const app = firebase.initializeApp(firebaseConfig);
firebase.database().ref("ac/0/").set(null);

//some code here to populate the array which is to be pushed into my firebase db

for(var i=0; i<arr.length; i++){
    var db_values = {
        "Current Date":arr[i][0],
        "EmpNo":arr[i][1],
        "Flag":arr[i][2],
        "Prev Date":arr[i][3],
        "Total charge":arr[i][4]
    };
    firebase.database().ref("ac/0/").push(db_values);
}
</code>```

After logging in, no data is being pushed into my realtime database, whereas I keep getting the following warning in my console:

FIREBASE WARNING: Missing appcheck token (https://project_name.firebaseio.com/)

If I go to the console, and unenforce app check, only then the data is pushed. Why is that? Where am I going wrong?

Body:
I am following all the steps accordingly as shown in the app check documentation page.

Initially I registered my web application in the official Google reCAPTCHA v3 website and acquired my private and public key. After that, I registered my private key in the app check section.

After that I added both app check library and firebase to my web-app:

login.js:

import { initializeAppCheck, ReCaptchaV3Provider} from "https://www.gstatic.com/firebasejs/9.14.0/firebase-app-check.js"
import { initializeApp } from 'https://www.gstatic.com/firebasejs/9.14.0/firebase-app.js';
import { getAuth, onAuthStateChanged, signInAnonymously } from "https://www.gstatic.com/firebasejs/9.14.0/firebase-auth.js";

const firebaseConfig = {
  apiKey: "key here",
  authDomain: "project.firebaseapp.com",
  projectId: "project_id",
  storageBucket: "project.appspot.com",
  messagingSenderId: "sender_id",
  databaseURL: "https://project.firebaseio.com",
  appId: "app_id"
};
const app = initializeApp(firebaseConfig);
const auth = getAuth();

signInAnonymously(auth).then(() => {
    onAuthStateChanged(auth, (user) => {
        if (user) {
            const appCheck = initializeAppCheck(app, {
                provider: new ReCaptchaV3Provider('reCAPTCHA v3 public key'),
                isTokenAutoRefreshEnabled: true
            });
            window.open("/index.html", "_self");
        }
    });
})
.catch((error) => {
    const errorCode = error.code;
    const errorMessage = error.message;
    alert(errorCode+": "+errorMessage);
});

index.js:

const firebaseConfig = {
  apiKey: "key here",
  authDomain: "project.firebaseapp.com",
  projectId: "project_id",
  storageBucket: "project.appspot.com",
  messagingSenderId: "sender_id",
  databaseURL: "https://project.firebaseio.com",
  appId: "app_id"
};
const app = firebase.initializeApp(firebaseConfig);
firebase.database().ref("ac/0/").set(null);

//some code here to populate the array which is to be pushed into my firebase db

for(var i=0; i<arr.length; i++){
    var db_values = {
        "Current Date":arr[i][0],
        "EmpNo":arr[i][1],
        "Flag":arr[i][2],
        "Prev Date":arr[i][3],
        "Total charge":arr[i][4]
    };
    firebase.database().ref("ac/0/").push(db_values);
}

After logging in, no data is being pushed into my realtime database, whereas I keep getting the following warning in my console:

FIREBASE WARNING: Missing appcheck token (https://project_name.firebaseio.com/)

If I go to the console, and unenforce app check, only then the data is pushed. Why is that? Where am I going wrong?