问:
How to make Youtube video in iframe full screen on Android device?
I'm trying to attach a Youtube video from a web page to an iframe.

If I add the 'allowfullscreen' option to the iframe and press the Youtube full screen button within the flutter app, I have confirmed that the Youtube video switches to full screen on iOS.

But there is a bug that does not switch to full screen even if I press the button on Android devices. How should I solve it?

html code (youtube_video.html)

```<code><iframe
        width="320"
        height="180"
        src="https://www.youtube.com/embed/xxxxxxxxxx"
        title="YouTube video player"
        frameborder="0"
        allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
</iframe>
</code>```

flutter source code

```<code>WebView(
  javascriptMode: JavascriptMode.unrestricted,
  initialUrl: "https://xxxxxxx.com/youtube_video.html",
);
</code>```

flutter doctor -v

```<code>[✓] Flutter (Channel stable, 2.10.5, on macOS 12.6.1 21G217 darwin-arm, locale en-KR)
    • Flutter version 2.10.5 at /Users/daniel/fvm/versions/2.10.5
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5464c5bac7 (8 months ago), 2022-04-18 09:55:37 -0700
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /Users/daniel/Library/Android/sdk
    • Platform android-33, build-tools 32.1.0-rc1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)

[✓] VS Code (version 1.64.2)
    • VS Code at /Users/daniel/Downloads/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
    • SM S901N (mobile) • R5CT50PN6BY • android-arm64  • Android 12 (API 31)
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 108.0.5359.124
    ! Device emulator-5554 is offline.

[✓] HTTP Host Availability
    • All required HTTP hosts are available
</code>```
```<code></code>```

Body:
I'm trying to attach a Youtube video from a web page to an iframe.

If I add the 'allowfullscreen' option to the iframe and press the Youtube full screen button within the flutter app, I have confirmed that the Youtube video switches to full screen on iOS.

But there is a bug that does not switch to full screen even if I press the button on Android devices. How should I solve it?

html code (youtube_video.html)

flutter source code

WebView(
  javascriptMode: JavascriptMode.unrestricted,
  initialUrl: "https://xxxxxxx.com/youtube_video.html",
);

flutter doctor -v

[✓] Flutter (Channel stable, 2.10.5, on macOS 12.6.1 21G217 darwin-arm, locale en-KR)
    • Flutter version 2.10.5 at /Users/daniel/fvm/versions/2.10.5
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5464c5bac7 (8 months ago), 2022-04-18 09:55:37 -0700
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /Users/daniel/Library/Android/sdk
    • Platform android-33, build-tools 32.1.0-rc1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)

[✓] VS Code (version 1.64.2)
    • VS Code at /Users/daniel/Downloads/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
    • SM S901N (mobile) • R5CT50PN6BY • android-arm64  • Android 12 (API 31)
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 108.0.5359.124
    ! Device emulator-5554 is offline.

[✓] HTTP Host Availability
    • All required HTTP hosts are available


来源: stackexchange

问:
I want to show occupied slots and available slots of interviewer from users table for a day and for remaining week by selecting date time
I am not an expert in writing postgresql queries, need some help in here.

I am using a tool to make a dashboard retool.com.
I have 2 tables users and interviewers. A user is an interviewer as well as interviewee. When users id is saved as interviewer_id in interviews table he is considered as interviewer, in the same way when the user id is saved as interviewee_id he is considered as interviewee. start_time column in interviews saves the interview start time. interviews_slots column in users table has the interviewer slots in json form.
see the sample data here.

`

```<code>{
  "monday": [
    {
      "start-time": "09:00",
      "end-time": "17:30"
    }
  ],
  "tuesday": [
    {
      "start-time": "09:00",
      "end-time": "17:30"
    }
  ],
  "wednesday": [
    {
      "start-time": "09:00",
      "end-time": "17:30"
    }
  ],
  "thursday": [
    {
      "start-time": "09:00",
      "end-time": "17:30"
    }
  ],
  "friday": [
    {
      "start-time": "09:00",
      "end-time": "17:30"
    }
  ]
}
</code>```

This is my sql statement.

```<code>SELECT users_tbl.id,
  users_tbl.name,
  (select name from users where id = interview_tbl.interviewee_id) as interviewee,
  interview_tbl,start_time,
  interview_tbl.duration,
  interview_slots,
  concat(users_tbl.interview_slots->'monday'->0->'start-time',' - ', users_tbl.interview_slots->'monday'->0->'end-time')
    as Monday,
  concat(users_tbl.interview_slots->'tuesday'->0->'start-time',' - ', users_tbl.interview_slots->'tuesday'->0->'end-time')
    as Tuesday,
  concat(users_tbl.interview_slots->'wednesday'->0->'start-time',' - ', users_tbl.interview_slots->'wednesday'->0->'end-time')
    as Wednesday,
  concat(users_tbl.interview_slots->'thursday'->0->'start-time',' - ', users_tbl.interview_slots->'thursday'->0->'end-time')
    as Thursday,
  concat(users_tbl.interview_slots->'friday'->0->'start-time',' - ', users_tbl.interview_slots->'friday'->0->'end-time')
    as Friday,
  concat(users_tbl.interview_slots->'saturday'->0->'start-time',' - ', users_tbl.interview_slots->'saturday'->0->'end-time')
    as Saturday,
  concat(users_tbl.interview_slots->'sunday'->0->'start-time',' - ',users_tbl.interview_slots->'sunday'->0->'end-time')
    as Sunday
  FROM users as users_tbl
  JOIN interviews interview_tbl
  ON users_tbl.id=interview_tbl.interviewer_id
  AND interview_tbl.created_at >= CURRENT_DATE;
</code>```

I want to query out the data based on the interview start_time
suppose a interview is set for Tuesday i.e 20th Dec at 10:00 am for 1 hour, i need to display a interviewer is available slots for Tuesday like

consider the sample data is used to display

Interviewer
Tuesday occupied slots
Available Slots

Batman
20th Dec at 10:00 am
9:00 - 10:00,

11:00 - 17:30.

Again in need to display similar data for the whole current week.
Thanks in advance.

ContentLicense: CC BY-SA 4.0

Body:
I am not an expert in writing postgresql queries, need some help in here.

I am using a tool to make a dashboard retool.com.
I have 2 tables users and interviewers. A user is an interviewer as well as interviewee. When users id is saved as interviewer_id in interviews table he is considered as interviewer, in the same way when the user id is saved as interviewee_id he is considered as interviewee. start_time column in interviews saves the interview start time. interviews_slots column in users table has the interviewer slots in json form.
see the sample data here.

`

{
  "monday": [
    {
      "start-time": "09:00",
      "end-time": "17:30"
    }
  ],
  "tuesday": [
    {
      "start-time": "09:00",
      "end-time": "17:30"
    }
  ],
  "wednesday": [
    {
      "start-time": "09:00",
      "end-time": "17:30"
    }
  ],
  "thursday": [
    {
      "start-time": "09:00",
      "end-time": "17:30"
    }
  ],
  "friday": [
    {
      "start-time": "09:00",
      "end-time": "17:30"
    }
  ]
}

This is my sql statement.

SELECT users_tbl.id,
  users_tbl.name,
  (select name from users where id = interview_tbl.interviewee_id) as interviewee,
  interview_tbl,start_time,
  interview_tbl.duration,
  interview_slots,
  concat(users_tbl.interview_slots->'monday'->0->'start-time',' - ', users_tbl.interview_slots->'monday'->0->'end-time')
    as Monday,
  concat(users_tbl.interview_slots->'tuesday'->0->'start-time',' - ', users_tbl.interview_slots->'tuesday'->0->'end-time')
    as Tuesday,
  concat(users_tbl.interview_slots->'wednesday'->0->'start-time',' - ', users_tbl.interview_slots->'wednesday'->0->'end-time')
    as Wednesday,
  concat(users_tbl.interview_slots->'thursday'->0->'start-time',' - ', users_tbl.interview_slots->'thursday'->0->'end-time')
    as Thursday,
  concat(users_tbl.interview_slots->'friday'->0->'start-time',' - ', users_tbl.interview_slots->'friday'->0->'end-time')
    as Friday,
  concat(users_tbl.interview_slots->'saturday'->0->'start-time',' - ', users_tbl.interview_slots->'saturday'->0->'end-time')
    as Saturday,
  concat(users_tbl.interview_slots->'sunday'->0->'start-time',' - ',users_tbl.interview_slots->'sunday'->0->'end-time')
    as Sunday
  FROM users as users_tbl
  JOIN interviews interview_tbl
  ON users_tbl.id=interview_tbl.interviewer_id
  AND interview_tbl.created_at >= CURRENT_DATE;

I want to query out the data based on the interview start_time
suppose a interview is set for Tuesday i.e 20th Dec at 10:00 am for 1 hour, i need to display a interviewer is available slots for Tuesday like

consider the sample data is used to display

Interviewer
Tuesday occupied slots
Available Slots

Batman
20th Dec at 10:00 am
9:00 - 10:00,

11:00 - 17:30.

Again in need to display similar data for the whole current week.
Thanks in advance.


问:
Mapping URL parameters with hyphens to object in Spring Web MVC without extending ServletModelAttributeMethodProcessor
Ideally request parameters should be case insensitive.

How can request parameters with hyphens be mapped to a java POJO without extending ServletModelAttributeMethodProcessor in Spring Web MVC?

Tried some common solution:
Mapping URL parameters with dashes to object in Spring Web MVC

This works fine.

Trying to find some other workaround.....


问:
[unixODBC][Driver Manager]Can't open lib '/home/odbc/sample_connections/inception/odbc.so' : file not found
Trying to write a sample odbc driver ,

on running

iusql -v "CLICKHOUSE"

getting the error

[unixODBC][Driver Manager]Can't open lib '/home/odbc/sample_connections/inception/odbc.so' : file not found [ISQL]ERROR: Could not SQLDriverConnect

but the file exists

on running

ldd -v /home/odbc/sample_connections/inception/odbc.so

getting the following

```<code>linux-vdso.so.1 (0x0000ffff8dcd4000)
        libstdc++.so.6 => /lib/aarch64-linux-gnu/libstdc++.so.6 (0x0000ffff8da50000)
        libgcc_s.so.1 => /lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000ffff8da20000)
        libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000ffff8d870000)
        /lib/ld-linux-aarch64.so.1 (0x0000ffff8dc9b000)
        libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000ffff8d7d0000)

        Version information:
        /home/odbc/sample_connections/inception/odbc.so:
                libgcc_s.so.1 (GCC_3.0) => /lib/aarch64-linux-gnu/libgcc_s.so.1
                libstdc++.so.6 (CXXABI_1.3) => /lib/aarch64-linux-gnu/libstdc++.so.6
                libstdc++.so.6 (CXXABI_1.3.9) => /lib/aarch64-linux-gnu/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4) => /lib/aarch64-linux-gnu/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4.21) => /lib/aarch64-linux-gnu/libstdc++.so.6
                ld-linux-aarch64.so.1 (GLIBC_2.17) => /lib/ld-linux-aarch64.so.1
                libc.so.6 (GLIBC_2.17) => /lib/aarch64-linux-gnu/libc.so.6
        /lib/aarch64-linux-gnu/libstdc++.so.6:
                ld-linux-aarch64.so.1 (GLIBC_2.17) => /lib/ld-linux-aarch64.so.1
                libm.so.6 (GLIBC_2.17) => /lib/aarch64-linux-gnu/libm.so.6
                libc.so.6 (GLIBC_2.33) => /lib/aarch64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.25) => /lib/aarch64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.18) => /lib/aarch64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.32) => /lib/aarch64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.17) => /lib/aarch64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.34) => /lib/aarch64-linux-gnu/libc.so.6
                libgcc_s.so.1 (GCC_4.2.0) => /lib/aarch64-linux-gnu/libgcc_s.so.1
                libgcc_s.so.1 (GCC_3.3) => /lib/aarch64-linux-gnu/libgcc_s.so.1
                libgcc_s.so.1 (GCC_3.0) => /lib/aarch64-linux-gnu/libgcc_s.so.1
                libgcc_s.so.1 (GCC_4.5.0) => /lib/aarch64-linux-gnu/libgcc_s.so.1
        /lib/aarch64-linux-gnu/libgcc_s.so.1:
                libc.so.6 (GLIBC_2.35) => /lib/aarch64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.34) => /lib/aarch64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.17) => /lib/aarch64-linux-gnu/libc.so.6
        /lib/aarch64-linux-gnu/libc.so.6:
                ld-linux-aarch64.so.1 (GLIBC_PRIVATE) => /lib/ld-linux-aarch64.so.1
                ld-linux-aarch64.so.1 (GLIBC_2.17) => /lib/ld-linux-aarch64.so.1
        /lib/aarch64-linux-gnu/libm.so.6:
                ld-linux-aarch64.so.1 (GLIBC_2.17) => /lib/ld-linux-aarch64.so.1
                libc.so.6 (GLIBC_PRIVATE) => /lib/aarch64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.17) => /lib/aarch64-linux-gnu/libc.so.6
</code>```

odbc.ini

```<code>[CLICKHOUSE]
Driver=CLICKHOUSE_LOCAL
Description=ClickHouse Local driver
DATABASE=default
HOST=localhost
PORT=9000
FRAMED=0
</code>```

odbcinst.ini

```<code>[CLICKHOUSE_LOCAL]
Driver=/home/odbc/sample_connections/inception/odbc.so
</code>```

The answers present doesn't seem to work. Not able to decode the error.

I tried to check architecture , the odbc.so file is aarch64 , but I am able to connect with clickhouse official driver .so file , and  that is also aarch64.

Body:
Trying to write a sample odbc driver ,

on running

iusql -v "CLICKHOUSE"

getting the error

[unixODBC][Driver Manager]Can't open lib '/home/odbc/sample_connections/inception/odbc.so' : file not found [ISQL]ERROR: Could not SQLDriverConnect

but the file exists

on running

ldd -v /home/odbc/sample_connections/inception/odbc.so

getting the following

linux-vdso.so.1 (0x0000ffff8dcd4000)
        libstdc++.so.6 => /lib/aarch64-linux-gnu/libstdc++.so.6 (0x0000ffff8da50000)
        libgcc_s.so.1 => /lib/aarch64-linux-gnu/libgcc_s.so.1 (0x0000ffff8da20000)
        libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000ffff8d870000)
        /lib/ld-linux-aarch64.so.1 (0x0000ffff8dc9b000)
        libm.so.6 => /lib/aarch64-linux-gnu/libm.so.6 (0x0000ffff8d7d0000)

        Version information:
        /home/odbc/sample_connections/inception/odbc.so:
                libgcc_s.so.1 (GCC_3.0) => /lib/aarch64-linux-gnu/libgcc_s.so.1
                libstdc++.so.6 (CXXABI_1.3) => /lib/aarch64-linux-gnu/libstdc++.so.6
                libstdc++.so.6 (CXXABI_1.3.9) => /lib/aarch64-linux-gnu/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4) => /lib/aarch64-linux-gnu/libstdc++.so.6
                libstdc++.so.6 (GLIBCXX_3.4.21) => /lib/aarch64-linux-gnu/libstdc++.so.6
                ld-linux-aarch64.so.1 (GLIBC_2.17) => /lib/ld-linux-aarch64.so.1
                libc.so.6 (GLIBC_2.17) => /lib/aarch64-linux-gnu/libc.so.6
        /lib/aarch64-linux-gnu/libstdc++.so.6:
                ld-linux-aarch64.so.1 (GLIBC_2.17) => /lib/ld-linux-aarch64.so.1
                libm.so.6 (GLIBC_2.17) => /lib/aarch64-linux-gnu/libm.so.6
                libc.so.6 (GLIBC_2.33) => /lib/aarch64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.25) => /lib/aarch64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.18) => /lib/aarch64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.32) => /lib/aarch64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.17) => /lib/aarch64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.34) => /lib/aarch64-linux-gnu/libc.so.6
                libgcc_s.so.1 (GCC_4.2.0) => /lib/aarch64-linux-gnu/libgcc_s.so.1
                libgcc_s.so.1 (GCC_3.3) => /lib/aarch64-linux-gnu/libgcc_s.so.1
                libgcc_s.so.1 (GCC_3.0) => /lib/aarch64-linux-gnu/libgcc_s.so.1
                libgcc_s.so.1 (GCC_4.5.0) => /lib/aarch64-linux-gnu/libgcc_s.so.1
        /lib/aarch64-linux-gnu/libgcc_s.so.1:
                libc.so.6 (GLIBC_2.35) => /lib/aarch64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.34) => /lib/aarch64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.17) => /lib/aarch64-linux-gnu/libc.so.6
        /lib/aarch64-linux-gnu/libc.so.6:
                ld-linux-aarch64.so.1 (GLIBC_PRIVATE) => /lib/ld-linux-aarch64.so.1
                ld-linux-aarch64.so.1 (GLIBC_2.17) => /lib/ld-linux-aarch64.so.1
        /lib/aarch64-linux-gnu/libm.so.6:
                ld-linux-aarch64.so.1 (GLIBC_2.17) => /lib/ld-linux-aarch64.so.1
                libc.so.6 (GLIBC_PRIVATE) => /lib/aarch64-linux-gnu/libc.so.6
                libc.so.6 (GLIBC_2.17) => /lib/aarch64-linux-gnu/libc.so.6

odbc.ini

[CLICKHOUSE]
Driver=CLICKHOUSE_LOCAL
Description=ClickHouse Local driver
DATABASE=default
HOST=localhost
PORT=9000
FRAMED=0

odbcinst.ini

[CLICKHOUSE_LOCAL]
Driver=/home/odbc/sample_connections/inception/odbc.so

The answers present doesn't seem to work. Not able to decode the error.

I tried to check architecture , the odbc.so file is aarch64 , but I am able to connect with clickhouse official driver .so file , and  that is also aarch64.


问:
Unable to update progress dialog message when there is a for loop inside a thread - Android Java
I tried to update a progress dialog message with percentage every second using a Thread and it worked well. But when I add some for loop codes inside it, the progress dialog message didn't change the percentage. So, why did this happen? Any help would be great. Thank you.</p>
```<code>
pd.show();

Thread thrd = new Thread(){
    @Override
    public void run() {
        while (!isInterrupted()){
            try{
                Thread.sleep(1000);

                if(iteratorAdapter < giAdapter.getSelected().size()) {
                    iteratorAdapter++;
                    int prog = iteratorAdapter*100/giAdapter.getSelected().size();
                    pd.setMessage("Memproses - " + prog + "%");
                } else {
                    pd.dismiss();
                    return;
                }

                    for (int i = 0; i < giAdapter.getSelected().size(); i++) {
                        databaseReference2GI.child(giAdapter.getSelected().get(i).getGiUID()).updateChildren(stringHashMap).addOnSuccessListener(new OnSuccessListener<Void>() {
                            @Override
                            public void onSuccess(Void unused) {
                                pd.dismiss();
                                binding.fabExpandMenu.animate().translationY(0).setDuration(100).start();
                                binding.btnSelectAll.setImageDrawable(AppCompatResources.getDrawable(c, R.drawable.ic_outline_select_all));

                                binding.llBottomSelectionOptions.animate()
                                        .translationY(binding.llBottomSelectionOptions.getHeight()).alpha(0.0f)
                                        .setListener(new AnimatorListenerAdapter() {
                                            @Override
                                            public void onAnimationEnd(Animator animation) {
                                                super.onAnimationEnd(animation);
                                                binding.llBottomSelectionOptions.setVisibility(View.GONE);
                                            }
                                        });
                                dialogInterface.dismiss();
                            }
                        });
                    }

                myHandler.post(runnable);
            } catch (InterruptedException e){
                e.printStackTrace();
            }
        }
        super.run();
    }
};

thrd.start();

</code>```

Body:
I tried to update a progress dialog message with percentage every second using a Thread and it worked well. But when I add some for loop codes inside it, the progress dialog message didn't change the percentage. So, why did this happen? Any help would be great. Thank you.

pd.show();

Thread thrd = new Thread(){
    @Override
    public void run() {
        while (!isInterrupted()){
            try{
                Thread.sleep(1000);

                if(iteratorAdapter < giAdapter.getSelected().size()) {
                    iteratorAdapter++;
                    int prog = iteratorAdapter*100/giAdapter.getSelected().size();
                    pd.setMessage("Memproses - " + prog + "%");
                } else {
                    pd.dismiss();
                    return;
                }

                    for (int i = 0; i < giAdapter.getSelected().size(); i++) {
                        databaseReference2GI.child(giAdapter.getSelected().get(i).getGiUID()).updateChildren(stringHashMap).addOnSuccessListener(new OnSuccessListener<Void>() {
                            @Override
                            public void onSuccess(Void unused) {
                                pd.dismiss();
                                binding.fabExpandMenu.animate().translationY(0).setDuration(100).start();
                                binding.btnSelectAll.setImageDrawable(AppCompatResources.getDrawable(c, R.drawable.ic_outline_select_all));

                                binding.llBottomSelectionOptions.animate()
                                        .translationY(binding.llBottomSelectionOptions.getHeight()).alpha(0.0f)
                                        .setListener(new AnimatorListenerAdapter() {
                                            @Override
                                            public void onAnimationEnd(Animator animation) {
                                                super.onAnimationEnd(animation);
                                                binding.llBottomSelectionOptions.setVisibility(View.GONE);
                                            }
                                        });
                                dialogInterface.dismiss();
                            }
                        });
                    }

                myHandler.post(runnable);
            } catch (InterruptedException e){
                e.printStackTrace();
            }
        }
        super.run();
    }
};

thrd.start();


问:
Tailwind cached issue with Next Js and netilfy
I',m Tailwind css for my Next project and it looks like it is not getting cached.

Website URL: https://elaborate-hotteok-0c5bac.netlify.app

Do I need to do something to make sure the static content like CSS and basic JS should get chached on the production?

Here is the SS even after loading the page twice

```<code>https://prnt.sc/rt3d2rGKORrV
https://prnt.sc/2bLNlII1QcIB
</code>```

And here is my tailwind config file

```<code>module.exports = {
  content: [
    './pages/**/*.{js,ts,jsx,tsx}',
    './components/**/*.{js,ts,jsx,tsx}',
    './app/**/*.{js,ts,jsx,tsx}',
    './templates/**/*.{js,ts,jsx,tsx}',
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}
</code>```

And next config file

```<code>module.exports = {
  reactStrictMode: false,
  images: {
    remotePatterns: [
      {
        protocol: 'https',
        hostname: 'cdn.shopify.com',
      },
    ],
  },
}
</code>```

enter code here

Body:
I',m Tailwind css for my Next project and it looks like it is not getting cached.

Website URL: https://elaborate-hotteok-0c5bac.netlify.app

Do I need to do something to make sure the static content like CSS and basic JS should get chached on the production?

Here is the SS even after loading the page twice

https://prnt.sc/rt3d2rGKORrV
https://prnt.sc/2bLNlII1QcIB

And here is my tailwind config file

module.exports = {
  content: [
    './pages/**/*.{js,ts,jsx,tsx}',
    './components/**/*.{js,ts,jsx,tsx}',
    './app/**/*.{js,ts,jsx,tsx}',
    './templates/**/*.{js,ts,jsx,tsx}',
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}

And next config file

module.exports = {
  reactStrictMode: false,
  images: {
    remotePatterns: [
      {
        protocol: 'https',
        hostname: 'cdn.shopify.com',
      },
    ],
  },
}

enter code here


问:
How to retrieve email address used by logged-in user in AzureAdB2c
I can get the ClaimsPrincipal from an authenticated user in AzureAdB2C. However, I want to retrieve the email address used to log-in.  The claims from the ID token includes a claim.Type = "emails" with value of an array of email strings(eg. '["someone@email.com"]').
How to retrieve that email string?

```<code>// Defines list of claim types that will be displayed after successful sign-in.
private string[] returnClaims = { "idp", "name", "oid", "emails" };
private string[] returnEmails = { "emails" };

</code>```
```<code>// Gets an AuthenticationState that describes the current user.
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();

var user = authState.User;

// Checks if the user has been authenticated.
if (user.Identity.IsAuthenticated)
{
_authMessage = $"{user.Identity.Name} is authenticated.";

// Sets the claims value in _claims variable.
// The claims mentioned in returnClaims variable are selected only.
_claims = user.Claims.Where(x => returnClaims.Contains(x.Type));
var emails = _claims.Where(x => returnEmails.Contains(x.Type));
var emailclaim = emails.First();
var _emailloggedin = emailclaim.Value.ToString();
}
</code>```

The _emailloggedin variable returns an empty string.  I am not familiar with the encoding used.

Body:
I can get the ClaimsPrincipal from an authenticated user in AzureAdB2C. However, I want to retrieve the email address used to log-in.  The claims from the ID token includes a claim.Type = "emails" with value of an array of email strings(eg. '["someone@email.com"]').
How to retrieve that email string?

// Defines list of claim types that will be displayed after successful sign-in.
private string[] returnClaims = { "idp", "name", "oid", "emails" };
private string[] returnEmails = { "emails" };

// Gets an AuthenticationState that describes the current user.
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();

var user = authState.User;

// Checks if the user has been authenticated.
if (user.Identity.IsAuthenticated)
{
_authMessage = $"{user.Identity.Name} is authenticated.";

// Sets the claims value in _claims variable.
// The claims mentioned in returnClaims variable are selected only.
_claims = user.Claims.Where(x => returnClaims.Contains(x.Type));
var emails = _claims.Where(x => returnEmails.Contains(x.Type));
var emailclaim = emails.First();
var _emailloggedin = emailclaim.Value.ToString();
}

The _emailloggedin variable returns an empty string.  I am not familiar with the encoding used.


问:
Trying to understand this non-recursive Heap's Permutation Algorithm
Right now I'm trying to understand why a certain non-recursive implementation of the Heap's Permutation Algorithm works. I implemented some code of this particular version of the algorithm in python, but I don't understand the logic behind what makes it work.

```<code>def element_swap(str_list, i1, i2):
    last = str_list[i1]
    last_swapee = str_list[i2]
    str_list[i1] = last_swapee
    str_list[i2] = last

def theRealPermuator(str_input):
    generated_permutations = [str_input]
    permute_this = list(str_input)
    length = len(permute_this)
    c = [0 for i in range(length)]
    i = 0
    while i < length:
        if c[i] < i:
            if i%2 == 0:
                element_swap(permute_this, 0, i)
            else:
                element_swap(permute_this, c[i], i)
            generated_permutations.append(''.join(permute_this))
            c[i] += 1
            i = 0
        else:
            c[i] = 0
            i += 1
    return generated_permutations

print(theRealPermuator('ABC'))

</code>```

Output: ['ABC', 'BAC', 'CAB', 'ACB', 'BCA', 'CBA']

I implemented the python code from the algorithm listed at this site:
https://www.baeldung.com/cs/array-generate-all-permutations
(see: 4.2. Non-Recursive Heap’s Algorithm)

Would anyone be able to explain the logic behind how this code generates the Output?

Body:
Right now I'm trying to understand why a certain non-recursive implementation of the Heap's Permutation Algorithm works. I implemented some code of this particular version of the algorithm in python, but I don't understand the logic behind what makes it work.

def element_swap(str_list, i1, i2):
    last = str_list[i1]
    last_swapee = str_list[i2]
    str_list[i1] = last_swapee
    str_list[i2] = last

def theRealPermuator(str_input):
    generated_permutations = [str_input]
    permute_this = list(str_input)
    length = len(permute_this)
    c = [0 for i in range(length)]
    i = 0
    while i < length:
        if c[i] < i:
            if i%2 == 0:
                element_swap(permute_this, 0, i)
            else:
                element_swap(permute_this, c[i], i)
            generated_permutations.append(''.join(permute_this))
            c[i] += 1
            i = 0
        else:
            c[i] = 0
            i += 1
    return generated_permutations

print(theRealPermuator('ABC'))

Output: ['ABC', 'BAC', 'CAB', 'ACB', 'BCA', 'CBA']

I implemented the python code from the algorithm listed at this site:
https://www.baeldung.com/cs/array-generate-all-permutations
(see: 4.2. Non-Recursive Heap’s Algorithm)

Would anyone be able to explain the logic behind how this code generates the Output?


问:
SQS sendMessage successful but message does not show up on the AWS console
I have a method that sends a message to a SQS Standard queue. The method returns a successful response upon execution. But the console does not show any messages in the queue. Any ideas on what could be the reason this is happening?? Can provide a code snippet if that is helpful. Thanks!

Visibility timeout has been set to 10 minutes.


问:
The current domain is not authorized for OAuth operations
The current domain is not authorized for OAuth operations. This will prevent signInWithPopup, signInWithRedirect, linkWithPopup and linkWithRedirect from working. Add your domain to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.

its working fine when i try to in localhost but if i host my project in netlify then its send me this error The current domain is not authorized for OAuth operations


问:
Network topology is not adding ghost nodes from monitoring points (ARCMAP 10.8, geofabric v3, BOM)
When I try to "Update network topology from ghost nodes" using the Australian bureau of meteorology 'geofabric', the upated layer does not add any ghost nodes from my database.

I have checked the ghost node database to make sure all the feature classes are correct.


问:
How to set Date validity
To set date validity only for 15 days after that the data should be refreshing and show new data it was done by every 15 days once. How to I format code for that.

```<code>StreamBuilder<QuerySnapshot>(stream: FirebaseFirestore.instance .collection("Business Slip")
.where("Date",isGreaterThanOrEqualTo:DateTime.now().subtract(Duration(minutes: 2))) .snapshots(),
</code>```

This is my code but its not working.

Title: How to set Date validity

Body:
To set date validity only for 15 days after that the data should be refreshing and show new data it was done by every 15 days once. How to I format code for that.

StreamBuilder<QuerySnapshot>(stream: FirebaseFirestore.instance .collection("Business Slip")
.where("Date",isGreaterThanOrEqualTo:DateTime.now().subtract(Duration(minutes: 2))) .snapshots(),

This is my code but its not working.


问:
Backward compatibility issues with SparkML Model migration from scala 2.11 to scala 2.12
We're migrating our MLpipeline from Spark 2.4(scala 2.11.11) to Spark 3.3.0(scala 2.12.17) we were not able to read the existing MLModel with spark 3.
This is because scala won’t support BC with major release upgrade.
Seems this is not a Spark issue, As I was able to load the PipelineModel.
The issue that I am facing now is we're storing a case class as binary object which is having Map datatype in scala 2.11.11 and trying to read that object file back with scala 2.12.17.
While doing that I am getting the below exception,

```<code>java.io.InvalidClassException: scala.collection.immutable.Map$Map4; local class incompatible: stream classdesc serialVersionUID = -7746713615561179240, local class serialVersionUID = -7992135791595275193
</code>```

Sample case class(just adding one column here):
case class LearningModelOutput(
transformerState: Map[String, Any])

The object that we're storing is like

```<code>0 = {Tuple2@8285} (targetColumn,)
1 = {Tuple2@8286} (consideredColumns,[Ljava.lang.String;@35b49c11)
2 = {Tuple2@8287} (schema,StructType(StructField(col1,IntegerType,true), StructField(col2,LongType,true
3 = {Tuple2@8288} (transformerStages,Map())
</code>```

When trying to read this objectfile using spark.sparkcontext.objectfileMap[String, Any]
getting the above mentioned serialization error.

Body:
We're migrating our MLpipeline from Spark 2.4(scala 2.11.11) to Spark 3.3.0(scala 2.12.17) we were not able to read the existing MLModel with spark 3.
This is because scala won’t support BC with major release upgrade.
Seems this is not a Spark issue, As I was able to load the PipelineModel.
The issue that I am facing now is we're storing a case class as binary object which is having Map datatype in scala 2.11.11 and trying to read that object file back with scala 2.12.17.
While doing that I am getting the below exception,

java.io.InvalidClassException: scala.collection.immutable.Map$Map4; local class incompatible: stream classdesc serialVersionUID = -7746713615561179240, local class serialVersionUID = -7992135791595275193

Sample case class(just adding one column here):
case class LearningModelOutput(
transformerState: Map[String, Any])

The object that we're storing is like

0 = {Tuple2@8285} (targetColumn,)
1 = {Tuple2@8286} (consideredColumns,[Ljava.lang.String;@35b49c11)
2 = {Tuple2@8287} (schema,StructType(StructField(col1,IntegerType,true), StructField(col2,LongType,true
3 = {Tuple2@8288} (transformerStages,Map())

When trying to read this objectfile using spark.sparkcontext.objectfileMap[String, Any]
getting the above mentioned serialization error.


问:
getting these errors when opening maven project in Eclipse
Some info:

I selected J2EE/Web developer when installing Eclipse

I have not installed any other plugin after installing Eclipse.

I checked marketplace and it seems m2e is installed as part of the install configuration I selected.

When importing the maven project into Eclipse, I get the error below (see image).

When I tried running "mvn clean install" from inside Eclipse (via run maven run configurations), I get an error (full error text below)

On IntelliJ community edition, I have no problem importing the maven project and running "mvn clean install"

On my terminal, I have no problem running "mvn clean install".

Any ideas on how to fix? Thanks

Eclipse import error

Full Eclipse mvn clean install error

```<code>[ERROR] Failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.7:clean(default) on project cbus-portals-features:Execution default of goal org.codehaus.mojo:cobertura-maven-plugin:2.7:clean failed: Plugin org.codehaus.mojo:cobertura-maven-plugin:2.7 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:0 at specified path C:\Users\myuser\.p2\pool\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.5.v20221102-0933\jre/../lib/tools.jar
</code>```

Body:
Some info:

I selected J2EE/Web developer when installing Eclipse

I have not installed any other plugin after installing Eclipse.

I checked marketplace and it seems m2e is installed as part of the install configuration I selected.

When importing the maven project into Eclipse, I get the error below (see image).

When I tried running "mvn clean install" from inside Eclipse (via run maven run configurations), I get an error (full error text below)

On IntelliJ community edition, I have no problem importing the maven project and running "mvn clean install"

On my terminal, I have no problem running "mvn clean install".

Any ideas on how to fix? Thanks

Eclipse import error

Full Eclipse mvn clean install error

[ERROR] Failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.7:clean(default) on project cbus-portals-features:Execution default of goal org.codehaus.mojo:cobertura-maven-plugin:2.7:clean failed: Plugin org.codehaus.mojo:cobertura-maven-plugin:2.7 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:0 at specified path C:\Users\myuser\.p2\pool\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.5.v20221102-0933\jre/../lib/tools.jar


问:
How to prevent url to load within same webview for single page application
I want to stop loading the url in same webview when clicking any item within the webpage.

for this I have tried shouldoverrideurlloading() but its not catching the url so not able to override it.

our application is single page application that may be reason due to which shouldOverrideUrlLoading() is not getting called.

```<code>@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
       final Uri uri = Uri.parse(url);
       return handleUri(view,uri);

}
@TargetApi(Build.VERSION_CODES.N)
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
       final Uri uri = request.getUrl();
       return handleUri(view, uri);
}
private boolean handleUri(WebView view,final Uri uri){
        if (uri.toString().contains("messages") || uri.toString().contains("proddetail") ||   uri.toString().contains("about-us")) {
            Intent intent = new Intent(webActivity.this, nativeActivity.class);
            startActivity(intent);
            return true;
 }
return true;
}
</code>```

In this its not catching url containing messages..

Another method I have tried is catching url using doUpdateVisitedHistory() and using view.stoploading() for stopping the loading of url within same webview.

```<code>@Override
public void doUpdateVisitedHistory(WebView view, String url,boolean isReload) {

if ( url.contains("messages"))
{
 final Handler handler = new Handler(Looper.getMainLooper());
 handler.postDelayed(new Runnable() {
@Override
 public void run() {
                   view.stopLoading();
                   //opening new fragment
                   SharedFunctions.getInstance().replaceFragment(CompanyPage.this, new   CompanyPage(uri.toString().replace("www","m")), "Messages", getActivity().getSupportFragmentManager(), true, true);

}
}, 1000);
                                         }
</code>```

Using this the loading of url is not stopping as when coming back to previous fragment that loading has been done in webview.

Body:
I want to stop loading the url in same webview when clicking any item within the webpage.

for this I have tried shouldoverrideurlloading() but its not catching the url so not able to override it.

our application is single page application that may be reason due to which shouldOverrideUrlLoading() is not getting called.

@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
       final Uri uri = Uri.parse(url);
       return handleUri(view,uri);

}
@TargetApi(Build.VERSION_CODES.N)
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
       final Uri uri = request.getUrl();
       return handleUri(view, uri);
}
private boolean handleUri(WebView view,final Uri uri){
        if (uri.toString().contains("messages") || uri.toString().contains("proddetail") ||   uri.toString().contains("about-us")) {
            Intent intent = new Intent(webActivity.this, nativeActivity.class);
            startActivity(intent);
            return true;
 }
return true;
}

In this its not catching url containing messages..

Another method I have tried is catching url using doUpdateVisitedHistory() and using view.stoploading() for stopping the loading of url within same webview.

@Override
public void doUpdateVisitedHistory(WebView view, String url,boolean isReload) {

if ( url.contains("messages"))
{
 final Handler handler = new Handler(Looper.getMainLooper());
 handler.postDelayed(new Runnable() {
@Override
 public void run() {
                   view.stopLoading();
                   //opening new fragment
                   SharedFunctions.getInstance().replaceFragment(CompanyPage.this, new   CompanyPage(uri.toString().replace("www","m")), "Messages", getActivity().getSupportFragmentManager(), true, true);

}
}, 1000);
                                         }

Using this the loading of url is not stopping as when coming back to previous fragment that loading has been done in webview.


问:
changing position of image or view during animation is not working as expected in SwiftUI
I am trying to build walkthrough pop up tip and i want to change of pop up position once the user move to next walkthrough pop up tip. Unfortunately, changing or adding new image or view in current animation view is not working as expected. Newly added image or change in position will make the view get detached from parent view. I tried delay, it worked in Xcode 13 but in Xcode 14 it is not working.
https://i.stack.imgur.com/QFbuc.gif</p>
```<code>struct ContentView: View {
    var walkthroughs: [Walkthrough] = Walkthrough.allCases
    @State var currentIndex = 0
    @State var bounceAnimation: Bool = true

    var body: some View {

        ZStack {
            VStack(alignment: .leading) {
                popTipView(with: walkthroughs[currentIndex])
            }
            VStack {
                Spacer()
                Button("Tap here") {
                        currentIndex += 1
                            withAnimation(.linear(duration: 1.5).repeatForever(autoreverses: true)) {
                                self.bounceAnimation.toggle()
                            }
                }
            }
        }
    }

    private func popTipView(with currentWalkthrough: Walkthrough) -> some View {
        PopTipSwiftUI(walkThrough: currentWalkthrough)
            .offset(x: currentWalkthrough.position.x,
                    y: bounceAnimation ? currentWalkthrough.position.y : currentWalkthrough.position.y - 8)
    }
}

enum Walkthrough: CaseIterable {
    case first
    case second
    case third
    case fourth
    case fifth

    var position: CGPoint {
        switch self {
        case .first:
            return CGPoint(x: 0, y: -200)
        case .second:
            return CGPoint(x: 0, y: 100)
        case .third:
            return CGPoint(x: -20, y: 200)
        case .fourth:
            return CGPoint(x: -20, y: 50)
        case .fifth:
            return CGPoint(x: -20, y: 250)

        }
    }
    var alignment: PopTipAlignment {
        switch self {
        case .first:
            return .topLeft
        case .second:
            return .topRight
        case .third:
            return .bottomCenter
        case .fourth:
            return .topLeft
        case .fifth:
            return .topCenter
        }
    }

    var message: String {
        return "Lorem Ipsum is simply dummy text of the printing and typesetting industry."
    }

    var leftImage: String? {
        switch self {
        case .third:
            return "eye.slash"
        default:
            return nil
        }
    }
}

enum PopTipAlignment {
    case topLeft
    case topRight
    case topCenter
    case bottomCenter
    case bottomLeft
    case bottomRight

    var horizontalAlignment: SwiftUI.HorizontalAlignment {
        switch self {
            case .topLeft, .bottomLeft:
                return .leading
            case .topCenter, .bottomCenter:
                return .center
            default:
                return .trailing
        }
    }

    var offSet: CGFloat {
        switch self {
            case .topLeft, .bottomLeft:
                return 24
            case .topCenter, .bottomCenter:
                return 0
            default:
                return -16
        }
    }
}

struct PopTipSwiftUI: View {

    // MARK: Public APIs
    var walkThrough: Walkthrough = .first

    // MARK: Private properties
    private var alignment: PopTipAlignment {
        walkThrough.alignment
    }

    // MARK: Initialiser
    var body: some View {
        VStack(alignment: walkThrough.alignment.horizontalAlignment, spacing: -Constant.spacing) {
            if alignment == .topLeft || alignment == .topCenter || alignment == .topRight {
                triangularPointer
            }
            textContainerView
            if alignment == .bottomLeft || alignment == .bottomCenter || alignment == .bottomRight {
                triangularPointer
                    .rotationEffect(.radians(.pi))

            }
        }
        .frame(maxWidth: Constant.maxWidth)
        .background(Color.clear)
    }

    // MARK: UI setup
    private var textContainerView: some View {
        HStack(alignment: .center) {
            horizontalSpacerView
            VStack {
                verticalSpacerView
                textView
                verticalSpacerView
            }
            horizontalSpacerView
        }
        .background(Color.black.opacity(Constant.bgOpacity))
        .cornerRadius(Constant.cornerRadius)
    }

    private var textView: some View {
        HStack(spacing: Constant.textViewSpacing) {
            leftImage
            Text(walkThrough.message)
                .font(.subheadline)
                .multilineTextAlignment(.leading)
                .foregroundColor(Color.white)
                rightChevronContainerView
        }
    }

    // MARK: UI components
    @ViewBuilder
    private var leftImage: some View {
        if let leftImage = walkThrough.leftImage {
            VStack {
                Image(systemName: leftImage)
                    .resizable()
                    .frame(width: Constant.leftImageWidth, height: Constant.leftImageHeight)
            }
            .frame(width: Constant.leftImageWidth, height: Constant.leftImageHeight)
        } else {
            EmptyView()
        }

    }

    private var rightChevronContainerView: some View {
        VStack(alignment: .center) {
            Image(systemName: "chevron.right")
                .resizable()
                .frame(width: Constant.chevronWidth, height: Constant.chevronHeight)
                .foregroundColor(Color.green)
        }
        .frame(width: Constant.chevronContainerWidth, height: Constant.chevronContainerHeight)
        .background(Color.black.opacity(Constant.chevronContainerOpacity))
        .cornerRadius(Constant.chevronContainerRadius)
    }

    private var triangularPointer: some View {
        VStack {
            Triangle()
                .fill(Color.black.opacity(Constant.bgOpacity))
        }
        .frame(width: Constant.triangleSize, height: Constant.triangleSize)
        .offset(x: alignment.offSet)
    }

    private var horizontalSpacerView: some View {
        Spacer()
            .frame(width: Constant.spacerWidth)
    }

    private var verticalSpacerView: some View {
        Spacer()
            .frame(height: Constant.spacerHeight)
    }

    // MARK: Constants
    private enum Constant {
        static let spacerHeight: CGFloat = 20
        static let spacerWidth: CGFloat = 20
        static let cornerRadius: CGFloat = 19
        static let bgOpacity: CGFloat = 0.80
        static let maxWidth: CGFloat = 300
        static let spacing: CGFloat = 0.5
        static let triangleSize: CGFloat = 8
        static let chevronWidth: CGFloat = 4
        static let chevronHeight: CGFloat = 8
        static let chevronContainerHeight: CGFloat = 28
        static let chevronContainerWidth: CGFloat = 40
        static let chevronContainerOpacity: CGFloat = 0.85
        static let chevronContainerRadius: CGFloat = 19
        static let leftImageWidth: CGFloat = 40
        static let leftImageHeight: CGFloat = 28
        static let textViewSpacing: CGFloat = 8
    }
}

struct Triangle: Shape {
    func path(in rect: CGRect) -> Path {
        var path = Path()
        path.move(to: CGPoint(x: rect.midX, y: rect.minY))
        path.addLine(to: CGPoint(x: rect.minX, y: rect.maxY))
        path.addLine(to: CGPoint(x: rect.maxX, y: rect.maxY))
        path.addLine(to: CGPoint(x: rect.midX, y: rect.minY))
        return path
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

[![enter image description here][1]][1]

https://i.stack.imgur.com/QFbuc.gif
</code>```

Body:
I am trying to build walkthrough pop up tip and i want to change of pop up position once the user move to next walkthrough pop up tip. Unfortunately, changing or adding new image or view in current animation view is not working as expected. Newly added image or change in position will make the view get detached from parent view. I tried delay, it worked in Xcode 13 but in Xcode 14 it is not working.
https://i.stack.imgur.com/QFbuc.gif

struct ContentView: View {
    var walkthroughs: [Walkthrough] = Walkthrough.allCases
    @State var currentIndex = 0
    @State var bounceAnimation: Bool = true

    var body: some View {

        ZStack {
            VStack(alignment: .leading) {
                popTipView(with: walkthroughs[currentIndex])
            }
            VStack {
                Spacer()
                Button("Tap here") {
                        currentIndex += 1
                            withAnimation(.linear(duration: 1.5).repeatForever(autoreverses: true)) {
                                self.bounceAnimation.toggle()
                            }
                }
            }
        }
    }

    private func popTipView(with currentWalkthrough: Walkthrough) -> some View {
        PopTipSwiftUI(walkThrough: currentWalkthrough)
            .offset(x: currentWalkthrough.position.x,
                    y: bounceAnimation ? currentWalkthrough.position.y : currentWalkthrough.position.y - 8)
    }
}

enum Walkthrough: CaseIterable {
    case first
    case second
    case third
    case fourth
    case fifth

    var position: CGPoint {
        switch self {
        case .first:
            return CGPoint(x: 0, y: -200)
        case .second:
            return CGPoint(x: 0, y: 100)
        case .third:
            return CGPoint(x: -20, y: 200)
        case .fourth:
            return CGPoint(x: -20, y: 50)
        case .fifth:
            return CGPoint(x: -20, y: 250)

        }
    }
    var alignment: PopTipAlignment {
        switch self {
        case .first:
            return .topLeft
        case .second:
            return .topRight
        case .third:
            return .bottomCenter
        case .fourth:
            return .topLeft
        case .fifth:
            return .topCenter
        }
    }

    var message: String {
        return "Lorem Ipsum is simply dummy text of the printing and typesetting industry."
    }

    var leftImage: String? {
        switch self {
        case .third:
            return "eye.slash"
        default:
            return nil
        }
    }
}

enum PopTipAlignment {
    case topLeft
    case topRight
    case topCenter
    case bottomCenter
    case bottomLeft
    case bottomRight

    var horizontalAlignment: SwiftUI.HorizontalAlignment {
        switch self {
            case .topLeft, .bottomLeft:
                return .leading
            case .topCenter, .bottomCenter:
                return .center
            default:
                return .trailing
        }
    }

    var offSet: CGFloat {
        switch self {
            case .topLeft, .bottomLeft:
                return 24
            case .topCenter, .bottomCenter:
                return 0
            default:
                return -16
        }
    }
}

struct PopTipSwiftUI: View {

    // MARK: Public APIs
    var walkThrough: Walkthrough = .first

    // MARK: Private properties
    private var alignment: PopTipAlignment {
        walkThrough.alignment
    }

    // MARK: Initialiser
    var body: some View {
        VStack(alignment: walkThrough.alignment.horizontalAlignment, spacing: -Constant.spacing) {
            if alignment == .topLeft || alignment == .topCenter || alignment == .topRight {
                triangularPointer
            }
            textContainerView
            if alignment == .bottomLeft || alignment == .bottomCenter || alignment == .bottomRight {
                triangularPointer
                    .rotationEffect(.radians(.pi))

            }
        }
        .frame(maxWidth: Constant.maxWidth)
        .background(Color.clear)
    }

    // MARK: UI setup
    private var textContainerView: some View {
        HStack(alignment: .center) {
            horizontalSpacerView
            VStack {
                verticalSpacerView
                textView
                verticalSpacerView
            }
            horizontalSpacerView
        }
        .background(Color.black.opacity(Constant.bgOpacity))
        .cornerRadius(Constant.cornerRadius)
    }

    private var textView: some View {
        HStack(spacing: Constant.textViewSpacing) {
            leftImage
            Text(walkThrough.message)
                .font(.subheadline)
                .multilineTextAlignment(.leading)
                .foregroundColor(Color.white)
                rightChevronContainerView
        }
    }

    // MARK: UI components
    @ViewBuilder
    private var leftImage: some View {
        if let leftImage = walkThrough.leftImage {
            VStack {
                Image(systemName: leftImage)
                    .resizable()
                    .frame(width: Constant.leftImageWidth, height: Constant.leftImageHeight)
            }
            .frame(width: Constant.leftImageWidth, height: Constant.leftImageHeight)
        } else {
            EmptyView()
        }

    }

    private var rightChevronContainerView: some View {
        VStack(alignment: .center) {
            Image(systemName: "chevron.right")
                .resizable()
                .frame(width: Constant.chevronWidth, height: Constant.chevronHeight)
                .foregroundColor(Color.green)
        }
        .frame(width: Constant.chevronContainerWidth, height: Constant.chevronContainerHeight)
        .background(Color.black.opacity(Constant.chevronContainerOpacity))
        .cornerRadius(Constant.chevronContainerRadius)
    }

    private var triangularPointer: some View {
        VStack {
            Triangle()
                .fill(Color.black.opacity(Constant.bgOpacity))
        }
        .frame(width: Constant.triangleSize, height: Constant.triangleSize)
        .offset(x: alignment.offSet)
    }

    private var horizontalSpacerView: some View {
        Spacer()
            .frame(width: Constant.spacerWidth)
    }

    private var verticalSpacerView: some View {
        Spacer()
            .frame(height: Constant.spacerHeight)
    }

    // MARK: Constants
    private enum Constant {
        static let spacerHeight: CGFloat = 20
        static let spacerWidth: CGFloat = 20
        static let cornerRadius: CGFloat = 19
        static let bgOpacity: CGFloat = 0.80
        static let maxWidth: CGFloat = 300
        static let spacing: CGFloat = 0.5
        static let triangleSize: CGFloat = 8
        static let chevronWidth: CGFloat = 4
        static let chevronHeight: CGFloat = 8
        static let chevronContainerHeight: CGFloat = 28
        static let chevronContainerWidth: CGFloat = 40
        static let chevronContainerOpacity: CGFloat = 0.85
        static let chevronContainerRadius: CGFloat = 19
        static let leftImageWidth: CGFloat = 40
        static let leftImageHeight: CGFloat = 28
        static let textViewSpacing: CGFloat = 8
    }
}

struct Triangle: Shape {
    func path(in rect: CGRect) -> Path {
        var path = Path()
        path.move(to: CGPoint(x: rect.midX, y: rect.minY))
        path.addLine(to: CGPoint(x: rect.minX, y: rect.maxY))
        path.addLine(to: CGPoint(x: rect.maxX, y: rect.maxY))
        path.addLine(to: CGPoint(x: rect.midX, y: rect.minY))
        return path
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

[![enter image description here][1]][1]

https://i.stack.imgur.com/QFbuc.gif


问:
How to place objects from collection one after another?
I making HTML for an Outlook email client.
I use thymeleaf to place collection of objects into table.
I have tried this, but the problem is that objects arranged vertically:

                name

                email

                8900000000

```

I want to make fixed number of cells wide and place them one after another. Like :

How can i do that ?
Remember that outlook doesn't allow many tags!

----UPD----
Ansver in comments!

Body:
I making HTML for an Outlook email client.
I use thymeleaf to place collection of objects into table.
I have tried this, but the problem is that objects arranged vertically:

                name

                email

                8900000000

I want to make fixed number of cells wide and place them one after another. Like :

How can i do that ?
Remember that outlook doesn't allow many tags!

----UPD----
Ansver in comments!


问:
Web page call rest api from iphone 8 got error but android is OK
below is the code to call rest api from web page:

```<code>        let formData = new FormData();

        formData.append("employeeid", employeeid);
        formData.append("subjectid", subjectid);
        formData.append("classroomid", classroomid);
        formData.append("classid", classid);
        formData.append("studentsize", studentsize);

        $.ajax({
            url: apiurl + '/edu/signin',
            type: 'POST',
            async: false,
            cache: false,
            data: formData,
            processData: false,
            contentType: false,
            success: (res) => {
                if (res["regId"] != null)
                    $("#message").text(`OK: ${res["employeeName"]}, ${res["classDate"]}, ${res["lessonName"]}, ${res["studentSize"]}人`)
                else
                    $("#message").text(`failed`)
            },
            error: (res) => {
                alert(JSON.stringify(res))
            }
        })
</code>```

from iphone 8 chrome, I got following error message:

```<code>{
"readyState":4,
"responseText":
   "{"timestamp":"2022-12-19T04:22:03.226+00:00",
      "status":400,
      "error":"Bad Request",
      "path":"/edu/siginin"
    }",
"responseJSON": {"timestamp":"2022-12-19T04:22:03.226+00:00",
"status": 400, "error":"/edu/signin"},
"status": 400, "statusText": "error"
}
</code>```

why cannot call rest api from iphone?

Anyone can help me? thanks a lot.

Body:
below is the code to call rest api from web page:

        let formData = new FormData();

        formData.append("employeeid", employeeid);
        formData.append("subjectid", subjectid);
        formData.append("classroomid", classroomid);
        formData.append("classid", classid);
        formData.append("studentsize", studentsize);

        $.ajax({
            url: apiurl + '/edu/signin',
            type: 'POST',
            async: false,
            cache: false,
            data: formData,
            processData: false,
            contentType: false,
            success: (res) => {
                if (res["regId"] != null)
                    $("#message").text(`OK: ${res["employeeName"]}, ${res["classDate"]}, ${res["lessonName"]}, ${res["studentSize"]}人`)
                else
                    $("#message").text(`failed`)
            },
            error: (res) => {
                alert(JSON.stringify(res))
            }
        })

from iphone 8 chrome, I got following error message:

{
"readyState":4,
"responseText":
   "{"timestamp":"2022-12-19T04:22:03.226+00:00",
      "status":400,
      "error":"Bad Request",
      "path":"/edu/siginin"
    }",
"responseJSON": {"timestamp":"2022-12-19T04:22:03.226+00:00",
"status": 400, "error":"/edu/signin"},
"status": 400, "statusText": "error"
}

why cannot call rest api from iphone?

Anyone can help me? thanks a lot.


问:
Javascript - How to include an emoji in your Twitter share URL?
I'm trying to add emoji in my Twitter share URL, here's the code (I'm using Sweet Alert):

```<code>Swal.fire({title: 'Cheers! ', html: '<div onclick="postTweet('Sharing this<br>nice emoji ')"><i class="ti-twitter-alt"></i> Share on Twitter</div>' });

function postTweet(text){
      var text2 = text.replace(/<br\s*\/?>/gi,'\n');
      window.open("https://twitter.com/intent/tweet?text=" + escape(text2));
}
</code>```

Buy it doesn't work, I get a 500 error. If I remove that  emoji, Twitter opens up successfully with the text of my share link.

I'd like to know what I'm doing wrong.

Body:
I'm trying to add emoji in my Twitter share URL, here's the code (I'm using Sweet Alert):

Swal.fire({title: 'Cheers! ', html: ' Share on Twitter
' });

function postTweet(text){
      var text2 = text.replace(/
/gi,'\n');
      window.open("https://twitter.com/intent/tweet?text=" + escape(text2));
}

Buy it doesn't work, I get a 500 error. If I remove that  emoji, Twitter opens up successfully with the text of my share link.

I'd like to know what I'm doing wrong.


问:
NPM package dependencies installed offline
I am fresher in JavaScript frameworks like React js and node js  I want to know that is it possible to install npm package in our local system with out internet if yes or no then why ?

Please explain me in details


问:
Golang inject package fields by google wire
Can I inject package fields by google wire, now I need a struct and inject the value of struct :

```<code>package ABC

func NewA(inb *inb) A{
    return A{
        b: inb ,
    }
}

type Astruct {
    b *B
}
</code>```

Now I what the value direct in package , not via a struct

```<code>package ABC

var b *B
var c *C
</code>```

How to inject it by google wire, I think set it by ABC.b= in a constructor function is not a good idea because I receive b via injection
Thank you

Body:
Can I inject package fields by google wire, now I need a struct and inject the value of struct :

package ABC

func NewA(inb *inb) A{
    return A{
        b: inb ,
    }
}

type Astruct {
    b *B
}

Now I what the value direct in package , not via a struct

package ABC

var b *B
var c *C

How to inject it by google wire, I think set it by ABC.b= in a constructor function is not a good idea because I receive b via injection
Thank you


问:
While passing the string to a api payload "\" is coming in the payload in dart
I need to pass a string variable to my api payload but after passing the payload in my payload data the \ is coming. And also some characters also missing.

```<code>var blocklyApiResponse = await apiProvider.getapiresponse(
    "private/wiziot-request/", json.encode("$payload"));
print("Response of  Blockly API : ${blocklyApiResponse}");
print("TheAPIPayload: $payload");
</code>```

This is the API I am passing :

```<code>{"mode":"MULTI_WRITE","api":"smartlight","type":"strip_effects","effect":"vibgyor","device_id":"001_prdt_kp01","source":"BLOCKLY"}
</code>```

This the output after passing the payload :

```<code>{\\"mode\\":\\"MULTI_WRITE\\",\\"api\\":\\"smartlight\\",\\"type\\":\\"strip_effects\\",\\"effect\\":\\"vibgyor\\",\\"device_id\\":\\"001_prdt_kp01\\",\\"source\\":\\"BLOCKLY\\""
</code>```

Note: some characters also missing.

Body:
I need to pass a string variable to my api payload but after passing the payload in my payload data the \ is coming. And also some characters also missing.

var blocklyApiResponse = await apiProvider.getapiresponse(
    "private/wiziot-request/", json.encode("$payload"));
print("Response of  Blockly API : ${blocklyApiResponse}");
print("TheAPIPayload: $payload");

This is the API I am passing :

{"mode":"MULTI_WRITE","api":"smartlight","type":"strip_effects","effect":"vibgyor","device_id":"001_prdt_kp01","source":"BLOCKLY"}

This the output after passing the payload :

{\\"mode\\":\\"MULTI_WRITE\\",\\"api\\":\\"smartlight\\",\\"type\\":\\"strip_effects\\",\\"effect\\":\\"vibgyor\\",\\"device_id\\":\\"001_prdt_kp01\\",\\"source\\":\\"BLOCKLY\\""

Note: some characters also missing.


问:
Debugiing Lit Element
I wanted to debug lit decorators in chrom inspect. I am using webpack plugin.
I have followed steps https://lit.dev/docs/tools/development/#development-and-production-builds and enabled the dev mode.  Still I am getting minimized file version in chrom inspect, source code is not hitting. Please help on this.

`

```<code>import {LitElement, html} from 'lit';
import {customElement, property, queryAssignedNodes} from 'lit/decorators.js';

@customElement("my-element")
class MyElement extends LitElement {

  @queryAssignedNodes({slot: 'list'})
  listItems!: Array<HTMLElement>;

  @property({type: String})
  name = 'World';

  @property({ type: Number })
  count = 0;

  @property({attribute: false})
  article = {
    title: 'My Nifty Article',
    text: 'Some witty text.',
  };

  headerTemplate() {
    console.log(this.renderRoot);
    let shadowRoot = this.renderRoot;
    console.log(shadowRoot.querySelector('slot[name="list"]'));
    return html`<header>${this.article.title}</header>`;
  }

  articleTemplate() {
    return html`<article>${this.article.text}</article>`;
  }

  footerTemplate() {
    return html`<footer>Your footer here.</footer>`;
  }

  _onClick() {
    this.count++;
    const nodes = [...this.listItems];
    console.log(nodes);
  }

  foo() {
    return html` <h1>Hello, ${this.name}!</h1>
    <button id = "1" onclick="${this._onClick}">
      Click Count: ${this.count}
    </button>
    <slot name="list"></slot>`;
  }

  render() {
    return html`
      ${this.headerTemplate()}
      ${this.articleTemplate()}
      ${this.footerTemplate()}
      ${this.foo()}
    `;
  }
}
</code>```

`

Note: I am trying to debug @queryAssignedNodes decorator.

I am getting minimized file version in chrom inspect, source code is not hitting.

Title: Debugiing Lit Element

Body:
I wanted to debug lit decorators in chrom inspect. I am using webpack plugin.
I have followed steps https://lit.dev/docs/tools/development/#development-and-production-builds and enabled the dev mode.  Still I am getting minimized file version in chrom inspect, source code is not hitting. Please help on this.

`

import {LitElement, html} from 'lit';
import {customElement, property, queryAssignedNodes} from 'lit/decorators.js';

@customElement("my-element")
class MyElement extends LitElement {

  @queryAssignedNodes({slot: 'list'})
  listItems!: Array<HTMLElement>;

  @property({type: String})
  name = 'World';

  @property({ type: Number })
  count = 0;

  @property({attribute: false})
  article = {
    title: 'My Nifty Article',
    text: 'Some witty text.',
  };

  headerTemplate() {
    console.log(this.renderRoot);
    let shadowRoot = this.renderRoot;
    console.log(shadowRoot.querySelector('slot[name="list"]'));
    return html`<header>${this.article.title}</header>`;
  }

  articleTemplate() {
    return html`<article>${this.article.text}</article>`;
  }

  footerTemplate() {
    return html`<footer>Your footer here.</footer>`;
  }

  _onClick() {
    this.count++;
    const nodes = [...this.listItems];
    console.log(nodes);
  }

  foo() {
    return html`
Hello, ${this.name}!

    <button id = "1" onclick="${this._onClick}">
      Click Count: ${this.count}
    </button>
    <slot name="list"></slot>`;
  }

  render() {
    return html`
      ${this.headerTemplate()}
      ${this.articleTemplate()}
      ${this.footerTemplate()}
      ${this.foo()}
    `;
  }
}

`

Note: I am trying to debug @queryAssignedNodes decorator.

I am getting minimized file version in chrom inspect, source code is not hitting.


问:
Command " /asadmin list-applications " failed in solaris
It appears that server [localhost:4848] does not accept secure connections. Retry with --secure=false.
javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateExpiredException: NotAfter: Thu Jul 21 05:29:59 IST 2022
Command list-applications failed.

I want to verify that is there any certificate is installed or not , If installed then how to resolved the problem . how to check the installed applications from solaris.How to check the ssl expiries in solaris system.


问:
Adding URL to main.js in angular for kubernetes
I am currently working on a project with mysql, springboot and angular(front-end) which I have to deploy on kubernetes. I have managed to get mysql and springboot to work by adding a service but I am not sure how to do with angular.
Here's my springboot-deplyoment.yml

```<code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: sample-service
spec:
  selector:
    matchLabels:
      app: sample-service
  replicas: 1
  template:
    metadata:
      labels:
        app: sample-service
    spec:
      containers:
      - name: sample-service
        image: username/sample-service
        imagePullPolicy: IfNotPresent
        ports:
          - containerPort: 8091
        env:
        - name: SPRING_DATASOURCE_URL
          value: jdbc:mysql://mysql:3306/buddyto_mstr_local?useSSL=false&allowPublicKeyRetrieval=true
        - name: SPRING_DATASOURCE_USERNAME
          value: root
        - name: SPRING_DATASOURCE_PASSWORD
          value: root
---
apiVersion: v1
kind: Service
metadata:
  name: sample-service
spec:
  ports:
    - protocol: "TCP"
      port: 8091
      targetPort: 8091
  selector:
    app: sample-service
  type: NodePort
</code>```

Here's my angular-deployment.yml

```<code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: angular
spec:
  selector:
    matchLabels:
      app: angular
  replicas: 1
  template:
    metadata:
      labels:
        app: angular
    spec:
      hostname: "sample-service"
      containers:
        - name: angular
          image: username/angular
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 8080
          env:
          - name: BACKEND_BASE_URL
            value: http://sample-service:8091
---
apiVersion: v1
kind: Service
metadata:
  name: angular
spec:
  ports:
    - protocol: "TCP"
      port: 8080
      targetPort: 8080
  selector:
    app: angular
  type: LoadBalancer
</code>```

Here's my Dockerfile

```<code>FROM nginx:alpine
EXPOSE 8080
EXPOSE 8091
COPY ./dist/ /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
ARG BACKEND_BASE_URL=http://sample-service:8091
</code>```

I want to connect angular to springboot but I am not sure what to add as a url in main.js before creating the docker image. I tried using http://sample-service:8080 but it didn't work.

Body:
I am currently working on a project with mysql, springboot and angular(front-end) which I have to deploy on kubernetes. I have managed to get mysql and springboot to work by adding a service but I am not sure how to do with angular.
Here's my springboot-deplyoment.yml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: sample-service
spec:
  selector:
    matchLabels:
      app: sample-service
  replicas: 1
  template:
    metadata:
      labels:
        app: sample-service
    spec:
      containers:
      - name: sample-service
        image: username/sample-service
        imagePullPolicy: IfNotPresent
        ports:
          - containerPort: 8091
        env:
        - name: SPRING_DATASOURCE_URL
          value: jdbc:mysql://mysql:3306/buddyto_mstr_local?useSSL=false&allowPublicKeyRetrieval=true
        - name: SPRING_DATASOURCE_USERNAME
          value: root
        - name: SPRING_DATASOURCE_PASSWORD
          value: root
---
apiVersion: v1
kind: Service
metadata:
  name: sample-service
spec:
  ports:
    - protocol: "TCP"
      port: 8091
      targetPort: 8091
  selector:
    app: sample-service
  type: NodePort

Here's my angular-deployment.yml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: angular
spec:
  selector:
    matchLabels:
      app: angular
  replicas: 1
  template:
    metadata:
      labels:
        app: angular
    spec:
      hostname: "sample-service"
      containers:
        - name: angular
          image: username/angular
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 8080
          env:
          - name: BACKEND_BASE_URL
            value: http://sample-service:8091
---
apiVersion: v1
kind: Service
metadata:
  name: angular
spec:
  ports:
    - protocol: "TCP"
      port: 8080
      targetPort: 8080
  selector:
    app: angular
  type: LoadBalancer

Here's my Dockerfile

FROM nginx:alpine
EXPOSE 8080
EXPOSE 8091
COPY ./dist/ /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
ARG BACKEND_BASE_URL=http://sample-service:8091

I want to connect angular to springboot but I am not sure what to add as a url in main.js before creating the docker image. I tried using http://sample-service:8080 but it didn't work.


问:
Returned data from a Script shows select option behind Boostrap Modal on Laravel
I have a simple JavaScript that retrieves set of data from my database and returns the result on my blade page Bootstrap Modal, however, as I enter the keyword value to retrieve, the select option result appears behind the modal form. How can I show it in front or within the modal? I adjusted the height of the modal but still the same.


问:
The APKs won't be signed and thus not installable unless you also pass a keystore via the flag --ks
Bundle bundletool build-apks --bundle=app.aab --output=release_app.apks
WARNING: The APKs won't be signed and thus not installable unless you also pass a keystore via the flag --ks. See the command help for more information.

how can i know --ks path ??

Bundle bundletool build-apks --bundle=app.aab --output=release_app.apks
WARNING: The APKs won't be signed and thus not installable unless you also pass a keystore via the flag --ks. See the command help for more information.


问:
Authentication with Reverse Proxy from Swagger UI
The API is deployed without any Security Scheme provided in the swagger.json, however, the API is accessed over reverse proxy with Basic Username/password Authentication. Since the security scheme is not provided, the swagger UI won't display the "Authorize" button. Is there any way to enable/show "Authorize" button without Security Scheme or provide such proxy configuration in Swagger spec itself?</p>


问:
How to profile a C++ shared library written for python
I am writing a library for some scientific computing tasks, where the core computational routines are written in c++ and pybind11 is used to expose them to the python side of the library.

How can I profile my c++ code to improve the performance. In particular, how can I use intel-vtune profiler with my python scripts that call the c++ functions.


问:
Unable to use PyCharm Remote development - installing IDE backend in server fails
I'm trying to connect my local PyCharm installation to a server so that I can code directly in the server. For this, I go to File > Remote Development > connect via ssh > select the appropriate connection > check connection and continue > enter the password > Next > select the project directory > Download and start IDE. It downloads the backend on the server but then fails with the following message

```<code>An error occurred while execution command: 'expand-archive --archive-path='/home/nagasn/.cache/JetBrains/RemoteDev/dist/86e6698dbdca2_pycharm-professional-2022.1.4/86e6698dbdca2_pycharm-professional-2022.1.4.tar.gz' --destination='/home/nagasn/.cache/JetBrains/RemoteDev/dist/86e6698dbdca2_pycharm-professional-2022.1.4/86e6698dbdca2_pycharm-professional-2022.1.4''
Exit code: null
</code>```

On googling the error, I see that the command expand-archive is a powershell command, which I understand is for windows and does not work in ubuntu terminal. So, why is PyCharm trying to run a powershell command in ubuntu? How can I tell PyCharm to use the ubuntu terminal command tar?

I also tried manually unzipping the downloaded archive and restarting the process, but PyCharm again starts downloading the IDE zip file and fails with the exact same error.

Body:
I'm trying to connect my local PyCharm installation to a server so that I can code directly in the server. For this, I go to File > Remote Development > connect via ssh > select the appropriate connection > check connection and continue > enter the password > Next > select the project directory > Download and start IDE. It downloads the backend on the server but then fails with the following message

An error occurred while execution command: 'expand-archive --archive-path='/home/nagasn/.cache/JetBrains/RemoteDev/dist/86e6698dbdca2_pycharm-professional-2022.1.4/86e6698dbdca2_pycharm-professional-2022.1.4.tar.gz' --destination='/home/nagasn/.cache/JetBrains/RemoteDev/dist/86e6698dbdca2_pycharm-professional-2022.1.4/86e6698dbdca2_pycharm-professional-2022.1.4''
Exit code: null

On googling the error, I see that the command expand-archive is a powershell command, which I understand is for windows and does not work in ubuntu terminal. So, why is PyCharm trying to run a powershell command in ubuntu? How can I tell PyCharm to use the ubuntu terminal command tar?

I also tried manually unzipping the downloaded archive and restarting the process, but PyCharm again starts downloading the IDE zip file and fails with the exact same error.


问:
Linking climate change model to infectious disease model
Please excuse my silly question. I am not a proficient statistician yet.

Actually, I wanted to ask if it is possible to interlink different models such as linking the climate change model to the infectious disease model and cardiovascular events model.

If it is not possible, then what can be the alternative methods we can use?


问:
How to Add google mob in React Native
I want to Add GoogleAdMob in My react-native-app(android).
I heard that the expo-admob will bo no longer supported. So I want to use

react-native-google-mobil-ads (https://docs.page/invertase/react-native-google-mobile-ads)
But Nothing executed and i got this error.

Below is my effort to add google-admob in my react-native-app

npx create-react-native-app [app_name]

add below code in  App.json

```<code>  "react-native-google-mobile-ads": {
    "android_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx",
    "ios_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx"
  }
</code>```

add Below code in my App.js

```<code>import mobileAds from 'react-native-google-mobile-ads';
import { AppOpenAd, InterstitialAd, RewardedAd, BannerAd, TestIds } from 'react-native-google-mobile-ads';

mobileAds()
  .initialize()
  .then(adapterStatuses => {
    // Initialization complete!
  });

<BannerAd unitId={TestIds.BANNER} />

</code>```

But I got the error

```<code>export { AdEventType } from './AdEventType';
error: Error: Unable to resolve module ./AdEventType from
File Directory\node_modules\react-native-google-mobile-ads\src\index.ts:

  28 | export { MaxAdContentRating } from './MaxAdContentRating';
  29 | export { TestIds } from './TestIds';
> 30 | export { AdEventType } from './AdEventType';
     |                              ^
  31 | export { BannerAdSize } from './BannerAdSize';
  32 | export { GAMAdEventType } from './GAMAdEventType';
  33 | export { RewardedAdEventType } from './RewardedAdEventType';
    at ModuleResolver.resolveDependency (File_Directory\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:152:15)
    at DependencyGraph.resolveDependency (File_Directory\node_modules\metro\src\node-haste\DependencyGraph.js:264:43)
    at Object.resolve (File_Directory\node_modules\metro\src\lib\transformHelpers.js:170:21)
    at resolveDependencies (File_Directory\node_modules\metro\src\DeltaBundler\graphOperations.js:466:33)
    at processModule (File_Directory\node_modules\metro\src\DeltaBundler\graphOperations.js:232:31)
    at async addDependency (File_Directory\node_modules\metro\src\DeltaBundler\graphOperations.js:361:18)
    at async Promise.all (index 0)
    at async processModule (File_Directory\node_modules\metro\src\DeltaBundler\graphOperations.js:279:3)
    at async traverseDependenciesForSingleFile (C:\Users\user\Desktop\Dance_Platform\banner-second\node_modules\metro\src\DeltaBundler\graphOperations.js:221:3)
    at async traverseDependencies (File_Directory\node_modules\metro\src\DeltaBundler\graphOperations.js:147:7)

</code>```

Anything I should do additional to add google-mob ?

Title: How to Add google mob in React Native

Body:
I want to Add GoogleAdMob in My react-native-app(android).
I heard that the expo-admob will bo no longer supported. So I want to use

react-native-google-mobil-ads (https://docs.page/invertase/react-native-google-mobile-ads)
But Nothing executed and i got this error.

Below is my effort to add google-admob in my react-native-app

npx create-react-native-app [app_name]

add below code in  App.json

  "react-native-google-mobile-ads": {
    "android_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx",
    "ios_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx"
  }

add Below code in my App.js

import mobileAds from 'react-native-google-mobile-ads';
import { AppOpenAd, InterstitialAd, RewardedAd, BannerAd, TestIds } from 'react-native-google-mobile-ads';

mobileAds()
  .initialize()
  .then(adapterStatuses => {
    // Initialization complete!
  });

<BannerAd unitId={TestIds.BANNER} />

But I got the error

export { AdEventType } from './AdEventType';
error: Error: Unable to resolve module ./AdEventType from
File Directory\node_modules\react-native-google-mobile-ads\src\index.ts:

  28 | export { MaxAdContentRating } from './MaxAdContentRating';
  29 | export { TestIds } from './TestIds';
> 30 | export { AdEventType } from './AdEventType';
     |                              ^
  31 | export { BannerAdSize } from './BannerAdSize';
  32 | export { GAMAdEventType } from './GAMAdEventType';
  33 | export { RewardedAdEventType } from './RewardedAdEventType';
    at ModuleResolver.resolveDependency (File_Directory\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:152:15)
    at DependencyGraph.resolveDependency (File_Directory\node_modules\metro\src\node-haste\DependencyGraph.js:264:43)
    at Object.resolve (File_Directory\node_modules\metro\src\lib\transformHelpers.js:170:21)
    at resolveDependencies (File_Directory\node_modules\metro\src\DeltaBundler\graphOperations.js:466:33)
    at processModule (File_Directory\node_modules\metro\src\DeltaBundler\graphOperations.js:232:31)
    at async addDependency (File_Directory\node_modules\metro\src\DeltaBundler\graphOperations.js:361:18)
    at async Promise.all (index 0)
    at async processModule (File_Directory\node_modules\metro\src\DeltaBundler\graphOperations.js:279:3)
    at async traverseDependenciesForSingleFile (C:\Users\user\Desktop\Dance_Platform\banner-second\node_modules\metro\src\DeltaBundler\graphOperations.js:221:3)
    at async traverseDependencies (File_Directory\node_modules\metro\src\DeltaBundler\graphOperations.js:147:7)

Anything I should do additional to add google-mob ?


问:
How to send files for upload without access to file input tag on the UI
I am trying to upload files using kendoFileManager control in the worker thread as I have some pre-upload check on the files which might take time.

I have following code in my worker -

worker.js

```<code>onmessage = function(filesArray) {
var fileData = new FormData();

// if there are multiple files , loop through each files
for (var i = 0; i < message.data.length; i++) {
     fileData.append(message.data[i].name, message.data[i]);
    }
var xhr = new XMLHttpRequest();
xhr.open("POST", "/SelfServiceAI/Upload3/", true);
xhr.setRequestHeader('Accept', 'multipart/form-data');
xhr.withCredentials = true;
xhr.onload = () => { // Call a function when the state changes.
    if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {
        //postMessage("File successfully uploaded")
        // Request finished. Do processing here.
    }
    else {
        //postMessage("File upload failed!");
    }
}
xhr.send(fileData);
}
</code>```

This worker is created and invoked on the upload event of the kendo FileManagerControl.

```<code>$("#filemanager").kendoFileManager({
....
upload : {
          upload : function (e) {
             const worker = new Worker(worker.js);
             worker.postMessage(e.sender.getFiles());
           }
         },
....
});
</code>```

controller action method -

```<code>public JsonResult Upload ()
{
 HttpFileCollectionBase files = Request.Files;
 // Other processing logic
}
</code>```

For me, the Request.Files is coming up as empty and there is no other property in Request that can be used to get the Files data for upload.
I am expecting a way to get the files passed from the UI in the controller action method.

Body:
I am trying to upload files using kendoFileManager control in the worker thread as I have some pre-upload check on the files which might take time.

I have following code in my worker -

worker.js

onmessage = function(filesArray) {
var fileData = new FormData();

// if there are multiple files , loop through each files
for (var i = 0; i < message.data.length; i++) {
     fileData.append(message.data[i].name, message.data[i]);
    }
var xhr = new XMLHttpRequest();
xhr.open("POST", "/SelfServiceAI/Upload3/", true);
xhr.setRequestHeader('Accept', 'multipart/form-data');
xhr.withCredentials = true;
xhr.onload = () => { // Call a function when the state changes.
    if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {
        //postMessage("File successfully uploaded")
        // Request finished. Do processing here.
    }
    else {
        //postMessage("File upload failed!");
    }
}
xhr.send(fileData);
}

This worker is created and invoked on the upload event of the kendo FileManagerControl.

$("#filemanager").kendoFileManager({
....
upload : {
          upload : function (e) {
             const worker = new Worker(worker.js);
             worker.postMessage(e.sender.getFiles());
           }
         },
....
});

controller action method -

public JsonResult Upload ()
{
 HttpFileCollectionBase files = Request.Files;
 // Other processing logic
}

For me, the Request.Files is coming up as empty and there is no other property in Request that can be used to get the Files data for upload.
I am expecting a way to get the files passed from the UI in the controller action method.


问:
React-leaflet in Next.js - "ReferenceError: window is not defined"
This is continuously giving Window undefined error. What could be the problem? This is not even showing any map. Tried too many solutions including with next.js dynamic package. Didn't work. Could you give me any answer?

```<code>import React, { useRef, useState } from "react";
import { Map, TileLayer, Popup, Marker } from "react-leaflet";

const attribution =
    '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors';
const url =
    "https://api.maptiler.com/maps/basic-v2/256/{z}/{x}/{y}.png?key=puoG6vOLC4oqJXcum8fR";

const OpenStreetMap = () => {
    const [center, setCenter] = useState({
        lat: 23.729211164246585,
        lng: 90.40874895549243,
    });
    const mapRef = useRef();
    console.log(Map);

    return (
        <div>
            <Map center={center} zoom={9} ref={mapRef}>
                <TileLayer attribution={attribution} url={url} />
                <Marker position={[23.729211164246585, 90.40874895549243]}>
                    <Popup>This is a popup.</Popup>
                </Marker>
            </Map>
        </div>
    );
};

export default OpenStreetMap;
</code>```

Body:
This is continuously giving Window undefined error. What could be the problem? This is not even showing any map. Tried too many solutions including with next.js dynamic package. Didn't work. Could you give me any answer?

import React, { useRef, useState } from "react";
import { Map, TileLayer, Popup, Marker } from "react-leaflet";

const attribution =
    '© OpenStreetMap contributors';
const url =
    "https://api.maptiler.com/maps/basic-v2/256/{z}/{x}/{y}.png?key=puoG6vOLC4oqJXcum8fR";

const OpenStreetMap = () => {
    const [center, setCenter] = useState({
        lat: 23.729211164246585,
        lng: 90.40874895549243,
    });
    const mapRef = useRef();
    console.log(Map);

    return (

            <Map center={center} zoom={9} ref={mapRef}>
                <TileLayer attribution={attribution} url={url} />
                <Marker position={[23.729211164246585, 90.40874895549243]}>
                    <Popup>This is a popup.</Popup>
                </Marker>
            </Map>

    );
};

export default OpenStreetMap;


问:
Reading decimal value from image through Image Processing(using pytesseract)
I am new to image processing and I am working on reading a decimal value from an image. For which I am referring to a link. I am struggling with setting an HSV range in image processing while generating a mask (https://github.com/DevashishPrasad/LCD-OCR/blob/master/code.py).

Question:
The link I am referring to is For reading a decimal value from an image but the solution is not coming correct it is reading 79.8 as 75.8.

Also, I am not able to set the proper range of HSV to generate a mask, If I am changing the image HSV range needs to be changed again, not able to find any generic solution. Code snippet for the same:

```<code># specific color(blue here) using OpenCV with Python
import cv2
import numpy as np
import imutils
import pytesseract
# Webcamera no 0 is used to capture the frames
cap = cv2.VideoCapture(0)

# This drives the program into an infinite loop.
# Captures the live stream frame-by-frame
_, frame = cap.read()
# Converts images from BGR to HSV
**hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
lower_red = np.array([0,0,0])
upper_red = np.array([0,255,255])**
# Here we are defining range of bluecolor in HSV
# This creates a mask of white coloured
# objects found in the frame.
mask = cv2.inRange(hsv, lower_red, upper_red)
# The bitwise and of the frame and mask is done so
# that only the blue coloured objects are highlighted
# and stored in res
res = cv2.bitwise_and(frame,frame, mask= mask)
# Blur the image
res = cv2.GaussianBlur(res,(13,13), 0)
# Edge detection
edged = cv2.Canny(res, 100, 200)
# Dilate it , number of iterations will depend on the image
dilate = cv2.dilate(edged, None, iterations=4)
# perform erosion
erode = cv2.erode(dilate, None, iterations=4)
# make an empty mask
mask2 = np.ones(frame.shape[:2], dtype="uint8") * 255
# find contours
cnts = cv2.findContours(erode.copy(), cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_SIMPLE)
cnts = cnts[0] if imutils.is_cv2() else cnts[1]
orig = frame.copy()
for c in cnts:
    # if the contour is not sufficiently large, ignore it
    if cv2.contourArea(c) < 600:
        cv2.drawContours(mask2, [c], -1, 0, -1)
        continue

# Remove ignored contours
newimage = cv2.bitwise_and(erode.copy(), dilate.copy(), mask=mask2)
# Again perform dilation and erosion
newimage = cv2.dilate(newimage,None, iterations=7)
newimage = cv2.erode(newimage,None, iterations=5)
ret,newimage = cv2.threshold(newimage,0,255,cv2.THRESH_BINARY_INV | cv2.THRESH_OTSU)
# Tesseract OCR
temp = pytesseract.image_to_string(newimage)
# It will turn 3 digits in this case,
new = temp[0] + temp[1] + "." + temp[2]
# Write results on the image
cv2.putText(frame, new, (50,100), cv2.FONT_HERSHEY_SIMPLEX, 1.4, (0,255,255), 2)
# Show the output
cv2.imshow('frame',frame)
cv2.imshow('orig',newimage)
cv2.waitKey(0)
cv2.destroyAllWindows()

# release the captured frame
cap.release()
</code>```

I need some suggestions for a generic code How can we set the proper range for HSV?

Body:
I am new to image processing and I am working on reading a decimal value from an image. For which I am referring to a link. I am struggling with setting an HSV range in image processing while generating a mask (https://github.com/DevashishPrasad/LCD-OCR/blob/master/code.py).

Question:
The link I am referring to is For reading a decimal value from an image but the solution is not coming correct it is reading 79.8 as 75.8.

Also, I am not able to set the proper range of HSV to generate a mask, If I am changing the image HSV range needs to be changed again, not able to find any generic solution. Code snippet for the same:

# specific color(blue here) using OpenCV with Python
import cv2
import numpy as np
import imutils
import pytesseract
# Webcamera no 0 is used to capture the frames
cap = cv2.VideoCapture(0)

# This drives the program into an infinite loop.
# Captures the live stream frame-by-frame
_, frame = cap.read()
# Converts images from BGR to HSV
**hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
lower_red = np.array([0,0,0])
upper_red = np.array([0,255,255])**
# Here we are defining range of bluecolor in HSV
# This creates a mask of white coloured
# objects found in the frame.
mask = cv2.inRange(hsv, lower_red, upper_red)
# The bitwise and of the frame and mask is done so
# that only the blue coloured objects are highlighted
# and stored in res
res = cv2.bitwise_and(frame,frame, mask= mask)
# Blur the image
res = cv2.GaussianBlur(res,(13,13), 0)
# Edge detection
edged = cv2.Canny(res, 100, 200)
# Dilate it , number of iterations will depend on the image
dilate = cv2.dilate(edged, None, iterations=4)
# perform erosion
erode = cv2.erode(dilate, None, iterations=4)
# make an empty mask
mask2 = np.ones(frame.shape[:2], dtype="uint8") * 255
# find contours
cnts = cv2.findContours(erode.copy(), cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_SIMPLE)
cnts = cnts[0] if imutils.is_cv2() else cnts[1]
orig = frame.copy()
for c in cnts:
    # if the contour is not sufficiently large, ignore it
    if cv2.contourArea(c) < 600:
        cv2.drawContours(mask2, [c], -1, 0, -1)
        continue

# Remove ignored contours
newimage = cv2.bitwise_and(erode.copy(), dilate.copy(), mask=mask2)
# Again perform dilation and erosion
newimage = cv2.dilate(newimage,None, iterations=7)
newimage = cv2.erode(newimage,None, iterations=5)
ret,newimage = cv2.threshold(newimage,0,255,cv2.THRESH_BINARY_INV | cv2.THRESH_OTSU)
# Tesseract OCR
temp = pytesseract.image_to_string(newimage)
# It will turn 3 digits in this case,
new = temp[0] + temp[1] + "." + temp[2]
# Write results on the image
cv2.putText(frame, new, (50,100), cv2.FONT_HERSHEY_SIMPLEX, 1.4, (0,255,255), 2)
# Show the output
cv2.imshow('frame',frame)
cv2.imshow('orig',newimage)
cv2.waitKey(0)
cv2.destroyAllWindows()

# release the captured frame
cap.release()

I need some suggestions for a generic code How can we set the proper range for HSV?