问:
xsd.exe to create /l:vb class from multiple files
Trying to generate Invoice VB class from UBL-Invoice-2.1.xsd

Folder structure is.

Trying with simple xsd.exe

```<code>xsd.exe UBL-Invoice-2.1.xsd /classes /l:vb
</code>```

Got:

Error: Error generating classes for schema 'UBL-Invoice-2_1'.

The element 'urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2:CustomizationID'
is missing.

Then I included others.

```<code>xsd.exe /c UBL-Invoice-2.1.xsd common/UBL-CommonAggregateComponents-2.1.xsd common/UBL-CommonBasicComponents-2.1.xsd common/UBL-CommonExtensionComponents-2.1.xsd common/UBL-UnqualifiedDataTypes-2.1.xsd /classes /l:vb
</code>```

But still missing

Error: Error generating classes for schema
'UBL-Invoice-2_1_common/UBL-CommonAggregateComponents-2_1_common/UBL-CommonBasicComponents-2_1_common/UBL-CommonExtensionComponents-2_1_common/UBL-UnqualifiedDataTypes-2_1'.

The datatype 'urn:un:unece:uncefact:data:specification:CoreComponentTypeSchemaModule:2:IdentifierType'
is missing.

Inside UBL-Invoice 2.1.xsd I have imports solved.

```<code><xsd:schema xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
    xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ccts="urn:un:unece:uncefact:documentation:2" targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
    elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.1">
    <!-- ===== Imports ===== -->
    <xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" schemaLocation="common/UBL-CommonAggregateComponents-2.1.xsd" />
    <xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" schemaLocation="common/UBL-CommonBasicComponents-2.1.xsd" />
    <xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" schemaLocation="common/UBL-CommonExtensionComponents-2.1.xsd" />
    <!-- ===== Element Declarations ===== -->
    <xsd:element name="Invoice" type="InvoiceType"></xsd:element>
    <!-- ===== Type Definitions ===== -->
    <!-- ===== Aggregate Business Information Entity Type Definitions ===== -->
    <xsd:complexType name="InvoiceType">
</code>```

How to generate the Invoice class ?

Body:
Trying to generate Invoice VB class from UBL-Invoice-2.1.xsd

Folder structure is.

Trying with simple xsd.exe

xsd.exe UBL-Invoice-2.1.xsd /classes /l:vb

Got:

Error: Error generating classes for schema 'UBL-Invoice-2_1'.

The element 'urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2:CustomizationID'
is missing.

Then I included others.

xsd.exe /c UBL-Invoice-2.1.xsd common/UBL-CommonAggregateComponents-2.1.xsd common/UBL-CommonBasicComponents-2.1.xsd common/UBL-CommonExtensionComponents-2.1.xsd common/UBL-UnqualifiedDataTypes-2.1.xsd /classes /l:vb

But still missing

Error: Error generating classes for schema
'UBL-Invoice-2_1_common/UBL-CommonAggregateComponents-2_1_common/UBL-CommonBasicComponents-2_1_common/UBL-CommonExtensionComponents-2_1_common/UBL-UnqualifiedDataTypes-2_1'.

The datatype 'urn:un:unece:uncefact:data:specification:CoreComponentTypeSchemaModule:2:IdentifierType'
is missing.

Inside UBL-Invoice 2.1.xsd I have imports solved.

<xsd:schema xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
    xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ccts="urn:un:unece:uncefact:documentation:2" targetNamespace="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
    elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.1">

    <xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" schemaLocation="common/UBL-CommonAggregateComponents-2.1.xsd" />
    <xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" schemaLocation="common/UBL-CommonBasicComponents-2.1.xsd" />
    <xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" schemaLocation="common/UBL-CommonExtensionComponents-2.1.xsd" />

    <xsd:element name="Invoice" type="InvoiceType"></xsd:element>

    <xsd:complexType name="InvoiceType">

How to generate the Invoice class ?


来源: stackexchange

问:
I've been trying to install react-native-maps to y project but whenever i rebuild my app it gives me this error continuously
I am using Gradle 8.0 and it won't allow me to build the app with the react-native-maps installed. I have tried every solution like clearing the cache and even compiling it on another device where it is compiled properly but I keep getting this error.

```<code>Task :react-native-maps:generateDebugRFile FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
37 actionable tasks: 3 executed, 34 up-to-date

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-maps:generateDebugRFile'.
> Could not resolve all files for configuration ':react-native-maps:debugCompileClasspath'.
   > Failed to transform react-native-0.71.0-rc.0-debug.aar (com.facebook.react:react-native:0.71.0-rc.0) to match attributes {artifactType=android-symbol-with-package-name, com.android.build.api.attributes.BuildTypeAttr=debug, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-api}.
      > Could not find react-native-0.71.0-rc.0-debug.aar (com.facebook.react:react-native:0.71.0-rc.0).
        Searched in the following locations:
            https://repo.maven.apache.org/maven2/com/facebook/react/react-native/0.71.0-rc.0/react-native-0.71.0-rc.0-debug.aar

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

BUILD FAILED in 54s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-maps:generateDebugRFile'.
> Could not resolve all files for configuration ':react-native-maps:debugCompileClasspath'.
   > Failed to transform react-native-0.71.0-rc.0-debug.aar (com.facebook.react:react-native:0.71.0-rc.0) to match attributes {artifactType=android-symbol-with-package-name, com.android.build.api.attributes.BuildTypeAttr=debug, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-api}.
      > Could not find react-native-0.71.0-rc.0-debug.aar (com.facebook.react:react-native:0.71.0-rc.0).
        Searched in the following locations:
            https://repo.maven.apache.org/maven2/com/facebook/react/react-native/0.71.0-rc.0/react-native-0.71.0-rc.0-debug.aar

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

BUILD FAILED in 54s
</code>```

Here is the info of my device on which im trying to make this project

```<code>info Fetching system and libraries information...
System:
    OS: Windows 10 10.0.19044
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 1.05 GB / 7.89 GB
  Binaries:
    Node: 16.17.1 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 8.15.0 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
    Windows SDK: Not Found
  IDEs:
    Android Studio: Not Found
    Visual Studio: 17.3.32819.101 (Visual Studio Community 2022)
  Languages:
    Java: 18.0.2.1
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.1.0 => 18.1.0
    react-native: 0.70.4 => 0.70.4
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
</code>```

Help would be greatly appreciated

an error solution help that  can build the project

ContentLicense: CC BY-SA 4.0

Body:
I am using Gradle 8.0 and it won't allow me to build the app with the react-native-maps installed. I have tried every solution like clearing the cache and even compiling it on another device where it is compiled properly but I keep getting this error.

Task :react-native-maps:generateDebugRFile FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
37 actionable tasks: 3 executed, 34 up-to-date

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-maps:generateDebugRFile'.
> Could not resolve all files for configuration ':react-native-maps:debugCompileClasspath'.
   > Failed to transform react-native-0.71.0-rc.0-debug.aar (com.facebook.react:react-native:0.71.0-rc.0) to match attributes {artifactType=android-symbol-with-package-name, com.android.build.api.attributes.BuildTypeAttr=debug, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-api}.
      > Could not find react-native-0.71.0-rc.0-debug.aar (com.facebook.react:react-native:0.71.0-rc.0).
        Searched in the following locations:
            https://repo.maven.apache.org/maven2/com/facebook/react/react-native/0.71.0-rc.0/react-native-0.71.0-rc.0-debug.aar

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

BUILD FAILED in 54s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-maps:generateDebugRFile'.
> Could not resolve all files for configuration ':react-native-maps:debugCompileClasspath'.
   > Failed to transform react-native-0.71.0-rc.0-debug.aar (com.facebook.react:react-native:0.71.0-rc.0) to match attributes {artifactType=android-symbol-with-package-name, com.android.build.api.attributes.BuildTypeAttr=debug, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-api}.
      > Could not find react-native-0.71.0-rc.0-debug.aar (com.facebook.react:react-native:0.71.0-rc.0).
        Searched in the following locations:
            https://repo.maven.apache.org/maven2/com/facebook/react/react-native/0.71.0-rc.0/react-native-0.71.0-rc.0-debug.aar

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

BUILD FAILED in 54s

Here is the info of my device on which im trying to make this project

info Fetching system and libraries information...
System:
    OS: Windows 10 10.0.19044
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 1.05 GB / 7.89 GB
  Binaries:
    Node: 16.17.1 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 8.15.0 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
    Windows SDK: Not Found
  IDEs:
    Android Studio: Not Found
    Visual Studio: 17.3.32819.101 (Visual Studio Community 2022)
  Languages:
    Java: 18.0.2.1
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.1.0 => 18.1.0
    react-native: 0.70.4 => 0.70.4
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Help would be greatly appreciated

an error solution help that  can build the project


问:
How do I remap a macro in Helix, instead of just adding another keymap alongside the default one?
I move with j-k-l-ñ instead of h-j-k-l  and I can't replace the go to line start command with gj and get rid about the gh macro.

```<code>[keys.normal}
 g = {j = "goto_line_start}
</code>```

I tried to do some research but I didn't find anything beyond just disabling the macro with  no_op .

Update:

If I try to set the goto_line_end macro to g"ñ" it just removes the new goto_line_start one (and also doesn't remap gl) for some reason

Body:
I move with j-k-l-ñ instead of h-j-k-l  and I can't replace the go to line start command with gj and get rid about the gh macro.

[keys.normal}
 g = {j = "goto_line_start}

I tried to do some research but I didn't find anything beyond just disabling the macro with  no_op .

Update:

If I try to set the goto_line_end macro to g"ñ" it just removes the new goto_line_start one (and also doesn't remap gl) for some reason


问:
jDateChooser restricted to only select a specific day of the week

Tell me how to make a restriction for choosing by day for the flight that I choose. For example, when I select Paris, only Monday and Wednesday are available for selection throughout the year .

I tried to find information but really did not find where exactly to prescribe the conditions in the gui for this calendar.


问:
how to patch module in fastAPI router python3
I'm struggling to write test code.

I want to patch a function load_model.
In my testcode, this function is not mocked because this function is imported in a router.py file when executing from router import router, although i decorated at test function.
What should I do?

# router.py

import os
import sys
import time
import uuid
import importlib
from io import BytesIO
from typing import List

import cv2
import numpy as np
from PIL import Image
from fastapi import APIRouter, UploadFile

APP_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(APP_DIR)
sys.path.append(ROOT_DIR)
from api_utils import load_model

print(load_model)
detection_model = load_model()
router = APIRouter()

@router.post("...")
def ...
```
<pre class="lang-py prettyprint-override"><code># test_router.py
import os
import sys
import pytest
from unittest.mock import Mock, patch
from fastapi.testclient import TestClient
TEST_DIR = os.path.dirname(os.path.abspath(__file__))
APP_DIR = os.path.dirname(TEST_DIR)
sys.path.append(APP_DIR)

@pytest.fixture()
@patch("router.api_utils.load_model")
@patch("router.detection_model")
def test_client(mock_dection_model, mock_api_utils):
    mock_api_utils.load_model = Mock()
    from router import router
    return TestClient(router)

def test_predict_image(test_client):
    return
</code>```

Body:
I'm struggling to write test code.

I want to patch a function load_model.
In my testcode, this function is not mocked because this function is imported in a router.py file when executing from router import router, although i decorated at test function.
What should I do?

# router.py

import os
import sys
import time
import uuid
import importlib
from io import BytesIO
from typing import List

import cv2
import numpy as np
from PIL import Image
from fastapi import APIRouter, UploadFile

APP_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(APP_DIR)
sys.path.append(ROOT_DIR)
from api_utils import load_model

print(load_model)
detection_model = load_model()
router = APIRouter()

@router.post("...")
def ...

# test_router.py
import os
import sys
import pytest
from unittest.mock import Mock, patch
from fastapi.testclient import TestClient
TEST_DIR = os.path.dirname(os.path.abspath(__file__))
APP_DIR = os.path.dirname(TEST_DIR)
sys.path.append(APP_DIR)

@pytest.fixture()
@patch("router.api_utils.load_model")
@patch("router.detection_model")
def test_client(mock_dection_model, mock_api_utils):
    mock_api_utils.load_model = Mock()
    from router import router
    return TestClient(router)

def test_predict_image(test_client):
    return


问:
Longest common prefix in Python3
I am looking for the longest common prefix and my code isnt working as I would like it to. It can detect prefix in every list below (list one to seven, except four):

```<code>four = ["a", "a", "b"]
</code>```

there is no common prefix but my program returns "a". I need to get "". How can I fix this, please? (I'm learning to code :-))

My code:

```<code>one = ["aac", "aab", "aabb"] #aa
two = ["a", "a"] #a
three = ["a"] #a
four = ["a", "a", "b"] #is "" but i get "a"
five = ["aaaa", "bbb", "ccc"] #""
six = ["marmelada", "marketa", "marek"] #mar
seven = ["", "", ""] #""

def check_prefix(words):

    for i in range(1, len(words[0])+1):
        if len(words) == 1:
            return words[0]
        for j in words[1:]:
            if i == len(words[0]) and words[0][:i] == j[:i]:
                return words[0][:i]
            if words[0][:i] != j[:i]:
                return words[0][:i-1]

    return ""

print(check_prefix(one))
print(check_prefix(two))
print(check_prefix(three))
print(check_prefix(four))
print(check_prefix(five))
print(check_prefix(six))
print(check_prefix(seven))
</code>```

I trid to use module os as os.path.commonprefix() and this worked well for me. However I would like to fix my code.

Title: Longest common prefix in Python3

Body:
I am looking for the longest common prefix and my code isnt working as I would like it to. It can detect prefix in every list below (list one to seven, except four):

four = ["a", "a", "b"]

there is no common prefix but my program returns "a". I need to get "". How can I fix this, please? (I'm learning to code :-))

My code:

one = ["aac", "aab", "aabb"] #aa
two = ["a", "a"] #a
three = ["a"] #a
four = ["a", "a", "b"] #is "" but i get "a"
five = ["aaaa", "bbb", "ccc"] #""
six = ["marmelada", "marketa", "marek"] #mar
seven = ["", "", ""] #""

def check_prefix(words):

    for i in range(1, len(words[0])+1):
        if len(words) == 1:
            return words[0]
        for j in words[1:]:
            if i == len(words[0]) and words[0][:i] == j[:i]:
                return words[0][:i]
            if words[0][:i] != j[:i]:
                return words[0][:i-1]

    return ""

print(check_prefix(one))
print(check_prefix(two))
print(check_prefix(three))
print(check_prefix(four))
print(check_prefix(five))
print(check_prefix(six))
print(check_prefix(seven))

I trid to use module os as os.path.commonprefix() and this worked well for me. However I would like to fix my code.


问:
django still uses StatReloader even though watchman & pywatchman are installed
I wanted to slow down the auto-reload feature of django's runserver for 7 seconds. While searching for a solution, I read on the django documentation https://docs.djangoproject.com/en/4.1/ref/django-admin/#s-runserver that I should install Watchman as well as pywatchman and that django will use that instead for which I can add a timeout period for reload after file change.
I also read on https://adamj.eu/tech/2021/01/20/efficient-reloading-in-djangos-runserver-with-watchman/ that after installation django's runserver will show Watching for file changes with WatchmanReloader instead of Watching for file changes with StatReloader.

I also add a .watchmanconfig like this:

{"ignore_dirs": [".git", ".vscode", "venv", "htmlcov", "media", ]}
```
<p>But on mine it still uses <code>StatReloader</code> even though <code>watchman</code> & <code>pywatchman</code> are installed in accordance with their doc.</p>
<pre class="lang-py prettyprint-override"><code>django version: 4.1.2
python version: 3.8.16
watchman version: 20221225.010033.0
pywatchman version: 1.4.1
</code>```

Can anybody help?

My gratitude before hand

Body:
I wanted to slow down the auto-reload feature of django's runserver for 7 seconds. While searching for a solution, I read on the django documentation https://docs.djangoproject.com/en/4.1/ref/django-admin/#s-runserver that I should install Watchman as well as pywatchman and that django will use that instead for which I can add a timeout period for reload after file change.
I also read on https://adamj.eu/tech/2021/01/20/efficient-reloading-in-djangos-runserver-with-watchman/ that after installation django's runserver will show Watching for file changes with WatchmanReloader instead of Watching for file changes with StatReloader.

I also add a .watchmanconfig like this:

{"ignore_dirs": [".git", ".vscode", "venv", "htmlcov", "media", ]}

But on mine it still uses StatReloader even though watchman & pywatchman are installed in accordance with their doc.

django version: 4.1.2
python version: 3.8.16
watchman version: 20221225.010033.0
pywatchman version: 1.4.1

Can anybody help?

My gratitude before hand


问:
SCSS - Different parents - same tag simplification
I have this navigation in HTML that looks like following:

```
<p>I have some styles applied to all <code>a</code>s in the navigation in the defaults layer, now I want to add separate styles for each level. I have this</p>
<pre class="lang-scss prettyprint-override"><code>nav {
    .nav-item {
        a {padding:0;}
        &.lvl-0 {
            > a {@extend .size-18;}
        }

        &.lvl-1 {
            > a {@extend .size-13;}
        }
    }
}
</code>```

Is there a way to write something along these lines:

nav {
    .nav-item {
        a {padding:0;
            .lvl-0 > & {@extend .size-18;}
            .lvl-1 > & {@extend .size-13;}
        }
    }
}
```

Body:
I have this navigation in HTML that looks like following:

I have some styles applied to all as in the navigation in the defaults layer, now I want to add separate styles for each level. I have this

nav {
    .nav-item {
        a {padding:0;}
        &.lvl-0 {
            > a {@extend .size-18;}
        }

        &.lvl-1 {
            > a {@extend .size-13;}
        }
    }
}

Is there a way to write something along these lines:

nav {
    .nav-item {
        a {padding:0;
            .lvl-0 > & {@extend .size-18;}
            .lvl-1 > & {@extend .size-13;}
        }
    }
}


问:
AVR simulator: XINT0 behaves not as expected
When simulating my ATTiny13 application in AVR Studio7 (latest version 7.0.2594, no stimuli file), XINT0 does not respond as I would expect:

In MCUCR I set ISC01|ISC00 to 0x02 because I want to trigger on the falling edge of XINT0.

When manipulating PINB1 manually, after ending up at a breakpoint, the simulator ALWAYS jumps into the ISR,regardless the change: rising as well as falling edge. Funny enough, the flag in GIFR is never set.

Clarification: in Tools / Options / Tools / Tool settings 'Mask interrupts while stepping' is set to false.

To reduce complexity, I stripped my code to the absolute minimum:

```<code>
;------------------------------------------------------
;register definitions
;------------------------------------------------------
.def    TmpReg =   r16
.def    Flags_Reg =   r21   ;

;------------------------------------------------------
;constants
;------------------------------------------------------
.equ    FLAG_KeyPressed    =   1

;------------------------------------------------------
;interrupt vectors
;------------------------------------------------------
.org    0x0000  rjmp RESET                  ;Reset
.org    0x0001  rjmp ExtInt0                ;ISR for ext int0
;------------------------------------------------------
;Init
;------------------------------------------------------
RESET:  ldi     TmpReg, RAMEND            ;Stack
        out     SPL, TmpReg
        ;----------------------------------------------

        ;----------------------------------------------
        ;prepare port B
        ;----------------------------------------------
        ldi        TmpReg, (1<<PB2)|(1<<PB3)|(1<<PB4)|(1<<PB5)
        out        ddrb, TmpReg             ;set PortB bit 0 and 1 as input, PortB bit 2 to 5 as output
        ldi        TmpReg, 0x1f     ; enable internal pullup for inputs and set 'Enable' for outputs
        out        PortB,TmpReg             ;and transfer to the output

;----------------------------------------------
;ExtInt0 init
;----------------------------------------------
        ldi         TmpReg,0x02
        out         MCUCR,TmpReg                ; enable falling edge int at ExtInt0
        ldi         TmpReg,0x40
        out         GIMSK,TmpReg

        sei                                     ; enable interrupts

; Initialise register values
        ldi         Flags_Reg, 0                ; reset

;------------------------------------------------------
; Main
;------------------------------------------------------

NoPush: sbrs    Flags_Reg, FLAG_KeyPressed  ; idle here as long as key not pressed / flag not set,
; FLAG_KeyPressed in FlagsReg is set by ISR KeyPressed (Ext Int0)
        rjmp    NoPush                      ; otherwise, key has been pressed
        cbr     Flags_Reg, 0x02             ; reset FLAG_KeyPressed
        rjmp    NoPush                      ; keep running in idle loop
;------------------------------------------------------
;end main loop
;------------------------------------------------------

;------------------------------------------------------
;ExtInt0 Interrupt: key is pressed
;------------------------------------------------------
ExtInt0:
    ori     Flags_Reg, 0x20     ; set flag for key pressed
    reti
</code>```

As with my previous, similar request, I tried the same in the simulator of the antique AVR studio version 4 - everything works fine here ;-)

Thanks for your help! And - btw - happy new year!

Body:
When simulating my ATTiny13 application in AVR Studio7 (latest version 7.0.2594, no stimuli file), XINT0 does not respond as I would expect:

In MCUCR I set ISC01|ISC00 to 0x02 because I want to trigger on the falling edge of XINT0.

When manipulating PINB1 manually, after ending up at a breakpoint, the simulator ALWAYS jumps into the ISR,regardless the change: rising as well as falling edge. Funny enough, the flag in GIFR is never set.

Clarification: in Tools / Options / Tools / Tool settings 'Mask interrupts while stepping' is set to false.

To reduce complexity, I stripped my code to the absolute minimum:

;------------------------------------------------------
;register definitions
;------------------------------------------------------
.def    TmpReg =   r16
.def    Flags_Reg =   r21   ;

;------------------------------------------------------
;constants
;------------------------------------------------------
.equ    FLAG_KeyPressed    =   1

;------------------------------------------------------
;interrupt vectors
;------------------------------------------------------
.org    0x0000  rjmp RESET                  ;Reset
.org    0x0001  rjmp ExtInt0                ;ISR for ext int0
;------------------------------------------------------
;Init
;------------------------------------------------------
RESET:  ldi     TmpReg, RAMEND            ;Stack
        out     SPL, TmpReg
        ;----------------------------------------------

        ;----------------------------------------------
        ;prepare port B
        ;----------------------------------------------
        ldi        TmpReg, (1<<PB2)|(1<<PB3)|(1<<PB4)|(1<<PB5)
        out        ddrb, TmpReg             ;set PortB bit 0 and 1 as input, PortB bit 2 to 5 as output
        ldi        TmpReg, 0x1f     ; enable internal pullup for inputs and set 'Enable' for outputs
        out        PortB,TmpReg             ;and transfer to the output

;----------------------------------------------
;ExtInt0 init
;----------------------------------------------
        ldi         TmpReg,0x02
        out         MCUCR,TmpReg                ; enable falling edge int at ExtInt0
        ldi         TmpReg,0x40
        out         GIMSK,TmpReg

        sei                                     ; enable interrupts

; Initialise register values
        ldi         Flags_Reg, 0                ; reset

;------------------------------------------------------
; Main
;------------------------------------------------------

NoPush: sbrs    Flags_Reg, FLAG_KeyPressed  ; idle here as long as key not pressed / flag not set,
; FLAG_KeyPressed in FlagsReg is set by ISR KeyPressed (Ext Int0)
        rjmp    NoPush                      ; otherwise, key has been pressed
        cbr     Flags_Reg, 0x02             ; reset FLAG_KeyPressed
        rjmp    NoPush                      ; keep running in idle loop
;------------------------------------------------------
;end main loop
;------------------------------------------------------

;------------------------------------------------------
;ExtInt0 Interrupt: key is pressed
;------------------------------------------------------
ExtInt0:
    ori     Flags_Reg, 0x20     ; set flag for key pressed
    reti

As with my previous, similar request, I tried the same in the simulator of the antique AVR studio version 4 - everything works fine here ;-)

Thanks for your help! And - btw - happy new year!


问:
How to click a cookie banner button in a shadow-root element using RSelenium?
I want to do some price monitoring on the page https://reiseauskunft.bahn.de/ but when I open/navigate, a coockie banner appears in the foreground and an acceptance buttton must be clicked, before any inquiries can be done. Using the inspect facility of the browser I have noticed the buttons are within a

```<code>#shadow-root (open)
</code>```

Addressing the button directly e.g.

```<code>remDr$findElement('css selector', 'button.btn:nth-child(1)')
</code>```

does not find the element.

Note: A solution using Python and the selenium module might help me to get on the right track.

Body:
I want to do some price monitoring on the page https://reiseauskunft.bahn.de/ but when I open/navigate, a coockie banner appears in the foreground and an acceptance buttton must be clicked, before any inquiries can be done. Using the inspect facility of the browser I have noticed the buttons are within a

#shadow-root (open)

Addressing the button directly e.g.

remDr$findElement('css selector', 'button.btn:nth-child(1)')

does not find the element.

Note: A solution using Python and the selenium module might help me to get on the right track.


问:
How to pass an array of objects from ejs file to express js file
I am using Express.js with ejs template for my app. I have index.ejs file where I call a function getTableValue() on click of a button. This function get data from a table and save it in an array of objects name “arrs” which is declared inside this function. I want to send this “arrs” which is array of objects to my index.ejs file to insert the data in it to a MySQL table named “student” in database when user click on save. When I tried to run the code, I got an error “arrs is not defined”. How can I send arrs from ejs script to app.js.

how could I update my code with AJAX.

```<code><button onclick=" getTableValue()">Get Table Value</button>
 <a href="/assessResult/<% = arrs %> " class="btn btn-danger btn-sm">Save</a>
<script>
const arrs[];
function getTableValue( ){
var table = document.getElementById("display_excel_data");
var totalRows = document.getElementById("display_excel_data").rows.length;
for (var x = 1; x < totalRows; x++) {
const arr={};
arr["studentID"]=table.rows[x].cells[0].innerHTML;
arr["studentName"]=table.rows[x].cells[1].innerHTML;
arrs.push(arr);
}
}
</script>
app.get('/assessResult/:arrs, function(req, res){
var stID = req.body.studentID;
var stname=req.body.studentName;
var sql = 'insert into Student values(?,?);';
con.query(sql,[stID, stname], function(err, result, fields){
if(err) throw err;
res.redirect('/listcourse');
 });
});
</code>```

Body:
I am using Express.js with ejs template for my app. I have index.ejs file where I call a function getTableValue() on click of a button. This function get data from a table and save it in an array of objects name “arrs” which is declared inside this function. I want to send this “arrs” which is array of objects to my index.ejs file to insert the data in it to a MySQL table named “student” in database when user click on save. When I tried to run the code, I got an error “arrs is not defined”. How can I send arrs from ejs script to app.js.

how could I update my code with AJAX.

<button onclick=" getTableValue()">Get Table Value</button>
 <a href="/assessResult/<% = arrs %> " class="btn btn-danger btn-sm">Save

app.get('/assessResult/:arrs, function(req, res){
var stID = req.body.studentID;
var stname=req.body.studentName;
var sql = 'insert into Student values(?,?);';
con.query(sql,[stID, stname], function(err, result, fields){
if(err) throw err;
res.redirect('/listcourse');
 });
});


问:
Mongoose Schema TypeScript Error + Index signature for type string is missing
I am using inversify in my express API for dependency injection and I am trying to define my schema using typescript 4.9.4 if I downgrade to 4.3.2 the error goes away but if possible I would love to figure this out.

Interface

```<code>export interface UserType {
    _id?: string
    email: string
    password: string
}

export interface UserModel extends UserType, Omit<Document, '_id'> {}
</code>```

Schema

```<code>@injectable()
export class UserRepository
    extends GenericRepository<UserType, UserModel>
    implements UserRepositoryInterface
{
    public constructor(@inject(TYPES.DbClient) dbClient: DbClient) {
        super(
            dbClient,
            'users',
            new Schema({
                email: {
                    type: String,
                    trim: true,
                    required: true,
                    unique: true,
                    lowercase: true,
                },
                password: {
                    type: String,
                    required: true,
                },
            }),
        )
    }
}
</code>```

Body:
I am using inversify in my express API for dependency injection and I am trying to define my schema using typescript 4.9.4 if I downgrade to 4.3.2 the error goes away but if possible I would love to figure this out.

Interface

export interface UserType {
    _id?: string
    email: string
    password: string
}

export interface UserModel extends UserType, Omit<Document, '_id'> {}

Schema

@injectable()
export class UserRepository
    extends GenericRepository<UserType, UserModel>
    implements UserRepositoryInterface
{
    public constructor(@inject(TYPES.DbClient) dbClient: DbClient) {
        super(
            dbClient,
            'users',
            new Schema({
                email: {
                    type: String,
                    trim: true,
                    required: true,
                    unique: true,
                    lowercase: true,
                },
                password: {
                    type: String,
                    required: true,
                },
            }),
        )
    }
}


问:
FirebaseAuthentication Plugin not updating local FireBase.Auth JS with signed in user

Background

I have an almost finished webapp already working with the following stack

Firebase

React/TypeScript

Context

I'm adding Capacitor to my WebApp so I have a native app where I can send push notifications, and have presence in App Store, Google Play Store. The application already works on its web version, so there is no rule (Real Time Database, FireStore, etc) problem, no credentials problems at all on its web version, all well tested.

Problem

I've added Authentication to my application via Firebase Authentication, which works well, and I have also connected the Native iOS version to it, as it's described in the documentation

Auth flows works fine, User/Password & Google sign up are working fine and actually triggering the methods like onIdTokenChange and OnAuthStateChange from the official Firebase Auth library, in both cases, iOS and WebApp, and also the OnAuthStateChange from the Capacitor plugin (in both clients too).

The problem is that the Firebase JS library remains somehow in a unauthenticated state, where any call to FireStore, Database, or Storage, ends up in "Permissions Denied" error (Only on iOS). Once the Token ID has changed, I can see that currentUser is NULL, and the "signed in user" is not propagating to the Firebase official library from the Capacitor Plugin.

Once I have connected the Capacitor Firebase Authentication plugin, I was expecting that the Firebase official JS library was going to be updated, I've also used Firebase Authentication with IndexedDB local persistence as follows (when being in Native) as follows:

```<code>export const Authentication = Capacitor.isNativePlatform() ? initializeAuth(FirebaseApp, {
  persistence: indexedDBLocalPersistence
}) : getAuth(FirebaseApp);
</code>```

Body:
Background

I have an almost finished webapp already working with the following stack

Firebase

React/TypeScript

Context

I'm adding Capacitor to my WebApp so I have a native app where I can send push notifications, and have presence in App Store, Google Play Store. The application already works on its web version, so there is no rule (Real Time Database, FireStore, etc) problem, no credentials problems at all on its web version, all well tested.

Problem

I've added Authentication to my application via Firebase Authentication, which works well, and I have also connected the Native iOS version to it, as it's described in the documentation

Auth flows works fine, User/Password & Google sign up are working fine and actually triggering the methods like onIdTokenChange and OnAuthStateChange from the official Firebase Auth library, in both cases, iOS and WebApp, and also the OnAuthStateChange from the Capacitor plugin (in both clients too).

The problem is that the Firebase JS library remains somehow in a unauthenticated state, where any call to FireStore, Database, or Storage, ends up in "Permissions Denied" error (Only on iOS). Once the Token ID has changed, I can see that currentUser is NULL, and the "signed in user" is not propagating to the Firebase official library from the Capacitor Plugin.

Once I have connected the Capacitor Firebase Authentication plugin, I was expecting that the Firebase official JS library was going to be updated, I've also used Firebase Authentication with IndexedDB local persistence as follows (when being in Native) as follows:

export const Authentication = Capacitor.isNativePlatform() ? initializeAuth(FirebaseApp, {
  persistence: indexedDBLocalPersistence
}) : getAuth(FirebaseApp);


问:
Recursive(Tower Hanoi) UI for android
`[I want to change the UI through the recursive function.

I want to implement UI through recursive function. When you run it, you should see the process of changing the UI according to the value, but if you insert hanoi(), the process does not come out and the value is printed at once. I think I need to change the move, but it's the same if I put sleep() in the move, and I tried Thread, Handler, AsyncTask, but the results are the same. I'd appreciate your help.

```<code>public class Disk3 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
class BackgroundThread extends Thread {
boolean running = false;
@Override
public void run() {
running = true;
while (running) {
runOnUiThread(new Runnable() {
@Override
public void run() {
move(3, 1, 3);
}
});
try {
sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}

btn_move.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
BackgroundThread thread = new BackgroundThread();
thread.start();
</code>```

}
});

```<code>    public void move(int N, int start, int to) {
    if (start == 1) {
    for (int i = 0; i <= 2; i++) {
    if (list_tv_diskA[i].getVisibility() == View.VISIBLE) {
    startTv = list_tv_diskA[i];
    startTv.setVisibility(View.INVISIBLE);
    Log.d("TAG", "list_tv_disk A :: " + i);
    break;
    }
    }
    }
    if (start == 2) {
    for (int j = 0; j <= 2; j++) {
    if (list_tv_diskB[j].getVisibility() == View.VISIBLE) {
    startTv = list_tv_diskB[j];
    startTv.setVisibility(View.INVISIBLE);
    Log.d("TAG", "list_tv_disk B :: " + j);
    break;
    }
    }
    }
    if (start == 3) {
    for (int k = 0; k <= 2; k++) {
    if (list_tv_diskC[k].getVisibility() == View.VISIBLE) {
    startTv.setText(toTv.getText());
    startTv = list_tv_diskC[k];
    startTv.setVisibility(View.INVISIBLE);
    Log.d("TAG", "list_tv_disk C :: " + k);
    break;
    }
    }
    }
    if (to == 1) {
    for (int i = 2; i >= 0; i--) {
    if (list_tv_diskA[i].getVisibility() == View.INVISIBLE) {
    toTv = list_tv_diskA[i];
    toTv.setText(startTv.getText());
    toTv.setVisibility(View.VISIBLE);
    Log.d("TAG", "list_tv_disk B :: " + i);
    break;
    }
    }
    }
    if (to == 2) {
    for (int j = 2; j >= 0; j--) {
    if (list_tv_diskB[j].getVisibility() == View.INVISIBLE) {
    toTv = list_tv_diskB[j];
    toTv.setText(startTv.getText());
    toTv.setVisibility(View.VISIBLE);
    Log.d("TAG", "list_tv_disk Bda :: " + j);
    break;
    }
    }
    }
    if (to == 3) {
    for (int k = 2; k >= 0; k--) {
    if (list_tv_diskC[k].getVisibility() == View.INVISIBLE) {
    toTv = list_tv_diskC[k];
    toTv.setText(startTv.getText());
    toTv.setVisibility(View.VISIBLE);
    Log.d("TAG", "list_tv_disk C :: " + k);
    break;
    }
    }
    }
    public void Hanoi(int N, int start, int to, int via) {
    if (N == 1) {
    move(1, start, to);
    return;
    } else {
    Hanoi(N - 1, start, via, to);
    move(N, start, to);
    Hanoi(N - 1, via, to, start);
   }
   }
</code>```

Title: Recursive(Tower Hanoi) UI for android

Body:
`[I want to change the UI through the recursive function.

I want to implement UI through recursive function. When you run it, you should see the process of changing the UI according to the value, but if you insert hanoi(), the process does not come out and the value is printed at once. I think I need to change the move, but it's the same if I put sleep() in the move, and I tried Thread, Handler, AsyncTask, but the results are the same. I'd appreciate your help.

public class Disk3 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
class BackgroundThread extends Thread {
boolean running = false;
@Override
public void run() {
running = true;
while (running) {
runOnUiThread(new Runnable() {
@Override
public void run() {
move(3, 1, 3);
}
});
try {
sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}

btn_move.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
BackgroundThread thread = new BackgroundThread();
thread.start();

}
});

    public void move(int N, int start, int to) {
    if (start == 1) {
    for (int i = 0; i <= 2; i++) {
    if (list_tv_diskA[i].getVisibility() == View.VISIBLE) {
    startTv = list_tv_diskA[i];
    startTv.setVisibility(View.INVISIBLE);
    Log.d("TAG", "list_tv_disk A :: " + i);
    break;
    }
    }
    }
    if (start == 2) {
    for (int j = 0; j <= 2; j++) {
    if (list_tv_diskB[j].getVisibility() == View.VISIBLE) {
    startTv = list_tv_diskB[j];
    startTv.setVisibility(View.INVISIBLE);
    Log.d("TAG", "list_tv_disk B :: " + j);
    break;
    }
    }
    }
    if (start == 3) {
    for (int k = 0; k <= 2; k++) {
    if (list_tv_diskC[k].getVisibility() == View.VISIBLE) {
    startTv.setText(toTv.getText());
    startTv = list_tv_diskC[k];
    startTv.setVisibility(View.INVISIBLE);
    Log.d("TAG", "list_tv_disk C :: " + k);
    break;
    }
    }
    }
    if (to == 1) {
    for (int i = 2; i >= 0; i--) {
    if (list_tv_diskA[i].getVisibility() == View.INVISIBLE) {
    toTv = list_tv_diskA[i];
    toTv.setText(startTv.getText());
    toTv.setVisibility(View.VISIBLE);
    Log.d("TAG", "list_tv_disk B :: " + i);
    break;
    }
    }
    }
    if (to == 2) {
    for (int j = 2; j >= 0; j--) {
    if (list_tv_diskB[j].getVisibility() == View.INVISIBLE) {
    toTv = list_tv_diskB[j];
    toTv.setText(startTv.getText());
    toTv.setVisibility(View.VISIBLE);
    Log.d("TAG", "list_tv_disk Bda :: " + j);
    break;
    }
    }
    }
    if (to == 3) {
    for (int k = 2; k >= 0; k--) {
    if (list_tv_diskC[k].getVisibility() == View.INVISIBLE) {
    toTv = list_tv_diskC[k];
    toTv.setText(startTv.getText());
    toTv.setVisibility(View.VISIBLE);
    Log.d("TAG", "list_tv_disk C :: " + k);
    break;
    }
    }
    }
    public void Hanoi(int N, int start, int to, int via) {
    if (N == 1) {
    move(1, start, to);
    return;
    } else {
    Hanoi(N - 1, start, via, to);
    move(N, start, to);
    Hanoi(N - 1, via, to, start);
   }
   }


问:
JS click run only after another click in mobile mode
I have an interesting problem with download table as jpeg.
My code is:

```<code>              html2canvas(document.getElementById("planety_table"), {
                onrendered: function(canvas) {
                document.getElementById('myImg').src = canvas.toDataURL("image/jpeg");
                var a = document.createElement('a');
                a.href = document.getElementById('myImg').src;
                a.download = "tabulka_planety.jpg";
                document.body.appendChild(a);
                a.click();
                document.body.removeChild(a);
              }
           });

</code>```

In notebook, this code working fine. In Huawei phone too. But in Samsung Galaxy phone not - only when I make one touch to display after the button is clicked.
Can you help me with this problem?

Thanks, best regards

Body:
I have an interesting problem with download table as jpeg.
My code is:

              html2canvas(document.getElementById("planety_table"), {
                onrendered: function(canvas) {
                document.getElementById('myImg').src = canvas.toDataURL("image/jpeg");
                var a = document.createElement('a');
                a.href = document.getElementById('myImg').src;
                a.download = "tabulka_planety.jpg";
                document.body.appendChild(a);
                a.click();
                document.body.removeChild(a);
              }
           });

In notebook, this code working fine. In Huawei phone too. But in Samsung Galaxy phone not - only when I make one touch to display after the button is clicked.
Can you help me with this problem?

Thanks, best regards


问:
Cannot see my variables in console while debuging react app on production
I am new to the react world and trying to use it in my sharepoint environment. I am packaging the app for production with source maps and upload it to the sharepoint site that I will use it in. App runs without a problem in the sharepoint but in the developer toolbox I cannot debug it completely. I can see my js file, put the debug point, and it pauses on the point but I cannot see the variables in console as you can see in the screenshot below.

But if I try the same code in dev environment with npm start I can see the same variable in console without any problem.

Is this normal behavior or am I doing something wrong? Thanks a lot.


问:
Exclude directory from includes from `CFLAGS`
Is there a way to explicitly exclude a given directory from includes in CFLAGS, so that it can be set from command line at build time?

What I'm searching for is like the opposite of -I<directory>, an -Ino<directory>.


问:
When I use the re.split function in Python, it keeps the separators. How do I fix this?
I am trying to separate the speaker from the speech in a document that looks like this:

Jim Friedland, Director Investor Relations: Thank you. Good afternoon, everyone, and
welcome to Alphabet’s first-quarter 2021 earnings conference call.
Sundar Pichai, CEO Alphabet and Google: Thank you, Jim, and good afternoon, everyone.

```<code>import re

# iterate through each row and select the "Speaker" and "Speech"
speaker_df_merged=pd.DataFrame(columns=['Speaker', 'Speech'])

for ind in calls.index:
    speakers = re.findall(r'\n([A-Z][a-z]+\s[A-Z][a-z]+.+):', calls.iloc[ind]["Text"])
    speakers.insert(0,'Introduction')
    speech = re.split(r'\n([A-Z][a-z]+\s[A-Z][a-z]+.+):', calls.iloc[ind]["Text"])

    speaker_speech_pair  = list (zip(speakers, speech))
    df_pair = pd.DataFrame(speaker_speech_pair, columns = ['Speaker', 'Speech'])
    speaker_df_merged = speaker_df_merged.append(df_pair, ignore_index = True)

speaker_df_merged
</code>```

However, in the list speech of speeches, the separators are included as well. For example, Jim Friedland, Director Investor Relations, the separator is included in the list of speech.

How do I fix this issue?

Body:
I am trying to separate the speaker from the speech in a document that looks like this:

Jim Friedland, Director Investor Relations: Thank you. Good afternoon, everyone, and
welcome to Alphabet’s first-quarter 2021 earnings conference call.
Sundar Pichai, CEO Alphabet and Google: Thank you, Jim, and good afternoon, everyone.

import re

# iterate through each row and select the "Speaker" and "Speech"
speaker_df_merged=pd.DataFrame(columns=['Speaker', 'Speech'])

for ind in calls.index:
    speakers = re.findall(r'\n([A-Z][a-z]+\s[A-Z][a-z]+.+):', calls.iloc[ind]["Text"])
    speakers.insert(0,'Introduction')
    speech = re.split(r'\n([A-Z][a-z]+\s[A-Z][a-z]+.+):', calls.iloc[ind]["Text"])

    speaker_speech_pair  = list (zip(speakers, speech))
    df_pair = pd.DataFrame(speaker_speech_pair, columns = ['Speaker', 'Speech'])
    speaker_df_merged = speaker_df_merged.append(df_pair, ignore_index = True)

speaker_df_merged

However, in the list speech of speeches, the separators are included as well. For example, Jim Friedland, Director Investor Relations, the separator is included in the list of speech.

How do I fix this issue?


问:
can i delay http response header after i run the page?
so i have a function like this

```<code> public ActionResult Dashboard()
        {
            Response.AddHeader("Refresh", "180");
            return View();
        }
</code>```

so i want to when i open something in that dashboard, ex a popup:

```<code>    $scope.openpopup = function (id) {
        var modalInstance = $uibModal.open({
            templateUrl: "stuff/Popupstuff/?id=" + id,
            size: '',
        });
        $cookieStore.put("id",id);
        modalInstance.result.finally(function () {
            $cookieStore.remove("id");
        });
    }
</code>```

i want to make the refresh to stop/delay until i close the popup, is that possible?

Body:
so i have a function like this

 public ActionResult Dashboard()
        {
            Response.AddHeader("Refresh", "180");
            return View();
        }

so i want to when i open something in that dashboard, ex a popup:

    $scope.openpopup = function (id) {
        var modalInstance = $uibModal.open({
            templateUrl: "stuff/Popupstuff/?id=" + id,
            size: '',
        });
        $cookieStore.put("id",id);
        modalInstance.result.finally(function () {
            $cookieStore.remove("id");
        });
    }

i want to make the refresh to stop/delay until i close the popup, is that possible?


问:
How to publish Office add-in in Azure Marketplace
I have an Office 365 add-in that I would like to publish to Azure Marketplace. I have read a lot of online documents on this subject and I am ok with setting up the SaaS fulfilment Api and the webhook. What I don't understand is how to link my app with the SaaS offer. I have published an add-in before to Appsource before but in the new partner centre I don't see anywhere to link my add-in with the marketplace. Does it mean that I have to publish my add-in to the appsource then create a parallel SaaS offer to go with it?</p>


问:
How to say "this" inside a hilt method without encountering cyclic dependency?
I have a ClassA which depends on ClassB but ClassB has a listener interface which is implemented by ClassA. How can I tell Hilt that I need ClassA while creating ClassB without facing dependency cycle error?

My class structure:

```<code>class ClassA(val classB: ClassB): IClassBListener

class ClassB(val classBListener: IClassBListener)

interface IClassBListener{}
</code>```

What I tried is below which gives dependency cycle error as I expected:

```<code>@Singleton
@Provides
fun provideClassA(classBListener: IClassBListener): ClassA = ClassA(ClassB(classBListener))

@Binds
abstract fun bindClassBListener(classA: ClassA): IClassBListener
</code>```

In funProvideClassA method, I need to return something like ClassA(ClassB(this)) where "this" is the ClassA that Hilt creates. How can this be possible?

Body:
I have a ClassA which depends on ClassB but ClassB has a listener interface which is implemented by ClassA. How can I tell Hilt that I need ClassA while creating ClassB without facing dependency cycle error?

My class structure:

class ClassA(val classB: ClassB): IClassBListener

class ClassB(val classBListener: IClassBListener)

interface IClassBListener{}

What I tried is below which gives dependency cycle error as I expected:

@Singleton
@Provides
fun provideClassA(classBListener: IClassBListener): ClassA = ClassA(ClassB(classBListener))

@Binds
abstract fun bindClassBListener(classA: ClassA): IClassBListener

In funProvideClassA method, I need to return something like ClassA(ClassB(this)) where "this" is the ClassA that Hilt creates. How can this be possible?


问:
wp_audio_shortcode_override and block editor
I use wp_audio_shortcode_override in my plugin. This is the code I use:

```<code>add_filter('wp_audio_shortcode_override', 'my_audio_shortcode_override', 10, 2);

function my_audio_shortcode_override( $html, $attr ) {

    if (isset( $attr['wav']) || isset( $attr['mp3']) || isset( $attr['m4a']) || isset( $attr['ogg']) || isset( $attr['src'])){

        return my_player($attr);
    }else{
        return "";
    }

};
</code>```

It works well in my plugin when audio shortcode is present, for example:

```<code>[audio src="audio-url"]
</code>```

However, if I use block editor and add audio, this doesnt work becuase its not a shortcode I presume. If I convert to html I get:

```<code><figure class="wp-block-audio"><audio controls src="audio-url.mp3"></audio></figure>
</code>```

Does this mean you cannot override audio as such?

Body:
I use wp_audio_shortcode_override in my plugin. This is the code I use:

add_filter('wp_audio_shortcode_override', 'my_audio_shortcode_override', 10, 2);

function my_audio_shortcode_override( $html, $attr ) {

    if (isset( $attr['wav']) || isset( $attr['mp3']) || isset( $attr['m4a']) || isset( $attr['ogg']) || isset( $attr['src'])){

        return my_player($attr);
    }else{
        return "";
    }

};

It works well in my plugin when audio shortcode is present, for example:

[audio src="audio-url"]

However, if I use block editor and add audio, this doesnt work becuase its not a shortcode I presume. If I convert to html I get:

<audio controls src="audio-url.mp3"></audio>

Does this mean you cannot override audio as such?


问:
how to force webpack to keep the dynamic import
I have this code

```<code>import('./myfile.js')
.then(m=>console.log(m.default))
.catch(err=>console.error(err))
</code>```

webpack bundles "myfile.js", but I want to copy this file to 'dist' and import it dynamically, i.e. I want to avoid compiling this import() statement.

note that this code is a part of a function and the file 'myfile.js' is provided by a function argument, so I cannot add the path to the webpack's externals array.

I tried the following approaches:

using webpac's magic comments /* webpackIgnore: true, webpackMode: "lazy" */

provide a variable path

```<code>let file = 'myfile.js'
import('./' + file)
</code>```

provide the path as a function call

```<code>let getPath = path=>path
import(getPath('./myfile.js'))
</code>```

put the import statement inside a function

```<code>function load(path){
  return import('./' + path)
}

load('myfile.js')
</code>```

Body:
I have this code

import('./myfile.js')
.then(m=>console.log(m.default))
.catch(err=>console.error(err))

webpack bundles "myfile.js", but I want to copy this file to 'dist' and import it dynamically, i.e. I want to avoid compiling this import() statement.

note that this code is a part of a function and the file 'myfile.js' is provided by a function argument, so I cannot add the path to the webpack's externals array.

I tried the following approaches:

using webpac's magic comments /* webpackIgnore: true, webpackMode: "lazy" */

provide a variable path

let file = 'myfile.js'
import('./' + file)

provide the path as a function call

let getPath = path=>path
import(getPath('./myfile.js'))

put the import statement inside a function

function load(path){
  return import('./' + path)
}

load('myfile.js')


问:
Xcode creates Outlet, but they aren't connected to the UI-elements
I try to connect an UI-element to an outlet the standard way.

But afterward there's no connection between the outlet and the element. Please pay attention to the circle on the left.

What is going wrong here?

How can the issue become fixed?


问:
FlutterToast won't appear every time the button is clicked and throws an error
I'm trying to call FlutterToast when I tap on InkWell widget. But whenever I try to tap, the FlutterToast won't show up. This is my Inkwell code.

```<code>InkWell(
  onTap: () async {
    await Clipboard.setData(ClipboardData(
            text: controller.vaNumber.toString()));
    await Fluttertoast.showToast(
        msg: "This is Center Short Toast",
        toastLength: Toast.LENGTH_SHORT,
        gravity: ToastGravity.BOTTOM,
        backgroundColor: Colors.grey,
        textColor: Colors.black,
        fontSize: 16.0
    );
  },
  child: Text(
    'SALIN',
    style: TextStyle(
        decoration: TextDecoration.underline,
        color: Colors.green),
  ),
)
</code>```

and this is my error message:

```<code>E/flutter (23418): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference, null, java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
E/flutter (23418):  at io.github.ponnamkarthik.toast.fluttertoast.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.kt:51)
E/flutter (23418):  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
E/flutter (23418):  at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/flutter (23418):  at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/flutter (23418):  at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/flutter (23418):  at android.os.Handler.handleCallback(Handler.java:938)
E/flutter (23418):  at android.os.Handler.dispatchMessage(Handler.java:99)
E/flutter (23418):  at android.os.Looper.loop(Looper.java:223)
E/flutter (23418):  at android.app.ActivityThread.main(ActivityThread.java:7656)
E/flutter (23418):  at java.lang.reflect.Method.invoke(Native Method)
E/flutter (23418):  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/flutter (23418):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/flutter (23418): )
E/flutter (23418): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653:7)
E/flutter (23418): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:296:18)
E/flutter (23418): <asynchronous suspension>
E/flutter (23418): #2      Fluttertoast.showToast (package:fluttertoast/fluttertoast.dart:101:17)
E/flutter (23418): <asynchronous suspension>
E/flutter (23418): #3      ReviewFundingView.build.<anonymous closure> (package:temanqu_member/app/modules/funding/review_funding/views/review_funding_view2.dart:228:31)
E/flutter (23418): <asynchronous suspension>
</code>```

I've tried adding await and increasing/decreasing the FlutterToast library version but nothing changes. How can I solve this problem? Thanks in advance for your help.

Body:
I'm trying to call FlutterToast when I tap on InkWell widget. But whenever I try to tap, the FlutterToast won't show up. This is my Inkwell code.

InkWell(
  onTap: () async {
    await Clipboard.setData(ClipboardData(
            text: controller.vaNumber.toString()));
    await Fluttertoast.showToast(
        msg: "This is Center Short Toast",
        toastLength: Toast.LENGTH_SHORT,
        gravity: ToastGravity.BOTTOM,
        backgroundColor: Colors.grey,
        textColor: Colors.black,
        fontSize: 16.0
    );
  },
  child: Text(
    'SALIN',
    style: TextStyle(
        decoration: TextDecoration.underline,
        color: Colors.green),
  ),
)

and this is my error message:

E/flutter (23418): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference, null, java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
E/flutter (23418):  at io.github.ponnamkarthik.toast.fluttertoast.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.kt:51)
E/flutter (23418):  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
E/flutter (23418):  at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/flutter (23418):  at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/flutter (23418):  at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/flutter (23418):  at android.os.Handler.handleCallback(Handler.java:938)
E/flutter (23418):  at android.os.Handler.dispatchMessage(Handler.java:99)
E/flutter (23418):  at android.os.Looper.loop(Looper.java:223)
E/flutter (23418):  at android.app.ActivityThread.main(ActivityThread.java:7656)
E/flutter (23418):  at java.lang.reflect.Method.invoke(Native Method)
E/flutter (23418):  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/flutter (23418):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/flutter (23418): )
E/flutter (23418): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653:7)
E/flutter (23418): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:296:18)
E/flutter (23418): <asynchronous suspension>
E/flutter (23418): #2      Fluttertoast.showToast (package:fluttertoast/fluttertoast.dart:101:17)
E/flutter (23418): <asynchronous suspension>
E/flutter (23418): #3      ReviewFundingView.build.<anonymous closure> (package:temanqu_member/app/modules/funding/review_funding/views/review_funding_view2.dart:228:31)
E/flutter (23418): <asynchronous suspension>

I've tried adding await and increasing/decreasing the FlutterToast library version but nothing changes. How can I solve this problem? Thanks in advance for your help.


问:
how to stop keyboard going down and coming up when using "readonly" parameter in text field in flutter
i'm building a 6 digit otp widget using 6 text fields. i want to design in such a way that only focused textfield has to editable and other textfields has be only to show data but shouldn't editable . for this i have used "readOnly" property to true . every thing works fine . but the when the focus is moving from one texfield to other textfield keyboard is going down and comming up . but i want keyboad has be on the screen without moving when i moved from one textifeld to other text field . Can anyone please help me with this? Your assistance would be greatly appreciated.

This is the code that i've written :

```<code>import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class OTPTextField extends StatefulWidget {
  const OTPTextField();

  @override
  OTPTextFieldState createState() => OTPTextFieldState();
}

class OTPTextFieldState extends State<OTPTextField> {
  final List<TextEditingController> _controllers =
      List.generate(6, (_) => TextEditingController());
  final List<FocusNode> _focusNodes = List.generate(6, (_) => FocusNode());

  FocusNode keyBoardFocus = FocusNode();

  final List<bool> _isActive = [true, false, false, false, false, false];
  late int previousIndex;

  void _onTextChanged(int index) {
    if (index != 5) {
      setState(() {
        _isActive[index] = !_isActive[index];
        _isActive[index + 1] = !_isActive[index + 1];
        print("this is from onTextChanged");
        print(_isActive);
      });
      FocusScope.of(context).requestFocus(_focusNodes[index + 1]);
    }
  }

  void onTextFieldTap() {
    final index = _isActive.indexOf(true);
    print("......" + index.toString() + ">>>>>>>");
    FocusScope.of(context).requestFocus(_focusNodes[index]);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: RawKeyboardListener(
        focusNode: keyBoardFocus,
        onKey: (keyEvent) {
          if (keyEvent.logicalKey == LogicalKeyboardKey.backspace &&
              keyEvent.runtimeType.toString() == "RawKeyDownEvent") {
            final index = _isActive.indexOf(true);
            print("this is triggered on keyboard listener on $index");
            if (index > 0) {
              setState(() {
                _isActive[index] = !_isActive[index];
                _isActive[index - 1] = !_isActive[index - 1];
                print(_isActive);
                FocusScope.of(context).requestFocus(_focusNodes[index - 1]);
                _controllers[index - 1].text = "";
              });
            }
          }
        },
        child: Center(
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: List.generate(6, (index) {
              return SizedBox(
                width: 35,
                height: 600,
                child: GestureDetector(
                  // behavior: HitTestBehavior.translucent,
                  onTap: () {
                    print("tap............tap,,,,,,,,,,");
                  },
                  child: TextField(
                    maxLength: 1,
                    autofocus: index == 0,
                    onTap: (() {
                      print("tap ..... tap.....");
                      onTextFieldTap();
                    }),
                    readOnly: !_isActive[index],
                    cursorColor: Colors.black,
                    cursorWidth: 2,
                    cursorRadius: const Radius.circular(5),
                    controller: _controllers[index],
                    focusNode: _focusNodes[index],
                    decoration: InputDecoration(
                      border: OutlineInputBorder(
                        borderRadius: BorderRadius.circular(5),
                      ),
                    ),
                    inputFormatters: [FilteringTextInputFormatter.digitsOnly],
                    keyboardType: TextInputType.number,
                    textInputAction: index == 5
                        ? TextInputAction.done
                        : TextInputAction.next,
                    onChanged: (value) => _onTextChanged(index),
                  ),
                ),
              );
            }),
          ),
        ),
      ),
    );
  }
}

</code>```

Body:
i'm building a 6 digit otp widget using 6 text fields. i want to design in such a way that only focused textfield has to editable and other textfields has be only to show data but shouldn't editable . for this i have used "readOnly" property to true . every thing works fine . but the when the focus is moving from one texfield to other textfield keyboard is going down and comming up . but i want keyboad has be on the screen without moving when i moved from one textifeld to other text field . Can anyone please help me with this? Your assistance would be greatly appreciated.

This is the code that i've written :

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class OTPTextField extends StatefulWidget {
  const OTPTextField();

  @override
  OTPTextFieldState createState() => OTPTextFieldState();
}

class OTPTextFieldState extends State<OTPTextField> {
  final List<TextEditingController> _controllers =
      List.generate(6, (_) => TextEditingController());
  final List<FocusNode> _focusNodes = List.generate(6, (_) => FocusNode());

  FocusNode keyBoardFocus = FocusNode();

  final List<bool> _isActive = [true, false, false, false, false, false];
  late int previousIndex;

  void _onTextChanged(int index) {
    if (index != 5) {
      setState(() {
        _isActive[index] = !_isActive[index];
        _isActive[index + 1] = !_isActive[index + 1];
        print("this is from onTextChanged");
        print(_isActive);
      });
      FocusScope.of(context).requestFocus(_focusNodes[index + 1]);
    }
  }

  void onTextFieldTap() {
    final index = _isActive.indexOf(true);
    print("......" + index.toString() + ">>>>>>>");
    FocusScope.of(context).requestFocus(_focusNodes[index]);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: RawKeyboardListener(
        focusNode: keyBoardFocus,
        onKey: (keyEvent) {
          if (keyEvent.logicalKey == LogicalKeyboardKey.backspace &&
              keyEvent.runtimeType.toString() == "RawKeyDownEvent") {
            final index = _isActive.indexOf(true);
            print("this is triggered on keyboard listener on $index");
            if (index > 0) {
              setState(() {
                _isActive[index] = !_isActive[index];
                _isActive[index - 1] = !_isActive[index - 1];
                print(_isActive);
                FocusScope.of(context).requestFocus(_focusNodes[index - 1]);
                _controllers[index - 1].text = "";
              });
            }
          }
        },
        child: Center(
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: List.generate(6, (index) {
              return SizedBox(
                width: 35,
                height: 600,
                child: GestureDetector(
                  // behavior: HitTestBehavior.translucent,
                  onTap: () {
                    print("tap............tap,,,,,,,,,,");
                  },
                  child: TextField(
                    maxLength: 1,
                    autofocus: index == 0,
                    onTap: (() {
                      print("tap ..... tap.....");
                      onTextFieldTap();
                    }),
                    readOnly: !_isActive[index],
                    cursorColor: Colors.black,
                    cursorWidth: 2,
                    cursorRadius: const Radius.circular(5),
                    controller: _controllers[index],
                    focusNode: _focusNodes[index],
                    decoration: InputDecoration(
                      border: OutlineInputBorder(
                        borderRadius: BorderRadius.circular(5),
                      ),
                    ),
                    inputFormatters: [FilteringTextInputFormatter.digitsOnly],
                    keyboardType: TextInputType.number,
                    textInputAction: index == 5
                        ? TextInputAction.done
                        : TextInputAction.next,
                    onChanged: (value) => _onTextChanged(index),
                  ),
                ),
              );
            }),
          ),
        ),
      ),
    );
  }
}


问:
How to filter a Json response using an array of strings in JavaScript which can change dynamically?
I have tried a lot but couldn't figure it out.

```<code>response = JSON.parse(this.responseText).user.filter(element => element.list == "State-CM" || element.list == "Ministers-Ministries")
</code>```

In the above code, I am filtering a Json response based on a fixed set of string values hard coded in the condition (element.list == "State-CM" || element.list == "Ministers-Ministries"). and it is working.

But I want to filter the Json based on a dynamic array (topics) which can change from time to time. Whatever values are there in the array, only those should be the filter criteria.

```<code>const topics = ["State-CM", "Ministers-Ministries","etc.","",.....];
</code>```

Body:
I have tried a lot but couldn't figure it out.

response = JSON.parse(this.responseText).user.filter(element => element.list == "State-CM" || element.list == "Ministers-Ministries")

In the above code, I am filtering a Json response based on a fixed set of string values hard coded in the condition (element.list == "State-CM" || element.list == "Ministers-Ministries"). and it is working.

But I want to filter the Json based on a dynamic array (topics) which can change from time to time. Whatever values are there in the array, only those should be the filter criteria.

const topics = ["State-CM", "Ministers-Ministries","etc.","",.....];


问:
Get the vertical scrollBar object of certain column in pyqt's QColumnView class
There is a QColumnView class as shown belown. I use QFileSystemModel as its data model.

As you can see, there are four columns and three vertical scroll bars and a horizontal scroll bar.
It's easy to get the horizontal scroll bar by using self.ui.columnView.horizontalScrollBar().
But when I use self.ui.columnView.verticalScrollBar() to get the vertical scroll bar, it doesn't work properly.
So I would like to know how to get certain column's scroll bar.

When I connect a function to the horizontal scroll bar's valueChanged event by self.ui.columnView.horizontalScrollBar().valueChanged.connect(self.sync) and I move the horizontal scroll bar, the self,sync is executed.
But when I use self.ui.columnView.verticalScrollBar().valueChanged.connect(self.sync), whatever vertical scroll bar I move, the self.sync cannot be executed.


问:
Changing Azure VM state machine
On an Azure environment can I un-generalized a VM to normal state again that I'll be able to use the VM?

When I try it I have an error message saying  that the VM is generalized.

Thanks in advance.

I needed to make a duplicate machine from this VM image, BUT since the machine was created without the options to delete the disks, seems like my option is to make another fresh machine, and change the name of it to something else.

I used this video.

https://www.youtube.com/watch?v=ukqbeiejLYE

But now I would like to use the generalized VM normally, can it be done?

Title: Changing Azure VM state machine


问:
Delphi DPR/Library path confusion (interference between D10 and D11)
I have Delphi 10.4 and Delphi 11.2. I find Delphi 11 too buggy to be used and I stick with my Delphi 10 (for the moment).

But Delphi 10 has also some bugs in its VCL, that were fixed in D11. So, I took Vcl.ExtCtrls.pas from D11 and copied into a separate folder (VCL_FIX). Then in Delphi 10, I include that file into my projects:

```<code>program MyProgram;

uses
  FastMM4,
  Forms,
  ...
  Vcl.ExtCtrls in 'C:\Packages\**VCL_FIX**\Alexandria_VCLs\Vcl.ExtCtrls.pas';
</code>```

The problem is that now, having D11 installed in parallel with D10, when I Ctrl+click the "Vcl.ExtCtrls" in the DPR file, it opens the real file from D11 ( c:\Delphi\Alexandria\source\vcl\ ), not the one from my "VCL_FIX" folder.

Why?

I don't understand how D10 gets access to D11 files... I thought they are individual installations.

And why the real D11 file takes precedence? The DPR clearly says that the file should be taken from VCL_FIX folder.

Body:
I have Delphi 10.4 and Delphi 11.2. I find Delphi 11 too buggy to be used and I stick with my Delphi 10 (for the moment).

But Delphi 10 has also some bugs in its VCL, that were fixed in D11. So, I took Vcl.ExtCtrls.pas from D11 and copied into a separate folder (VCL_FIX). Then in Delphi 10, I include that file into my projects:

program MyProgram;

uses
  FastMM4,
  Forms,
  ...
  Vcl.ExtCtrls in 'C:\Packages\**VCL_FIX**\Alexandria_VCLs\Vcl.ExtCtrls.pas';

The problem is that now, having D11 installed in parallel with D10, when I Ctrl+click the "Vcl.ExtCtrls" in the DPR file, it opens the real file from D11 ( c:\Delphi\Alexandria\source\vcl\ ), not the one from my "VCL_FIX" folder.

Why?

I don't understand how D10 gets access to D11 files... I thought they are individual installations.

And why the real D11 file takes precedence? The DPR clearly says that the file should be taken from VCL_FIX folder.


问:
Run (neo)vim motions, both insert and normal mode headlessly through commands with stdin
I'm creating a vim game where the purpose is to use vim motions to alter a buffer. It's a web game so I would have to emulate the inputs being sent from the client to the server, one challenge is going from insert mode to normal mode somehow. I'm running neovim behind an API, and this is how I'm able to run things from the app/frontend:

```<code>$ echo "foo" | nvim --headless --clean +"norm l" +"%print" +"echo getpos('.')" +q! -
</code>```

I'm echoing "foo" into vim and using the norm command to alter it.
Inside the +"norm l" command I'm able to input vim motions, in this case moving the cursor right one character.

It works well, however, it can only handle things through normal mode. If I were to input ifoo<Esc>, which for me would translate to i, foo and then hitting the escape key, <Esc> is treated as an literal. Same thing with <C-c> and jj.

```<code>$ echo "foo" | nvim --headless --clean +"norm ifoo<Esc>" +"%print" +"echo getpos('.')" +q! -
foo<Esc>foo
[0, 1, 8, 0]
</code>```

Is there a way to do this that I'm not seeing?

Body:
I'm creating a vim game where the purpose is to use vim motions to alter a buffer. It's a web game so I would have to emulate the inputs being sent from the client to the server, one challenge is going from insert mode to normal mode somehow. I'm running neovim behind an API, and this is how I'm able to run things from the app/frontend:

$ echo "foo" | nvim --headless --clean +"norm l" +"%print" +"echo getpos('.')" +q! -

I'm echoing "foo" into vim and using the norm command to alter it.
Inside the +"norm l" command I'm able to input vim motions, in this case moving the cursor right one character.

It works well, however, it can only handle things through normal mode. If I were to input ifoo<Esc>, which for me would translate to i, foo and then hitting the escape key, <Esc> is treated as an literal. Same thing with <C-c> and jj.

$ echo "foo" | nvim --headless --clean +"norm ifoo<Esc>" +"%print" +"echo getpos('.')" +q! -
foo<Esc>foo
[0, 1, 8, 0]

Is there a way to do this that I'm not seeing?


问:
NextJS | Cannot use import statement outside a module | availability-calendar-react
I'm trying to work with the package: availability-calendar-react in my react application, which uses NextJS.

When building the project, I'm getting the following error message:

```<code>/codebuild/output/src399936834/src/node_modules/availability-calendar-react/index.js:1
import CalendarTemplate from "./dist/Calendar";
^^^^^^

SyntaxError: Cannot use import statement outside a module
</code>```

I've added the "type": "module" and modified the import statement to:

```<code>const CalendarTemplate = dynamic(() => import('availability-calendar-react'), { ssr: false })
</code>```

Seems like the error is coming from the node_module of this package.
What can be done

added the "type": "module"

modified to:

```<code>const CalendarTemplate = dynamic(() => import('availability-calendar-react'), { ssr: false })
</code>```

Body:
I'm trying to work with the package: availability-calendar-react in my react application, which uses NextJS.

When building the project, I'm getting the following error message:

/codebuild/output/src399936834/src/node_modules/availability-calendar-react/index.js:1
import CalendarTemplate from "./dist/Calendar";
^^^^^^

SyntaxError: Cannot use import statement outside a module

I've added the "type": "module" and modified the import statement to:

const CalendarTemplate = dynamic(() => import('availability-calendar-react'), { ssr: false })

Seems like the error is coming from the node_module of this package.
What can be done

added the "type": "module"

modified to:

const CalendarTemplate = dynamic(() => import('availability-calendar-react'), { ssr: false })


问:
Pandas: highlight max value in multiindex
I have a dataframe with a multiindex looking like this:

The columns are: Index(['0.001', '0.01', '0.1'], dtype='object', name='Selectivity')

The index is:

```<code>MultiIndex([(        'Periodic', 'Adaptive Adaptive'),
            (        'Periodic',              'Alex'),
            (        'Periodic',           'BB-Tree'),
            (        'Periodic',               'CKD'),
            (        'Periodic',               'Elf'),
            (        'Periodic',           'Mlindex'),
            (        'Periodic',            'Quasii'),
            (      'Sequential', 'Adaptive Adaptive'),
            (      'Sequential',              'Alex'),
            (      'Sequential',           'BB-Tree'),
            (      'Sequential',               'CKD'),
            (      'Sequential',               'Elf'),
            (      'Sequential',           'Mlindex'),
            (      'Sequential',            'Quasii'),
            ( 'Sequential Zoom', 'Adaptive Adaptive'),
            ( 'Sequential Zoom',              'Alex'),
            ( 'Sequential Zoom',           'BB-Tree'),
            ( 'Sequential Zoom',               'CKD'),
            ( 'Sequential Zoom',               'Elf'),
            ( 'Sequential Zoom',           'Mlindex'),
            ( 'Sequential Zoom',            'Quasii'),
            (          'Skewed', 'Adaptive Adaptive'),
            (          'Skewed',              'Alex'),
            (          'Skewed',           'BB-Tree'),
            (          'Skewed',               'CKD'),
            (          'Skewed',               'Elf'),
            (          'Skewed',           'Mlindex'),
            (          'Skewed',            'Quasii'),
            (         'Uniform', 'Adaptive Adaptive'),
            (         'Uniform',              'Alex'),
            (         'Uniform',           'BB-Tree'),
            (         'Uniform',               'CKD'),
            (         'Uniform',               'Elf'),
            (         'Uniform',           'Mlindex'),
            (         'Uniform',            'Quasii'),
            (            'Zoom', 'Adaptive Adaptive'),
            (            'Zoom',              'Alex'),
            (            'Zoom',           'BB-Tree'),
            (            'Zoom',               'CKD'),
            (            'Zoom',               'Elf'),
            (            'Zoom',           'Mlindex'),
            (            'Zoom',            'Quasii'),
            ('Zoom Alternating', 'Adaptive Adaptive'),
            ('Zoom Alternating',              'Alex'),
            ('Zoom Alternating',           'BB-Tree'),
            ('Zoom Alternating',               'CKD'),
            ('Zoom Alternating',               'Elf'),
            ('Zoom Alternating',           'Mlindex'),
            ('Zoom Alternating',            'Quasii'),
            (        'Zufällig', 'Adaptive Adaptive'),
            (        'Zufällig',              'Alex'),
            (        'Zufällig',           'BB-Tree'),
            (        'Zufällig',               'CKD'),
            (        'Zufällig',               'Elf'),
            (        'Zufällig',           'Mlindex'),
            (        'Zufällig',            'Quasii')],
           names=['Workload', 'Indexstruktur'])
</code>```

What I want to achieve is that it highlights the maximum value for the entire block within each workload. So there is one maximum value for "Periodic", one for "Sequential" and so on.

Currently, I have this code:

```<code>df_style = df_tab.style
df_style.highlight_max(color="lightgreen", axis=0)
</code>```

I know I can alter the value of axis between 0 and 1, and I can also set a subset, but only on selectivity values.

Is there a smart way to do this for the multiindex?

Body:
I have a dataframe with a multiindex looking like this:

The columns are: Index(['0.001', '0.01', '0.1'], dtype='object', name='Selectivity')

The index is:

MultiIndex([(        'Periodic', 'Adaptive Adaptive'),
            (        'Periodic',              'Alex'),
            (        'Periodic',           'BB-Tree'),
            (        'Periodic',               'CKD'),
            (        'Periodic',               'Elf'),
            (        'Periodic',           'Mlindex'),
            (        'Periodic',            'Quasii'),
            (      'Sequential', 'Adaptive Adaptive'),
            (      'Sequential',              'Alex'),
            (      'Sequential',           'BB-Tree'),
            (      'Sequential',               'CKD'),
            (      'Sequential',               'Elf'),
            (      'Sequential',           'Mlindex'),
            (      'Sequential',            'Quasii'),
            ( 'Sequential Zoom', 'Adaptive Adaptive'),
            ( 'Sequential Zoom',              'Alex'),
            ( 'Sequential Zoom',           'BB-Tree'),
            ( 'Sequential Zoom',               'CKD'),
            ( 'Sequential Zoom',               'Elf'),
            ( 'Sequential Zoom',           'Mlindex'),
            ( 'Sequential Zoom',            'Quasii'),
            (          'Skewed', 'Adaptive Adaptive'),
            (          'Skewed',              'Alex'),
            (          'Skewed',           'BB-Tree'),
            (          'Skewed',               'CKD'),
            (          'Skewed',               'Elf'),
            (          'Skewed',           'Mlindex'),
            (          'Skewed',            'Quasii'),
            (         'Uniform', 'Adaptive Adaptive'),
            (         'Uniform',              'Alex'),
            (         'Uniform',           'BB-Tree'),
            (         'Uniform',               'CKD'),
            (         'Uniform',               'Elf'),
            (         'Uniform',           'Mlindex'),
            (         'Uniform',            'Quasii'),
            (            'Zoom', 'Adaptive Adaptive'),
            (            'Zoom',              'Alex'),
            (            'Zoom',           'BB-Tree'),
            (            'Zoom',               'CKD'),
            (            'Zoom',               'Elf'),
            (            'Zoom',           'Mlindex'),
            (            'Zoom',            'Quasii'),
            ('Zoom Alternating', 'Adaptive Adaptive'),
            ('Zoom Alternating',              'Alex'),
            ('Zoom Alternating',           'BB-Tree'),
            ('Zoom Alternating',               'CKD'),
            ('Zoom Alternating',               'Elf'),
            ('Zoom Alternating',           'Mlindex'),
            ('Zoom Alternating',            'Quasii'),
            (        'Zufällig', 'Adaptive Adaptive'),
            (        'Zufällig',              'Alex'),
            (        'Zufällig',           'BB-Tree'),
            (        'Zufällig',               'CKD'),
            (        'Zufällig',               'Elf'),
            (        'Zufällig',           'Mlindex'),
            (        'Zufällig',            'Quasii')],
           names=['Workload', 'Indexstruktur'])

What I want to achieve is that it highlights the maximum value for the entire block within each workload. So there is one maximum value for "Periodic", one for "Sequential" and so on.

Currently, I have this code:

df_style = df_tab.style
df_style.highlight_max(color="lightgreen", axis=0)

I know I can alter the value of axis between 0 and 1, and I can also set a subset, but only on selectivity values.

Is there a smart way to do this for the multiindex?


问:
Angular 15 Material Tab Control: Is it possible to auto scroll content only?
With Angular Material 15, is it possible to keep the tab control tabs in view when the content overflows and apply scrollbars to the content only?

View on Stackblitz

I've previously rejected the use of Material Tab Control as it didn't work well with Flex Layout. As @angular/flex-layout is now deprecated, I've given this another go using CSS Flexbox. However, I can't work out how to add scrollbars to the content only when the content overflows.

The issue is described here but the Stackblitz links are no longer working and the solution proposed by liviu-nita seems like a less than ideal work-around.

Dynamic height seems to be irrelevant to the issue, and I've not been able to adapt the answer here.

Demo of the issue on Stackblitz

How the control is rendered:


问:
How to upload a video in comments using Facebook Graph Api
I've been trying this for so long, but i can't achieve it...

If i upload a video in /comment node it always spits me this error:

```<code>{"error":{"message":"(#200) Permissions error","type":"OAuthException","code":200,"fbtrace_id":"..."}}
</code>```

If i'm going to upload images it just works fine.

This is my curl request so far..

```<code>curl -svX POST "https://graph.facebook.com/v15.0/{obj_id}/comments?access_token=EAA..." -F "message=Hello World!" -F "source=@./sample.mp4"
</code>```

Body:
I've been trying this for so long, but i can't achieve it...

If i upload a video in /comment node it always spits me this error:

{"error":{"message":"(#200) Permissions error","type":"OAuthException","code":200,"fbtrace_id":"..."}}

If i'm going to upload images it just works fine.

This is my curl request so far..

curl -svX POST "https://graph.facebook.com/v15.0/{obj_id}/comments?access_token=EAA..." -F "message=Hello World!" -F "source=@./sample.mp4"