问:
Run an exe file on a Mac with Wineskin (VseeFace Application)
I really hope that someone could help me out with my problem.

I want to start an exe File (VSeeFace - see https://www.vseeface.icu for more information) on my Mac with wineskin. VseeFace is an application for Vtubing.

The application starts normally via Wineskin, but as soon as I try to open my avatar (a .vrm file), the software stops and I don't know why. I have searched everywhere and found nothing about my problem, but perhaps that is also due to my limited knowledge of development skills.

Can anyone help me please?

My Mac:
MacOS Monterey Version 12.4
Radeon Pro 575X 4 GB

My Wineskin Setup:
Wrapper Version Wineskin 2.9.1.5
Engine WS11WineCX64Bit22.0.1-1
Config Utility - Windows-Version 8

VseeFace Software – https://www.vseeface.icu/#download
They also describe how it will work on Linux or maybe Mac,
https://www.vseeface.icu/#running-on-linux-and-maybe-mac

For the Facetracking I run OpenSeeFace (but that seemed to work, I could see the green light of the iMac camera, but I couldn't test it because of my software problem).

I mean I could run the application but on the most important Screen it stops working.

In the debug.log file I noticed the following messages:
0024:err:shell:HCR_GetFolderAttributes should be called for simple PIDL's only!
0024:fixme:exec:SHELL_execute flags ignored: 0x0000000c

0118:err:module:import_dll Library dsound.dll (which is needed by L"C:\windows\system32\devenum.dll") not found
0118:trace:loaddll:build_module Loaded L"C:\windows\system32\msdmo.dll" at 000000034ABC0000: builtin
0118:err:ole:apartment_add_dll couldn't load in-process dll L"C:\windows\system32\devenum.dll"
0118:err:ole:com_get_class_object no class object {62be5d10-60eb-11d0-bd3b-00a0c911ce86} could be created for context 0x1
0118:err:module:import_dll Library dsound.dll (which is needed by L"C:\windows\system32\devenum.dll") not found
0118:err:ole:apartment_add_dll couldn't load in-process dll L"C:\windows\system32\devenum.dll"
0118:err:ole:com_get_class_object no class object {62be5d10-60eb-11d0-bd3b-00a0c911ce86} could be created for context 0x1
0118:err:ole:apartment_add_dll couldn't find function DllGetClassObject in L"C:\windows\system32\devenum.dll"
0118:err:ole:com_get_class_object no class object {62be5d10-60eb-11d0-bd3b-00a0c911ce86} could be created for context 0x1

0118:err:ole:com_get_class_object no class object {62be5d10-60eb-11d0-bd3b-00a0c911ce86} could be created for context 0x1
0118:trace:loaddll:build_module Loaded L"C:\windows\system32\Avrt.dll" at 00000002F2930000: builtin
0118:trace:loaddll:build_module Loaded L"C:\VSeeFace\VSeeFace_Data\Plugins\x86_64\LeapCV4.dll" at 000000010A220000: native
0118:trace:loaddll:build_module Loaded L"C:\windows\system32\VCRUNTIME140_1.dll" at 00000002F7F20000: builtin
0118:err:module:import_dll Loading library MSVCP140_2.dll (which is needed by L"C:\VSeeFace\VSeeFace_Data\Plugins\x86_64\LeapCV5.dll") failed (error c000007b).
0118:trace:loaddll:build_module Loaded L"C:\VSeeFace\VSeeFace_Data\Plugins\x86_64\CONCRT140.dll" at 0000000104CA0000: native
0118:err:module:import_dll Loading library MSVCP140_2.dll (which is needed by L"C:\VSeeFace\VSeeFace_Data\Plugins\x86_64\LeapCV5.dll") failed (error c000007b).
[mvk-info] Created 2 swapchain images with initial size (1280, 720) and contents scale 1.0 for screen Integriertes Retina-Display.
[mvk-error] VK_ERROR_INITIALIZATION_FAILED: Render pipeline compile failed (Error code 2):
Vertex attribute v4(4) of type int4 cannot be read using MTLAttributeFormatUInt4.

0118:trace:loaddll:build_module Loaded L"C:\VSeeFace\UnityPlayer.dll" at 0000000180000000: native
0118:fixme:thread:get_thread_times not implemented on this platform

0118:trace:loaddll:build_module Loaded L"C:\windows\system32\mmdevapi.dll" at 0000000336850000: builtin
0118:trace:loaddll:build_module Loaded L"C:\windows\system32\winecoreaudio.drv" at 00000001C92D0000: builtin
0118:fixme:coreaudio:ca_channel_layout_to_channel_mask Unhandled channel 0xffffffff
0
01b0:fixme:kernelbase:AppPolicyGetThreadInitializationType FFFFFFFFFFFFFFFA, 0000000066D6FE10
01b0:trace:loaddll:build_module Loaded L"C:\windows\system32\avrt.dll" at 00000002F2930000: builtin
01b0:fixme:avrt:AvSetMmThreadCharacteristicsW (L"Audio",0000000066D6FDB8): stub
01b0:trace:loaddll:free_modref Unloaded module L"C:\windows\system32\avrt.dll" : builtin

***If needed I could post the complete log file. ***

I have installed the dlls and they are in all the folders. I have also tried the installation via Winetricks, where it displays the following message:

Executing mkdir -p /Applications/Wineskin/VSeeFace.app/Contents/SharedSupport

warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.

Using winetricks 20220411-next - sha256sum: 846f79cac49697fd818f06a6aebf36ca408661f89b97633e9872025b33bc0e7b with wine-7.7 (WineskinCX 22.0.1) and WINEARCH=win64
Unknown arg UnityPlayer.dll
Usage: Applications/Wineskin/VSeeFace.app/Wineskin.app/Contents/Resources/winetricks [options] [command|verb|path-to-verb] ...
Executes given verbs.  Each verb installs an application or changes a setting.

Options:
--country=CC      Set country code to CC and don't detect your IP address
-f, --force           Don't check whether packages were already installed
--gui             Show gui diagnostics even when driven by commandline
--gui=OPT         Set OPT to kdialog or zenity to override GUI engine
--isolate         Install each app or game in its own bottle (WINEPREFIX)
--self-update     Update this application to the last version
--update-rollback Rollback the last self update
-k, --keep_isos       Cache isos (allows later installation without disc)
--no-clean        Don't delete temp directories (useful during debugging)
-q, --unattended      Don't ask any questions, just install automatically
-r, --ddrescue        Retry hard when caching scratched discs
-t  --torify          Run downloads under torify, if available
--verify          Run (automated) GUI tests for verbs, if available
-v, --verbose         Echo all commands as they are executed
-h, --help            Display this message and exit
-V, --version         Display version and exit

Commands:
list                  list categories
list-all              list all categories and their verbs
apps list             list verbs in category 'applications'
benchmarks list       list verbs in category 'benchmarks'
dlls list             list verbs in category 'dlls'
fonts list            list verbs in category 'fonts'
games list            list verbs in category 'games'
settings list         list verbs in category 'settings'
list-cached           list cached-and-ready-to-install verbs
list-download         list verbs which download automatically
list-manual-download  list verbs which download with some help from the user
list-installed        list already-installed verbs
arch=32|64            create wineprefix with 32 or 64 bit, this option must be
given before prefix=foobar and will not work in case of
the default wineprefix.
prefix=foobar         select WINEPREFIX=/Users/myusername/.local/share/wineprefixes/foobar
annihilate            Delete ALL DATA AND APPLICATIONS INSIDE THIS WINEPREFIX

Winetricks Commands Finished!!


来源: stackexchange

问:
i have a big problem with mysql and Xammp real_connect(): (HY000/2002)
I was working perfectly my project on localhost, but I had to install openssl, and it was still working well, but today reboot my Mac, but when the xampp services start, first

```<code>A PHP Error was encountered
Severity: Warning

Message: mysqli::real_connect(): (HY000/2002): Connection refused

Filename: mysqli/mysqli_driver.php

Line Number: 203

Backtrace:

File: /Applications/XAMPP/xamppfiles/htdocs/fed8/application/controllers/Login.php
Line: 8
Function: __construct

File: /Applications/XAMPP/xamppfiles/htdocs/fed8/index.php
Line: 315
Function: require_once
</code>```

Then try to enter localhost/phpmyadmin and error:

```<code>MySQL ha dicho: Documentación

No se estableció la conexión: los parámetros están incorrectos.
 Índice de servidor inválido:
 mysqli::real_connect(): (HY000/2002): Connection refused
 La conexión para controluser, como está definida en su configuración, fracasó.
 mysqli::real_connect(): (HY000/2002): Connection refused
 phpMyAdmin intentó conectarse con el servidor MySQL, y el servidor rechazó esta conexión. Deberá revisar el host, nombre de usuario y contraseña en config.inc.php y asegurarse que corresponden con la información provista por el administrador del servidor MySQL.
</code>```

I already tried everything about the internet, in config.inc.php
-uncomment the host, I put 172.0.0.1, localhost:3008 and nothing
-change config to cookie
-I put a password
-I put the extra line in my.cnf

-reinstall xammp, update it to 8, it sends me errors in the controllers so I downgrade to 7.4.33

ContentLicense: CC BY-SA 4.0

Body:
I was working perfectly my project on localhost, but I had to install openssl, and it was still working well, but today reboot my Mac, but when the xampp services start, first

A PHP Error was encountered
Severity: Warning

Message: mysqli::real_connect(): (HY000/2002): Connection refused

Filename: mysqli/mysqli_driver.php

Line Number: 203

Backtrace:

File: /Applications/XAMPP/xamppfiles/htdocs/fed8/application/controllers/Login.php
Line: 8
Function: __construct

File: /Applications/XAMPP/xamppfiles/htdocs/fed8/index.php
Line: 315
Function: require_once

Then try to enter localhost/phpmyadmin and error:

MySQL ha dicho: Documentación

No se estableció la conexión: los parámetros están incorrectos.
 Índice de servidor inválido:
 mysqli::real_connect(): (HY000/2002): Connection refused
 La conexión para controluser, como está definida en su configuración, fracasó.
 mysqli::real_connect(): (HY000/2002): Connection refused
 phpMyAdmin intentó conectarse con el servidor MySQL, y el servidor rechazó esta conexión. Deberá revisar el host, nombre de usuario y contraseña en config.inc.php y asegurarse que corresponden con la información provista por el administrador del servidor MySQL.

I already tried everything about the internet, in config.inc.php
-uncomment the host, I put 172.0.0.1, localhost:3008 and nothing
-change config to cookie
-I put a password
-I put the extra line in my.cnf

-reinstall xammp, update it to 8, it sends me errors in the controllers so I downgrade to 7.4.33


问:
Update version of CSV file from web
a got this link

```<code>data = "https://opendata.mzcr.cz/data/psychiatricka-pece/akutni-pece.csv"
</code>```

I can read it with pandas from web directly

```<code>source_file = pandas.read_csv(data)
</code>```

Is there some way to verify if there is updated version online and notify user (another app with plots) that version was updated?

Thank you

Title: Update version of CSV file from web

Body:
a got this link

data = "https://opendata.mzcr.cz/data/psychiatricka-pece/akutni-pece.csv"

I can read it with pandas from web directly

source_file = pandas.read_csv(data)

Is there some way to verify if there is updated version online and notify user (another app with plots) that version was updated?

Thank you


问:
TIA Portal Openness - modify project library types
In TIA Portal Openness (API version 16, 17 or 18) - is there a way to edit library types? That is, to modify a library type and release the change as a new version?

Specifically, I wish to modify PLC User Defined Types (UDTs).

using Openness, I have managed to:

Instantiate a library UDT type in a PLC

Export it as XML (no library type information was included in the export)

Modify the XML file

Import the XML file, but only when the UDT type is not being edited

The PLC UDT is updated according to the changes in the XML file, but it is no longer linked to a library type.  However, I wish to make versioned changes as above.  Is this possible?  If yes, how?


问:
ImportError: 'pyarrow' is required for converting a Sequence of date or datetime values to a PySeries
I am using the code from "Polars - User Guide" in VSC.
Gives an error message: "ImportError: 'pyarrow' is required for converting a Sequence of date or datetime values to a PySeries"

Code:

```<code>import polars as pl

# to enrich the examples in this quickstart with dates
from datetime import datetime, timedelta
# to generate data for the examples
import numpy as np

dataframe = pl.DataFrame({"integer": [1, 2, 3],
                          "date": [
                              (datetime(2022, 1, 1)),
                              (datetime(2022, 1, 2)),
                              (datetime(2022, 1, 3))
                          ],
                          "float":[4.0, 5.0, 6.0]})
dataframe
</code>```

can't find how to get past the error

Body:
I am using the code from "Polars - User Guide" in VSC.
Gives an error message: "ImportError: 'pyarrow' is required for converting a Sequence of date or datetime values to a PySeries"

Code:

import polars as pl

# to enrich the examples in this quickstart with dates
from datetime import datetime, timedelta
# to generate data for the examples
import numpy as np

dataframe = pl.DataFrame({"integer": [1, 2, 3],
                          "date": [
                              (datetime(2022, 1, 1)),
                              (datetime(2022, 1, 2)),
                              (datetime(2022, 1, 3))
                          ],
                          "float":[4.0, 5.0, 6.0]})
dataframe

can't find how to get past the error


问:
Image to indexed binary
I need to convert an image to binary. The result should be a 256 indexed binary file with the color format RGB565 16bit(1 color 2 bytes)

This format is used to store image background for watchfaces on cheap smartwaches.

https://github.com/fbiego/dt78/blob/master/firmware/watchface.md#decoded

https://lvgl.io/tools/imageconverter

This tool can create and indexed binary files but the format is RGBA 32bit (4 bytes per color) and also pads extra bytes at the start of the file.

What algorithm is used to create an indexed binary from an image?

Are there any Kotlin frameworks that can do this?

Title: Image to indexed binary


问:
Want to eliminate: "[WARNING] Could not determine source for class com.mycompany.MyClass_" when building Java + Scala project
I am using maven with the scala-maven-plugin for building a project that is a mixture of Java 1.8 and Scala 2.12.7 code.  When I build from the command line with:

```<code>mvn clean install -DskipTests
</code>```

I get messages like:

"[WARNING] Could not determine source for class
com.mycompany.MyClass_".

com.mycompany.MyClass is an annotated Java class that exists in my project.  Note that the warning message has an underscore after "MyClass".  There is no Java source code for a class named com.mycompany.MyClass_ in my project, but there is a class file at target/classes/com/mycompany/MyClass_.class.

What can I do to determine the cause of these warnings and remove them?  (I can get rid of them by commenting out the scala-maven-plugin section of my pom file, but that seems a little extreme.)

Additional diagnostic data:

Following @Joachim Sauer's advice, I used javap to look at the class file.  The output included:

Compiled from "MyClass_.java"

I did a search for "MyClass_.java" from the root of the project.  It was found in

```<code>target/scoverage-classes/com/mycompany/MyClass_.java
</code>```

When I look at that class in the editor, it includes:

```<code>@Generated(value = "org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor")
@StaticMetamodel(FileMetadata.class)
</code>```

So it looks like the file generated by SCoverage and/or JPAMetaModelEntityProcessor is not locatable by some other tool.  I'll dig some more...

Body:
I am using maven with the scala-maven-plugin for building a project that is a mixture of Java 1.8 and Scala 2.12.7 code.  When I build from the command line with:

mvn clean install -DskipTests

I get messages like:

"[WARNING] Could not determine source for class
com.mycompany.MyClass_".

com.mycompany.MyClass is an annotated Java class that exists in my project.  Note that the warning message has an underscore after "MyClass".  There is no Java source code for a class named com.mycompany.MyClass_ in my project, but there is a class file at target/classes/com/mycompany/MyClass_.class.

What can I do to determine the cause of these warnings and remove them?  (I can get rid of them by commenting out the scala-maven-plugin section of my pom file, but that seems a little extreme.)

Additional diagnostic data:

Following @Joachim Sauer's advice, I used javap to look at the class file.  The output included:

Compiled from "MyClass_.java"

I did a search for "MyClass_.java" from the root of the project.  It was found in

target/scoverage-classes/com/mycompany/MyClass_.java

When I look at that class in the editor, it includes:

@Generated(value = "org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor")
@StaticMetamodel(FileMetadata.class)

So it looks like the file generated by SCoverage and/or JPAMetaModelEntityProcessor is not locatable by some other tool.  I'll dig some more...


问:
Execute a HTTP request in Gatling/Jmeter every time a SSE event message is received
One of my application sends API url to be hit via SSE.We want to replicate this end to end behaviour.
How to hit a API request whenever we receive a message on SSE connection using Gatling/jmeter.

Usually server sends a message every 4-5 mins in real time.


问:
Return old and new value from comparing models function
I have a function that compare two models and return the difference as the following example:

function getPropertyDifferences(obj1, obj2, type) {
    return Object.entries(obj1).reduce((diff, [key, value]) => {
      // Check if the property exists in obj2.
      if (obj2.hasOwnProperty(key)) {
        const val = obj2[key];

        if (typeof val === "string") {
          const obj1Date = new Date(value.toString());
          const obj2Date = new Date(val);
          // check if the values are valid dates. if not, we go through regular comparison
          if (!isNaN(Number(obj1Date)) && !isNaN(Number(obj2Date))) {
            return obj1Date.toDateString() !== obj2Date.toDateString() ? { ...diff,
              [key]: val
            } : diff;
          }
        }

        if((val === null || undefined) && value === 0){
         return;
        }

        // Check if obj1's property's value is different from obj2's.
        if (val !== value) {
          return {
            ...diff,
            [key]: val,
          };
        }
      }

      // Otherwise, just return the previous diff object.
      return diff;
    }, {});
  }

  const a = {
  dateOfBirth: "Wed Jan 06 2021 12:00:05 GMT-0700 (Mexican Pacific Standard Time)",
  name: "test",
  testValue: "this is the old value",
  testValue2: "value2"
};
const b = {
  dateOfBirth: "2021-01-06T12:00:05.357",
  name: "test",
  testValue: "this is the new one",
  testValue2: "new value2"
};

console.log(getPropertyDifferences(a, b));```
</div>
</div>
</p>
<p>Now I have a new model that has the following properties:</p>
```export class ProfileActivity {
  oldValue: string;
  newValue: string;
  description: string;
}
```
<p>So, in the <strong>TS</strong> I use it as:</p>
```profileActivity: ProfileActivity[]
```
<p>Now, in the function, I want to return this model instead of only the new value in the following format:</p>
```[{
    oldValue: oldValueName
    newValue: newValueName
    description: Updated or Deleted(type)
   }],
   [{
    oldValue: oldValueName
    newValue: newValueName
    description: Updated or Deleted(type)
   }]
   ...etc
```
<p>How can I achieve that?</p>
<p><strong>Update</strong></p>
<p>I achieve this as following:</p>
```getPropertyDifferences(obj1, obj2) {
    let newProfileActivity: ProfileActivity;
    return Object.entries(obj1).reduce((diff, [key, value]) => {
      // Check if the property exists in obj2.
      if (obj2.hasOwnProperty(key)) {
        const val = obj2[key];

        if(((val === null || undefined) && value === 0) || key === "clientIds"){
          return;
         }

        if (typeof val === "string") {
          const obj1Date = new Date(value.toString());
          const obj2Date = new Date(val);

          // check if the values are valid dates. if not, we go through regular comparison
          if (!isNaN(Number(obj1Date)) && !isNaN(Number(obj2Date))) {

          if(obj1Date.toDateString() !== obj2Date.toDateString()){
            debugger;
            let dateProfileActivity: ProfileActivity = {
              newValue: obj1Date.toDateString(),
              oldValue: obj2Date.toDateString(),
              description: 'Update'
            }
            this.profileActivity.push(dateProfileActivity)
          }

            return obj1Date.toDateString() !== obj2Date.toDateString() ? { ...diff,
              [key]: val
            } : diff;
          }
        }
```

It would be appreciated if there is a better approach to the cleanest way to do this.

Body:
I have a function that compare two models and return the difference as the following example:

function getPropertyDifferences(obj1, obj2, type) {
    return Object.entries(obj1).reduce((diff, [key, value]) => {
      // Check if the property exists in obj2.
      if (obj2.hasOwnProperty(key)) {
        const val = obj2[key];

        if (typeof val === "string") {
          const obj1Date = new Date(value.toString());
          const obj2Date = new Date(val);
          // check if the values are valid dates. if not, we go through regular comparison
          if (!isNaN(Number(obj1Date)) && !isNaN(Number(obj2Date))) {
            return obj1Date.toDateString() !== obj2Date.toDateString() ? { ...diff,
              [key]: val
            } : diff;
          }
        }

        if((val === null || undefined) && value === 0){
         return;
        }

        // Check if obj1's property's value is different from obj2's.
        if (val !== value) {
          return {
            ...diff,
            [key]: val,
          };
        }
      }

      // Otherwise, just return the previous diff object.
      return diff;
    }, {});
  }

  const a = {
  dateOfBirth: "Wed Jan 06 2021 12:00:05 GMT-0700 (Mexican Pacific Standard Time)",
  name: "test",
  testValue: "this is the old value",
  testValue2: "value2"
};
const b = {
  dateOfBirth: "2021-01-06T12:00:05.357",
  name: "test",
  testValue: "this is the new one",
  testValue2: "new value2"
};

console.log(getPropertyDifferences(a, b));

Now I have a new model that has the following properties:

export class ProfileActivity {
  oldValue: string;
  newValue: string;
  description: string;
}

So, in the TS I use it as:

profileActivity: ProfileActivity[]

Now, in the function, I want to return this model instead of only the new value in the following format:

[{
    oldValue: oldValueName
    newValue: newValueName
    description: Updated or Deleted(type)
   }],
   [{
    oldValue: oldValueName
    newValue: newValueName
    description: Updated or Deleted(type)
   }]
   ...etc

How can I achieve that?

Update

I achieve this as following:

getPropertyDifferences(obj1, obj2) {
    let newProfileActivity: ProfileActivity;
    return Object.entries(obj1).reduce((diff, [key, value]) => {
      // Check if the property exists in obj2.
      if (obj2.hasOwnProperty(key)) {
        const val = obj2[key];

        if(((val === null || undefined) && value === 0) || key === "clientIds"){
          return;
         }

        if (typeof val === "string") {
          const obj1Date = new Date(value.toString());
          const obj2Date = new Date(val);

          // check if the values are valid dates. if not, we go through regular comparison
          if (!isNaN(Number(obj1Date)) && !isNaN(Number(obj2Date))) {

          if(obj1Date.toDateString() !== obj2Date.toDateString()){
            debugger;
            let dateProfileActivity: ProfileActivity = {
              newValue: obj1Date.toDateString(),
              oldValue: obj2Date.toDateString(),
              description: 'Update'
            }
            this.profileActivity.push(dateProfileActivity)
          }

            return obj1Date.toDateString() !== obj2Date.toDateString() ? { ...diff,
              [key]: val
            } : diff;
          }
        }

It would be appreciated if there is a better approach to the cleanest way to do this.


问:
Jetpack Compose Gestures: Consume long press and vertical scroll
I am using this youtube player (which uses iFrame Youtube API in a webview) in a jetpack compose app - via AndroidView()

```<code> DisposableEffect(
         AndroidView(factory = {
             youTubePlayerView
        }
         )
    ) {
        onDispose { youTubePlayerView.release() }
    }
</code>```

Problem is, when used from a Lazy Column, on scroll up, the long press is passed along to the iFrame in the webview, which triggers this context menu to appear:

Same problem occurs in the "classic" android view system, when used with a recycler view, and is described in detail here, along with a solution given - but I cant figure out how to adopt this solution to compose - or is there any other solution?
Let me recap, how to detect and stop the long press on vertical scroll from propagating to the iFrame?

```<code>public class CustomRecyclerView extends RecyclerView {
    private int touchSlop;
    private List<MotionEvent> touchEventTrack = new ArrayList<>();

    public CustomRecyclerView(@NonNull Context context) {
        super(context);
        touchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
    }

    public CustomRecyclerView(Context context, AttributeSet attributeSet){
        super(context,attributeSet);
        touchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
    }

    public CustomRecyclerView(@NonNull Context context, @Nullable @org.jetbrains.annotations.Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        touchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        // TODO Only intercept vertical scroll
        switch (ev.getAction()){
            case MotionEvent.ACTION_DOWN:{
                touchEventTrack.clear();
                touchEventTrack.add(MotionEvent.obtain(ev));
                break;
            }
            case MotionEvent.ACTION_MOVE:{
                touchEventTrack.add(MotionEvent.obtain(ev));
                break;
            }
            case MotionEvent.ACTION_UP:{
                touchEventTrack.add(MotionEvent.obtain(ev));
                if (isClick(ev)) {
                    for (int i = 0; i < getChildCount();i++){
                        View view = getChildAt(i);
                        if (!isInView(ev, view)) {
                            continue;
                        }
                        boolean handle = false;
                        for (MotionEvent event : touchEventTrack) {
                            handle = dispatchTransformedTouchEvent(event, view);
                            if (!handle){
                                break;
                            }
                        }
                        if (handle) {
                            MotionEvent cancelEvent = MotionEvent.obtain(ev);
                            cancelEvent.setAction(MotionEvent.ACTION_CANCEL);
                            return onTouchEvent(cancelEvent);
                        }
                    }
                }
                break;
            }
        }
        return onTouchEvent(ev);
    }

    private boolean isInView(MotionEvent ev, View view) {
        Rect rect = new Rect(view.getLeft(), view.getTop(), view.getRight(), view.getBottom());
        return rect.contains((int)ev.getX(), (int)ev.getY());
    }

    private boolean isClick(MotionEvent ev) {
        MotionEvent downEvent = this.touchEventTrack.get(0);
        return Math.abs(downEvent.getX() - ev.getX()) < touchSlop && Math.abs(downEvent.getY() - ev.getY()) < touchSlop;
    }

    private boolean dispatchTransformedTouchEvent(MotionEvent event, View child) {
        float offsetX = getScrollX() - child.getLeft();
        float offsetY = getScaleY() - child.getTop();
        event.offsetLocation(offsetX, offsetY);
        boolean handle = child.dispatchTouchEvent(event);
        if (!handle) {
            event.offsetLocation(-offsetX, -offsetY);
        }
        return handle;
    }
}
</code>```

I did try several things suggested in other SO threads, like the one below, but none of them works, best it achieves is disabling gestures for the lazy column too (which obviously is not what i want, i want to be able to scroll but just not pass the long press on scroll to the iFrame)

Jetpack Compose: how to disable gesture detection on children

https://github.com/PierfrancescoSoffritti/android-youtube-player/issues/848

Body:
I am using this youtube player (which uses iFrame Youtube API in a webview) in a jetpack compose app - via AndroidView()

 DisposableEffect(
         AndroidView(factory = {
             youTubePlayerView
        }
         )
    ) {
        onDispose { youTubePlayerView.release() }
    }

Problem is, when used from a Lazy Column, on scroll up, the long press is passed along to the iFrame in the webview, which triggers this context menu to appear:

Same problem occurs in the "classic" android view system, when used with a recycler view, and is described in detail here, along with a solution given - but I cant figure out how to adopt this solution to compose - or is there any other solution?
Let me recap, how to detect and stop the long press on vertical scroll from propagating to the iFrame?

public class CustomRecyclerView extends RecyclerView {
    private int touchSlop;
    private List<MotionEvent> touchEventTrack = new ArrayList<>();

    public CustomRecyclerView(@NonNull Context context) {
        super(context);
        touchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
    }

    public CustomRecyclerView(Context context, AttributeSet attributeSet){
        super(context,attributeSet);
        touchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
    }

    public CustomRecyclerView(@NonNull Context context, @Nullable @org.jetbrains.annotations.Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        touchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        // TODO Only intercept vertical scroll
        switch (ev.getAction()){
            case MotionEvent.ACTION_DOWN:{
                touchEventTrack.clear();
                touchEventTrack.add(MotionEvent.obtain(ev));
                break;
            }
            case MotionEvent.ACTION_MOVE:{
                touchEventTrack.add(MotionEvent.obtain(ev));
                break;
            }
            case MotionEvent.ACTION_UP:{
                touchEventTrack.add(MotionEvent.obtain(ev));
                if (isClick(ev)) {
                    for (int i = 0; i < getChildCount();i++){
                        View view = getChildAt(i);
                        if (!isInView(ev, view)) {
                            continue;
                        }
                        boolean handle = false;
                        for (MotionEvent event : touchEventTrack) {
                            handle = dispatchTransformedTouchEvent(event, view);
                            if (!handle){
                                break;
                            }
                        }
                        if (handle) {
                            MotionEvent cancelEvent = MotionEvent.obtain(ev);
                            cancelEvent.setAction(MotionEvent.ACTION_CANCEL);
                            return onTouchEvent(cancelEvent);
                        }
                    }
                }
                break;
            }
        }
        return onTouchEvent(ev);
    }

    private boolean isInView(MotionEvent ev, View view) {
        Rect rect = new Rect(view.getLeft(), view.getTop(), view.getRight(), view.getBottom());
        return rect.contains((int)ev.getX(), (int)ev.getY());
    }

    private boolean isClick(MotionEvent ev) {
        MotionEvent downEvent = this.touchEventTrack.get(0);
        return Math.abs(downEvent.getX() - ev.getX()) < touchSlop && Math.abs(downEvent.getY() - ev.getY()) < touchSlop;
    }

    private boolean dispatchTransformedTouchEvent(MotionEvent event, View child) {
        float offsetX = getScrollX() - child.getLeft();
        float offsetY = getScaleY() - child.getTop();
        event.offsetLocation(offsetX, offsetY);
        boolean handle = child.dispatchTouchEvent(event);
        if (!handle) {
            event.offsetLocation(-offsetX, -offsetY);
        }
        return handle;
    }
}

I did try several things suggested in other SO threads, like the one below, but none of them works, best it achieves is disabling gestures for the lazy column too (which obviously is not what i want, i want to be able to scroll but just not pass the long press on scroll to the iFrame)

Jetpack Compose: how to disable gesture detection on children

https://github.com/PierfrancescoSoffritti/android-youtube-player/issues/848


问:
Why my file gets deleted from /tmp directory on LINUX?
(Linux Sles12 OS)
After running command kinit to create a Kerberos ticket,
I run klist and I see the file is stored at: /tmp/krb5cc_123456789
its seems like after a random short time (few min/sec) the file gets deleted.
how can I find what is responsible for the deletion of this file?

Thanks!

I searched and saw that the file /usr/lib/tmpfiles.d/tmp.conf is responsible for tmp deletion policy however it is with default setting means nothing gets deleted.


问:
Delphi Android app has Accessibility issues on Google Play Console
I have an Android app built with Delphi 11.2 that works fine on the devices. However, when I submit the app to Google Play Console for testing, their auto testing reports warnings about Accessibility problems. The Pre-Launch report has a red rectangle highlighting the full screen of the app under the Content labeling section, with the recommendation "This item may not have a label readable by screen readers."

So, I started up TalkBack on my Android device, and it does the same thing. It shows a blue highlight around the whole app screen. If I try to press any of the buttons on the screen, I hear a beep and the highlight remains around the whole screen and nothing happens. It is like there is some object overlaying the whole app screen and not allowing access to any of the controls under it.

When I look at my source code, the only items that cover the full screen are the form itself and a TLayout item set to Client of the form. All of the controls are placed on top of the TLayout.

Has anyone else had problems like this with Android apps build with Delphi? If so, what do I need to do to fix the problem for screen readers not having access to the controls?


问:
Calling postgresql function from dotnet6
My PostgreSQL function:

```<code>CREATE OR REPLACE FUNCTION public.fn_test()
RETURNS refcursor AS $$
DECLARE
    ref1 refcursor;
BEGIN

OPEN ref1 FOR
    Select * from public.testTable;

RETURN ref1;
END;
$$ LANGUAGE plpgsql;
</code>```

My C# dotnet6 code:

```<code>string connString = String.Format("Server={0};Database={1};User Id={2};Password={3};Port={4}", Host, "testDB", Username, Password, Port);
NpgsqlConnection pgCon = new NpgsqlConnection(connString);
pgCon.Open();
string strCmd = @"select * from public.fn_test();";
NpgsqlCommand pgCmd = new NpgsqlCommand(strCmd, pgCon);
NpgsqlDataReader pgDr = pgCmd.ExecuteReader(); //This returns <unnamed portal 1>
</code>```

Question:
How to read values from <unnamed portal 1>?

PostgreSQL version: 14.5

Dotnet version: 6

Visual Studio 2022

Thank you!

Body:
My PostgreSQL function:

CREATE OR REPLACE FUNCTION public.fn_test()
RETURNS refcursor AS $$
DECLARE
    ref1 refcursor;
BEGIN

OPEN ref1 FOR
    Select * from public.testTable;

RETURN ref1;
END;
$$ LANGUAGE plpgsql;

My C# dotnet6 code:

string connString = String.Format("Server={0};Database={1};User Id={2};Password={3};Port={4}", Host, "testDB", Username, Password, Port);
NpgsqlConnection pgCon = new NpgsqlConnection(connString);
pgCon.Open();
string strCmd = @"select * from public.fn_test();";
NpgsqlCommand pgCmd = new NpgsqlCommand(strCmd, pgCon);
NpgsqlDataReader pgDr = pgCmd.ExecuteReader(); //This returns <unnamed portal 1>

Question:
How to read values from <unnamed portal 1>?

PostgreSQL version: 14.5

Dotnet version: 6

Visual Studio 2022

Thank you!


问:
Upgrade openpgpg from version 4 to version 5.x - initworker() not found
I need to upgrade openpgp from version 4.x to version 5.x and I noticed there are major changes in version 5.x

The reason I need to upgrade is that version 4.x have dependency that causing problem and this dependency do not exit in version 5.x

First problem I get when upgrading to version 5.x is that initworker function does not exist.

is there a documentation to help upgrading to version 5.x ?

I was expecting version 5 to be backward compatible with minor changes


问:
The enviroment varoable path seems to have some paths containing the """ character
Every time when i open vs code i get this messag: The environment variable 'Path' seems to have some paths containing the '"' character. The existence of such a character is known to have caused the Python extension to not load. If the extension fails to load please modify your paths to remove this '"' character. i dont know why it comes up and how to make it disappear

i tried changing some values in the different enviroment settings the user-settings and the system-settings but it did not seem to work.


问:
What happens in Peterson's problem if one process only wishes to use the critical section once?
So for Peterson's solution:

```<code>flag[0]   = 0;
flag[1]   = 0;
turn;

P0: flag[0] = 1;
    turn = 1;
    while (flag[1] == 1 && turn == 1)
    {
           // busy wait
    }
    // critical section
       ...
    // end of critical section
    flag[0] = 0;

P1: flag[1] = 1;
    turn = 0;
    while (flag[0] == 1 && turn == 0)
    {
           // busy wait
    }
    // critical section
       ...
    // end of critical section
    flag[1] = 0;
</code>```

Imagine both processes are ran at the same time but P1 is a bit slower and sets turn = 0.
P0 is now allowed to enter the critical section and when done it sets the flag[0] = 0; indicating that P0 does not want to enter the critical section anymore. But what if P0 now exits the while loop?

turn is still set to 0 no?
Would this not mean that P1 is now stuck in the wile loop.

Body:
So for Peterson's solution:

flag[0]   = 0;
flag[1]   = 0;
turn;

P0: flag[0] = 1;
    turn = 1;
    while (flag[1] == 1 && turn == 1)
    {
           // busy wait
    }
    // critical section
       ...
    // end of critical section
    flag[0] = 0;

P1: flag[1] = 1;
    turn = 0;
    while (flag[0] == 1 && turn == 0)
    {
           // busy wait
    }
    // critical section
       ...
    // end of critical section
    flag[1] = 0;

Imagine both processes are ran at the same time but P1 is a bit slower and sets turn = 0.
P0 is now allowed to enter the critical section and when done it sets the flag[0] = 0; indicating that P0 does not want to enter the critical section anymore. But what if P0 now exits the while loop?

turn is still set to 0 no?
Would this not mean that P1 is now stuck in the wile loop.


问:
Getting error while populating a table in laravel
i am learning to work with laravel and i'm having some troubles and i can't figure it out why. I have already changed names and I get the same result. I am trying to populate one table with some data from the database unsuccessfully. I would appreciate some help.
I keep getting the error : Class "App\Models\Contacto" not found

Controller

```<code>use App\Models\Contacto;

    public function show()
    {
       $data = Contacto::all();
       return view('contactos', ['contacto' => $data]);
    }
</code>```

Model

```<code>use Illuminate\Database\Eloquent\Model;

class Contacto extends Model
{
    use HasFactory;
    public $timestamp = false;
    protected $table = 'contacto';
    protected $fillable = ['nt', 'consumo','id_comercial','tipo_contacto','nipc','nome'];
}
</code>```

web

```<code>use App\Http\Controllers\ContactoController;

Route::get('/contactos', [ContactoController::class, 'show']);
</code>```

Blade

```<code>            @foreach($contacto as $con)
            <tr>
                <td class="align-middle">{{$con ['nt']}}</td>
                <td class="align-middle">{{$con ['consumo']}}</td>
                <td class="align-middle">{{$con ['id_comercial']}}</td>
                <td class="align-middle">{{$con ['tipo_contacto']}}</td>
                <td class="align-middle">{{$con ['nipc']}}</td>
                <td class="align-middle">{{$con ['nome']}}</td>
                <td class="align-middle"><a href="cliente"><button type="button" class="col-12 btn btn-outline-primary mb-1 p-3">Abrir ficha contacto</button></a></td>
            </tr>
            @endforeach
</code>```
```<code></code>```

Body:
i am learning to work with laravel and i'm having some troubles and i can't figure it out why. I have already changed names and I get the same result. I am trying to populate one table with some data from the database unsuccessfully. I would appreciate some help.
I keep getting the error : Class "App\Models\Contacto" not found

Controller

use App\Models\Contacto;

    public function show()
    {
       $data = Contacto::all();
       return view('contactos', ['contacto' => $data]);
    }

Model

use Illuminate\Database\Eloquent\Model;

class Contacto extends Model
{
    use HasFactory;
    public $timestamp = false;
    protected $table = 'contacto';
    protected $fillable = ['nt', 'consumo','id_comercial','tipo_contacto','nipc','nome'];
}

web

use App\Http\Controllers\ContactoController;

Route::get('/contactos', [ContactoController::class, 'show']);

Blade

            @foreach($contacto as $con)

                {{$con ['nt']}}
                {{$con ['consumo']}}
                {{$con ['id_comercial']}}
                {{$con ['tipo_contacto']}}
                {{$con ['nipc']}}
                {{$con ['nome']}}
                <button type="button" class="col-12 btn btn-outline-primary mb-1 p-3">Abrir ficha contacto</button>

            @endforeach


问:
Returning Pivot table data in Laravel 9 Resource (Building an API)
I'm trying to build an API in Laravel 9 and want data from a pivot table.

I want to retrieve all instances, whether they have sessions assigned to them or not, and display the sessions where relevant.

I currently have a table of instances and a table of sessions - each instance can each many sessions, and each session can belong to multiple cases.

Instance Model

```<code>public function sessions() {
    return $this->belongsToMany(Session::class)->using(InstanceSession::class)->withPivot(['date', 'zoom_room_id', 'trainer_id']);
}
</code>```

Session Model

```<code>function instances() {
    return $this->belongsToMany(Instance::class);
}
</code>```

If I put this in my Resource:

```<code>public function toArray($request)
{
    return [
        'courseName' => $this->course->name,
        'cohort' => $this->cohort->name,
        'sessions' => $this->sessions
    ];

}
</code>```

It outputs this object for each session along with the data for the instance.

```<code>{
  "id": 10,
  "name": "eos totam corporis aut",
  "review_due": "2022-10-11",
  "review_status": "Embedding",
  "slides": "http://www.schimmel.com/",
  "trainer_notes": "http://www.roberts.com/vero-asperiores-voluptatum-facilis-aut-omnis-eos.html",
  "created_at": "2022-11-01T17:00:24.000000Z",
  "updated_at": "2022-11-01T17:00:24.000000Z",
  "pivot": {
    "instance_id": 1,
    "session_id": 10,
    "date": "2023-01-06",
    "zoom_room_id": 1,
    "trainer_id": 17
  }
}
</code>```

How do I access that pivot object and its relationships to get the data I want?

NB. I have tried the pivot methods and whenLoaded methods from the Laravel docs, and this doesn't seem to give me anything.

Body:
I'm trying to build an API in Laravel 9 and want data from a pivot table.

I want to retrieve all instances, whether they have sessions assigned to them or not, and display the sessions where relevant.

I currently have a table of instances and a table of sessions - each instance can each many sessions, and each session can belong to multiple cases.

Instance Model

public function sessions() {
    return $this->belongsToMany(Session::class)->using(InstanceSession::class)->withPivot(['date', 'zoom_room_id', 'trainer_id']);
}

Session Model

function instances() {
    return $this->belongsToMany(Instance::class);
}

If I put this in my Resource:

public function toArray($request)
{
    return [
        'courseName' => $this->course->name,
        'cohort' => $this->cohort->name,
        'sessions' => $this->sessions
    ];

}

It outputs this object for each session along with the data for the instance.

{
  "id": 10,
  "name": "eos totam corporis aut",
  "review_due": "2022-10-11",
  "review_status": "Embedding",
  "slides": "http://www.schimmel.com/",
  "trainer_notes": "http://www.roberts.com/vero-asperiores-voluptatum-facilis-aut-omnis-eos.html",
  "created_at": "2022-11-01T17:00:24.000000Z",
  "updated_at": "2022-11-01T17:00:24.000000Z",
  "pivot": {
    "instance_id": 1,
    "session_id": 10,
    "date": "2023-01-06",
    "zoom_room_id": 1,
    "trainer_id": 17
  }
}

How do I access that pivot object and its relationships to get the data I want?

NB. I have tried the pivot methods and whenLoaded methods from the Laravel docs, and this doesn't seem to give me anything.


问:
Debian Package Installation: post-installation script subprocess returned error
I need to have JavaFX Scene Builder in my Intellij Idea. To do so, I need to download and install SceneBuilder Debain package first on Deepin. With the following command

```<code> sudo dpkg -i SceneBuilder-19.0.0.deb
</code>```

yields an error

```<code>Selecting previously unselected package scenebuilder.
(Reading database ... 233756 files and directories currently installed.)
Preparing to unpack SceneBuilder-19.0.0.deb ...
Unpacking scenebuilder (19.0.0) ...
Setting up scenebuilder (19.0.0) ...
xdg-desktop-menu: No writable system menu directory found.
dpkg: error processing package scenebuilder (--install):
  installed scenebuilder package post-installation script subprocess returned error
exit status 3
Errors were encountered while processing:
 scenebuilder
</code>```

How to resolve this post-installation script subprocess returned error ?

Body:
I need to have JavaFX Scene Builder in my Intellij Idea. To do so, I need to download and install SceneBuilder Debain package first on Deepin. With the following command

 sudo dpkg -i SceneBuilder-19.0.0.deb

yields an error

Selecting previously unselected package scenebuilder.
(Reading database ... 233756 files and directories currently installed.)
Preparing to unpack SceneBuilder-19.0.0.deb ...
Unpacking scenebuilder (19.0.0) ...
Setting up scenebuilder (19.0.0) ...
xdg-desktop-menu: No writable system menu directory found.
dpkg: error processing package scenebuilder (--install):
  installed scenebuilder package post-installation script subprocess returned error
exit status 3
Errors were encountered while processing:
 scenebuilder

How to resolve this post-installation script subprocess returned error ?


问:
Problems sourcing env variables for the vscode-server process/extensions
I am developing with the espressif ESP-IDF. I'm doing this on a windows mashine inside the WSL2. To do this I decided to setup a custom distribution based on ubuntu-core lts image.

I got all that set up, can connect to it but: in order for the ESP-IDF to work I added a line to the .bashrc to source a .sh file that sets some environment variables adds stuff to PATH and so on. That works fine in the integrated terminal. The CMake extension (which does need the variables) does not seem to get them. It seems like the vscode-server process does not source the .bashrc of the user it connects to. While that does somewhat seem correct to me I also feel like there should be a way to do this.

Am I doing something wrong, is this intended behavior, or did I encounter a bug?


问:
Running multiple Debezium connectors for MongoDB source
We're running MongoDB debezium connector. We want to do an initial snapshot of ~ 5TB of the data and then run the CDC.

I'm wondering if it's recommended to run multiple connectors and configure each connector to read the data from a subset of the collections. Or even run one connector per collection?

All of these connectors will share the same topic for the offset, status, and config as they will run on the same Connect Cluster. Would that cause any issues with the MongoDB connector?

I'm new with Kafka connect and debezium, so any suggestion is appreciated.


问:
Draggable: check for changes on dragged cloned element and save changed cloned element in Local Storage
I am using Vue Draggable package to clone HTML components into a empty page.

I am building a page builder. In the page builder, user can change text and images after a component have been cloned to the empty page.

Does anyone know, how I can check what exactly have been changed in the cloned HTML component?

The idea is that I want to save the modified cloned HTML component (text or image change) in Local Storage.

Vue code. File name: Designer.vue:

const dragComponentToPage = function (comp) {
    // deep clone component
    const clonedComp = { ...comp };

    // return to the cloned element to be dropped
    return clonedComp;
};
```

I can provide more code if needed.

Body:
I am using Vue Draggable package to clone HTML components into a empty page.

I am building a page builder. In the page builder, user can change text and images after a component have been cloned to the empty page.

Does anyone know, how I can check what exactly have been changed in the cloned HTML component?

The idea is that I want to save the modified cloned HTML component (text or image change) in Local Storage.

Vue code. File name: Designer.vue:

const dragComponentToPage = function (comp) {
    // deep clone component
    const clonedComp = { ...comp };

    // return to the cloned element to be dropped
    return clonedComp;
};

I can provide more code if needed.


问:
How to limit the amount of rows in a VueJS table
I have this table

```<code> <table class="table">
                <thead>
                    <tr>
                        <th>{{ i18n('Date') }}</th>
                        <th>{{ i18n('Transaction Type') }}</th>
                        <th>{{ i18n('Starbucks Card') }}</th>
                        <th>{{ i18n('Card Type') }}</th>
                        <th>{{ i18n('Amount') }} (R$)</th>
                        <th>{{ i18n('Stars') }}</th>
                        <th>{{ i18n('Expiration of the Stars') }}</th>
                        <th>{{ i18n('Store') }}</th>
                        <th>{{ i18n('Product') }}</th>
                    </tr>
                </thead>
                <tbody v-if="loading">
                    <tr>
                        <td colspan="9" class="loading"></td>
                    </tr>
                </tbody>
                <tbody v-if=" ! loading && data.extract && ! data.extract.length">
                    <tr>
                        <td colspan="9" class="no-results">{{ i18n('No results found') }}</td>
                    </tr>
                </tbody>
                <tbody v-if=" ! loading &&  data.extract && data.extract.length" class="sf">
                    <tr v-for="(item, k) in data.extract" v-bind:key="k">
                        <td>{{ formatDate(item.transactionDate) }}</td>
                        <td>{{ i18n(processDescription(item.typeDescription)) }}</td>
                        <td>{{ item.starbucksCard }}</td>
                        <td>{{ i18n(item.cardType) }}</td>
                        <td>{{ item.value }}</td>
                        <td>{{ item.stars }}</td>
                        <td>{{ (item.expirationDate) ? formatDate(item.expirationDate) : ' - '}}</td>
                        <td>{{ (item.place) ? item.place : ' - ' }}</td>
                        <td v-if="!item.products || item.products.length == 0"> - </td>
                        <td v-if="item.products">
                            <div v-for="(prod,k) in item.products" v-bind:key="k">
                                - {{prod}}
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
</code>```

It is automatically populated with an object that comes from an endPoint, However, this element is very large, with more than 10000 thousand lines, in this case I need to limit the number of lines in the frontEnd. I looked in several places but I didn't find anything that could help.

Body:
I have this table

                        {{ i18n('Date') }}
                        {{ i18n('Transaction Type') }}
                        {{ i18n('Starbucks Card') }}
                        {{ i18n('Card Type') }}
                        {{ i18n('Amount') }} (R$)
                        {{ i18n('Stars') }}
                        {{ i18n('Expiration of the Stars') }}
                        {{ i18n('Store') }}
                        {{ i18n('Product') }}

                        {{ i18n('No results found') }}

                        {{ formatDate(item.transactionDate) }}
                        {{ i18n(processDescription(item.typeDescription)) }}
                        {{ item.starbucksCard }}
                        {{ i18n(item.cardType) }}
                        {{ item.value }}
                        {{ item.stars }}
                        {{ (item.expirationDate) ? formatDate(item.expirationDate) : ' - '}}
                        {{ (item.place) ? item.place : ' - ' }}
                         -

                                - {{prod}}

It is automatically populated with an object that comes from an endPoint, However, this element is very large, with more than 10000 thousand lines, in this case I need to limit the number of lines in the frontEnd. I looked in several places but I didn't find anything that could help.


问:
How to setup and use the firebase v9 into class based react project?
I am new in react. How can I use firebase inside react project.

//  config file of firebase looks like this
//../src/firebase.js

```<code>import { initializeApp } from 'firebase/app';
import { getFirestore } from 'firebase/firestore';

const firebaseConfig = {
    apiKey: "AIzaSyCXaeZcvAMHJPKnWNob6iJrfSNakCFfoew",
    authDomain: "cart-items-72efc.firebaseapp.com",
    projectId: "cart-items-72efc",
    storageBucket: "cart-items-72efc.appspot.com",
    messagingSenderId: "38214317083",
    appId: "1:38214317083:web:cca4fc6829824dae1a74be"
};
const app = initializeApp(firebaseConfig);
export const db = getFirestore(app);

</code>```

// Want to use db inside app.js which is class based component
//../src/components/app.js

```<code>import React, { Component } from 'react';
import db from '../firebase';
import {collection} from 'firebase/firestore';

class App extends Component{
    constructor() {
        super();
        this.state = {
            products: [],
        }
    }
    componentDidMount() {
        db.collection('item').onSnapshot((snapshot) => {
           const products = snapshot.docs.map((doc) => {
               const data = doc.data();
               data['id'] = doc.id;
               return data;
          });
         this.setState({
             products:products
         })
       })
      }
    }
</code>```

I do this kind of setup but not able to get data from firebase and get some compilation error.

Thank you for any help:)

Body:
I am new in react. How can I use firebase inside react project.

//  config file of firebase looks like this
//../src/firebase.js

import { initializeApp } from 'firebase/app';
import { getFirestore } from 'firebase/firestore';

const firebaseConfig = {
    apiKey: "AIzaSyCXaeZcvAMHJPKnWNob6iJrfSNakCFfoew",
    authDomain: "cart-items-72efc.firebaseapp.com",
    projectId: "cart-items-72efc",
    storageBucket: "cart-items-72efc.appspot.com",
    messagingSenderId: "38214317083",
    appId: "1:38214317083:web:cca4fc6829824dae1a74be"
};
const app = initializeApp(firebaseConfig);
export const db = getFirestore(app);

// Want to use db inside app.js which is class based component
//../src/components/app.js

import React, { Component } from 'react';
import db from '../firebase';
import {collection} from 'firebase/firestore';

class App extends Component{
    constructor() {
        super();
        this.state = {
            products: [],
        }
    }
    componentDidMount() {
        db.collection('item').onSnapshot((snapshot) => {
           const products = snapshot.docs.map((doc) => {
               const data = doc.data();
               data['id'] = doc.id;
               return data;
          });
         this.setState({
             products:products
         })
       })
      }
    }

I do this kind of setup but not able to get data from firebase and get some compilation error.

Thank you for any help:)


问:
RasberriPi 4, trying to stream Camera throuth UDP Socket - OSError: [Errno 99] Cannot assign requested address (Python, Kivy + Socket)
So basicly I just need stream from server (RasberiPi4) to my client (Android phone). My friend can run this code and its working on his Pi (Server) - Linux (Client). I have been struggling to fix this error.

So this is USB DEBUG -

https://paste.pythondiscord.com/sijojirobo

This is code for Server

https://paste.pythondiscord.com/izohamodos

This is Client

https://paste.pythondiscord.com/maquqesojo

So when I launch Kivy app this errors shows up, so something is not right but I tried many things.
I am using RaspAP which creates hotspot on which I connect with client and cant connect on UDP Server. Can someone please help me?


问:
NetworkX: Subgraph matching
Trying to match a Query subgraph to a Target graph, where:

Query:

and Target:

As I understand matching in this case should return tuples of matching nodes:

```<code>(1,1)
(2,2)
(3,3)
</code>```

where first number is a node in Query and second is node in Target

Yet with the following code I get another result:

```<code>import networkx as nx
import networkx.algorithms.isomorphism as iso

# Target graph
target = nx.Graph()
target.add_edge(1, 2)
target.add_edge(1, 3)
target.add_edge(1, 5)
target.add_edge(2, 3)
target.add_edge(3, 4)
target.add_edge(4, 5)

# Add attributes to target nodes
target.nodes[1]['cat'] = 1
target.nodes[2]['cat'] = 2
target.nodes[3]['cat'] = 3
target.nodes[4]['cat'] = 4
target.nodes[5]['cat'] = 5

# Query graph
query = nx.Graph()
query.add_edge(1, 2)
query.add_edge(1, 3)
query.add_edge(2, 3)

# Add attributes to query graph
query.nodes[1]['cat'] = 1
query.nodes[2]['cat'] = 2
query.nodes[3]['cat'] = 3

# GraphMatcher is supposed to call this function when matching nodes
def node_match(q_node_dict, t_node_dict): # This is never called!
    #print("q_node_dict: {} t_node_dict: {}".format(q_node_dict, t_node_dict))
    return q_node_dict['cat'] == t_node_dict['cat']

# Matcher
GM = iso.GraphMatcher(query, target, node_match=node_match)

# This should print matching nodes?
for x in GM.candidate_pairs_iter():
    print(x)

# What this should print?
for x in GM.subgraph_isomorphisms_iter():
    print(x)
</code>```

Instead code in GM.candidate_pairs_iter() returns:

```<code>(1,1)
(2,1)
(3,1)
</code>```

As if all nodes in Query match to a single node '1' in the Target. Why?

Iterator GM.subgraph_isomorphisms_iter() is empty. What should it iterate?

In hope to facilitate subgraph matching I have added attributes to Query and Target. Nodes 1,2,3 in Query and Target have the same values and should match, but it looks like they don't.

According to NetworkX documentation node_match parameter of GraphMatcher constructor  is a "callable function that returns True iff node n1 in G1 and n2 in G2 should be considered equal during the isomorphism test. The function will be called like:

node_match(G1.nodes[n1], G2.nodes[n2]) "

and this function is never called in my case!

What am I missing? Thanks!

Title: NetworkX: Subgraph matching

Body:
Trying to match a Query subgraph to a Target graph, where:

Query:

and Target:

As I understand matching in this case should return tuples of matching nodes:

(1,1)
(2,2)
(3,3)

where first number is a node in Query and second is node in Target

Yet with the following code I get another result:

import networkx as nx
import networkx.algorithms.isomorphism as iso

# Target graph
target = nx.Graph()
target.add_edge(1, 2)
target.add_edge(1, 3)
target.add_edge(1, 5)
target.add_edge(2, 3)
target.add_edge(3, 4)
target.add_edge(4, 5)

# Add attributes to target nodes
target.nodes[1]['cat'] = 1
target.nodes[2]['cat'] = 2
target.nodes[3]['cat'] = 3
target.nodes[4]['cat'] = 4
target.nodes[5]['cat'] = 5

# Query graph
query = nx.Graph()
query.add_edge(1, 2)
query.add_edge(1, 3)
query.add_edge(2, 3)

# Add attributes to query graph
query.nodes[1]['cat'] = 1
query.nodes[2]['cat'] = 2
query.nodes[3]['cat'] = 3

# GraphMatcher is supposed to call this function when matching nodes
def node_match(q_node_dict, t_node_dict): # This is never called!
    #print("q_node_dict: {} t_node_dict: {}".format(q_node_dict, t_node_dict))
    return q_node_dict['cat'] == t_node_dict['cat']

# Matcher
GM = iso.GraphMatcher(query, target, node_match=node_match)

# This should print matching nodes?
for x in GM.candidate_pairs_iter():
    print(x)

# What this should print?
for x in GM.subgraph_isomorphisms_iter():
    print(x)

Instead code in GM.candidate_pairs_iter() returns:

(1,1)
(2,1)
(3,1)

As if all nodes in Query match to a single node '1' in the Target. Why?

Iterator GM.subgraph_isomorphisms_iter() is empty. What should it iterate?

In hope to facilitate subgraph matching I have added attributes to Query and Target. Nodes 1,2,3 in Query and Target have the same values and should match, but it looks like they don't.

According to NetworkX documentation node_match parameter of GraphMatcher constructor  is a "callable function that returns True iff node n1 in G1 and n2 in G2 should be considered equal during the isomorphism test. The function will be called like:

node_match(G1.nodes[n1], G2.nodes[n2]) "

and this function is never called in my case!

What am I missing? Thanks!


问:
Javascript Iframe Security Error Within Try/Catch Block In Webkit Browsers
When I run the following code in webkit browsers, I get an error outputted to the console despite having my code wrapped in a try/catch block.

```<code>var externallyFramed = false;
try {
  externallyFramed = top.location.host != location.host;
} catch (e) {
  externallyFramed = true;
}
</code>```

The error I get is the following:

Unsafe JavaScript attempt to access frame with URL...

Is there anything I can do differently to prevent the error from showing up?

ContentLicense: CC BY-SA 3.0

Body:
When I run the following code in webkit browsers, I get an error outputted to the console despite having my code wrapped in a try/catch block.

var externallyFramed = false;
try {
  externallyFramed = top.location.host != location.host;
} catch (e) {
  externallyFramed = true;
}

The error I get is the following:

Unsafe JavaScript attempt to access frame with URL...

Is there anything I can do differently to prevent the error from showing up?


问:
facet_plot returning "object...not found" error with aes()
I am trying to produce a plot containing two figures: (1) a phylogenetic tree on the left, and (2) a horizontal stacked bar graph on the right.

```<code>library(ggtree)
library(tidyverse)
library(clustree)

p <- ggtree(vtree) + geom_blank(aes(x=0.42))

facet_plot(p, data = mytable2, geom = geom_bar, panel = "Cluster", colour = "black",
           mapping = aes(x=Freq, fill=clusterCut), stat = "identity", orientation="y") +
  geom_tiplab(size = 2)
</code>```

But, when I run the code above, I get the following error:

```<code>Error:
! Problem while computing aesthetics.
ℹ Error occurred in the 4th layer.
Caused by error in `FUN()`:
! object 'clusterCut' not found
---
Backtrace:
  1. base (local) `<fn>`(x)
  2. ggplot2:::print.ggplot(x)
  4. ggplot2:::ggplot_build.ggplot(x)
  5. ggplot2:::by_layer(...)
 12. ggplot2 (local) f(l = layers[[i]], d = data[[i]])
 13. l$compute_aesthetics(d, plot)
 14. ggplot2 (local) compute_aesthetics(..., self = self)
 15. ggplot2:::scales_add_defaults(...)
 16. base::lapply(aesthetics[new_aesthetics], eval_tidy, data = data)
 17. rlang (local) FUN(X[[i]], ...)
</code>```

I'm having trouble understanding the error notice, and why 'clusterCut' can not be found.

Here is the data for 'mytable2':

```<code>structure(list(clusterCut = c(1L, 2L, 3L, 4L, 5L, 6L, 1L, 2L,
3L, 4L, 5L, 6L, 1L, 2L, 3L, 4L, 5L, 6L, 1L, 2L, 3L, 4L, 5L, 6L,
1L, 2L, 3L, 4L, 5L, 6L, 1L, 2L, 3L, 4L, 5L, 6L, 1L, 2L, 3L, 4L,
5L, 6L, 1L, 2L, 3L, 4L, 5L, 6L, 1L, 2L, 3L, 4L, 5L, 6L, 1L, 2L,
3L, 4L, 5L, 6L, 1L, 2L, 3L, 4L, 5L, 6L, 1L, 2L, 3L, 4L, 5L, 6L
), Var2 = c("Abatino macacapox virus", "Abatino macacapox virus",
"Abatino macacapox virus", "Abatino macacapox virus", "Abatino macacapox virus",
"Abatino macacapox virus", "Akhmeta virus", "Akhmeta virus",
"Akhmeta virus", "Akhmeta virus", "Akhmeta virus", "Akhmeta virus",
"Alaskapox virus", "Alaskapox virus", "Alaskapox virus", "Alaskapox virus",
"Alaskapox virus", "Alaskapox virus", "Camelpox virus", "Camelpox virus",
"Camelpox virus", "Camelpox virus", "Camelpox virus", "Camelpox virus",
"Cetaceanpox virus", "Cetaceanpox virus", "Cetaceanpox virus",
"Cetaceanpox virus", "Cetaceanpox virus", "Cetaceanpox virus",
"Cowpox virus", "Cowpox virus", "Cowpox virus", "Cowpox virus",
"Cowpox virus", "Cowpox virus", "Ectromelia virus", "Ectromelia virus",
"Ectromelia virus", "Ectromelia virus", "Ectromelia virus", "Ectromelia virus",
"Monkeypox virus", "Monkeypox virus", "Monkeypox virus", "Monkeypox virus",
"Monkeypox virus", "Monkeypox virus", "Raccoonpox virus", "Raccoonpox virus",
"Raccoonpox virus", "Raccoonpox virus", "Raccoonpox virus", "Raccoonpox virus",
"Skunkpox virus", "Skunkpox virus", "Skunkpox virus", "Skunkpox virus",
"Skunkpox virus", "Skunkpox virus", "Vaccinia virus", "Vaccinia virus",
"Vaccinia virus", "Vaccinia virus", "Vaccinia virus", "Vaccinia virus",
"Volepox virus", "Volepox virus", "Volepox virus", "Volepox virus",
"Volepox virus", "Volepox virus"), Freq = c(1, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0.166666666666667, 0, 0,
0, 0, 0.833333333333333, 0, 0, 1, 0, 0, 0, 0.705882352941177,
0, 0, 0, 0.294117647058824, 0, 1, 0, 0, 0, 0, 0, 0, 0.945205479452055,
0.0547945205479452, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0,
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0)), class = "data.frame", row.names = c(NA,
72L))
</code>```

Here is the data for 'vtree':

```<code>structure(list(edge = structure(c(13L, 14L, 15L, 15L, 16L, 16L,
14L, 17L, 17L, 18L, 19L, 20L, 21L, 21L, 22L, 22L, 20L, 19L, 23L,
23L, 18L, 13L, 14L, 15L, 1L, 16L, 2L, 3L, 17L, 4L, 18L, 19L,
20L, 21L, 5L, 22L, 6L, 7L, 8L, 23L, 9L, 10L, 11L, 12L), dim = c(22L,
2L)), edge.length = c(0.734311, 0.100672, 0.092785, 0.069175,
0.07415, 0.049043, 0.076235, 0.07632, 0.030269, 0.025787, 0.004255,
0.020637, 0.028154, 0.006898, 0.021277, 0.032036, 0.022467, 0.009429,
0.012776, 0.031136, 0.044858, 0.978308), Nnode = 11L, tip.label = c("027213.1_Raccoonpox",
"031033.1_Volepox", "031038.1_Skunkpox", "Alaskapox", "003310.1_Monkeypox",
"006998.1_Vaccinia", "003391.1_Camelpox", "003663.2_Cowpox",
"055231.1_Abatino", "004105.1_Ectromelia", "055230.1_Akhmeta",
"Cetaceanpox")), class = "phylo", order = "cladewise")
</code>```

Body:
I am trying to produce a plot containing two figures: (1) a phylogenetic tree on the left, and (2) a horizontal stacked bar graph on the right.

library(ggtree)
library(tidyverse)
library(clustree)

p <- ggtree(vtree) + geom_blank(aes(x=0.42))

facet_plot(p, data = mytable2, geom = geom_bar, panel = "Cluster", colour = "black",
           mapping = aes(x=Freq, fill=clusterCut), stat = "identity", orientation="y") +
  geom_tiplab(size = 2)

But, when I run the code above, I get the following error:

Error:
! Problem while computing aesthetics.
ℹ Error occurred in the 4th layer.
Caused by error in `FUN()`:
! object 'clusterCut' not found
---
Backtrace:
  1. base (local) `<fn>`(x)
  2. ggplot2:::print.ggplot(x)
  4. ggplot2:::ggplot_build.ggplot(x)
  5. ggplot2:::by_layer(...)
 12. ggplot2 (local) f(l = layers[[i]], d = data[[i]])
 13. l$compute_aesthetics(d, plot)
 14. ggplot2 (local) compute_aesthetics(..., self = self)
 15. ggplot2:::scales_add_defaults(...)
 16. base::lapply(aesthetics[new_aesthetics], eval_tidy, data = data)
 17. rlang (local) FUN(X[[i]], ...)

I'm having trouble understanding the error notice, and why 'clusterCut' can not be found.

Here is the data for 'mytable2':

structure(list(clusterCut = c(1L, 2L, 3L, 4L, 5L, 6L, 1L, 2L,
3L, 4L, 5L, 6L, 1L, 2L, 3L, 4L, 5L, 6L, 1L, 2L, 3L, 4L, 5L, 6L,
1L, 2L, 3L, 4L, 5L, 6L, 1L, 2L, 3L, 4L, 5L, 6L, 1L, 2L, 3L, 4L,
5L, 6L, 1L, 2L, 3L, 4L, 5L, 6L, 1L, 2L, 3L, 4L, 5L, 6L, 1L, 2L,
3L, 4L, 5L, 6L, 1L, 2L, 3L, 4L, 5L, 6L, 1L, 2L, 3L, 4L, 5L, 6L
), Var2 = c("Abatino macacapox virus", "Abatino macacapox virus",
"Abatino macacapox virus", "Abatino macacapox virus", "Abatino macacapox virus",
"Abatino macacapox virus", "Akhmeta virus", "Akhmeta virus",
"Akhmeta virus", "Akhmeta virus", "Akhmeta virus", "Akhmeta virus",
"Alaskapox virus", "Alaskapox virus", "Alaskapox virus", "Alaskapox virus",
"Alaskapox virus", "Alaskapox virus", "Camelpox virus", "Camelpox virus",
"Camelpox virus", "Camelpox virus", "Camelpox virus", "Camelpox virus",
"Cetaceanpox virus", "Cetaceanpox virus", "Cetaceanpox virus",
"Cetaceanpox virus", "Cetaceanpox virus", "Cetaceanpox virus",
"Cowpox virus", "Cowpox virus", "Cowpox virus", "Cowpox virus",
"Cowpox virus", "Cowpox virus", "Ectromelia virus", "Ectromelia virus",
"Ectromelia virus", "Ectromelia virus", "Ectromelia virus", "Ectromelia virus",
"Monkeypox virus", "Monkeypox virus", "Monkeypox virus", "Monkeypox virus",
"Monkeypox virus", "Monkeypox virus", "Raccoonpox virus", "Raccoonpox virus",
"Raccoonpox virus", "Raccoonpox virus", "Raccoonpox virus", "Raccoonpox virus",
"Skunkpox virus", "Skunkpox virus", "Skunkpox virus", "Skunkpox virus",
"Skunkpox virus", "Skunkpox virus", "Vaccinia virus", "Vaccinia virus",
"Vaccinia virus", "Vaccinia virus", "Vaccinia virus", "Vaccinia virus",
"Volepox virus", "Volepox virus", "Volepox virus", "Volepox virus",
"Volepox virus", "Volepox virus"), Freq = c(1, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0.166666666666667, 0, 0,
0, 0, 0.833333333333333, 0, 0, 1, 0, 0, 0, 0.705882352941177,
0, 0, 0, 0.294117647058824, 0, 1, 0, 0, 0, 0, 0, 0, 0.945205479452055,
0.0547945205479452, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0,
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0)), class = "data.frame", row.names = c(NA,
72L))

Here is the data for 'vtree':

structure(list(edge = structure(c(13L, 14L, 15L, 15L, 16L, 16L,
14L, 17L, 17L, 18L, 19L, 20L, 21L, 21L, 22L, 22L, 20L, 19L, 23L,
23L, 18L, 13L, 14L, 15L, 1L, 16L, 2L, 3L, 17L, 4L, 18L, 19L,
20L, 21L, 5L, 22L, 6L, 7L, 8L, 23L, 9L, 10L, 11L, 12L), dim = c(22L,
2L)), edge.length = c(0.734311, 0.100672, 0.092785, 0.069175,
0.07415, 0.049043, 0.076235, 0.07632, 0.030269, 0.025787, 0.004255,
0.020637, 0.028154, 0.006898, 0.021277, 0.032036, 0.022467, 0.009429,
0.012776, 0.031136, 0.044858, 0.978308), Nnode = 11L, tip.label = c("027213.1_Raccoonpox",
"031033.1_Volepox", "031038.1_Skunkpox", "Alaskapox", "003310.1_Monkeypox",
"006998.1_Vaccinia", "003391.1_Camelpox", "003663.2_Cowpox",
"055231.1_Abatino", "004105.1_Ectromelia", "055230.1_Akhmeta",
"Cetaceanpox")), class = "phylo", order = "cladewise")


问:
cannot import name 'config' from partially initialized module 'panel.config'(most likely due to a circular import)
I have an error "cannot import name 'config' from partially initialized module 'panel.config'(most likely due to a circular import) " when running an analysis.

I read solutions to similar problems and I changed the name of 'config.py' file to 'generate-config.py' to fix the issue but now I got another error 'no module named panel.config'

How to fix this issue?

Thanks


问:
How do I use dense optical flow to filter the key points given by SIFT?
I have a video, and I have applied SIFT and dense optical flow (Farneback) to it (Using python, and open CV). Is there a way to filter the key points given by sift using the dense optical flow, so that I only get the key points of the MOVING objects and it ignores those in the background?

Any help is much appreciated :)

I tried to filter it based on the "projected point" in the next frame, but I was unable to get it to work. At one point I was getting 2 points in the WHOLE video in just random places. I am not sure what I am doing wrong

EDIT --------------

I figured out that the output of the dense optical flow return the "shift" in x and y of every single pixel co-ordinate. I also figured out how to separate the keypoints returned by SIFT by x,y pixel co-ordinate, though I did need to round down or up to turn it into an Int value.

I now need to figure out how the optical flow algorithm decides which points to "color", and then use those co-ordinates to filter the key points. Any ideas?


问:
How to pass values through XPCE button and run a function?
I have a function that calculates all possible outcomes to a given equation in a given range. It needs 4 values that can be ints or unknown. I am trying to add some kind of GUI to let user input those values and get a result. I am not able to get any result from a function through GUI button, even though it passess input numbers. How can I run my function (oblicz) and get results to show up anywhere? I just want to input values and make the function run like you normally would without GUI. Here is my code:</p>
```<code>:-use_module(library(pce)).
usun(X,[X|Reszta],Reszta).
usun(X,[Y|Ogon],[Y|Reszta]):-
    usun(X,Ogon,Reszta).
niewiadome(X,L,L1):-
    usun(X,L,L1).
oblicz(A,B,C,D):-
    numlist(-50,50,L),
    niewiadome(A,L,_),niewiadome(B,L,_),niewiadome(C,L,_),niewiadome(D,L,_),
    A+B-C-3*D=:=2,
    A+B+C-2*D=:=24,
    A-B+C-D=:=12.

licz:- new(P, dialog('Obliczanie układów równań')),
    new(F,int_item('Podaj 1 niewiadomą')),
    new(G,int_item('Podaj 2 niewiadomą')),
    new(H,int_item('Podaj 3 niewiadomą')),
    new(J,int_item('Podaj 4 niewiadomą')),

    send(P, append, F),
    send(P, append, G),
    send(P, append, H),
    send(P, append, J),
    send(P, append, new(button('Gotowe',
    message(@prolog, oblicz, F, G, H, J)))),

    send(P, append, button('koniec',
    message(@prolog,zamknij,P))),

    send(P,open).

zamknij(P):-send(P, destroy).

</code>```

Body:
I have a function that calculates all possible outcomes to a given equation in a given range. It needs 4 values that can be ints or unknown. I am trying to add some kind of GUI to let user input those values and get a result. I am not able to get any result from a function through GUI button, even though it passess input numbers. How can I run my function (oblicz) and get results to show up anywhere? I just want to input values and make the function run like you normally would without GUI. Here is my code:

:-use_module(library(pce)).
usun(X,[X|Reszta],Reszta).
usun(X,[Y|Ogon],[Y|Reszta]):-
    usun(X,Ogon,Reszta).
niewiadome(X,L,L1):-
    usun(X,L,L1).
oblicz(A,B,C,D):-
    numlist(-50,50,L),
    niewiadome(A,L,_),niewiadome(B,L,_),niewiadome(C,L,_),niewiadome(D,L,_),
    A+B-C-3*D=:=2,
    A+B+C-2*D=:=24,
    A-B+C-D=:=12.

licz:- new(P, dialog('Obliczanie układów równań')),
    new(F,int_item('Podaj 1 niewiadomą')),
    new(G,int_item('Podaj 2 niewiadomą')),
    new(H,int_item('Podaj 3 niewiadomą')),
    new(J,int_item('Podaj 4 niewiadomą')),

    send(P, append, F),
    send(P, append, G),
    send(P, append, H),
    send(P, append, J),
    send(P, append, new(button('Gotowe',
    message(@prolog, oblicz, F, G, H, J)))),

    send(P, append, button('koniec',
    message(@prolog,zamknij,P))),

    send(P,open).

zamknij(P):-send(P, destroy).


问:
Regarding the pipeline, how to wait for function to finish before carrying on?
I am working on a module and am struggling with getting one of its functions to work synchronously with other commandlets in the pipeline.
Here is a simpe version of the function:

```<code>function Invoke-ShareX {
    [CmdletBinding()]
    param (
        [Parameter(Position = 0)]
        [ArgumentCompletions('ActiveMonitor', 'ActiveWindow')]
        [String]$Action,
        [String]$Destination
    )
    Process{
        switch ($PSBoundParameters.keys) {
            "Action" {
                switch ($Action) {
                    'ActiveMonitor'{ShareX -Workflow ActiveMonitor;(WatchClipboard) | get-item -ErrorAction SilentlyContinue}
                    'ActiveWindow' {}
                }
            }
        }
    }
}
</code>```

The above function is rellying on another function that is internal to the module:

```<code>function WatchClipboard {Set-clipboard $null; While ((Get-Clipboard).Length -eq 0){Start-Sleep -Milliseconds 10; Get-Clipboard}}
</code>```

I am essentially using ShareX to:

Trigger a preconfigured action via its Command Line

Take a screenshot

Place the path of the image file on my clipboard

Return this path to the host/pipeline for other commandlets

The problem I am having is, the next commandlet on the pipeline misses the returned object, for example:

```<code>Invoke-ShareX -Action ActiveMonitor
</code>```

Will return

```<code>C:\Users\...\Documents\ShareX\Screenshots\Monitor__1120.jpg
</code>```

But doing something like

```<code>Invoke-ShareX -Action ActiveMonitor | move -Destination $Temp
</code>```

Will return an error:

```<code>Move-Item: Cannot bind argument to parameter 'Path' because it is null.
</code>```

How can I pause flow of execution until up to the point the path is returned to the host\pipe?

Body:
I am working on a module and am struggling with getting one of its functions to work synchronously with other commandlets in the pipeline.
Here is a simpe version of the function:

function Invoke-ShareX {
    [CmdletBinding()]
    param (
        [Parameter(Position = 0)]
        [ArgumentCompletions('ActiveMonitor', 'ActiveWindow')]
        [String]$Action,
        [String]$Destination
    )
    Process{
        switch ($PSBoundParameters.keys) {
            "Action" {
                switch ($Action) {
                    'ActiveMonitor'{ShareX -Workflow ActiveMonitor;(WatchClipboard) | get-item -ErrorAction SilentlyContinue}
                    'ActiveWindow' {}
                }
            }
        }
    }
}

The above function is rellying on another function that is internal to the module:

function WatchClipboard {Set-clipboard $null; While ((Get-Clipboard).Length -eq 0){Start-Sleep -Milliseconds 10; Get-Clipboard}}

I am essentially using ShareX to:

Trigger a preconfigured action via its Command Line

Take a screenshot

Place the path of the image file on my clipboard

Return this path to the host/pipeline for other commandlets

The problem I am having is, the next commandlet on the pipeline misses the returned object, for example:

Invoke-ShareX -Action ActiveMonitor

Will return

C:\Users\...\Documents\ShareX\Screenshots\Monitor__1120.jpg

But doing something like

Invoke-ShareX -Action ActiveMonitor | move -Destination $Temp

Will return an error:

Move-Item: Cannot bind argument to parameter 'Path' because it is null.

How can I pause flow of execution until up to the point the path is returned to the host\pipe?


问:
Spring Security 2 matching mappings for /error
I have a customer JWT filter and when I try to make a request to APIs that aren't excluded from security I'm always getting 403 back. I'm sure that the token I'm sending is valid.
I assume there is some conflict in configuration since it says that there are 2 mappings for /error

Logs:

```<code>2023-01-09T22:07:00.844+02:00  INFO 18940 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2023-01-09T22:07:00.844+02:00  INFO 18940 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2023-01-09T22:07:00.844+02:00 TRACE 18940 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Detected org.springframework.web.multipart.support.StandardServletMultipartResolver@3928d789
2023-01-09T22:07:00.844+02:00 TRACE 18940 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Detected org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver@59824ef6
2023-01-09T22:07:00.844+02:00 TRACE 18940 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Detected org.springframework.web.servlet.theme.FixedThemeResolver@5c1b29d0
2023-01-09T22:07:00.845+02:00 TRACE 18940 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Detected DefaultRequestToViewNameTranslator
2023-01-09T22:07:00.845+02:00 TRACE 18940 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Detected SessionFlashMapManager
2023-01-09T22:07:00.845+02:00 DEBUG 18940 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : enableLoggingRequestDetails='false': request parameters and headers will be masked to prevent unsafe logging of potentially sensitive data
2023-01-09T22:07:00.845+02:00  INFO 18940 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms
2023-01-09T22:07:00.855+02:00 TRACE 18940 --- [nio-8080-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : 2 matching mappings: [{ [/error]}, { [/error], produces [text/html]}]
2023-01-09T22:07:00.858+02:00 TRACE 18940 --- [nio-8080-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
2023-01-09T22:07:00.859+02:00 TRACE 18940 --- [nio-8080-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : 2 matching mappings: [{ [/error]}, { [/error], produces [text/html]}]
2023-01-09T22:07:00.859+02:00 TRACE 18940 --- [nio-8080-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
</code>```

Config:

@Configuration
@EnableWebSecurity
@RequiredArgsConstructor
public class SecurityConfig {

    private final JwtManager jwtManager;
    private final CustomerCredentialsDao customerCredentialsDao;

    @Bean
    public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
        http
            .csrf().disable()
            .authorizeHttpRequests()
                .anyRequest().authenticated()
                .and()
            .sessionManagement()
                .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
                .and()
            .authenticationProvider(authenticationProvider())
            .addFilterBefore(new JwtAuthFilter(jwtManager, customerCredentialsDao), UsernamePasswordAuthenticationFilter.class);
        return http.build();
    }

    @Bean
    CorsConfigurationSource corsConfigurationSource() {
        CorsConfiguration configuration = new CorsConfiguration();
        configuration.setAllowedOrigins(Collections.singletonList("*"));
        configuration.setAllowedMethods(Arrays.asList("GET", "POST", "OPTIONS", "DELETE", "PUT", "PATCH"));
        configuration.setAllowedHeaders(Arrays.asList("X-Requested-With", "Origin", "Content-Type", "Accept", "Authorization"));
        configuration.setAllowCredentials(true);
        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
        source.registerCorsConfiguration("/**", configuration);
        return source;
    }

    @Bean
    public WebSecurityCustomizer webSecurityCustomizer() {
        return (web) -> web
                .ignoring()
                .requestMatchers(HttpMethod.POST, "/api/v1/customer")
                .requestMatchers(HttpMethod.POST, "/api/v1/auth")
                .requestMatchers(HttpMethod.GET, "/api/v1/customer/verify");
    }

    @Bean
    public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration) throws Exception {
        return authenticationConfiguration.getAuthenticationManager();
    }

    @Bean
    public AuthenticationProvider authenticationProvider() {
        final DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider();
        authenticationProvider.setUserDetailsService(userDetailsService());
        authenticationProvider.setPasswordEncoder(encoder());
        return authenticationProvider;
    }

    @Bean
    public UserDetailsService userDetailsService() {
        return email -> (CustomerContext) customerCredentialsDao.findCredentialsAndIdByEmail(email);
    }

    @Bean
    public PasswordEncoder encoder() {
        return new BCryptPasswordEncoder();
    }
}
```

And I have SecurityAutoConfiguration.class excluded.
Any idea whats going wrong here?

Body:
I have a customer JWT filter and when I try to make a request to APIs that aren't excluded from security I'm always getting 403 back. I'm sure that the token I'm sending is valid.
I assume there is some conflict in configuration since it says that there are 2 mappings for /error

Logs:

2023-01-09T22:07:00.844+02:00  INFO 18940 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2023-01-09T22:07:00.844+02:00  INFO 18940 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2023-01-09T22:07:00.844+02:00 TRACE 18940 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Detected org.springframework.web.multipart.support.StandardServletMultipartResolver@3928d789
2023-01-09T22:07:00.844+02:00 TRACE 18940 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Detected org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver@59824ef6
2023-01-09T22:07:00.844+02:00 TRACE 18940 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Detected org.springframework.web.servlet.theme.FixedThemeResolver@5c1b29d0
2023-01-09T22:07:00.845+02:00 TRACE 18940 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Detected DefaultRequestToViewNameTranslator
2023-01-09T22:07:00.845+02:00 TRACE 18940 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Detected SessionFlashMapManager
2023-01-09T22:07:00.845+02:00 DEBUG 18940 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : enableLoggingRequestDetails='false': request parameters and headers will be masked to prevent unsafe logging of potentially sensitive data
2023-01-09T22:07:00.845+02:00  INFO 18940 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms
2023-01-09T22:07:00.855+02:00 TRACE 18940 --- [nio-8080-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : 2 matching mappings: [{ [/error]}, { [/error], produces [text/html]}]
2023-01-09T22:07:00.858+02:00 TRACE 18940 --- [nio-8080-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
2023-01-09T22:07:00.859+02:00 TRACE 18940 --- [nio-8080-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : 2 matching mappings: [{ [/error]}, { [/error], produces [text/html]}]
2023-01-09T22:07:00.859+02:00 TRACE 18940 --- [nio-8080-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)

Config:

@Configuration
@EnableWebSecurity
@RequiredArgsConstructor
public class SecurityConfig {

    private final JwtManager jwtManager;
    private final CustomerCredentialsDao customerCredentialsDao;

    @Bean
    public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
        http
            .csrf().disable()
            .authorizeHttpRequests()
                .anyRequest().authenticated()
                .and()
            .sessionManagement()
                .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
                .and()
            .authenticationProvider(authenticationProvider())
            .addFilterBefore(new JwtAuthFilter(jwtManager, customerCredentialsDao), UsernamePasswordAuthenticationFilter.class);
        return http.build();
    }

    @Bean
    CorsConfigurationSource corsConfigurationSource() {
        CorsConfiguration configuration = new CorsConfiguration();
        configuration.setAllowedOrigins(Collections.singletonList("*"));
        configuration.setAllowedMethods(Arrays.asList("GET", "POST", "OPTIONS", "DELETE", "PUT", "PATCH"));
        configuration.setAllowedHeaders(Arrays.asList("X-Requested-With", "Origin", "Content-Type", "Accept", "Authorization"));
        configuration.setAllowCredentials(true);
        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
        source.registerCorsConfiguration("/**", configuration);
        return source;
    }

    @Bean
    public WebSecurityCustomizer webSecurityCustomizer() {
        return (web) -> web
                .ignoring()
                .requestMatchers(HttpMethod.POST, "/api/v1/customer")
                .requestMatchers(HttpMethod.POST, "/api/v1/auth")
                .requestMatchers(HttpMethod.GET, "/api/v1/customer/verify");
    }

    @Bean
    public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration) throws Exception {
        return authenticationConfiguration.getAuthenticationManager();
    }

    @Bean
    public AuthenticationProvider authenticationProvider() {
        final DaoAuthenticationProvider authenticationProvider = new DaoAuthenticationProvider();
        authenticationProvider.setUserDetailsService(userDetailsService());
        authenticationProvider.setPasswordEncoder(encoder());
        return authenticationProvider;
    }

    @Bean
    public UserDetailsService userDetailsService() {
        return email -> (CustomerContext) customerCredentialsDao.findCredentialsAndIdByEmail(email);
    }

    @Bean
    public PasswordEncoder encoder() {
        return new BCryptPasswordEncoder();
    }
}

And I have SecurityAutoConfiguration.class excluded.
Any idea whats going wrong here?


问:
How to intercept http response in Artifactory java client?
I need to log http response from Artifactory, I am using this https://github.com/jfrog/artifactory-client-java There is info on how to intercept and log requests, but no info on how to intercept/log responses. How can I achieve this?</p>


问:
Use Matrix4x4 to transform points in Unity3d
I would like to convert some Vector3 points into 2d, projecting them onto a plane just like a camera would, with perspective.
I am starting with 3d points, a camera position and look direction, and fov.
My attempt:

```<code>void Update()
    {
        Matrix4x4 proj = Matrix4x4.LookAt(FakeCam.transform.position, Vector3.zero, FakeCam.transform.up) *
            Matrix4x4.Perspective(fov, aspect, zNear, zFar);

        for (int i=0; i<8; i++)
        {
            var point = proj.MultiplyPoint(Points[i]);
            Dots.SetPosition(i, new Vector3(point.x, 0, point.z));
        }

        Dots.Draw(transform.localToWorldMatrix);
    }
</code>```

The LookAt matrix seems to work as expected here. If I only use the LookAt matrix, I get my object shown (with an orthographic projection). If I add the perspective matrix, it is twisted in the middle (the back face of the cube is rotated 180 ??)

Body:
I would like to convert some Vector3 points into 2d, projecting them onto a plane just like a camera would, with perspective.
I am starting with 3d points, a camera position and look direction, and fov.
My attempt:

void Update()
    {
        Matrix4x4 proj = Matrix4x4.LookAt(FakeCam.transform.position, Vector3.zero, FakeCam.transform.up) *
            Matrix4x4.Perspective(fov, aspect, zNear, zFar);

        for (int i=0; i<8; i++)
        {
            var point = proj.MultiplyPoint(Points[i]);
            Dots.SetPosition(i, new Vector3(point.x, 0, point.z));
        }

        Dots.Draw(transform.localToWorldMatrix);
    }

The LookAt matrix seems to work as expected here. If I only use the LookAt matrix, I get my object shown (with an orthographic projection). If I add the perspective matrix, it is twisted in the middle (the back face of the cube is rotated 180 ??)


问:
Right aligning aggregate columns in Blazorise/DataGrid
For context, I'm using ABP.IO/Blazorise to show a bunch of transactions.
Aggregate data is returned by from a serverside call. All works well, except for the alignment of those columns. They are 'something' aligned it seems... I would like the correctly right aligned with the other values in the grid rows.

Here's a pic of what it looks like:

And here is the code:

```<code>       <DataGrid
        Striped="true"
        TItem="ViewTransactionDetailedDto"
        Data="TransactionsList"
        AggregateData="AggregatesList"
        ReadData="OnDataGridReadAsync"
        TotalItems="@TotalCount"
        CurrentPage="@CurrentPage"
        PageSizeChanged="@OnPageSizeChanged"
        ShowPager="true"
        ShowPageSizes="true"
        Sortable="true"
        PageSize="@PageSize">

        <DataGridAggregates>
            @foreach (var aggregate in ThisReportGridColumns.AggregateColumns)
            {
                <DataGridAggregate Field="@(aggregate.field)" Aggregate="DataGridAggregateType.Sum" DisplayFormat="{0:N0}"></DataGridAggregate>
            }
        </DataGridAggregates>

        <DataGridColumns>
            @{ int index = 0; }
            @foreach (var col in ThisReportGridColumns.Columns)
            {
                var colRefTemplate = col.custom;
                if (!col.HasCustomLookup)
                {
                    <DataGridColumn TItem="ViewTransactionDetailedDto"
                                    DisplayOrder="@index"
                                    Field="@(col.field)"
                                    Sortable="@col.sortable"
                                    SortField="@col.sortField"
                                    Caption="@col.caption"
                                    HeaderTextAlignment="@col.BlazorHeaderAlignment()"
                                    TextAlignment="@col.BlazorTextAlignment()">
                    </DataGridColumn>
                }
                @if (col.HasCustomLookup)
                {
                    <DataGridColumn TItem="ViewTransactionDetailedDto"
                                    DisplayOrder="@index"
                                    Field="@col.field"
                                    Sortable="@col.sortable"
                                    SortField="@col.sortField"
                                    Caption="@col.caption"
                                    HeaderTextAlignment="@col.BlazorHeaderAlignment()"
                                    TextAlignment="@col.BlazorTextAlignment()">
                        <DisplayTemplate>
                            @context.ValueForRefWithName(colRefTemplate)
                        </DisplayTemplate>
                    </DataGridColumn>
                }
                index++;
            }
        </DataGridColumns>
    </DataGrid>
</code>```

The columns are dynamic, since there are a couple of report layouts.
But the values returned (for column alignment) are the same as in Blazorise.

There doesn't seem to be a way to specify horizontal alignment in a DataGridAggregate.
Ideas?

Body:
For context, I'm using ABP.IO/Blazorise to show a bunch of transactions.
Aggregate data is returned by from a serverside call. All works well, except for the alignment of those columns. They are 'something' aligned it seems... I would like the correctly right aligned with the other values in the grid rows.

Here's a pic of what it looks like:

And here is the code:

       <DataGrid
        Striped="true"
        TItem="ViewTransactionDetailedDto"
        Data="TransactionsList"
        AggregateData="AggregatesList"
        ReadData="OnDataGridReadAsync"
        TotalItems="@TotalCount"
        CurrentPage="@CurrentPage"
        PageSizeChanged="@OnPageSizeChanged"
        ShowPager="true"
        ShowPageSizes="true"
        Sortable="true"
        PageSize="@PageSize">

        <DataGridAggregates>
            @foreach (var aggregate in ThisReportGridColumns.AggregateColumns)
            {
                <DataGridAggregate Field="@(aggregate.field)" Aggregate="DataGridAggregateType.Sum" DisplayFormat="{0:N0}"></DataGridAggregate>
            }
        </DataGridAggregates>

        <DataGridColumns>
            @{ int index = 0; }
            @foreach (var col in ThisReportGridColumns.Columns)
            {
                var colRefTemplate = col.custom;
                if (!col.HasCustomLookup)
                {
                    <DataGridColumn TItem="ViewTransactionDetailedDto"
                                    DisplayOrder="@index"
                                    Field="@(col.field)"
                                    Sortable="@col.sortable"
                                    SortField="@col.sortField"
                                    Caption="@col.caption"
                                    HeaderTextAlignment="@col.BlazorHeaderAlignment()"
                                    TextAlignment="@col.BlazorTextAlignment()">
                    </DataGridColumn>
                }
                @if (col.HasCustomLookup)
                {
                    <DataGridColumn TItem="ViewTransactionDetailedDto"
                                    DisplayOrder="@index"
                                    Field="@col.field"
                                    Sortable="@col.sortable"
                                    SortField="@col.sortField"
                                    Caption="@col.caption"
                                    HeaderTextAlignment="@col.BlazorHeaderAlignment()"
                                    TextAlignment="@col.BlazorTextAlignment()">
                        <DisplayTemplate>
                            @context.ValueForRefWithName(colRefTemplate)
                        </DisplayTemplate>
                    </DataGridColumn>
                }
                index++;
            }
        </DataGridColumns>
    </DataGrid>

The columns are dynamic, since there are a couple of report layouts.
But the values returned (for column alignment) are the same as in Blazorise.

There doesn't seem to be a way to specify horizontal alignment in a DataGridAggregate.
Ideas?